summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/event.h94
-rw-r--r--include/modules/bs_badwords.h1
-rw-r--r--include/modules/bs_bot.h4
-rw-r--r--include/modules/bs_info.h1
-rw-r--r--include/modules/bs_kick.h2
-rw-r--r--include/modules/chanserv.h7
-rw-r--r--include/modules/cs_access.h2
-rw-r--r--include/modules/cs_akick.h2
-rw-r--r--include/modules/cs_drop.h2
-rw-r--r--include/modules/cs_info.h1
-rw-r--r--include/modules/cs_mode.h1
-rw-r--r--include/modules/cs_set.h3
-rw-r--r--include/modules/cs_suspend.h2
-rw-r--r--include/modules/dns.h3
-rw-r--r--include/modules/fantasy.h3
-rw-r--r--include/modules/help.h2
-rw-r--r--include/modules/hs_del.h2
-rw-r--r--include/modules/memoserv.h12
-rw-r--r--include/modules/nickserv.h13
-rw-r--r--include/modules/ns_cert.h2
-rw-r--r--include/modules/ns_drop.h1
-rw-r--r--include/modules/ns_group.h2
-rw-r--r--include/modules/ns_info.h2
-rw-r--r--include/modules/ns_set.h4
-rw-r--r--include/modules/ns_suspend.h6
-rw-r--r--include/modules/ns_update.h1
-rw-r--r--include/modules/os_defcon.h1
-rw-r--r--include/modules/os_session.h1
-rw-r--r--modules/bs_autoassign.cpp2
-rw-r--r--modules/commands/bs_assign.cpp4
-rw-r--r--modules/commands/bs_badwords.cpp2
-rw-r--r--modules/commands/bs_bot.cpp5
-rw-r--r--modules/commands/bs_info.cpp3
-rw-r--r--modules/commands/bs_kick.cpp6
-rw-r--r--modules/commands/bs_set.cpp2
-rw-r--r--modules/commands/cs_access.cpp4
-rw-r--r--modules/commands/cs_akick.cpp4
-rw-r--r--modules/commands/cs_drop.cpp2
-rw-r--r--modules/commands/cs_entrymsg.cpp2
-rw-r--r--modules/commands/cs_info.cpp2
-rw-r--r--modules/commands/cs_list.cpp2
-rw-r--r--modules/commands/cs_log.cpp4
-rw-r--r--modules/commands/cs_mode.cpp8
-rw-r--r--modules/commands/cs_seen.cpp14
-rw-r--r--modules/commands/cs_set.cpp24
-rw-r--r--modules/commands/cs_set_misc.cpp2
-rw-r--r--modules/commands/cs_suspend.cpp12
-rw-r--r--modules/commands/cs_topic.cpp6
-rw-r--r--modules/commands/greet.cpp6
-rw-r--r--modules/commands/help.cpp2
-rw-r--r--modules/commands/hs_del.cpp2
-rw-r--r--modules/commands/hs_group.cpp4
-rw-r--r--modules/commands/ns_access.cpp2
-rw-r--r--modules/commands/ns_ajoin.cpp2
-rw-r--r--modules/commands/ns_cert.cpp6
-rw-r--r--modules/commands/ns_drop.cpp2
-rw-r--r--modules/commands/ns_group.cpp2
-rw-r--r--modules/commands/ns_info.cpp2
-rw-r--r--modules/commands/ns_list.cpp2
-rw-r--r--modules/commands/ns_recover.cpp4
-rw-r--r--modules/commands/ns_register.cpp4
-rw-r--r--modules/commands/ns_resetpass.cpp2
-rw-r--r--modules/commands/ns_set.cpp16
-rw-r--r--modules/commands/ns_set_misc.cpp2
-rw-r--r--modules/commands/ns_suspend.cpp18
-rw-r--r--modules/commands/ns_update.cpp2
-rw-r--r--modules/commands/os_defcon.cpp14
-rw-r--r--modules/commands/os_dns.cpp10
-rw-r--r--modules/commands/os_forbid.cpp8
-rw-r--r--modules/commands/os_ignore.cpp2
-rw-r--r--modules/commands/os_info.cpp4
-rw-r--r--modules/commands/os_login.cpp2
-rw-r--r--modules/commands/os_news.cpp4
-rw-r--r--modules/commands/os_noop.cpp2
-rw-r--r--modules/commands/os_session.cpp8
-rw-r--r--modules/cs_statusupdate.cpp4
-rw-r--r--modules/database/db_flatfile.cpp4
-rw-r--r--modules/database/db_old.cpp4
-rw-r--r--modules/database/db_redis.cpp4
-rw-r--r--modules/database/db_sql.cpp2
-rw-r--r--modules/encryption/enc_bcrypt.cpp4
-rw-r--r--modules/encryption/enc_md5.cpp4
-rw-r--r--modules/encryption/enc_none.cpp6
-rw-r--r--modules/encryption/enc_old.cpp4
-rw-r--r--modules/encryption/enc_sha1.cpp4
-rw-r--r--modules/encryption/enc_sha256.cpp4
-rw-r--r--modules/extra/m_ldap.cpp2
-rw-r--r--modules/extra/m_ldap_oper.cpp4
-rw-r--r--modules/extra/m_mysql.cpp2
-rw-r--r--modules/extra/m_sql_authentication.cpp4
-rw-r--r--modules/extra/m_sql_log.cpp2
-rw-r--r--modules/extra/m_sql_oper.cpp2
-rw-r--r--modules/extra/m_ssl_gnutls.cpp2
-rw-r--r--modules/extra/m_ssl_openssl.cpp2
-rw-r--r--modules/fantasy.cpp8
-rw-r--r--modules/m_dns.cpp2
-rw-r--r--modules/m_dnsbl.cpp2
-rw-r--r--modules/m_helpchan.cpp2
-rw-r--r--modules/m_httpd.cpp2
-rw-r--r--modules/m_proxyscan.cpp2
-rw-r--r--modules/m_redis.cpp2
-rw-r--r--modules/ns_maxemail.cpp2
-rw-r--r--modules/protocol/bahamut.cpp2
-rw-r--r--modules/protocol/charybdis.cpp4
-rw-r--r--modules/protocol/hybrid.cpp2
-rw-r--r--modules/protocol/inspircd20.cpp14
-rw-r--r--modules/protocol/ngircd.cpp2
-rw-r--r--modules/protocol/unreal.cpp10
-rw-r--r--modules/pseudoclients/botserv/botserv.cpp18
-rw-r--r--modules/pseudoclients/chanserv/chanserv.cpp42
-rw-r--r--modules/pseudoclients/global.cpp8
-rw-r--r--modules/pseudoclients/hostserv.cpp10
-rw-r--r--modules/pseudoclients/memoserv/memoserv.cpp20
-rw-r--r--modules/pseudoclients/nickserv/nickserv.cpp48
-rw-r--r--modules/pseudoclients/operserv.cpp18
-rw-r--r--src/event.cpp168
116 files changed, 508 insertions, 365 deletions
diff --git a/include/event.h b/include/event.h
index a8c8999cd..1cc39a67e 100644
--- a/include/event.h
+++ b/include/event.h
@@ -59,6 +59,9 @@ struct Caller<EventHandler, Func, EventReturn, Args...>
}
};
+template<typename T>
+struct EventName;
+
template<typename EventHandler>
class EventHook;
@@ -69,7 +72,7 @@ class EventHandlers : public Service
friend class EventHook<EventHandler>;
public:
- EventHandlers(Module *o, const Anope::string &ename) : Service(o, "EventHandlers", ename)
+ EventHandlers(Module *o) : Service(o, "EventHandlers", EventName<EventHandler>::name)
{
}
@@ -85,7 +88,7 @@ class EventHandlersReference
{
ServiceReference<EventHandlers<EventHandler>> ref;
public:
- EventHandlersReference(const Anope::string &name) : ref("EventHandlers", name) { }
+ EventHandlersReference() : ref("EventHandlers", EventName<EventHandler>::name) { }
explicit operator bool()
{
@@ -131,7 +134,7 @@ class EventHook : public EventHandler
}
priority;
- EventHook(const Anope::string &name, Priority p = Priority::LAST) : handlers(this, name), priority(p)
+ EventHook(Priority p = Priority::LAST) : handlers(this, EventName<EventHandler>::name), priority(p)
{
handlers.Check();
}
@@ -1013,3 +1016,88 @@ namespace Event
extern CoreExport EventHandlers<SerializeEvents> OnSerialize;
}
+template<> struct EventName<Event::PreUserKicked> { static constexpr const char *const name = "OnPreUserKicked"; };
+template<> struct EventName<Event::UserKicked> { static constexpr const char *const name = "OnUserKicked"; };
+template<> struct EventName<Event::PreBotAssign> { static constexpr const char *const name = "OnPreBotAssign"; };
+template<> struct EventName<Event::BotAssign> { static constexpr const char *const name = "OnBotAssign"; };
+template<> struct EventName<Event::BotUnAssign> { static constexpr const char *const name = "OnBotUnAssign"; };
+template<> struct EventName<Event::UserConnect> { static constexpr const char *const name = "OnUserConnect"; };
+template<> struct EventName<Event::NewServer> { static constexpr const char *const name = "OnNewServer"; };
+template<> struct EventName<Event::UserNickChange> { static constexpr const char *const name = "OnUserNickChange"; };
+template<> struct EventName<Event::PreCommand> { static constexpr const char *const name = "OnPreCommand"; };
+template<> struct EventName<Event::PostCommand> { static constexpr const char *const name = "OnPostCommand"; };
+template<> struct EventName<Event::SaveDatabase> { static constexpr const char *const name = "OnSaveDatabase"; };
+template<> struct EventName<Event::LoadDatabase> { static constexpr const char *const name = "OnLoadDatabase"; };
+template<> struct EventName<Event::Encrypt> { static constexpr const char *const name = "OnEncrypt"; };
+template<> struct EventName<Event::Decrypt> { static constexpr const char *const name = "OnDecrypt"; };
+template<> struct EventName<Event::CreateBot> { static constexpr const char *const name = "OnCreateBot"; };
+template<> struct EventName<Event::DelBot> { static constexpr const char *const name = "OnDelBot"; };
+template<> struct EventName<Event::PrePartChannel> { static constexpr const char *const name = "OnPrePartChannel"; };
+template<> struct EventName<Event::PartChannel> { static constexpr const char *const name = "OnPartChannel"; };
+template<> struct EventName<Event::LeaveChannel> { static constexpr const char *const name = "OnLeaveChannel"; };
+template<> struct EventName<Event::JoinChannel> { static constexpr const char *const name = "OnJoinChannel"; };
+template<> struct EventName<Event::TopicUpdated> { static constexpr const char *const name = "OnTopicUpdated"; };
+template<> struct EventName<Event::PreServerConnect> { static constexpr const char *const name = "OnPreServerConnect"; };
+template<> struct EventName<Event::ServerConnect> { static constexpr const char *const name = "OnServerConnect"; };
+template<> struct EventName<Event::PreUplinkSync> { static constexpr const char *const name = "OnPreUplinkSync"; };
+template<> struct EventName<Event::ServerDisconnect> { static constexpr const char *const name = "OnServerDisconnect"; };
+template<> struct EventName<Event::Restart> { static constexpr const char *const name = "OnRestart"; };
+template<> struct EventName<Event::Shutdown> { static constexpr const char *const name = "OnShutdown"; };
+template<> struct EventName<Event::AddXLine> { static constexpr const char *const name = "OnAddXLine"; };
+template<> struct EventName<Event::DelXLine> { static constexpr const char *const name = "OnDelXLine"; };
+template<> struct EventName<Event::IsServicesOperEvent> { static constexpr const char *const name = "OnIsServicesOper"; };
+template<> struct EventName<Event::ServerQuit> { static constexpr const char *const name = "OnServerQuit"; };
+template<> struct EventName<Event::UserQuit> { static constexpr const char *const name = "OnUserQuit"; };
+template<> struct EventName<Event::PreUserLogoff> { static constexpr const char *const name = "OnPreUserLogoff"; };
+template<> struct EventName<Event::PostUserLogoff> { static constexpr const char *const name = "OnPostUserLogoff"; };
+template<> struct EventName<Event::AccessDel> { static constexpr const char *const name = "OnAccessDel"; };
+template<> struct EventName<Event::AccessAdd> { static constexpr const char *const name = "OnAccessAdd"; };
+template<> struct EventName<Event::AccessClear> { static constexpr const char *const name = "OnAccessClear"; };
+template<> struct EventName<Event::ChanRegistered> { static constexpr const char *const name = "OnChanRegistered"; };
+template<> struct EventName<Event::CreateChan> { static constexpr const char *const name = "OnCreateChan"; };
+template<> struct EventName<Event::DelChan> { static constexpr const char *const name = "OnDelChan"; };
+template<> struct EventName<Event::ChannelCreate> { static constexpr const char *const name = "OnChannelCreate"; };
+template<> struct EventName<Event::ChannelDelete> { static constexpr const char *const name = "OnChannelDelete"; };
+template<> struct EventName<Event::CheckKick> { static constexpr const char *const name = "OnCheckKick"; };
+template<> struct EventName<Event::CheckPriv> { static constexpr const char *const name = "OnCheckPriv"; };
+template<> struct EventName<Event::GroupCheckPriv> { static constexpr const char *const name = "OnGroupCheckPriv"; };
+template<> struct EventName<Event::NickIdentify> { static constexpr const char *const name = "OnNickIdentify"; };
+template<> struct EventName<Event::UserLogin> { static constexpr const char *const name = "OnUserLogin"; };
+template<> struct EventName<Event::NickLogout> { static constexpr const char *const name = "OnNickLogout"; };
+template<> struct EventName<Event::DelNick> { static constexpr const char *const name = "OnDelNick"; };
+template<> struct EventName<Event::NickCoreCreate> { static constexpr const char *const name = "OnNickCoreCreate"; };
+template<> struct EventName<Event::DelCore> { static constexpr const char *const name = "OnDelCore"; };
+template<> struct EventName<Event::ChangeCoreDisplay> { static constexpr const char *const name = "OnChangeCoreDisplay"; };
+template<> struct EventName<Event::NickClearAccess> { static constexpr const char *const name = "OnNickClearAccess"; };
+template<> struct EventName<Event::NickAddAccess> { static constexpr const char *const name = "OnNickAddAccess"; };
+template<> struct EventName<Event::NickEraseAccess> { static constexpr const char *const name = "OnNickEraseAccess"; };
+template<> struct EventName<Event::CheckAuthentication> { static constexpr const char *const name = "OnCheckAuthentication"; };
+template<> struct EventName<Event::Fingerprint> { static constexpr const char *const name = "OnFingerprint"; };
+template<> struct EventName<Event::UserAway> { static constexpr const char *const name = "OnUserAway"; };
+template<> struct EventName<Event::Invite> { static constexpr const char *const name = "OnInvite"; };
+template<> struct EventName<Event::SetVhost> { static constexpr const char *const name = "OnSetVhost"; };
+template<