From e78633dbd29be1920e0c02509b6ce62b87b61d77 Mon Sep 17 00:00:00 2001
From: Benjamin Auder <benjamin.auder@somewhere>
Date: Sat, 4 Apr 2020 00:33:55 +0200
Subject: [PATCH] Fix Dynamo for corr play

---
 client/src/variants/Dynamo.js | 2 +-
 server/models/Game.js         | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

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?*\/-]+$/))
       ) && (
-- 
2.44.0