diff --git a/ArchiSteamFarm/MobileAuthenticator.cs b/ArchiSteamFarm/MobileAuthenticator.cs index fd7e017ec..8d31e9694 100644 --- a/ArchiSteamFarm/MobileAuthenticator.cs +++ b/ArchiSteamFarm/MobileAuthenticator.cs @@ -55,7 +55,6 @@ namespace ArchiSteamFarm { private const byte CodeDigits = 5; private const byte CodeInterval = 30; - private const byte MinimumTimeLeft = 5; private static readonly char[] CodeCharacters = { '2', '3', '4', '5', '6', '7', '8', '9', 'B', 'C', @@ -187,12 +186,12 @@ namespace ArchiSteamFarm { } internal async Task GenerateToken() { - Tuple tokenTimePair = await GenerateTokenTimePair().ConfigureAwait(false); - if (tokenTimePair != null) { - return tokenTimePair.Item1; + uint time = await GetSteamTime().ConfigureAwait(false); + if (time != 0) { + return GenerateTokenForTime(time); } - Logging.LogNullError(nameof(tokenTimePair), Bot.BotName); + Logging.LogNullError(nameof(time), Bot.BotName); return null; } @@ -204,12 +203,7 @@ namespace ArchiSteamFarm { } byte timeLeft = (byte) (CodeInterval - time % CodeInterval); - if (timeLeft >= MinimumTimeLeft) { - return new Tuple(GenerateTokenForTime(time), timeLeft); - } - - await Task.Delay(timeLeft * 1000).ConfigureAwait(false); - return new Tuple(GenerateTokenForTime(time + timeLeft), CodeInterval); + return new Tuple(GenerateTokenForTime(time), timeLeft); } internal async Task> GetConfirmations() {