From 0e8750c9854429c59ce80c265dade999de9f81c5 Mon Sep 17 00:00:00 2001 From: sebaschi <74497638+sebaschi@users.noreply.github.com> Date: Fri, 8 Apr 2022 13:34:30 +0200 Subject: [PATCH] Updated diary.txt for Sebastian 8.4.22. Started to handle case in Lobby if lobby is full. --- Meilenstein III/Diary.txt | 7 +++++++ .../java/ch/unibas/dmi/dbis/cs108/BudaLogConfig.java | 4 ++++ .../java/ch/unibas/dmi/dbis/cs108/sebaschi/Lobby.java | 11 +++++++++-- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/Meilenstein III/Diary.txt b/Meilenstein III/Diary.txt index 503348c..78800f5 100644 --- a/Meilenstein III/Diary.txt +++ b/Meilenstein III/Diary.txt @@ -243,9 +243,16 @@ Stand: Lobby: ? Spiellogik: VoteHandler wurde getestet und tut weitestgehenst was er soll +08.04.2022 - Sebastian +Stand Mittag: + Lobby: Es gibt eine Lobby Class. Sie verwaltet: LobbyID basierend darauf wieviele Lobbys/Spiele laufen; + Wieviele Spieler in der Lobby sind; Wer in der Lobby ist. + ToDo: Spiellogik: - Send() methode von Passenger mit Client-Server verknüpfen(Seraina) - NoiseHandler (Alex) - Game Zyklus implementieren (Seraina) + + diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/BudaLogConfig.java b/src/main/java/ch/unibas/dmi/dbis/cs108/BudaLogConfig.java index 4788f5a..0510c83 100644 --- a/src/main/java/ch/unibas/dmi/dbis/cs108/BudaLogConfig.java +++ b/src/main/java/ch/unibas/dmi/dbis/cs108/BudaLogConfig.java @@ -7,6 +7,10 @@ import org.apache.logging.log4j.core.LoggerContext; import org.apache.logging.log4j.core.config.Configuration; import org.apache.logging.log4j.core.config.LoggerConfig; +/** + * CAN CURRENTLY BE IGNORED: NOT SURE IF NEEDED YET. + * TODO: Decide weather we need this. + */ public class BudaLogConfig { public Logger LOGGER; 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 b57f0e4..25e09f4 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 @@ -8,7 +8,10 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; /** - * The Lobby one is in after a client sends the CRTGM command. THe Server + * Use: If a client sends a CRTGM command the server should create a lobby with the client as admin. + * In this state, up to 5 other clients (so 6 in total) are able to join this lobby. Once the admin + * feels like it, he can start a game. + * TODO: is all data in here or should GameSessionData be used to collect all relevant data? */ public class Lobby { @@ -16,7 +19,10 @@ public class Lobby { public static final BudaLogConfig l = new BudaLogConfig(LOGGER); private static final int MAX_NO_OF_CLIENTS = 6; - private static int lobbies; + public static int lobbies; + + //TODO + CentralServerData serverData; /** * The Person who created the game and can configure it and decide to start once enough players @@ -31,6 +37,7 @@ public class Lobby { private int numberOfPlayersInLobby; + //TODO maybe it makes sense to have LobbyID Class? private final int lobbyID = lobbies++;