From a45ae4e59de9d8d2934c233eb3decc300d9078bd Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 5 Mar 2013 03:24:00 -0500 Subject: the word is .... --- server.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'server.js') diff --git a/server.js b/server.js index 32b5849..e70efa5 100644 --- a/server.js +++ b/server.js @@ -83,7 +83,7 @@ function Channel() { this.images = {}; this.imageCount = 0; this.votes = {}; - this.voters = {}; + this.scores = {}; this.voteCount = 0; this.word = ""; this.timer = null; @@ -110,7 +110,7 @@ Channel.prototype.getState = function(){ word: this.word, players: this.players, images: this.images, - votes: this.votes, + scores: this.scores, voteCount: this.voteCount, imageCount: this.imageCount, }; @@ -156,8 +156,8 @@ Channel.prototype.pushImage = function(image){ Channel.prototype.addVote = function(data, user){ if (data.nick in this.images && not( user.nick in this.voters )) { this.voteCount++; - this.voters[ user.nick ] = true; - this.votes[ data.nick ] += 1; + this.votes[ user.nick ] = true; + this.scores[ data.nick ] += 1; if (this.voteCount == this.playerCount) this.startWinning(); } } @@ -166,7 +166,7 @@ Channel.prototype.reset = function(){ this.images = {}; this.imageCount = 0; this.votes = {}; - this.voters = {}; + this.scores = {}; this.voteCount = 0; } Channel.prototype.startDrawing = function(){ -- cgit v1.2.3-70-g09d2