From a40c117b73868ce29469116b2e33df70615473ed Mon Sep 17 00:00:00 2001 From: JustArchi Date: Sun, 9 Feb 2020 18:37:52 +0100 Subject: [PATCH] Remove excessive private gettes from assets Those getters are not required for item classification, and their removal decreases the request size, effectively increasing the amount of items we can send across one without running into POST size. At the same time 255 is still relevant in regards to Steam servers stability. --- ArchiSteamFarm/Json/Steam.cs | 7 ++----- ArchiSteamFarm/Trading.cs | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/ArchiSteamFarm/Json/Steam.cs b/ArchiSteamFarm/Json/Steam.cs index c1e235250..6fd368fef 100644 --- a/ArchiSteamFarm/Json/Steam.cs +++ b/ArchiSteamFarm/Json/Steam.cs @@ -97,6 +97,7 @@ namespace ArchiSteamFarm.Json { } #pragma warning restore IDE0051 +#pragma warning disable IDE0052 [JsonProperty(PropertyName = "assetid", Required = Required.DisallowNull)] [JetBrains.Annotations.NotNull] private string AssetIDText { @@ -118,13 +119,12 @@ namespace ArchiSteamFarm.Json { AssetID = assetID; } } +#pragma warning restore IDE0052 #pragma warning disable IDE0051 [JsonProperty(PropertyName = "classid", Required = Required.DisallowNull)] [JetBrains.Annotations.NotNull] private string ClassIDText { - get => ClassID.ToString(); - set { if (string.IsNullOrEmpty(value)) { ASF.ArchiLogger.LogNullError(nameof(value)); @@ -169,7 +169,6 @@ namespace ArchiSteamFarm.Json { [JsonProperty(PropertyName = "id", Required = Required.DisallowNull)] [JetBrains.Annotations.NotNull] private string IDText { - get => AssetIDText; set => AssetIDText = value; } #pragma warning restore IDE0051 @@ -178,8 +177,6 @@ namespace ArchiSteamFarm.Json { [JsonProperty(PropertyName = "instanceid", Required = Required.DisallowNull)] [JetBrains.Annotations.NotNull] private string InstanceIDText { - get => InstanceID.ToString(); - set { if (string.IsNullOrEmpty(value)) { return; diff --git a/ArchiSteamFarm/Trading.cs b/ArchiSteamFarm/Trading.cs index d20364c67..32307f9d7 100644 --- a/ArchiSteamFarm/Trading.cs +++ b/ArchiSteamFarm/Trading.cs @@ -34,7 +34,7 @@ using SteamKit2; namespace ArchiSteamFarm { public sealed class Trading : IDisposable { - internal const byte MaxItemsPerTrade = 200; // This is decided upon various factors, mainly limit on POST size in WebBrowser, as well as stability of Steam servers when dealing with huge trade offers + internal const byte MaxItemsPerTrade = byte.MaxValue; // This is decided upon various factors, mainly limit on POST size in WebBrowser, as well as stability of Steam servers when dealing with huge trade offers internal const byte MaxTradesPerAccount = 5; // This is limit introduced by Valve private readonly Bot Bot;