From: Benjamin Auder Date: Tue, 3 Mar 2020 22:13:19 +0000 (+0100) Subject: Merge branch 'master' of auder.net:vchess X-Git-Url: https://git.auder.net/variants/current/doc/css/doc/html/packages.html?a=commitdiff_plain;h=1051336271ad4d4128ef1f66953f54973601d774;p=vchess.git Merge branch 'master' of auder.net:vchess --- 1051336271ad4d4128ef1f66953f54973601d774 diff --cc client/src/views/Game.vue index ec25588b,758759dc..6c289e61 --- a/client/src/views/Game.vue +++ b/client/src/views/Game.vue @@@ -703,11 -661,14 +699,15 @@@ export default // Update current game object (no need for moves stack): playMove(move, this.vr); this.game.movesCount++; + // TODO: notifyTurn // (add)Time indication: useful in case of lastate infos requested - this.game.moves.push({move:move, addTime:addTime}); + this.game.moves.push(this.game.type == "live" + ? {move:move, addTime:addTime} + : move); this.game.fen = this.vr.getFen(); - this.game.clocks[colorIdx] += addTime; + if (this.game.type == "live") this.game.clocks[colorIdx] += addTime; + // In corr games, just reset clock to mainTime: + else this.game.clocks[colorIdx] = extractTime(this.game.cadence).mainTime; // data.initime is set only when I receive a "lastate" move from opponent this.game.initime[nextIdx] = (data && data.initime) ? data.initime : Date.now(); this.re_setClocks();