fix: adjust login process for standard

This commit is contained in:
punchready 2021-06-29 08:40:00 +02:00
parent 844cc08c49
commit bf3bd7d0a4
2 changed files with 10 additions and 4 deletions

View File

@ -152,7 +152,13 @@ public class LobbyConnection implements Runnable {
public void handleReconnect(Participant participant) {
participant.disconnected = false;
if (state == LobbyConnectionState.Started) {
GeneralAssignmentMessage response = new GeneralAssignmentMessage();
response.gameID = gameID;
participant.sendMessage(response);
sendGameStructure(participant.equals(player1), participant.equals(player2), false);
lobby.handleReconnect(participant);
}
}

View File

@ -181,15 +181,15 @@ public class LobbyManager {
boolean complete = lobby.setSelection(participant, selected);
ConfirmSelectionMessage response = new ConfirmSelectionMessage();
response.selectionComplete = complete;
participant.sendMessage(response);
if (complete) {
lobby.getPlayer1().getClient().setState(ClientState.Playing);
lobby.getPlayer2().getClient().setState(ClientState.Playing);
lobby.getSpectators().forEach(spectator -> spectator.getClient().setState(ClientState.Playing));
LobbyRunner.getInstance().startLobby(lobby);
} else {
ConfirmSelectionMessage response = new ConfirmSelectionMessage();
response.selectionComplete = false;
participant.sendMessage(response);
}
return true;