This commit is contained in:
Kewin Brandsma 2016-10-04 21:08:42 +02:00
parent 15e628b528
commit 03077e308a
2 changed files with 6 additions and 5 deletions

View file

@ -222,8 +222,8 @@ function connect(){
if (message.type === '__identify') { if (message.type === '__identify') {
client.emit('__identify', { client.emit('__identify', {
id: client.id, id: client.config.id
path: client.path //path: client.path
}); });
continue; continue;
} }

View file

@ -248,11 +248,12 @@ function serverCreated(socket) {
); );
} else { } else {
this.on('__identify', function(clientDetails) { this.on('__identify', function(clientDetails) {
var id = clientDetails.id; var id = clientDetails.id,
clientConfig = Object.assign(this.config, {id: clientDetails.id, path: clientDetails.path});
this.of[id] = new Client(this.config, this.log, socket); this.of[id] = new Client(clientConfig, this.log, socket);
this.of[id].id = id; this.of[id].id = id;
this.of[id].path = clientDetails.path; this.of[id].path = clientConfig.path;
this.of[id].on('disconnect', function() { this.of[id].on('disconnect', function() {
delete this.of[id]; delete this.of[id];