question

Matthew Miskiewicz avatar image
Matthew Miskiewicz asked

"Disable client API access" for scheduled maintenance?

In my game, there will be "season resets" that occur once per month. A scheduled cloud script will run at this time, updating player statistics and player data. In order to prevent various types of issues, it makes sense to me to temporarily make the game unavailable in "maintenance mode" for perhaps 15 or 30 minutes.

Is there a recommended way to do this? A few solutions I can think of:

1. Use the "Disable client API access" option in title settings -> api features

2. Update the permissions policy to disable API calls from the client

3. Have a flag in title data indicating if in maintenance mode, then all CloudScript functions check the flag before executing. (I'm sure this would work, but seems overboard)

Solution 1 seems ideal (except that the client won't get a response like, "In maintenance mode," but I can work the timing logic into the client to predict when maintenance occurs). I mainly wanted to check, is this part of the intended use for this option, and I assume that I can re-enable the client API access with no issue? If I should not use this option in this way, what solution is recommended?

Thanks!

-Matt

Edit: I think the solution I'm going to use, is #3 above. Each season, 15 before and after the maintenance is done, a scheduled cloud script will set the title-data flag. Then all cloudscript functions will check if in maintenance mode, which won't cause much any API overhead because I'm already calling getCombinedInfo with every 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

·
brandon@uprootstudios.com avatar image
brandon@uprootstudios.com answered

We ended up going with your #3 route and using Title data to set our game's maintenance configuration, as we tested with disabling API policies and it would take 2-8 hours before the policy was updated for all clients.

In one scenario, I enabled a Client call in the API policy before going to sleep, and later the next day 1 to 3 calls to the API would still return as disabled.

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Matthew Miskiewicz avatar image Matthew Miskiewicz commented ·

Ah, that's great to know! I appreciate the info :-)

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.