// 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();