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.
This commit is contained in:
JustArchi
2017-02-19 12:21:41 +01:00
parent 701cb9d327
commit e9f55b2b0b
4 changed files with 0 additions and 29 deletions

View File

@@ -98,7 +98,6 @@ namespace ArchiSteamFarm {
[JsonProperty] [JsonProperty]
internal bool KeepRunning { get; private set; } internal bool KeepRunning { get; private set; }
private Timer AcceptConfirmationsTimer;
private string AuthCode; private string AuthCode;
private Timer ConnectionFailureTimer; private Timer ConnectionFailureTimer;
private Timer FamilySharingInactivityTimer; private Timer FamilySharingInactivityTimer;
@@ -241,7 +240,6 @@ namespace ArchiSteamFarm {
Trading.Dispose(); Trading.Dispose();
// Those are objects that might be null and the check should be in-place // Those are objects that might be null and the check should be in-place
AcceptConfirmationsTimer?.Dispose();
ConnectionFailureTimer?.Dispose(); ConnectionFailureTimer?.Dispose();
FamilySharingInactivityTimer?.Dispose(); FamilySharingInactivityTimer?.Dispose();
SendItemsTimer?.Dispose(); SendItemsTimer?.Dispose();
@@ -425,25 +423,6 @@ namespace ArchiSteamFarm {
CardsFarmer.SetInitialState(BotConfig.Paused); 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)) { if ((BotConfig.SendTradePeriod > 0) && (BotConfig.SteamMasterID != 0)) {
TimeSpan delay = TimeSpan.FromHours(BotConfig.SendTradePeriod) + TimeSpan.FromMinutes(Bots.Count); TimeSpan delay = TimeSpan.FromHours(BotConfig.SendTradePeriod) + TimeSpan.FromMinutes(Bots.Count);
TimeSpan period = TimeSpan.FromHours(BotConfig.SendTradePeriod); TimeSpan period = TimeSpan.FromHours(BotConfig.SendTradePeriod);

View File

@@ -36,9 +36,6 @@ namespace ArchiSteamFarm {
[SuppressMessage("ReSharper", "ClassNeverInstantiated.Global")] [SuppressMessage("ReSharper", "ClassNeverInstantiated.Global")]
[SuppressMessage("ReSharper", "ConvertToConstant.Global")] [SuppressMessage("ReSharper", "ConvertToConstant.Global")]
internal sealed class BotConfig { internal sealed class BotConfig {
[JsonProperty(Required = Required.DisallowNull)]
internal readonly byte AcceptConfirmationsPeriod = 0;
[JsonProperty(Required = Required.DisallowNull)] [JsonProperty(Required = Required.DisallowNull)]
internal readonly bool AcceptGifts = false; internal readonly bool AcceptGifts = false;

View File

@@ -1,5 +1,4 @@
{ {
"AcceptConfirmationsPeriod": 0,
"AcceptGifts": false, "AcceptGifts": false,
"CardDropsRestricted": true, "CardDropsRestricted": true,
"CustomGamePlayedWhileFarming": null, "CustomGamePlayedWhileFarming": null,

View File

@@ -37,10 +37,6 @@ namespace ConfigGenerator {
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
[SuppressMessage("ReSharper", "UnusedMember.Global")] [SuppressMessage("ReSharper", "UnusedMember.Global")]
internal sealed class BotConfig : ASFConfig { internal sealed class BotConfig : ASFConfig {
[LocalizedCategory("Advanced")]
[JsonProperty(Required = Required.DisallowNull)]
public byte AcceptConfirmationsPeriod { get; set; } = 0;
[JsonProperty(Required = Required.DisallowNull)] [JsonProperty(Required = Required.DisallowNull)]
public bool AcceptGifts { get; set; } = false; public bool AcceptGifts { get; set; } = false;