this.scores[playerID] = score;
- this.pendingEvents.push(
- {
- players: [{
- player: player,
- score: score
- }]
- }
- );
+ this.pendingEvents.push({
+ players: [{
+ player: player,
+ score: score
+ }]
+ });
};
Game.prototype.playerJoined = function (playerName) {
};
Game.prototype.commit = function () {
- const pendingEvents = this.pendingEvents;
+ const msg = JSON.stringify(this.pendingEvents);
this.pendingEvents = [];
- const msg = JSON.stringify(pendingEvents);
for (let i = 0; i < this.listeningPlayers.length; i++) {
while (i < this.listeningPlayers.length && !this.listeningPlayers[i]) {
const initialRackCount = countTiles(rack);
const rackCount = countTiles(cmd.rack);
- debuglog(rack, cmd.rack);
-
if (initialRackCount !== rackCount) {
response.write(
JSON.stringify({
};
for (const i in mimes) {
- if (request.url.endsWith(i)) {
+ if (Object.prototype.hasOwnProperty.call(mimes, i) && request.url.endsWith(i)) {
mime = mimes[i];
break;
}