Closed sudhxnva closed 3 years ago
Wrote code to parse the sprays and add them to the PlayerInventory
return object
Here's the example output now when valorant.playerApi..getInventory()
is called:
{
"Subject": "16848a0d-ec55-5e7b-9ad8-6d51c6f2d54e",
"Version": 344,
"GunSkins": {
"Odin": "f454efd1-49cb-372f-7096-d394df615308",
"Ares": "556646c0-46dd-6986-00df-a78d1c17f268",
"Vandal": "b9ee2457-481c-6776-3f5b-0ca8e8f90c89",
"Bulldog": "dbf7b813-4931-3b45-db2b-ea8d418b2b1d",
"Phantom": "25a7f0f2-4bce-7e45-b4b0-ca9264f5dfcc",
"Judge": "5d217dd0-4f2c-cfca-274e-3f8f9d518b13",
"Bucky": "1322a9a8-49ad-bc3a-2319-fb866e21334c",
"Frenzy": "7d05d1ce-4bf2-fa96-d8f4-dca86052e3d2",
"Classic": "d653f4a7-4e92-2559-0a97-2c9d46d009b3",
"Ghost": "0a6edcf0-4a64-0ed5-1b10-0e96c2eb4cb4",
"Sheriff": "121bc438-4748-b2ee-2c58-768c8c26838b",
"Shorty": "3a921c7b-4e8f-8543-bee8-01ba6da86874",
"Operator": "aecab890-43b7-d719-06bc-9295e3d116dc",
"Guardian": "96679876-4d41-683c-2e5c-2ea25ddd8fdf",
"Marshal": "fd44b2d5-49ee-77ab-fa56-588f3ac0c268",
"Spectre": "d405272b-4388-578c-e33b-04842496b8c1",
"Stinger": "0cf70376-4150-39aa-5657-8890617bc0d1",
"Melee": "24cf2882-48c7-f287-155a-a4b6b083baa4"
},
"Sprays": {
"PreRound": "677dc003-4dbf-66a8-9116-4f8d7a9fb8d5",
"MidRound": "0eb56d06-474d-fbec-372f-069286388bc5",
"PostRound": "bc8917ee-4e11-0286-ff49-77b1e5b12fcb"
},
"Identity": {
"PlayerCardID": "5b27d2de-4a97-d6c1-76e7-669189c67072",
"PlayerTitleID": "f3bf3c15-4e3b-6e58-64a3-8f9995f39370",
"AccountLevel": 0
}
}
Sorry for reading it this late, I will be updating the library tomorrow. Thank you for pointing out this issue!
Thanks!
Updated library
ItemParser
Update to Handle New FormatRiot is sending data to the endpoint
/personalization/v2/players/{accountID}/playerloadout
in a revised format, which broke the old ItemParser implementation. Refer Issue #16 .Here is the new format of data:
A new
Identity
property is now present. And it looks like it's returning the new "Account Level" feature Riot is releasing soon (source)It is only a minor change, so I made a small refactor in the ItemParser code. It will return the
Identity
object, which contains the PlayerCardID and PlayerTitleID. (Since this is a refactor, this might break valorant.js dependants - well tbh it's already broken right now).Also (off topic), looks like Riot is implementing an "Incognito" feature for Valorant? Inferring this from the last
Incognito
property. I don't know if this existed before.