1
0
mirror of https://github.com/anope/anope.git synced 2026-06-27 03:16:37 +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
+4 -7
View File
@@ -95,8 +95,6 @@ class DBSQL : public Module, public Pipe
Implementation i[] = { I_OnReload, I_OnShutdown, I_OnRestart, I_OnLoadDatabase, I_OnSerializableConstruct, I_OnSerializableDestruct, I_OnSerializableUpdate, I_OnSerializeTypeCreate };
ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation));
this->OnReload();
if (ModuleManager::FindModule("db_sql_live") != NULL)
throw ModuleException("db_sql can not be loaded after db_sql_live");
}
@@ -148,13 +146,12 @@ class DBSQL : public Module, public Pipe
this->imported = true;
}
void OnReload() anope_override
void OnReload(ServerConfig *conf, ConfigReader &reader) anope_override
{
ConfigReader config;
Anope::string engine = config.ReadValue("db_sql", "engine", "", 0);
Anope::string engine = reader.ReadValue("db_sql", "engine", "", 0);
this->sql = ServiceReference<Provider>("SQL::Provider", engine);
this->prefix = config.ReadValue("db_sql", "prefix", "anope_db_", 0);
this->import = config.ReadFlag("db_sql", "import", "false", 0);
this->prefix = reader.ReadValue("db_sql", "prefix", "anope_db_", 0);
this->import = reader.ReadFlag("db_sql", "import", "false", 0);
}
void OnShutdown() anope_override