Skip to content

Commit 3b83150

Browse files
committed
Fix regressions
1 parent bd028ba commit 3b83150

File tree

2 files changed

+21
-14
lines changed

2 files changed

+21
-14
lines changed

ArchiSteamFarm/ArchiWebHandler.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ internal uint GetServerTime() {
606606
type = description.Item2;
607607
}
608608

609-
Steam.Item steamItem = new Steam.Item(appID, contextID, amount, realAppID, type);
609+
Steam.Item steamItem = new Steam.Item(appID, contextID, classID, amount, realAppID, type);
610610
tradeOffer.ItemsToGive.Add(steamItem);
611611
}
612612

@@ -644,7 +644,7 @@ internal uint GetServerTime() {
644644
type = description.Item2;
645645
}
646646

647-
Steam.Item steamItem = new Steam.Item(appID, contextID, amount, realAppID, type);
647+
Steam.Item steamItem = new Steam.Item(appID, contextID, classID, amount, realAppID, type);
648648
tradeOffer.ItemsToReceive.Add(steamItem);
649649
}
650650

ArchiSteamFarm/JSON/Steam.cs

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -176,31 +176,38 @@ private string AmountString {
176176
internal uint RealAppID { get; set; }
177177
internal EType Type { get; set; }
178178

179-
internal Item(uint appID, ulong contextID, ulong assetID, uint amount) {
180-
if ((appID == 0) || (contextID == 0) || (assetID == 0) || (amount == 0)) {
181-
throw new ArgumentNullException(nameof(appID) + " || " + nameof(contextID) + " || " + nameof(assetID) + " || " + nameof(amount));
179+
// This constructor is used for constructing items in trades being sent
180+
internal Item(uint appID, ulong contextID, ulong assetID, uint amount) : this(appID, contextID, amount) {
181+
if (assetID == 0) {
182+
throw new ArgumentNullException(nameof(assetID));
182183
}
183184

184-
AppID = appID;
185-
ContextID = contextID;
186185
AssetID = assetID;
187-
Amount = amount;
188186
}
189187

190-
internal Item(uint appID, ulong contextID, uint amount, uint realAppID, EType type) {
191-
if ((appID == 0) || (contextID == 0) || (amount == 0)) {
192-
throw new ArgumentNullException(nameof(appID) + " || " + nameof(contextID) + " || " + nameof(amount));
188+
// This constructor is used for constructing items in trades being received
189+
internal Item(uint appID, ulong contextID, ulong classID, uint amount, uint realAppID, EType type) : this(appID, contextID, amount) {
190+
if (classID == 0) {
191+
throw new ArgumentNullException(nameof(classID));
193192
}
194193

195-
AppID = appID;
196-
ContextID = contextID;
197-
Amount = amount;
194+
ClassID = classID;
198195
RealAppID = realAppID;
199196
Type = type;
200197
}
201198

202199
[SuppressMessage("ReSharper", "UnusedMember.Local")]
203200
private Item() { }
201+
202+
private Item(uint appID, ulong contextID, uint amount) {
203+
if ((appID == 0) || (contextID == 0) || (amount == 0)) {
204+
throw new ArgumentNullException(nameof(appID) + " || " + nameof(contextID) + " || " + nameof(amount));
205+
}
206+
207+
AppID = appID;
208+
ContextID = contextID;
209+
Amount = amount;
210+
}
204211
}
205212

206213
internal sealed class TradeOffer { // REF: https://developer.valvesoftware.com/wiki/Steam_Web_API/IEconService#CEcon_TradeOffer

0 commit comments

Comments
 (0)