question

kliu avatar image
kliu asked

Is there a way to get a full inventory (including revoked items) for a player?

Pretty self-explanatory - I would like to know if a user has ever had an item before (even if it has been consumed, revoked, stacked, etc.).

Also is there a good way to query my entire userbase to see how many users have an item but it has been consumed or revoked?

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

·
Rick Chen avatar image
Rick Chen answered

When an item is granted or consumed, some PlayStream events will be generated. You could use the Event history to check the items that are grant to a player or consumed by a player:

  • Go to [Game Manager] -> [Your title] -> [Data], in the Event History tab, choose the relevant event name, e.g. “player_consumed_item”, then click Search blow. Then it will display those relevant events.
  • You can construct your own Event History Search
  • Be aware of the retention days on the top of the Event History tab.

Or you can use the PlayFab Explorer to search those events:

  • Go to [Game Manager] -> [Your title] -> [Data], choose the Explorer (Preview) tab, write the query and run it.
  • For example, the query below finds the events that a player with [PlayFabId] consumes the item with [Your Item ID]
  • ['events.all'] | where FullName_Name == ‘player_consumed_item’ | where Entity_Id == '[PlayFabId]' | where EventData.ItemId == '[Your Item ID]'
  • Replace the [PlayFabId] with the player’s PlayFabId and replace [Your Item ID] with the item ID you want to search for and click run.
  • If you want to see the amount of users that consumed the item, you can write:
    • ['events.all'] | where FullName_Name == ‘player_consumed_item’ | where EventData.ItemId == '[Your Item ID]' | count
    • Replace [Your Item ID] with the item ID you want to search for and click run.
  • You can refer to Kusto Query Language to learn how to write the query.
2 comments
10 |1200

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

kliu avatar image kliu commented ·

Thank you for answering, but I think I forgot to specify 2 things.

I want to see items that have been revoked as well as consumed. I don't see any of those events in history.

I also want to be able to query for more than 30 days at a time.

Ideally there would be a solution where I could pull up a list of players that have ever had this item revoked, but if I could do an API call to get the full inventory list (like what you see when you go to a player inventory and click the revoked stacked or consumed link) that would suit my needs as well.

0 Likes 0 ·
Rick Chen avatar image Rick Chen ♦ kliu commented ·

I am afraid that there is no way to query the consumed or revoked items using PlayFab APIs.

Depends on your scenario, you can set up your database to store those items when they are grant to the player, then you can query from your database. Or if you only want know if a player has ever consumed some specific items, I suggest using tags:

0 Likes 0 ·

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.