Merge branch 'feat/97-add-joinlobby-command-on-server-side' of https://git.scicore.unibas.ch/cs108-fs26/Gruppe-13 into feat/97-add-joinlobby-command-on-server-side

This commit is contained in:
Jona Walpert
2026-04-11 19:42:09 +02:00
@@ -86,8 +86,7 @@ public class ServerApp {
SESSION_DISCONNECT_JOB_PERIOD, SESSION_DISCONNECT_JOB_PERIOD,
TimeUnit.SECONDS); TimeUnit.SECONDS);
LobbyManager lobbyManager = new LobbyManager(); registerCommands(dispatcher, router, responseDispatcher, userRegistry);
registerCommands(dispatcher, router, responseDispatcher, userRegistry, lobbyManager);
NetworkManager networkManager = new NetworkManager(port, sessionManager, router); NetworkManager networkManager = new NetworkManager(port, sessionManager, router);
networkManager.start(); networkManager.start();
@@ -104,8 +103,7 @@ public class ServerApp {
CommandParserDispatcher parserDispatcher, CommandParserDispatcher parserDispatcher,
CommandRouter commandRouter, CommandRouter commandRouter,
ResponseDispatcher responseDispatcher, ResponseDispatcher responseDispatcher,
UserRegistry userRegistry, UserRegistry userRegistry) {
LobbyManager lobbyManager) {
parserDispatcher.register("PING", new PingParser()); parserDispatcher.register("PING", new PingParser());
commandRouter.register(PingRequest.class, new PingHandler(responseDispatcher)); commandRouter.register(PingRequest.class, new PingHandler(responseDispatcher));
@@ -139,16 +137,5 @@ public class ServerApp {
parserDispatcher.register("LIST_USERS", new ListUsersParser()); parserDispatcher.register("LIST_USERS", new ListUsersParser());
commandRouter.register( commandRouter.register(
ListUsersRequest.class, new ListUsersHandler(responseDispatcher, userRegistry)); ListUsersRequest.class, new ListUsersHandler(responseDispatcher, userRegistry));
// Lobby commands
parserDispatcher.register(
"JOIN_LOBBY",
new ch.unibas.dmi.dbis.cs108.casono.server.app.commands.lobby.join_lobby
.JoinLobbyParser());
commandRouter.register(
ch.unibas.dmi.dbis.cs108.casono.server.app.commands.lobby.join_lobby
.JoinLobbyRequest.class,
new ch.unibas.dmi.dbis.cs108.casono.server.app.commands.lobby.join_lobby
.JoinLobbyHandler(responseDispatcher, lobbyManager, userRegistry));
} }
} }