yet another attempt at fixing ability to join non-existent lobbies
This commit is contained in:
@@ -42,8 +42,7 @@ app.get("/lobby/join", async (req, res) => {
|
||||
if (!user) {
|
||||
return res.status(401).json({error: "User doesn't exist"});
|
||||
}
|
||||
for (let lobby of playerMap) {
|
||||
if (playerMap[lobby.lobbyId] == lobbyId) {
|
||||
if (playerMap[lobbyId]) {
|
||||
await joinLobby(lobbyId, user.username);
|
||||
|
||||
if (!playerMap[lobbyId]) {
|
||||
@@ -56,7 +55,6 @@ app.get("/lobby/join", async (req, res) => {
|
||||
|
||||
res.json({lobbyId, username});
|
||||
} else console.log("Lobby with " + lobbyId + " not found.");
|
||||
}
|
||||
});
|
||||
|
||||
app.get("/lobby/players", async (req, res) => {
|
||||
|
||||
Reference in New Issue
Block a user