From 8f590459ffa33a6d98a682269753a621c98eeeac Mon Sep 17 00:00:00 2001 From: tjperr Date: Tue, 1 Dec 2020 21:49:50 +0000 Subject: [PATCH 1/4] round --- src/server/game.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/server/game.js b/src/server/game.js index 4e2eb41..3f7107f 100644 --- a/src/server/game.js +++ b/src/server/game.js @@ -113,9 +113,10 @@ export class Game { this.log('getViewDrawing'); const round = this.getCurrentRound(); if (!round) { + console.log('getViewDrawing:getCurrentRound returned null'); return null; } - return this.getCurrentTurn().getDrawing(); + return round.getCurrentTurn().getDrawing(); } // get the captions from the current turn From 9369f3c70b05b3f77b8be882c3d752f1427acc75 Mon Sep 17 00:00:00 2001 From: tjperr Date: Tue, 1 Dec 2020 22:31:49 +0000 Subject: [PATCH 2/4] logs --- src/server/game.js | 6 +++++- src/server/turn.js | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/server/game.js b/src/server/game.js index 3f7107f..0d575b1 100644 --- a/src/server/game.js +++ b/src/server/game.js @@ -113,7 +113,7 @@ export class Game { this.log('getViewDrawing'); const round = this.getCurrentRound(); if (!round) { - console.log('getViewDrawing:getCurrentRound returned null'); + this.log('getViewDrawing:getCurrentRound returned null'); return null; } return round.getCurrentTurn().getDrawing(); @@ -262,6 +262,10 @@ export class Game { startCaptionPhase() { this.cancelCountdown(); + + if (!this.getCurrentRound().allDrawingsIn()) { + this.log('Caption phase started but not all drawings in'); + } this._phase = PHASES.CAPTION; this.log('Time to caption these masterpieces!'); diff --git a/src/server/turn.js b/src/server/turn.js index 174bd98..e22904f 100644 --- a/src/server/turn.js +++ b/src/server/turn.js @@ -45,6 +45,9 @@ export class Turn { } submitDrawing(drawing) { + if (drawing === null) { + this.log('null drawing submitted to turn'); + } this._drawing = drawing; this._drawingSubmitted = true; } From 2b5d46edfcf0679bf8ee5d6b1015cf0fa77bb224 Mon Sep 17 00:00:00 2001 From: tjperr Date: Tue, 1 Dec 2020 22:39:59 +0000 Subject: [PATCH 3/4] simplify logging --- src/server/game.js | 1 - src/server/player.js | 7 +++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/server/game.js b/src/server/game.js index 0d575b1..88523eb 100644 --- a/src/server/game.js +++ b/src/server/game.js @@ -373,7 +373,6 @@ export class Game { // syncs players state for all players in the game sync() { this.log('syncing all players, current game plan:'); - this.log(this.gameplan); this._players.forEach((player) => { player.sync(); }); diff --git a/src/server/player.js b/src/server/player.js index 788fff6..d78001c 100644 --- a/src/server/player.js +++ b/src/server/player.js @@ -124,8 +124,11 @@ export class Player { .update(JSON.stringify(data.viewDrawing)) .digest('hex'), }; - this.log('sync:'); - this.log(stripped); + if (data.timeRemaining === data.timerDuration) { + this.log('sync:'); + this.log(this._game && this._game.gameplan); + this.log(stripped); + } this.emit('sync', data); } From 0f45ab4fee4ceb4a4137526795aacbf269ed164a Mon Sep 17 00:00:00 2001 From: tjperr Date: Fri, 4 Dec 2020 12:28:38 +0000 Subject: [PATCH 4/4] log --- src/server/game.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/server/game.js b/src/server/game.js index a01a8c2..ba20b78 100644 --- a/src/server/game.js +++ b/src/server/game.js @@ -365,7 +365,8 @@ export class Game { // syncs players state for all players in the game sync() { - this.log('syncing all players:'); + this.log('syncing all players, current game plan:'); + this.log(this._gameplan); this._players.forEach((player) => { player.sync();