These are the docs for 13.3, an old version of SpatialOS. The docs for this version are frozen: we do not correct, update or republish them. 14.5 is the newest →

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 spatial 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. We don’t provide any out-of-the-box ways of doing this, so you’ll need to create your own.

Search results

Was this page helpful?

Thanks for letting us know!

Thanks for your feedback

Need more help? Ask on the forums