mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-01 22:20:52 +00:00
Make Bot.RefreshCMs() not fatal
Works around latest nightly Mono fuckup by the way
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user