Some improvements on message handling, on client and serverside

This commit is contained in:
Peter 'Pita' Martischka 2011-03-27 12:49:04 +01:00
parent c563faf431
commit f28a5c18c6
3 changed files with 47 additions and 11 deletions

View file

@ -346,6 +346,19 @@ function handleClientReady(client, message)
//Ask the author Manager for a authorname of this token.
var author = authorManager.getAuthor4Token(message.token);
//Check if this author is already on the pad, if yes, kick him!
if(pad2sessions[message.padId])
{
for(var i in pad2sessions[message.padId])
{
if(sessioninfos[pad2sessions[message.padId][i]].author == author)
{
client.send({disconnect:"doublelogin"});
return;
}
}
}
//Save in session2pad that this session belonges to this pad
var sessionId=String(client.sessionId);
session2pad[sessionId] = message.padId;