- sockIds: Object.keys(clients).filter(k => k != sid &&
- (clients[k].page == curPage ||
- // Consider that people playing are in Hall too:
- (curPage == "/" && clients[k].page.indexOf("/game/") >= 0))
+ sockIds: Object.keys(clients).filter(k =>
+ k != sid && clients[k].page == curPage
+ )}));
+ break;
+ }
+ case "pollgamers":
+ socket.send(JSON.stringify({code:"pollgamers",
+ sockIds: Object.keys(clients).filter(k =>
+ k != sid && clients[k].page.indexOf("/game/") >= 0