From bf3bd7d0a43b967a379572d5be5d60c73c987714 Mon Sep 17 00:00:00 2001 From: punchready Date: Tue, 29 Jun 2021 08:40:00 +0200 Subject: [PATCH] fix: adjust login process for standard --- .../marvelous/server/lobbymanager/LobbyConnection.java | 6 ++++++ .../marvelous/server/lobbymanager/LobbyManager.java | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) 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;