question

andalexopoulos@gmail.com avatar image
andalexopoulos@gmail.com asked

Unique Item in player inventory

I am a returnee user of PlayFab and I was playing around with Catalogs and inventories while implementing my game, and got stuck in an implementation where I need an item to exist only once in the inventory of a player, so that if for some reason a duplicate call is made to the server via the API to purchase an already purchased item then the call must fail.

I haven't found a property while editing the items of my game, am I missing something or is this something that must be done manually?

For example, even though I will filter out any purchased items in the client, a server side call could be emulated via proxy clients that could result in a second item instance in a player inventory, which could affect the stat provision of that item.

If there is no out of the box solution for this, how would one go about implementing such functionality when using client API?

My ultimate intention is to block this by server API as well or even by granting the item manually to a player, so that no agent grants an item by mistake, that the player already owns.

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.

Citrus Yan avatar image
Citrus Yan answered

We don’t have a feature that guarantees the uniqueness of specific items in a player’s inventory yet. As a workaround, from the client side, you may prevent the player from buying a already owned item by disabling the “buy”option, and, from the server side, add some checks for duplicates before actually granting an item. And, I don’t quite follow this part: “a server side call could be emulated via proxy clients that could result in a second item instance in a player inventory”, because only you as a developer has full control over server side calls, clients have no way to access it, therefore proxy clients cannot emulate server calls.

10 |1200

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

andalexopoulos@gmail.com avatar image
andalexopoulos@gmail.com answered

First of all, thank you so much for your help and suggestion!

As far as your question goes, and while I am not really sure if this can be done, couldn't a sniffing tool catch a call before being called to the server, after leaving the client, and repeat that call? Perhaps it's my ignorance on such stuff (networking stuff, that is) that are confusing you, if this can't be done due to secure channels and network protocols, then it's all good.

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.