From 3e5a5e1c669f6027b897f7358d45f92e1552f746 Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 10 Dec 2014 01:29:18 -0500 Subject: Use a triat class for event names instead of having to manually give them places, which is much less error prone --- include/event.h | 94 +++++++++++++++- include/modules/bs_badwords.h | 1 + include/modules/bs_bot.h | 4 + include/modules/bs_info.h | 1 + include/modules/bs_kick.h | 2 + include/modules/chanserv.h | 7 +- include/modules/cs_access.h | 2 + include/modules/cs_akick.h | 2 + include/modules/cs_drop.h | 2 + include/modules/cs_info.h | 1 + include/modules/cs_mode.h | 1 + include/modules/cs_set.h | 3 +- include/modules/cs_suspend.h | 2 + include/modules/dns.h | 3 +- include/modules/fantasy.h | 3 + include/modules/help.h | 2 + include/modules/hs_del.h | 2 + include/modules/memoserv.h | 12 +- include/modules/nickserv.h | 13 ++- include/modules/ns_cert.h | 2 + include/modules/ns_drop.h | 1 + include/modules/ns_group.h | 2 + include/modules/ns_info.h | 2 + include/modules/ns_set.h | 4 +- include/modules/ns_suspend.h | 6 +- include/modules/ns_update.h | 1 + include/modules/os_defcon.h | 1 + include/modules/os_session.h | 1 + modules/bs_autoassign.cpp | 2 +- modules/commands/bs_assign.cpp | 4 +- modules/commands/bs_badwords.cpp | 2 +- modules/commands/bs_bot.cpp | 5 +- modules/commands/bs_info.cpp | 3 +- modules/commands/bs_kick.cpp | 6 +- modules/commands/bs_set.cpp | 2 +- modules/commands/cs_access.cpp | 4 +- modules/commands/cs_akick.cpp | 4 +- modules/commands/cs_drop.cpp | 2 +- modules/commands/cs_entrymsg.cpp | 2 +- modules/commands/cs_info.cpp | 2 +- modules/commands/cs_list.cpp | 2 +- modules/commands/cs_log.cpp | 4 +- modules/commands/cs_mode.cpp | 8 +- modules/commands/cs_seen.cpp | 14 +-- modules/commands/cs_set.cpp | 24 ++-- modules/commands/cs_set_misc.cpp | 2 +- modules/commands/cs_suspend.cpp | 12 +- modules/commands/cs_topic.cpp | 6 +- modules/commands/greet.cpp | 6 +- modules/commands/help.cpp | 2 +- modules/commands/hs_del.cpp | 2 +- modules/commands/hs_group.cpp | 4 +- modules/commands/ns_access.cpp | 2 +- modules/commands/ns_ajoin.cpp | 2 +- modules/commands/ns_cert.cpp | 6 +- modules/commands/ns_drop.cpp | 2 +- modules/commands/ns_group.cpp | 2 +- modules/commands/ns_info.cpp | 2 +- modules/commands/ns_list.cpp | 2 +- modules/commands/ns_recover.cpp | 4 +- modules/commands/ns_register.cpp | 4 +- modules/commands/ns_resetpass.cpp | 2 +- modules/commands/ns_set.cpp | 16 +-- modules/commands/ns_set_misc.cpp | 2 +- modules/commands/ns_suspend.cpp | 18 +-- modules/commands/ns_update.cpp | 2 +- modules/commands/os_defcon.cpp | 14 +-- modules/commands/os_dns.cpp | 10 +- modules/commands/os_forbid.cpp | 8 +- modules/commands/os_ignore.cpp | 2 +- modules/commands/os_info.cpp | 4 +- modules/commands/os_login.cpp | 2 +- modules/commands/os_news.cpp | 4 +- modules/commands/os_noop.cpp | 2 +- modules/commands/os_session.cpp | 8 +- modules/cs_statusupdate.cpp | 4 +- modules/database/db_flatfile.cpp | 4 +- modules/database/db_old.cpp | 4 +- modules/database/db_redis.cpp | 4 +- modules/database/db_sql.cpp | 2 +- modules/encryption/enc_bcrypt.cpp | 4 +- modules/encryption/enc_md5.cpp | 4 +- modules/encryption/enc_none.cpp | 6 +- modules/encryption/enc_old.cpp | 4 +- modules/encryption/enc_sha1.cpp | 4 +- modules/encryption/enc_sha256.cpp | 4 +- modules/extra/m_ldap.cpp | 2 +- modules/extra/m_ldap_oper.cpp | 4 +- modules/extra/m_mysql.cpp | 2 +- modules/extra/m_sql_authentication.cpp | 4 +- modules/extra/m_sql_log.cpp | 2 +- modules/extra/m_sql_oper.cpp | 2 +- modules/extra/m_ssl_gnutls.cpp | 2 +- modules/extra/m_ssl_openssl.cpp | 2 +- modules/fantasy.cpp | 8 +- modules/m_dns.cpp | 2 +- modules/m_dnsbl.cpp | 2 +- modules/m_helpchan.cpp | 2 +- modules/m_httpd.cpp | 2 +- modules/m_proxyscan.cpp | 2 +- modules/m_redis.cpp | 2 +- modules/ns_maxemail.cpp | 2 +- modules/protocol/bahamut.cpp | 2 +- modules/protocol/charybdis.cpp | 4 +- modules/protocol/hybrid.cpp | 2 +- modules/protocol/inspircd20.cpp | 14 +-- modules/protocol/ngircd.cpp | 2 +- modules/protocol/unreal.cpp | 10 +- modules/pseudoclients/botserv/botserv.cpp | 18 +-- modules/pseudoclients/chanserv/chanserv.cpp | 42 +++---- modules/pseudoclients/global.cpp | 8 +- modules/pseudoclients/hostserv.cpp | 10 +- modules/pseudoclients/memoserv/memoserv.cpp | 20 ++-- modules/pseudoclients/nickserv/nickserv.cpp | 48 ++++---- modules/pseudoclients/operserv.cpp | 18 +-- src/event.cpp | 168 ++++++++++++++-------------- 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 } }; +template +struct EventName; + template class EventHook; @@ -69,7 +72,7 @@ class EventHandlers : public Service friend class EventHook; public: - EventHandlers(Module *o, const Anope::string &ename) : Service(o, "EventHandlers", ename) + EventHandlers(Module *o) : Service(o, "EventHandlers", EventName::name) { } @@ -85,7 +88,7 @@ class EventHandlersReference { ServiceReference> ref; public: - EventHandlersReference(const Anope::string &name) : ref("EventHandlers", name) { } + EventHandlersReference() : ref("EventHandlers", EventName::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::name), priority(p) { handlers.Check(); } @@ -1013,3 +1016,88 @@ namespace Event extern CoreExport EventHandlers OnSerialize; } +template<> struct EventName { static constexpr const char *const name = "OnPreUserKicked"; }; +template<> struct EventName { static constexpr const char *const name = "OnUserKicked"; }; +template<> struct EventName { static constexpr const char *const name = "OnPreBotAssign"; }; +template<> struct EventName { static constexpr const char *const name = "OnBotAssign"; }; +template<> struct EventName { static constexpr const char *const name = "OnBotUnAssign"; }; +template<> struct EventName { static constexpr const char *const name = "OnUserConnect"; }; +template<> struct EventName { static constexpr const char *const name = "OnNewServer"; }; +template<> struct EventName { static constexpr const char *const name = "OnUserNickChange"; }; +template<> struct EventName { static constexpr const char *const name = "OnPreCommand"; }; +template<> struct EventName { static constexpr const char *const name = "OnPostCommand"; }; +template<> struct EventName { static constexpr const char *const name = "OnSaveDatabase"; }; +template<> struct EventName { static constexpr const char *const name = "OnLoadDatabase"; }; +template<> struct EventName { static constexpr const char *const name = "OnEncrypt"; }; +template<> struct EventName { static constexpr const char *const name = "OnDecrypt"; }; +template<> struct EventName { static constexpr const char *const name = "OnCreateBot"; }; +template<> struct EventName { static constexpr const char *const name = "OnDelBot"; }; +template<> struct EventName { static constexpr const char *const name = "OnPrePartChannel"; }; +template<> struct EventName { static constexpr const char *const name = "OnPartChannel"; }; +template<> struct EventName { static constexpr const char *const name = "OnLeaveChannel"; }; +template<> struct EventName { static constexpr const char *const name = "OnJoinChannel"; }; +template<> struct EventName { static constexpr const char *const name = "OnTopicUpdated"; }; +template<> struct EventName { static constexpr const char *const name = "OnPreServerConnect"; }; +template<> struct EventName { static constexpr const char *const name = "OnServerConnect"; }; +template<> struct EventName { static constexpr const char *const name = "OnPreUplinkSync"; }; +template<> struct EventName { static constexpr const char *const name = "OnServerDisconnect"; }; +template<> struct EventName { static constexpr const char *const name = "OnRestart"; }; +template<> struct EventName { static constexpr const char *const name = "OnShutdown"; }; +template<> struct EventName { static constexpr const char *const name = "OnAddXLine"; }; +template<> struct EventName { static constexpr const char *const name = "OnDelXLine"; }; +template<> struct EventName { static constexpr const char *const name = "OnIsServicesOper"; }; +template<> struct EventName { static constexpr const char *const name = "OnServerQuit"; }; +template<> struct EventName { static constexpr const char *const name = "OnUserQuit"; }; +template<> struct EventName { static constexpr const char *const name = "OnPreUserLogoff"; }; +template<> struct EventName { static constexpr const char *const name = "OnPostUserLogoff"; }; +template<> struct EventName { static constexpr const char *const name = "OnAccessDel"; }; +template<> struct EventName { static constexpr const char *const name = "OnAccessAdd"; }; +template<> struct EventName { static constexpr const char *const name = "OnAccessClear"; }; +template<> struct EventName { static constexpr const char *const name = "OnChanRegistered"; }; +template<> struct EventName { static constexpr const char *const name = "OnCreateChan"; }; +template<> struct EventName { static constexpr const char *const name = "OnDelChan"; }; +template<> struct EventName { static constexpr const char *const name = "OnChannelCreate"; }; +template<> struct EventName { static constexpr const char *const name = "OnChannelDelete"; }; +template<> struct EventName { static constexpr const char *const name = "OnCheckKick"; }; +template<> struct EventName { static constexpr const char *const name = "OnCheckPriv"; }; +template<> struct EventName { static constexpr const char *const name = "OnGroupCheckPriv"; }; +template<> struct EventName { static constexpr const char *const name = "OnNickIdentify"; }; +template<> struct EventName { static constexpr const char *const name = "OnUserLogin"; }; +template<> struct EventName { static constexpr const char *const name = "OnNickLogout"; }; +template<> struct EventName { static constexpr const char *const name = "OnDelNick"; }; +template<> struct EventName { static constexpr const char *const name = "OnNickCoreCreate"; }; +template<> struct EventName { static constexpr const char *const name = "OnDelCore"; }; +template<> struct EventName { static constexpr const char *const name = "OnChangeCoreDisplay"; }; +template<> struct EventName { static constexpr const char *const name = "OnNickClearAccess"; }; +template<> struct EventName { static constexpr const char *const name = "OnNickAddAccess"; }; +template<> struct EventName { static constexpr const char *const name = "OnNickEraseAccess"; }; +template<> struct EventName { static constexpr const char *const name = "OnCheckAuthentication"; }; +template<> struct EventName { static constexpr const char *const name = "OnFingerprint"; }; +template<> struct EventName { static constexpr const char *const name = "OnUserAway"; }; +template<> struct EventName { static constexpr const char *const name = "OnInvite"; }; +template<> struct EventName { static constexpr const char *const name = "OnSetVhost"; }; +template<> struct EventName { static constexpr const char *const name = "OnSetDisplayedHost"; }; +template<> struct EventName { static constexpr const char *const name = "OnChannelModeSet"; }; +template<> struct EventName { static constexpr const char *const name = "OnChannelModeUnset"; }; +template<> struct EventName { static constexpr const char *const name = "OnUserModeSet"; }; +template<> struct EventName { static constexpr const char *const name = "OnUserModeUnset"; }; +template<> struct EventName { static constexpr const char *const name = "OnChannelModeAdd"; }; +template<> struct EventName { static constexpr const char *const name = "OnUserModeAdd"; }; +template<> struct EventName { static constexpr const char *const name = "OnModuleLoad"; }; +template<> struct EventName { static constexpr const char *const name = "OnModuleUnload"; }; +template<> struct EventName { static constexpr const char *const name = "OnServerSync"; }; +template<> struct EventName { static constexpr const char *const name = "OnUplinkSync"; }; +template<> struct EventName { static constexpr const char *const name = "OnBotPrivmsg"; }; +template<> struct EventName { static constexpr const char *const name = "OnBotNotice"; }; +template<> struct EventName { static constexpr const char *const name = "OnPrivmsg"; }; +template<> struct EventName { static constexpr const char *const name = "OnLog"; }; +template<> struct EventName { static constexpr const char *const name = "OnLogMessage"; }; +template<> struct EventName { static constexpr const char *const name = "OnCheckModes"; }; +template<> struct EventName { static constexpr const char *const name = "OnChannelSync"; }; +template<> struct EventName { static constexpr const char *const name = "OnSetCorrectModes"; }; +template<> struct EventName { static constexpr const char *const name = "OnMessage"; }; +template<> struct EventName { static constexpr const char *const name = "OnCanSet"; }; +template<> struct EventName { static constexpr const char *const name = "OnCheckDelete"; }; +template<> struct EventName { static constexpr const char *const name = "OnExpireTick"; }; +template<> struct EventName { static constexpr const char *const name = "OnSerialize"; }; + diff --git a/include/modules/bs_badwords.h b/include/modules/bs_badwords.h index df42af6ec..87986ee62 100644 --- a/include/modules/bs_badwords.h +++ b/include/modules/bs_badwords.h @@ -99,3 +99,4 @@ namespace Event }; } +template<> struct EventName { static constexpr const char *const name = "Badwords"; }; diff --git a/include/modules/bs_bot.h b/include/modules/bs_bot.h index f66d57031..fe6534309 100644 --- a/include/modules/bs_bot.h +++ b/include/modules/bs_bot.h @@ -32,3 +32,7 @@ namespace Event virtual void OnBotDelete(ServiceBot *bi) anope_abstract; }; } + +template<> struct EventName { static constexpr const char *const name = "OnBotCreate"; }; +template<> struct EventName { static constexpr const char *const name = "OnBotChange"; }; +template<> struct EventName { static constexpr const char *const name = "OnBotDelete"; }; diff --git a/include/modules/bs_info.h b/include/modules/bs_info.h index 606888f4c..1ebd58c89 100644 --- a/include/modules/bs_info.h +++ b/include/modules/bs_info.h @@ -18,3 +18,4 @@ namespace Event extern CoreExport EventHandlers OnServiceBot; } +template<> struct EventName { static constexpr const char *const name = "OnServiceBot"; }; diff --git a/include/modules/bs_kick.h b/include/modules/bs_kick.h index 4fe234dd0..1346d7427 100644 --- a/include/modules/bs_kick.h +++ b/include/modules/bs_kick.h @@ -128,3 +128,5 @@ namespace Event }; } +template<> struct EventName { static constexpr const char *const name = "OnBotBan"; }; + diff --git a/include/modules/chanserv.h b/include/modules/chanserv.h index 9985f25dc..a6f741c1b 100644 --- a/include/modules/chanserv.h +++ b/include/modules/chanserv.h @@ -164,7 +164,7 @@ namespace ChanServ */ virtual void OnPreChanExpire(Channel *ci, bool &expire) anope_abstract; }; - static EventHandlersReference OnPreChanExpire("OnPreChanExpire"); + static EventHandlersReference OnPreChanExpire; struct CoreExport ChanExpire : Events { @@ -173,7 +173,7 @@ namespace ChanServ */ virtual void OnChanExpire(Channel *ci) anope_abstract; }; - static EventHandlersReference OnChanExpire("OnChanExpire"); + static EventHandlersReference OnChanExpire; } /* It matters that Base is here before Extensible (it is inherited by Serializable) @@ -734,3 +734,6 @@ namespace ChanServ } }; } + +template<> struct EventName { static constexpr const char *const name = "OnPreChanExpire"; }; +template<> struct EventName { static constexpr const char *const name = "OnChanExpire"; }; diff --git a/include/modules/cs_access.h b/include/modules/cs_access.h index b56996ede..54eb3f353 100644 --- a/include/modules/cs_access.h +++ b/include/modules/cs_access.h @@ -24,3 +24,5 @@ namespace Event virtual void OnLevelChange(CommandSource &source, ChanServ::Channel *ci, const Anope::string &priv, int16_t what) anope_abstract; }; } + +template<> struct EventName { static constexpr const char *const name = "OnLevelChange"; }; diff --git a/include/modules/cs_akick.h b/include/modules/cs_akick.h index a5c050e51..966dac15b 100644 --- a/include/modules/cs_akick.h +++ b/include/modules/cs_akick.h @@ -60,3 +60,5 @@ namespace Event virtual void OnAkickDel(CommandSource &source, ChanServ::Channel *ci, const AutoKick *ak) anope_abstract; }; } + +template<> struct EventName { static constexpr const char *const name = "Akick"; }; diff --git a/include/modules/cs_drop.h b/include/modules/cs_drop.h index 49247b3cb..db231059b 100644 --- a/include/modules/cs_drop.h +++ b/include/modules/cs_drop.h @@ -18,3 +18,5 @@ namespace Event virtual EventReturn OnChanDrop(CommandSource &source, ChanServ::Channel *ci) anope_abstract; }; } + +template<> struct EventName { static constexpr const char *const name = "OnChanDrop"; }; diff --git a/include/modules/cs_info.h b/include/modules/cs_info.h index 7b19abd19..f80e3daf2 100644 --- a/include/modules/cs_info.h +++ b/include/modules/cs_info.h @@ -21,3 +21,4 @@ namespace Event }; } +template<> struct EventName { static constexpr const char *const name = "OnChanInfo"; }; diff --git a/include/modules/cs_mode.h b/include/modules/cs_mode.h index a27197533..4d5f9dd2f 100644 --- a/include/modules/cs_mode.h +++ b/include/modules/cs_mode.h @@ -120,3 +120,4 @@ namespace Event }; } +template<> struct EventName { static constexpr const char *const name = "MLock"; }; diff --git a/include/modules/cs_set.h b/include/modules/cs_set.h index 355459f7c..a0e81c888 100644 --- a/include/modules/cs_set.h +++ b/include/modules/cs_set.h @@ -20,6 +20,7 @@ namespace Event */ virtual EventReturn OnSetChannelOption(CommandSource &source, Command *cmd, ChanServ::Channel *ci, const Anope::string &setting) anope_abstract; }; - static EventHandlersReference OnSetChannelOption("OnSetChannelOption"); + static EventHandlersReference OnSetChannelOption; } +template<> struct EventName { static constexpr const char *const name = "OnSetChannelOption"; }; diff --git a/include/modules/cs_suspend.h b/include/modules/cs_suspend.h index 6c561b637..27187ea09 100644 --- a/include/modules/cs_suspend.h +++ b/include/modules/cs_suspend.h @@ -49,3 +49,5 @@ namespace Event extern CoreExport EventHandlers OnChanUnsuspend; } +template<> struct EventName { static constexpr const char *const name = "OnChanSuspend"; }; +template<> struct EventName { static constexpr const char *const name = "OnChanUnsuspend"; }; diff --git a/include/modules/dns.h b/include/modules/dns.h index 7a0a587fa..f1ee94f87 100644 --- a/include/modules/dns.h +++ b/include/modules/dns.h @@ -188,9 +188,10 @@ namespace Event */ virtual void OnDnsRequest(DNS::Query &req, DNS::Query *reply) anope_abstract; }; - static EventHandlersReference OnDnsRequest("OnDnsRequest"); + static EventHandlersReference OnDnsRequest; } +template<> struct EventName { static constexpr const char *const name = "OnDnsRequest"; }; #endif // DNS_H diff --git a/include/modules/fantasy.h b/include/modules/fantasy.h index bb13b959d..1bdd8afdc 100644 --- a/include/modules/fantasy.h +++ b/include/modules/fantasy.h @@ -33,3 +33,6 @@ namespace Event virtual EventReturn OnBotNoFantasyAccess(CommandSource &source, Command *c, ChanServ::Channel *ci, const std::vector ¶ms) anope_abstract; }; } + +template<> struct EventName { static constexpr const char *const name = "OnBotFantasy"; }; +template<> struct EventName { static constexpr const char *const name = "OnBotNoFantasyAccess"; }; diff --git a/include/modules/help.h b/include/modules/help.h index 333e5f9c8..df81aecbf 100644 --- a/include/modules/help.h +++ b/include/modules/help.h @@ -25,3 +25,5 @@ namespace Event virtual void OnPostHelp(CommandSource &source, const std::vector ¶ms) anope_abstract; }; } + +template<> struct EventName { static constexpr const char *const name = "Help"; }; diff --git a/include/modules/hs_del.h b/include/modules/hs_del.h index fdec23b21..9b2ea39ef 100644 --- a/include/modules/hs_del.h +++ b/include/modules/hs_del.h @@ -16,3 +16,5 @@ namespace Event virtual void OnDeleteVhost(NickServ::Nick *na) anope_abstract; }; } + +template<> struct EventName { static constexpr const char *const name = "OnDeleteVhost"; }; diff --git a/include/modules/memoserv.h b/include/modules/memoserv.h index 9a209e27f..b7d49ad3a 100644 --- a/include/modules/memoserv.h +++ b/include/modules/memoserv.h @@ -61,7 +61,7 @@ namespace MemoServ */ virtual void OnMemoSend(const Anope::string &source, const Anope::string &target, MemoInfo *mi, Memo *m) anope_abstract; }; - static EventHandlersReference OnMemoSend("OnMemoSend"); + static EventHandlersReference OnMemoSend; struct CoreExport MemoDel : Events { @@ -72,14 +72,14 @@ namespace MemoServ */ virtual void OnMemoDel(const Anope::string &target, MemoInfo *mi, const Memo *m) anope_abstract; }; - static EventHandlersReference OnMemoDel("OnMemoDel"); + static EventHandlersReference OnMemoDel; } class Memo : public Serialize::Object { protected: using Serialize::Object::Object; -// Memo() : Serialize::Object("Memo") { } + public: virtual MemoInfo *GetMemoInfo() anope_abstract; virtual void SetMemoInfo(MemoInfo *) anope_abstract; @@ -109,8 +109,7 @@ namespace MemoServ { protected: using Serialize::Object::Object; - //using MemoInfo::MemoInfo; - //MemoInfo() : Serialize::Object("MemoInfo") { } + public: virtual Memo *GetMemo(unsigned index) anope_abstract; @@ -148,3 +147,6 @@ namespace MemoServ static Serialize::TypeReference ignore("MemoIgnore"); } + +template<> struct EventName { static constexpr const char *const name = "OnMemoSend"; }; +template<> struct EventName { static constexpr const char *const name = "OnMemoDel"; }; diff --git a/include/modules/nickserv.h b/include/modules/nickserv.h index 84ff39520..a6921cf2e 100644 --- a/include/modules/nickserv.h +++ b/include/modules/nickserv.h @@ -67,7 +67,7 @@ namespace NickServ */ virtual void OnPreNickExpire(Nick *na, bool &expire) anope_abstract; }; - static EventHandlersReference OnPreNickExpire("OnPreNickExpire"); + static EventHandlersReference OnPreNickExpire; struct CoreExport NickExpire : Events { @@ -76,7 +76,7 @@ namespace NickServ */ virtual void OnNickExpire(Nick *na) anope_abstract; }; - static EventHandlersReference OnNickExpire("OnNickExpire"); + static EventHandlersReference OnNickExpire; struct CoreExport NickRegister : Events { @@ -87,7 +87,7 @@ namespace NickServ */ virtual void OnNickRegister(User *user, Nick *na, const Anope::string &password) anope_abstract; }; - static EventHandlersReference OnNickRegister("OnNickRegister"); + static EventHandlersReference OnNickRegister; struct CoreExport NickValidate : Events { @@ -99,7 +99,7 @@ namespace NickServ */ virtual EventReturn OnNickValidate(User *u, Nick *na) anope_abstract; }; - static EventHandlersReference OnNickValidate("OnNickValidate"); + static EventHandlersReference OnNickValidate; } /* A registered nickname. @@ -293,3 +293,8 @@ namespace NickServ static Serialize::TypeReference mode("NSKeepMode"); } + +template<> struct EventName { static constexpr const char *const name = "OnPreNickExpire"; }; +template<> struct EventName { static constexpr const char *const name = "OnNickExpire"; }; +template<> struct EventName { static constexpr const char *const name = "OnNickRegister"; }; +template<> struct EventName { static constexpr const char *const name = "OnNickValidate"; }; diff --git a/include/modules/ns_cert.h b/include/modules/ns_cert.h index 994f0378e..be75fb9bf 100644 --- a/include/modules/ns_cert.h +++ b/include/modules/ns_cert.h @@ -62,3 +62,5 @@ namespace Event }; } + +template<> struct EventName { static constexpr const char *const name = "OnNickCert"; }; diff --git a/include/modules/ns_drop.h b/include/modules/ns_drop.h index 9217a924c..bae9d77b6 100644 --- a/include/modules/ns_drop.h +++ b/include/modules/ns_drop.h @@ -19,3 +19,4 @@ namespace Event extern CoreExport EventHandlers OnNickDrop; } +template<> struct EventName { static constexpr const char *const name = "OnNickDrop"; }; diff --git a/include/modules/ns_group.h b/include/modules/ns_group.h index a254c4412..caa568a9e 100644 --- a/include/modules/ns_group.h +++ b/include/modules/ns_group.h @@ -18,3 +18,5 @@ namespace Event virtual void OnNickGroup(User *u, NickServ::Nick *target) anope_abstract; }; } + +template<> struct EventName { static constexpr const char *const name = "OnNickGroup"; }; diff --git a/include/modules/ns_info.h b/include/modules/ns_info.h index dd593ce59..e816cc356 100644 --- a/include/modules/ns_info.h +++ b/include/modules/ns_info.h @@ -20,3 +20,5 @@ namespace Event virtual void OnNickInfo(CommandSource &source, NickServ::Nick *na, InfoFormatter &info, bool show_hidden) anope_abstract; }; } + +template<> struct EventName { static constexpr const char *const name = "OnNickInfo"; }; diff --git a/include/modules/ns_set.h b/include/modules/ns_set.h index b958b4cf5..c6b86032b 100644 --- a/include/modules/ns_set.h +++ b/include/modules/ns_set.h @@ -20,5 +20,7 @@ namespace Event */ virtual EventReturn OnSetNickOption(CommandSource &source, Command *cmd, NickServ::Account *nc, const Anope::string &setting) anope_abstract; }; - static EventHandlersReference OnSetNickOption("OnSetNickOption"); + static EventHandlersReference OnSetNickOption; } + +template<> struct EventName { static constexpr const char *const name = "OnSetNickOption"; }; diff --git a/include/modules/ns_suspend.h b/include/modules/ns_suspend.h index b985cb218..fcfc0265d 100644 --- a/include/modules/ns_suspend.h +++ b/include/modules/ns_suspend.h @@ -40,12 +40,14 @@ namespace Event virtual void OnNickSuspend(NickServ::Nick *na) anope_abstract; }; - struct CoreExport NickUnsuspended : Events + struct CoreExport NickUnsuspend : Events { /** Called when a nick is unsuspneded * @param na The nick alias */ - virtual void OnNickUnsuspended(NickServ::Nick *na) anope_abstract; + virtual void OnNickUnsuspend(NickServ::Nick *na) anope_abstract; }; } +template<> struct EventName { static constexpr const char *const name = "OnNickSuspend"; }; +template<> struct EventName { static constexpr const char *const name = "OnNickUnsuspend"; }; diff --git a/include/modules/ns_update.h b/include/modules/ns_update.h index d5d01320a..ce75c33ac 100644 --- a/include/modules/ns_update.h +++ b/include/modules/ns_update.h @@ -18,3 +18,4 @@ namespace Event }; } +template<> struct EventName { static constexpr const char *const name = "OnNickUpdate"; }; diff --git a/include/modules/os_defcon.h b/include/modules/os_defcon.h index 81b220eb3..f980d5008 100644 --- a/include/modules/os_defcon.h +++ b/include/modules/os_defcon.h @@ -18,3 +18,4 @@ namespace Event }; } +template<> struct EventName { static constexpr const char *const name = "OnDefconLevel"; }; diff --git a/include/modules/os_session.h b/include/modules/os_session.h index c6af4fb03..b9afd196e 100644 --- a/include/modules/os_session.h +++ b/include/modules/os_session.h @@ -74,3 +74,4 @@ namespace Event }; } +template<> struct EventName { static constexpr const char *const name = "Exception"; }; diff --git a/modules/bs_autoassign.cpp b/modules/bs_autoassign.cpp index 81559ea86..2e26319b6 100644 --- a/modules/bs_autoassign.cpp +++ b/modules/bs_autoassign.cpp @@ -14,7 +14,7 @@ class BSAutoAssign : public Module { public: BSAutoAssign(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , EventHook("OnChanRegistered") + , EventHook() { } diff --git a/modules/commands/bs_assign.cpp b/modules/commands/bs_assign.cpp index 90f6f80cf..350aa9c00 100644 --- a/modules/commands/bs_assign.cpp +++ b/modules/commands/bs_assign.cpp @@ -227,8 +227,8 @@ class BSAssign : public Module public: BSAssign(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , EventHook("OnInvite") - , EventHook("OnServiceBotEvent") + , EventHook() + , EventHook() , nobot(this, botinfo, "BS_NOBOT") diff --git a/modules/commands/bs_badwords.cpp b/modules/commands/bs_badwords.cpp index 744f625e1..22488a1c0 100644 --- a/modules/commands/bs_badwords.cpp +++ b/modules/commands/bs_badwords.cpp @@ -455,7 +455,7 @@ class BSBadwords : public Module BSBadwords(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) , commandbsbadwords(this) , badwords(this) - , events(this, "Badwords") + , events(this) , bwtype(this) { bwevents = &events; diff --git a/modules/commands/bs_bot.cpp b/modules/commands/bs_bot.cpp index 2e9d5980c..c67c5d168 100644 --- a/modules/commands/bs_bot.cpp +++ b/modules/commands/bs_bot.cpp @@ -275,7 +275,10 @@ class CommandBSBot : public Command } public: - CommandBSBot(Module *creator) : Command(creator, "botserv/bot", 1, 6), OnBotCreate(creator, "OnBotCreate"), OnBotChange(creator, "OnBotChange"), OnBotDelete(creator, "OnBotDelete") + CommandBSBot(Module *creator) : Command(creator, "botserv/bot", 1, 6) + , OnBotCreate(creator) + , OnBotChange(creator) + , OnBotDelete(creator) { this->SetDesc(_("Maintains network bot list")); this->SetSyntax(_("\002ADD \037nicknae\037 \037username\037 \037hostname\037 \037realname\037\002")); diff --git a/modules/commands/bs_info.cpp b/modules/commands/bs_info.cpp index 7b100bc41..6d74c308e 100644 --- a/modules/commands/bs_info.cpp +++ b/modules/commands/bs_info.cpp @@ -106,7 +106,8 @@ class BSInfo : public Module public: BSInfo(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , commandbsinfo(this, onbotinfo), onbotinfo(this, "OnServiceBot") + , commandbsinfo(this, onbotinfo) + , onbotinfo(this) { } diff --git a/modules/commands/bs_kick.cpp b/modules/commands/bs_kick.cpp index b29a5dc31..e7b4738cd 100644 --- a/modules/commands/bs_kick.cpp +++ b/modules/commands/bs_kick.cpp @@ -1279,8 +1279,8 @@ class BSKick : public Module public: BSKick(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , EventHook("OnServiceBotEvent") - , EventHook("OnPrivmsg") + , EventHook() + , EventHook() , bandata(this, "bandata") , userdata(this, "userdata") @@ -1303,7 +1303,7 @@ class BSKick : public Module , purger(this) - , onbotban(this, "OnBotBan") + , onbotban(this) { me = this; } diff --git a/modules/commands/bs_set.cpp b/modules/commands/bs_set.cpp index 8a95edcaf..58015ba01 100644 --- a/modules/commands/bs_set.cpp +++ b/modules/commands/bs_set.cpp @@ -194,7 +194,7 @@ class BSSet : public Module public: BSSet(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , EventHook("OnBotBan") + , EventHook() , commandbsset(this) , commandbssetbanexpire(this) , commandbssetprivate(this) diff --git a/modules/commands/cs_access.cpp b/modules/commands/cs_access.cpp index e1431e977..7e9c47993 100644 --- a/modules/commands/cs_access.cpp +++ b/modules/commands/cs_access.cpp @@ -891,10 +891,10 @@ class CSAccess : public Module public: CSAccess(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , EventHook("OnGroupCheckPriv") + , EventHook() , commandcsaccess(this) , commandcslevels(this, onlevelchange) - , onlevelchange(this, "OnLevelChange") + , onlevelchange(this) , accesschanaccesstype(this) { this->SetPermanent(true); diff --git a/modules/commands/cs_akick.cpp b/modules/commands/cs_akick.cpp index 4174c9b20..f88904a46 100644 --- a/modules/commands/cs_akick.cpp +++ b/modules/commands/cs_akick.cpp @@ -668,9 +668,9 @@ class CSAKick : public Module public: CSAKick(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , EventHook("OnCheckKick") + , EventHook() , commandcsakick(this, akickevents) - , akickevents(this, "Akick") + , akickevents(this) , akick_type(this) { } diff --git a/modules/commands/cs_drop.cpp b/modules/commands/cs_drop.cpp index 6ac3df61c..a1020bcab 100644 --- a/modules/commands/cs_drop.cpp +++ b/modules/commands/cs_drop.cpp @@ -92,7 +92,7 @@ class CSDrop : public Module public: CSDrop(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) , commandcsdrop(this, onchandrop) - , onchandrop(this, "OnChanDrop") + , onchandrop(this) { } diff --git a/modules/commands/cs_entrymsg.cpp b/modules/commands/cs_entrymsg.cpp index 6695a7cec..51654ea84 100644 --- a/modules/commands/cs_entrymsg.cpp +++ b/modules/commands/cs_entrymsg.cpp @@ -254,7 +254,7 @@ class CSEntryMessage : public Module public: CSEntryMessage(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , EventHook("OnJoinChannel") + , EventHook() , commandentrymsg(this) , entrymsg_type(this) { diff --git a/modules/commands/cs_info.cpp b/modules/commands/cs_info.cpp index 7f08e7e91..43405a18d 100644 --- a/modules/commands/cs_info.cpp +++ b/modules/commands/cs_info.cpp @@ -88,7 +88,7 @@ class CSInfo : public Module public: CSInfo(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) , commandcsinfo(this, eventonchaninfo) - , eventonchaninfo(this, "OnChanInfo") + , eventonchaninfo(this) { } diff --git a/modules/commands/cs_list.cpp b/modules/commands/cs_list.cpp index 9e7e6a31b..44c96d0ce 100644 --- a/modules/commands/cs_list.cpp +++ b/modules/commands/cs_list.cpp @@ -244,7 +244,7 @@ class CSList : public Module public: CSList(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , EventHook("OnChanInfo") + , EventHook() , commandcslist(this) , commandcssetprivate(this) , priv(this, "CS_PRIVATE") diff --git a/modules/commands/cs_log.cpp b/modules/commands/cs_log.cpp index 695493b78..6c7ca03d1 100644 --- a/modules/commands/cs_log.cpp +++ b/modules/commands/cs_log.cpp @@ -345,8 +345,8 @@ class CSLog : public Module public: CSLog(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , EventHook("OnChanRegistered") - , EventHook("OnLog") + , EventHook() + , EventHook() , commandcslog(this) , logtype(this) { diff --git a/modules/commands/cs_mode.cpp b/modules/commands/cs_mode.cpp index f66c5ce87..d26e113d6 100644 --- a/modules/commands/cs_mode.cpp +++ b/modules/commands/cs_mode.cpp @@ -861,14 +861,14 @@ class CSMode : public Module public: CSMode(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , EventHook("OnCheckModes") - , EventHook("OnChanRegistered") - , EventHook("OnChanInfo") + , EventHook() + , EventHook() + , EventHook() , commandcsmode(this) , commandcsmodes(this) , modelock(this) , modelock_type(this) - , modelockevents(this, "MLock") + , modelockevents(this) { events = &modelockevents; } diff --git a/modules/commands/cs_seen.cpp b/modules/commands/cs_seen.cpp index c730609be..0474b8e26 100644 --- a/modules/commands/cs_seen.cpp +++ b/modules/commands/cs_seen.cpp @@ -378,13 +378,13 @@ class CSSeen : public Module public: CSSeen(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , EventHook("OnExpireTick") - , EventHook("OnUserConnect") - , EventHook("OnUserNickChange") - , EventHook("OnUserQuit") - , EventHook("OnJoinChannel") - , EventHook("OnPartChannel") - , EventHook("OnPreUserKicked") + , EventHook() + , EventHook() + , EventHook() + , EventHook() + , EventHook() + , EventHook() + , EventHook() // , seeninfo_type("SeenInfo", SeenInfo::Unserialize) , commandseen(this) , commandosseen(this) diff --git a/modules/commands/cs_set.cpp b/modules/commands/cs_set.cpp index 2a811b5b2..9cf58c029 100644 --- a/modules/commands/cs_set.cpp +++ b/modules/commands/cs_set.cpp @@ -1101,18 +1101,18 @@ class CSSet : public Module public: CSSet(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , EventHook("OnCreateChan") - , EventHook("OnChannelCreate") - , EventHook("OnChannelSync") - , EventHook("OnCheckKick") - , EventHook("OnDelChan") - , EventHook("OnChannelModeSet") - , EventHook("OnChannelModeUnset") - , EventHook("OnCheckDelete") - , EventHook("OnJoinChannel") - , EventHook("OnSetCorrectModes") - , EventHook("OnPreChanExpire") - , EventHook("OnChanInfo") + , EventHook() + , EventHook() + , EventHook() + , EventHook() + , EventHook() + , EventHook() + , EventHook() + , EventHook() + , EventHook() + , EventHook() + , EventHook() + , EventHook() , noautoop(this, ChanServ::channel, "NOAUTOOP") , peace(this, ChanServ::channel, "PEACE") diff --git a/modules/commands/cs_set_misc.cpp b/modules/commands/cs_set_misc.cpp index 35b943f6c..48716b194 100644 --- a/modules/commands/cs_set_misc.cpp +++ b/modules/commands/cs_set_misc.cpp @@ -175,7 +175,7 @@ class CSSetMisc : public Module public: CSSetMisc(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , EventHook("OnChanInfo") + , EventHook() , commandcssetmisc(this) , type(this) { diff --git a/modules/commands/cs_suspend.cpp b/modules/commands/cs_suspend.cpp index dadb7c15d..6fd234014 100644 --- a/modules/commands/cs_suspend.cpp +++ b/modules/commands/cs_suspend.cpp @@ -268,14 +268,14 @@ class CSSuspend : public Module public: CSSuspend(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , EventHook("OnChanInfo") - , EventHook("OnPreChanExpire") - , EventHook("OnCheckKick") - , EventHook("OnChanDrop") + , EventHook() + , EventHook() + , EventHook() + , EventHook() , commandcssuspend(this, onchansuspend) , commandcsunsuspend(this, onchanunsuspend) - , onchansuspend(this, "OnChanSuspend") - , onchanunsuspend(this, "OnChanUnsuspend") + , onchansuspend(this) + , onchanunsuspend(this) , cst(this) { } diff --git a/modules/commands/cs_topic.cpp b/modules/commands/cs_topic.cpp index 213876749..5fd40bdf0 100644 --- a/modules/commands/cs_topic.cpp +++ b/modules/commands/cs_topic.cpp @@ -211,9 +211,9 @@ class CSTopic : public Module public: CSTopic(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , EventHook("OnChannelSync") - , EventHook("OnTopicUpdated") - , EventHook("OnChanInfo") + , EventHook() + , EventHook() + , EventHook() , commandcstopic(this) , commandcssetkeeptopic(this) , topiclock(this, "TOPICLOCK") diff --git a/modules/commands/greet.cpp b/modules/commands/greet.cpp index a66b28e11..9134876cc 100644 --- a/modules/commands/greet.cpp +++ b/modules/commands/greet.cpp @@ -170,9 +170,9 @@ class Greet : public Module public: Greet(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , EventHook("OnJoinChannel") - , EventHook("OnNickInfo") - , EventHook("OnServiceBotEvent") + , EventHook() + , EventHook() + , EventHook() , bs_greet(this, ChanServ::channel, "BS_GREET") , ns_greet(this, NickServ::account, "greet") , commandbssetgreet(this) diff --git a/modules/commands/help.cpp b/modules/commands/help.cpp index 419474574..debb25837 100644 --- a/modules/commands/help.cpp +++ b/modules/commands/help.cpp @@ -188,7 +188,7 @@ class Help : public Module public: Help(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) , commandhelp(this, onhelp) - , onhelp(this, "Help") + , onhelp(this) { } diff --git a/modules/commands/hs_del.cpp b/modules/commands/hs_del.cpp index 8c9c20c1c..4d7e7aac9 100644 --- a/modules/commands/hs_del.cpp +++ b/modules/commands/hs_del.cpp @@ -99,7 +99,7 @@ class HSDel : public Module HSDel(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) , commandhsdel(this, ondeletevhost) , commandhsdelall(this, ondeletevhost) - , ondeletevhost(this, "OnDeleteVhost") + , ondeletevhost(this) { } diff --git a/modules/commands/hs_group.cpp b/modules/commands/hs_group.cpp index dc66d4477..5635b8ce6 100644 --- a/modules/commands/hs_group.cpp +++ b/modules/commands/hs_group.cpp @@ -84,8 +84,8 @@ class HSGroup : public Module public: HSGroup(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , EventHook("OnSetVhost") - , EventHook("OnNickGroup") + , EventHook() + , EventHook() , commandhsgroup(this) { } diff --git a/modules/commands/ns_access.cpp b/modules/commands/ns_access.cpp index d944c8736..7b727452a 100644 --- a/modules/commands/ns_access.cpp +++ b/modules/commands/ns_access.cpp @@ -236,7 +236,7 @@ class NSAccess : public Module public: NSAccess(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , EventHook("OnNickRegister") + , EventHook() , commandnsaccess(this) , nick_type(this) { diff --git a/modules/commands/ns_ajoin.cpp b/modules/commands/ns_ajoin.cpp index 93fb136b9..7aca41b3e 100644 --- a/modules/commands/ns_ajoin.cpp +++ b/modules/commands/ns_ajoin.cpp @@ -282,7 +282,7 @@ class NSAJoin : public Module public: NSAJoin(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , EventHook("OnUserLogin") + , EventHook() , commandnsajoin(this) , ajtype(this) { diff --git a/modules/commands/ns_cert.cpp b/modules/commands/ns_cert.cpp index c743c619a..a241f9c97 100644 --- a/modules/commands/ns_cert.cpp +++ b/modules/commands/ns_cert.cpp @@ -313,11 +313,11 @@ class NSCert : public Module public: NSCert(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , EventHook("OnFingerprint") - , EventHook("OnNickValidate") + , EventHook() + , EventHook() , commandnscert(this) , cs(this) - , onnickservevents(this, "OnNickCert") + , onnickservevents(this) { if (!IRCD || !IRCD->CanCertFP) throw ModuleException("Your IRCd does not support ssl client certificates"); diff --git a/modules/commands/ns_drop.cpp b/modules/commands/ns_drop.cpp index f778cac00..62ee41970 100644 --- a/modules/commands/ns_drop.cpp +++ b/modules/commands/ns_drop.cpp @@ -82,7 +82,7 @@ class NSDrop : public Module public: NSDrop(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) , commandnsdrop(this, onnickdrop) - , onnickdrop(this, "OnNickDrop") + , onnickdrop(this) { } diff --git a/modules/commands/ns_group.cpp b/modules/commands/ns_group.cpp index 0af17d29a..e3acf74f9 100644 --- a/modules/commands/ns_group.cpp +++ b/modules/commands/ns_group.cpp @@ -375,7 +375,7 @@ class NSGroup : public Module , commandnsgroup(this, onnickgroup) , commandnsungroup(this) , commandnsglist(this) - , onnickgroup(this, "OnNickGroup") + , onnickgroup(this) { if (Config->GetModule("nickserv")->Get("nonicknameownership")) throw ModuleException(modname + " can not be used with options:nonicknameownership enabled"); diff --git a/modules/commands/ns_info.cpp b/modules/commands/ns_info.cpp index 63adea013..7091e53fd 100644 --- a/modules/commands/ns_info.cpp +++ b/modules/commands/ns_info.cpp @@ -268,7 +268,7 @@ class NSInfo : public Module , commandnsinfo(this, onnickinfo) , commandnssethide(this) , commandnssasethide(this) - , onnickinfo(this, "OnNickInfo") + , onnickinfo(this) , hide_email(this, NickServ::account, "HIDE_EMAIL") , hide_usermask(this, NickServ::account, "HIDE_MASK") , hide_status(this, NickServ::account, "HIDE_STATUS") diff --git a/modules/commands/ns_list.cpp b/modules/commands/ns_list.cpp index b382625d8..e5dd56562 100644 --- a/modules/commands/ns_list.cpp +++ b/modules/commands/ns_list.cpp @@ -270,7 +270,7 @@ class NSList : public Module public: NSList(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , EventHook("OnNickInfo") + , EventHook() , commandnslist(this) , commandnssetprivate(this) , commandnssasetprivate(this) diff --git a/modules/commands/ns_recover.cpp b/modules/commands/ns_recover.cpp index f3caf416b..21d11124f 100644 --- a/modules/commands/ns_recover.cpp +++ b/modules/commands/ns_recover.cpp @@ -202,8 +202,8 @@ class NSRecover : public Module public: NSRecover(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , EventHook("OnUserNickChange") - , EventHook("OnJoinChannel") + , EventHook() + , EventHook() , commandnsrecover(this) , recover(this, "recover") { diff --git a/modules/commands/ns_register.cpp b/modules/commands/ns_register.cpp index 4e7890d79..1c601e2a2 100644 --- a/modules/commands/ns_register.cpp +++ b/modules/commands/ns_register.cpp @@ -350,8 +350,8 @@ class NSRegister : public Module public: NSRegister(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , EventHook("OnNickIdentify") - , EventHook("OnPreNickExpire") + , EventHook() + , EventHook() , commandnsregister(this) , commandnsconfirm(this) , commandnsrsend(this) diff --git a/modules/commands/ns_resetpass.cpp b/modules/commands/ns_resetpass.cpp index a1c32976c..2ee7f7a01 100644 --- a/modules/commands/ns_resetpass.cpp +++ b/modules/commands/ns_resetpass.cpp @@ -67,7 +67,7 @@ class NSResetPass : public Module public: NSResetPass(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , EventHook("OnPreCommand") + , EventHook() , commandnsresetpass(this), reset(this, "reset") { if (!Config->GetBlock("mail")->Get("usemail")) diff --git a/modules/commands/ns_set.cpp b/modules/commands/ns_set.cpp index d78edb150..f60c23053 100644 --- a/modules/commands/ns_set.cpp +++ b/modules/commands/ns_set.cpp @@ -1107,13 +1107,13 @@ class NSSet : public Module public: NSSet(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , EventHook("OnPreCommand") - , EventHook("OnSetCorrectModes") - , EventHook("OnPreNickExpire") - , EventHook("OnNickInfo") - , EventHook("OnUserModeSet") - , EventHook("OnUserModeUnset") - , EventHook("OnUserLogin") + , EventHook() + , EventHook() + , EventHook() + , EventHook() + , EventHook() + , EventHook() + , EventHook() , commandnsset(this) , commandnssaset(this) , commandnssetautoop(this) @@ -1147,7 +1147,7 @@ class NSSet : public Module , ns_set_email(this, "ns_set_email") - , onsetnickoption(this, "OnSetNickOption") + , onsetnickoption(this) { } diff --git a/modules/commands/ns_set_misc.cpp b/modules/commands/ns_set_misc.cpp index 8a84a459c..a062f0511 100644 --- a/modules/commands/ns_set_misc.cpp +++ b/modules/commands/ns_set_misc.cpp @@ -186,7 +186,7 @@ class NSSetMisc : public Module public: NSSetMisc(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , EventHook("OnNickInfo") + , EventHook() , commandnssetmisc(this) , commandnssasetmisc(this) , type(this) diff --git a/modules/commands/ns_suspend.cpp b/modules/commands/ns_suspend.cpp index 15219dad7..9019b5f7d 100644 --- a/modules/commands/ns_suspend.cpp +++ b/modules/commands/ns_suspend.cpp @@ -199,10 +199,10 @@ class CommandNSSuspend : public Command class CommandNSUnSuspend : public Command { - EventHandlers &onnickunsuspend; + EventHandlers &onnickunsuspend; public: - CommandNSUnSuspend(Module *creator, EventHandlers &event) : Command(creator, "nickserv/unsuspend", 1, 1), onnickunsuspend(event) + CommandNSUnSuspend(Module *creator, EventHandlers &event) : Command(creator, "nickserv/unsuspend", 1, 1), onnickunsuspend(event) { this->SetDesc(_("Unsuspend a given nick")); this->SetSyntax(_("\037account\037")); @@ -235,7 +235,7 @@ class CommandNSUnSuspend : public Command source.Reply(_("\002{0}\002 is now released."), na->GetNick()); - this->onnickunsuspend(&Event::NickUnsuspended::OnNickUnsuspended, na); + this->onnickunsuspend(&Event::NickUnsuspend::OnNickUnsuspend, na); } bool OnHelp(CommandSource &source, const Anope::string &subcommand) override @@ -253,7 +253,7 @@ class NSSuspend : public Module CommandNSSuspend commandnssuspend; CommandNSUnSuspend commandnsunsuspend; EventHandlers onnicksuspend; - EventHandlers onnickunsuspend; + EventHandlers onnickunsuspend; std::vector show; NSSuspendType nst; @@ -272,13 +272,13 @@ class NSSuspend : public Module public: NSSuspend(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , EventHook("OnNickInfo") - , EventHook("OnPreNickExpire") - , EventHook("OnNickValidate") + , EventHook() + , EventHook() + , EventHook() , commandnssuspend(this, onnicksuspend) , commandnsunsuspend(this, onnickunsuspend) - , onnicksuspend(this, "OnNickSuspend") - , onnickunsuspend(this, "OnNickUnsuspended") + , onnicksuspend(this) + , onnickunsuspend(this) , nst(this) { } diff --git a/modules/commands/ns_update.cpp b/modules/commands/ns_update.cpp index 9f16f59c2..0022f389d 100644 --- a/modules/commands/ns_update.cpp +++ b/modules/commands/ns_update.cpp @@ -58,7 +58,7 @@ class NSUpdate : public Module public: NSUpdate(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) , commandnsupdate(this, onnickupdate) - , onnickupdate(this, "OnNickUpdate") + , onnickupdate(this) { } diff --git a/modules/commands/os_defcon.cpp b/modules/commands/os_defcon.cpp index c97c33bb4..9e38d0779 100644 --- a/modules/commands/os_defcon.cpp +++ b/modules/commands/os_defcon.cpp @@ -337,16 +337,16 @@ class OSDefcon : public Module public: OSDefcon(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , EventHook("OnChannelModeSet") - , EventHook("OnChannelModeUnset") - , EventHook("OnPreCommand") - , EventHook("OnUserConnect") - , EventHook("OnChannelModeAdd") - , EventHook("OnChannelSync") + , EventHook() + , EventHook() + , EventHook() + , EventHook() + , EventHook() + , EventHook() , session_service("SessionService", "session") , akills("XLineManager", "xlinemanager/sgline") , commandosdefcon(this, ondefconlevel) - , ondefconlevel(this, "OnDefconLevel") + , ondefconlevel(this) { } diff --git a/modules/commands/os_dns.cpp b/modules/commands/os_dns.cpp index fe61a9b63..2d68583e2 100644 --- a/modules/commands/os_dns.cpp +++ b/modules/commands/os_dns.cpp @@ -802,11 +802,11 @@ class ModuleDNS : public Module public: ModuleDNS(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, EXTRA | VENDOR) - , EventHook("OnNewServer") - , EventHook("OnServerQuit") - , EventHook("OnUserConnect") - , EventHook("OnPreUserLogoff") - , EventHook("OnDnsRequest") + , EventHook() + , EventHook() + , EventHook() + , EventHook() + , EventHook() , zonetype(this) , servertype(this) , zonemembtype(this) diff --git a/modules/commands/os_forbid.cpp b/modules/commands/os_forbid.cpp index f8afcc6ee..95ad737b3 100644 --- a/modules/commands/os_forbid.cpp +++ b/modules/commands/os_forbid.cpp @@ -460,10 +460,10 @@ class OSForbid : public Module public: OSForbid(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , EventHook("OnUserConnect") - , EventHook("OnUserNickChange") - , EventHook("OnCheckKick") - , EventHook("OnPreCommand") + , EventHook() + , EventHook() + , EventHook() + , EventHook() , forbid_service(this) , type(this) , commandosforbid(this) diff --git a/modules/commands/os_ignore.cpp b/modules/commands/os_ignore.cpp index 8210700a0..e260ed7d0 100644 --- a/modules/commands/os_ignore.cpp +++ b/modules/commands/os_ignore.cpp @@ -374,7 +374,7 @@ class OSIgnore : public Module public: OSIgnore(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , EventHook("OnBotPrivmsg") + , EventHook() , ignoretype(this) , osignoreservice(this) , commandosignore(this) diff --git a/modules/commands/os_info.cpp b/modules/commands/os_info.cpp index 7c17cb2a0..4342791a7 100644 --- a/modules/commands/os_info.cpp +++ b/modules/commands/os_info.cpp @@ -241,8 +241,8 @@ class OSInfo : public Module public: OSInfo(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , EventHook("OnNickInfo") - , EventHook("OnChanInfo") + , EventHook() + , EventHook() , commandosinfo(this) , oinfotype(this) { diff --git a/modules/commands/os_login.cpp b/modules/commands/os_login.cpp index 8aae3c302..f09d794b2 100644 --- a/modules/commands/os_login.cpp +++ b/modules/commands/os_login.cpp @@ -125,7 +125,7 @@ class OSLogin : public Module public: OSLogin(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , EventHook("OnIsServicesOperEvent") + , EventHook() , commandoslogin(this) , commandoslogout(this) , os_login(this, "os_login") diff --git a/modules/commands/os_news.cpp b/modules/commands/os_news.cpp index a552f22d2..547952ea6 100644 --- a/modules/commands/os_news.cpp +++ b/modules/commands/os_news.cpp @@ -426,8 +426,8 @@ class OSNews : public Module public: OSNews(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , EventHook("OnUserModeSet") - , EventHook("OnUserConnect") + , EventHook() + , EventHook() , newsitemtype(this) , commandoslogonnews(this) , commandosopernews(this) diff --git a/modules/commands/os_noop.cpp b/modules/commands/os_noop.cpp index 31709c078..14cf8b8c4 100644 --- a/modules/commands/os_noop.cpp +++ b/modules/commands/os_noop.cpp @@ -77,7 +77,7 @@ class OSNOOP : public Module public: OSNOOP(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , EventHook("OnUserModeSet") + , EventHook() , commandosnoop(this) , noop(this, "noop") { diff --git a/modules/commands/os_session.cpp b/modules/commands/os_session.cpp index 4580e4a8d..e33b89756 100644 --- a/modules/commands/os_session.cpp +++ b/modules/commands/os_session.cpp @@ -671,14 +671,14 @@ class OSSession : public Module public: OSSession(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , EventHook("OnUserConnect", EventHook::Priority::FIRST) - , EventHook("OnUserQuit", EventHook::Priority::FIRST) - , EventHook("OnExpireTick", EventHook::Priority::FIRST) + , EventHook(EventHook::Priority::FIRST) + , EventHook(EventHook::Priority::FIRST) + , EventHook(EventHook::Priority::FIRST) , ss(this) , commandossession(this) , commandosexception(this) , akills("XLineManager", "xlinemanager/sgline") - , exceptionevents(this, "Exception") + , exceptionevents(this) , etype(this) { this->SetPermanent(true); diff --git a/modules/cs_statusupdate.cpp b/modules/cs_statusupdate.cpp index 9874c90d6..312aaac71 100644 --- a/modules/cs_statusupdate.cpp +++ b/modules/cs_s