changed function( to function (

This commit is contained in:
logsol 2012-07-28 13:38:31 +02:00
parent 26f3d22db7
commit 7e5eeb0a27
36 changed files with 209 additions and 209 deletions

View file

@ -4,7 +4,7 @@ define([
"child_process"
],
function(User, Channel, childProcess) {
function (User, Channel, childProcess) {
var fork = childProcess.fork;
@ -13,19 +13,19 @@ function(User, Channel, childProcess) {
this.lobbyUsers = {};
}
Coordinator.prototype.createUser = function(socketLink){
Coordinator.prototype.createUser = function (socketLink){
var user = new User(socketLink, this);
this.assignUserToLobby(user);
}
Coordinator.prototype.assignUserToLobby = function(user){
Coordinator.prototype.assignUserToLobby = function (user){
if(user.channelProcess) {
//user.channel.releaseUser(user); -> generate message
}
this.lobbyUsers[user.id] = user;
}
Coordinator.prototype.assignUserToChannel = function(user, channelName){
Coordinator.prototype.assignUserToChannel = function (user, channelName){
if(user.channelProcess) {
//user.channel.releaseUser(user); -> generate message
@ -62,7 +62,7 @@ function(User, Channel, childProcess) {
delete this.lobbyUsers[user.id];
}
Coordinator.prototype.removeUser = function(user){
Coordinator.prototype.removeUser = function (user){
delete this.lobbyUsers[user.id];
if(user.channelProcess) {
//user.channel.releaseUser(user); -> generate message

View file

@ -3,7 +3,7 @@ define([
"Game/Core/Protocol/Helper"
],
function(Parent, ProtocolHelper) {
function (Parent, ProtocolHelper) {
function User(socketLink, coordinator) {
Parent.call(this, socketLink.id);
@ -13,32 +13,32 @@ function(Parent, ProtocolHelper) {
var self = this;
socketLink.on('message', function(message){
socketLink.on('message', function (message){
self.onMessage(message);
});
socketLink.on('disconnect', function(){
socketLink.on('disconnect', function (){
self.onDisconnect();
});
}
User.prototype = Object.create(Parent.prototype);
User.prototype.setChannelProcess = function(channelProcess) {
User.prototype.setChannelProcess = function (channelProcess) {
this.channelProcess = channelProcess;
}
User.prototype.onMessage = function(message){
User.prototype.onMessage = function (message){
var self = this;
ProtocolHelper.runCommands(message, function(command, options){
ProtocolHelper.runCommands(message, function (command, options){
self.processControlCommand(command, options);
});
}
User.prototype.onDisconnect = function(){
User.prototype.onDisconnect = function (){
this.coordinator.removeUser(this);
}
User.prototype.processControlCommand = function(command, options){
User.prototype.processControlCommand = function (command, options){
switch(command) {
case 'join':