Skip to content

Commit 8879335

Browse files
committed
update for asf 5.1.x.x
1 parent 4e38762 commit 8879335

File tree

4 files changed

+15
-16
lines changed

4 files changed

+15
-16
lines changed

ArchiSteamFarm

Submodule ArchiSteamFarm updated 278 files

ItemDispenser/DispenseItems.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
using System.Collections.Immutable;
2-
using ArchiSteamFarm.Json;
2+
using ArchiSteamFarm.Steam.Data;
33
using Newtonsoft.Json;
44

55
namespace ItemDispenser {
66

77
public sealed class DispenseItem {
8-
public static readonly ImmutableHashSet<Steam.Asset.EType> EmptyTypes = ImmutableHashSet<Steam.Asset.EType>.Empty;
8+
public static readonly ImmutableHashSet<Asset.EType> EmptyTypes = ImmutableHashSet<Asset.EType>.Empty;
99

1010
[JsonProperty(Required = Required.Always)]
1111
public readonly uint AppID;
1212
[JsonProperty(Required = Required.Always)]
1313
public readonly ulong ContextID;
1414
[JsonProperty]
15-
public readonly ImmutableHashSet<Steam.Asset.EType> Types = EmptyTypes;
15+
public readonly ImmutableHashSet<Asset.EType> Types = EmptyTypes;
1616
}
1717
}

ItemDispenser/ItemDispenser.cs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@
44
using System.Composition;
55
using System.Linq;
66
using System.Threading.Tasks;
7-
using ArchiSteamFarm;
7+
using ArchiSteamFarm.Steam;
8+
using ArchiSteamFarm.Steam.Cards;
9+
using ArchiSteamFarm.Steam.Data;
10+
using ArchiSteamFarm.Steam.Storage;
811
using ArchiSteamFarm.Collections;
9-
using ArchiSteamFarm.Json;
10-
using ArchiSteamFarm.Plugins;
12+
using ArchiSteamFarm.Core;
13+
using ArchiSteamFarm.Plugins.Interfaces;
1114
using JetBrains.Annotations;
1215
using Newtonsoft.Json;
1316
using Newtonsoft.Json.Linq;
@@ -23,7 +26,7 @@ public class ItemDispenser : IBotTradeOffer, IBotModules {
2326

2427
public Version Version => typeof(ItemDispenser).Assembly.GetName().Version ?? new Version("0");
2528

26-
public async Task<bool> OnBotTradeOffer([NotNull] Bot bot, [NotNull] Steam.TradeOffer tradeOffer) {
29+
public async Task<bool> OnBotTradeOffer([NotNull] Bot bot, [NotNull] TradeOffer tradeOffer) {
2730
if (tradeOffer == null) {
2831
ASF.ArchiLogger.LogNullError(nameof(tradeOffer));
2932
return false;
@@ -43,7 +46,7 @@ public async Task<bool> OnBotTradeOffer([NotNull] Bot bot, [NotNull] Steam.Trade
4346
// If user has a trade hold, we add extra logic
4447
if (holdDuration.Value > 0) {
4548
// If trade hold duration exceeds our max, or user asks for cards with short lifespan, reject the trade
46-
if ((holdDuration.Value > (ASF.GlobalConfig?.MaxTradeHoldDuration ?? 0)) || tradeOffer.ItemsToGiveReadOnly.Any(item => ((item.Type == Steam.Asset.EType.FoilTradingCard) || (item.Type == Steam.Asset.EType.TradingCard)) && CardsFarmer.SalesBlacklist.Contains(item.RealAppID))) {
49+
if ((holdDuration.Value > (ASF.GlobalConfig?.MaxTradeHoldDuration ?? 0)) || tradeOffer.ItemsToGiveReadOnly.Any(item => ((item.Type == Asset.EType.FoilTradingCard) || (item.Type == Asset.EType.TradingCard)) && CardsFarmer.SalesBlacklist.Contains(item.RealAppID))) {
4750
return false;
4851
}
4952
}
@@ -53,7 +56,7 @@ public async Task<bool> OnBotTradeOffer([NotNull] Bot bot, [NotNull] Steam.Trade
5356
return false;
5457
}
5558

56-
foreach (Steam.Asset item in tradeOffer.ItemsToGiveReadOnly) {
59+
foreach (Asset item in tradeOffer.ItemsToGiveReadOnly) {
5760
if (!ItemsToDispense.Any( sample =>
5861
(sample.AppID == item.AppID) &&
5962
(sample.ContextID == item.ContextID) &&
@@ -83,7 +86,7 @@ public void OnBotInitModules([NotNull] Bot bot, [CanBeNull] IReadOnlyDictionary<
8386

8487
ConcurrentHashSet <DispenseItem>? dispenseItems;
8588
try {
86-
dispenseItems = jToken.Value<JArray>().ToObject<ConcurrentHashSet<DispenseItem>>();
89+
dispenseItems = jToken.Value<JArray>()?.ToObject<ConcurrentHashSet<DispenseItem>>();
8790
if (dispenseItems == null){
8891
bot.ArchiLogger.LogNullError(nameof(dispenseItems));
8992
return;

ItemDispenser/ItemDispenser.csproj

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<Authors>Ryzhehvost</Authors>
5-
<AssemblyVersion>0.2.0.0</AssemblyVersion>
5+
<AssemblyVersion>0.3.0.0</AssemblyVersion>
66
<TargetFrameworks>net5.0;net48</TargetFrameworks>
77
<Nullable>enable</Nullable>
88
<LangVersion>latest</LangVersion>
@@ -16,8 +16,4 @@
1616
<ProjectReference Include="..\ArchiSteamFarm\ArchiSteamFarm\ArchiSteamFarm.csproj" />
1717
</ItemGroup>
1818

19-
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
20-
<Exec Command="mkdir $(TargetDir)ItemDispenser&#xD;&#xA;copy $(TargetPath) $(TargetDir)ItemDispenser\&#xD;&#xA;7z a -tzip -mx7 ItemDispenser.zip $(TargetDir)ItemDispenser" />
21-
</Target>
22-
2319
</Project>

0 commit comments

Comments
 (0)