State count of handled confirmations in 2fa commands

This commit is contained in:
JustArchi
2019-04-08 21:15:09 +02:00
parent 8d38fd04a5
commit 285449b3ea
3 changed files with 16 additions and 3 deletions

View File

@@ -106,7 +106,7 @@ namespace ArchiSteamFarm {
if ((acceptedTradeOfferIDs == null) || (acceptedTradeOfferIDs.Count == 0)) {
bool result = await Bot.BotDatabase.MobileAuthenticator.HandleConfirmations(confirmations, accept).ConfigureAwait(false);
return (result, result ? Strings.Success : Strings.WarningFailed);
return (result, result ? string.Format(Strings.BotHandledConfirmations, confirmations.Count) : Strings.WarningFailed);
}
IList<Steam.ConfirmationDetails> results = await Utilities.InParallel(confirmations.Select(Bot.BotDatabase.MobileAuthenticator.GetConfirmationDetails)).ConfigureAwait(false);
@@ -133,11 +133,11 @@ namespace ArchiSteamFarm {
// Check if those are all that we were expected to confirm
if (acceptedTradeOfferIDs.All(handledTradeOfferIDs.Contains)) {
return (true, Strings.Success);
return (true, string.Format(Strings.BotHandledConfirmations, acceptedTradeOfferIDs.Count));
}
}
return (!waitIfNeeded, waitIfNeeded ? Strings.Success : string.Format(Strings.ErrorRequestFailedTooManyTimes, WebBrowser.MaxTries));
return (!waitIfNeeded, !waitIfNeeded ? Strings.Success : string.Format(Strings.ErrorRequestFailedTooManyTimes, WebBrowser.MaxTries));
}
[PublicAPI]

View File

@@ -321,6 +321,15 @@ namespace ArchiSteamFarm.Localization {
}
}
/// <summary>
/// Wyszukuje zlokalizowany ciąg podobny do ciągu Successfully handled {0} confirmations..
/// </summary>
public static string BotHandledConfirmations {
get {
return ResourceManager.GetString("BotHandledConfirmations", resourceCulture);
}
}
/// <summary>
/// Wyszukuje zlokalizowany ciąg podobny do ciągu Bot has no wallet..
/// </summary>

View File

@@ -720,4 +720,8 @@ StackTrace:
<data name="ErrorSingleInstanceRequired" xml:space="preserve">
<value>ASF process is already running for this working directory, aborting!</value>
</data>
<data name="BotHandledConfirmations" xml:space="preserve">
<value>Successfully handled {0} confirmations.</value>
<comment>{0} will be replaced by number of confirmations</comment>
</data>
</root>