Save latest game state received in client to send it back to server and make the client work again with the new message protocol

This commit is contained in:
Tissevert 2019-10-19 09:31:58 +02:00
parent 7804aeecef
commit 8147589377
1 changed files with 4 additions and 1 deletions

View File

@ -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;