question

Konrad Kozaczenko avatar image
Konrad Kozaczenko asked

Data encryption in cloud script response

Hi, in my game created with Unity, player starts certain mission which have 10 sub levels. Player can go from one level to another when he will defeat all enemies on current level. I want to store in player data on what mission is player playing and on what level he actually is. So for now my approach is

1. User starts mission, I execute cloud script which save in internal data currentMission and currentLevel.

2. When player kill all enemies in certain level I execute another cloud script which increment currentLevel.

3. When player is on the last level and kill all enemies I execute another one cloud script which will add to player gold and experience as reward for complete whole mission.

Now my question is how to prevent that user will not execute requests on playfab rest api on his own? I thought about some kind of data encryption / decryption on server and client side. I know that this is not perfect solution but it will make it harder to cheat I think.

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

·
Seth Du avatar image
Seth Du answered

Theoretically, it cannot be avoided for players to call restful API on their own. However, the client API will have specific permissions and in common scenarios, changes on those data won’t affect other players’ gaming experiences. Clients API won’t be able to update Player Read-Only Data and Player Internal Data. Players cannot see internal data via Client API.

Your solution should be fine and I will also suggest add a timestamp with “currentLevel” for verification.

Moreover, if you have concerns, you may deny particular client APIs via API Access Policy, please refer to: https://docs.microsoft.com/en-us/gaming/playfab/api-references/api-access-policy

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.