Xonotic Forums
Running a config script when the server becomes empty? - Printable Version

+- Xonotic Forums (https://forums.xonotic.org)
+-- Forum: Support (https://forums.xonotic.org/forumdisplay.php?fid=3)
+--- Forum: Xonotic - Server Administration (https://forums.xonotic.org/forumdisplay.php?fid=16)
+--- Thread: Running a config script when the server becomes empty? (/showthread.php?tid=7789)



Running a config script when the server becomes empty? - Notavi - 08-05-2018

I've got my server setup with different votable gametypes, and it's working well. But one thing I'd like to do is to have the server 'reset' itself to the defaults once it's empty. Is there some mechanism (I'm thinking something like the gametype hooks) which could be used to have the server run a set of commands / execute a configuration file when it starts up a new map empty?


RE: Running a config script when the server becomes empty? - martin-t - 08-06-2018

Yes, see my _if_empty alias which is called from sv_hook_gameend. Despite the comment about being experimental, it's worked well for quite a few months. It's inspired by this thread about the console.


RE: Running a config script when the server becomes empty? - Notavi - 08-11-2018

Nice, thanks Smile

Now to see if I can find a nice detailed page on prvm_globalget and rpn, those commands look like they could be very useful for a lot of things.


RE: Running a config script when the server becomes empty? - BuddyFriendGuy - 08-18-2018

I'm so stealing your _if_empty, martin-t! Thank you!