question

Artem avatar image
Artem asked

How can I add game currency from a client?,How can I add currency to a client?

I need to add currency from the client (since I do not have a connection to the server in the game), I know about such a substance as AddUserVirtualCurrency, but I know that you can not top up the currency from the client, since it can replace it and cheat. What should I do in such an event?

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

·
Citrus Yan avatar image
Citrus Yan answered

Do you mean that your game do not have a connection to the custom server you hosted therefore you cannot have players make requests to it, which calls Server/AddUserVirtualCurrency API to add virtual currency for the requesting players? If that’s the case, maybe you can try executing a custom CloudScript function from the client-side using Client/ExecuteCloudScript, in that function, it first performs some validation workflow to prevent/detect cheating and then calls the Server/AddUserVirtualCurrency API to add virtual currency for the player. Please refer to this doc to learn more about writing custom CloudScript: Writing custom 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.

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.