question

Omar avatar image
Omar asked

How to display player inventory in Economy V2?

If I have a player inventory with 100s of items how do I construct the inventory in a displayable state for the client? Our title does not use pagination, and has infinite scroll features.

It seems I can only retrieve portions of the inventory using "GetInventoryItems", and even in that response I don't have my friendly id? I only have the actual GUID which our localization database doesn't understand.

Is the expected way to create it is to recursively loop the "GetInventoryItems" request until I fully retrieve all items using continuation tokens? Then search those items across the catalog to get their friendly ids? This seems very inconvenient.

Player Inventory
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
drallcom3 avatar image
drallcom3 answered

At game start you first have to do a SearchItems() to get the catalog data you want. Then after the GetInventoryItems() you can construct your player inventory by searching within the catalog data. You will need some helper functions and maybe even a custom class for the player inventory entry.

I grab the whole catalog at game start, since it's not that much and I also did that with v1.

And yes, you have to use the continue token.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.