1
0
mirror of https://github.com/anope/anope.git synced 2026-06-25 04:56:39 +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
+4 -6
View File
@@ -134,13 +134,14 @@ public:
class ModuleSQLOper final
: public Module
{
Anope::string engine;
Anope::string query;
ServiceReference<SQL::Provider> SQL;
public:
ModuleSQLOper(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, EXTRA | VENDOR)
ModuleSQLOper(const Anope::string &modname, const Anope::string &creator)
: Module(modname, creator, EXTRA | VENDOR)
, SQL("SQL::Provider")
{
}
@@ -159,11 +160,8 @@ public:
void OnReload(Configuration::Conf &conf) override
{
const auto &config = conf.GetModule(this);
this->engine = config.Get<const Anope::string>("engine");
this->query = config.Get<const Anope::string>("query");
this->SQL = ServiceReference<SQL::Provider>("SQL::Provider", this->engine);
this->SQL.SetServiceName(config.Get<const Anope::string>("engine"));
}
void OnNickIdentify(User *u) override