1
0
mirror of https://github.com/anope/anope.git synced 2026-07-04 09:23:13 +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 -11
View File
@@ -589,19 +589,12 @@ class DBPlain : public Module
public:
DBPlain(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, DATABASE | VENDOR)
{
Implementation i[] = { I_OnReload, I_OnLoadDatabase, I_OnSaveDatabase };
ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation));
OnReload();
LastDay = 0;
}
~DBPlain()
{
}
void BackupDatabase()
{
/* Do not backup a database that doesn't exist */
@@ -642,11 +635,10 @@ class DBPlain : public Module
}
}
void OnReload() anope_override
void OnReload(ServerConfig *conf, ConfigReader &reader) anope_override
{
ConfigReader config;
DatabaseFile = Anope::DataDir + "/" + config.ReadValue("db_plain", "database", "anope.db", 0);
BackupFile = Anope::DataDir + "/backups/" + config.ReadValue("db_plain", "database", "anope.db", 0);
DatabaseFile = Anope::DataDir + "/" + reader.ReadValue("db_plain", "database", "anope.db", 0);
BackupFile = Anope::DataDir + "/backups/" + reader.ReadValue("db_plain", "database", "anope.db", 0);
}
EventReturn OnLoadDatabase() anope_override