X-Git-Url: https://git.auder.net/img/rock_paper_scissors_lizard_spock.gif?a=blobdiff_plain;f=sockets.js;h=c3190aa28bb392fd1eaa8b7abbeb85c261f883c3;hb=186516b8eb00e193102ba43cff95de0a55c60dcb;hp=2a43e323d6cdf58616918d1323486862af8f823d;hpb=1d184b4c016a645228251ce984d4c980e60420b0;p=vchess.git diff --git a/sockets.js b/sockets.js index 2a43e323..c3190aa2 100644 --- a/sockets.js +++ b/sockets.js @@ -18,6 +18,9 @@ module.exports = function(wss) { 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);