- if (
- movePlus.index < movesCount ||
- this.gotMoveIdx >= movePlus.index
- ) {
- // Opponent re-send but we already have the move:
- // (maybe he didn't receive our pingback...)
- this.send("gotmove", {data: movePlus.index, target: data.from});
- } else {
- this.gotMoveIdx = movePlus.index;
- const receiveMyMove = (movePlus.color == this.game.mycolor);
- if (!receiveMyMove && !!this.game.mycolor)
- // Notify opponent that I got the move:
- this.send("gotmove", {data: movePlus.index, target: data.from});
- if (movePlus.cancelDrawOffer) {
- // Opponent refuses draw
- this.drawOffer = "";
- // NOTE for corr games: drawOffer reset by player in turn
- if (
- this.game.type == "live" &&
- !!this.game.mycolor &&
- !receiveMyMove
- ) {
- GameStorage.update(this.gameRef, { drawOffer: "" });
- }
- }
- this.$refs["basegame"].play(movePlus.move, "received", null, true);
- const moveColIdx = ["w", "b"].indexOf(movePlus.color);
- this.game.clocks[moveColIdx] = movePlus.clock;
- this.processMove(
- movePlus.move,
- { receiveMyMove: receiveMyMove }
+ this.gotMoveIdx = movePlus.index;
+ const receiveMyMove = (movePlus.color == this.game.mycolor);
+ const moveColIdx = ["w", "b"].indexOf(movePlus.color);
+ if (!receiveMyMove && !!this.game.mycolor) {
+ // Notify opponent that I got the move:
+ this.send(
+ "gotmove",
+ { data: movePlus.index, target: data.from }