This commit is contained in:
JustArchi
2017-01-06 22:18:41 +01:00
parent 436386586c
commit 88006ef103
3 changed files with 36 additions and 6 deletions

View File

@@ -1413,6 +1413,15 @@ namespace ArchiSteamFarm.Localization {
}
}
/// <summary>
/// Looks up a localized string similar to Please review our privacy policy section on the wiki if you&apos;re concerned about what ASF is in fact doing!.
/// </summary>
internal static string WarningPrivacyPolicy {
get {
return ResourceManager.GetString("WarningPrivacyPolicy", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to ASF detected unsupported runtime version, program might NOT run correctly in current environment. You&apos;re running it at your own risk without support!.
/// </summary>
@@ -1493,5 +1502,14 @@ namespace ArchiSteamFarm.Localization {
return ResourceManager.GetString("WCFStarting", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to It looks like it&apos;s your first launch of the program, welcome!.
/// </summary>
internal static string Welcome {
get {
return ResourceManager.GetString("Welcome", resourceCulture);
}
}
}
}

View File

@@ -682,4 +682,10 @@ StackTrace:
<value>Initializing {0}...</value>
<comment>{0} will be replaced by service name that is being initialized</comment>
</data>
<data name="WarningPrivacyPolicy" xml:space="preserve">
<value>Please review our privacy policy section on the wiki if you're concerned about what ASF is in fact doing!</value>
</data>
<data name="Welcome" xml:space="preserve">
<value>It looks like it's your first launch of the program, welcome!</value>
</data>
</root>

View File

@@ -162,16 +162,16 @@ namespace ArchiSteamFarm {
if (!Runtime.IsRuntimeSupported) {
ArchiLogger.LogGenericError(Strings.WarningRuntimeUnsupported);
Thread.Sleep(10000);
await Task.Delay(10 * 1000).ConfigureAwait(false);
}
InitServices();
await InitServices().ConfigureAwait(false);
// If debugging is on, we prepare debug directory prior to running
if (GlobalConfig.Debug) {
if (Directory.Exists(SharedInfo.DebugDirectory)) {
Directory.Delete(SharedInfo.DebugDirectory, true);
Thread.Sleep(1000); // Dirty workaround giving Windows some time to sync
await Task.Delay(1000).ConfigureAwait(false); // Dirty workaround giving Windows some time to sync
}
Directory.CreateDirectory(SharedInfo.DebugDirectory);
@@ -195,22 +195,28 @@ namespace ArchiSteamFarm {
ASF.InitFileWatcher();
}
private static void InitServices() {
private static async Task InitServices() {
string globalConfigFile = Path.Combine(SharedInfo.ConfigDirectory, SharedInfo.GlobalConfigFileName);
GlobalConfig = GlobalConfig.Load(globalConfigFile);
if (GlobalConfig == null) {
ArchiLogger.LogGenericError(string.Format(Strings.ErrorGlobalConfigNotLoaded, globalConfigFile));
Thread.Sleep(5000);
await Task.Delay(5 * 1000).ConfigureAwait(false);
Exit(1);
}
string globalDatabaseFile = Path.Combine(SharedInfo.ConfigDirectory, SharedInfo.GlobalDatabaseFileName);
if (!File.Exists(globalDatabaseFile)) {
ArchiLogger.LogGenericInfo(Strings.Welcome);
ArchiLogger.LogGenericWarning(Strings.WarningPrivacyPolicy);
await Task.Delay(15 * 1000).ConfigureAwait(false);
}
GlobalDatabase = GlobalDatabase.Load(globalDatabaseFile);
if (GlobalDatabase == null) {
ArchiLogger.LogGenericError(string.Format(Strings.ErrorDatabaseInvalid, globalDatabaseFile));
Thread.Sleep(5000);
await Task.Delay(5 * 1000).ConfigureAwait(false);
Exit(1);
}