From 5e6745ee23edf7f283e85be13622c336bed706c2 Mon Sep 17 00:00:00 2001 From: Yannik Bretschneider Date: Mon, 7 Jun 2021 17:05:56 +0200 Subject: [PATCH] fix: fixed bug where spectator joins as player if free spot available --- .../marvelous/server/lobbymanager/LobbyManager.java | 8 +++++++- 1 file changed, 7 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 c477231..8799482 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 @@ -101,7 +101,13 @@ public class LobbyManager { return; } - ParticipantType type = lobby.freeSlot(); + ParticipantType type; + + if (role == RoleEnum.SPECTATOR) { + type = ParticipantType.Spectator; + } else { + type = lobby.freeSlot(); + } Logger.trace("New participant '{}' has the role '{}'", client.id.getName(), type);