From b6a5b8942cf6b431a0417f95034539b2aa5ded85 Mon Sep 17 00:00:00 2001 From: JustArchi Date: Wed, 16 Dec 2015 09:39:03 +0100 Subject: [PATCH] Actually do not wait 25 minutes after expired login keys --- ArchiSteamFarm/Bot.cs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/ArchiSteamFarm/Bot.cs b/ArchiSteamFarm/Bot.cs index 70e1d084c..113fbf2d7 100755 --- a/ArchiSteamFarm/Bot.cs +++ b/ArchiSteamFarm/Bot.cs @@ -741,15 +741,18 @@ namespace ArchiSteamFarm { } break; case EResult.InvalidPassword: - Logging.LogGenericWarning(BotName, "Unable to login to Steam: " + result + ", will retry after a longer while"); + Logging.LogGenericWarning(BotName, "Unable to login to Steam: " + result); await Stop().ConfigureAwait(false); - // InvalidPassword means that we must assume login key has expired - LoginKey = null; - File.Delete(LoginKeyFile); - - // InvalidPassword also means that we might get captcha or other network-based throttling - await Utilities.SleepAsync(25 * 60 * 1000).ConfigureAwait(false); // Captcha disappears after around 20 minutes, so we make it 25 + // InvalidPassword means usually that login key has expired, if we used it + if (!string.IsNullOrEmpty(LoginKey)) { + LoginKey = null; + File.Delete(LoginKeyFile); + Logging.LogGenericInfo(BotName, "Removed expired login key, reconnecting..."); + } else { // If we didn't use login key, InvalidPassword usually means we got captcha or other network-based throttling + Logging.LogGenericInfo(BotName, "Will retry after 25 minutes..."); + await Utilities.SleepAsync(25 * 60 * 1000).ConfigureAwait(false); // Captcha disappears after around 20 minutes, so we make it 25 + } // After all of that, try again await Start().ConfigureAwait(false);