Ping command check before telemetry check

This commit is contained in:
Geoffrey Coulaud 2022-01-29 10:20:06 +00:00 committed by Observer KRypt0n_
parent c461f35391
commit 62aaab0d74
2 changed files with 19 additions and 0 deletions

View file

@ -231,6 +231,11 @@ notifications:
title: 'Launcher update available: {from} -> {to}'
body: You can download a new version of the launcher from the project's repository at {repository}
# Before telemetry check when iputils is not downloaded
iputils_package_required:
title: An Anime Game Launcher
body: You must have iputils installed for telemetry checking
# When telemetry servers are not disabled
telemetry_not_disabled:
title: An Anime Game Launcher

View file

@ -13,6 +13,20 @@ export default (launcher: Launcher): Promise<void> => {
return new Promise(async (resolve) => {
const debugThread = new DebugThread('State/Launch', 'Starting the game');
// Show an error notification if ping is not available
if (!await Launcher.isPackageAvailable('ping'))
{
Notification.show({
...(Locales.translate('notifications.iputils_package_required') as { title: string, body: string }),
icon: `${constants.paths.appDir}/public/images/baal64-transparent.png`,
importance: 'critical'
});
debugThread.log('iputils package is not installed!');
resolve();
}
const telemetry = await Game.isTelemetryDisabled();
// If telemetry servers are not disabled