question

hulosowanie7 avatar image
hulosowanie7 asked

How to make AddUserCurrency secure?

Hey!

I need to have CloudScript function which is calling AddUserCurrency secure.

The currency in game may be exchange for the real money so it must be high secure.

Please write me step by step what should I do to make it high secure, by this time I am using args.Value from game but everyone can set value.

CloudScript
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

If you want to ensure the security when calling the server.AddUserVirtualCurrency API in CloudScript and allowing the client to pass in the amount of currency as parameter, you have to write appropriate checks in the server-side logic to ensure the security. And the checks are dependent on your needs.

4 comments
10 |1200

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

hulosowanie7 avatar image hulosowanie7 commented ·

@Xiao Zha yes I know and my question is how is looking these appropriate checks? I was thinking how to do it but I do not know, can you help me?

I have only the "CODE" authentication but the player is able to PAUSE the call and then he gets a current CODE but the CALL is not finished and he is able to change args.Value

0 Likes 0 ·
Xiao Zha avatar image Xiao Zha hulosowanie7 commented ·

Since you allow the client to pass in the amount of currency as parameter, there is no way to fully guarantee the security of incoming values. For data security, all important data processing logic should be done by the server based on your game logic. For example, in the common scenario to ensure that the reward currency after the player kills the Boss will not be hacked, before playing the Boss level, the client first informs the server that the player is about to hit the Boss, then all the data of the player’s operations are processed by the server, include the final killing. After the fight, the server will issue the currency according to the configuration file written into the server in advance by the game. During this entire process, the client only provides the request to start the game and the player’s in-game battle operation request, and the client cannot touch the reward distribution process at all, which ensure the security of the data.

0 Likes 0 ·
hulosowanie7 avatar image hulosowanie7 Xiao Zha commented ·

Really there is no way to make it fully secure? Like I do not know JS language - only C# so there is no way that I will make these same script from the game in the CloudScript in JS language...

please there must a solution for that

0 Likes 0 ·
Show more comments

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.