From 054662957a47ec740c87704c862d4552b46aca88 Mon Sep 17 00:00:00 2001 From: Yannik Bretschneider Date: Mon, 7 Jun 2021 17:47:41 +0200 Subject: [PATCH] fix: fixed bug where spectators would never be in the playing state --- .../teamname/marvelous/server/lobbymanager/LobbyManager.java | 4 ++++ 1 file changed, 4 insertions(+) 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 56f51e4..28134bb 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 @@ -11,6 +11,7 @@ import uulm.teamname.marvelous.gamelibrary.messages.server.ConfirmSelectionMessa import uulm.teamname.marvelous.gamelibrary.messages.server.GameAssignmentMessage; import uulm.teamname.marvelous.gamelibrary.messages.server.GeneralAssignmentMessage; import uulm.teamname.marvelous.server.netconnector.Client; +import uulm.teamname.marvelous.server.netconnector.ClientState; import uulm.teamname.marvelous.server.netconnector.SUID; import uulm.teamname.marvelous.server.netconnector.UserManager; @@ -185,6 +186,9 @@ public class LobbyManager { participant.sendMessage(response); if (complete) { + lobby.getPlayer1().getClient().state = ClientState.Playing; + lobby.getPlayer2().getClient().state = ClientState.Playing; + lobby.getSpectators().forEach(spectator -> spectator.getClient().state = ClientState.Playing); LobbyRunner.getInstance().startLobby(lobby); }