diff options
164 files changed, 86 insertions, 374 deletions
diff --git a/include/access.h b/include/access.h index fd2b60356..0c730c9ff 100644 --- a/include/access.h +++ b/include/access.h @@ -44,7 +44,7 @@ enum ChannelAccess class ChanAccess; -class CoreExport AccessProvider : public Service +class CoreExport AccessProvider : public Service<AccessProvider> { public: AccessProvider(Module *o, const Anope::string &n); diff --git a/include/commands.h b/include/commands.h index 227483f63..02a89f416 100644 --- a/include/commands.h +++ b/include/commands.h @@ -62,7 +62,7 @@ struct CoreExport CommandSource /** Every services command is a class, inheriting from Command. */ -class CoreExport Command : public Service, public Flags<CommandFlag> +class CoreExport Command : public Service<Command>, public Flags<CommandFlag> { Anope::string desc; std::vector<Anope::string> syntax; diff --git a/include/modules.h b/include/modules.h index 5ba1be938..a34b7f64d 100644 --- a/include/modules.h +++ b/include/modules.h @@ -1076,16 +1076,10 @@ enum Implementation I_END }; -class Service; - /** Used to manage modules. */ class CoreExport ModuleManager { - private: - /** A map of service providers - */ - static std::map<Anope::string, Service *> ServiceProviders; public: /** Event handler hooks. * This needs to be public to be used by FOREACH_MOD and friends. @@ -1197,29 +1191,6 @@ class CoreExport ModuleManager */ static void UnloadAll(); - /** Register a service - * @param s The service - * @return true if it was successfully registeed, else false (service name colision) - */ - static bool RegisterService(Service *s); - - /** Unregister a service - * @param s The service - * @return true if it was unregistered successfully - */ - static bool UnregisterService(Service *s); - - /** Get a service - * @param name The service name - * @return The services, or NULL - */ - static Service *GetService(const Anope::string &name); - - /** Get the existing service key names - * @return The keys - */ - static std::vector<Anope::string> GetServiceKeys(); - private: /** Call the module_delete function to safely delete the module * @param m the module to delete @@ -1254,7 +1225,7 @@ class service_reference : public dynamic_reference<T> Anope::string name; public: - service_reference(const Anope::string &n) : dynamic_reference<T>(static_cast<T *>(ModuleManager::GetService(n))), name(n) + service_reference(const Anope::string &n) : dynamic_reference<T>(NULL), name(n) { } @@ -1267,7 +1238,7 @@ class service_reference : public dynamic_reference<T> } if (!this->ref) { - this->ref = static_cast<T *>(ModuleManager::GetService(this->name)); + this->ref = Service<T>::FindService(this->name); if (this->ref) this->ref->AddReference(this); } diff --git a/include/oper.h b/include/oper.h index 228d1cf50..8c587794b 100644 --- a/include/oper.h +++ b/include/oper.h @@ -30,7 +30,7 @@ class CoreExport XLine sockaddrs GetIP() const; }; -class CoreExport XLineManager : public Service +class CoreExport XLineManager : public Service<XLineManager> { char type; protected: diff --git a/include/services.h b/include/services.h index 9719ab13e..d6db4e9ed 100644 --- a/include/services.h +++ b/include/services.h @@ -347,17 +347,42 @@ template<typename T, size_t Size = 32> class Flags class Module; -class CoreExport Service : public Base +template<typename T> class CoreExport Service : public Base { + static Anope::map<T *> services; public: + static T* FindService(const Anope::string &n) + { + typename Anope::map<T *>::iterator it = Service<T>::services.find(n); + if (it != Service<T>::services.end()) + return it->second; + return NULL; + } + + static std::vector<Anope::string> GetServiceKeys() + { + std::vector<Anope::string> keys; + for (typename Anope::map<T *>::iterator it = Service<T>::services.begin(), it_end = Service<T>::services.end(); it != it_end; ++it) + keys.push_back(it->first); + return keys; + } + Module *owner; Anope::string name; - Service(Module *o, const Anope::string &n); + Service(Module *o, const Anope::string &n) : owner(o), name(n) + { + if (Service<T>::services.find(n) != Service<T>::services.end()) + throw ModuleException("Service with name " + n + " already exists"); + Service<T>::services[n] = static_cast<T *>(this); + } - virtual ~Service(); + virtual ~Service() + { + Service<T>::services.erase(this->name); + } }; - +template<typename T> Anope::map<T *> Service<T>::services; #include "sockets.h" #include "socketengine.h" diff --git a/modules/commands/bs_assign.cpp b/modules/commands/bs_assign.cpp index fcaca4bac..13f3e4403 100644 --- a/modules/commands/bs_assign.cpp +++ b/modules/commands/bs_assign.cpp @@ -160,8 +160,6 @@ class BSAssign : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandbsassign); - ModuleManager::RegisterService(&commandbsunassign); } }; diff --git a/modules/commands/bs_badwords.cpp b/modules/commands/bs_badwords.cpp index c2ca13723..15298d5eb 100644 --- a/modules/commands/bs_badwords.cpp +++ b/modules/commands/bs_badwords.cpp @@ -324,7 +324,6 @@ class BSBadwords : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandbsbadwords); } }; diff --git a/modules/commands/bs_bot.cpp b/modules/commands/bs_bot.cpp index e4f88856f..3f6ee872a 100644 --- a/modules/commands/bs_bot.cpp +++ b/modules/commands/bs_bot.cpp @@ -407,7 +407,6 @@ class BSBot : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandbsbot); } }; diff --git a/modules/commands/bs_botlist.cpp b/modules/commands/bs_botlist.cpp index b614c0689..03e0c16b8 100644 --- a/modules/commands/bs_botlist.cpp +++ b/modules/commands/bs_botlist.cpp @@ -84,7 +84,6 @@ class BSBotList : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandbsbotlist); } }; diff --git a/modules/commands/bs_control.cpp b/modules/commands/bs_control.cpp index a798c6171..b464a4520 100644 --- a/modules/commands/bs_control.cpp +++ b/modules/commands/bs_control.cpp @@ -150,8 +150,6 @@ class BSControl : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandbssay); - ModuleManager::RegisterService(&commandbsact); } }; diff --git a/modules/commands/bs_info.cpp b/modules/commands/bs_info.cpp index 3f1b107f2..d6668184d 100644 --- a/modules/commands/bs_info.cpp +++ b/modules/commands/bs_info.cpp @@ -237,7 +237,6 @@ class BSInfo : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandbsinfo); } }; diff --git a/modules/commands/bs_kick.cpp b/modules/commands/bs_kick.cpp index 0612c7e40..107e78d64 100644 --- a/modules/commands/bs_kick.cpp +++ b/modules/commands/bs_kick.cpp @@ -739,7 +739,6 @@ class BSKick : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandbskick); ModuleManager::Attach(I_OnPrivmsg, this); } diff --git a/modules/commands/bs_set.cpp b/modules/commands/bs_set.cpp index 46e4236b1..be699c3e8 100644 --- a/modules/commands/bs_set.cpp +++ b/modules/commands/bs_set.cpp @@ -302,7 +302,6 @@ class BSSet : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandbsset); } }; diff --git a/modules/commands/cs_access.cpp b/modules/commands/cs_access.cpp index ae1e03fbf..2dd7da51c 100644 --- a/modules/commands/cs_access.cpp +++ b/modules/commands/cs_access.cpp @@ -882,9 +882,6 @@ class CSAccess : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&accessprovider); - ModuleManager::RegisterService(&commandcsaccess); - ModuleManager::RegisterService(&commandcslevels); Implementation i[] = { I_OnReload, I_OnChanRegistered, I_OnCreateChan, I_OnGroupCheckPriv }; ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); diff --git a/modules/commands/cs_akick.cpp b/modules/commands/cs_akick.cpp index 11b4da62c..594544e22 100644 --- a/modules/commands/cs_akick.cpp +++ b/modules/commands/cs_akick.cpp @@ -557,7 +557,6 @@ class CSAKick : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandcsakick); } }; diff --git a/modules/commands/cs_appendtopic.cpp b/modules/commands/cs_appendtopic.cpp index 63fb0a785..bc4db7cba 100644 --- a/modules/commands/cs_appendtopic.cpp +++ b/modules/commands/cs_appendtopic.cpp @@ -110,7 +110,6 @@ class CSAppendTopic : public Module { this->SetAuthor("SGR"); - ModuleManager::RegisterService(&commandcsappendtopic); } }; diff --git a/modules/commands/cs_ban.cpp b/modules/commands/cs_ban.cpp index de506e3fe..0aae3f9bd 100644 --- a/modules/commands/cs_ban.cpp +++ b/modules/commands/cs_ban.cpp @@ -102,7 +102,6 @@ class CSBan : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandcsban); } }; diff --git a/modules/commands/cs_clearusers.cpp b/modules/commands/cs_clearusers.cpp index 91dc68cc2..e8f47bac4 100644 --- a/modules/commands/cs_clearusers.cpp +++ b/modules/commands/cs_clearusers.cpp @@ -76,7 +76,6 @@ class CSClearUsers : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandcsclearusers); } }; diff --git a/modules/commands/cs_clone.cpp b/modules/commands/cs_clone.cpp index dff50f9ce..8a242c532 100644 --- a/modules/commands/cs_clone.cpp +++ b/modules/commands/cs_clone.cpp @@ -186,7 +186,6 @@ class CSClone : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandcsclone); } }; diff --git a/modules/commands/cs_drop.cpp b/modules/commands/cs_drop.cpp index a42c8e58e..7056f5c35 100644 --- a/modules/commands/cs_drop.cpp +++ b/modules/commands/cs_drop.cpp @@ -93,7 +93,6 @@ class CSDrop : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandcsdrop); } }; diff --git a/modules/commands/cs_enforce.cpp b/modules/commands/cs_enforce.cpp index 267a0a850..78a2a9950 100644 --- a/modules/commands/cs_enforce.cpp +++ b/modules/commands/cs_enforce.cpp @@ -208,7 +208,6 @@ class CSEnforce : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandcsenforce); } }; diff --git a/modules/commands/cs_entrymsg.cpp b/modules/commands/cs_entrymsg.cpp index 71e0eea9c..05b97e027 100644 --- a/modules/commands/cs_entrymsg.cpp +++ b/modules/commands/cs_entrymsg.cpp @@ -168,7 +168,6 @@ class CSEntryMessage : public Module Implementation i[] = { I_OnJoinChannel, I_OnReload, I_OnDatabaseReadMetadata, I_OnDatabaseWriteMetadata }; ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); - ModuleManager::RegisterService(&commandentrymsg); this->OnReload(); } diff --git a/modules/commands/cs_flags.cpp b/modules/commands/cs_flags.cpp index a8d44aeea..8bec73ae0 100644 --- a/modules/commands/cs_flags.cpp +++ b/modules/commands/cs_flags.cpp @@ -427,8 +427,6 @@ class CSFlags : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&accessprovider); - ModuleManager::RegisterService(&commandcsflags); Implementation i[] = { I_OnReload }; ModuleManager::Attach(i, this, 1); diff --git a/modules/commands/cs_getkey.cpp b/modules/commands/cs_getkey.cpp index e2f3c7531..cfb148134 100644 --- a/modules/commands/cs_getkey.cpp +++ b/modules/commands/cs_getkey.cpp @@ -73,7 +73,6 @@ class CSGetKey : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandcsgetkey); } }; diff --git a/modules/commands/cs_info.cpp b/modules/commands/cs_info.cpp index 5cc100c78..54f14cd0c 100644 --- a/modules/commands/cs_info.cpp +++ b/modules/commands/cs_info.cpp @@ -78,7 +78,6 @@ class CommandCSInfo : public Command Anope::string optbuf; CheckOptStr(optbuf, CI_KEEPTOPIC, _("Topic Retention"), ci, u->Account()); - CheckOptStr(optbuf, CI_OPNOTICE, _("OP Notice"), ci, u->Account()); CheckOptStr(optbuf, CI_PEACE, _("Peace"), ci, u->Account()); CheckOptStr(optbuf, CI_PRIVATE, _("Private"), ci, u->Account()); CheckOptStr(optbuf, CI_RESTRICTED, _("Restricted Access"), ci, u->Account()); @@ -135,7 +134,6 @@ class CSInfo : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandcsinfo); } }; diff --git a/modules/commands/cs_invite.cpp b/modules/commands/cs_invite.cpp index 9773ba332..f6ed44685 100644 --- a/modules/commands/cs_invite.cpp +++ b/modules/commands/cs_invite.cpp @@ -95,7 +95,6 @@ class CSInvite : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandcsinvite); } }; diff --git a/modules/commands/cs_kick.cpp b/modules/commands/cs_kick.cpp index 312bb0859..b9c0f7b41 100644 --- a/modules/commands/cs_kick.cpp +++ b/modules/commands/cs_kick.cpp @@ -84,7 +84,6 @@ class CSKick : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandcskick); } }; diff --git a/modules/commands/cs_list.cpp b/modules/commands/cs_list.cpp index 92b5c702f..29a4309b2 100644 --- a/modules/commands/cs_list.cpp +++ b/modules/commands/cs_list.cpp @@ -129,7 +129,6 @@ class CSList : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandcslist); } }; diff --git a/modules/commands/cs_mode.cpp b/modules/commands/cs_mode.cpp index 7c98292d3..3e4ed784c 100644 --- a/modules/commands/cs_mode.cpp +++ b/modules/commands/cs_mode.cpp @@ -365,7 +365,6 @@ class CSMode : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandcsmode); } }; diff --git a/modules/commands/cs_modes.cpp b/modules/commands/cs_modes.cpp index e2b2f2516..fb2fcb727 100644 --- a/modules/commands/cs_modes.cpp +++ b/modules/commands/cs_modes.cpp @@ -61,17 +61,16 @@ class CommandModeBase : public Command * @param set Is the mode being set or removed * @param level The acecss level required to set this mode on someone else * @param levelself The access level required to set this mode on yourself - * @param notice Flag required on a channel to send a notice */ - void do_util(CommandSource &source, Command *com, ChannelMode *cm, const Anope::string &chan, const Anope::string &nick, bool set, ChannelAccess level, ChannelAccess levelself, ChannelInfoFlag notice) + void do_util(CommandSource &source, Command *com, ChannelMode *cm, const Anope::string &chan, const Anope::string &nick, bool set, ChannelAccess level, ChannelAccess levelself) { User *u = source.u; if (chan.empty()) for (UChannelList::iterator it = u->chans.begin(); it != u->chans.end(); ++it) - do_mode(source, com, cm, (*it)->chan->name, u->nick, set, level, levelself, notice); + do_mode(source, com, cm, (*it)->chan->name, u->nick, set, level, levelself); else - do_mode(source, com, cm, chan, !nick.empty() ? nick : u->nick, set, level, levelself, notice); + do_mode(source, com, cm, chan, !nick.empty() ? nick : u->nick, set, level, levelself); return; } @@ -153,7 +152,7 @@ class CommandCSVoice : public CommandModeBase { ChannelMode *cm = ModeManager::FindChannelModeByName(CMODE_VOICE); - return do_util(source, this, cm, !params.empty() ? params[0] : "", params.size() > 1 ? params[1] : "", true, CA_VOICE, CA_VOICEME, CI_BEGIN); + return do_util(source, this, cm, !params.empty() ? params[0] : "", params.size() > 1 ? params[1] : "", true, CA_VOICE, CA_VOICEME); } bool OnHelp(CommandSource &source, const Anope::string &subcommand) @@ -183,7 +182,7 @@ class CommandCSDeVoice : public CommandModeBase { ChannelMode *cm = ModeManager::FindChannelModeByName(CMODE_VOICE); - return do_util(source, this, cm, !params.empty() ? params[0] : "", params.size() > 1 ? params[1] : "", false, CA_VOICE, CA_VOICEME, CI_BEGIN); + return do_util(source, this, cm, !params.empty() ? params[0] : "", params.size() > 1 ? params[1] : "", false, CA_VOICE, CA_VOICEME); } bool OnHelp(CommandSource &source, const Anope::string &subcommand) @@ -216,7 +215,7 @@ class CommandCSHalfOp : public CommandModeBase if (!cm) return; - return do_util(source, this, cm, !params.empty() ? params[0] : "", params.size() > 1 ? params[1] : "", true, CA_HALFOP, CA_HALFOPME, CI_BEGIN); + return do_util(source, this, cm, !params.empty() ? params[0] : "", params.size() > 1 ? params[1] : "", true, CA_HALFOP, CA_HALFOPME); } bool OnHelp(CommandSource &source, const Anope::string &subcommand) @@ -248,7 +247,7 @@ class CommandCSDeHalfOp : public CommandModeBase if (!cm) return; - return do_util(source, this, cm, !params.empty() ? params[0] : "", params.size() > 1 ? params[1] : "", false, CA_HALFOP, CA_HALFOPME, CI_BEGIN); + return do_util(source, this, cm, !params.empty() ? params[0] : "", params.size() > 1 ? params[1] : "", false, CA_HALFOP, CA_HALFOPME); } bool OnHelp(CommandSource &source, const Anope::string &subcommand) @@ -281,7 +280,7 @@ class CommandCSProtect : public CommandModeBase if (!cm) return; - return do_util(source, this, cm, !params.empty() ? params[0] : "", params.size() > 1 ? params[1] : "", true, CA_PROTECT, CA_PROTECTME, CI_BEGIN); + return do_util(source, this, cm, !params.empty() ? params[0] : "", params.size() > 1 ? params[1] : "", true, CA_PROTECT, CA_PROTECTME); } bool OnHelp(CommandSource &source, const Anope::string &subcommand) @@ -313,7 +312,7 @@ class CommandCSDeProtect : public CommandModeBase if (!cm) return; - return do_util(source, this, cm, !params.empty() ? params[0] : "", params.size() > 1 ? params[1] : "", false, CA_PROTECT, CA_PROTECTME, CI_BEGIN); + return do_util(source, this, cm, !params.empty() ? params[0] : "", params.size() > 1 ? params[1] : "", false, CA_PROTECT, CA_PROTECTME); } bool OnHelp(CommandSource &source, const Anope::string &subcommand) @@ -344,7 +343,7 @@ class CommandCSOwner : public CommandModeBase if (!cm) return; - return do_util(source, this, cm, !params.empty() ? params[0] : "", params.size() > 1 ? params[1] : "", true, CA_OWNER, CA_OWNERME, CI_BEGIN); + return do_util(source, this, cm, !params.empty() ? params[0] : "", params.size() > 1 ? params[1] : "", true, CA_OWNER, CA_OWNERME); } bool OnHelp(CommandSource &source, const Anope::string &subcommand) @@ -375,7 +374,7 @@ class CommandCSDeOwner : public CommandModeBase if (!cm) return; - return do_util(source, this, cm, !params.empty() ? params[0] : "", params.size() > 1 ? params[1] : "", false, CA_OWNER, CA_OWNERME, CI_BEGIN); + return do_util(source, this, cm, !params.empty() ? params[0] : "", params.size() > 1 ? params[1] : "", false, CA_OWNER, CA_OWNERME); } bool OnHelp(CommandSource &source, const Anope::string &subcommand) @@ -412,17 +411,7 @@ class CSModes : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandcsop); - ModuleManager::RegisterService(&commandcsdeop); - ModuleManager::RegisterService(&commandcsvoice); - ModuleManager::RegisterService(&commandcsdevoice); - ModuleManager::RegisterService(&commandcsowner); - ModuleManager::RegisterService(&commandcsdeowner); - ModuleManager::RegisterService(&commandcsprotect); - ModuleManager::RegisterService(&commandcsdeprotect); - ModuleManager::RegisterService(&commandcshalfop); - ModuleManager::RegisterService(&commandcsdehalfop); } }; diff --git a/modules/commands/cs_register.cpp b/modules/commands/cs_register.cpp index 632cbced7..e9344d362 100644 --- a/modules/commands/cs_register.cpp +++ b/modules/commands/cs_register.cpp @@ -182,7 +182,6 @@ class CSRegister : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandcsregister); ModuleManager::Attach(I_OnDelChan, this); } diff --git a/modules/commands/cs_saset.cpp b/modules/commands/cs_saset.cpp index 699c5bc2c..7049c2723 100644 --- a/modules/commands/cs_saset.cpp +++ b/modules/commands/cs_saset.cpp @@ -67,7 +67,6 @@ class CSSASet : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandcssaset); } }; diff --git a/modules/commands/cs_saset_noexpire.cpp b/modules/commands/cs_saset_noexpire.cpp index 91ca8ecd9..1f645304a 100644 --- a/modules/commands/cs_saset_noexpire.cpp +++ b/modules/commands/cs_saset_noexpire.cpp @@ -74,7 +74,6 @@ class CSSetNoexpire : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandcssasetnoexpire); } }; diff --git a/modules/commands/cs_seen.cpp b/modules/commands/cs_seen.cpp index 8b7c8061f..d466acca4 100644 --- a/modules/commands/cs_seen.cpp +++ b/modules/commands/cs_seen.cpp @@ -294,8 +294,6 @@ class CSSeen : public Module I_OnDatabaseWrite }; ModuleManager::Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation)); - ModuleManager::RegisterService(&commandseen); - ModuleManager::RegisterService(&commandosseen); OnReload(); } diff --git a/modules/commands/cs_set.cpp b/modules/commands/cs_set.cpp index 65719ce91..d2bb3464a 100644 --- a/modules/commands/cs_set.cpp +++ b/modules/commands/cs_set.cpp @@ -67,7 +67,6 @@ class CSSet : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandcsset); } }; diff --git a/modules/commands/cs_set_bantype.cpp b/modules/commands/cs_set_bantype.cpp index 7d7fea56e..468a3cb86 100644 --- a/modules/commands/cs_set_bantype.cpp +++ b/modules/commands/cs_set_bantype.cpp @@ -90,8 +90,6 @@ class CSSetBanType : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandcssetbantype); - ModuleManager::RegisterService(&commandcssasetbantype); } }; diff --git a/modules/commands/cs_set_description.cpp b/modules/commands/cs_set_description.cpp index 3a1341f1a..acd30e68b 100644 --- a/modules/commands/cs_set_description.cpp +++ b/modules/commands/cs_set_description.cpp @@ -81,8 +81,6 @@ class CSSetDescription : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandcssetdescription); - ModuleManager::RegisterService(&commandcssasetdescription); } }; diff --git a/modules/commands/cs_set_founder.cpp b/modules/commands/cs_set_founder.cpp index 7587b36b8..ac7ece637 100644 --- a/modules/commands/cs_set_founder.cpp +++ b/modules/commands/cs_set_founder.cpp @@ -97,8 +97,6 @@ class CSSetFounder : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandcssetfounder); - ModuleManager::RegisterService(&commandcssasetfounder); } }; diff --git a/modules/commands/cs_set_keeptopic.cpp b/modules/commands/cs_set_keeptopic.cpp index d0c5e5bd6..58c88a73c 100644 --- a/modules/commands/cs_set_keeptopic.cpp +++ b/modules/commands/cs_set_keeptopic.cpp @@ -86,8 +86,6 @@ class CSSetKeepTopic : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandcssetkeeptopic); - ModuleManager::RegisterService(&commandcssasetkeeptopic); } }; diff --git a/modules/commands/cs_set_misc.cpp b/modules/commands/cs_set_misc.cpp index 37a8dda4e..a64bbf6ea 100644 --- a/modules/commands/cs_set_misc.cpp +++ b/modules/commands/cs_set_misc.cpp @@ -67,8 +67,6 @@ class CSSetMisc : public Module Implementation i[] = { I_OnChanInfo, I_OnDatabaseWriteMetadata, I_OnDatabaseReadMetadata }; ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); - ModuleManager::RegisterService(&this->commandcssetmisc); - ModuleManager::RegisterService(&this->commandcssasetmisc); } void OnChanInfo(CommandSource &source, ChannelInfo *ci, bool ShowHidden) diff --git a/modules/commands/cs_set_peace.cpp b/modules/commands/cs_set_peace.cpp index f64c06c7e..a5bdd7cd5 100644 --- a/modules/commands/cs_set_peace.cpp +++ b/modules/commands/cs_set_peace.cpp @@ -85,8 +85,6 @@ class CSSetPeace : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandcssetpeace); - ModuleManager::RegisterService(&commandcssasetpeace); } }; diff --git a/modules/commands/cs_set_persist.cpp b/modules/commands/cs_set_persist.cpp index 8b13ae200..000389ef1 100644 --- a/modules/commands/cs_set_persist.cpp +++ b/modules/commands/cs_set_persist.cpp @@ -172,8 +172,6 @@ class CSSetPersist : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandcssetpeace); - ModuleManager::RegisterService(&commandcssasetpeace); } }; diff --git a/modules/commands/cs_set_private.cpp b/modules/commands/cs_set_private.cpp index 1e6129a09..39fd8b414 100644 --- a/modules/commands/cs_set_private.cpp +++ b/modules/commands/cs_set_private.cpp @@ -85,8 +85,6 @@ class CSSetPrivate : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandcssetprivate); - ModuleManager::RegisterService(&commandcssasetprivate); } }; diff --git a/modules/commands/cs_set_restricted.cpp b/modules/commands/cs_set_restricted.cpp index b37ae8de4..bc04297f1 100644 --- a/modules/commands/cs_set_restricted.cpp +++ b/modules/commands/cs_set_restricted.cpp @@ -83,8 +83,6 @@ class CSSetRestricted : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandcssetrestricted); - ModuleManager::RegisterService(&commandcssasetrestricted); } }; diff --git a/modules/commands/cs_set_secure.cpp b/modules/commands/cs_set_secure.cpp index 7b5eb2ce6..63671588b 100644 --- a/modules/commands/cs_set_secure.cpp +++ b/modules/commands/cs_set_secure.cpp @@ -86,8 +86,6 @@ class CSSetSecure : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandcssetsecure); - ModuleManager::RegisterService(&commandcssasetsecure); } }; diff --git a/modules/commands/cs_set_securefounder.cpp b/modules/commands/cs_set_securefounder.cpp index 584380244..746555814 100644 --- a/modules/commands/cs_set_securefounder.cpp +++ b/modules/commands/cs_set_securefounder.cpp @@ -87,8 +87,6 @@ class CSSetSecureFounder : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandcssetsecurefounder); - ModuleManager::RegisterService(&commandcssasetsecurefounder); } }; diff --git a/modules/commands/cs_set_secureops.cpp b/modules/commands/cs_set_secureops.cpp index d19107607..3dcc7b301 100644 --- a/modules/commands/cs_set_secureops.cpp +++ b/modules/commands/cs_set_secureops.cpp @@ -84,8 +84,6 @@ class CSSetSecureOps : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandcssetsecureops); - ModuleManager::RegisterService(&commandcssasetsecureops); } }; diff --git a/modules/commands/cs_set_signkick.cpp b/modules/commands/cs_set_signkick.cpp index 1d4508418..3a4177b83 100644 --- a/modules/commands/cs_set_signkick.cpp +++ b/modules/commands/cs_set_signkick.cpp @@ -96,8 +96,6 @@ class CSSetSignKick : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandcssetsignkick); - ModuleManager::RegisterService(&commandcssasetsignkick); } }; diff --git a/modules/commands/cs_set_successor.cpp b/modules/commands/cs_set_successor.cpp index eec276226..efd09bb6d 100644 --- a/modules/commands/cs_set_successor.cpp +++ b/modules/commands/cs_set_successor.cpp @@ -111,8 +111,6 @@ class CSSetSuccessor : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandcssetsuccessor); - ModuleManager::RegisterService(&commandcssasetsuccessor); } }; diff --git a/modules/commands/cs_set_topiclock.cpp b/modules/commands/cs_set_topiclock.cpp index 500e3db76..02f9151a0 100644 --- a/modules/commands/cs_set_topiclock.cpp +++ b/modules/commands/cs_set_topiclock.cpp @@ -84,8 +84,6 @@ class CSSetTopicLock : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandcssettopiclock); - ModuleManager::RegisterService(&commandcssasettopiclock); } }; diff --git a/modules/commands/cs_suspend.cpp b/modules/commands/cs_suspend.cpp index d1bd7b72a..d9f846d71 100644 --- a/modules/commands/cs_suspend.cpp +++ b/modules/commands/cs_suspend.cpp @@ -150,8 +150,6 @@ class CSSuspend : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandcssuspend); - ModuleManager::RegisterService(&commandcsunsuspend); } }; diff --git a/modules/commands/cs_sync.cpp b/modules/commands/cs_sync.cpp index 5c5c51fee..72964b786 100644 --- a/modules/commands/cs_sync.cpp +++ b/modules/commands/cs_sync.cpp @@ -59,7 +59,6 @@ class CSSync : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandcssync); } }; diff --git a/modules/commands/cs_tban.cpp b/modules/commands/cs_tban.cpp index 6bc682efe..0e7b8978e 100644 --- a/modules/commands/cs_tban.cpp +++ b/modules/commands/cs_tban.cpp @@ -109,7 +109,6 @@ class CSTBan : public Module me = this; - ModuleManager::RegisterService(&commandcstban); } }; diff --git a/modules/commands/cs_topic.cpp b/modules/commands/cs_topic.cpp index 49f6e8a13..a55c969f7 100644 --- a/modules/commands/cs_topic.cpp +++ b/modules/commands/cs_topic.cpp @@ -77,7 +77,6 @@ class CSTopic : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandcstopic); } }; diff --git a/modules/commands/cs_unban.cpp b/modules/commands/cs_unban.cpp index b4d09068c..c78b3a7d1 100644 --- a/modules/commands/cs_unban.cpp +++ b/modules/commands/cs_unban.cpp @@ -87,7 +87,6 @@ class CSUnban : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandcsunban); } }; diff --git a/modules/commands/cs_updown.cpp b/modules/commands/cs_updown.cpp index a3848c393..94a0d45d5 100644 --- a/modules/commands/cs_updown.cpp +++ b/modules/commands/cs_updown.cpp @@ -122,8 +122,6 @@ class CSUpDown : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandcsup); - ModuleManager::RegisterService(&commandcsdown); } }; diff --git a/modules/commands/cs_xop.cpp b/modules/commands/cs_xop.cpp index 1ea99541e..27f200b9b 100644 --- a/modules/commands/cs_xop.cpp +++ b/modules/commands/cs_xop.cpp @@ -868,12 +868,6 @@ class CSXOP : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&accessprovider); - ModuleManager::RegisterService(&commandcssop); - ModuleManager::RegisterService(&commandcsaop); - ModuleManager::RegisterService(&commandcsqop); - ModuleManager::RegisterService(&commandcsvop); - ModuleManager::RegisterService(&commandcshop); } }; diff --git a/modules/commands/gl_global.cpp b/modules/commands/gl_global.cpp index 80c42e017..b9b64f137 100644 --- a/modules/commands/gl_global.cpp +++ b/modules/commands/gl_global.cpp @@ -57,7 +57,6 @@ class GLGlobal : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandglglobal); } }; diff --git a/modules/commands/help.cpp b/modules/commands/help.cpp index 2a4f25b6c..bde3b5762 100644 --- a/modules/commands/help.cpp +++ b/modules/commands/help.cpp @@ -123,7 +123,6 @@ class Help : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandhelp); } }; diff --git a/modules/commands/hs_del.cpp b/modules/commands/hs_del.cpp index 541986aff..b4cde4f92 100644 --- a/modules/commands/hs_del.cpp +++ b/modules/commands/hs_del.cpp @@ -99,8 +99,6 @@ class HSDel : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandhsdel); - ModuleManager::RegisterService(&commandhsdelall); } }; diff --git a/modules/commands/hs_group.cpp b/modules/commands/hs_group.cpp index 8d6fbd630..c41d9de3b 100644 --- a/modules/commands/hs_group.cpp +++ b/modules/commands/hs_group.cpp @@ -73,7 +73,6 @@ class HSGroup : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandhsgroup); } }; diff --git a/modules/commands/hs_list.cpp b/modules/commands/hs_list.cpp index 589eef3e1..785db9e5c 100644 --- a/modules/commands/hs_list.cpp +++ b/modules/commands/hs_list.cpp @@ -130,7 +130,6 @@ class HSList : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandhslist); } }; diff --git a/modules/commands/hs_off.cpp b/modules/commands/hs_off.cpp index a3f11c2bd..789a711a9 100644 --- a/modules/commands/hs_off.cpp +++ b/modules/commands/hs_off.cpp @@ -60,7 +60,6 @@ class HSOff : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandhsoff); } }; diff --git a/modules/commands/hs_on.cpp b/modules/commands/hs_on.cpp index 0ba124ba1..c4f22d64c 100644 --- a/modules/commands/hs_on.cpp +++ b/modules/commands/hs_on.cpp @@ -70,7 +70,6 @@ class HSOn : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandhson); } }; diff --git a/modules/commands/hs_request.cpp b/modules/commands/hs_request.cpp index 75bb7994d..3d330bc2a 100644 --- a/modules/commands/hs_request.cpp +++ b/modules/commands/hs_request.cpp @@ -306,10 +306,6 @@ class HSRequest : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandhsrequest); - ModuleManager::RegisterService(&commandhsactive); - ModuleManager::RegisterService(&commandhsreject); - ModuleManager::RegisterService(&commandhswaiting); Implementation i[] = { I_OnDelNick, I_OnDatabaseRead, I_OnDatabaseWrite, I_OnReload }; ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); diff --git a/modules/commands/hs_set.cpp b/modules/commands/hs_set.cpp index 44a501cc1..1d6991202 100644 --- a/modules/commands/hs_set.cpp +++ b/modules/commands/hs_set.cpp @@ -216,8 +216,6 @@ class HSSet : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandhsset); - ModuleManager::RegisterService(&commandhssetall); } }; diff --git a/modules/commands/ms_cancel.cpp b/modules/commands/ms_cancel.cpp index e5beffa10..2d4374278 100644 --- a/modules/commands/ms_cancel.cpp +++ b/modules/commands/ms_cancel.cpp @@ -70,7 +70,6 @@ class MSCancel : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandmscancel); } }; diff --git a/modules/commands/ms_check.cpp b/modules/commands/ms_check.cpp index 3019e270f..a230eb749 100644 --- a/modules/commands/ms_check.cpp +++ b/modules/commands/ms_check.cpp @@ -82,7 +82,6 @@ class MSCheck : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandmscheck); } }; diff --git a/modules/commands/ms_del.cpp b/modules/commands/ms_del.cpp index b67fbc0cc..8f75b0da9 100644 --- a/modules/commands/ms_del.cpp +++ b/modules/commands/ms_del.cpp @@ -156,7 +156,6 @@ class MSDel : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandmsdel); } }; diff --git a/modules/commands/ms_ignore.cpp b/modules/commands/ms_ignore.cpp index 76075b299..b0c6cfd4f 100644 --- a/modules/commands/ms_ignore.cpp +++ b/modules/commands/ms_ignore.cpp @@ -104,7 +104,6 @@ class MSIgnore : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandmsignore); } }; diff --git a/modules/commands/ms_info.cpp b/modules/commands/ms_info.cpp index 9562b63e4..741be799a 100644 --- a/modules/commands/ms_info.cpp +++ b/modules/commands/ms_info.cpp @@ -212,7 +212,6 @@ class MSInfo : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandmsinfo); } }; diff --git a/modules/commands/ms_list.cpp b/modules/commands/ms_list.cpp index c0b5f910c..e6d7a691d 100644 --- a/modules/commands/ms_list.cpp +++ b/modules/commands/ms_list.cpp @@ -161,7 +161,6 @@ class MSList : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandmslist); } }; diff --git a/modules/commands/ms_read.cpp b/modules/commands/ms_read.cpp index 1221c5cc2..87a5cb648 100644 --- a/modules/commands/ms_read.cpp +++ b/modules/commands/ms_read.cpp @@ -189,7 +189,6 @@ class MSRead : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandmsread); } }; diff --git a/modules/commands/ms_rsend.cpp b/modules/commands/ms_rsend.cpp index 37c633e02..9dcb7033c 100644 --- a/modules/commands/ms_rsend.cpp +++ b/modules/commands/ms_rsend.cpp @@ -99,7 +99,6 @@ class MSRSend : public Module if (!Config->MSMemoReceipt) throw ModuleException("Invalid value for memoreceipt"); - ModuleManager::RegisterService(&commandmsrsend); } }; diff --git a/modules/commands/ms_send.cpp b/modules/commands/ms_send.cpp index 9397e7ad7..c9a70af10 100644 --- a/modules/commands/ms_send.cpp +++ b/modules/commands/ms_send.cpp @@ -63,7 +63,6 @@ class MSSend : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandmssend); } }; diff --git a/modules/commands/ms_sendall.cpp b/modules/commands/ms_sendall.cpp index 7af5ac7af..e72c14dbd 100644 --- a/modules/commands/ms_sendall.cpp +++ b/modules/commands/ms_sendall.cpp @@ -67,7 +67,6 @@ class MSSendAll : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandmssendall); } }; diff --git a/modules/commands/ms_set.cpp b/modules/commands/ms_set.cpp index 02eb971ad..a4fef31a8 100644 --- a/modules/commands/ms_set.cpp +++ b/modules/commands/ms_set.cpp @@ -305,7 +305,6 @@ class MSSet : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandmsset); } }; diff --git a/modules/commands/ms_staff.cpp b/modules/commands/ms_staff.cpp index 6264dbea4..090f67cfc 100644 --- a/modules/commands/ms_staff.cpp +++ b/modules/commands/ms_staff.cpp @@ -64,7 +64,6 @@ class MSStaff : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandmsstaff); } }; diff --git a/modules/commands/ns_access.cpp b/modules/commands/ns_access.cpp index df9ae6eed..366681b09 100644 --- a/modules/commands/ns_access.cpp +++ b/modules/commands/ns_access.cpp @@ -188,7 +188,6 @@ class NSAccess : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandnsaccess); } }; diff --git a/modules/commands/ns_ajoin.cpp b/modules/commands/ns_ajoin.cpp index 050470ec4..ca7b656a6 100644 --- a/modules/commands/ns_ajoin.cpp +++ b/modules/commands/ns_ajoin.cpp @@ -120,7 +120,6 @@ class NSAJoin : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandnsajoin); Implementation i[] = { I_OnNickIdentify, I_OnDatabaseWriteMetadata, I_OnDatabaseReadMetadata }; ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); diff --git a/modules/commands/ns_alist.cpp b/modules/commands/ns_alist.cpp index 179fa745a..84af7cadd 100644 --- a/modules/commands/ns_alist.cpp +++ b/modules/commands/ns_alist.cpp @@ -95,7 +95,6 @@ class NSAList : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandnsalist); } }; diff --git a/modules/commands/ns_cert.cpp b/modules/commands/ns_cert.cpp index f442fe14a..88e0144a3 100644 --- a/modules/commands/ns_cert.cpp +++ b/modules/commands/ns_cert.cpp @@ -214,7 +214,6 @@ class NSCert : public Module Implementation i[] = { I_OnFingerprint }; ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); - ModuleManager::RegisterService(&commandnscert); } void OnFingerprint(User *u) diff --git a/modules/commands/ns_drop.cpp b/modules/commands/ns_drop.cpp index 7960652ff..84e72c3cc 100644 --- a/modules/commands/ns_drop.cpp +++ b/modules/commands/ns_drop.cpp @@ -123,7 +123,6 @@ class NSDrop : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandnsdrop); } }; diff --git a/modules/commands/ns_getemail.cpp b/modules/commands/ns_getemail.cpp index fa27e5174..ab19cbf0e 100644 --- a/modules/commands/ns_getemail.cpp +++ b/modules/commands/ns_getemail.cpp @@ -75,7 +75,6 @@ class NSGetEMail : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandnsgetemail); } }; diff --git a/modules/commands/ns_getpass.cpp b/modules/commands/ns_getpass.cpp index 9ebea5263..0e266f9a8 100644 --- a/modules/commands/ns_getpass.cpp +++ b/modules/commands/ns_getpass.cpp @@ -72,7 +72,6 @@ class NSGetPass : public Module if (enc_decrypt(tmp_pass, tmp_pass) == -1) throw ModuleException("Incompatible with the encryption module being used"); - ModuleManager::RegisterService(&commandnsgetpass); } }; diff --git a/modules/commands/ns_ghost.cpp b/modules/commands/ns_ghost.cpp index 37dcef9c7..db4ff1dcd 100644 --- a/modules/commands/ns_ghost.cpp +++ b/modules/commands/ns_ghost.cpp @@ -115,7 +115,6 @@ class NSGhost : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandnsghost); } }; diff --git a/modules/commands/ns_group.cpp b/modules/commands/ns_group.cpp index 2e23e1f51..b41cad09d 100644 --- a/modules/commands/ns_group.cpp +++ b/modules/commands/ns_group.cpp @@ -296,9 +296,6 @@ class NSGroup : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandnsgroup); - ModuleManager::RegisterService(&commandnsungroup); - ModuleManager::RegisterService(&commandnsglist); } }; diff --git a/modules/commands/ns_identify.cpp b/modules/commands/ns_identify.cpp index b0a375cd2..2daa39df2 100644 --- a/modules/commands/ns_identify.cpp +++ b/modules/commands/ns_identify.cpp @@ -86,7 +86,6 @@ class NSIdentify : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandnsidentify); } }; diff --git a/modules/commands/ns_info.cpp b/modules/commands/ns_info.cpp index e40f80f77..8940bfaa7 100644 --- a/modules/commands/ns_info.cpp +++ b/modules/commands/ns_info.cpp @@ -171,7 +171,6 @@ class NSInfo : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandnsinfo); } }; diff --git a/modules/commands/ns_list.cpp b/modules/commands/ns_list.cpp index 96049ba02..e46be55e7 100644 --- a/modules/commands/ns_list.cpp +++ b/modules/commands/ns_list.cpp @@ -162,7 +162,6 @@ class NSList : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandnslist); } }; diff --git a/modules/commands/ns_logout.cpp b/modules/commands/ns_logout.cpp index 923ea7867..63798cdcb 100644 --- a/modules/commands/ns_logout.cpp +++ b/modules/commands/ns_logout.cpp @@ -90,7 +90,6 @@ class NSLogout : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandnslogout); } }; diff --git a/modules/commands/ns_recover.cpp b/modules/commands/ns_recover.cpp index e6352fb7c..f1a22129d 100644 --- a/modules/commands/ns_recover.cpp +++ b/modules/commands/ns_recover.cpp @@ -133,7 +133,6 @@ class NSRecover : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandnsrecover); } }; diff --git a/modules/commands/ns_register.cpp b/modules/commands/ns_register.cpp index 9e30167d8..aced3046e 100644 --- a/modules/commands/ns_register.cpp +++ b/modules/commands/ns_register.cpp @@ -315,9 +315,6 @@ class NSRegister : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandnsregister); - ModuleManager::RegisterService(&commandnsconfirm); - ModuleManager::RegisterService(&commandnsrsend); } }; diff --git a/modules/commands/ns_release.cpp b/modules/commands/ns_release.cpp index 20a3e295c..eb8a42729 100644 --- a/modules/commands/ns_release.cpp +++ b/modules/commands/ns_release.cpp @@ -103,7 +103,6 @@ class NSRelease : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandnsrelease); } }; diff --git a/modules/commands/ns_resetpass.cpp b/modules/commands/ns_resetpass.cpp index 400be41f9..153691cdf 100644 --- a/modules/commands/ns_resetpass.cpp +++ b/modules/commands/ns_resetpass.cpp @@ -69,7 +69,6 @@ class NSResetPass : public Module if (!Config->UseMail) throw ModuleException("Not using mail."); - ModuleManager::RegisterService(&commandnsresetpass); ModuleManager::Attach(I_OnPreCommand, this); } diff --git a/modules/commands/ns_saset.cpp b/modules/commands/ns_saset.cpp index a4aa2f422..d8305e43a 100644 --- a/modules/commands/ns_saset.cpp +++ b/modules/commands/ns_saset.cpp @@ -164,9 +164,6 @@ class NSSASet : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandnssaset); - ModuleManager::RegisterService(&commandnssasetdisplay); - ModuleManager::RegisterService(&commandnssasetpassword); } }; diff --git a/modules/commands/ns_saset_noexpire.cpp b/modules/commands/ns_saset_noexpire.cpp index 1bff9b461..e960f4030 100644 --- a/modules/commands/ns_saset_noexpire.cpp +++ b/modules/commands/ns_saset_noexpire.cpp @@ -69,7 +69,6 @@ class NSSASetNoexpire : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandnssasetnoexpire); } }; diff --git a/modules/commands/ns_sendpass.cpp b/modules/commands/ns_sendpass.cpp index 5195ac727..0aa81b9a7 100644 --- a/modules/commands/ns_sendpass.cpp +++ b/modules/commands/ns_sendpass.cpp @@ -83,7 +83,6 @@ class NSSendPass : public Module if (enc_decrypt(tmp_pass, tmp_pass) == -1) throw ModuleException("Incompatible with the encryption module being used"); - ModuleManager::RegisterService(&commandnssendpass); } }; diff --git a/modules/commands/ns_set.cpp b/modules/commands/ns_set.cpp index ad7acb5a4..11334565f 100644 --- a/modules/commands/ns_set.cpp +++ b/modules/commands/ns_set.cpp @@ -149,9 +149,6 @@ class NSSet : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandnsset); - ModuleManager::RegisterService(&commandnssetdisplay); - ModuleManager::RegisterService(&commandnssetpassword); } }; diff --git a/modules/commands/ns_set_autoop.cpp b/modules/commands/ns_set_autoop.cpp index ff178141f..b332ac485 100644 --- a/modules/commands/ns_set_autoop.cpp +++ b/modules/commands/ns_set_autoop.cpp @@ -99,8 +99,6 @@ class NSSetAutoOp : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandnssetautoop); - ModuleManager::RegisterService(&commandnssasetautoop); } }; diff --git a/modules/commands/ns_set_email.cpp b/modules/commands/ns_set_email.cpp index 0df8584b7..175ed5b9e 100644 --- a/modules/commands/ns_set_email.cpp +++ b/modules/commands/ns_set_email.cpp @@ -156,8 +156,6 @@ class NSSetEmail : public Module ModuleManager::Attach(I_OnPreCommand, this); - ModuleManager::RegisterService(&commandnssetemail); - ModuleManager::RegisterService(&commandnssasetemail); } EventReturn OnPreCommand(CommandSource &source, Command *command, std::vector<Anope::string> ¶ms) diff --git a/modules/commands/ns_set_greet.cpp b/modules/commands/ns_set_greet.cpp index 03bcd3834..811303796 100644 --- a/modules/commands/ns_set_greet.cpp +++ b/modules/commands/ns_set_greet.cpp @@ -100,8 +100,6 @@ class NSSetGreet : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandnssetgreet); - ModuleManager::RegisterService(&commandnssasetgreet); } }; diff --git a/modules/commands/ns_set_hide.cpp b/modules/commands/ns_set_hide.cpp index e0fb0e85e..1bad2d6bb 100644 --- a/modules/commands/ns_set_hide.cpp +++ b/modules/commands/ns_set_hide.cpp @@ -141,8 +141,6 @@ class NSSetHide : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandnssethide); - ModuleManager::RegisterService(&commandnssasethide); } }; diff --git a/modules/commands/ns_set_kill.cpp b/modules/commands/ns_set_kill.cpp index f57a93893..ed15d57f4 100644 --- a/modules/commands/ns_set_kill.cpp +++ b/modules/commands/ns_set_kill.cpp @@ -141,8 +141,6 @@ class NSSetKill : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandnssetkill); - ModuleManager::RegisterService(&commandnssasetkill); } }; diff --git a/modules/commands/ns_set_language.cpp b/modules/commands/ns_set_language.cpp index 9af0753f1..de3785593 100644 --- a/modules/commands/ns_set_language.cpp +++ b/modules/commands/ns_set_language.cpp @@ -121,8 +121,6 @@ class NSSetLanguage : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandnssetlanguage); - ModuleManager::RegisterService(&commandnssasetlanguage); } }; diff --git a/modules/commands/ns_set_message.cpp b/modules/commands/ns_set_message.cpp index 677002c78..ea77f5013 100644 --- a/modules/commands/ns_set_message.cpp +++ b/modules/commands/ns_set_message.cpp @@ -106,8 +106,6 @@ class NSSetMessage : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandnssetmessage); - ModuleManager::RegisterService(&commandnssasetmessage); } }; diff --git a/modules/commands/ns_set_misc.cpp b/modules/commands/ns_set_misc.cpp index 769dff9de..c511159d2 100644 --- a/modules/commands/ns_set_misc.cpp +++ b/modules/commands/ns_set_misc.cpp @@ -78,8 +78,6 @@ class NSSetMisc : public Module Implementation i[] = { I_OnNickInfo, I_OnDatabaseWriteMetadata, I_OnDatabaseReadMetadata }; ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); - ModuleManager::RegisterService(&this->commandnssetmisc); - ModuleManager::RegisterService(&this->commandnssasetmisc); } void OnNickInfo(CommandSource &source, NickAlias *na, bool ShowHidden) diff --git a/modules/commands/ns_set_private.cpp b/modules/commands/ns_set_private.cpp index 63fec57d6..bbbefa615 100644 --- a/modules/commands/ns_set_private.cpp +++ b/modules/commands/ns_set_private.cpp @@ -106,8 +106,6 @@ class NSSetPrivate : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandnssetprivate); - ModuleManager::RegisterService(&commandnssasetprivate); } }; diff --git a/modules/commands/ns_set_secure.cpp b/modules/commands/ns_set_secure.cpp index 31314a5a5..904ae6b0b 100644 --- a/modules/commands/ns_set_secure.cpp +++ b/modules/commands/ns_set_secure.cpp @@ -106,8 +106,6 @@ class NSSetSecure : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandnssetsecure); - ModuleManager::RegisterService(&commandnssasetsecure); } }; diff --git a/modules/commands/ns_status.cpp b/modules/commands/ns_status.cpp index 9d8b58fcb..e5878cd90 100644 --- a/modules/commands/ns_status.cpp +++ b/modules/commands/ns_status.cpp @@ -87,7 +87,6 @@ class NSStatus : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandnsstatus); } }; diff --git a/modules/commands/ns_suspend.cpp b/modules/commands/ns_suspend.cpp index 50cf039ce..c4934788a 100644 --- a/modules/commands/ns_suspend.cpp +++ b/modules/commands/ns_suspend.cpp @@ -152,8 +152,6 @@ class NSSuspend : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandnssuspend); - ModuleManager::RegisterService(&commandnsunsuspend); } }; diff --git a/modules/commands/ns_update.cpp b/modules/commands/ns_update.cpp index d870e3532..1c40d8e5a 100644 --- a/modules/commands/ns_update.cpp +++ b/modules/commands/ns_update.cpp @@ -63,7 +63,6 @@ class NSUpdate : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandnsupdate); } }; diff --git a/modules/commands/os_akill.cpp b/modules/commands/os_akill.cpp index 296819ca7..99aa60089 100644 --- a/modules/commands/os_akill.cpp +++ b/modules/commands/os_akill.cpp @@ -460,7 +460,6 @@ class OSAKill : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandosakill); } }; diff --git a/modules/commands/os_chankill.cpp b/modules/commands/os_chankill.cpp index 9ce895c59..9e6d29dbd 100644 --- a/modules/commands/os_chankill.cpp +++ b/modules/commands/os_chankill.cpp @@ -113,7 +113,6 @@ class OSChanKill : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandoschankill); } }; diff --git a/modules/commands/os_config.cpp b/modules/commands/os_config.cpp index 1d1fead33..4955aa473 100644 --- a/modules/commands/os_config.cpp +++ b/modules/commands/os_config.cpp @@ -210,7 +210,6 @@ class OSConfig : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandosconfig); } }; diff --git a/modules/commands/os_defcon.cpp b/modules/commands/os_defcon.cpp index f5c28d38f..47851bd89 100644 --- a/modules/commands/os_defcon.cpp +++ b/modules/commands/os_defcon.cpp @@ -342,7 +342,6 @@ class OSDefcon : public Module Implementation i[] = { I_OnReload, I_OnChannelModeSet, I_OnChannelModeUnset, I_OnPreCommand, I_OnUserConnect, I_OnChannelModeAdd, I_OnChannelCreate }; ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); - ModuleManager::RegisterService(&commandosdefcon); try { diff --git a/modules/commands/os_forbid.cpp b/modules/commands/os_forbid.cpp index ffa5503e7..f4ce7b0c8 100644 --- a/modules/commands/os_forbid.cpp +++ b/modules/commands/os_forbid.cpp @@ -217,9 +217,7 @@ class OSForbid : public Module Implementation i[] = { I_OnUserConnect, I_OnUserNickChange, I_OnJoinChannel, I_OnPreCommand, I_OnDatabaseWrite, I_OnDatabaseRead }; ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); - ModuleManager::RegisterService(&this->forbidService); - ModuleManager::RegisterService(&commandosforbid); } void OnUserConnect(dynamic_reference<User> &u, bool &exempt) diff --git a/modules/commands/os_forbid.h b/modules/commands/os_forbid.h index b91aa3be8..d7b6e1467 100644 --- a/modules/commands/os_forbid.h +++ b/modules/commands/os_forbid.h @@ -19,10 +19,10 @@ struct ForbidData ForbidType type; }; -class ForbidService : public Service +class ForbidService : public Service<ForbidService> { public: - ForbidService(Module *m) : Service(m, "forbid") { } + ForbidService(Module *m) : Service<ForbidService>(m, "forbid") { } virtual void AddForbid(ForbidData *d) = 0; diff --git a/modules/commands/os_ignore.cpp b/modules/commands/os_ignore.cpp index 9f50ec967..46286786f 100644 --- a/modules/commands/os_ignore.cpp +++ b/modules/commands/os_ignore.cpp @@ -291,12 +291,10 @@ class OSIgnore : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandosignore); Implementation i[] = { I_OnDatabaseRead, I_OnDatabaseWrite, I_OnBotPrivmsg }; ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); - ModuleManager::RegisterService(&this->osignoreservice); } EventReturn OnDatabaseRead(const std::vector<Anope::string> ¶ms) diff --git a/modules/commands/os_ignore.h b/modules/commands/os_ignore.h index 056161a79..daa8e1863 100644 --- a/modules/commands/os_ignore.h +++ b/modules/commands/os_ignore.h @@ -18,12 +18,12 @@ struct IgnoreData time_t time; /* When do we stop ignoring them? */ }; -class IgnoreService : public Service +class IgnoreService : public Service<IgnoreService> { protected: std::list<IgnoreData> ignores; - IgnoreService(Module *c, const Anope::string &n) : Service(c, n) { } + IgnoreService(Module *c, const Anope::string &n) : Service<IgnoreService>(c, n) { } public: virtual void AddIgnore(const Anope::string &mask, const Anope::string &creator, const Anope::string &reason, time_t delta = Anope::CurTime) = 0; diff --git a/modules/commands/os_jupe.cpp b/modules/commands/os_jupe.cpp index b11b975d8..54834a0a6 100644 --- a/modules/commands/os_jupe.cpp +++ b/modules/commands/os_jupe.cpp @@ -72,7 +72,6 @@ class OSJupe : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandosjupe); } }; diff --git a/modules/commands/os_kick.cpp b/modules/commands/os_kick.cpp index 341ea1ee6..95229c386 100644 --- a/modules/commands/os_kick.cpp +++ b/modules/commands/os_kick.cpp @@ -76,7 +76,6 @@ class OSKick : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandoskick); } }; diff --git a/modules/commands/os_kill.cpp b/modules/commands/os_kill.cpp index 11a0636ef..5fceb70e6 100644 --- a/modules/commands/os_kill.cpp +++ b/modules/commands/os_kill.cpp @@ -65,7 +65,6 @@ class OSKill : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandoskill); } }; diff --git a/modules/commands/os_list.cpp b/modules/commands/os_list.cpp index 9a582f97b..45179a427 100644 --- a/modules/commands/os_list.cpp +++ b/modules/commands/os_list.cpp @@ -179,8 +179,6 @@ class OSList : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandoschanlist); - ModuleManager::RegisterService(&commandosuserlist); } }; diff --git a/modules/commands/os_login.cpp b/modules/commands/os_login.cpp index 94a82e334..57c172f7f 100644 --- a/modules/commands/os_login.cpp +++ b/modules/commands/os_login.cpp @@ -70,7 +70,6 @@ class OSLogin : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandoslogin); ModuleManager::Attach(I_IsServicesOper, this); } diff --git a/modules/commands/os_mode.cpp b/modules/commands/os_mode.cpp index b3e62ca25..4b548da75 100644 --- a/modules/commands/os_mode.cpp +++ b/modules/commands/os_mode.cpp @@ -101,8 +101,6 @@ class OSMode : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandosmode); - ModuleManager::RegisterService(&commandosumode); } }; diff --git a/modules/commands/os_modinfo.cpp b/modules/commands/os_modinfo.cpp index 38d9cf905..e687c9982 100644 --- a/modules/commands/os_modinfo.cpp +++ b/modules/commands/os_modinfo.cpp @@ -31,13 +31,14 @@ class CommandOSModInfo : public Command { source.Reply(_("Module: \002%s\002 Version: \002%s\002 Author: \002%s\002 loaded: \002%s\002"), m->name.c_str(), !m->version.empty() ? m->version.c_str() : "?", !m->author.empty() ? m->author.c_str() : "?", do_strftime(m->created).c_str()); - std::vector<Anope::string> services = ModuleManager::GetServiceKeys(); - for (unsigned i = 0; i < services.size(); ++i) + std::vector<Anope::string> servicekeys = Service<Command>::GetServiceKeys(); + for (unsigned i = 0; i < servicekeys.size(); ++i) { - Service *s = ModuleManager::GetService(services[i]); - if (!s || s->owner != m) + Command *c = Service<Command>::FindService(servicekeys[i]); + if (!c || c->owner != m) continue; - source.Reply(_(" Providing service: \002%s\002"), s->name.c_str()); + + source.Reply(_(" Providing service: \002%s\002"), c->name.c_str()); for (botinfo_map::const_iterator it = BotListByNick.begin(), it_end = BotListByNick.end(); it != it_end; ++it) { @@ -47,9 +48,9 @@ class CommandOSModInfo : public Command { const Anope::string &c_name = cit->first; const CommandInfo &info = cit->second; - if (info.name != s->name) + if (info.name != c->name) continue; - source.Reply(_(" Command \002%s\002 on \002%s\002 is linked to \002%s\002"), c_name.c_str(), bi->nick.c_str(), s->name.c_str()); + source.Reply(_(" Command \002%s\002 on \002%s\002 is linked to \002%s\002"), c_name.c_str(), bi->nick.c_str(), c->name.c_str()); } } } @@ -237,8 +238,6 @@ class OSModInfo : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandosmodinfo); - ModuleManager::RegisterService(&commandosmodlist); } }; diff --git a/modules/commands/os_module.cpp b/modules/commands/os_module.cpp index 750a29bfa..7f9f1d990 100644 --- a/modules/commands/os_module.cpp +++ b/modules/commands/os_module.cpp @@ -196,9 +196,6 @@ class OSModule : public Module this->SetAuthor("Anope"); this->SetPermanent(true); - ModuleManager::RegisterService(&commandosmodload); - ModuleManager::RegisterService(&commandosmodreload); - ModuleManager::RegisterService(&commandosmodunload); } }; diff --git a/modules/commands/os_news.cpp b/modules/commands/os_news.cpp index 9c9aae0a4..227bc9380 100644 --- a/modules/commands/os_news.cpp +++ b/modules/commands/os_news.cpp @@ -376,14 +376,10 @@ class OSNews : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandoslogonnews); - ModuleManager::RegisterService(&commandosopernews); - ModuleManager::RegisterService(&commandosrandomnews); Implementation i[] = { I_OnUserModeSet, I_OnUserConnect, I_OnDatabaseRead, I_OnDatabaseWrite }; ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); - ModuleManager::RegisterService(&this->newsservice); } void OnUserModeSet(User *u, UserModeName Name) diff --git a/modules/commands/os_news.h b/modules/commands/os_news.h index c55f56d42..484c8403e 100644 --- a/modules/commands/os_news.h +++ b/modules/commands/os_news.h @@ -23,10 +23,10 @@ struct NewsItem time_t time; }; -class NewsService : public Service +class NewsService : public Service<NewsService> { public: - NewsService(Module *m) : Service(m, "news") { } + NewsService(Module *m) : Service<NewsService>(m, "news") { } virtual void AddNewsItem(NewsItem *n) = 0; diff --git a/modules/commands/os_noop.cpp b/modules/commands/os_noop.cpp index 2eec522a3..6167710d1 100644 --- a/modules/commands/os_noop.cpp +++ b/modules/commands/os_noop.cpp @@ -87,7 +87,6 @@ class OSNOOP : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandosnoop); } }; diff --git a/modules/commands/os_oline.cpp b/modules/commands/os_oline.cpp index adebc52a1..cf4686d08 100644 --- a/modules/commands/os_oline.cpp +++ b/modules/commands/os_oline.cpp @@ -76,7 +76,6 @@ class OSOLine : public Module if (!ircd || !ircd->omode) throw ModuleException("Your IRCd does not support OMODE."); - ModuleManager::RegisterService(&commandosoline); } }; diff --git a/modules/commands/os_oper.cpp b/modules/commands/os_oper.cpp index 0ef032f15..e65cb98eb 100644 --- a/modules/commands/os_oper.cpp +++ b/modules/commands/os_oper.cpp @@ -178,7 +178,6 @@ class OSOper : public Module Implementation i[] = { I_OnDatabaseWrite, I_OnDatabaseRead }; ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); - ModuleManager::RegisterService(&commandosoper); } void OnDatabaseWrite(void (*Write)(const Anope::string &)) diff --git a/modules/commands/os_reload.cpp b/modules/commands/os_reload.cpp index d4d8eac7c..48ff74d45 100644 --- a/modules/commands/os_reload.cpp +++ b/modules/commands/os_reload.cpp @@ -65,7 +65,6 @@ class OSReload : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandosreload); } }; diff --git a/modules/commands/os_session.cpp b/modules/commands/os_session.cpp index 427e4021e..a8808420c 100644 --- a/modules/commands/os_session.cpp +++ b/modules/commands/os_session.cpp @@ -728,10 +728,7 @@ class OSSession : public Module ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); ModuleManager::SetPriority(this, PRIORITY_FIRST); - ModuleManager::RegisterService(&commandossession); - ModuleManager::RegisterService(&commandosexception); - ModuleManager::RegisterService(&this->ss); } void OnUserConnect(dynamic_reference<User> &user, bool &exempt) diff --git a/modules/commands/os_session.h b/modules/commands/os_session.h index faab37934..e47fb3c51 100644 --- a/modules/commands/os_session.h +++ b/modules/commands/os_session.h @@ -1,13 +1,13 @@ #ifndef OS_SESSION_H #define OS_SESSION_H -class SessionService : public Service +class SessionService : public Service<SessionService> { public: typedef Anope::map<Session *> SessionMap; typedef std::vector<Exception *> ExceptionVector; - SessionService(Module *m) : Service(m, "session") { } + SessionService(Module *m) : Service<SessionService>(m, "session") { } virtual void AddException(Exception *e) = 0; diff --git a/modules/commands/os_set.cpp b/modules/commands/os_set.cpp index 340b463ea..20df33c78 100644 --- a/modules/commands/os_set.cpp +++ b/modules/commands/os_set.cpp @@ -254,7 +254,6 @@ class OSSet : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandosset); } }; diff --git a/modules/commands/os_shutdown.cpp b/modules/commands/os_shutdown.cpp index bc3a19353..efc55c0be 100644 --- a/modules/commands/os_shutdown.cpp +++ b/modules/commands/os_shutdown.cpp @@ -108,9 +108,6 @@ class OSShutdown : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandosquit); - ModuleManager::RegisterService(&commandosrestart); - ModuleManager::RegisterService(&commandosshutdown); } }; diff --git a/modules/commands/os_stats.cpp b/modules/commands/os_stats.cpp index 0cebe7645..813e59f5f 100644 --- a/modules/commands/os_stats.cpp +++ b/modules/commands/os_stats.cpp @@ -197,7 +197,6 @@ class OSStats : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandosstats); } }; diff --git a/modules/commands/os_svsnick.cpp b/modules/commands/os_svsnick.cpp index dc7c77a6c..65aad5094 100644 --- a/modules/commands/os_svsnick.cpp +++ b/modules/commands/os_svsnick.cpp @@ -85,7 +85,6 @@ class OSSVSNick : public Module if (!ircd || !ircd->svsnick) throw ModuleException("Your IRCd does not support SVSNICK"); - ModuleManager::RegisterService(&commandossvsnick); } }; diff --git a/modules/commands/os_sxline.cpp b/modules/commands/os_sxline.cpp index c1d620914..80ad9db8c 100644 --- a/modules/commands/os_sxline.cpp +++ b/modules/commands/os_sxline.cpp @@ -320,8 +320,11 @@ class CommandOSSNLine : public CommandOSSXLineBase void OnAdd(CommandSource &source, const std::vector<Anope::string> ¶ms) { - if (!this->xlm()) + if (!this->xlm() ||! ircd->snline) + { + source.Reply(_("Your IRCd does not support SNLINE")); return; + } User *u = source.u; unsigned last_param = 2; @@ -491,8 +494,11 @@ class CommandOSSQLine : public CommandOSSXLineBase void OnAdd(CommandSource &source, const std::vector<Anope::string> ¶ms) { - if (!this->xlm()) + if (!this->xlm() ||! ircd->sqline) + { + source.Reply(_("Your IRCd does not support SQLINE")); return; + } User *u = source.u; unsigned last_param = 2; @@ -643,11 +649,6 @@ class OSSXLine : public Module commandossnline(this), commandossqline(this) { this->SetAuthor("Anope"); - - if (ircd && ircd->snline) - ModuleManager::RegisterService(&commandossnline); - if (ircd && ircd->sqline) - ModuleManager::RegisterService(&commandossqline); } }; diff --git a/modules/commands/os_update.cpp b/modules/commands/os_update.cpp index 776835cf7..eb74a2618 100644 --- a/modules/commands/os_update.cpp +++ b/modules/commands/os_update.cpp @@ -49,7 +49,6 @@ class OSUpdate : public Module { this->SetAuthor("Anope"); - ModuleManager::RegisterService(&commandosupdate); } }; diff --git a/modules/database/db_mysql.cpp b/modules/database/db_mysql.cpp index 6eefe7365..19d41bb6e 100644 --- a/modules/database/db_mysql.cpp +++ b/modules/database/db_mysql.cpp @@ -134,8 +134,6 @@ class DBMySQL : public Module }; ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); - ModuleManager::RegisterService(&commandsqlsync); - if (CurrentUplink) OnServerConnect(); } diff --git a/modules/extra/ldap.h b/modules/extra/ldap.h index 6fbba7c11..7ac0d545f 100644 --- a/modules/extra/ldap.h +++ b/modules/extra/ldap.h @@ -111,10 +111,10 @@ class LDAPInterface virtual void OnError(const LDAPResult &err) { } }; -class LDAPProvider : public Service +class LDAPProvider : public Service<LDAPProvider> { public: - LDAPProvider(Module *c, const Anope::string &n) : Service(c, n) { } + LDAPProvider(Module *c, const Anope::string &n) : Service<LDAPProvider>(c, n) { } /** Attempt to bind to the LDAP server as an admin * @param i The LDAPInterface the result is sent to diff --git a/modules/extra/m_ldap.cpp b/modules/extra/m_ldap.cpp index 2be07ff05..e1e58417c 100644 --- a/modules/extra/m_ldap.cpp +++ b/modules/extra/m_ldap.cpp @@ -328,12 +328,6 @@ class LDAPService : public LDAPProvider, public Thread, public Condition me->Notify(); } } - - void SetExitState() - { - ModuleManager::UnregisterService(this); - Thread::SetExitState(); - } }; class ModuleLDAP : public Module, public Pipe @@ -407,7 +401,6 @@ class ModuleLDAP : public Module, public Pipe { LDAPService *ss = new LDAPService(this, connname, server, port, admin_binddn, admin_password); this->LDAPServices.insert(std::make_pair(connname, ss)); - ModuleManager::RegisterService(ss); Log(LOG_NORMAL, "ldap") << "LDAP: Successfully connected to server " << connname << " (" << server << ")"; } diff --git a/modules/extra/m_mysql.cpp b/modules/extra/m_mysql.cpp index 4e0111bfd..501e3fdff 100644 --- a/modules/extra/m_mysql.cpp +++ b/modules/extra/m_mysql.cpp @@ -225,7 +225,6 @@ class ModuleSQL : public Module, public Pipe { MySQLService *ss = new MySQLService(this, connname, database, server, user, password, port); this->MySQLServices.insert(std::make_pair(connname, ss)); - ModuleManager::RegisterService(ss); Log(LOG_NORMAL, "mysql") << "MySQL: Successfully connected to server " << connname << " (" << server << ")"; } diff --git a/modules/extra/m_ssl.cpp b/modules/extra/m_ssl.cpp index 5143d964a..2d89c078d 100644 --- a/modules/extra/m_ssl.cpp +++ b/modules/extra/m_ssl.cpp @@ -149,7 +149,6 @@ class SSLModule : public Module SSL_CTX_set_verify(client_ctx, SSL_VERIFY_PEER | SSL_VERIFY_CLIENT_ONCE, SSLModule::AlwaysAccept); SSL_CTX_set_verify(server_ctx, SSL_VERIFY_PEER | SSL_VERIFY_CLIENT_ONCE, SSLModule::AlwaysAccept); - ModuleManager::RegisterService(&this->service); ModuleManager::Attach(I_OnPreServerConnect, this); } diff --git a/modules/extra/m_xmlrpc.cpp b/modules/extra/m_xmlrpc.cpp index 38a733c7c..5a5556822 100644 --- a/modules/extra/m_xmlrpc.cpp +++ b/modules/extra/m_xmlrpc.cpp @@ -229,7 +229,6 @@ class ModuleXMLRPC : public Module { me = this; - ModuleManager::RegisterService(&this->xmlrpcinterface); Implementation i[] = { I_OnReload }; ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); diff --git a/modules/extra/sql.h b/modules/extra/sql.h index 5f9b8993d..bc7267ce0 100644 --- a/modules/extra/sql.h +++ b/modules/extra/sql.h @@ -108,10 +108,10 @@ class SQLInterface /** Class providing the SQL service, modules call this to execute queries */ -class SQLProvider : public Service +class SQLProvider : public Service<SQLProvider> { public: - SQLProvider(Module *c, const Anope::string &n) : Service(c, n) { } + SQLProvider(Module *c, const Anope::string &n) : Service<SQLProvider>(c, n) { } virtual void Run(SQLInterface *i, const SQLQuery &query) = 0; diff --git a/modules/extra/ssl.h b/modules/extra/ssl.h index e25251379..8261e4705 100644 --- a/modules/extra/ssl.h +++ b/modules/extra/ssl.h @@ -1,8 +1,8 @@ -class SSLService : public Service +class SSLService : public Service<SSLService> { public: - SSLService(Module *o, const Anope::string &n) : Service(o, n) { } + SSLService(Module *o, const Anope::string &n) : Service<SSLService>(o, n) { } virtual void Init(Socket *s) = 0; }; diff --git a/modules/extra/xmlrpc.h b/modules/extra/xmlrpc.h index 364617ecc..3a5c05332 100644 --- a/modules/extra/xmlrpc.h +++ b/modules/extra/xmlrpc.h @@ -55,10 +55,10 @@ class XMLRPCEvent virtual void Run(XMLRPCServiceInterface *iface, XMLRPCClientSocket *source, XMLRPCRequest *request) = 0; }; -class XMLRPCServiceInterface : public Service +class XMLRPCServiceInterface : public Service<XMLRPCServiceInterface> { public: - XMLRPCServiceInterface(Module *creator, const Anope::string &sname) : Service(creator, sname) { } + XMLRPCServiceInterface(Module *creator, const Anope::string &sname) : Service<XMLRPCServiceInterface>(creator, sname) { } virtual void Register(XMLRPCEvent *event) = 0; diff --git a/modules/pseudoclients/global.cpp b/modules/pseudoclients/global.cpp index c7ccf9209..7bc002fc0 100644 --- a/modules/pseudoclients/global.cpp +++ b/modules/pseudoclients/global.cpp @@ -57,8 +57,6 @@ class GlobalCore : public Module if (Global == NULL) throw ModuleException("No bot named " + Config->Global); - ModuleManager::RegisterService(&this->myglobalservice); - Implementation i[] = { I_OnRestart, I_OnShutdown, I_OnNewServer, I_OnPreHelp }; ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); } diff --git a/modules/pseudoclients/global.h b/modules/pseudoclients/global.h index 454e879c2..364834e73 100644 --- a/modules/pseudoclients/global.h +++ b/modules/pseudoclients/global.h @@ -1,10 +1,10 @@ #ifndef GLOBAL_H #define GLOBAL_H -class GlobalService : public Service +class GlobalService : public Service<GlobalService> { public: - GlobalService(Module *m) : Service(m, "Global") { } + GlobalService(Module *m) : Service<GlobalService>(m, "Global") { } /** Send out a global message to all users * @param sender Our client which should send the global diff --git a/modules/pseudoclients/memoserv.cpp b/modules/pseudoclients/memoserv.cpp index eb8af114f..987dec16b 100644 --- a/modules/pseudoclients/memoserv.cpp +++ b/modules/pseudoclients/memoserv.cpp @@ -172,8 +172,6 @@ class MemoServCore : public Module Implementation i[] = { I_OnNickIdentify, I_OnJoinChannel, I_OnUserAway, I_OnNickUpdate, I_OnPreHelp, I_OnPostHelp }; ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); - - ModuleManager::RegisterService(&this->mymemoserv); } void OnNickIdentify(User *u) diff --git a/modules/pseudoclients/memoserv.h b/modules/pseudoclients/memoserv.h index 0bf0c79ca..ab608326a 100644 --- a/modules/pseudoclients/memoserv.h +++ b/modules/pseudoclients/memoserv.h @@ -1,7 +1,7 @@ #ifndef MEMOSERV_H #define MEMOSERV_H -class MemoServService : public Service +class MemoServService : public Service<MemoServService> { public: enum MemoResult @@ -12,7 +12,7 @@ class MemoServService : public Service MEMO_TARGET_FULL }; - MemoServService(Module *m) : Service(m, "MemoServ") { } + MemoServService(Module *m) : Service<MemoServService>(m, "MemoServ") { } /** Retrieve the memo info for a nick or channel * @param target Target diff --git a/modules/pseudoclients/nickserv.cpp b/modules/pseudoclients/nickserv.cpp index c31590881..14067b712 100644 --- a/modules/pseudoclients/nickserv.cpp +++ b/modules/pseudoclients/nickserv.cpp @@ -149,8 +149,6 @@ class NickServCore : public Module Implementation i[] = { I_OnDelNick, I_OnDelCore, I_OnChangeCoreDisplay, I_OnNickIdentify, I_OnNickGroup, I_OnNickUpdate, I_OnUserNickChange, I_OnPreHelp, I_OnPostHelp }; ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); - - ModuleManager::RegisterService(&this->mynickserv); } void OnDelNick(NickAlias *na) diff --git a/modules/pseudoclients/nickserv.h b/modules/pseudoclients/nickserv.h index b58dbd65f..1619fac2d 100644 --- a/modules/pseudoclients/nickserv.h +++ b/modules/pseudoclients/nickserv.h @@ -1,10 +1,10 @@ #ifndef NICKSERV_H #define NICKSERV_H -class NickServService : public Service +class NickServService : public Service<NickServService> { public: - NickServService(Module *m) : Service(m, "NickServ") { } + NickServService(Module *m) : Service<NickServService>(m, "NickServ") { } virtual void Validate(User *u) = 0; }; diff --git a/modules/pseudoclients/operserv.cpp b/modules/pseudoclients/operserv.cpp index 9bc830335..2cf4d2a28 100644 --- a/modules/pseudoclients/operserv.cpp +++ b/modules/pseudoclients/operserv.cpp @@ -269,10 +269,6 @@ class OperServCore : public Module Implementation i[] = { I_OnBotPrivmsg, I_OnServerQuit, I_OnUserModeSet, I_OnUserModeUnset, I_OnUserConnect, I_OnUserNickChange, I_OnPreHelp }; ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); - ModuleManager::RegisterService(&sglines); - ModuleManager::RegisterService(&sqlines); - ModuleManager::RegisterService(&snlines); - /* Yes, these are in this order for a reason. Most violent->least violent. */ XLineManager::RegisterXLineManager(&sglines); XLineManager::RegisterXLineManager(&sqlines); diff --git a/src/access.cpp b/src/access.cpp index 9eb014b56..b9b3e1e9a 100644 --- a/src/access.cpp +++ b/src/access.cpp @@ -19,7 +19,7 @@ enum ACCESS_FOUNDER = 10001 }; -AccessProvider::AccessProvider(Module *o, const Anope::string &n) : Service(o, n) +AccessProvider::AccessProvider(Module *o, const Anope::string &n) : Service<AccessProvider>(o, n) { } diff --git a/src/command.cpp b/src/command.cpp index 8a564e91a..e9da36ac2 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -55,7 +55,7 @@ void CommandSource::DoReply() } } -Command::Command(Module *o, const Anope::string &sname, size_t min_params, size_t max_params) : Service(o, sname), Flags<CommandFlag>(CommandFlagStrings), MaxParams(max_params), MinParams(min_params), module(owner) +Command::Command(Module *o, const Anope::string &sname, size_t min_params, size_t max_params) : Service<Command>(o, sname), Flags<CommandFlag>(CommandFlagStrings), MaxParams(max_params), MinParams(min_params), module(owner) { } diff --git a/src/config.cpp b/src/config.cpp index bf32bce5f..28a0b6a9c 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -108,8 +108,6 @@ ServerConfig::ServerConfig() : config_data(), NSDefFlags(NickCoreFlagStrings), C this->CSDefFlags.SetFlag(CI_SIGNKICK); else if (option.equals_ci("signkicklevel")) this->CSDefFlags.SetFlag(CI_SIGNKICK_LEVEL); - else if (option.equals_ci("opnotice")) - this->CSDefFlags.SetFlag(CI_OPNOTICE); else if (option.equals_ci("peace")) this->CSDefFlags.SetFlag(CI_PEACE); else if (option.equals_ci("persist")) diff --git a/src/modulemanager.cpp b/src/modulemanager.cpp index b2907e467..d42bc7d75 100644 --- a/src/modulemanager.cpp +++ b/src/modulemanager.cpp @@ -9,7 +9,6 @@ #include "modules.h" #include <algorithm> // std::find -std::map<Anope::string, Service *> ModuleManager::ServiceProviders; std::vector<Module *> ModuleManager::EventHandlers[I_END]; void ModuleManager::CleanupRuntimeDirectory() @@ -498,46 +497,3 @@ void ModuleManager::UnloadAll() } } -/** Register a service - * @oaram s The service - * @return true if it was successfully registeed, else false (service name colision) - */ -bool ModuleManager::RegisterService(Service *s) -{ - return ModuleManager::ServiceProviders.insert(std::make_pair(s->name, s)).second; -} - -/** Unregister a service - * @param s The service - * @return true if it was unregistered successfully - */ -bool ModuleManager::UnregisterService(Service *s) -{ - return ModuleManager::ServiceProviders.erase(s->name); -} - -/** Get a service - * @param name The service name - * @param s The service - * @return The service - */ -Service *ModuleManager::GetService(const Anope::string &name) -{ - std::map<Anope::string, Service *>::const_iterator it = ModuleManager::ServiceProviders.find(name); - - if (it != ModuleManager::ServiceProviders.end()) - return it->second; - return NULL; -} - -/** Get the existing service key names - * @return The keys - */ -std::vector<Anope::string> ModuleManager::GetServiceKeys() -{ - std::vector<Anope::string> keys; - for (std::map<Anope::string, Service *>::const_iterator it = ModuleManager::ServiceProviders.begin(), it_end = ModuleManager::ServiceProviders.end(); it != it_end; ++it) - keys.push_back(it->first); - return keys; -} - diff --git a/src/modules.cpp b/src/modules.cpp index 241054715..84ef6bcb8 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -65,12 +65,3 @@ std::vector<Message *> Anope::FindMessage(const Anope::string &name) return messages; } -Service::Service(Module *o, const Anope::string &n) : owner(o), name(n) -{ -} - -Service::~Service() -{ - ModuleManager::UnregisterService(this); -} - diff --git a/src/operserv.cpp b/src/operserv.cpp index 2eb616aad..b17f9e0ad 100644 --- a/src/operserv.cpp +++ b/src/operserv.cpp @@ -68,7 +68,7 @@ sockaddrs XLine::GetIP() const /** Constructor */ -XLineManager::XLineManager(Module *creator, const Anope::string &xname, char t) : Service(creator, xname), type(t) +XLineManager::XLineManager(Module *creator, const Anope::string &xname, char t) : Service<XLineManager>(creator, xname), type(t) { } |