Add optional donation trade logging info

This commit is contained in:
JustArchi
2018-04-21 21:45:45 +02:00
parent 9aa168afd2
commit 691812aa67
3 changed files with 18 additions and 1 deletions

View File

@@ -78,6 +78,15 @@ namespace ArchiSteamFarm.Localization {
}
}
/// <summary>
/// Wyszukuje zlokalizowany ciąg podobny do ciągu Accepted donation trade: {0}.
/// </summary>
internal static string BotAcceptedDonationTrade {
get {
return ResourceManager.GetString("BotAcceptedDonationTrade", resourceCulture);
}
}
/// <summary>
/// Wyszukuje zlokalizowany ciąg podobny do ciągu Accepting gift: {0}....
/// </summary>

View File

@@ -661,4 +661,8 @@ StackTrace:
<value>Usage of {0} is deprecated and will be removed in future versions of the program. Please use {1} instead.</value>
<comment>{0} will be replaced by the name of deprecated property (such as argument, config property or likewise), {1} will be replaced by the name of valid replacement (such as another argument or config property)</comment>
</data>
<data name="BotAcceptedDonationTrade" xml:space="preserve">
<value>Accepted donation trade: {0}</value>
<comment>{0} will be replaced by trade's ID (number)</comment>
</data>
</root>

View File

@@ -190,7 +190,11 @@ namespace ArchiSteamFarm {
case ParseTradeResult.EResult.AcceptedWithItemLose:
case ParseTradeResult.EResult.AcceptedWithoutItemLose:
Bot.ArchiLogger.LogGenericInfo(string.Format(Strings.AcceptingTrade, tradeOffer.TradeOfferID));
await Bot.ArchiWebHandler.AcceptTradeOffer(tradeOffer.TradeOfferID).ConfigureAwait(false);
if (await Bot.ArchiWebHandler.AcceptTradeOffer(tradeOffer.TradeOfferID).ConfigureAwait(false)) {
if (tradeOffer.ItemsToReceive.Count > tradeOffer.ItemsToGive.Count) {
Bot.ArchiLogger.LogGenericTrace(string.Format(Strings.BotAcceptedDonationTrade, tradeOffer.TradeOfferID));
}
}
break;
case ParseTradeResult.EResult.RejectedPermanently:
case ParseTradeResult.EResult.RejectedTemporarily: