Permalink
Browse files

Fixed bugs with disconnection.

  • Loading branch information...
1 parent 9fecfec commit ee1b05ef242038a2b8d8fd2bf2099e2277cb7cea @mcantelon committed Jul 23, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 app.js
View
5 app.js
@@ -36,10 +36,11 @@ io.set('log level', 1);
io.sockets.on('connection', function (socket) {
socket.join('Lobby');
+ socket.emit('joinResult', {room: 'Lobby'});
- socket.on('disconnect', function(socket) {
+ socket.on('disconnect', function() {
nameIndex = namesUsed.indexOf(nickNames[socket.id]);
- delete nameUsed[nameIndex];
+ delete namesUsed[nameIndex];
delete nickNames[socket.id];
});

0 comments on commit ee1b05e

Please sign in to comment.