Skip to content

Commit

Permalink
Add replayKilled variable
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackYps committed Mar 25, 2023
1 parent c188950 commit 2e408b4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/java/com/faforever/client/game/GameService.java
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ public class GameService implements InitializingBean {
private Process replayProcess;
private CompletableFuture<Void> matchmakerFuture;
private boolean gameKilled;
private boolean replayKilled;
private boolean rehostRequested;
private int localReplayPort;
private boolean inOthersParty;
Expand Down Expand Up @@ -588,7 +589,7 @@ public void startSearchMatchmaker() {
.thenCompose(gameLaunchResponse -> downloadMapIfNecessary(gameLaunchResponse.getMapName()).thenCompose(aVoid -> {
// We need to kill the replay to free the lock on the game.prefs
if (isReplayRunning()) {
gameKilled = true;
replayKilled = true;
replayProcess.destroy();
}
return leaderboardService.getActiveLeagueEntryForPlayer(playerService.getCurrentPlayer(), gameLaunchResponse.getLeaderboard());
Expand Down Expand Up @@ -703,6 +704,7 @@ private CompletableFuture<Void> startGame(GameParameters gameParameters) {
.thenApply(adapterPort -> {
fafServerAccessor.setPingIntervalSeconds(5);
gameKilled = false;
replayKilled = false;
gameParameters.setLocalGpgPort(adapterPort);
gameParameters.setLocalReplayPort(localReplayPort);
gameParameters.setRehost(rehostRequested);
Expand Down Expand Up @@ -783,7 +785,7 @@ private void handleTermination(Process finishedProcess) {
}
});

if (exitCode != 0 && !gameKilled) {
if (exitCode != 0 && !(gameKilled || replayKilled)) {
if (exitCode == -1073741515) {
notificationService.addImmediateWarnNotification("game.crash.notInitialized");
} else {
Expand Down

0 comments on commit 2e408b4

Please sign in to comment.