diff options
| author | Jules Laplace <jules@okfoc.us> | 2013-03-05 03:24:00 -0500 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2013-03-05 03:24:00 -0500 |
| commit | a45ae4e59de9d8d2934c233eb3decc300d9078bd (patch) | |
| tree | f2e9f521b8331bbaa37861e6cb9acbae326e5274 /server.js | |
| parent | dba03a90555d9f8516551ddf2e1758c37ca60c25 (diff) | |
the word is ....
Diffstat (limited to 'server.js')
| -rw-r--r-- | server.js | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -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(){ |
