From a8f1cef5b8e079b1e16dd289f3090b2e0d509348 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Domeradzki?= Date: Wed, 6 Nov 2024 18:47:39 +0100 Subject: [PATCH] Remove obsolete functionalities, bump --- .../Steam/Integration/ArchiWebHandler.cs | 68 ------------------- ArchiSteamFarm/Steam/Interaction/Commands.cs | 2 +- Directory.Build.props | 2 +- 3 files changed, 2 insertions(+), 70 deletions(-) diff --git a/ArchiSteamFarm/Steam/Integration/ArchiWebHandler.cs b/ArchiSteamFarm/Steam/Integration/ArchiWebHandler.cs index e2ab8b809..75ee3aeb8 100644 --- a/ArchiSteamFarm/Steam/Integration/ArchiWebHandler.cs +++ b/ArchiSteamFarm/Steam/Integration/ArchiWebHandler.cs @@ -55,10 +55,6 @@ public sealed class ArchiWebHandler : IDisposable { internal const ushort MaxItemsInSingleInventoryRequest = 5000; private const string EconService = "IEconService"; - - [Obsolete] - private const string LoyaltyRewardsService = "ILoyaltyRewardsService"; - private const byte MaxTradeOfferMessageLength = 128; private const byte MinimumSessionValidityInSeconds = 10; private const byte SessionIDLength = 24; // For maximum compatibility, should be divisible by 2 and match the length of "sessionid" property that Steam uses across their websites @@ -397,70 +393,6 @@ public sealed class ArchiWebHandler : IDisposable { } } - [Obsolete($"Use {nameof(ArchiHandler)}.{nameof(ArchiHandler.GetPointsBalance)} instead, this endpoint will be removed in the future version")] - [PublicAPI] - public async Task GetPointsBalance() { - string? accessToken = Bot.AccessToken; - - if (string.IsNullOrEmpty(accessToken)) { - return null; - } - - Dictionary arguments = new(2, StringComparer.Ordinal) { - { "access_token", accessToken }, - { "steamid", Bot.SteamID } - }; - - KeyValue? response = null; - - for (byte i = 0; (i < WebBrowser.MaxTries) && (response == null); i++) { - if ((i > 0) && (WebLimiterDelay > 0)) { - await Task.Delay(WebLimiterDelay).ConfigureAwait(false); - } - - using WebAPI.AsyncInterface loyaltyRewardsService = Bot.SteamConfiguration.GetAsyncWebAPIInterface(LoyaltyRewardsService); - - loyaltyRewardsService.Timeout = WebBrowser.Timeout; - - try { - response = await WebLimitRequest( - WebAPI.DefaultBaseAddress, - - // ReSharper disable once AccessToDisposedClosure - async () => await loyaltyRewardsService.CallAsync(HttpMethod.Get, "GetSummary", args: arguments).ConfigureAwait(false) - ).ConfigureAwait(false); - } catch (TaskCanceledException e) { - Bot.ArchiLogger.LogGenericDebuggingException(e); - } catch (Exception e) { - Bot.ArchiLogger.LogGenericWarningException(e); - } - } - - if (response == null) { - Bot.ArchiLogger.LogGenericWarning(Strings.FormatErrorRequestFailedTooManyTimes(WebBrowser.MaxTries)); - - return null; - } - - KeyValue pointsInfo = response["summary"]["points"]; - - if (pointsInfo == KeyValue.Invalid) { - Bot.ArchiLogger.LogNullError(pointsInfo); - - return null; - } - - uint result = pointsInfo.AsUnsignedInteger(uint.MaxValue); - - if (result == uint.MaxValue) { - Bot.ArchiLogger.LogNullError(result); - - return null; - } - - return result; - } - [PublicAPI] public async Task?> GetTradeOffers(bool? activeOffers = null, bool? receivedOffers = null, bool? sentOffers = null, bool? withDescriptions = null) { if ((receivedOffers == false) && (sentOffers == false)) { diff --git a/ArchiSteamFarm/Steam/Interaction/Commands.cs b/ArchiSteamFarm/Steam/Interaction/Commands.cs index 7e9e9e90a..f293106f8 100644 --- a/ArchiSteamFarm/Steam/Interaction/Commands.cs +++ b/ArchiSteamFarm/Steam/Interaction/Commands.cs @@ -1020,7 +1020,7 @@ public sealed class Commands { return responses.Count > 0 ? string.Join(Environment.NewLine, responses) : null; } - private async Task ResponseAdvancedTransferByAssetRarity(EAccess access, uint appID, ulong contextID, Bot targetBot, IReadOnlyCollection assetRarities) { + private async Task ResponseAdvancedTransferByAssetRarity(EAccess access, uint appID, ulong contextID, Bot targetBot, HashSet assetRarities) { if (!Enum.IsDefined(access)) { throw new InvalidEnumArgumentException(nameof(access), (int) access, typeof(EAccess)); } diff --git a/Directory.Build.props b/Directory.Build.props index c88f6d9b6..14a3c6b5a 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,6 +1,6 @@ - 6.0.9.0 + 6.0.9.1