Shutdowns
As part of the Game Automation API, Neuro is planned to get access to a new shutdown command, which as the name suggests, allows her to shut a game down.
Messages sent from Neuro
Section titled “Messages sent from Neuro”There are 2 types of shutdowns: graceful and immediate.
Graceful shutdowns
Section titled “Graceful shutdowns”When Neuro wants to do a graceful shutdown, she sends this packet to the connected client:
{ "command": "shutdown/graceful", "data": { "wants_shutdown": boolean }}The wants_shutdown key indicates whether or not Neuro wants to shutdown or not.
truemeans the game should save and quit to main menu at the next graceful point.falsemeans that the game should cancel shutdown preparations, as Neuro no longer wants to shut the game down.
When a shutdown/graceful command is sent from Neuro, it is recommended to save all the progress and return back to the main menu so that the files aren’t being read while she shuts the game down.
Immediate shutdown
Section titled “Immediate shutdown”When Neuro wants to do an immediate shutdown, she sends this packet to the connected client:
{ "command": "shutdown/immediate"}When a shutdown/immediate command is sent from Neuro, death is imminent. Save as much progress as possible, since there is only a couple seconds before Neuro kills the game’s process.
Messages sent to Neuro
Section titled “Messages sent to Neuro”Upon saving (and returning to main menu if a graceful shutdown was received), games that support this API should send back this packet:
{ "command": "shutdown/ready", "game": string}This will tell Neuro that the game can be closed safely now. Neuro will immediately (or as soon as possible) kill the game’s process, so definitely ensure that progress has been saved before sending this packet.