update of client data by server

This commit is contained in:
Jeena Paradies 2012-07-13 22:49:15 +02:00
parent 2cb401bbd3
commit c8d0a48489
11 changed files with 239 additions and 120 deletions

View file

@ -58,7 +58,13 @@ define(["Protocol/Helper", "Chuck/ClientGame"], function(ProtocolHelper, ClientG
Networker.prototype.onUserJoined = function(userId) {
this.clientGame.userJoined(userId);
console.log("User " + userId + " joined");
};
}
Networker.prototype.sendGameCommand = function(command, options) {
var message = {};
message[command] = options || true;
this.sendCommand('gameCommand', message);
}
Networker.prototype.processControlCommand = function(command, options) {
switch(command) {
@ -67,7 +73,9 @@ define(["Protocol/Helper", "Chuck/ClientGame"], function(ProtocolHelper, ClientG
break;
case 'gameCommand':
this.clientGame.processGameCommand(options);
for(var c in options) {
this.clientGame.processGameCommand(c, options[c]);
}
break;
case 'userJoined':