From e9f55b2b0bec92aa94d6c23bdc2d5ab0ef1ad654 Mon Sep 17 00:00:00 2001 From: JustArchi Date: Sun, 19 Feb 2017 12:21:41 +0100 Subject: [PATCH] Remove AcceptConfirmationsPeriod This property was added when ASF 2FA existed in solo + import mode, and the purpose was automatic accept of confirmations in solo mode. Due to the fact that ASF 2FA exists only in import mode, and user should be using authenticator of his choice for all 2FA-related tasks, this properly is no longer in ASF 2FA scope, and should be removed to avoid confusion. Yet another reason for this is the fact that it actually didn't work since quite a while, together with SendTradePeriod. --- ArchiSteamFarm/Bot.cs | 21 --------------------- ArchiSteamFarm/BotConfig.cs | 3 --- ArchiSteamFarm/config/example.json | 1 - ConfigGenerator/BotConfig.cs | 4 ---- 4 files changed, 29 deletions(-) diff --git a/ArchiSteamFarm/Bot.cs b/ArchiSteamFarm/Bot.cs index 437cf59b1..2c775bd27 100755 --- a/ArchiSteamFarm/Bot.cs +++ b/ArchiSteamFarm/Bot.cs @@ -98,7 +98,6 @@ namespace ArchiSteamFarm { [JsonProperty] internal bool KeepRunning { get; private set; } - private Timer AcceptConfirmationsTimer; private string AuthCode; private Timer ConnectionFailureTimer; private Timer FamilySharingInactivityTimer; @@ -241,7 +240,6 @@ namespace ArchiSteamFarm { Trading.Dispose(); // Those are objects that might be null and the check should be in-place - AcceptConfirmationsTimer?.Dispose(); ConnectionFailureTimer?.Dispose(); FamilySharingInactivityTimer?.Dispose(); SendItemsTimer?.Dispose(); @@ -425,25 +423,6 @@ namespace ArchiSteamFarm { CardsFarmer.SetInitialState(BotConfig.Paused); - if (BotConfig.AcceptConfirmationsPeriod > 0) { - TimeSpan delay = TimeSpan.FromMinutes(BotConfig.AcceptConfirmationsPeriod) + TimeSpan.FromMinutes(0.2 * Bots.Count); - TimeSpan period = TimeSpan.FromMinutes(BotConfig.AcceptConfirmationsPeriod); - - if (AcceptConfirmationsTimer == null) { - AcceptConfirmationsTimer = new Timer( - async e => await AcceptConfirmations(true).ConfigureAwait(false), - null, - delay, // Delay - period // Period - ); - } else { - AcceptConfirmationsTimer.Change(delay, period); - } - } else if (AcceptConfirmationsTimer != null) { - AcceptConfirmationsTimer.Dispose(); - AcceptConfirmationsTimer = null; - } - if ((BotConfig.SendTradePeriod > 0) && (BotConfig.SteamMasterID != 0)) { TimeSpan delay = TimeSpan.FromHours(BotConfig.SendTradePeriod) + TimeSpan.FromMinutes(Bots.Count); TimeSpan period = TimeSpan.FromHours(BotConfig.SendTradePeriod); diff --git a/ArchiSteamFarm/BotConfig.cs b/ArchiSteamFarm/BotConfig.cs index 2ec845c89..98835dedc 100644 --- a/ArchiSteamFarm/BotConfig.cs +++ b/ArchiSteamFarm/BotConfig.cs @@ -36,9 +36,6 @@ namespace ArchiSteamFarm { [SuppressMessage("ReSharper", "ClassNeverInstantiated.Global")] [SuppressMessage("ReSharper", "ConvertToConstant.Global")] internal sealed class BotConfig { - [JsonProperty(Required = Required.DisallowNull)] - internal readonly byte AcceptConfirmationsPeriod = 0; - [JsonProperty(Required = Required.DisallowNull)] internal readonly bool AcceptGifts = false; diff --git a/ArchiSteamFarm/config/example.json b/ArchiSteamFarm/config/example.json index 9c3968364..29d43bc50 100644 --- a/ArchiSteamFarm/config/example.json +++ b/ArchiSteamFarm/config/example.json @@ -1,5 +1,4 @@ { - "AcceptConfirmationsPeriod": 0, "AcceptGifts": false, "CardDropsRestricted": true, "CustomGamePlayedWhileFarming": null, diff --git a/ConfigGenerator/BotConfig.cs b/ConfigGenerator/BotConfig.cs index f68fb6802..21154a3c5 100644 --- a/ConfigGenerator/BotConfig.cs +++ b/ConfigGenerator/BotConfig.cs @@ -37,10 +37,6 @@ namespace ConfigGenerator { [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] [SuppressMessage("ReSharper", "UnusedMember.Global")] internal sealed class BotConfig : ASFConfig { - [LocalizedCategory("Advanced")] - [JsonProperty(Required = Required.DisallowNull)] - public byte AcceptConfirmationsPeriod { get; set; } = 0; - [JsonProperty(Required = Required.DisallowNull)] public bool AcceptGifts { get; set; } = false;