1
0
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:
Sadie Powell
2026-01-10 21:23:23 +00:00
parent 25cd6c96e3
commit bfb47ab5a6
14 changed files with 82 additions and 55 deletions
+9 -5
View File
@@ -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)