diff --git a/ArchiSteamFarm/Core/RemoteCommunication.cs b/ArchiSteamFarm/Core/RemoteCommunication.cs index 788dc84ef..b06318262 100644 --- a/ArchiSteamFarm/Core/RemoteCommunication.cs +++ b/ArchiSteamFarm/Core/RemoteCommunication.cs @@ -42,7 +42,7 @@ using ArchiSteamFarm.Web; namespace ArchiSteamFarm.Core; internal sealed class RemoteCommunication : IAsyncDisposable, IDisposable { - private const ushort MaxItemsForFairBots = ArchiWebHandler.MaxItemsInSingleInventoryRequest * WebBrowser.MaxTries; // Determines which fair bots we'll deprioritize when matching due to excessive number of inventory requests they need to make, which are likely to fail in the process or cause excessive delays + private const ushort MaxItemsForFairBots = ArchiWebHandler.RecommendedItemsInSingleInventoryRequest * WebBrowser.MaxTries; // Determines which fair bots we'll deprioritize when matching due to excessive number of inventory requests they need to make, which are likely to fail in the process or cause excessive delays private const byte MaxMatchedBotsHard = 40; // Determines how many bots we can attempt to match in total, where match attempt is equal to analyzing bot's inventory private const byte MaxMatchingRounds = 10; // Determines maximum amount of matching rounds we're going to consider before leaving the rest of work for the next batch private const byte MinAnnouncementCheckTTL = 6; // Minimum amount of hours we must wait before checking eligibility for Announcement, should be lower than MinPersonaStateTTL diff --git a/ArchiSteamFarm/Steam/Integration/ArchiWebHandler.cs b/ArchiSteamFarm/Steam/Integration/ArchiWebHandler.cs index bd34f70ea..45580cd10 100644 --- a/ArchiSteamFarm/Steam/Integration/ArchiWebHandler.cs +++ b/ArchiSteamFarm/Steam/Integration/ArchiWebHandler.cs @@ -48,10 +48,11 @@ using SteamKit2; namespace ArchiSteamFarm.Steam.Integration; public sealed class ArchiWebHandler : IDisposable { - internal const ushort MaxItemsInSingleInventoryRequest = 2000; + internal const ushort RecommendedItemsInSingleInventoryRequest = 2000; // In regards to rate limits private const string EconService = "IEconService"; private const string LoyaltyRewardsService = "ILoyaltyRewardsService"; + private const ushort MaxItemsInSingleInventoryRequest = 5000; private const byte MinimumSessionValidityInSeconds = 10; private const string SteamAppsService = "ISteamApps"; private const string SteamUserAuthService = "ISteamUserAuth"; @@ -135,6 +136,8 @@ public sealed class ArchiWebHandler : IDisposable { throw new InvalidOperationException(nameof(ASF.InventorySemaphore)); } + ushort count = RecommendedItemsInSingleInventoryRequest; + if (steamID == 0) { if (!Initialized) { byte connectionTimeout = ASF.GlobalConfig?.ConnectionTimeout ?? GlobalConfig.DefaultConnectionTimeout; @@ -149,6 +152,7 @@ public sealed class ArchiWebHandler : IDisposable { } steamID = Bot.SteamID; + count = MaxItemsInSingleInventoryRequest; } else if (!new SteamID(steamID).IsIndividualAccount) { throw new NotSupportedException(string.Format(CultureInfo.CurrentCulture, Strings.ErrorObjectIsNull, nameof(steamID))); } @@ -161,7 +165,7 @@ public sealed class ArchiWebHandler : IDisposable { int rateLimitingDelay = (ASF.GlobalConfig?.InventoryLimiterDelay ?? GlobalConfig.DefaultInventoryLimiterDelay) * 1000; while (true) { - Uri request = new(SteamCommunityURL, $"/inventory/{steamID}/{appID}/{contextID}?count={MaxItemsInSingleInventoryRequest}&l=english{(startAssetID > 0 ? $"&start_assetid={startAssetID}" : "")}"); + Uri request = new(SteamCommunityURL, $"/inventory/{steamID}/{appID}/{contextID}?count={count}&l=english{(startAssetID > 0 ? $"&start_assetid={startAssetID}" : "")}"); await ASF.InventorySemaphore.WaitAsync().ConfigureAwait(false); diff --git a/ArchiSteamFarm/Storage/GlobalConfig.cs b/ArchiSteamFarm/Storage/GlobalConfig.cs index 1124578e9..5587c0335 100644 --- a/ArchiSteamFarm/Storage/GlobalConfig.cs +++ b/ArchiSteamFarm/Storage/GlobalConfig.cs @@ -73,7 +73,7 @@ public sealed class GlobalConfig { public const byte DefaultIdleFarmingPeriod = 8; [PublicAPI] - public const byte DefaultInventoryLimiterDelay = 3; + public const byte DefaultInventoryLimiterDelay = 4; [PublicAPI] public const bool DefaultIPC = true;