Skip to content

Commit 0467dc1

Browse files
committed
Make trade message disappear for all non-steam appids
1 parent d81e8d2 commit 0467dc1

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

ArchiSteamFarm/Steam/Exchange/Trading.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
// limitations under the License.
2323

2424
using System;
25-
using System.Collections.Frozen;
2625
using System.Collections.Generic;
2726
using System.Linq;
2827
using System.Threading;
@@ -45,9 +44,6 @@ public sealed class Trading : IDisposable {
4544
internal const byte MaxItemsPerTrade = byte.MaxValue; // This is decided upon various factors, mainly stability of Steam servers when dealing with huge trade offers
4645
internal const byte MaxTradesPerAccount = 5; // This is limit introduced by Valve
4746

48-
[PublicAPI]
49-
public static readonly FrozenSet<uint> TradeRestrictionsAppIDs = [730];
50-
5147
private readonly Bot Bot;
5248
private readonly ConcurrentHashSet<ulong> HandledTradeOfferIDs = [];
5349
private readonly SemaphoreSlim TradesSemaphore = new(1, 1);
@@ -298,7 +294,7 @@ private async Task<bool> ParseActiveTrades() {
298294

299295
IList<ParseTradeResult> tradeResults = await Utilities.InParallel(tasks).ConfigureAwait(false);
300296

301-
if (!Bot.BotDatabase.TradeRestrictionsAcknowledged && tradeResults.Any(static result => ((result.Result == ParseTradeResult.EResult.Accepted) && (result.ItemsToGive?.Any(static item => TradeRestrictionsAppIDs.Contains(item.AppID)) == true)) || (result.ItemsToReceive?.Any(static item => TradeRestrictionsAppIDs.Contains(item.AppID)) == true))) {
297+
if (!Bot.BotDatabase.TradeRestrictionsAcknowledged && tradeResults.Any(static result => ((result.Result == ParseTradeResult.EResult.Accepted) && (result.ItemsToGive?.Any(static item => item.AppID != Asset.SteamAppID) == true)) || (result.ItemsToReceive?.Any(static item => item.AppID != Asset.SteamAppID) == true))) {
302298
// We should normally fail the process in case of a failure here, but since the popup could be marked already in the past, we'll allow it in hope it wasn't needed after all
303299
await AcknowledgeTradeRestrictions().ConfigureAwait(false);
304300
}

ArchiSteamFarm/Steam/Interaction/Actions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ public static (bool Success, string Message) Restart() {
460460
}
461461

462462
// In similar way we might need to accept popup on Steam side, we limit it only to cases that we're aware of, as sending this request otherwise is additional overhead for no reason
463-
if (!Bot.BotDatabase.TradeRestrictionsAcknowledged && items.Any(static item => Trading.TradeRestrictionsAppIDs.Contains(item.AppID))) {
463+
if (!Bot.BotDatabase.TradeRestrictionsAcknowledged && items.Any(static item => item.AppID != Asset.SteamAppID)) {
464464
// We should normally fail the process in case of a failure here, but since the popup could be marked already in the past, we'll allow it in hope it wasn't needed after all
465465
await Bot.Trading.AcknowledgeTradeRestrictions().ConfigureAwait(false);
466466
}

0 commit comments

Comments
 (0)