- squares: filtered_move,
- message: this.corrMsg,
- played: Date.now(), //TODO: on server?
- idx: this.game.moves.length,
- },
- clocks: this.game.clocks.map((t,i) => i==colorIdx
- ? this.game.clocks[i] + addTime
- : this.game.clocks[i]),
- initime: this.game.initime.map((t,i) => i==nextIdx
- ? Date.now()
- : this.game.initime[i]),
- });
+ fen: move.fen,
+ move:
+ {
+ squares: filtered_move,
+ message: this.corrMsg,
+ played: Date.now(), //TODO: on server?
+ idx: this.game.moves.length,
+ },
+ });
+ }
+ else //live
+ {
+ GameStorage.update(this.gameRef.id,
+ {
+ fen: move.fen,
+ move: filtered_move,
+ clocks: this.game.clocks.map((t,i) => i==colorIdx
+ ? this.game.clocks[i] + addTime
+ : this.game.clocks[i]),
+ initime: this.game.initime.map((t,i) => i==nextIdx
+ ? Date.now()
+ : this.game.initime[i]),
+ });
+ }