mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-01 06:00:46 +00:00
Test
This commit is contained in:
@@ -494,11 +494,12 @@ namespace ArchiSteamFarm {
|
||||
while (true) {
|
||||
Steam.InventoryResponse response = await WebBrowser.UrlGetToJsonResultRetry<Steam.InventoryResponse>(request + (startAssetID > 0 ? "&start_assetid=" + startAssetID : "")).ConfigureAwait(false);
|
||||
|
||||
if (response == null) {
|
||||
if (response?.Success != true) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if ((response.Assets == null) || (response.Assets.Count == 0) || (response.Descriptions == null) || (response.Descriptions.Count == 0)) {
|
||||
// Empty inventory
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -372,6 +372,7 @@ namespace ArchiSteamFarm.JSON {
|
||||
|
||||
internal ulong LastAssetID { get; private set; }
|
||||
internal bool MoreItems { get; private set; }
|
||||
internal bool Success { get; private set; }
|
||||
|
||||
[JsonProperty(PropertyName = "last_assetid", Required = Required.DisallowNull)]
|
||||
private string LastAssetIDString {
|
||||
@@ -395,6 +396,11 @@ namespace ArchiSteamFarm.JSON {
|
||||
set => MoreItems = value > 0;
|
||||
}
|
||||
|
||||
[JsonProperty(PropertyName = "success", Required = Required.Always)]
|
||||
private byte SuccessNumber {
|
||||
set => Success = value > 0;
|
||||
}
|
||||
|
||||
// Deserialized from JSON
|
||||
private InventoryResponse() { }
|
||||
|
||||
|
||||
@@ -143,6 +143,8 @@ namespace ArchiSteamFarm {
|
||||
return default;
|
||||
}
|
||||
|
||||
ArchiLogger.LogGenericDebug("JSON: <" + json + ">");
|
||||
|
||||
try {
|
||||
return JsonConvert.DeserializeObject<T>(json);
|
||||
} catch (JsonException e) {
|
||||
|
||||
Reference in New Issue
Block a user