fix room client leave

pull/2295/head
John McLear 2014-11-04 22:34:43 +00:00
parent 8391f902fb
commit af3e8e5e15
1 changed files with 7 additions and 3 deletions

View File

@ -1021,8 +1021,13 @@ function handleClientReady(client, message)
return callback(); return callback();
//Check if this author is already on the pad, if yes, kick the other sessions! //Check if this author is already on the pad, if yes, kick the other sessions!
/* var roomClients = [], room = socketio.sockets.adapter.rooms[pad.id];
var roomClients = socketio.sockets.clients(padIds.padId); if (room) {
for (var id in room) {
roomClients.push(socketio.sockets.adapter.nsp.connected[id]);
}
}
for(var i = 0; i < roomClients.length; i++) { for(var i = 0; i < roomClients.length; i++) {
var sinfo = sessioninfos[roomClients[i].id]; var sinfo = sessioninfos[roomClients[i].id];
if(sinfo && sinfo.author == author) { if(sinfo && sinfo.author == author) {
@ -1032,7 +1037,6 @@ function handleClientReady(client, message)
roomClients[i].json.send({disconnect:"userdup"}); roomClients[i].json.send({disconnect:"userdup"});
} }
} }
*/
//Save in sessioninfos that this session belonges to this pad //Save in sessioninfos that this session belonges to this pad
sessioninfos[client.id].padId = padIds.padId; sessioninfos[client.id].padId = padIds.padId;