mirror of
https://github.com/anope/anope.git
synced 2026-07-07 13:43:11 +02:00
Rework the interface for service references.
This commit is contained in:
@@ -73,17 +73,21 @@ class CSStats final
|
||||
MySQLInterface sqlinterface;
|
||||
Anope::string prefix;
|
||||
public:
|
||||
CSStats(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR),
|
||||
commandcsstats(this), commandcsgstats(this), sql("", ""), sqlinterface(this)
|
||||
CSStats(const Anope::string &modname, const Anope::string &creator)
|
||||
: Module(modname, creator, VENDOR)
|
||||
, commandcsstats(this)
|
||||
, commandcsgstats(this)
|
||||
, sql("SQL::Provider")
|
||||
, sqlinterface(this)
|
||||
{
|
||||
me = this;
|
||||
|
||||
}
|
||||
|
||||
void OnReload(Configuration::Conf &conf) override
|
||||
{
|
||||
prefix = conf.GetModule("chanstats").Get<const Anope::string>("prefix", "anope_");
|
||||
this->sql = ServiceReference<SQL::Provider>("SQL::Provider", conf.GetModule("chanstats").Get<const Anope::string>("engine"));
|
||||
const auto &block = conf.GetModule("chanstats");
|
||||
prefix = block.Get<const Anope::string>("prefix", "anope_");
|
||||
this->sql.SetServiceName(block.Get<const Anope::string>("engine"));
|
||||
}
|
||||
|
||||
SQL::Result RunQuery(const SQL::Query &query)
|
||||
|
||||
Reference in New Issue
Block a user