diff --git a/ArchiSteamFarm.sln.DotSettings b/ArchiSteamFarm.sln.DotSettings index d027f800b..b12394f8f 100644 --- a/ArchiSteamFarm.sln.DotSettings +++ b/ArchiSteamFarm.sln.DotSettings @@ -1,6 +1,93 @@  + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + HINT + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + USE_TABS_ONLY + Required + Required + Required + Required END_OF_LINE END_OF_LINE + True END_OF_LINE END_OF_LINE TOGETHER_SAME_LINE diff --git a/ArchiSteamFarm/ArchiWebHandler.cs b/ArchiSteamFarm/ArchiWebHandler.cs index b35d08725..f261ea5ed 100644 --- a/ArchiSteamFarm/ArchiWebHandler.cs +++ b/ArchiSteamFarm/ArchiWebHandler.cs @@ -270,15 +270,14 @@ namespace ArchiSteamFarm { HashSet result = new HashSet(); - foreach (HtmlNode htmlNode in htmlNodes) { - string miniProfile = htmlNode.GetAttributeValue("data-miniprofile", null); + foreach (string miniProfile in htmlNodes.Select(htmlNode => htmlNode.GetAttributeValue("data-miniprofile", null))) { if (string.IsNullOrEmpty(miniProfile)) { Logging.LogNullError(nameof(miniProfile), Bot.BotName); return null; } uint steamID3; - if (!uint.TryParse(miniProfile, out steamID3) || steamID3 == 0) { + if (!uint.TryParse(miniProfile, out steamID3) || (steamID3 == 0)) { Logging.LogNullError(nameof(steamID3), Bot.BotName); return null; } @@ -342,7 +341,7 @@ namespace ArchiSteamFarm { string request = SteamCommunityURL + "/mobileconf/details/" + confirmation.ID + "?l=english&p=" + deviceID + "&a=" + SteamID + "&k=" + WebUtility.UrlEncode(confirmationHash) + "&t=" + time + "&m=android&tag=conf"; Steam.ConfirmationDetails response = await WebBrowser.UrlGetToJsonResultRetry(request).ConfigureAwait(false); - if ((response == null) || !response.Success) { + if (!response?.Success != true) { return null; } @@ -741,16 +740,16 @@ namespace ArchiSteamFarm { Dictionary> descriptionMap = new Dictionary>(); foreach (JToken description in descriptions.Where(description => description != null)) { - string classIDString = description["classid"].ToString(); + string classIDString = description["classid"]?.ToString(); if (string.IsNullOrEmpty(classIDString)) { Logging.LogNullError(nameof(classIDString), Bot.BotName); - return null; + continue; } ulong classID; if (!ulong.TryParse(classIDString, out classID) || (classID == 0)) { Logging.LogNullError(nameof(classID), Bot.BotName); - return null; + continue; } if (descriptionMap.ContainsKey(classID)) { @@ -759,27 +758,27 @@ namespace ArchiSteamFarm { uint appID = 0; - string hashName = description["market_hash_name"].ToString(); + string hashName = description["market_hash_name"]?.ToString(); if (!string.IsNullOrEmpty(hashName)) { appID = GetAppIDFromMarketHashName(hashName); } if (appID == 0) { - string appIDString = description["appid"].ToString(); + string appIDString = description["appid"]?.ToString(); if (string.IsNullOrEmpty(appIDString)) { Logging.LogNullError(nameof(appIDString), Bot.BotName); - return null; + continue; } - if (!uint.TryParse(appIDString, out appID)) { + if (!uint.TryParse(appIDString, out appID) || (appID == 0)) { Logging.LogNullError(nameof(appID), Bot.BotName); - return null; + continue; } } Steam.Item.EType type = Steam.Item.EType.Unknown; - string descriptionType = description["type"].ToString(); + string descriptionType = description["type"]?.ToString(); if (!string.IsNullOrEmpty(descriptionType)) { type = GetItemType(descriptionType); } @@ -808,6 +807,9 @@ namespace ArchiSteamFarm { return null; } + steamItem.AppID = Steam.Item.SteamAppID; + steamItem.ContextID = Steam.Item.SteamCommunityContextID; + Tuple description; if (descriptionMap.TryGetValue(steamItem.ClassID, out description)) { steamItem.RealAppID = description.Item1; diff --git a/ArchiSteamFarm/JSON/Steam.cs b/ArchiSteamFarm/JSON/Steam.cs index 02e66eba8..73f30de0e 100644 --- a/ArchiSteamFarm/JSON/Steam.cs +++ b/ArchiSteamFarm/JSON/Steam.cs @@ -51,7 +51,7 @@ namespace ArchiSteamFarm.JSON { TradingCard } - internal uint AppID { get; private set; } + internal uint AppID { get; set; } [JsonProperty(PropertyName = "appid", Required = Required.DisallowNull)] [SuppressMessage("ReSharper", "UnusedMember.Local")] @@ -76,7 +76,7 @@ namespace ArchiSteamFarm.JSON { } } - internal ulong ContextID { get; private set; } + internal ulong ContextID { get; set; } [JsonProperty(PropertyName = "contextid", Required = Required.DisallowNull)] [SuppressMessage("ReSharper", "UnusedMember.Local")]