forked from Hri7566/mpp-server-dev2
Use newer isLobby
This commit is contained in:
parent
a078ce6ca1
commit
1602896928
10
src/Room.js
10
src/Room.js
|
@ -202,13 +202,19 @@ class Room extends EventEmitter {
|
||||||
}
|
}
|
||||||
isLobby(_id) {
|
isLobby(_id) {
|
||||||
if (_id.startsWith("lobby")) {
|
if (_id.startsWith("lobby")) {
|
||||||
|
let lobbynum = _id.split("lobby")[1];
|
||||||
if (_id == "lobby") {
|
if (_id == "lobby") {
|
||||||
return true;
|
return true;
|
||||||
} else if (parseFloat(_id.split("lobby")[1] % 1) === 0) {
|
}
|
||||||
return true;
|
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 {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else if (_id.startsWith("test/")) {
|
} else if (_id.startsWith("test/")) {
|
||||||
if (_id == "test/") {
|
if (_id == "test/") {
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue