mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-13 23:20:37 +00:00
Open global database for public API
This commit is contained in:
@@ -40,7 +40,6 @@ namespace ArchiSteamFarm {
|
||||
internal static class Program {
|
||||
internal static byte LoadBalancingDelay => Math.Max(ASF.GlobalConfig?.LoginLimiterDelay ?? 0, GlobalConfig.DefaultLoginLimiterDelay);
|
||||
|
||||
internal static GlobalDatabase GlobalDatabase { get; private set; }
|
||||
internal static bool ProcessRequired { get; private set; }
|
||||
internal static bool RestartAllowed { get; private set; } = true;
|
||||
|
||||
@@ -337,9 +336,9 @@ namespace ArchiSteamFarm {
|
||||
await Task.Delay(5 * 1000).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
GlobalDatabase = await GlobalDatabase.CreateOrLoad(globalDatabaseFile).ConfigureAwait(false);
|
||||
GlobalDatabase globalDatabase = await GlobalDatabase.CreateOrLoad(globalDatabaseFile).ConfigureAwait(false);
|
||||
|
||||
if (GlobalDatabase == null) {
|
||||
if (globalDatabase == null) {
|
||||
ASF.ArchiLogger.LogGenericError(string.Format(Strings.ErrorDatabaseInvalid, globalDatabaseFile));
|
||||
await Task.Delay(5 * 1000).ConfigureAwait(false);
|
||||
await Exit(1).ConfigureAwait(false);
|
||||
@@ -347,9 +346,11 @@ namespace ArchiSteamFarm {
|
||||
return;
|
||||
}
|
||||
|
||||
ASF.InitGlobalDatabase(globalDatabase);
|
||||
|
||||
// If debugging is on, we prepare debug directory prior to running
|
||||
if (Debugging.IsUserDebugging) {
|
||||
ASF.ArchiLogger.LogGenericDebug(SharedInfo.GlobalDatabaseFileName + ": " + JsonConvert.SerializeObject(GlobalDatabase, Formatting.Indented));
|
||||
ASF.ArchiLogger.LogGenericDebug(SharedInfo.GlobalDatabaseFileName + ": " + JsonConvert.SerializeObject(ASF.GlobalDatabase, Formatting.Indented));
|
||||
Logging.EnableTraceLogging();
|
||||
|
||||
if (Directory.Exists(SharedInfo.DebugDirectory)) {
|
||||
|
||||
Reference in New Issue
Block a user