From f57889431dc3a0985db1e97a3968d454536384de Mon Sep 17 00:00:00 2001 From: Sebastian Lenzlinger Date: Fri, 8 Apr 2022 15:45:35 +0200 Subject: [PATCH] minor change to addPlayer() method --- src/main/java/ch/unibas/dmi/dbis/cs108/sebaschi/Lobby.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/sebaschi/Lobby.java b/src/main/java/ch/unibas/dmi/dbis/cs108/sebaschi/Lobby.java index 7fb87ac..5109794 100644 --- a/src/main/java/ch/unibas/dmi/dbis/cs108/sebaschi/Lobby.java +++ b/src/main/java/ch/unibas/dmi/dbis/cs108/sebaschi/Lobby.java @@ -74,10 +74,11 @@ public class Lobby { /** * Adds a player to the lobby. * TODO: ad an appropriate response. Currently hardcoded. + * TODO: Does this method need to implemented somewhere else, e.g. in the ClientHandler? * @param player who wants to join the lobby. */ public void addPlayer(ClientHandler player) { - if (players.size() != 6) { + if (players.size() <= MAX_NO_OF_CLIENTS) { players.add(player); numberOfPlayersInLobby++; LOGGER.debug(player.getClientUserName() + " has been added to Lobby with ID: " + lobbyID