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
This commit is contained in:
JustArchi
2016-04-16 19:24:04 +02:00
parent 387f0dd1c7
commit 891d40afe1

View File

@@ -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