From: Benjamin Auder Date: Fri, 3 Apr 2020 22:33:55 +0000 (+0200) Subject: Fix Dynamo for corr play X-Git-Url: https://git.auder.net/variants/current/css/img/scripts/assets/index.css?a=commitdiff_plain;h=e78633dbd29be1920e0c02509b6ce62b87b61d77;p=vchess.git Fix Dynamo for corr play --- diff --git a/client/src/variants/Dynamo.js b/client/src/variants/Dynamo.js index 91920e07..3cb8dc47 100644 --- a/client/src/variants/Dynamo.js +++ b/client/src/variants/Dynamo.js @@ -9,7 +9,7 @@ export class DynamoRules extends ChessRules { canIplay(side, [x, y]) { // Sometimes opponent's pieces can be moved directly - return true; + return this.turn == side; } setOtherVariables(fen) { diff --git a/server/models/Game.js b/server/models/Game.js index 516c4bc5..401e3653 100644 --- a/server/models/Game.js +++ b/server/models/Game.js @@ -309,7 +309,8 @@ const GameModel = ) && ( !obj.rematchOffer || !!(obj.rematchOffer.match(/^[wbn]$/)) ) && ( - !obj.fen || !!(obj.fen.match(/^[a-zA-Z0-9, /-]*$/)) + // TODO: check if commas are still used (probably not) + !obj.fen || !!(obj.fen.match(/^[a-zA-Z0-9,. /-]*$/)) ) && ( !obj.score || !!(obj.score.match(/^[012?*\/-]+$/)) ) && (