From d7d98db072fee588a095224c5210def75213dec5 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 4 Mar 2013 18:03:56 -0500 Subject: slight delay on join/part so we don't clobber game state --- server.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'server.js') diff --git a/server.js b/server.js index 87a3da4..f5170c1 100644 --- a/server.js +++ b/server.js @@ -129,9 +129,9 @@ Channel.prototype.setTimeout = function( callback, delay ){ // Someone joined/left, so either start a game or stop it. Channel.prototype.checkState = function(){ if ( this.hasEnoughPlayers() ) { - if (this.state <= State.WAITING) this.startDrawing(); + if (this.state <= State.WAITING) this.setTimeout( this.startDrawing, 2000); } - else if (this.state > State.WAITING) this.startWaiting(); + else if (this.state > State.WAITING) this.setTimeout( this.startWaiting, 2000); } Channel.prototype.hasEnoughPlayers = function(){ var count = 0; -- cgit v1.2.3-70-g09d2