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_plain.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_plain.cpp')
| -rw-r--r-- | modules/database/db_plain.cpp | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/modules/database/db_plain.cpp b/modules/database/db_plain.cpp index f2b3bffd2..11274c593 100644 --- a/modules/database/db_plain.cpp +++ b/modules/database/db_plain.cpp @@ -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 |
