Refactor of network stack

This commit is contained in:
2026-06-09 19:23:58 +02:00
parent 73f3d152af
commit 2fb43c385b
18 changed files with 94 additions and 92 deletions
@@ -280,12 +280,11 @@ public class GameEventProcessor {
*/
private void endGameForFeit(Game game) {
synchronized (gameController) {
gameController.EndGameForFeit();
gameController.endGameForFeit();
EndedGame forfeitEnd = new EndedGame(
game.getSlotMap(), game.orderLogicCard,
game.getCurrentState(), game.getPlayerStanding()
);
forfeitEnd.setDisconnected(buildDisconnectedList(game));
broadcaster.notifyAll(forfeitEnd);
System.out.println("Timer expired: no player reconnected in 60 s.");
removeOfflinePlayers();
@@ -319,14 +318,12 @@ public class GameEventProcessor {
game.getUpperListTribeCards(), game.getLowerListTribeCards(),
game.getUpperListBuilding(), game.getLowerListBuilding()
);
nextRound.setDisconnected(buildDisconnectedList(game));
broadcaster.notifyAll(nextRound);
} else if (game.getCurrentState().getGameStage() == GameStages.ENDED) {
EndedGame endedGame = new EndedGame(
game.getSlotMap(), game.orderLogicCard,
game.getCurrentState(), game.getPlayerStanding()
);
endedGame.setDisconnected(buildDisconnectedList(game));
broadcaster.notifyAll(endedGame);
if (!saveManager.delete()) {
System.out.println("\n!!! Couldn't delete save !!!\n");