From 9029f4547056b096dfb9296d3eb69948f889ba23 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Sat, 6 Jun 2020 08:47:27 -0700 Subject: [PATCH] Properly JSON-stingify move before broadcasting it With the Tic Tac Toe game, this bug was hidden, (since the move data is just an integer and there's no difference in strignifying that or not). But an upcoming game (Scribe) uses a pair of integers, and there's a lot of difference between "1,2" and "[1,2]" since only the latter is proper JSON. --- game.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/game.js b/game.js index bf74de4..eb78f31 100644 --- a/game.js +++ b/game.js @@ -306,7 +306,7 @@ class Game { } broadcast_move(move) { - this.broadcast_event("move", move); + this.broadcast_event("move", JSON.stringify(move)); } } -- 2.43.0