diff --git a/ArchiSteamFarm/Bot.cs b/ArchiSteamFarm/Bot.cs index b8586f58b..0eeb3ab60 100755 --- a/ArchiSteamFarm/Bot.cs +++ b/ArchiSteamFarm/Bot.cs @@ -610,6 +610,8 @@ namespace ArchiSteamFarm { // Remove from our pending inventory all items that are not steam cards and boosters inventory.RemoveWhere(item => item.Type != Steam.Item.EType.TradingCard && item.Type != Steam.Item.EType.FoilTradingCard && item.Type != Steam.Item.EType.BoosterPack); + inventory.TrimExcess(); + if (inventory.Count == 0) { return "Nothing to send, inventory seems empty!"; } diff --git a/ArchiSteamFarm/Trading.cs b/ArchiSteamFarm/Trading.cs index e5dae8e87..75792e39a 100644 --- a/ArchiSteamFarm/Trading.cs +++ b/ArchiSteamFarm/Trading.cs @@ -173,6 +173,7 @@ namespace ArchiSteamFarm { // Now remove from our inventory all items we're NOT interested in inventory.RemoveWhere(item => !appIDs.Contains(item.RealAppID)); + inventory.TrimExcess(); // If for some reason Valve is talking crap and we can't find mentioned items, assume OK if (inventory.Count == 0) { diff --git a/ArchiSteamFarm/WCF.cs b/ArchiSteamFarm/WCF.cs index 07a3f3c23..1f7b071ba 100644 --- a/ArchiSteamFarm/WCF.cs +++ b/ArchiSteamFarm/WCF.cs @@ -122,8 +122,13 @@ namespace ArchiSteamFarm { Logging.LogGenericInfo("Received command: " + input); - string command = '!' + input; - string output = bot.Response(Program.GlobalConfig.SteamOwnerID, command).Result; // TODO: This should be asynchronous + string output; + if (Program.GlobalConfig.SteamOwnerID == 0) { + output = "Refusing to handle request because SteamOwnerID is not set!"; + } else { + string command = '!' + input; + output = bot.Response(Program.GlobalConfig.SteamOwnerID, command).Result; // TODO: This should be asynchronous + } Logging.LogGenericInfo("Answered to command: " + input + " with: " + output); return output;