mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 18:47:35 +00:00
update of client data by server
This commit is contained in:
parent
2cb401bbd3
commit
c8d0a48489
11 changed files with 239 additions and 120 deletions
|
|
@ -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':
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue