diff --git a/ArchiSteamFarm/BotConfig.cs b/ArchiSteamFarm/BotConfig.cs index af4d7c485..9337be839 100644 --- a/ArchiSteamFarm/BotConfig.cs +++ b/ArchiSteamFarm/BotConfig.cs @@ -72,7 +72,7 @@ namespace ArchiSteamFarm { [JsonProperty(Required = Required.DisallowNull)] internal readonly bool IsBotAccount = false; - [JsonProperty(Required = Required.DisallowNull)] + [JsonProperty(ObjectCreationHandling = ObjectCreationHandling.Replace, Required = Required.DisallowNull)] internal readonly HashSet LootableTypes = new HashSet { Steam.Item.EType.BoosterPack, Steam.Item.EType.FoilTradingCard, Steam.Item.EType.TradingCard }; [JsonProperty(Required = Required.DisallowNull)] diff --git a/ArchiSteamFarm/GlobalConfig.cs b/ArchiSteamFarm/GlobalConfig.cs index bad79a597..4aae6f650 100644 --- a/ArchiSteamFarm/GlobalConfig.cs +++ b/ArchiSteamFarm/GlobalConfig.cs @@ -50,8 +50,8 @@ namespace ArchiSteamFarm { [JsonProperty(Required = Required.DisallowNull)] internal readonly bool AutoUpdates = true; - [JsonProperty(Required = Required.DisallowNull)] - internal readonly HashSet Blacklist = new HashSet(GlobalBlacklist); + [JsonProperty(ObjectCreationHandling = ObjectCreationHandling.Replace, Required = Required.DisallowNull)] + internal readonly HashSet Blacklist = GlobalBlacklist; [JsonProperty(Required = Required.DisallowNull)] internal readonly bool Debug = false; diff --git a/ConfigGenerator/BotConfig.cs b/ConfigGenerator/BotConfig.cs index 9806a720c..2cc29d617 100644 --- a/ConfigGenerator/BotConfig.cs +++ b/ConfigGenerator/BotConfig.cs @@ -78,8 +78,8 @@ namespace ConfigGenerator { [JsonProperty(Required = Required.DisallowNull)] public bool IsBotAccount { get; set; } = false; - [JsonProperty(Required = Required.DisallowNull)] - public List LootableTypes { get; set; } = new List(); + [JsonProperty(ObjectCreationHandling = ObjectCreationHandling.Replace, Required = Required.DisallowNull)] + public List LootableTypes { get; set; } = new List { Steam.Item.EType.BoosterPack, Steam.Item.EType.FoilTradingCard, Steam.Item.EType.TradingCard }; [Category("\tAccess")] [JsonProperty(Required = Required.DisallowNull)] @@ -145,9 +145,6 @@ namespace ConfigGenerator { throw new ArgumentNullException(nameof(filePath)); } - LootableTypes.Add(Steam.Item.EType.BoosterPack); - LootableTypes.Add(Steam.Item.EType.FoilTradingCard); - LootableTypes.Add(Steam.Item.EType.TradingCard); Save(); } diff --git a/ConfigGenerator/GlobalConfig.cs b/ConfigGenerator/GlobalConfig.cs index 05e2ad74a..699d1db0a 100644 --- a/ConfigGenerator/GlobalConfig.cs +++ b/ConfigGenerator/GlobalConfig.cs @@ -53,8 +53,8 @@ namespace ConfigGenerator { [JsonProperty(Required = Required.DisallowNull)] public bool AutoUpdates { get; set; } = true; - [JsonProperty(Required = Required.DisallowNull)] - public List Blacklist { get; set; } = new List(); + [JsonProperty(ObjectCreationHandling = ObjectCreationHandling.Replace, Required = Required.DisallowNull)] + public List Blacklist { get; set; } = new List(GlobalBlacklist); [Category("\tDebugging")] [JsonProperty(Required = Required.DisallowNull)] @@ -126,7 +126,6 @@ namespace ConfigGenerator { throw new ArgumentNullException(nameof(filePath)); } - Blacklist.AddRange(GlobalBlacklist); Save(); }