diff --git a/ArchiSteamFarm/Core/RemoteCommunication.cs b/ArchiSteamFarm/Core/RemoteCommunication.cs index cc75308b8..2a4de4210 100644 --- a/ArchiSteamFarm/Core/RemoteCommunication.cs +++ b/ArchiSteamFarm/Core/RemoteCommunication.cs @@ -74,7 +74,7 @@ internal sealed class RemoteCommunication : IAsyncDisposable { internal RemoteCommunication(Bot bot) { Bot = bot ?? throw new ArgumentNullException(nameof(bot)); - if (Bot.BotConfig.RemoteCommunication.HasFlag(BotConfig.ERemoteCommunication.TradeMatcher)) { + if (Bot.BotConfig.TradingPreferences.HasFlag(BotConfig.ETradingPreferences.MatchActively)) { MatchActivelyTimer = new Timer( MatchActively, null, @@ -245,12 +245,20 @@ internal sealed class RemoteCommunication : IAsyncDisposable { } private async Task IsEligibleForListing() { + // But must be eligible for matching first bool? isEligibleForMatching = await IsEligibleForMatching().ConfigureAwait(false); if (isEligibleForMatching != true) { return isEligibleForMatching; } + // Bot must have STM enabled in TradingPreferences + if (!Bot.BotConfig.TradingPreferences.HasFlag(BotConfig.ETradingPreferences.SteamTradeMatcher)) { + Bot.ArchiLogger.LogGenericTrace(string.Format(CultureInfo.CurrentCulture, Strings.WarningFailedWithError, $"{nameof(Bot.BotConfig.TradingPreferences)}: {Bot.BotConfig.TradingPreferences}")); + + return false; + } + // Bot must have public inventory bool? hasPublicInventory = await Bot.HasPublicInventory().ConfigureAwait(false); @@ -271,13 +279,6 @@ internal sealed class RemoteCommunication : IAsyncDisposable { return false; } - // Bot must have STM enable in TradingPreferences - if (!Bot.BotConfig.TradingPreferences.HasFlag(BotConfig.ETradingPreferences.SteamTradeMatcher)) { - Bot.ArchiLogger.LogGenericTrace(string.Format(CultureInfo.CurrentCulture, Strings.WarningFailedWithError, $"{nameof(Bot.BotConfig.TradingPreferences)}: {Bot.BotConfig.TradingPreferences}")); - - return false; - } - // Bot must have at least one accepted matchable type set if ((Bot.BotConfig.MatchableTypes.Count == 0) || Bot.BotConfig.MatchableTypes.All(static type => !AcceptedMatchableTypes.Contains(type))) { Bot.ArchiLogger.LogGenericTrace(string.Format(CultureInfo.CurrentCulture, Strings.WarningFailedWithError, $"{nameof(Bot.BotConfig.MatchableTypes)}: {string.Join(", ", Bot.BotConfig.MatchableTypes)}")); @@ -298,10 +299,6 @@ internal sealed class RemoteCommunication : IAsyncDisposable { } private async void MatchActively(object? state = null) { - if (!Bot.BotConfig.RemoteCommunication.HasFlag(BotConfig.ERemoteCommunication.TradeMatcher)) { - return; - } - if (!Bot.IsConnectedAndLoggedOn || Bot.BotConfig.TradingPreferences.HasFlag(BotConfig.ETradingPreferences.MatchEverything) || !Bot.BotConfig.TradingPreferences.HasFlag(BotConfig.ETradingPreferences.MatchActively) || (await IsEligibleForMatching().ConfigureAwait(false) != true)) { Bot.ArchiLogger.LogGenericTrace(Strings.ErrorAborted); diff --git a/ArchiSteamFarm/Steam/Storage/BotConfig.cs b/ArchiSteamFarm/Steam/Storage/BotConfig.cs index ed94d5b06..3b6f074ae 100644 --- a/ArchiSteamFarm/Steam/Storage/BotConfig.cs +++ b/ArchiSteamFarm/Steam/Storage/BotConfig.cs @@ -687,9 +687,8 @@ public sealed class BotConfig { public enum ERemoteCommunication : byte { None = 0, SteamGroup = 1, - TradeMatcher = 2, - PublicListing = 4, - All = SteamGroup | TradeMatcher | PublicListing + PublicListing = 2, + All = SteamGroup | PublicListing } [Flags]