From: Carl Worth Date: Sat, 6 Jun 2020 15:47:27 +0000 (-0700) Subject: Properly JSON-stingify move before broadcasting it X-Git-Url: https://git.cworth.org/git?p=empires-server;a=commitdiff_plain;h=9029f4547056b096dfb9296d3eb69948f889ba23 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. --- 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)); } }