Replaced AJAX by fetch: not everything tested yet, but seems fine
[vchess.git] / server / sockets.js
index ea95dc5..467036e 100644 (file)
@@ -208,7 +208,7 @@ module.exports = function(wss) {
           ) {
             send(
               clients[page][obj.target[0]][obj.target[1]],
-              { code: "gotmove", data: obj.data }
+              { code: "gotmove" }
             );
           }
           break;
@@ -228,7 +228,7 @@ module.exports = function(wss) {
               Object.keys(clients[pg][s]).forEach(x => {
                 send(
                   clients[pg][s][x],
-                  { code: "mconnect", data: obj.data }
+                  { code: "mconnect", from: sid }
                 );
               });
             });
@@ -241,7 +241,7 @@ module.exports = function(wss) {
         case "mabort": {
           const gamePg = "/game/" + obj.gid;
           if (!!clients[gamePg] && !!clients[gamePg][obj.target]) {
-            Object.keys(clients[gamePg][target]).forEach(x => {
+            Object.keys(clients[gamePg][obj.target]).forEach(x => {
               send(
                 clients[gamePg][obj.target][x],
                 { code: "abort" }