mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
nc refuckulating
This commit is contained in:
parent
28f71f49e1
commit
4f4bbf73e8
16 changed files with 142 additions and 58 deletions
|
|
@ -11,7 +11,7 @@ function (User, Channel, PipeToChannel, Nc, Settings) {
|
|||
function Coordinator() {
|
||||
this.channelPipes = {};
|
||||
|
||||
Nc.on('coordinator/message', this.onMessage, this);
|
||||
Nc.on(Nc.ns.server.events.controlCommand + "coordinator", this.onMessage, this);
|
||||
|
||||
console.checkpoint('create Coordinator');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ function (Nc, childProcess) {
|
|||
}
|
||||
|
||||
PipeToChannel.prototype.onMessage = function (message) {
|
||||
Nc.trigger(message.recipient + '/message', message.data);
|
||||
Nc.trigger(Nc.ns.server.events.controlCommand + message.recipient, message.data);
|
||||
}
|
||||
|
||||
return PipeToChannel;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue