- removed OnServerCfg in favor of OnConfigsExecuted

- added AutoExecConfig() which automates safe config execution

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40984
This commit is contained in:
David Anderson
2007-06-18 07:04:22 +00:00
parent 33b2d04e2d
commit 254fc2557a
14 changed files with 447 additions and 100 deletions
+23 -8
View File
@@ -125,16 +125,16 @@ forward OnMapStart();
forward OnMapEnd();
/**
* Called when the map has loaded and the servercfgfile has finished
* executing. This is usually 'server.cfg' but most mods allow it to
* be set via 'servercfgfile'.
* Called when the map has loaded, servercfgfile (server.cfg) has been
* executed, and all plugin configs are done executing. This is the best
* place to inialize plugin functions which are based on cvar data.
*
* @note If server.cfg is executed more than once per map, this forward
* will only be called the first time (per map).
* @note It is not guaranteed that this will be called on all mods. If
* a mod does not appear to support it, please file a SourceMod bug report.
* @note This will always be called once and only once per map. It will be
* called after OnMapStart().
*
* @noreturn
*/
forward OnServerCfg();
forward OnConfigsExecuted();
/**
* Returns the calling plugin's Handle.
@@ -297,5 +297,20 @@ native bool:GameConfGetKeyValue(Handle:gc, const String:key[], String:buffer[],
*/
native GetSysTickCount();
/**
* Specifies that the given config file should be executed after plugin load.
* OnConfigsExecuted() will not be called until the config file has executed,
* but it will be called if the execution fails.
*
* @param autoCreate If true, and the config file does not exist, such a config
* file will be automatically created and populated with
* information from the plugin's registered cvars.
* @param name Name of the config file, excluding the .cfg extension.
* If empty, <plugin.filename.cfg> is assumed.
* @param folder Folder under cfg/ to use. By default this is "sourcemod."
* @noreturn
*/
native AutoExecConfig(bool:autoCreate=true, const String:name[]="", const String:folder[]="sourcemod");
#include <helpers>
#include <entity>