Try to switch off cleanGamesDb
[vchess.git] / server / sockets.js
index 175fe7e..3fb7ea2 100644 (file)
@@ -186,6 +186,11 @@ module.exports = function(wss) {
           notifyRoom(page, obj.code, {data:obj.data});
           break;
 
+        case "result":
+          // Special case: notify all, 'transroom': Game --> Hall
+          notifyRoom("/", "result", {gid:obj.gid, score:obj.score});
+          break;
+
         // Passing, relaying something: from isn't needed,
         // but target is fully identified (sid + tmpId)
         case "challenge":
@@ -201,9 +206,7 @@ module.exports = function(wss) {
       }
     };
     const closeListener = () => {
-      // TODO: BUG: this is triggered twice when anonymous reloads page
-      // (+ registered users, everyone in Hall).
-      // For tab or browser closing:
+      // For browser or tab closing (including page reload):
       doDisconnect();
     };
     // Update clients object: add new connexion