mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
Added spawning gameCommand logic
This commit is contained in:
parent
371592f167
commit
fb5de522e5
8 changed files with 84 additions and 59 deletions
|
|
@ -13,7 +13,7 @@ function(Parent, NotificationCenter, ProtocolHelper) {
|
|||
this.player = null;
|
||||
var self = this;
|
||||
|
||||
NotificationCenter.on('user/joined', function(user) {
|
||||
NotificationCenter.on('user/joined', function(user) { // FIXME: use sendToAllUsersExcept instead
|
||||
if(user.id != self.id) {
|
||||
self.sendControlCommand("userJoined", user.id);
|
||||
}
|
||||
|
|
@ -23,7 +23,7 @@ function(Parent, NotificationCenter, ProtocolHelper) {
|
|||
self.sendControlCommand("joinSuccess", options);
|
||||
});
|
||||
|
||||
NotificationCenter.on('user/' + this.id + "/controlCommand", function(message) { // FIXME: right now only game commands?
|
||||
NotificationCenter.on('user/' + this.id + "/controlCommand", function(message) {
|
||||
ProtocolHelper.applyCommand(message.data, self);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue