this.rpc = new WebsocketRpc(this.websocket);
// Clients address
- this.real_address = this.websocket.kiwi.real_address;
+ this.real_address = this.websocket.meta.real_address;
// A hash to identify this client instance
this.hash = crypto.createHash('sha256')
});
this.disposed = false;
+
+ // Let the client know it's finished connecting
+ this.sendKiwiCommand('connected');
};
util.inherits(Client, events.EventEmitter);
};
function handleClientMessage(msg, callback) {
- var server;
+ var that = this,
+ server;
// Make sure we have a server number specified
if ((msg.server === null) || (typeof msg.server !== 'number')) {
}
// Run the client command
- this.client_commands.run(msg.data.method, msg.data.args, server, callback);
+ global.modules.emit('client command', {
+ command: msg.data,
+ server: server
+ })
+ .done(function() {
+ that.client_commands.run(msg.data.method, msg.data.args, server, callback);
+ });
}
global.config.restrict_server_ssl :
command.ssl),
command.nick,
- {hostname: this.websocket.kiwi.revdns, address: this.websocket.kiwi.real_address},
+ {hostname: this.websocket.meta.revdns, address: this.websocket.meta.real_address},
options,
callback);
} else {