Game maintenance and recovery

Sometimes you need to take down your game temporarily. This might be for routine game maintenance, or because something’s gone wrong.

The following pages (Urgent restart, Precaution restart, and Scheduled maintenance) cover the best-practice steps you should follow in these scenarios.

Where possible, we've listed the SpatialOS CLI commands for these steps, but you can also do many of them using the Console.


Set up a worker flag callback

You can use a worker flag and the callback OnFlagUpdate to let players know that the game is going to stop. Which worker you set up the callback on depends on how you want to communicate the information to the players. For example, if you want to display a message to all players on their game clients, you’d set up the callback on your game client worker.

Set up your worker to register the OnFlagUpdate callback for a worker flag with a specific name (for example, urgent_restart) and to handle the flag’s value (for example, a message). You shouldn’t add the worker flag itself until you need to let the players know that the game is going to stop.

Set up a way of removing players from your game

For the precaution restart and scheduled maintenance steps, you need a way of removing all players from your game.

You can use system entities to do this. For details, see Interacting with client-worker entities.

Updated about a year ago

Game maintenance and recovery

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.