use of com.faforever.client.notification.DismissAction in project downlords-faf-client by FAForever.
the class GameServiceImpl method startGame.
/**
* Actually starts the game, including relay and replay server. Call this method when everything else is prepared
* (mod/map download, connectivity check etc.)
*/
private void startGame(GameLaunchMessage gameLaunchMessage, Faction faction, RatingMode ratingMode) {
if (isRunning()) {
logger.warn("Forged Alliance is already running, not starting game");
return;
}
stopSearchLadder1v1();
replayService.startReplayServer(gameLaunchMessage.getUid()).thenCompose(aVoid -> iceAdapter.start()).thenAccept(adapterPort -> {
List<String> args = fixMalformedArgs(gameLaunchMessage.getArgs());
process = noCatch(() -> forgedAllianceService.startGame(gameLaunchMessage.getUid(), faction, args, ratingMode, adapterPort, clientProperties.getReplay().getLocalServerPort(), rehostRequested, getCurrentPlayer()));
setGameRunning(true);
this.ratingMode = ratingMode;
spawnTerminationListener(process);
}).exceptionally(throwable -> {
logger.warn("Game could not be started", throwable);
notificationService.addNotification(new ImmediateNotification(i18n.get("errorTitle"), i18n.get("game.start.couldNotStart"), ERROR, throwable, Arrays.asList(new ReportAction(i18n, reportingService, throwable), new DismissAction(i18n))));
setGameRunning(false);
return null;
});
}
use of com.faforever.client.notification.DismissAction in project downlords-faf-client by FAForever.
the class MapVaultController method onLoadMoreButtonClicked.
public void onLoadMoreButtonClicked() {
moreButton.setVisible(false);
loadingLabel.setVisible(true);
currentSupplier.get().thenAccept(maps -> {
appendSearchResult(maps, searchResultPane);
enterSearchResultState();
}).exceptionally(e -> {
notificationService.addNotification(new ImmediateNotification(i18n.get("errorTitle"), i18n.get("vault.replays.searchError"), Severity.ERROR, e, Collections.singletonList(new DismissAction(i18n))));
enterShowroomState();
return null;
});
}
use of com.faforever.client.notification.DismissAction in project downlords-faf-client by FAForever.
the class ModVaultController method displayModsFromSupplier.
private void displayModsFromSupplier(Supplier<CompletableFuture<List<ModVersion>>> modsSupplier) {
this.currentSupplier = modsSupplier;
modsSupplier.get().thenAccept(this::displayMods).exceptionally(e -> {
notificationService.addNotification(new ImmediateNotification(i18n.get("errorTitle"), i18n.get("vault.replays.searchError"), Severity.ERROR, e, Collections.singletonList(new DismissAction(i18n))));
enterShowroomState();
return null;
});
}
use of com.faforever.client.notification.DismissAction in project downlords-faf-client by FAForever.
the class ModVaultController method onRefreshButtonClicked.
public void onRefreshButtonClicked() {
modService.evictCache();
switch(state) {
case SHOWROOM:
displayShowroomMods();
break;
case SEARCH_RESULT:
currentPage--;
currentSupplier.get().thenAccept(this::displayMods).exceptionally(e -> {
notificationService.addNotification(new ImmediateNotification(i18n.get("errorTitle"), i18n.get("vault.mods.searchError"), Severity.ERROR, e, Collections.singletonList(new DismissAction(i18n))));
enterShowroomState();
return null;
});
break;
default:
}
}
use of com.faforever.client.notification.DismissAction in project downlords-faf-client by FAForever.
the class OnlineReplayVaultController method displayReplaysFromSupplier.
private void displayReplaysFromSupplier(Supplier<CompletableFuture<List<Replay>>> mapsSupplier) {
currentPage = 1;
this.currentSupplier = mapsSupplier;
mapsSupplier.get().thenAccept(this::displaySearchResult).exceptionally(e -> {
notificationService.addNotification(new ImmediateNotification(i18n.get("errorTitle"), i18n.get("vault.replays.searchError"), Severity.ERROR, e, Collections.singletonList(new DismissAction(i18n))));
enterResultState();
return null;
});
}
Aggregations