From 75c62b6de0300d031631fb01492f7129ea9f3b3e Mon Sep 17 00:00:00 2001 From: Archi Date: Wed, 28 Dec 2022 00:26:14 +0100 Subject: [PATCH] Call base constructor while creating BotDatabase This is a severe edge case. We forgot to call base constructor during creating BotDatabase, which is funny because it wasn't the case for ASF database. This caused event listeners to not be recorded, and therefore changes not being saved. Normally this bug entirely slipped through because on first login, login key is normally saved into the database, and that part always generated the file, with or without the listeners. However, if somebody has UseLoginKeys: false, and doesn't set up ASF 2FA for the bot, and bot database doesn't exist, it won't get created on changes to other bot database properties, that is: farming blacklist, farming priority queue, match actively blacklist and trading blacklist. Wow, this one is old, I don't know if we didn't have this bug since first version of ASF or something. --- ArchiSteamFarm/Steam/Storage/BotDatabase.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ArchiSteamFarm/Steam/Storage/BotDatabase.cs b/ArchiSteamFarm/Steam/Storage/BotDatabase.cs index f41a8e17d..fe6e87892 100644 --- a/ArchiSteamFarm/Steam/Storage/BotDatabase.cs +++ b/ArchiSteamFarm/Steam/Storage/BotDatabase.cs @@ -94,7 +94,7 @@ internal sealed class BotDatabase : SerializableFile { [JsonProperty($"_{nameof(MobileAuthenticator)}")] private MobileAuthenticator? BackingMobileAuthenticator; - private BotDatabase(string filePath) { + private BotDatabase(string filePath) : this() { if (string.IsNullOrEmpty(filePath)) { throw new ArgumentNullException(nameof(filePath)); }