Cleanup obsolete parts (#3471)

This commit is contained in:
Łukasz Domeradzki
2025-09-04 14:32:34 +02:00
committed by GitHub
parent c929efbf24
commit b1d4eb5c8c
2 changed files with 1 additions and 46 deletions

View File

@@ -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<T>(this T obj) where T : notnull {

View File

@@ -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<uint> 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 {