summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2013-03-04 15:49:05 -0500
committerJules Laplace <jules@okfoc.us>2013-03-04 15:49:05 -0500
commit8cc16aaa52e0ea7670a9a7e8bdca9deb002012e3 (patch)
tree1c6b5a08745e1fe83b1289e083019019f7cc2c11
parent632a7220c2afdc99ae5942b919b42621a9c5df47 (diff)
fix
-rw-r--r--server.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/server.js b/server.js
index e731c34..482638b 100644
--- a/server.js
+++ b/server.js
@@ -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);
} );