diff --git a/server/index.js b/server/index.js index 9496e64..a61a557 100644 --- a/server/index.js +++ b/server/index.js @@ -19,7 +19,9 @@ wss.on("connection", function connection(ws, req) { .pop() .toLocaleLowerCase(); ws.on("message", function incoming(data) { - console.log(data); + if (!data.match(/^\["ping/i)) { + console.log(ws.channel, wss.clients.size, data); + } wss.clients.forEach(function each(client) { if ( client !== ws && diff --git a/src/components/Menu.vue b/src/components/Menu.vue index 17a81b2..144708c 100644 --- a/src/components/Menu.vue +++ b/src/components/Menu.vue @@ -140,14 +140,14 @@ export default { }, hostSession() { const sessionId = prompt( - "Enter a channel number for your session", + "Enter a channel number / name for your session", Math.round(Math.random() * 10000) ); if (sessionId) { this.$store.commit("setSpectator", false); this.$store.commit( "setSessionId", - sessionId.replace(/[^0-9]/g, "").substr(0, 5) + sessionId.replace(/[^0-9a-z]/g, "").substr(0, 5) ); this.copySessionUrl(); } @@ -166,13 +166,13 @@ export default { }, joinSession() { const sessionId = prompt( - "Enter the channel number of the session you want to join" + "Enter the channel number / name of the session you want to join" ); if (sessionId) { this.$store.commit("setSpectator", true); this.$store.commit( "setSessionId", - sessionId.replace(/[^0-9]/g, "").substr(0, 5) + sessionId.replace(/[^0-9a-z]/g, "").substr(0, 5) ); } },