projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add state indicators for game seek/playing
[vchess.git]
/
sockets.js
diff --git
a/sockets.js
b/sockets.js
index
2a43e32
..
c3190aa
100644
(file)
--- a/
sockets.js
+++ b/
sockets.js
@@
-18,6
+18,9
@@
module.exports = function(wss) {
for (const v of Variants)
clients[v.name] = {};
for (const v of Variants)
clients[v.name] = {};
+ // TODO: when relaying to opponent, check readyState, potential setTimeout()? + send opponent (re)disconnect
+ // (resign, newgame, newmove). See https://github.com/websockets/ws/blob/master/lib/websocket.js around line 313
+
wss.on("connection", (socket, req) => {
//const params = new URL("http://localhost" + req.url).searchParams;
var query = getJsonFromUrl(req.url);
wss.on("connection", (socket, req) => {
//const params = new URL("http://localhost" + req.url).searchParams;
var query = getJsonFromUrl(req.url);