1
0
mirror of https://github.com/anope/anope.git synced 2026-06-28 15:36:38 +02:00

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

This commit is contained in:
Adam
2013-04-11 00:08:28 -05:00
parent 207c46c871
commit 4f9b7874d6
45 changed files with 251 additions and 373 deletions
+3 -6
View File
@@ -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