From 04bf7ba54568a6095c00bf09c61e6ebfa2cbf765 Mon Sep 17 00:00:00 2001 From: Jona Walpert Date: Wed, 8 Apr 2026 13:22:24 +0200 Subject: [PATCH] Refactor: move login function from coreClient to LobbyClient --- .../cs108/casono/client/network/LobbyClient.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/casono/client/network/LobbyClient.java b/src/main/java/ch/unibas/dmi/dbis/cs108/casono/client/network/LobbyClient.java index 996f767..f74853d 100644 --- a/src/main/java/ch/unibas/dmi/dbis/cs108/casono/client/network/LobbyClient.java +++ b/src/main/java/ch/unibas/dmi/dbis/cs108/casono/client/network/LobbyClient.java @@ -19,6 +19,10 @@ public class LobbyClient { this.client = client; } + public ClientService getClientService() { + return client; + } + /** * Fetch the current status of the lobby with the given id from the server. * @@ -61,4 +65,13 @@ public class LobbyClient { public void joinLobby(int lobbyId) { client.processCommand("JOIN_LOBBY ID=" + lobbyId); } + + /** + * Logs in to the server with the given username by sending a "LOGIN" command. + * + * @param user The username to log in with. + */ + public void login(String user) { + client.processCommand("LOGIN USERNAME=" + user); + } }