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.
This commit is contained in:
JustArchi
2020-02-09 18:37:52 +01:00
parent 72901ce3f2
commit a40c117b73
2 changed files with 3 additions and 6 deletions

View File

@@ -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;

View File

@@ -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;