question

george-1 avatar image
george-1 asked

Fix inventory problem through automation

I have an item that has been updated incorrectly. Due to human mistake names are spelled wrong, or something happened. The game is updated with this new inventory item.

Now we need to look through all players, remove that wrong item and replace it with the new item. I was hoping to use segments and automate the process by granting the item. But I need to first know if they had the wrong item in the first place. This part I can't find in the segment section.

Is the only solution to create a cloudscript and run that? Will it cause errors? I would check each player's inventory and see if they own it, then grant the new item. What is the best way to go about this. (Aside from double checking my work and catching it on the front end).

CloudScriptIn-Game EconomyPlayer 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

·
Xiao Zha avatar image
Xiao Zha answered

PlayFab doesn’t provide such feature to segment based on the items the player owns. You can post a feature request for it.

Using Scheduled Tasks to run Cloud Script or Azure Function in all player segment is the only way to automate the process. And please note that Cloud Script triggered from PlayStream actions are limited to 1 second of processing time. In your Function, you can use GetUserInventory API to get player Items, then you can call RevokeInventoryItems API with ItemInstanceId to revoke the wrong Items, then you can call GrantItemsToUser API to grant correct items to player.

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.