From ec6236c57fce8580765e81b881620468aa5fcc36 Mon Sep 17 00:00:00 2001 From: punchready Date: Thu, 1 Jul 2021 12:33:33 +0200 Subject: [PATCH] fix: only set runningGame to true if the client actually had a started game --- .../teamname/marvelous/server/lobbymanager/LobbyManager.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Server/src/main/java/uulm/teamname/marvelous/server/lobbymanager/LobbyManager.java b/Server/src/main/java/uulm/teamname/marvelous/server/lobbymanager/LobbyManager.java index 1049544..af46382 100644 --- a/Server/src/main/java/uulm/teamname/marvelous/server/lobbymanager/LobbyManager.java +++ b/Server/src/main/java/uulm/teamname/marvelous/server/lobbymanager/LobbyManager.java @@ -42,7 +42,10 @@ public class LobbyManager { */ public boolean handleConnect(Client client, AtomicBoolean running) { if (participants.containsKey(client.getId())) { - running.set(true); + LobbyConnection lobby = lobbies.get(participants.get(client.getId()).lobby); + if (lobby != null) { + running.set(lobby.state == LobbyConnectionState.Started); + } } return true; }