Skip to content

Commit

Permalink
ensure map on game map change (whether as host or as joiner)
Browse files Browse the repository at this point in the history
  • Loading branch information
Axle1975 committed Jan 24, 2022
1 parent a773540 commit c6dcd25
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -718,11 +718,14 @@ private void hostGame(MapBean map) {
}

public void onUpdateButtonClicked() {
gameService.updateSettingsForStagingGame(
mapListView.getSelectionModel().getSelectedItem().getMapName(),
rankedEnabledCheckBox.isSelected()
? mapPoolListView.getSelectionModel().getSelectedItem().getLeaderboard().getTechnicalName()
: DEFAULT_RATING_TYPE);
mapService.ensureMap(
featuredModListView.getSelectionModel().getSelectedItem().getTechnicalName(),
mapListView.getSelectionModel().getSelectedItem(), null, null)
.thenRun(() -> gameService.updateSettingsForStagingGame(
mapListView.getSelectionModel().getSelectedItem().getMapName(),
rankedEnabledCheckBox.isSelected()
? mapPoolListView.getSelectionModel().getSelectedItem().getLeaderboard().getTechnicalName()
: DEFAULT_RATING_TYPE));
}

public Pane getRoot() {
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/com/faforever/client/game/GameService.java
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,9 @@ private void setRunningGameUid(Integer uidOrNull) {

public void startBattleRoom() {
if (isGameRunning()) {
this.totalAnnihilationService.sendToConsole("/launch");
Game game = getCurrentGame();
mapService.ensureMap(game.getFeaturedMod(), game.getMapName(), game.getMapCrc(), game.getMapArchiveName(), null, null)
.thenRun(() -> this.totalAnnihilationService.sendToConsole("/launch"));
}
}

Expand Down

0 comments on commit c6dcd25

Please sign in to comment.