Decrease size of the request

We reached a point where it actually matters whether we say "realAppID" or just "r", since we're doing this sometimes even 600k times, multiplied by 9 properties that we have
This commit is contained in:
Archi
2023-01-11 18:40:46 +01:00
parent 3cadcd16b4
commit 4895a95794
3 changed files with 11 additions and 11 deletions

View File

@@ -57,7 +57,7 @@ internal static class Backend {
throw new ArgumentOutOfRangeException(nameof(tradeToken));
}
Uri request = new(ArchiNet.URL, "/Api/Listing/Announce");
Uri request = new(ArchiNet.URL, "/Api/Listing/Announce/v2");
AnnouncementRequest data = new(ASF.GlobalDatabase?.Identifier ?? Guid.NewGuid(), bot.SteamID, tradeToken, inventory, acceptedMatchableTypes, bot.BotConfig.TradingPreferences.HasFlag(BotConfig.ETradingPreferences.MatchEverything), ASF.GlobalConfig?.MaxTradeHoldDuration ?? GlobalConfig.DefaultMaxTradeHoldDuration, nickname, avatarHash);
@@ -80,7 +80,7 @@ internal static class Backend {
throw new ArgumentNullException(nameof(acceptedMatchableTypes));
}
Uri request = new(ArchiNet.URL, "/Api/Listing/Inventories");
Uri request = new(ArchiNet.URL, "/Api/Listing/Inventories/v2");
Dictionary<string, string> headers = new(1, StringComparer.Ordinal) {
{ "X-License-Key", licenseID.ToString("N") }

View File

@@ -26,10 +26,10 @@ using Newtonsoft.Json;
namespace ArchiSteamFarm.OfficialPlugins.ItemsMatcher.Data;
internal sealed class AssetForListing : AssetInInventory {
[JsonProperty(Required = Required.Always)]
[JsonProperty("i", Required = Required.Always)]
internal readonly uint Index;
[JsonProperty(Required = Required.Always)]
[JsonProperty("l", Required = Required.Always)]
internal readonly ulong PreviousAssetID;
internal AssetForListing(Asset asset, uint index, ulong previousAssetID) : base(asset) {

View File

@@ -26,25 +26,25 @@ using Newtonsoft.Json;
namespace ArchiSteamFarm.OfficialPlugins.ItemsMatcher.Data;
internal class AssetInInventory {
[JsonProperty(Required = Required.Always)]
[JsonProperty("a", Required = Required.Always)]
internal readonly uint Amount;
[JsonProperty(Required = Required.Always)]
[JsonProperty("d", Required = Required.Always)]
internal readonly ulong AssetID;
[JsonProperty(Required = Required.Always)]
[JsonProperty("c", Required = Required.Always)]
internal readonly ulong ClassID;
[JsonProperty(Required = Required.Always)]
[JsonProperty("r", Required = Required.Always)]
internal readonly Asset.ERarity Rarity;
[JsonProperty(Required = Required.Always)]
[JsonProperty("e", Required = Required.Always)]
internal readonly uint RealAppID;
[JsonProperty(Required = Required.Always)]
[JsonProperty("t", Required = Required.Always)]
internal readonly bool Tradable;
[JsonProperty(Required = Required.Always)]
[JsonProperty("p", Required = Required.Always)]
internal readonly Asset.EType Type;
internal AssetInInventory(Asset asset) {