fix: adjust login process for standard
This commit is contained in:
parent
844cc08c49
commit
bf3bd7d0a4
@ -152,7 +152,13 @@ public class LobbyConnection implements Runnable {
|
|||||||
public void handleReconnect(Participant participant) {
|
public void handleReconnect(Participant participant) {
|
||||||
participant.disconnected = false;
|
participant.disconnected = false;
|
||||||
if (state == LobbyConnectionState.Started) {
|
if (state == LobbyConnectionState.Started) {
|
||||||
|
|
||||||
|
GeneralAssignmentMessage response = new GeneralAssignmentMessage();
|
||||||
|
response.gameID = gameID;
|
||||||
|
participant.sendMessage(response);
|
||||||
|
|
||||||
sendGameStructure(participant.equals(player1), participant.equals(player2), false);
|
sendGameStructure(participant.equals(player1), participant.equals(player2), false);
|
||||||
|
|
||||||
lobby.handleReconnect(participant);
|
lobby.handleReconnect(participant);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -181,15 +181,15 @@ public class LobbyManager {
|
|||||||
|
|
||||||
boolean complete = lobby.setSelection(participant, selected);
|
boolean complete = lobby.setSelection(participant, selected);
|
||||||
|
|
||||||
ConfirmSelectionMessage response = new ConfirmSelectionMessage();
|
|
||||||
response.selectionComplete = complete;
|
|
||||||
participant.sendMessage(response);
|
|
||||||
|
|
||||||
if (complete) {
|
if (complete) {
|
||||||
lobby.getPlayer1().getClient().setState(ClientState.Playing);
|
lobby.getPlayer1().getClient().setState(ClientState.Playing);
|
||||||
lobby.getPlayer2().getClient().setState(ClientState.Playing);
|
lobby.getPlayer2().getClient().setState(ClientState.Playing);
|
||||||
lobby.getSpectators().forEach(spectator -> spectator.getClient().setState(ClientState.Playing));
|
lobby.getSpectators().forEach(spectator -> spectator.getClient().setState(ClientState.Playing));
|
||||||
LobbyRunner.getInstance().startLobby(lobby);
|
LobbyRunner.getInstance().startLobby(lobby);
|
||||||
|
} else {
|
||||||
|
ConfirmSelectionMessage response = new ConfirmSelectionMessage();
|
||||||
|
response.selectionComplete = false;
|
||||||
|
participant.sendMessage(response);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user