- // Check if receiver is connected, because there may be some lag
- // between a client disconnects and another notice.
- if (Array.isArray(obj.target))
- {
- if (!clients[page][obj.target[0]] ||
- !clients[page][obj.target[0]][obj.target[1]])
- {
- return;
- }
- }
- else if (!clients[page][obj.target])
- return;
+ // I effectively disconnected from this page:
+ notifyRoom(page, "disconnect");
+ if (page.indexOf("/game/") >= 0)
+ notifyRoom("/", "gdisconnect", {page:page});