From 1602896928aeba1a0993158c7c92276e064c2dcd Mon Sep 17 00:00:00 2001 From: Chars chan <28523197+Charsy89@users.noreply.github.com> Date: Tue, 19 Nov 2019 19:46:15 -0700 Subject: [PATCH] Use newer isLobby --- src/Room.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/Room.js b/src/Room.js index 818294b..efb0475 100644 --- a/src/Room.js +++ b/src/Room.js @@ -202,13 +202,19 @@ class Room extends EventEmitter { } isLobby(_id) { if (_id.startsWith("lobby")) { + let lobbynum = _id.split("lobby")[1]; if (_id == "lobby") { return true; - } else if (parseFloat(_id.split("lobby")[1] % 1) === 0) { - return true; - } else { - return false; - } + } + if (!(parseInt(lobbynum).toString() == lobbynum)) return false; + for (let i in lobbynum) { + if (parseInt(lobbynum[i]) >= 0) { + if (parseInt(i) + 1 == lobbynum.length) return true; + + } else { + return false; + } + } } else if (_id.startsWith("test/")) { if (_id == "test/") { return false;