question

Konrad Kozaczenko avatar image
Konrad Kozaczenko asked

Purchasable item requirements

Hi, I created new bundle and I want it to be accessible only for players that are on level 10 or more in my game. Level is based on virtual currency (EXP). Is there a way that i can achive that?

Case in my game is that the player can buy 1250 gold for 50 diamonds but if he reach level 10 then he can buy 3750 gold for the same 50 diamond. Now I'm afraid that every player that will obtain his playfab token can call /purchaseItem endpoint on playfab API with changed item ID.

I know I can use CloudScript for this but I wonder if is there any way to achive that using catalog bundles?

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

We specifically designed the store system for this type of behavior. Here's how you would do this:

First, do not put any price on the items in the catalog. If you do, that price is valid for any purchase call that doesn't specify a store.

Next, set up your store for the "all players" segment (not containing the level 10+ item). We'll call this the "basic store".

Then, set up a store containing the item for level 10+ players. We'll call this the "special store".

In your player segmentation, you'll see that you have an "All Players" segment containing every player in your game. Don't change that one, as you do need it. But you should add a segment for players that have greater than or equal to the EXP you are defining for level 10+ players. We'll call that the "high exp player" segment, for this discussion.

Now, back to the stores:

In the "basic store", scroll down to the segment overrides and set an override to redirect the "high exp player" segment to the "special store". So now, when a player in that level 10+ segment requests the "basic store", they'll get the "special store" instead.

However, a hacker could have the purchase call point directly to the "special store", so the last step is to block them from being able to do that.

Finally, go to the "special store" and scroll down to the overrides. Set an override for the "All Players" segment to redirect them to the "basic store".

The key here is that only one level of redirection is used. So level 10+ players redirected to the "special store" will see that one (they won't be redirected a second time, away from it), but players who aren't can't get to the "special store" by hacking the call, as they're redirected back to the "basic store".

1 comment
10 |1200

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

Konrad Kozaczenko avatar image Konrad Kozaczenko commented ·

Brilliant! Thank you for your answer :)

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.