diff options
| author | Jules Laplace <jules@okfoc.us> | 2013-03-04 15:49:05 -0500 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2013-03-04 15:49:05 -0500 |
| commit | 8cc16aaa52e0ea7670a9a7e8bdca9deb002012e3 (patch) | |
| tree | 1c6b5a08745e1fe83b1289e083019019f7cc2c11 | |
| parent | 632a7220c2afdc99ae5942b919b42621a9c5df47 (diff) | |
fix
| -rw-r--r-- | server.js | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -84,7 +84,7 @@ function Channel() { this.word = ""; this.timer = null; } -Channel.prototype.join = function(user, socket.id){ +Channel.prototype.join = function(user, socket){ this.playerCount++; } Channel.prototype.part = function(){ @@ -166,7 +166,7 @@ var game = new Channel (); io.sockets.on( 'connection', function(socket){ socket.emit( 'event-welcome', game.report() ); socket.on( 'event-join', function(data){ - game.join(data); + game.join(data, socket); game.checkState(); socket.broadcast.emit('event-join', data); } ); @@ -175,7 +175,7 @@ io.sockets.on( 'connection', function(socket){ socket.broadcast.emit('event-message', data); } ); socket.on( 'disconnect', function(data){ - game.part(data); + game.part(data, socket); game.checkState(); socket.broadcast.emit('event-part', data); } ); |
