@@ -66,12 +66,17 @@ public sealed class BotConfig {
6666 [ PublicAPI ]
6767 public const EFarmingPreferences DefaultFarmingPreferences = EFarmingPreferences . None ;
6868
69+ [ PublicAPI ]
70+ public const EGamingDeviceType DefaultGamingDeviceType = EGamingDeviceType . StandardPC ;
71+
6972 [ PublicAPI ]
7073 public const byte DefaultHoursUntilCardDrops = 3 ;
7174
7275 [ PublicAPI ]
7376 public const EPersonaStateFlag DefaultOnlineFlags = 0 ;
7477
78+ // TODO: Remove me
79+ [ Obsolete ( "Will be removed in the next stable release" ) ]
7580 [ PublicAPI ]
7681 public const EOnlinePreferences DefaultOnlinePreferences = EOnlinePreferences . None ;
7782
@@ -229,6 +234,10 @@ public WebProxy? WebProxy {
229234 [ UnconditionalSuppressMessage ( "AssemblyLoadTrimming" , "IL2026:RequiresUnreferencedCode" , Justification = "This is optional, supportive attribute, we don't care if it gets trimmed or not" ) ]
230235 public ImmutableList < uint > GamesPlayedWhileIdle { get ; init ; } = DefaultGamesPlayedWhileIdle ;
231236
237+ // TODO: Change set to init
238+ [ JsonInclude ]
239+ public EGamingDeviceType GamingDeviceType { get ; internal set ; } = DefaultGamingDeviceType ;
240+
232241 [ JsonInclude ]
233242 [ Range ( byte . MinValue , byte . MaxValue ) ]
234243 public byte HoursUntilCardDrops { get ; init ; } = DefaultHoursUntilCardDrops ;
@@ -244,7 +253,9 @@ public WebProxy? WebProxy {
244253 [ JsonInclude ]
245254 public EPersonaStateFlag OnlineFlags { get ; init ; } = DefaultOnlineFlags ;
246255
256+ // TODO: Remove me
247257 [ JsonInclude ]
258+ [ Obsolete ( "Will be removed in the next stable release" ) ]
248259 public EOnlinePreferences OnlinePreferences { get ; init ; } = DefaultOnlinePreferences ;
249260
250261 [ JsonInclude ]
@@ -403,6 +414,9 @@ public BotConfig() { }
403414 [ UsedImplicitly ]
404415 public bool ShouldSerializeGamesPlayedWhileIdle ( ) => ! Saving || ( ( GamesPlayedWhileIdle != DefaultGamesPlayedWhileIdle ) && ! GamesPlayedWhileIdle . SequenceEqual ( DefaultGamesPlayedWhileIdle ) ) ;
405416
417+ [ UsedImplicitly ]
418+ public bool ShouldSerializeGamingDeviceType ( ) => ! Saving || ( GamingDeviceType != DefaultGamingDeviceType ) ;
419+
406420 [ UsedImplicitly ]
407421 public bool ShouldSerializeHoursUntilCardDrops ( ) => ! Saving || ( HoursUntilCardDrops != DefaultHoursUntilCardDrops ) ;
408422
@@ -415,8 +429,10 @@ public BotConfig() { }
415429 [ UsedImplicitly ]
416430 public bool ShouldSerializeOnlineFlags ( ) => ! Saving || ( OnlineFlags != DefaultOnlineFlags ) ;
417431
432+ #pragma warning disable CA1822 // TODO: Remove me
418433 [ UsedImplicitly ]
419- public bool ShouldSerializeOnlinePreferences ( ) => ! Saving || ( OnlinePreferences != DefaultOnlinePreferences ) ;
434+ public bool ShouldSerializeOnlinePreferences ( ) => false ;
435+ #pragma warning restore CA1822 // TODO: Remove me
420436
421437 [ UsedImplicitly ]
422438 public bool ShouldSerializeOnlineStatus ( ) => ! Saving || ( OnlineStatus != DefaultOnlineStatus ) ;
@@ -514,6 +530,10 @@ public static async Task<bool> Write(string filePath, BotConfig botConfig) {
514530 return ( false , Strings . FormatErrorConfigPropertyInvalid ( nameof ( GamesPlayedWhileIdle ) , $ "{ nameof ( GamesPlayedWhileIdle . Count ) } { GamesPlayedWhileIdle . Count } > { ArchiHandler . MaxGamesPlayedConcurrently } ") ) ;
515531 }
516532
533+ if ( GamingDeviceType == EGamingDeviceType . Unknown || ! Enum . IsDefined ( GamingDeviceType ) ) {
534+ return ( false , Strings . FormatErrorConfigPropertyInvalid ( nameof ( GamingDeviceType ) , GamingDeviceType ) ) ;
535+ }
536+
517537 foreach ( EAssetType lootableType in LootableTypes . Where ( static lootableType => ! Enum . IsDefined ( lootableType ) ) ) {
518538 return ( false , Strings . FormatErrorConfigPropertyInvalid ( nameof ( LootableTypes ) , lootableType ) ) ;
519539 }
@@ -548,10 +568,16 @@ public static async Task<bool> Write(string filePath, BotConfig botConfig) {
548568 return ( false , Strings . FormatErrorConfigPropertyInvalid ( nameof ( OnlineFlags ) , OnlineFlags ) ) ;
549569 }
550570
571+ #pragma warning disable CS0618 // TODO: Remove me
551572 if ( OnlinePreferences > EOnlinePreferences . All ) {
552573 return ( false , Strings . FormatErrorConfigPropertyInvalid ( nameof ( OnlinePreferences ) , OnlinePreferences ) ) ;
553574 }
554575
576+ if ( OnlinePreferences . HasFlag ( EOnlinePreferences . IsSteamDeck ) ) {
577+ GamingDeviceType = EGamingDeviceType . SteamDeck ;
578+ }
579+ #pragma warning restore CS0618 // TODO: Remove me
580+
555581 if ( ! Enum . IsDefined ( OnlineStatus ) ) {
556582 return ( false , Strings . FormatErrorConfigPropertyInvalid ( nameof ( OnlineStatus ) , OnlineStatus ) ) ;
557583 }
@@ -736,6 +762,7 @@ public enum EFarmingPreferences : ushort {
736762 }
737763
738764 [ Flags ]
765+ [ Obsolete ( "Will be removed in the next stable release" ) ]
739766 [ PublicAPI ]
740767 public enum EOnlinePreferences : byte {
741768 None = 0 ,
0 commit comments