diff --git a/ArchiSteamFarm/Bot.cs b/ArchiSteamFarm/Bot.cs index e517c87c1..80e07091e 100755 --- a/ArchiSteamFarm/Bot.cs +++ b/ArchiSteamFarm/Bot.cs @@ -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) {