From 891d40afe11d0318b6130a7b7e053de5cb038196 Mon Sep 17 00:00:00 2001 From: JustArchi Date: Sat, 16 Apr 2016 19:24:04 +0200 Subject: [PATCH] Fix potential bug found by zinnerz We might !stop account waiting in invalid password or game playing condition, which will then initiate connect without checking if it's still valid to do so --- ArchiSteamFarm/Bot.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ArchiSteamFarm/Bot.cs b/ArchiSteamFarm/Bot.cs index 0d82f1072..f977be94b 100755 --- a/ArchiSteamFarm/Bot.cs +++ b/ArchiSteamFarm/Bot.cs @@ -1377,10 +1377,6 @@ namespace ArchiSteamFarm { return; } - if (!KeepRunning) { - return; - } - if (InvalidPassword) { InvalidPassword = false; if (!string.IsNullOrEmpty(BotDatabase.LoginKey)) { // InvalidPassword means usually that login key has expired, if we used it @@ -1402,6 +1398,10 @@ namespace ArchiSteamFarm { await Utilities.SleepAsync(Program.GlobalConfig.AccountPlayingDelay * 60 * 1000).ConfigureAwait(false); } + if (!KeepRunning || SteamClient.IsConnected) { + return; + } + Logging.LogGenericInfo("Reconnecting...", BotName); // 2FA tokens are expiring soon, use limiter only when we don't have any pending