diff options
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(){ |
