diff options
author | Adam <Adam@anope.org> | 2013-04-11 00:08:28 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2013-04-11 00:08:28 -0500 |
commit | 4f9b7874d6b3a41939ecc2e872ec08d03af7b5f1 (patch) | |
tree | 43162205d31b277c9ff12ee28b7e3a60d6382316 /modules/database/db_sql_live.cpp | |
parent | 207c46c871e85b55ae66acc456c6bc412c0c79f9 (diff) |
Pass new config and the new config reader to the OnReload event, aswell as call it on module load on modules that hook to it
Diffstat (limited to 'modules/database/db_sql_live.cpp')
-rw-r--r-- | modules/database/db_sql_live.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/modules/database/db_sql_live.cpp b/modules/database/db_sql_live.cpp index ab08472d8..a26b08cf7 100644 --- a/modules/database/db_sql_live.cpp +++ b/modules/database/db_sql_live.cpp @@ -75,8 +75,6 @@ class DBMySQL : public Module, public Pipe Implementation i[] = { I_OnReload, I_OnShutdown, I_OnLoadDatabase, I_OnSerializableConstruct, I_OnSerializableDestruct, I_OnSerializeCheck, I_OnSerializableUpdate }; ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); - OnReload(); - if (ModuleManager::FindFirstOf(DATABASE) != this) throw ModuleException("If db_sql_live is loaded it must be the first database module loaded."); } @@ -132,12 +130,11 @@ class DBMySQL : public Module, public Pipe init = false; } - void OnReload() anope_override + void OnReload(ServerConfig *conf, ConfigReader &reader) anope_override { - ConfigReader config; - this->engine = config.ReadValue("db_sql", "engine", "", 0); + this->engine = reader.ReadValue("db_sql", "engine", "", 0); this->SQL = ServiceReference<Provider>("SQL::Provider", this->engine); - this->prefix = config.ReadValue("db_sql", "prefix", "anope_db_", 0); + this->prefix = reader.ReadValue("db_sql", "prefix", "anope_db_", 0); } void OnSerializableConstruct(Serializable *obj) anope_override |