Make Bot.RefreshCMs() not fatal

Works around latest nightly Mono fuckup by the way
This commit is contained in:
JustArchi
2016-02-21 22:19:55 +01:00
parent 6feb1a46cc
commit 08b7f18796

View File

@@ -112,17 +112,22 @@ namespace ArchiSteamFarm {
internal static async Task RefreshCMs() {
bool initialized = false;
while (!initialized) {
for (byte i = 0; i < 5 && !initialized; i++) {
try {
Logging.LogGenericInfo("Refreshing list of CMs...");
await SteamDirectory.Initialize().ConfigureAwait(false);
initialized = true;
Logging.LogGenericInfo("Success!");
} catch (Exception e) {
Logging.LogGenericException(e);
await Utilities.SleepAsync(5000).ConfigureAwait(false);
}
}
if (initialized) {
Logging.LogGenericInfo("Success!");
} else {
Logging.LogGenericWarning("Failed to initialize list of CMs after 5 tries, ASF will use built-in SK2 list, it may take a while to connect");
}
}
internal Bot(string botName) {