diff --git a/ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/SteamTokenDumperPlugin.cs b/ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/SteamTokenDumperPlugin.cs index 486683728..d5349a582 100644 --- a/ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/SteamTokenDumperPlugin.cs +++ b/ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/SteamTokenDumperPlugin.cs @@ -362,6 +362,10 @@ internal sealed class SteamTokenDumperPlugin : OfficialPlugin, IASF, IBot, IBotC using (HashSet.Enumerator enumerator = appIDsToRefresh.GetEnumerator()) { while (true) { + if (!bot.IsConnectedAndLoggedOn) { + return; + } + while ((appIDsThisRound.Count < SharedInfo.AppInfosPerSingleRequest) && enumerator.MoveNext()) { appIDsThisRound.Add(enumerator.Current); } @@ -370,10 +374,6 @@ internal sealed class SteamTokenDumperPlugin : OfficialPlugin, IASF, IBot, IBotC break; } - if (!bot.IsConnectedAndLoggedOn) { - return; - } - bot.ArchiLogger.LogGenericInfo(string.Format(CultureInfo.CurrentCulture, Strings.BotRetrievingAppAccessTokens, appIDsThisRound.Count)); SteamApps.PICSTokensCallback response; @@ -383,7 +383,9 @@ internal sealed class SteamTokenDumperPlugin : OfficialPlugin, IASF, IBot, IBotC } catch (Exception e) { bot.ArchiLogger.LogGenericWarningException(e); - return; + appIDsThisRound.Clear(); + + continue; } bot.ArchiLogger.LogGenericInfo(string.Format(CultureInfo.CurrentCulture, Strings.BotFinishedRetrievingAppAccessTokens, appIDsThisRound.Count)); @@ -399,6 +401,10 @@ internal sealed class SteamTokenDumperPlugin : OfficialPlugin, IASF, IBot, IBotC using (HashSet.Enumerator enumerator = appIDsToRefresh.GetEnumerator()) { while (true) { + if (!bot.IsConnectedAndLoggedOn) { + return; + } + while ((appIDsThisRound.Count < SharedInfo.AppInfosPerSingleRequest) && enumerator.MoveNext()) { appIDsThisRound.Add(enumerator.Current); } @@ -407,10 +413,6 @@ internal sealed class SteamTokenDumperPlugin : OfficialPlugin, IASF, IBot, IBotC break; } - if (!bot.IsConnectedAndLoggedOn) { - return; - } - bot.ArchiLogger.LogGenericInfo(string.Format(CultureInfo.CurrentCulture, Strings.BotRetrievingAppInfos, appIDsThisRound.Count)); AsyncJobMultiple.ResultSet response; @@ -420,7 +422,9 @@ internal sealed class SteamTokenDumperPlugin : OfficialPlugin, IASF, IBot, IBotC } catch (Exception e) { bot.ArchiLogger.LogGenericWarningException(e); - return; + appIDsThisRound.Clear(); + + continue; } if (response.Results == null) { @@ -461,7 +465,7 @@ internal sealed class SteamTokenDumperPlugin : OfficialPlugin, IASF, IBot, IBotC } catch (Exception e) { bot.ArchiLogger.LogGenericWarningException(e); - return; + continue; } bot.ArchiLogger.LogGenericInfo(string.Format(CultureInfo.CurrentCulture, Strings.BotFinishedRetrievingDepotKeys, depotTasks.Count));