Feat: Add addPlayer command on sever side #258
@@ -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));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user