From b1d4eb5c8c72705a2b293870b8f920aa96b9d027 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Domeradzki?= Date: Thu, 4 Sep 2025 14:32:34 +0200 Subject: [PATCH] Cleanup obsolete parts (#3471) --- ArchiSteamFarm/Helpers/Json/JsonUtilities.cs | 10 ------ ArchiSteamFarm/Steam/Storage/BotConfig.cs | 37 +------------------- 2 files changed, 1 insertion(+), 46 deletions(-) diff --git a/ArchiSteamFarm/Helpers/Json/JsonUtilities.cs b/ArchiSteamFarm/Helpers/Json/JsonUtilities.cs index de77e4416..3fb95b57c 100644 --- a/ArchiSteamFarm/Helpers/Json/JsonUtilities.cs +++ b/ArchiSteamFarm/Helpers/Json/JsonUtilities.cs @@ -44,16 +44,6 @@ public static class JsonUtilities { [PublicAPI] public static readonly JsonSerializerOptions IndentedJsonSerializerOptions = CreateDefaultJsonSerializerOptions(true); - // TODO: Remove me in the future - [Obsolete($"Use {nameof(DefaultJsonSerializerOptions)} instead of this typo, thanks")] - [PublicAPI] - public static JsonSerializerOptions DefaultJsonSerialierOptions => DefaultJsonSerializerOptions; - - // TODO: Remove me in the future - [Obsolete($"Use {nameof(IndentedJsonSerializerOptions)} instead of this typo, thanks")] - [PublicAPI] - public static JsonSerializerOptions IndentedJsonSerialierOptions => IndentedJsonSerializerOptions; - [PublicAPI] [UnconditionalSuppressMessage("AssemblyLoadTrimming", "IL2026:RequiresUnreferencedCode", Justification = "We don't care about trimmed assemblies, as we need it to work only with the known (used) ones")] public static JsonElement ToJsonElement(this T obj) where T : notnull { diff --git a/ArchiSteamFarm/Steam/Storage/BotConfig.cs b/ArchiSteamFarm/Steam/Storage/BotConfig.cs index 3f7ef71ba..405e8e4f9 100644 --- a/ArchiSteamFarm/Steam/Storage/BotConfig.cs +++ b/ArchiSteamFarm/Steam/Storage/BotConfig.cs @@ -75,11 +75,6 @@ public sealed class BotConfig { [PublicAPI] public const EPersonaStateFlag DefaultOnlineFlags = 0; - // TODO: Remove me - [Obsolete("Will be removed in the next stable release")] - [PublicAPI] - public const EOnlinePreferences DefaultOnlinePreferences = EOnlinePreferences.None; - [PublicAPI] public const EPersonaState DefaultOnlineStatus = EPersonaState.Online; @@ -231,9 +226,8 @@ public sealed class BotConfig { [UnconditionalSuppressMessage("AssemblyLoadTrimming", "IL2026:RequiresUnreferencedCode", Justification = "This is optional, supportive attribute, we don't care if it gets trimmed or not")] public ImmutableList GamesPlayedWhileIdle { get; init; } = DefaultGamesPlayedWhileIdle; - // TODO: Change set to init [JsonInclude] - public EGamingDeviceType GamingDeviceType { get; internal set; } = DefaultGamingDeviceType; + public EGamingDeviceType GamingDeviceType { get; init; } = DefaultGamingDeviceType; [JsonInclude] [Range(byte.MinValue, byte.MaxValue)] @@ -250,11 +244,6 @@ public sealed class BotConfig { [JsonInclude] public EPersonaStateFlag OnlineFlags { get; init; } = DefaultOnlineFlags; - // TODO: Remove me - [JsonInclude] - [Obsolete("Will be removed in the next stable release")] - public EOnlinePreferences OnlinePreferences { get; init; } = DefaultOnlinePreferences; - [JsonInclude] public EPersonaState OnlineStatus { get; init; } = DefaultOnlineStatus; @@ -426,11 +415,6 @@ public sealed class BotConfig { [UsedImplicitly] public bool ShouldSerializeOnlineFlags() => !Saving || (OnlineFlags != DefaultOnlineFlags); -#pragma warning disable CA1822 // TODO: Remove me - [UsedImplicitly] - public bool ShouldSerializeOnlinePreferences() => false; -#pragma warning restore CA1822 // TODO: Remove me - [UsedImplicitly] public bool ShouldSerializeOnlineStatus() => !Saving || (OnlineStatus != DefaultOnlineStatus); @@ -565,16 +549,6 @@ public sealed class BotConfig { return (false, Strings.FormatErrorConfigPropertyInvalid(nameof(OnlineFlags), OnlineFlags)); } -#pragma warning disable CS0618 // TODO: Remove me - if (OnlinePreferences > EOnlinePreferences.All) { - return (false, Strings.FormatErrorConfigPropertyInvalid(nameof(OnlinePreferences), OnlinePreferences)); - } - - if (OnlinePreferences.HasFlag(EOnlinePreferences.IsSteamDeck)) { - GamingDeviceType = EGamingDeviceType.SteamDeck; - } -#pragma warning restore CS0618 // TODO: Remove me - if (!Enum.IsDefined(OnlineStatus)) { return (false, Strings.FormatErrorConfigPropertyInvalid(nameof(OnlineStatus), OnlineStatus)); } @@ -758,15 +732,6 @@ public sealed class BotConfig { All = FarmingPausedByDefault | ShutdownOnFarmingFinished | SendOnFarmingFinished | FarmPriorityQueueOnly | SkipRefundableGames | SkipUnplayedGames | EnableRiskyCardsDiscovery | AutoUnpackBoosterPacks } - [Flags] - [Obsolete("Will be removed in the next stable release")] - [PublicAPI] - public enum EOnlinePreferences : byte { - None = 0, - IsSteamDeck = 1, - All = IsSteamDeck - } - [Flags] [PublicAPI] public enum ERedeemingPreferences : byte {