From 81475893771d18d4c238a47a61faaa214e170b40 Mon Sep 17 00:00:00 2001 From: Tissevert Date: Sat, 19 Oct 2019 09:31:58 +0200 Subject: [PATCH] Save latest game state received in client to send it back to server and make the client work again with the new message protocol --- www/game.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/www/game.js b/www/game.js index ba62750..a38115b 100644 --- a/www/game.js +++ b/www/game.js @@ -3,6 +3,7 @@ function Game(modules) { var rest = document.getElementById("rest"); var status = { dom: document.getElementById("status"), + game: null, playing: false, step: null, month: null @@ -233,7 +234,8 @@ function Game(modules) { function play(move) { modules.messaging.send({ tag: "Play", - move: move + move: move, + onGame: status.game }); } @@ -246,6 +248,7 @@ function Game(modules) { function setStatus(game) { modules.dom.clear(status.dom); + status.game = game; status.step = game.public.step.tag; if(game.public.month != status.month) { status.month = game.public.month;