+ // If repetition detected, consider that a draw offer was received:
+ const fenObj = V.ParseFen(move.fen);
+ let repIdx = fenObj.position + "_" + fenObj.turn;
+ if (!!fenObj.flags)
+ repIdx += "_" + fenObj.flags;
+ this.repeat[repIdx] = (!!this.repeat[repIdx]
+ ? this.repeat[repIdx]+1
+ : 1);
+ if (this.repeat[repIdx] >= 3)
+ this.drawOffer = "received"; //TODO: will print "mutual agreement"...
+ },
+ processChat: function(chat) {
+ if (this.game.type == "corr")
+ GameStorage.update(this.gameRef.id, {chat: chat});