This commit is contained in:
Łukasz Domeradzki 2024-08-06 03:07:41 +02:00
parent f983a2eab2
commit 4ff1411c38
No known key found for this signature in database
GPG key ID: 6B138B4C64555AEA
2 changed files with 22 additions and 0 deletions

View file

@ -2774,6 +2774,7 @@ public sealed class Bot : IAsyncDisposable, IDisposable {
CellID = ASF.GlobalDatabase?.CellID,
ChatMode = SteamUser.ChatMode.NewSteamChat,
ClientLanguage = CultureInfo.CurrentCulture.ToSteamClientLanguage(),
IsSteamDeck = BotConfig.OnlinePreferences.HasFlag(BotConfig.EOnlinePreferences.IsSteamDeck),
LoginID = LoginID,
ShouldRememberPassword = BotConfig.UseLoginKeys,
UIMode = BotConfig.UserInterfaceMode,

View file

@ -71,6 +71,9 @@ public sealed class BotConfig {
[PublicAPI]
public const EPersonaStateFlag DefaultOnlineFlags = 0;
[PublicAPI]
public const EOnlinePreferences DefaultOnlinePreferences = EOnlinePreferences.None;
[PublicAPI]
public const EPersonaState DefaultOnlineStatus = EPersonaState.Online;
@ -186,6 +189,9 @@ public sealed class BotConfig {
[JsonInclude]
public EPersonaStateFlag OnlineFlags { get; private init; } = DefaultOnlineFlags;
[JsonInclude]
public EOnlinePreferences OnlinePreferences { get; private init; } = DefaultOnlinePreferences;
[JsonInclude]
public EPersonaState OnlineStatus { get; private init; } = DefaultOnlineStatus;
@ -338,6 +344,9 @@ public sealed class BotConfig {
[UsedImplicitly]
public bool ShouldSerializeOnlineFlags() => !Saving || (OnlineFlags != DefaultOnlineFlags);
[UsedImplicitly]
public bool ShouldSerializeOnlinePreferences() => !Saving || (OnlinePreferences != DefaultOnlinePreferences);
[UsedImplicitly]
public bool ShouldSerializeOnlineStatus() => !Saving || (OnlineStatus != DefaultOnlineStatus);
@ -459,6 +468,10 @@ public sealed class BotConfig {
return (false, Strings.FormatErrorConfigPropertyInvalid(nameof(OnlineFlags), OnlineFlags));
}
if (OnlinePreferences > EOnlinePreferences.All) {
return (false, Strings.FormatErrorConfigPropertyInvalid(nameof(OnlinePreferences), OnlinePreferences));
}
if (!Enum.IsDefined(OnlineStatus)) {
return (false, Strings.FormatErrorConfigPropertyInvalid(nameof(OnlineStatus), OnlineStatus));
}
@ -641,6 +654,14 @@ public sealed class BotConfig {
All = FarmingPausedByDefault | ShutdownOnFarmingFinished | SendOnFarmingFinished | FarmPriorityQueueOnly | SkipRefundableGames | SkipUnplayedGames | EnableRiskyCardsDiscovery | AutoSteamSaleEvent
}
[Flags]
[PublicAPI]
public enum EOnlinePreferences : byte {
None = 0,
IsSteamDeck = 1,
All = IsSteamDeck
}
[Flags]
[PublicAPI]
public enum ERedeemingPreferences : byte {