Add debug trace to understand why corr move 1 isn't recorded
[vchess.git] / server / models / Game.js
index 92c0130..4d06e48 100644 (file)
@@ -242,8 +242,13 @@ const GameModel =
         query += modifs + " WHERE id = " + id;
         db.run(query);
       }
+
+
+//return cb({errmsg: JSON.stringify(obj.move)});
+
+
       // NOTE: move, chat and delchat are mutually exclusive
-      if (obj.move)
+      if (!!obj.move)
       {
         // Security: only update moves if index is right
         query =
@@ -253,7 +258,7 @@ const GameModel =
         db.get(query, (err,ret) => {
           const m = obj.move;
 
-return cb({errmsg: ret.maxIdx + " " + m.idx + " " + (!ret.maxIdx || ret.maxIdx + 1 == m.idx) + " " + query});
+//return cb({errmsg: ret.maxIdx + " " + m.idx + " " + (!ret.maxIdx || ret.maxIdx + 1 == m.idx) + " " + query});
 
 
           if (!ret.maxIdx || ret.maxIdx + 1 == m.idx) {