Skip to content

Commit 4321fdf

Browse files
committed
update to ASF 6.0.1.24
1 parent 3715cf2 commit 4321fdf

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

ArchiSteamFarm

Submodule ArchiSteamFarm updated 278 files

ItemDispenser/DispenseItems.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
namespace ItemDispenser {
66

77
public sealed class DispenseItem {
8-
public static readonly ImmutableHashSet<Asset.EType> EmptyTypes = [];
8+
public static readonly ImmutableHashSet<EAssetType> EmptyTypes = [];
99
[JsonInclude]
1010
[JsonRequired]
1111
public uint AppID { get; private init; }
@@ -14,6 +14,6 @@ public sealed class DispenseItem {
1414
public ulong ContextID { get; private init; }
1515

1616
[JsonInclude]
17-
public ImmutableHashSet<Asset.EType> Types { get; private init; } = EmptyTypes;
17+
public ImmutableHashSet<EAssetType> Types { get; private init; } = EmptyTypes;
1818
}
1919
}

ItemDispenser/ItemDispenser.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ namespace ItemDispenser;
1919
[Export(typeof(IPlugin))]
2020

2121
internal sealed class ItemDispenser : IBotTradeOffer, IBotModules {
22-
private static readonly ConcurrentDictionary<Bot, FrozenDictionary<(uint AppID, ulong ContextID), FrozenSet<Asset.EType>>> BotSettings = new();
22+
private static readonly ConcurrentDictionary<Bot, FrozenDictionary<(uint AppID, ulong ContextID), FrozenSet<EAssetType>>> BotSettings = new();
2323

2424
public string Name => nameof(ItemDispenser);
2525

@@ -40,7 +40,7 @@ public Task OnBotInitModules(Bot bot, IReadOnlyDictionary<string, JsonElement>?
4040
return Task.CompletedTask;
4141
}
4242

43-
Dictionary<(uint AppID, ulong ContextID), HashSet<Asset.EType>> botSettings = [];
43+
Dictionary<(uint AppID, ulong ContextID), HashSet<EAssetType>> botSettings = [];
4444

4545
try {
4646
foreach (DispenseItem? dispenseItem in jsonElement.EnumerateArray().Select(static elem => elem.ToJsonObject<DispenseItem>())) {
@@ -50,7 +50,7 @@ public Task OnBotInitModules(Bot bot, IReadOnlyDictionary<string, JsonElement>?
5050

5151
(uint AppID, ulong ContextID) key = (dispenseItem.AppID, dispenseItem.ContextID);
5252

53-
if (!botSettings.TryGetValue(key, out HashSet<Asset.EType>? types)) {
53+
if (!botSettings.TryGetValue(key, out HashSet<EAssetType>? types)) {
5454
types = [];
5555
botSettings[key] = types;
5656
}
@@ -73,7 +73,7 @@ public async Task<bool> OnBotTradeOffer(Bot bot, TradeOffer tradeOffer) {
7373
ArgumentNullException.ThrowIfNull(bot);
7474
ArgumentNullException.ThrowIfNull(tradeOffer);
7575

76-
if (!BotSettings.TryGetValue(bot, out FrozenDictionary<(uint AppID, ulong ContextID), FrozenSet<Asset.EType>>? itemsToDispense)) {
76+
if (!BotSettings.TryGetValue(bot, out FrozenDictionary<(uint AppID, ulong ContextID), FrozenSet<EAssetType>>? itemsToDispense)) {
7777
// Settings not declared for this bot, skip overhead
7878
return false;
7979
}
@@ -85,8 +85,8 @@ public async Task<bool> OnBotTradeOffer(Bot bot, TradeOffer tradeOffer) {
8585

8686
byte? holdDuration = await bot.GetTradeHoldDuration(tradeOffer.OtherSteamID64, tradeOffer.TradeOfferID).ConfigureAwait(false);
8787

88-
return holdDuration != null && (!(holdDuration > 0) || holdDuration.Value <= (ASF.GlobalConfig?.MaxTradeHoldDuration ?? 0)) && !tradeOffer.ItemsToGiveReadOnly.Any(static item => item.Type is Asset.EType.FoilTradingCard or Asset.EType.TradingCard && CardsFarmer.SalesBlacklist.Contains(item.RealAppID))
89-
&& tradeOffer.ItemsToGiveReadOnly.All(item => itemsToDispense.TryGetValue((item.AppID, item.ContextID), out FrozenSet<Asset.EType>? dispense) && ((dispense.Count == 0) || dispense.Contains(item.Type)));
88+
return holdDuration != null && (!(holdDuration > 0) || holdDuration.Value <= (ASF.GlobalConfig?.MaxTradeHoldDuration ?? 0)) && !tradeOffer.ItemsToGiveReadOnly.Any(static item => item.Type is EAssetType.FoilTradingCard or EAssetType.TradingCard && CardsFarmer.SalesBlacklist.Contains(item.RealAppID))
89+
&& tradeOffer.ItemsToGiveReadOnly.All(item => itemsToDispense.TryGetValue((item.AppID, item.ContextID), out FrozenSet<EAssetType>? dispense) && ((dispense.Count == 0) || dispense.Contains(item.Type)));
9090
}
9191

9292
public Task OnLoaded() {

0 commit comments

Comments
 (0)