mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2025-12-16 06:20:34 +00:00
Fix serializable files not always getting written on change
In some cases, STJ might decide to replace the object rather than populating it. This will work for majority of properties and use cases, however, we actually set up events on some properties to notify us back if they change during runtime. That event registration did not work properly, as the object was replaced with the new, that did not have appropriate listeners set up. Populate rather than replacing those selected properties, which fixes the problem.
This commit is contained in:
@@ -38,6 +38,7 @@ namespace ArchiSteamFarm.OfficialPlugins.ItemsMatcher;
|
||||
internal sealed class BotCache : SerializableFile {
|
||||
[JsonDisallowNull]
|
||||
[JsonInclude]
|
||||
[JsonObjectCreationHandling(JsonObjectCreationHandling.Populate)]
|
||||
internal ConcurrentList<AssetForListing> LastAnnouncedAssetsForListing { get; private init; } = [];
|
||||
|
||||
internal string? LastAnnouncedTradeToken {
|
||||
|
||||
@@ -65,6 +65,7 @@ public sealed class BotDatabase : GenericDatabase {
|
||||
|
||||
[JsonDisallowNull]
|
||||
[JsonInclude]
|
||||
[JsonObjectCreationHandling(JsonObjectCreationHandling.Populate)]
|
||||
internal ConcurrentHashSet<uint> ExtraStorePackages { get; private init; } = [];
|
||||
|
||||
internal DateTime ExtraStorePackagesRefreshedAt {
|
||||
@@ -82,22 +83,27 @@ public sealed class BotDatabase : GenericDatabase {
|
||||
|
||||
[JsonDisallowNull]
|
||||
[JsonInclude]
|
||||
[JsonObjectCreationHandling(JsonObjectCreationHandling.Populate)]
|
||||
internal ConcurrentHashSet<uint> FarmingBlacklistAppIDs { get; private init; } = [];
|
||||
|
||||
[JsonDisallowNull]
|
||||
[JsonInclude]
|
||||
[JsonObjectCreationHandling(JsonObjectCreationHandling.Populate)]
|
||||
internal ConcurrentHashSet<uint> FarmingPriorityQueueAppIDs { get; private init; } = [];
|
||||
|
||||
[JsonDisallowNull]
|
||||
[JsonInclude]
|
||||
[JsonObjectCreationHandling(JsonObjectCreationHandling.Populate)]
|
||||
internal ObservableConcurrentDictionary<uint, DateTime> FarmingRiskyIgnoredAppIDs { get; private init; } = new();
|
||||
|
||||
[JsonDisallowNull]
|
||||
[JsonInclude]
|
||||
[JsonObjectCreationHandling(JsonObjectCreationHandling.Populate)]
|
||||
internal ConcurrentHashSet<uint> FarmingRiskyPrioritizedAppIDs { get; private init; } = [];
|
||||
|
||||
[JsonDisallowNull]
|
||||
[JsonInclude]
|
||||
[JsonObjectCreationHandling(JsonObjectCreationHandling.Populate)]
|
||||
internal ConcurrentHashSet<uint> MatchActivelyBlacklistAppIDs { get; private init; } = [];
|
||||
|
||||
internal MobileAuthenticator? MobileAuthenticator {
|
||||
@@ -141,6 +147,7 @@ public sealed class BotDatabase : GenericDatabase {
|
||||
|
||||
[JsonDisallowNull]
|
||||
[JsonInclude]
|
||||
[JsonObjectCreationHandling(JsonObjectCreationHandling.Populate)]
|
||||
internal ConcurrentHashSet<ulong> TradingBlacklistSteamIDs { get; private init; } = [];
|
||||
|
||||
[JsonInclude]
|
||||
|
||||
@@ -57,10 +57,12 @@ public sealed class GlobalDatabase : GenericDatabase {
|
||||
|
||||
[JsonDisallowNull]
|
||||
[JsonInclude]
|
||||
[JsonObjectCreationHandling(JsonObjectCreationHandling.Populate)]
|
||||
internal ConcurrentHashSet<ulong> CachedBadBots { get; private init; } = [];
|
||||
|
||||
[JsonDisallowNull]
|
||||
[JsonInclude]
|
||||
[JsonObjectCreationHandling(JsonObjectCreationHandling.Populate)]
|
||||
internal ObservableConcurrentDictionary<uint, byte> CardCountsPerGame { get; private init; } = new();
|
||||
|
||||
internal uint CellID {
|
||||
@@ -91,6 +93,7 @@ public sealed class GlobalDatabase : GenericDatabase {
|
||||
|
||||
[JsonDisallowNull]
|
||||
[JsonInclude]
|
||||
[JsonObjectCreationHandling(JsonObjectCreationHandling.Populate)]
|
||||
internal InMemoryServerListProvider ServerListProvider { get; private init; } = new();
|
||||
|
||||
[JsonInclude]
|
||||
|
||||
Reference in New Issue
Block a user