missing socketio fix
This commit is contained in:
parent
ff9a2a687f
commit
703440acd7
|
@ -496,14 +496,19 @@ function handleSuggestUserName(client, message)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var padId = sessioninfos[client.id].padId,
|
var padId = sessioninfos[client.id].padId;
|
||||||
clients = socketio.sockets.clients(padId);
|
var roomClients = [], room = socketio.sockets.adapter.rooms[padId];
|
||||||
|
if (room) {
|
||||||
|
for (var id in room) {
|
||||||
|
roomClients.push(socketio.sockets.adapter.nsp.connected[id]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//search the author and send him this message
|
//search the author and send him this message
|
||||||
for(var i = 0; i < clients.length; i++) {
|
for(var i = 0; i < roomClients.length; i++) {
|
||||||
var session = sessioninfos[clients[i].id];
|
var session = sessioninfos[roomClients[i].id];
|
||||||
if(session && session.author == message.data.payload.unnamedId) {
|
if(session && session.author == message.data.payload.unnamedId) {
|
||||||
clients[i].json.send(message);
|
roomClients[i].json.send(message);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue