Implement workaround for #380

This commit is contained in:
JustArchi
2016-12-24 19:27:36 +01:00
parent 829bd8ce2f
commit 9d882784ee
4 changed files with 19 additions and 13 deletions

View File

@@ -193,13 +193,13 @@ namespace ArchiSteamFarm {
await RestartOrExit().ConfigureAwait(false);
}
internal static void InitBots() {
internal static async Task InitBots() {
if (Bot.Bots.Count != 0) {
return;
}
// Before attempting to connect, initialize our list of CMs
Bot.InitializeCMs(Program.GlobalDatabase.CellID, Program.GlobalDatabase.ServerListProvider);
await Bot.InitializeCMs(Program.GlobalDatabase.CellID, Program.GlobalDatabase.ServerListProvider).ConfigureAwait(false);
foreach (string botName in Directory.EnumerateFiles(SharedInfo.ConfigDirectory, "*.json").Select(Path.GetFileNameWithoutExtension)) {
switch (botName) {