When is my cloud script code exposed to hackers?
I found this answer but I don't understand the difference between a function that is exposed and a function that is not exposed.
"Players can can only call CloudScript methods attached to the handlers JavaScript object. So, if you didn't expose your function with handlers object then hackers also can not invoke that function."
How can I find out if my functions are exposed and vulnerable to hackers?
For example, I call AddGoldCoins in my client code with PlayFabClientAPI.ExecuteCloudScript. Is this cloud script code exposed or not? If yes, how could I change the code in order to protect it from hackers?
handlers.AddGoldCoins = function (args, context) { if (args.rewardType == "Bronze") { server.AddUserVirtualCurrency({PlayFabID: currentPlayerId, VirtualCurrency: "GO", Amount: "100"}); } if (args.rewardType == "Silver") { server.AddUserVirtualCurrency({PlayFabID: currentPlayerId, VirtualCurrency: "GO", Amount: "200"}); } if (args.rewardType == "Gold") { server.AddUserVirtualCurrency({PlayFabID: currentPlayerId, VirtualCurrency: "GO", Amount: "500"}); } return {messageValue: "added reward"}; }