Use newer isLobby

This commit is contained in:
Chars chan 2019-11-19 19:46:15 -07:00 committed by GitHub
parent a078ce6ca1
commit 1602896928
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 5 deletions

View File

@ -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;