More robust in-check indications (ready for Antiking)
[vchess.git] / sockets.js
index 2a43e32..a1818e0 100644 (file)
@@ -18,6 +18,10 @@ 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
+       // TODO: awaiting newmove, resign, newgame :: in memory structure
+
        wss.on("connection", (socket, req) => {
                //const params = new URL("http://localhost" + req.url).searchParams;
                var query = getJsonFromUrl(req.url);