use of com.faforever.client.util.ProgrammingError in project downlords-faf-client by FAForever.
the class OnGameFullNotifier method onGameFull.
@Subscribe
public void onGameFull(GameFullEvent event) {
executor.execute(() -> {
platformService.startFlashingWindow(faWindowTitle);
while (gameService.isGameRunning() && !platformService.isWindowFocused(faWindowTitle)) {
noCatch(() -> sleep(500));
}
platformService.stopFlashingWindow(faWindowTitle);
});
Game currentGame = gameService.getCurrentGame();
if (currentGame == null) {
throw new ProgrammingError("Got a GameFull notification but player is not in a game");
}
if (platformService.isWindowFocused(faWindowTitle)) {
return;
}
notificationService.addNotification(new TransientNotification(i18n.get("game.full"), i18n.get("game.full.action"), mapService.loadPreview(currentGame.getMapFolderName(), PreviewSize.SMALL), v -> platformService.focusWindow(faWindowTitle)));
}
use of com.faforever.client.util.ProgrammingError in project downlords-faf-client by FAForever.
the class GameUpdaterImpl method copyLegacyInitFile.
@SneakyThrows
private void copyLegacyInitFile(List<PatchResult> patchResults) {
Path initFile = patchResults.stream().map(PatchResult::getLegacyInitFile).filter(Objects::nonNull).findFirst().orElseThrow(() -> new ProgrammingError("No legacy init file is available"));
Files.copy(initFile, initFile.resolveSibling(ForgedAlliancePrefs.INIT_FILE_NAME), StandardCopyOption.REPLACE_EXISTING);
}
Aggregations