Bug fix
authorBenjamin Auder <benjamin.auder@somewhere>
Thu, 6 Feb 2020 20:41:04 +0000 (21:41 +0100)
committerBenjamin Auder <benjamin.auder@somewhere>
Thu, 6 Feb 2020 20:41:04 +0000 (21:41 +0100)
client/src/views/Hall.vue
server/sockets.js

index e8f7785..db8f528 100644 (file)
@@ -447,7 +447,6 @@ export default {
         }
         case "connect":
         case "gconnect":
-console.log(data.code + " " + data.from);
           this.$set(this.people, data.from, {name:"", id:0, gamer:data.code[0]=='g'});
           this.st.conn.send(JSON.stringify({code:"askidentity", target:data.from}));
           if (data.code == "connect")
@@ -457,7 +456,6 @@ console.log(data.code + " " + data.from);
           break;
         case "disconnect":
         case "pdisconnect":
-console.log(data.code + " " + data.from);
           this.$delete(this.people, data.from);
           if (data.code == "disconnect")
           {
index 553f8c6..75aeadd 100644 (file)
@@ -41,10 +41,13 @@ module.exports = function(wss) {
       switch (obj.code)
       {
         case "connect":
-          notifyRoom(query["page"], "connect"); //Hall or Game
-          if (query["page"].indexOf("/game/") >= 0)
+        {
+          const curPage = clients[sid].page;
+          notifyRoom(curPage, "connect"); //Hall or Game
+          if (curPage.indexOf("/game/") >= 0)
             notifyRoom("/", "gconnect"); //notify main hall
           break;
+        }
         case "pollclients":
         {
           const curPage = clients[sid].page;
@@ -62,7 +65,6 @@ module.exports = function(wss) {
           break;
         case "pagechange":
           // page change clients[sid].page --> obj.page
-console.log(sid + " : page change: " + clients[sid].page + " --> " + obj.page);
           notifyRoom(clients[sid].page, "disconnect");
           if (clients[sid].page.indexOf("/game/") >= 0)
             notifyRoom("/", "gdisconnect");