fix: only set runningGame to true if the client actually had a started game

This commit is contained in:
punchready 2021-07-01 12:33:33 +02:00
parent 1a8566895b
commit ec6236c57f

View File

@ -42,7 +42,10 @@ public class LobbyManager {
*/ */
public boolean handleConnect(Client client, AtomicBoolean running) { public boolean handleConnect(Client client, AtomicBoolean running) {
if (participants.containsKey(client.getId())) { 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; return true;
} }