question

fiercy avatar image
fiercy asked

Subtracting Virtual Currency Using PlayFabID

So I have a question without a server if I have a client that at the start/end give/take coins from other players is there a way for me to do it provided I know PlayFabID within the API.

I don't know how to use any of CloudScript staff since you guys have 0 code examples.

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

Actually, all games created in our service have, as revision 1, a Cloud Script showing a number of basic tasks, including calling into the Server API. We also have a samples repo here (https://github.com/PlayFab/PlayFab-Samples) with a number of Cloud Script examples of common tasks, like progressive rewards and cross-promotion in games. I'll work with the site team to make sure the samples are promoted more.

In answer to your question, you can turn on the Client API calls to add/subtract virtual currency in your title's settings, but a) we strongly discourage this, as it makes it trivially easy for a hacked client to add as much currency as it wants to, and b) it's only for the signed-in player's currency.

If you want to modify the currencies of other players as a result of some action the player takes, the Server API would be the way to go, either using Cloud Script or a custom game server.

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.