projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add a soft timer to avoid spending much more than 5 seconds on a move
[vchess.git]
/
sockets.js
diff --git
a/sockets.js
b/sockets.js
index
8548e2f
..
820a88c
100644
(file)
--- a/
sockets.js
+++ b/
sockets.js
@@
-45,7
+45,11
@@
module.exports = function(wss) {
break;
case "lastate":
if (!!clients[page][obj.oppid])
break;
case "lastate":
if (!!clients[page][obj.oppid])
- clients[page][obj.oppid].send(objtxt);
+ {
+ const oppId = obj.oppid;
+ obj.oppid = sid; //I'm oppid for my opponent
+ clients[page][oppId].send(JSON.stringify(obj));
+ }
break;
case "newgame":
if (!!games[page])
break;
case "newgame":
if (!!games[page])