question

Travis Pettry avatar image
Travis Pettry asked

API Feature Settings

Hi All,

I am relatively new to PlayFab and I have ran across a few settings that I do not fully understand. I understand why you would not want the client to add virtual currency. However, I do not understand why you would not want the client to subtract virtual currency and post statistics. What is the difference between calling PlayFabClientAPI.SubtractUserVirtualCurrency in my client vs doing the same thing in cloud code?

Thank you,

Travis Pettry

CloudScript
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.

Travis Pettry avatar image Travis Pettry commented ·

I am only using this to deduct from the player lives that I am using as a currency.

0 Likes 0 ·

1 Answer

·
Hernando avatar image
Hernando answered

In the released games, we don't recommend allowing clients to upload statistics, for example, this user has encountered the problem with players cheating :https://community.playfab.com/questions/27050/players-cheating-in-my-leaderboard.html

As for why you should using SubtractUserVirtualCurrency on CloudScript, because this API can make the balance become negative. And call it on CloudScript, you can check the balance with the authoritative code to prevent the Player from becoming negative due to the outdated balance data.

Besides, maybe you think that the abuse of this API will only hurt the cheater himself, but we also need to try to avoid the loss of ordinary players due to accidental errors in the client side.

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.