From: Benjamin Auder Date: Wed, 4 Mar 2020 23:00:18 +0000 (+0100) Subject: Add debug trace to understand why corr move 1 isn't recorded X-Git-Url: https://git.auder.net/%7B%7B%20asset%28%27mixstore/css/user/doc/pieces/cb.svg?a=commitdiff_plain;h=89ffc919a31cc1cd24beadc63050d9097e7505f7;p=vchess.git Add debug trace to understand why corr move 1 isn't recorded --- diff --git a/server/models/Game.js b/server/models/Game.js index 2e330311..4d06e48d 100644 --- a/server/models/Game.js +++ b/server/models/Game.js @@ -244,11 +244,11 @@ const GameModel = } -return cb({errmsg: JSON.stringify(obj.move)}); +//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 = @@ -258,7 +258,7 @@ return cb({errmsg: JSON.stringify(obj.move)}); 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) {