Stop sending empty arrays, fix sending empty requests
authorRaphaël Jakse <raphael.jakse@univ-grenoble-alpes.fr>
Sat, 4 Apr 2020 13:37:49 +0000 (15:37 +0200)
committerRaphaël Jakse <raphael.jakse@univ-grenoble-alpes.fr>
Sat, 4 Apr 2020 14:30:44 +0000 (16:30 +0200)
trivabble.js

index f39d684768051617b7c1c987713144fb17839c50..0659da616fbd485eb25a664bd9735c32673a160a 100644 (file)
 
     function send(data) {
         if (!pollingReady && ((data.cmds && data.cmds.length) && data.cmds[0].cmd !== "joinGame")) {
-            send([]);
+            sendCmds();
             setTimeout(send.bind(null, data), POLLING_DELAY);
             return;
         }
                         setTimeout(sendCmds.bind(null, []), POLLING_DELAY);
                     } else {
                         retriedImmediately = true;
-                        sendCmds([])
+                        sendCmds()
                     }
                     return;
                 }
                 blockMove--;
 
                 if (!pollingServer) {
-                    sendCmds([]);
+                    sendCmds();
                 }
             }
         };