Updated 'LobbyState' class.

Updated the 'LobbyState' class by fixing the error by sending the 'ServerStartGameMessage' after all players are ready.
This commit is contained in:
Daniel Grigencha
2024-12-01 23:57:26 +01:00
parent 697b974ce1
commit 92cbd9202a

View File

@@ -109,7 +109,9 @@ public void received(LobbyReadyMessage msg, int from) {
}
this.logic.getGame().setAllReady(true);
this.logic.getServerSender().broadcast(new ServerStartGameMessage(this.logic.getGame().getBoard()));
if (this.logic.getGame().allReady()) {
this.logic.getServerSender().broadcast(new ServerStartGameMessage(this.logic.getGame().getBoard()));
}
}
/**