mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
NC refactoring
This commit is contained in:
parent
28f71f49e1
commit
96bf9bffbd
24 changed files with 69 additions and 69 deletions
|
|
@ -50,7 +50,7 @@
|
|||
var self = this;
|
||||
|
||||
if(!this.gameController.level || !this.gameController.level.isLoaded) {
|
||||
var token = Nc.on("game/level/loaded", function() {
|
||||
var token = Nc.on(Nc.ns.core.game.events.level.loaded, function() {
|
||||
self.sendJoinSuccess(options);
|
||||
Nc.off(token);
|
||||
});
|
||||
|
|
@ -82,14 +82,14 @@
|
|||
|
||||
//Nc.trigger('user/' + user.id + "/joinSuccess", options);
|
||||
user.sendControlCommand("joinSuccess", options);
|
||||
Nc.trigger('user/joined', user);
|
||||
Nc.trigger(Nc.ns.channel.events.user.joined, user);
|
||||
|
||||
this.broadcastControlCommandExcept("userJoined", user.options, user);
|
||||
};
|
||||
|
||||
Channel.prototype.onReleaseUser = function (userId) {
|
||||
var user = this.users[userId];
|
||||
Nc.trigger('user/left', userId);
|
||||
Nc.trigger(Nc.ns.channel.events.user.left, userId);
|
||||
delete this.users[userId];
|
||||
|
||||
this.broadcastControlCommand("userLeft", userId);
|
||||
|
|
|
|||
|
|
@ -20,8 +20,8 @@ function (Parent, PhysicsEngine, Settings, PlayerController, requestAnimFrame, N
|
|||
|
||||
Parent.call(this);
|
||||
|
||||
Nc.on('user/joined', this.onUserJoined, this);
|
||||
Nc.on('user/left', this.onUserLeft, this);
|
||||
Nc.on(Nc.ns.channel.events.user.joined, this.onUserJoined, this);
|
||||
Nc.on(Nc.ns.channel.events.user.left, this.onUserLeft, this);
|
||||
Nc.on('user/resetLevel', this.onResetLevel, this);
|
||||
Nc.on('user/clientReady', this.onClientReady, this);
|
||||
Nc.on('player/killed', this.onPlayerKilled, this);
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ function (Nc, Channel) {
|
|||
};
|
||||
|
||||
PipeToServer.prototype.onMessage = function (message) {
|
||||
Nc.trigger(message.recipient + '/controlCommand', message);
|
||||
Nc.trigger(Nc.ns.channel.events.controlCommand + recipient, message);
|
||||
}
|
||||
|
||||
PipeToServer.prototype.destroy = function() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue