question

JULIEN MAIRAT avatar image
JULIEN MAIRAT asked

How to revoke player inventory item from the console and automatically update the player data

We are using playstream and cloudscript when we grant an item to a player from the console using player_inventory_item_added and a custom cloudscript. This let's us grant a player an item from the console and automatically updates that player's data to reflect the change.

Looking through the default options for playstream events we didn't see any option for revoking (ie player_inventory_item_removed) similar to granting an item. We would like to revoke the item in the console and set up a playstream event and cloudscript that automatically updates the player data.

We found player_item_consumed but this wasn't triggerable when we revoke an item in the console and doesn't reflect the use case for a durable item.

What is the best way to achieve this?

Player DataCloudScriptPlayer InventoryPlayStream
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

·
brendan avatar image
brendan answered

Correct, as we mentioned in this thread (https://community.playfab.com/questions/7391/revoke-item-event.html), we have a backlog item for an "item revoked" event, but there isn't one in the service currently. Since item revocation can only be done via a targeted API call or through the Game Manager though, right now you could simply have the process be to do both steps - revoke the item, then update the data. The simplest would be to do this via a script that does both API calls for you, using the Server API.

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.