summaryrefslogtreecommitdiff
path: root/modules/extra
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2016-07-28 21:29:35 -0400
committerAdam <Adam@anope.org>2016-07-28 21:29:35 -0400
commit0e758a2ac23dc4a001e8e126cec14588da9a9769 (patch)
tree45df813323e023c5c89db7279426c4ad0943b4a9 /modules/extra
parenta3c8afae00c54d5b95c620248b51f90679d7d53f (diff)
Allow serializable fields to use storage in the respective objects.
Split service management code nito a proper servicemanager. Make service references managed instead of lazy lookup. Also made events and serializable use service manager instead of their respective systems for management
Diffstat (limited to 'modules/extra')
-rw-r--r--modules/extra/ldap_authentication.cpp2
-rw-r--r--modules/extra/mysql.cpp5
-rw-r--r--modules/extra/sasl_dh-aes.cpp2
-rw-r--r--modules/extra/sasl_dh-blowfish.cpp2
-rw-r--r--modules/extra/sql_authentication.cpp2
-rw-r--r--modules/extra/stats/chanstats.cpp4
6 files changed, 9 insertions, 8 deletions
diff --git a/modules/extra/ldap_authentication.cpp b/modules/extra/ldap_authentication.cpp
index dd63fd3fb..ac4b9dd4e 100644
--- a/modules/extra/ldap_authentication.cpp
+++ b/modules/extra/ldap_authentication.cpp
@@ -97,7 +97,7 @@ class IdentifyInterface : public LDAPInterface
{
na = new NickServ::Nick(ii->req->GetAccount(), new NickServ::Account(ii->req->GetAccount()));
na->SetLastRealname(ii->user ? ii->user->realname : ii->req->GetAccount());
- NickServ::Event::OnNickRegister(&NickServ::Event::NickRegister::OnNickRegister, ii->user, na, ii->req->GetPassword());;
+ NickServ::EventManager::Get()->Dispatch(&NickServ::Event::NickRegister::OnNickRegister, ii->user, na, ii->req->GetPassword());;
ServiceBot *NickServ = Config->GetClient("NickServ");
if (ii->user && NickServ)
ii->user->SendMessage(NickServ, _("Your account \002%s\002 has been successfully created."), na->GetNick().c_str());
diff --git a/modules/extra/mysql.cpp b/modules/extra/mysql.cpp
index 843a2ba0a..11a5e1f15 100644
--- a/modules/extra/mysql.cpp
+++ b/modules/extra/mysql.cpp
@@ -182,6 +182,7 @@ class ModuleSQL : public Module
DispatcherThread *DThread;
ModuleSQL(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, EXTRA | VENDOR)
+ , EventHook<Event::ModuleUnload>(this)
{
me = this;
@@ -526,9 +527,9 @@ void MySQLService::Connect()
bool connect = mysql_real_connect(this->sql, this->server.c_str(), this->user.c_str(), this->password.c_str(), this->database.c_str(), this->port, NULL, CLIENT_MULTI_RESULTS);
if (!connect)
- throw SQL::Exception("Unable to connect to MySQL service " + this->name + ": " + mysql_error(this->sql));
+ throw SQL::Exception("Unable to connect to MySQL service " + this->GetName() + ": " + mysql_error(this->sql));
- Log(LOG_DEBUG) << "Successfully connected to MySQL service " << this->name << " at " << this->server << ":" << this->port;
+ Log(LOG_DEBUG) << "Successfully connected to MySQL service " << this->GetName() << " at " << this->server << ":" << this->port;
}
diff --git a/modules/extra/sasl_dh-aes.cpp b/modules/extra/sasl_dh-aes.cpp
index dd06d118b..b4920aeb4 100644
--- a/modules/extra/sasl_dh-aes.cpp
+++ b/modules/extra/sasl_dh-aes.cpp
@@ -161,7 +161,7 @@ class DHAES : public Mechanism
return Err(sess, pubkey);
SASL::IdentifyRequest* req = new SASL::IdentifyRequest(this->owner, m.source, username, password);
- Event::OnCheckAuthentication(&Event::CheckAuthentication::OnCheckAuthentication, nullptr, req);
+ EventManager::Get()->Dispatch(&Event::CheckAuthentication::OnCheckAuthentication, nullptr, req);
req->Dispatch();
BN_free(pubkey);
diff --git a/modules/extra/sasl_dh-blowfish.cpp b/modules/extra/sasl_dh-blowfish.cpp
index f6e4b27b3..e3e0eb4f9 100644
--- a/modules/extra/sasl_dh-blowfish.cpp
+++ b/modules/extra/sasl_dh-blowfish.cpp
@@ -171,7 +171,7 @@ class DHBS : public Mechanism
return Err(sess, pubkey);
SASL::IdentifyRequest* req = new SASL::IdentifyRequest(this->owner, m.source, username, password);
- Event::OnCheckAuthentication(&Event::CheckAuthentication::OnCheckAuthentication, nullptr, req);
+ EventManager::Get()->Dispatch(&Event::CheckAuthentication::OnCheckAuthentication, nullptr, req);
req->Dispatch();
BN_free(pubkey);
diff --git a/modules/extra/sql_authentication.cpp b/modules/extra/sql_authentication.cpp
index 1c2dbe729..a7d5b206f 100644
--- a/modules/extra/sql_authentication.cpp
+++ b/modules/extra/sql_authentication.cpp
@@ -43,7 +43,7 @@ class SQLAuthenticationResult : public SQL::Interface
if (na == NULL)
{
na = new NickServ::Nick(req->GetAccount(), new NickServ::Account(req->GetAccount()));
- NickServ::Event::OnNickRegister(&NickServ::Event::NickRegister::OnNickRegister, user, na, "");
+ NickServ::EventManager::Get()->Dispatch(&NickServ::Event::NickRegister::OnNickRegister, user, na, "");
if (user && NickServ)
user->SendMessage(NickServ, _("Your account \002%s\002 has been successfully created."), na->GetNick().c_str());
}
diff --git a/modules/extra/stats/chanstats.cpp b/modules/extra/stats/chanstats.cpp
index 687c077b5..65a198449 100644
--- a/modules/extra/stats/chanstats.cpp
+++ b/modules/extra/stats/chanstats.cpp
@@ -20,7 +20,7 @@ class CommandCSSetChanstats : public Command
}
EventReturn MOD_RESULT;
- MOD_RESULT = Event::OnSetChannelOption(&Event::SetChannelOption::OnSetChannelOption, source, this, ci, params[1]);
+ MOD_RESULT = EventManager::Get()->Dispatch(&Event::SetChannelOption::OnSetChannelOption, source, this, ci, params[1]);
if (MOD_RESULT == EVENT_STOP)
return;
@@ -73,7 +73,7 @@ class CommandNSSetChanstats : public Command
}
EventReturn MOD_RESULT;
- MOD_RESULT = Event::OnSetNickOption(&Event::SetNickOption::OnSetNickOption, source, this, na->GetAccount(), param);
+ MOD_RESULT = EventManager::Get()->Dispatch(&Event::SetNickOption::OnSetNickOption, source, this, na->GetAccount(), param);
if (MOD_RESULT == EVENT_STOP)
return;