Best way to trigger a quit of Unity app running in batch mode
I have a Unity app running in batch mode (-batchmode) on an Amazon server. It is acting as a game server. I want to be able to remotely trigger this server to cleanly quit, and I'm trying to figure out the best way to do this. Killing the process is not an option because I want to do some cleanup before quitting.
I can imagine some ways, such as polling for the existence of a dummy file and quitting if it is found (that way I can trigger quit by creating this file), or sending a message via sockets, or even launching a Unity client whose only purpose is to send an RPC call to the server to tell it to quit.
Is there an easier/cleaner way?
In case relevant, it's running on Windows.
Thanks.
Comment