From 6afafa4550ff06df8acc6f93f8133ec0a8dd411a Mon Sep 17 00:00:00 2001 From: JustArchi Date: Fri, 11 Jan 2019 02:50:36 +0100 Subject: [PATCH] Misc --- ArchiSteamFarm/ArchiWebHandler.cs | 18 +++++------------- ArchiSteamFarm/Trading.cs | 2 +- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/ArchiSteamFarm/ArchiWebHandler.cs b/ArchiSteamFarm/ArchiWebHandler.cs index 69d8da38c..7a997775e 100644 --- a/ArchiSteamFarm/ArchiWebHandler.cs +++ b/ArchiSteamFarm/ArchiWebHandler.cs @@ -1066,7 +1066,7 @@ namespace ArchiSteamFarm { return null; } - Dictionary<(uint AppID, uint ContextID, ulong ClassID), (uint RealAppID, Steam.Asset.EType Type)> descriptions = new Dictionary<(uint AppID, uint ContextID, ulong ClassID), (uint RealAppID, Steam.Asset.EType Type)>(); + Dictionary<(uint AppID, ulong ClassID), (uint RealAppID, Steam.Asset.EType Type)> descriptions = new Dictionary<(uint AppID, ulong ClassID), (uint RealAppID, Steam.Asset.EType Type)>(); foreach (KeyValue description in response["descriptions"].Children) { uint appID = description["appid"].AsUnsignedInteger(); @@ -1077,14 +1077,6 @@ namespace ArchiSteamFarm { return null; } - uint contextID = description["contextid"].AsUnsignedInteger(); - - if (contextID == 0) { - Bot.ArchiLogger.LogNullError(nameof(contextID)); - - return null; - } - ulong classID = description["classid"].AsUnsignedLong(); if (classID == 0) { @@ -1093,7 +1085,7 @@ namespace ArchiSteamFarm { return null; } - if (descriptions.ContainsKey((appID, contextID, classID))) { + if (descriptions.ContainsKey((appID, classID))) { continue; } @@ -1114,7 +1106,7 @@ namespace ArchiSteamFarm { } } - descriptions[(appID, contextID, classID)] = (realAppID, type); + descriptions[(appID, classID)] = (realAppID, type); } HashSet result = new HashSet(); @@ -2383,7 +2375,7 @@ namespace ArchiSteamFarm { return uri.AbsolutePath.StartsWith("/login", StringComparison.Ordinal) || uri.Host.Equals("lostauth"); } - private static bool ParseItems(IReadOnlyDictionary<(uint AppID, uint ContextID, ulong ClassID), (uint RealAppID, Steam.Asset.EType Type)> descriptions, IReadOnlyCollection input, ICollection output) { + private static bool ParseItems(IReadOnlyDictionary<(uint AppID, ulong ClassID), (uint RealAppID, Steam.Asset.EType Type)> descriptions, IReadOnlyCollection input, ICollection output) { if ((descriptions == null) || (input == null) || (input.Count == 0) || (output == null)) { ASF.ArchiLogger.LogNullError(nameof(descriptions) + " || " + nameof(input) + " || " + nameof(output)); @@ -2426,7 +2418,7 @@ namespace ArchiSteamFarm { uint realAppID = 0; Steam.Asset.EType type = Steam.Asset.EType.Unknown; - if (descriptions.TryGetValue((appID, contextID, classID), out (uint RealAppID, Steam.Asset.EType Type) description)) { + if (descriptions.TryGetValue((appID, classID), out (uint RealAppID, Steam.Asset.EType Type) description)) { realAppID = description.RealAppID; type = description.Type; } diff --git a/ArchiSteamFarm/Trading.cs b/ArchiSteamFarm/Trading.cs index e98526efa..8137a3eb8 100644 --- a/ArchiSteamFarm/Trading.cs +++ b/ArchiSteamFarm/Trading.cs @@ -317,7 +317,7 @@ namespace ArchiSteamFarm { uint amountToGive = itemToGive.Amount; HashSet itemsToRemove = new HashSet(); - // Keep in mind that ClassID is unique only within appID/contextID scope - we can do it like this because we're not dealing with non-Steam items here (otherwise we'd need to check appID and contextID too) + // Keep in mind that ClassID is unique only within appID scope - we can do it like this because we're not dealing with non-Steam items here (otherwise we'd need to check appID too) foreach (Steam.Asset item in inventory.Where(item => item.ClassID == itemToGive.ClassID)) { if (amountToGive >= item.Amount) { itemsToRemove.Add(item);