nc refuckulating

This commit is contained in:
logsol 2014-03-17 21:46:19 +01:00
parent 28f71f49e1
commit 4f4bbf73e8
16 changed files with 142 additions and 58 deletions

View file

@ -16,7 +16,7 @@ function (Parent, ProtocolHelper, Nc) {
socketLink.on('message', this.onMessage.bind(this));
socketLink.on('disconnect', this.onDisconnect.bind(this));
Nc.on("user/" + this.socketLink.id + "/message", this.socketLink.send, this.socketLink);
Nc.on(Nc.ns.server.to.client.message.send + id, this.socketLink.send, this.socketLink);
}
User.prototype = Object.create(Parent.prototype);
@ -73,7 +73,7 @@ function (Parent, ProtocolHelper, Nc) {
User.prototype.onPing = function(timestamp) {
var message = ProtocolHelper.encodeCommand("pong", timestamp);
Nc.trigger("user/" + this.socketLink.id + "/message", message);
Nc.trigger(Nc.ns.server.to.client.message.send + id, message);
};
return User;