From 11e429a73fc4df51b4473e5053f58081534d3ccc Mon Sep 17 00:00:00 2001 From: JustArchi Date: Thu, 23 Feb 2017 17:07:51 +0100 Subject: [PATCH] Don't accept STM trades when we can't check our inventory It's nice to note that MatchEverything doesn't even bother with loading the inventory at all. --- ArchiSteamFarm/Trading.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ArchiSteamFarm/Trading.cs b/ArchiSteamFarm/Trading.cs index 40472fb4f..137261ca9 100644 --- a/ArchiSteamFarm/Trading.cs +++ b/ArchiSteamFarm/Trading.cs @@ -249,7 +249,9 @@ namespace ArchiSteamFarm { HashSet inventory = await Bot.ArchiWebHandler.GetMySteamInventory(false, new HashSet { Steam.Item.EType.TradingCard }).ConfigureAwait(false); if ((inventory == null) || (inventory.Count == 0)) { - return new ParseTradeResult(tradeOffer.TradeOfferID, ParseTradeResult.EResult.AcceptedWithItemLose); // OK, assume that this trade is valid, we can't check our EQ + // If we can't check our inventory when not using MatchEverything, this is a temporary failure + Bot.ArchiLogger.LogGenericWarning(string.Join(Strings.ErrorIsEmpty, nameof(inventory))); + return new ParseTradeResult(tradeOffer.TradeOfferID, ParseTradeResult.EResult.RejectedTemporarily); } // Get appIDs we're interested in @@ -258,9 +260,10 @@ namespace ArchiSteamFarm { // Now remove from our inventory all items we're NOT interested in inventory.RemoveWhere(item => !appIDs.Contains(item.RealAppID)); - // If for some reason Valve is talking crap and we can't find mentioned items, assume OK + // If for some reason Valve is talking crap and we can't find mentioned items, this is a temporary failure if (inventory.Count == 0) { - return new ParseTradeResult(tradeOffer.TradeOfferID, ParseTradeResult.EResult.AcceptedWithItemLose); + Bot.ArchiLogger.LogGenericWarning(string.Join(Strings.ErrorIsEmpty, nameof(inventory))); + return new ParseTradeResult(tradeOffer.TradeOfferID, ParseTradeResult.EResult.RejectedTemporarily); } // Now let's create a map which maps items to their amount in our EQ