Refactor: move login function from coreClient to LobbyClient

This commit is contained in:
Jona Walpert
2026-04-08 13:22:24 +02:00
parent 42b5344059
commit 04bf7ba545
@@ -19,6 +19,10 @@ public class LobbyClient {
this.client = client; this.client = client;
} }
public ClientService getClientService() {
return client;
}
/** /**
* Fetch the current status of the lobby with the given id from the server. * 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) { public void joinLobby(int lobbyId) {
client.processCommand("JOIN_LOBBY ID=" + 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);
}
} }