let obj = JSON.parse(objtxt);
if (!!obj.target && !clients[obj.target])
return; //receiver not connected, nothing we can do
let obj = JSON.parse(objtxt);
if (!!obj.target && !clients[obj.target])
return; //receiver not connected, nothing we can do
clients[obj.target].sock.send(JSON.stringify(
{code:"askchallenge",from:sid}));
break;
clients[obj.target].sock.send(JSON.stringify(
{code:"askchallenge",from:sid}));
break;
// Check all clients playing, and send them a "askgame" message
Object.keys(clients).forEach(k => {
if (k != sid && clients[k].page.indexOf("/game/") >= 0)
// Check all clients playing, and send them a "askgame" message
Object.keys(clients).forEach(k => {
if (k != sid && clients[k].page.indexOf("/game/") >= 0)