question

Matt avatar image
Matt asked

Multiple Calls Combined Into One

When the player completes a level in my game I'd like to give them some virtual currencies, save some statistics, maybe award achievements and other things, and update their progress in the PlayerData. Is there a way to perform all of this in a single update call with a single result/error?

If the call fails at any time, I need to let the user know they've lost connection and they can't do anything else until it's restored. It'd be much easier to do this with a single call than having to watch for a series of results coming back to make sure they all succeeded.

I was imagining something similar to the Login call, where I can just specify all of the things I wish to update and send it out. If not...is there a better approach than making several, separate calls to update data on the server?

Thanks!

-Matt

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

Yes, you would accomplish that by using Cloud Script to create a handler that does all the actions you need. The bonus there is that you can build the logic of your handler to make sure you're protecting against cheating as much as possible - making sure reported scores are reasonable (within range, and that enough time has passed since their last report), use Title Data to have a server-authoritative source for info on rewards (achievement, VC, or anything else), etc.

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.