Description:
We've been having problems with memory leaks in servers, so I created this plugin that automatically forces a server quit at an appropriate time. By default, the plugin will force a quit when it has been 2 hours since the last forced quit and the server is empty of players.
Configuration:
There are 4 configuration cvars and a public version cvar.
sm_autoquit_restartinterval - This is the minimum amount of time that must elapse before the plugin will restart a server again. Default is 7200 seconds (2 hours) sm_autoquit_checkinterval - This determines how often the plugin should check if it should restart the server. Default is 600 seconds (10 minutes). sm_autoquit_maxplayers - The plugin will force a quit if there are this many or fewer players in the server. Setting to 3 means the server will restart if 3 or fewer players are present. Setting to 0 means the server must be empty. Default is 0. sm_autoquit_debug - Enables debug output to the sourcemod logs. Default is 0. sm_autoquit_version - public cvar
Requirements
I don't know the minimum version of Sourcemod required but there is nothing sophisticated in this plugin. So I'll just guess at:
Sourcemod 1.2.1
Installation
Just put the .smx in the plugins directory.
Two files are automatically created when the plugin first runs.
The plugin uses AutoExecConfig() to create a "plugin.autoquit.cfg" file. On my tf server it is at tf/cfg/sourcemod/plugin.autoquit.cfg.
The plugin keeps track of the last time it forced a restart with a key/value file stored at a path created by BuildPath at "data/autoquit.kv". On my tf2 server it is stored in tf/addons/sourcemod/data/autoquit.kv.
Last edited by NovaDenizen; 11-14-2010 at 22:21.
Reason: typo