mirror of
https://github.com/JustArchiNET/ArchiSteamFarm
synced 2024-11-10 07:04:27 +00:00
Closes #3261
This commit is contained in:
parent
f983a2eab2
commit
4ff1411c38
2 changed files with 22 additions and 0 deletions
|
@ -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,
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue