This commit is contained in:
JustArchi
2017-09-18 16:54:28 +02:00
parent 49f5dc67ec
commit 15df745680
3 changed files with 10 additions and 1 deletions

View File

@@ -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;
}

View File

@@ -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() { }

View File

@@ -143,6 +143,8 @@ namespace ArchiSteamFarm {
return default;
}
ArchiLogger.LogGenericDebug("JSON: <" + json + ">");
try {
return JsonConvert.DeserializeObject<T>(json);
} catch (JsonException e) {