From 65797c65bc1d3c98bd16ad4c2c0f1e486b9ebe49 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sun, 25 Apr 2021 10:36:16 -0300 Subject: actually set hasAnnouncedJoin on server lol --- socket.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/socket.js b/socket.js index 1e25e6c..e6ebc57 100644 --- a/socket.js +++ b/socket.js @@ -372,10 +372,17 @@ export function makeSocketServer() { nickname = command.nickname } - // If the socket hasn't announced its joining yet - and this isn't the - // command where it does so - don't relay the command. + // If it's an 'announce-join' command, mark the variable for this! - if (!hasAnnouncedJoin && command.code !== 'announce-join') { + if (command.code === 'announce-join') { + hasAnnouncedJoin = true; + } + + // If the socket hasn't announced its joining yet, don't relay the + // command. (Since hasAnnouncedJoin gets set above, 'announce-join' + // will meet this condition.) + + if (!hasAnnouncedJoin) { return } -- cgit 1.3.0-6-gf8a5