I've been writing a couple of plugins which make use of the MySQL facilitys available and I was wondering what the opinion is on exec'ing mysql.cfg. ATM all the sql plugins I am using register (or attempt to register) the db cvars and exec the config file, which means that (at tme moment) mysql.cfg is being exec'd three times on each map load.
I was wondering if perhaps it might be better to put all of this in a hypothetical
mysql_base plugin consisting of something like this:
Code:
//MySQL base plugin, required for use with all MySQL plugins
#include <amxmodx>
#include <amxmisc>
public plugin_init()
{
register_plugin("Base Plugin for MySQL","X.X","default")
register_cvar("amx_mysql_host","127.0.0.1")
register_cvar("amx_mysql_user","root")
register_cvar("amx_mysql_pass","")
register_cvar("amx_mysql_db","amx")
new configsDir[128]
get_configsdir(configsDir, 127)
server_cmd("exec %s/mysql.cfg", configsDir)
}
So that people writing plugins for MySql don't need to worry about registering the cvars and exec'ing the config file etc.
__________________