More balanced Shinobi according to Couch Tomato + Fables tests
[vchess.git] / server / models / Game.js
index 76a91dc..5f9ab73 100644 (file)
@@ -321,8 +321,7 @@ const GameModel = {
       ) && (
         !obj.rematchOffer || !!(obj.rematchOffer.match(/^[wbn]$/))
       ) && (
-        // TODO: check if commas are still used (probably not)
-        !obj.fen || !!(obj.fen.match(/^[a-zA-Z0-9,. /-]*$/))
+        !obj.fen || !!(obj.fen.match(/^[a-zA-Z0-9,.:{}\[\]" /-]*$/))
       ) && (
         !obj.score || !!(obj.score.match(/^[012?*\/-]+$/))
       ) && (
@@ -510,6 +509,7 @@ const GameModel = {
             }
             // Set score if lost on time and >= 2 moves:
             else if (
+              g.score == '*' &&
               !!movesGroups[g.id] &&
               movesGroups[g.id].nbMoves >= 2 &&
               tsNow - movesGroups[g.id].lastMaj >