Push 2FA requests ahead of queue

This commit is contained in:
JustArchi
2015-12-06 19:38:09 +01:00
parent 3995b3a083
commit 7e10e6ba81

View File

@@ -233,7 +233,12 @@ namespace ArchiSteamFarm {
IsRunning = true;
Logging.LogGenericInfo(BotName, "Starting...");
await Program.LimitSteamRequestsAsync().ConfigureAwait(false);
// 2FA tokens are expiring soon, use limiter only when we don't have any pending
if (TwoFactorAuth == null) {
await Program.LimitSteamRequestsAsync().ConfigureAwait(false);
}
SteamClient.Connect();
var fireAndForget = Task.Run(() => HandleCallbacks());
@@ -398,7 +403,12 @@ namespace ArchiSteamFarm {
}
Logging.LogGenericWarning(BotName, "Disconnected from Steam, reconnecting...");
await Program.LimitSteamRequestsAsync().ConfigureAwait(false);
// 2FA tokens are expiring soon, use limiter only when we don't have any pending
if (TwoFactorAuth == null) {
await Program.LimitSteamRequestsAsync().ConfigureAwait(false);
}
SteamClient.Connect();
}
@@ -533,6 +543,10 @@ namespace ArchiSteamFarm {
case EResult.OK:
Logging.LogGenericInfo(BotName, "Successfully logged on!");
// Reset one-time-only access tokens
AuthCode = null;
TwoFactorAuth = null;
if (!SteamNickname.Equals("null")) {
SteamFriends.SetPersonaName(SteamNickname);
}