diff --git a/ArchiSteamFarm.OfficialPlugins.ItemsMatcher/RemoteCommunication.cs b/ArchiSteamFarm.OfficialPlugins.ItemsMatcher/RemoteCommunication.cs index de1cd062f..a00d8cc12 100644 --- a/ArchiSteamFarm.OfficialPlugins.ItemsMatcher/RemoteCommunication.cs +++ b/ArchiSteamFarm.OfficialPlugins.ItemsMatcher/RemoteCommunication.cs @@ -655,7 +655,7 @@ internal sealed class RemoteCommunication : IAsyncDisposable, IDisposable { return; } - bool hasWorkingAuthenticator = false; + HashSet pendingMobileTradeOfferIDs = new(); byte maxTradeHoldDuration = ASF.GlobalConfig?.MaxTradeHoldDuration ?? GlobalConfig.DefaultMaxTradeHoldDuration; @@ -836,21 +836,7 @@ internal sealed class RemoteCommunication : IAsyncDisposable, IDisposable { (bool success, HashSet? mobileTradeOfferIDs) = await Bot.ArchiWebHandler.SendTradeOffer(listedUser.SteamID, itemsToGive, itemsToReceive, listedUser.TradeToken, true).ConfigureAwait(false); if (mobileTradeOfferIDs?.Count > 0) { - (bool twoFactorSuccess, _, _) = await Bot.Actions.HandleTwoFactorAuthenticationConfirmations(true, Confirmation.EType.Trade, mobileTradeOfferIDs, true).ConfigureAwait(false); - - if (!twoFactorSuccess) { - Bot.ArchiLogger.LogGenericWarning(string.Format(CultureInfo.CurrentCulture, Strings.WarningFailedWithError, nameof(twoFactorSuccess))); - - if (hasWorkingAuthenticator) { - // We can assume this to be just a temporary Steam issue, and we may try to continue the matching with other users - break; - } - - // User didn't confirm even one single trade, naturally this could be just a coincidence, but it's more likely that his ASF 2FA credentials are invalid and this is why we'll refuse to continue for now - return; - } - - hasWorkingAuthenticator = true; + pendingMobileTradeOfferIDs.UnionWith(mobileTradeOfferIDs); } if (!success) { @@ -934,6 +920,16 @@ internal sealed class RemoteCommunication : IAsyncDisposable, IDisposable { } } + if (pendingMobileTradeOfferIDs.Count > 0) { + (bool twoFactorSuccess, _, _) = await Bot.Actions.HandleTwoFactorAuthenticationConfirmations(true, Confirmation.EType.Trade, pendingMobileTradeOfferIDs, true).ConfigureAwait(false); + + if (!twoFactorSuccess) { + Bot.ArchiLogger.LogGenericWarning(string.Format(CultureInfo.CurrentCulture, Strings.WarningFailedWithError, nameof(twoFactorSuccess))); + + return; + } + } + Bot.ArchiLogger.LogGenericInfo(string.Format(CultureInfo.CurrentCulture, Localization.Strings.ActivelyMatchingItemsRound, matchedSets)); } }