summaryrefslogtreecommitdiff
path: root/modules/commands/cs_fantasy_stats.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/commands/cs_fantasy_stats.cpp')
-rw-r--r--modules/commands/cs_fantasy_stats.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/modules/commands/cs_fantasy_stats.cpp b/modules/commands/cs_fantasy_stats.cpp
index 580307441..b8c83e73b 100644
--- a/modules/commands/cs_fantasy_stats.cpp
+++ b/modules/commands/cs_fantasy_stats.cpp
@@ -12,7 +12,7 @@
/*************************************************************************/
#include "module.h"
-#include "../extra/sql.h"
+#include "modules/sql.h"
class MySQLInterface : public SQL::Interface
{
@@ -68,23 +68,21 @@ class CSStats : public Module
MySQLInterface sqlinterface;
Anope::string prefix;
public:
- CSStats(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
+ CSStats(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR),
commandcsstats(this), commandcsgstats(this), sql("", ""), sqlinterface(this)
{
me = this;
- this->SetAuthor("Anope");
Implementation i[] = { I_OnReload };
ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation));
- this->OnReload();
}
- void OnReload() anope_override
+ void OnReload(Configuration::Conf *conf) anope_override
{
- ConfigReader config;
- prefix = config.ReadValue("chanstats", "prefix", "anope_", 0);
- Anope::string engine = config.ReadValue("chanstats", "engine", "", 0);
- this->sql = ServiceReference<SQL::Provider>("SQL::Provider", engine);
+ prefix = conf->GetModule(this)->Get<const Anope::string>("prefix");
+ if (prefix.empty())
+ prefix = "anope_";
+ this->sql = ServiceReference<SQL::Provider>("SQL::Provider", conf->GetModule(this)->Get<const Anope::string>("engine"));
}
SQL::Result RunQuery(const SQL::Query &query)