projects
/
vchess.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e4b6e28
)
Add debug trace to understand why corr move 1 isn't recorded
author
Benjamin Auder
<benjamin.auder@somewhere>
Wed, 4 Mar 2020 22:54:55 +0000
(23:54 +0100)
committer
Benjamin Auder
<benjamin.auder@somewhere>
Wed, 4 Mar 2020 22:54:55 +0000
(23:54 +0100)
server/models/Game.js
patch
|
blob
|
blame
|
history
diff --git
a/server/models/Game.js
b/server/models/Game.js
index
cfaddfe
..
92c0130
100644
(file)
--- a/
server/models/Game.js
+++ b/
server/models/Game.js
@@
-253,13
+253,13
@@
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});
if (!ret.maxIdx || ret.maxIdx + 1 == m.idx) {
query =
"INSERT INTO Moves (gid, squares, played, idx) VALUES " +
"(" + id + ",?," + m.played + "," + m.idx + ")";
-return cb({errmsg: (!ret.maxIdx || ret.maxIdx + 1 == m.idx) + " " + query});
db.run(query, JSON.stringify(m.squares));
cb(null);
}