Skip to content
This repository has been archived by the owner on Apr 27, 2023. It is now read-only.

Commit

Permalink
Update GlobalConfig.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
Awbugl committed Mar 22, 2023
1 parent 2055d9a commit 171a68f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Core/GlobalConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ internal static void Init()
Environment.Exit(0);
}

Config = JsonConvert.DeserializeObject<ConfigItem>(File.ReadAllText("apiconfig.json"))!;
Config = JsonConvert.DeserializeObject<ConfigItem>(File.ReadAllText(apiconfig))!;

var tokens = Path.Combine(AppContext.BaseDirectory, "tokens.json");
if (!File.Exists(tokens)) File.WriteAllText(tokens, "[]");
Tokens = JsonConvert.DeserializeObject<HashSet<string>>(File.ReadAllText("tokens.json"))!;
Tokens = JsonConvert.DeserializeObject<HashSet<string>>(File.ReadAllText(tokens))!;

Directory.CreateDirectory(Path.Combine(Config.DataPath, "log"));
Directory.CreateDirectory(Path.Combine(Config.DataPath, "database"));
Expand All @@ -74,8 +74,8 @@ internal static void Init()
Console.WriteLine("cert file not found, get infomation from main server...");

Dictionary<string, string> json = CertResponse.GetContent();
File.WriteAllBytes(Config.CertFileName, Convert.FromBase64String(json["cert"]));
File.WriteAllBytes(arccert, Convert.FromBase64String(json["cert"]));

Console.WriteLine("cert file created.");
}
}
Expand All @@ -95,7 +95,7 @@ internal static void CheckUpdate()
Console.WriteLine("Register account task completed.");
}
}

BackgroundService.ArcUpdate();
Console.Clear();
}
Expand All @@ -105,12 +105,12 @@ internal static void Reload(string fileName)
switch (fileName)
{
case "apiconfig.json":
Config = JsonConvert.DeserializeObject<ConfigItem>(File.ReadAllText("apiconfig.json"))!;
Config = JsonConvert.DeserializeObject<ConfigItem>(File.ReadAllText(Path.Combine(AppContext.BaseDirectory, "apiconfig.json")))!;
ArcaeaFetch.Init();
break;

case "tokens.json":
Tokens = JsonConvert.DeserializeObject<HashSet<string>>(File.ReadAllText("tokens.json"))!;
Tokens = JsonConvert.DeserializeObject<HashSet<string>>(File.ReadAllText(Path.Combine(AppContext.BaseDirectory, "tokens.json")))!;
break;
}
}
Expand Down

0 comments on commit 171a68f

Please sign in to comment.