X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=server%2Fsockets.js;h=a3f4649a923138f081e879c9953fee6d61569ab6;hp=09434a02b75ea53228d61f0a91ca606459e8a577;hb=a36a09c039d2abaa130c7daddd865009f1456bf7;hpb=6fba6e0c029afc74a780ef845a02659da53c84e0 diff --git a/server/sockets.js b/server/sockets.js index 09434a02..a3f4649a 100644 --- a/server/sockets.js +++ b/server/sockets.js @@ -83,14 +83,13 @@ module.exports = function(wss) { case "newchat": clients[obj.target].send(JSON.stringify({code:"newchat",msg:obj.msg})); break; - // Transmit chats and moves to current room // TODO: WebRTC instead in this case (most demanding?) case "newmove": clients[obj.target].send(JSON.stringify({code:"newmove",move:obj.move})); break; - // TODO: generalize that for several opponents case "ping": - socket.send(JSON.stringify({code:"pong",gameId:obj.gameId})); + // If this code is reached, then obj.target is connected + socket.send(JSON.stringify({code:"pong"})); break; case "lastate": const oppId = obj.target;