This commit is contained in:
Jeena 2014-02-24 19:26:31 +01:00
parent 695008afd8
commit aa4535cb0c
10 changed files with 73 additions and 32 deletions

View file

@ -104,11 +104,17 @@
}
Channel.prototype.broadcastGameCommand = function (command, options) {
this.broadcastControlCommand("gameCommand", ProtocolHelper.encodeCommand(command, options));
for(var id in this.users) {
this.users[id].sendGameCommand(command, options);
}
}
Channel.prototype.broadcastGameCommandExcept = function (command, options, exceptUser) {
this.broadcastControlCommandExcept("gameCommand", ProtocolHelper.encodeCommand(command, options), exceptUser);
for(var id in this.users) {
if (id != exceptUser.id) {
this.users[id].sendGameCommand(command, options);
}
}
}
return Channel;