Changing behavior of the same user on a pad. Kick old sessions instead of refusing new

This commit is contained in:
Peter 'Pita' Martischka 2011-06-04 18:02:22 +01:00
parent bf32c18d8d
commit b692ffec0b
2 changed files with 18 additions and 30 deletions

View file

@ -520,15 +520,14 @@ function handleClientReady(client, message)
},
function(callback)
{
//Check if this author is already on the pad, if yes, kick him!
//Check if this author is already on the pad, if yes, kick the other sessions!
if(pad2sessions[message.padId])
{
for(var i in pad2sessions[message.padId])
{
if(sessioninfos[pad2sessions[message.padId][i]].author == author)
{
client.send({disconnect:"doublelogin"});
return;
socketio.clients[pad2sessions[message.padId][i]].send({disconnect:"doublelogin"});
}
}
}