projects
/
vchess.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0baae6b
)
Add debug trace to understand why corr move 1 isn't recorded
author
Benjamin Auder
<benjamin.auder@somewhere>
Wed, 4 Mar 2020 23:00:18 +0000
(
00:00
+0100)
committer
Benjamin Auder
<benjamin.auder@somewhere>
Wed, 4 Mar 2020 23:00:18 +0000
(
00:00
+0100)
server/models/Game.js
patch
|
blob
|
blame
|
history
diff --git
a/server/models/Game.js
b/server/models/Game.js
index
2e33031
..
4d06e48
100644
(file)
--- 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
// NOTE: move, chat and delchat are mutually exclusive
- if (obj.move)
+ if (
!!
obj.move)
{
// Security: only update moves if index is right
query =
{
// 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;
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) {
if (!ret.maxIdx || ret.maxIdx + 1 == m.idx) {