X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=server%2Fsockets.js;h=b16135bd54b15c2fb53f5d79982e0dd0b1da6f79;hp=c8f3c7f80bd8fae9cbd3cb3eefcc6ca5df077bc8;hb=585d095517ca2aedab8ad125cc7c39b90e13d5cc;hpb=bf7e5f3669a4c0bfa2756921d15d3fd055d4cfd2 diff --git a/server/sockets.js b/server/sockets.js index c8f3c7f8..b16135bd 100644 --- a/server/sockets.js +++ b/server/sockets.js @@ -208,16 +208,13 @@ module.exports = function(wss) { case "drawoffer": case "rematchoffer": case "draw": - if (!!obj.oppsid) - // "newgame" message from Hall: do not target players - notifyAllBut(page, "newgame", {data: obj.data}, [sid, obj.oppsid]); - else notifyRoom(page, obj.code, {data: obj.data}); + notifyRoom(page, obj.code, {data: obj.data}); break; case "rnewgame": - // A rematch game started: players are already informed + // A rematch game started: + // NOTE: no need to explicitely notify Hall: the game will be sent notifyAllBut(page, "newgame", {data: obj.data}, [sid]); - notifyAllBut("/", "newgame", {data: obj.data}, [sid, obj.oppsid]); notifyRoom("/mygames", "newgame", {data: obj.data}); break;