diff --git a/Server/src/main/java/uulm/teamname/marvelous/server/lobbymanager/LobbyConnection.java b/Server/src/main/java/uulm/teamname/marvelous/server/lobbymanager/LobbyConnection.java index f9c9939..1f6f004 100644 --- a/Server/src/main/java/uulm/teamname/marvelous/server/lobbymanager/LobbyConnection.java +++ b/Server/src/main/java/uulm/teamname/marvelous/server/lobbymanager/LobbyConnection.java @@ -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); } } diff --git a/Server/src/main/java/uulm/teamname/marvelous/server/lobbymanager/LobbyManager.java b/Server/src/main/java/uulm/teamname/marvelous/server/lobbymanager/LobbyManager.java index 317d5ee..1049544 100644 --- a/Server/src/main/java/uulm/teamname/marvelous/server/lobbymanager/LobbyManager.java +++ b/Server/src/main/java/uulm/teamname/marvelous/server/lobbymanager/LobbyManager.java @@ -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;