question

studio avatar image
studio asked

Cloud script execute more once

Hey,

I am not sure if this is a bug or not but, I am making a request to execute a cloudscript to gift an item to a player , but the request is happening 14 times , but I have only made the request once , I check the code and check it again , is there a way to add a validator to the script .

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

·
brendan avatar image
brendan answered

A script will only execute once from a call to ExecuteCloudScript, so it sounds like you have a PlayStream action set to trigger the script, which may be getting triggered by something you're doing in the script itself. What is the Title ID and the Cloud Script handler in question?

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

studio avatar image studio commented ·

Hey @Brendan,

The Title ID is E5C and I am calling the cloud script via unity by calling ExecuteCloudScriptRequest and passing the function 'RewardGachaPrize'.

As far as i know , the only way the cloudscript is called is via the code from the client

0 Likes 0 ·
brendan avatar image brendan studio commented ·

I'm not seeing that in any of the accounts I check. Can you also provide a PlayFab ID for a player account that ran into this issue?

0 Likes 0 ·
studio avatar image studio commented ·

The Title ID is E5C and I am calling the cloud script via unity by calling ExecuteCloudScriptRequest and passing the function 'RewardGachaPrize'.

As far as i know , the only way the cloudscript is called is via the code from the game client

0 Likes 0 ·
brendan avatar image brendan studio commented ·

Understood, but I'm not able to find an example of that issue in any player account. Can you please provide the PlayFab ID of a player account where this issue was seen?

0 Likes 0 ·
studio avatar image studio commented ·

Hi Brendan , this user id 307E035008DC703A that had the issue , on July 10th 12:59 PM he used a coin and then my code excutes a cloudscript to grant an item to the player , but instend of 1 item he got 14 items

Let me know if you need anything more @Brendan

0 Likes 0 ·
results.png (279.3 KiB)
brendan avatar image brendan studio commented ·

Looking at the details, the service only ran it once each time it was called - it's just that it was called that many times. If you're positive there's no way the client code could do that, it's likely the player just hacked the call. That's why we always recommend putting cheat checking code into your Cloud Script - the server side is the only place you can effectively prevent cheating, really. So, check min/max values, the last time something was called, etc. Right now, your RewardGachaPrize simply grants the item without taking any precautions to see if the call is legitimate.

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.