summaryrefslogtreecommitdiff
path: root/server.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2013-03-04 18:03:56 -0500
committerJules Laplace <jules@okfoc.us>2013-03-04 18:03:56 -0500
commitd7d98db072fee588a095224c5210def75213dec5 (patch)
tree5583382da5f6b6edebcbe77a26fa8f79f2522a7d /server.js
parent3c88fe5742f6e017a7e32a348f69b582a6709927 (diff)
slight delay on join/part so we don't clobber game state
Diffstat (limited to 'server.js')
-rw-r--r--server.js4
1 files changed, 2 insertions, 2 deletions
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;