]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Automatically register ServiceProviders created by modules
authorattilamolnar <attilamolnar@hush.com>
Sun, 26 May 2013 17:44:13 +0000 (19:44 +0200)
committerattilamolnar <attilamolnar@hush.com>
Sun, 8 Sep 2013 15:11:08 +0000 (17:11 +0200)
130 files changed:
include/base.h
include/inspircd.h
include/listmode.h
include/modules.h
include/modules/cap.h
src/commands/cmd_dns.cpp
src/commands/cmd_hostname_lookup.cpp
src/commands/cmd_lusers.cpp
src/commands/cmd_privmsg.cpp
src/commands/cmd_whowas.cpp
src/listmode.cpp
src/modmanager_dynamic.cpp
src/modmanager_static.cpp
src/modules.cpp
src/modules/extra/m_geoip.cpp
src/modules/extra/m_ldapauth.cpp
src/modules/extra/m_mssql.cpp
src/modules/extra/m_regex_pcre.cpp
src/modules/extra/m_regex_posix.cpp
src/modules/extra/m_regex_re2.cpp
src/modules/extra/m_regex_stdlib.cpp
src/modules/extra/m_regex_tre.cpp
src/modules/extra/m_ssl_gnutls.cpp
src/modules/extra/m_ssl_openssl.cpp
src/modules/m_allowinvite.cpp
src/modules/m_alltime.cpp
src/modules/m_auditorium.cpp
src/modules/m_autoop.cpp
src/modules/m_banexception.cpp
src/modules/m_banredirect.cpp
src/modules/m_blockamsg.cpp
src/modules/m_blockcaps.cpp
src/modules/m_blockcolor.cpp
src/modules/m_botmode.cpp
src/modules/m_callerid.cpp
src/modules/m_cap.cpp
src/modules/m_cban.cpp
src/modules/m_censor.cpp
src/modules/m_cgiirc.cpp
src/modules/m_chanfilter.cpp
src/modules/m_chanhistory.cpp
src/modules/m_check.cpp
src/modules/m_chghost.cpp
src/modules/m_chgident.cpp
src/modules/m_chgname.cpp
src/modules/m_cloaking.cpp
src/modules/m_clones.cpp
src/modules/m_close.cpp
src/modules/m_commonchans.cpp
src/modules/m_conn_waitpong.cpp
src/modules/m_customtitle.cpp
src/modules/m_cycle.cpp
src/modules/m_dccallow.cpp
src/modules/m_deaf.cpp
src/modules/m_delayjoin.cpp
src/modules/m_delaymsg.cpp
src/modules/m_devoice.cpp
src/modules/m_dnsbl.cpp
src/modules/m_exemptchanops.cpp
src/modules/m_filter.cpp
src/modules/m_globalload.cpp
src/modules/m_globops.cpp
src/modules/m_helpop.cpp
src/modules/m_hidechans.cpp
src/modules/m_hideoper.cpp
src/modules/m_httpd.cpp
src/modules/m_ident.cpp
src/modules/m_inviteexception.cpp
src/modules/m_joinflood.cpp
src/modules/m_jumpserver.cpp
src/modules/m_kicknorejoin.cpp
src/modules/m_knock.cpp
src/modules/m_lockserv.cpp
src/modules/m_md5.cpp
src/modules/m_messageflood.cpp
src/modules/m_mlock.cpp
src/modules/m_namedmodes.cpp
src/modules/m_nickflood.cpp
src/modules/m_nicklock.cpp
src/modules/m_noctcp.cpp
src/modules/m_nokicks.cpp
src/modules/m_nonicks.cpp
src/modules/m_nonotice.cpp
src/modules/m_ojoin.cpp
src/modules/m_operchans.cpp
src/modules/m_opermotd.cpp
src/modules/m_operprefix.cpp
src/modules/m_password_hash.cpp
src/modules/m_permchannels.cpp
src/modules/m_redirect.cpp
src/modules/m_regex_glob.cpp
src/modules/m_remove.cpp
src/modules/m_repeat.cpp
src/modules/m_ripemd160.cpp
src/modules/m_rline.cpp
src/modules/m_rmode.cpp
src/modules/m_sajoin.cpp
src/modules/m_sakick.cpp
src/modules/m_samode.cpp
src/modules/m_sanick.cpp
src/modules/m_sapart.cpp
src/modules/m_saquit.cpp
src/modules/m_sasl.cpp
src/modules/m_satopic.cpp
src/modules/m_services_account.cpp
src/modules/m_servprotect.cpp
src/modules/m_sethost.cpp
src/modules/m_setident.cpp
src/modules/m_setidle.cpp
src/modules/m_setname.cpp
src/modules/m_sha256.cpp
src/modules/m_showwhois.cpp
src/modules/m_shun.cpp
src/modules/m_silence.cpp
src/modules/m_spanningtree/main.cpp
src/modules/m_spanningtree/servercommand.cpp
src/modules/m_sqlauth.cpp
src/modules/m_sslinfo.cpp
src/modules/m_sslmodes.cpp
src/modules/m_stripcolor.cpp
src/modules/m_svshold.cpp
src/modules/m_swhois.cpp
src/modules/m_testnet.cpp
src/modules/m_timedbans.cpp
src/modules/m_tline.cpp
src/modules/m_topiclock.cpp
src/modules/m_uninvite.cpp
src/modules/m_userip.cpp
src/modules/m_vhost.cpp
src/modules/m_watch.cpp

index c6d361576f8772a663c18e9d079f2708806ee1ac..86aa2769fc3112956b3666a24708637c1720e8dc 100644 (file)
@@ -249,8 +249,11 @@ class CoreExport ServiceProvider : public classbase
        const std::string name;
        /** Type of service (must match object type) */
        const ServiceType service;
-       ServiceProvider(Module* Creator, const std::string& Name, ServiceType Type)
-               : creator(Creator), name(Name), service(Type) {}
+       ServiceProvider(Module* Creator, const std::string& Name, ServiceType Type);
        virtual ~ServiceProvider();
+
+       /** If called, this ServiceProvider won't be registered automatically
+        */
+       void DisableAutoRegister();
 };
 
index 694869423222b4e03ce3b85dfe85923b1d1fbbcb..2e4b02fac91d095c889e3fa553397aa9b25dc78c 100644 (file)
@@ -714,11 +714,6 @@ class CommandModule : public Module
        {
        }
 
-       void init()
-       {
-               ServerInstance->Modules->AddService(cmd);
-       }
-
        Version GetVersion()
        {
                return Version(cmd.name, VF_VENDOR|VF_CORE);
index e27071eacbb75d30fd2d89de54f9b4da2d00719b..e6ca88d4c1d70c078e4a0443d354bb87619b948f 100644 (file)
@@ -157,10 +157,6 @@ class CoreExport ListModeBase : public ModeHandler
         */
        virtual void DoRehash();
 
-       /** Populate the Implements list with the correct events for a List Mode
-        */
-       virtual void DoImplements(Module* m);
-
        /** Handle the list mode.
         * See mode.h
         */
index 1d9d16f264572b8222a1f6752015a7ddc0677a4a..e8f0d10fe4926d24f8fea1cf057e5c20b0ec1163 100644 (file)
@@ -1168,6 +1168,9 @@ typedef IntModuleList::iterator EventHandlerIter;
  */
 class CoreExport ModuleManager
 {
+ public:
+       typedef std::vector<ServiceProvider*> ServiceList;
+
  private:
        /** Holds a string describing the last module error to occur
         */
@@ -1189,7 +1192,7 @@ class CoreExport ModuleManager
 
        /** Loads all core modules (cmd_*)
         */
-       void LoadCoreModules();
+       void LoadCoreModules(std::map<std::string, ServiceList>& servicemap);
 
        /** Calls the Prioritize() method in all loaded modules
         * @return True if all went well, false if a dependency loop was detected
@@ -1207,6 +1210,16 @@ class CoreExport ModuleManager
        /** List of data services keyed by name */
        std::multimap<std::string, ServiceProvider*> DataProviders;
 
+       /** A list of ServiceProviders waiting to be registered.
+        * Non-NULL when constructing a Module, NULL otherwise.
+        * When non-NULL ServiceProviders add themselves to this list on creation and the core
+        * automatically registers them (that is, call AddService()) after the Module is constructed,
+        * and before Module::init() is called.
+        * If a service is created after the construction of the Module (for example in init()) it
+        * has to be registered manually.
+        */
+       ServiceList* NewServices;
+
        /** Simple, bog-standard, boring constructor.
         */
        ModuleManager();
@@ -1328,6 +1341,11 @@ class CoreExport ModuleManager
        /** Unregister a service provided by a module */
        void DelService(ServiceProvider&);
 
+       /** Register all services in a given ServiceList
+        * @param list The list containing the services to register
+        */
+       void AddServices(const ServiceList& list);
+
        inline void AddServices(ServiceProvider** list, int count)
        {
                for(int i=0; i < count; i++)
index 2ed8df49447603d385b9ee8d6bbf333a5346da30..7fa5fa96900c4cf900ef069811038e28aa099450 100644 (file)
@@ -45,7 +45,6 @@ class GenericCap
        const std::string cap;
        GenericCap(Module* parent, const std::string &Cap) : ext("cap_" + Cap, parent), cap(Cap)
        {
-               ServerInstance->Modules->AddService(ext);
        }
 
        void HandleEvent(Event& ev)
index f97d687832f0fefeee3a5a77c02bc1b93d63b5a4..f9ec8e9900f3e7b6e3f725a5560c698ba7ed4096 100644 (file)
@@ -795,11 +795,6 @@ class ModuleDNS : public Module
        {
        }
 
-       void init()
-       {
-               ServerInstance->Modules->AddService(this->manager);
-       }
-
        void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
        {
                std::string oldserver = DNSServer;
index f352443d0a501f5926d1223e1a91ab5b65309ca4..3287f3662d228399c87db85e4639e62d5aba26fd 100644 (file)
@@ -191,12 +191,6 @@ class ModuleHostnameLookup : public Module
                ph = &ptrHosts;
        }
 
-       void init()
-       {
-               ServerInstance->Modules->AddService(this->dnsLookup);
-               ServerInstance->Modules->AddService(this->ptrHosts);
-       }
-
        void OnUserInit(LocalUser *user)
        {
                if (!DNS || !user->MyClass->resolvehostnames)
index 06419733d4ce0c699c828039015af8b0e8864fae..63ce032d11316b7e8384aeb52b9de679cff2fdf3 100644 (file)
@@ -156,7 +156,6 @@ class ModuleLusers : public Module
 
        void init()
        {
-               ServerInstance->Modules->AddService(cmd);
                ServerInstance->Modes->AddModeWatcher(&mw);
        }
 
index ed98c771f64f967fbede63e113faef7cacc39fff..5a8e23e9b23f9bd71a4ed04aeb94a8da04257bf3 100644 (file)
@@ -269,12 +269,6 @@ class ModuleCoreMessage : public Module
        {
        }
 
-       void init()
-       {
-               ServerInstance->Modules->AddService(CommandPrivmsg);
-               ServerInstance->Modules->AddService(CommandNotice);
-       }
-
        Version GetVersion()
        {
                return Version("PRIVMSG, NOTICE", VF_CORE|VF_VENDOR);
index ea1020fbc6f798807601e97df7d199a864594bb0..175b2bdf31289394572275076b8eb1b2f286f129 100644 (file)
@@ -228,11 +228,6 @@ class ModuleWhoWas : public Module
        {
        }
 
-       void init()
-       {
-               ServerInstance->Modules->AddService(cmd);
-       }
-
        void OnGarbageCollect()
        {
                // Remove all entries older than MaxKeep
index a377f19e3293a276d2ab7e509767bdd611c61ecd..f7890f9ad8cafdf4246b7a87661f1e647fb701b8 100644 (file)
@@ -89,11 +89,6 @@ void ListModeBase::DoRehash()
        }
 }
 
-void ListModeBase::DoImplements(Module* m)
-{
-       ServerInstance->Modules->AddService(extItem);
-}
-
 unsigned int ListModeBase::FindLimit(const std::string& channame)
 {
        for (limitlist::iterator it = chanlimits.begin(); it != chanlimits.end(); ++it)
index 7789c90bf8764294438c12c4f608b4cd4bbd6d44..de2593d7236e50946fdf87a93718debca05a438c 100644 (file)
@@ -55,10 +55,14 @@ bool ModuleManager::Load(const std::string& filename, bool defer)
 
        Module* newmod = NULL;
        DLLManager* newhandle = new DLLManager(moduleFile.c_str());
+       ServiceList newservices;
+       if (!defer)
+               this->NewServices = &newservices;
 
        try
        {
                newmod = newhandle->CallInit();
+               this->NewServices = NULL;
 
                if (newmod)
                {
@@ -77,6 +81,7 @@ bool ModuleManager::Load(const std::string& filename, bool defer)
                                ConfigStatus confstatus;
 
                                AttachAll(newmod);
+                               AddServices(newservices);
                                newmod->init();
                                newmod->ReadConfig(confstatus);
 
@@ -95,6 +100,8 @@ bool ModuleManager::Load(const std::string& filename, bool defer)
        }
        catch (CoreException& modexcept)
        {
+               this->NewServices = NULL;
+
                // failure in module constructor
                if (newmod)
                {
@@ -118,7 +125,7 @@ bool ModuleManager::Load(const std::string& filename, bool defer)
 }
 
 /* We must load the modules AFTER initializing the socket engine, now */
-void ModuleManager::LoadCoreModules()
+void ModuleManager::LoadCoreModules(std::map<std::string, ServiceList>& servicemap)
 {
        std::cout << std::endl << "Loading core commands";
        fflush(stdout);
@@ -134,6 +141,8 @@ void ModuleManager::LoadCoreModules()
                                std::cout << ".";
                                fflush(stdout);
 
+                               this->NewServices = &servicemap[entry->d_name];
+
                                if (!Load(entry->d_name, true))
                                {
                                        ServerInstance->Logs->Log("MODULE", LOG_DEFAULT, this->LastError());
index 7d6c89258852a6493fabda7965e64efc4024872b..76f16fa92fd140e2594a0ab9062c70b46c99f2b2 100644 (file)
@@ -58,7 +58,6 @@ class AllModule : public Module
                        {
                                Command* c = (*i)(this);
                                cmds.push_back(c);
-                               ServerInstance->Modules->AddService(*c);
                        }
                }
                catch (...)
@@ -88,6 +87,11 @@ bool ModuleManager::Load(const std::string& name, bool defer)
        if (it == modlist->end())
                return false;
        Module* mod = NULL;
+
+       ServiceList newservices;
+       if (!defer)
+               this->NewServices = &newservices;
+
        try
        {
                mod = (*it->second->init)();
@@ -95,6 +99,7 @@ bool ModuleManager::Load(const std::string& name, bool defer)
                mod->ModuleDLLManager = NULL;
                mod->dying = false;
                Modules[name] = mod;
+               this->NewServices = NULL;
                if (defer)
                {
                        ServerInstance->Logs->Log("MODULE", LOG_DEFAULT, "New module introduced: %s", name.c_str());
@@ -105,12 +110,15 @@ bool ModuleManager::Load(const std::string& name, bool defer)
                        ConfigStatus confstatus;
 
                        AttachAll(mod);
+                       AddServices(newservices);
                        mod->init();
                        mod->ReadConfig(confstatus);
                }
        }
        catch (CoreException& modexcept)
        {
+               this->NewServices = NULL;
+
                if (mod)
                        DoSafeUnload(mod);
                ServerInstance->Logs->Log("MODULE", LOG_DEFAULT, "Unable to load " + name + ": " + modexcept.GetReason());
@@ -123,12 +131,18 @@ bool ModuleManager::Load(const std::string& name, bool defer)
        return true;
 }
 
-void ModuleManager::LoadCoreModules()
+void ModuleManager::LoadCoreModules(std::map<std::string, ServiceList>& servicemap)
 {
-       Load("cmd_all.so", true);
-       Load("cmd_whowas.so", true);
-       Load("cmd_lusers.so", true);
-       Load("cmd_privmsg.so", true);
+       for (modmap::const_iterator i = modlist->begin(); i != modlist->end(); ++i)
+       {
+               const std::string modname = i->first;
+               if (modname[0] == 'c')
+               {
+                       this->NewServices = &servicemap[modname];
+                       Load(modname, true);
+               }
+       }
+       this->NewServices = NULL;
 }
 
 #endif
index 15e3930997a7b6ae8ba9625bf74356a9fddd57d4..8255049b177d1d037e2945bf700140d32ced2eb5 100644 (file)
@@ -163,6 +163,24 @@ ModResult   Module::OnAcceptConnection(int, ListenSocket*, irc::sockets::sockadd
 void           Module::OnSendWhoLine(User*, const std::vector<std::string>&, User*, std::string&) { DetachEvent(I_OnSendWhoLine); }
 void           Module::OnSetUserIP(LocalUser*) { DetachEvent(I_OnSetUserIP); }
 
+ServiceProvider::ServiceProvider(Module* Creator, const std::string& Name, ServiceType Type)
+       : creator(Creator), name(Name), service(Type)
+{
+       if ((ServerInstance) && (ServerInstance->Modules->NewServices))
+               ServerInstance->Modules->NewServices->push_back(this);
+}
+
+void ServiceProvider::DisableAutoRegister()
+{
+       if ((ServerInstance) && (ServerInstance->Modules->NewServices))
+       {
+               ModuleManager::ServiceList& list = *ServerInstance->Modules->NewServices;
+               ModuleManager::ServiceList::iterator it = std::find(list.begin(), list.end(), this);
+               if (it != list.end())
+                       list.erase(it);
+       }
+}
+
 ModuleManager::ModuleManager()
 {
 }
@@ -494,13 +512,15 @@ void ModuleManager::Reload(Module* mod, HandlerBase1<void, bool>* callback)
 
 void ModuleManager::LoadAll()
 {
-       LoadCoreModules();
+       std::map<std::string, ServiceList> servicemap;
+       LoadCoreModules(servicemap);
 
        ConfigTagList tags = ServerInstance->Config->ConfTags("module");
        for (ConfigIter i = tags.first; i != tags.second; ++i)
        {
                ConfigTag* tag = i->second;
                std::string name = tag->getString("name");
+               this->NewServices = &servicemap[name];
                std::cout << "[" << con_green << "*" << con_reset << "] Loading module:\t" << con_green << name << con_reset << std::endl;
 
                if (!this->Load(name, true))
@@ -520,6 +540,7 @@ void ModuleManager::LoadAll()
                {
                        ServerInstance->Logs->Log("MODULE", LOG_DEBUG, "Initializing %s", i->first.c_str());
                        AttachAll(mod);
+                       AddServices(servicemap[i->first]);
                        mod->init();
                        mod->ReadConfig(confstatus);
                }
@@ -541,6 +562,15 @@ std::string& ModuleManager::LastError()
        return LastModuleError;
 }
 
+void ModuleManager::AddServices(const ServiceList& list)
+{
+       for (ServiceList::const_iterator i = list.begin(); i != list.end(); ++i)
+       {
+               ServiceProvider& s = **i;
+               AddService(s);
+       }
+}
+
 void ModuleManager::AddService(ServiceProvider& item)
 {
        switch (item.service)
index 50df9fc26827742cece87819e80ad152a066a413..142c5fbcfc1c14477fca78df1ab2f24d1211175f 100644 (file)
@@ -56,8 +56,6 @@ class ModuleGeoIP : public Module
                if (gi == NULL)
                                throw ModuleException("Unable to initialize geoip, are you missing GeoIP.dat?");
 
-               ServerInstance->Modules->AddService(ext);
-
                for (LocalUserList::const_iterator i = ServerInstance->Users->local_users.begin(); i != ServerInstance->Users->local_users.end(); ++i)
                {
                        LocalUser* user = *i;
index 827179f84ebb0c225d39ff262cc1c5baf82968c5..d1690850d579d18d0e34e86117a6cf7bc38fb661 100644 (file)
@@ -118,12 +118,6 @@ public:
                conn = NULL;
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(ldapAuthed);
-               ServerInstance->Modules->AddService(ldapVhost);
-       }
-
        ~ModuleLDAPAuth()
        {
                if (conn)
index 84e02be98ca8351bd837c9ebe5091c385193dd4c..8f8fe080fbd2c99483c56e8b4bebacf59e6b928e 100644 (file)
@@ -656,8 +656,6 @@ class ModuleMsSQL : public Module
                ReadConf();
 
                ServerInstance->Threads->Start(queryDispatcher);
-
-               ServerInstance->Modules->AddService(sqlserv);
        }
 
        ~ModuleMsSQL()
index 91c2d1404d20a33c1c69cd1c5049f3eca1b7d004..9ae6719ba96a89d35adc9d67ca7d5c5f7bd6932f 100644 (file)
@@ -73,7 +73,6 @@ class ModuleRegexPCRE : public Module
        PCREFactory ref;
        ModuleRegexPCRE() : ref(this)
        {
-               ServerInstance->Modules->AddService(ref);
        }
 
        Version GetVersion() CXX11_OVERRIDE
index bde5c39475ec428452b32fa7ab5f7b51452232f3..b5fddfab8f2c0e748aa35cb22fcc861bc2eeb90f 100644 (file)
@@ -78,7 +78,6 @@ class ModuleRegexPOSIX : public Module
  public:
        ModuleRegexPOSIX() : ref(this)
        {
-               ServerInstance->Modules->AddService(ref);
        }
 
        Version GetVersion() CXX11_OVERRIDE
index 2525b70abba9f2c98a4d0bc0944066682717b111..544e3060e26aa74d3eaf1e57bfef57f0e7d9fd6f 100644 (file)
@@ -66,7 +66,6 @@ class ModuleRegexRE2 : public Module
  public:
        ModuleRegexRE2() : ref(this)
        {
-               ServerInstance->Modules->AddService(ref);
        }
 
        Version GetVersion() CXX11_OVERRIDE
index 2f75a60a870302a0812018329655832f65d2e511..8e7bd0da25f99375ca7ab2b5304dc44c89805aa2 100644 (file)
@@ -61,7 +61,6 @@ public:
        StdRegexFactory ref;
        ModuleRegexStd() : ref(this)
        {
-               ServerInstance->Modules->AddService(ref);
        }
 
        Version GetVersion() CXX11_OVERRIDE
index 92f2ad9900d93db92ead68be161c48128a3c92d7..8a1d5424880d6d479ea9286494a2a0ec921f5433 100644 (file)
@@ -80,7 +80,6 @@ class ModuleRegexTRE : public Module
  public:
        ModuleRegexTRE() : trf(this)
        {
-               ServerInstance->Modules->AddService(trf);
        }
 
        Version GetVersion() CXX11_OVERRIDE
index 9f21d6d281397d2fb235a1caf43a1f724d3b4fa9..5c30d6f57b604b3108f0fd1fea2055519a9ed2dd 100644 (file)
@@ -633,9 +633,6 @@ class ModuleSSLGnuTLS : public Module
 
                // Void return, guess we assume success
                gnutls_certificate_set_dh_params(iohook.x509_cred, dh_params);
-
-               ServerInstance->Modules->AddService(iohook);
-               ServerInstance->Modules->AddService(starttls);
        }
 
        void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
index 0957b5912f16c7a444b01f01e455b211b64eac84..7acbcfc187534e39290bf380b43a8f03c98eea36 100644 (file)
@@ -490,7 +490,6 @@ class ModuleSSLOpenSSL : public Module
        {
                // Needs the flag as it ignores a plain /rehash
                OnModuleRehash(NULL,"ssl");
-               ServerInstance->Modules->AddService(iohook);
        }
 
        void OnHookIO(StreamSocket* user, ListenSocket* lsb) CXX11_OVERRIDE
index a33bee83276850572859b61850982e760b52dc37..f4b2f14d4612c986319b3caba4798d4552bd5a7d 100644 (file)
@@ -34,11 +34,6 @@ class ModuleAllowInvite : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(ni);
-       }
-
        void On005Numeric(std::map<std::string, std::string>& tokens) CXX11_OVERRIDE
        {
                tokens["EXTBAN"].push_back('A');
index dac3a4c8e38c0f5ab1e18fa55758197dc6adec32..58f7c4fb5a484f4076a661f10c8f8371f6d38091 100644 (file)
@@ -58,11 +58,6 @@ class Modulealltime : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(mycommand);
-       }
-
        Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Display timestamps from all servers connected to the network", VF_OPTCOMMON | VF_VENDOR);
index 00227c66e8e9e5e8dbd8f39db440ac50861290d6..0adfe77aabd69e94c2dc5336e2225d9f92689229 100644 (file)
@@ -51,11 +51,6 @@ class ModuleAuditorium : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(aum);
-       }
-
        void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
        {
                ConfigTag* tag = ServerInstance->Config->ConfValue("auditorium");
index 32e0971882c012f9a8df32b45ea11f7a34caa8fa..8ecee9578c4c1d35797c9de74eaa6563f381ccbd 100644 (file)
@@ -85,12 +85,6 @@ class ModuleAutoOp : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(mh);
-               mh.DoImplements(this);
-       }
-
        void OnPostJoin(Membership *memb) CXX11_OVERRIDE
        {
                if (!IS_LOCAL(memb->user))
index ad42449451c665dff817278a166af03e597bc226..62742a527b22d631db2e49005ba79f592d083a8e 100644 (file)
@@ -51,13 +51,6 @@ class ModuleBanException : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(be);
-
-               be.DoImplements(this);
-       }
-
        void On005Numeric(std::map<std::string, std::string>& tokens) CXX11_OVERRIDE
        {
                tokens["EXCEPTS"] = "e";
index 73d8270d1b098452caa55dc9fc1c886bba7825bd..7ba54a9f5616ea5e7f1c079a0cfa0873144884ae 100644 (file)
@@ -232,7 +232,6 @@ class ModuleBanRedirect : public Module
        void init() CXX11_OVERRIDE
        {
                ServerInstance->Modes->AddModeWatcher(&re);
-               ServerInstance->Modules->AddService(re.extItem);
        }
 
        void OnCleanup(int target_type, void* item) CXX11_OVERRIDE
index 963f94fc299a45fc3baf7b32af7058ead25c6335..833828233e7f6a89db5846b5b4c07db5d8b764d5 100644 (file)
@@ -57,11 +57,6 @@ class ModuleBlockAmsg : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(blockamsg);
-       }
-
        Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Attempt to block /amsg, at least some of the irritating mIRC scripts.",VF_VENDOR);
index c3c8b2297bab151937b7ba073d08a92ca48faa51..afc559d76e1a63f05139926b2589d6d413d85504 100644 (file)
@@ -43,11 +43,6 @@ public:
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(bc);
-       }
-
        void On005Numeric(std::map<std::string, std::string>& tokens) CXX11_OVERRIDE
        {
                tokens["EXTBAN"].push_back('B');
index 6e04e53da3c022cf7e7a7b7341474f45b72f889e..cfad33268a5bd8601482947422bf354dcf6e7172 100644 (file)
@@ -40,11 +40,6 @@ class ModuleBlockColor : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(bc);
-       }
-
        void On005Numeric(std::map<std::string, std::string>& tokens) CXX11_OVERRIDE
        {
                tokens["EXTBAN"].push_back('c');
index 7c2794789bf18b059154794f19166abee4b1d2ba..3702284884ab349617618a78f096150e7a46aa4c 100644 (file)
@@ -38,11 +38,6 @@ class ModuleBotMode : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(bm);
-       }
-
        Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Provides user mode +B to mark the user as a bot",VF_VENDOR);
index de74773ad5784c9d9ff8556bf0868805b25eab4f..4038639e6562d52fe9149c0a5e945b77cbf46cf7 100644 (file)
@@ -361,13 +361,6 @@ public:
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(myumode);
-               ServerInstance->Modules->AddService(cmd);
-               ServerInstance->Modules->AddService(cmd.extInfo);
-       }
-
        Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Implementation of callerid, usermode +g, /accept", VF_COMMON | VF_VENDOR);
index 35c24fd23c4aca0b84233452ccd33da46c101477..21b2e5a7c25b8f32de61c7cdd2f74cabe7dfee3f 100644 (file)
@@ -125,12 +125,6 @@ class ModuleCAP : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(cmd);
-               ServerInstance->Modules->AddService(cmd.reghold);
-       }
-
        ModResult OnCheckReady(LocalUser* user) CXX11_OVERRIDE
        {
                /* Users in CAP state get held until CAP END */
index 39a5d6266bbefcc0ce39aafa8ed8c83b10b53054..263426f60bf665326a952bfca39ff8a27789340c 100644 (file)
@@ -157,8 +157,6 @@ class ModuleCBan : public Module
        void init() CXX11_OVERRIDE
        {
                ServerInstance->XLines->RegisterFactory(&f);
-
-               ServerInstance->Modules->AddService(mycommand);
        }
 
        ~ModuleCBan()
index fe0321ab1db2c3b53acfd00e2fc59dde91d0bbe5..a4c3c86c057b4fd54946c109daabda7413b7bd63 100644 (file)
@@ -53,12 +53,6 @@ class ModuleCensor : public Module
  public:
        ModuleCensor() : cu(this), cc(this) { }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(cu);
-               ServerInstance->Modules->AddService(cc);
-       }
-
        // format of a config entry is <badword text="shit" replace="poo">
        ModResult OnUserPreMessage(User* user, void* dest, int target_type, std::string& text, char status, CUList& exempt_list, MessageType msgtype) CXX11_OVERRIDE
        {
index 9fbc77850e82e4b089a7bea8f27f7bc958c42d91..9e67a4f0882a662f9466976553396640c24f26fc 100644 (file)
@@ -234,12 +234,6 @@ public:
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServiceProvider* providerlist[] = { &cmd, &cmd.realhost, &cmd.realip, &cmd.webirc_hostname, &cmd.webirc_ip, &waiting };
-               ServerInstance->Modules->AddServices(providerlist, sizeof(providerlist)/sizeof(ServiceProvider*));
-       }
-
        void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
        {
                cmd.Hosts.clear();
index 3a7ad90572a402ade49396602e23165ea3c0b99c..dc5718bde1361328564de4c02ea771c97e79ce8c 100644 (file)
@@ -75,13 +75,6 @@ class ModuleChanFilter : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(cf);
-
-               cf.DoImplements(this);
-       }
-
        void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
        {
                hidemask = ServerInstance->Config->ConfValue("chanfilter")->getBool("hidemask");
index 0e0841f6760a916d051afe2289882a764e4fe868..24c6237b3812b6d7e9a18426d2563381ef6c4944 100644 (file)
@@ -114,12 +114,6 @@ class ModuleChanHistory : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(m);
-               ServerInstance->Modules->AddService(m.ext);
-       }
-
        void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
        {
                ConfigTag* tag = ServerInstance->Config->ConfValue("chanhistory");
index 25835297904c74973e60c59a3aca71387e2f2cdc..cf99e640419682b0e57f039399c92028876165b6 100644 (file)
@@ -268,11 +268,6 @@ class ModuleCheck : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(mycommand);
-       }
-
        void ProtoSendMode(void* uv, TargetTypeFlags, void*, const std::vector<std::string>& result, const std::vector<TranslateType>&)
        {
                User* user = (User*)uv;
index 4d8223d137d29cdcad7dc48cb964478b232cc746..1748f516c9ef4704f4d4ff808c044101c2cd3c9f 100644 (file)
@@ -94,11 +94,6 @@ class ModuleChgHost : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(cmd);
-       }
-
        void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
        {
                std::string hmap = ServerInstance->Config->ConfValue("hostname")->getString("charmap", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.-_/0123456789");
index b9de3e45bbf97e0d2472522313908cd2dffd1264..6960a3ad855829de04ba4e3d985199adda151670 100644 (file)
@@ -86,11 +86,6 @@ public:
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(cmd);
-       }
-
        Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Provides support for the CHGIDENT command", VF_OPTCOMMON | VF_VENDOR);
index efcce15902c1e6f45706a306945e6a126bf4860f..73381e719d4ac993e79c03f54486ec8497816420 100644 (file)
@@ -82,11 +82,6 @@ public:
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(cmd);
-       }
-
        Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Provides support for the CHGNAME command", VF_OPTCOMMON | VF_VENDOR);
index bef4e94b82ab2982937dcb85cd0541238a640dda..4c2c56318c96e85072e986ad56544cc048ed067b 100644 (file)
@@ -146,13 +146,6 @@ class ModuleCloaking : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(cu);
-               ServerInstance->Modules->AddService(ck);
-               ServerInstance->Modules->AddService(cu.ext);
-       }
-
        /** This function takes a domain name string and returns just the last two domain parts,
         * or the last domain part if only two are available. Failing that it just returns what it was given.
         *
index ecdea5be080148a4812956eb2f11668802fd9b0c..1f505e9a21dbc4d3a0e7b1463e174ea879cce298 100644 (file)
@@ -69,11 +69,6 @@ class ModuleClones : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(cmd);
-       }
-
        Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Provides the /CLONES command to retrieve information on clones.", VF_VENDOR);
index 806a88640fcae54af7d566b95baa2295629decb8..0583eb20170be8f14a670951eba6ec05bfa7a809 100644 (file)
@@ -70,11 +70,6 @@ class ModuleClose : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(cmd);
-       }
-
        Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Provides /CLOSE functionality", VF_VENDOR);
index 5871f5f9dfada6aa47ef335dbd97cfdbb61fb964..816c3acdac8e8c1701dc9cea1e9c3397f321e6c2 100644 (file)
@@ -35,11 +35,6 @@ class ModulePrivacyMode : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(pm);
-       }
-
        Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Adds user mode +c, which if set, users must be on a common channel with you to private message you", VF_VENDOR);
index 76f41c4bf7919f7377e150293ca2285e93a093d0..496b04c2d4cb7d0b403af607e79e2013bd56c750 100644 (file)
@@ -36,11 +36,6 @@ class ModuleWaitPong : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(ext);
-       }
-
        void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
        {
                ConfigTag* tag = ServerInstance->Config->ConfValue("waitpong");
index 5a3a925a31dc42c68b4047fa7ac224e52c56f766..67000e98e5a47b6928d4a77b0deb5b81d03fff59 100644 (file)
@@ -79,12 +79,6 @@ class ModuleCustomTitle : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(cmd);
-               ServerInstance->Modules->AddService(cmd.ctitle);
-       }
-
        // :kenny.chatspike.net 320 Brain Azhrarn :is getting paid to play games.
        ModResult OnWhoisLine(User* user, User* dest, int &numeric, std::string &text) CXX11_OVERRIDE
        {
index 61deaf58b05093fffdd77bf572a5338fc65837e8..4a7b0f64421acb1e4bfabd1ec573a545ea5dc18b 100644 (file)
@@ -88,11 +88,6 @@ class ModuleCycle : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(cmd);
-       }
-
        Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Provides command CYCLE, acts as a server-side HOP command to part and rejoin a channel.", VF_VENDOR);
index 169ba720326108dd1d22595a727cc170c121dc16..c6cb096452dabda7b5260ff3a3826c19834ac4af 100644 (file)
@@ -257,7 +257,6 @@ class ModuleDCCAllow : public Module
        {
                ext = new SimpleExtItem<dccallowlist>("dccallow", this);
                ServerInstance->Modules->AddService(*ext);
-               ServerInstance->Modules->AddService(cmd);
        }
 
        void OnUserQuit(User* user, const std::string &reason, const std::string &oper_message) CXX11_OVERRIDE
index 3fdd2533eae9c2da8077b10b6fd5c7931aa1759b..468f1046ab8616ecfec3332c8e5cd1b5d95b9c8a 100644 (file)
@@ -53,11 +53,6 @@ class ModuleDeaf : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(m1);
-       }
-
        void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
        {
                ConfigTag* tag = ServerInstance->Config->ConfValue("deaf");
index 444cbbc395db258153b04a03ad0f4a150591365c..70c6b87176aee4e2b555641e657995816db012b6 100644 (file)
@@ -44,11 +44,6 @@ class ModuleDelayJoin : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(djm);
-               ServerInstance->Modules->AddService(unjoined);
-       }
        Version GetVersion() CXX11_OVERRIDE;
        void OnNamesListItem(User* issuer, Membership*, std::string &prefixes, std::string &nick) CXX11_OVERRIDE;
        void OnUserJoin(Membership*, bool, bool, CUList&) CXX11_OVERRIDE;
index 1e16647f3e89a51c3c5b6537d204bd37f509d616..ae0342e36ef9e6a183a47bd2ecf1b67175f0829b 100644 (file)
@@ -45,11 +45,6 @@ class ModuleDelayMsg : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(djm);
-               ServerInstance->Modules->AddService(djm.jointime);
-       }
        Version GetVersion() CXX11_OVERRIDE;
        void OnUserJoin(Membership* memb, bool sync, bool created, CUList&) CXX11_OVERRIDE;
        ModResult OnUserPreMessage(User* user, void* dest, int target_type, std::string& text, char status, CUList& exempt_list, MessageType msgtype) CXX11_OVERRIDE;
index e16a87336e450ee268a04f63b59d54bfc7deccc5..901f77b1a83b1d22a7003828381dd2f14bab83ad 100644 (file)
@@ -56,11 +56,6 @@ class ModuleDeVoice : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(cmd);
-       }
-
        Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Provides voiced users with the ability to devoice themselves.", VF_VENDOR);
index a785678b58e765d107587cc08dfa40e9e2f5ef0a..b77fb82a95d83be398a494905562654fbc1701d1 100644 (file)
@@ -229,12 +229,6 @@ class ModuleDNSBL : public Module
  public:
        ModuleDNSBL() : DNS(this, "DNS"), nameExt("dnsbl_match", this), countExt("dnsbl_pending", this) { }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(nameExt);
-               ServerInstance->Modules->AddService(countExt);
-       }
-
        Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Provides handling of DNS blacklists", VF_VENDOR);
index 57057c4117e4966c42cdd36517f7d9199c87760f..068f503c3b42d6a0033c90de6f944bff551b30a3 100644 (file)
@@ -115,7 +115,6 @@ class ModuleExemptChanOps : public Module
 
        void init() CXX11_OVERRIDE
        {
-               ServerInstance->Modules->AddService(eh.ec);
                ServerInstance->OnCheckExemption = &eh;
        }
 
index ec75ebebb8bde3b42ae953f6d0870a2639e14ae1..5198cac1843b51704181895d72d75b0757335bdf 100644 (file)
@@ -177,7 +177,6 @@ class ModuleFilter : public Module
        std::set<std::string> exemptfromfilter; // List of channel names excluded from filtering.
 
        ModuleFilter();
-       void init() CXX11_OVERRIDE;
        CullResult cull();
        ModResult OnUserPreMessage(User* user, void* dest, int target_type, std::string& text, char status, CUList& exempt_list, MessageType msgtype) CXX11_OVERRIDE;
        FilterResult* FilterMatch(User* user, const std::string &text, int flags);
@@ -298,11 +297,6 @@ ModuleFilter::ModuleFilter()
 {
 }
 
-void ModuleFilter::init()
-{
-       ServerInstance->Modules->AddService(filtcommand);
-}
-
 CullResult ModuleFilter::cull()
 {
        FreeFilters();
index 2c936d5ea3dbff4cc53fbc51cee10c83ee88e54c..570aaa13b62516456e345fd01ad2e1f34cadfabf 100644 (file)
@@ -184,13 +184,6 @@ class ModuleGlobalLoad : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(cmd1);
-               ServerInstance->Modules->AddService(cmd2);
-               ServerInstance->Modules->AddService(cmd3);
-       }
-
        Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Allows global loading of a module.", VF_COMMON | VF_VENDOR);
index d74534ca1888ab12d1099eef9998e80e14b31640..1cb87324b5417cbd9803a9eed9d3011905f30874 100644 (file)
@@ -48,7 +48,6 @@ class ModuleGlobops : public Module
 
        void init() CXX11_OVERRIDE
        {
-               ServerInstance->Modules->AddService(cmd);
                ServerInstance->SNO->EnableSnomask('g',"GLOBOPS");
        }
 
index 6259636ce3b03a326f4a95f1154243933566298c..f316d42d1f3380d91367c1436c5d9a86abc53bad 100644 (file)
@@ -106,12 +106,6 @@ class ModuleHelpop : public Module
                {
                }
 
-               void init() CXX11_OVERRIDE
-               {
-                       ServerInstance->Modules->AddService(ho);
-                       ServerInstance->Modules->AddService(cmd);
-               }
-
                void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
                {
                        helpop_map.clear();
index 1bf6c18665885bb91d9b4aad4f050b6f0dd93d59..cd3ac2c26e5175c156f11513b15cc3de7fd343aa 100644 (file)
@@ -37,11 +37,6 @@ class ModuleHideChans : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(hm);
-       }
-
        Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Provides support for hiding channels with user mode +I", VF_VENDOR);
index ded6f679116f198b884284ecb5afc058c24507f9..a7a701697421515af13b7ea14b3b954304206e38 100644 (file)
@@ -41,11 +41,6 @@ class ModuleHideOper : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(hm);
-       }
-
        Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Provides support for hiding oper status with user mode +H", VF_VENDOR);
index 9a5722c6a121647d94f2f42d3da8c03dd053a954..5a71f8018e3b6cb82bcde7f6f7812499f5840ce6 100644 (file)
@@ -357,7 +357,6 @@ class ModuleHttpServer : public Module
        void init() CXX11_OVERRIDE
        {
                HttpModule = this;
-               ServerInstance->Modules->AddService(APIImpl);
        }
 
        ModResult OnAcceptConnection(int nfd, ListenSocket* from, irc::sockets::sockaddrs* client, irc::sockets::sockaddrs* server) CXX11_OVERRIDE
index a9a62fecf53636c2970c5b008b10af0ea95a191d..516287668c9fd7f45426fe127a1dabb05cf23e25 100644 (file)
@@ -276,11 +276,6 @@ class ModuleIdent : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(ext);
-       }
-
        Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Provides support for RFC1413 ident lookups", VF_VENDOR);
index 2424808f6b6310253948e2e4ed6bea1142f9e984..08322f9cfa05655b74016c30887c1a3b8f3817e9 100644 (file)
@@ -51,12 +51,6 @@ public:
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(ie);
-               ie.DoImplements(this);
-       }
-
        void On005Numeric(std::map<std::string, std::string>& tokens) CXX11_OVERRIDE
        {
                tokens["INVEX"] = "I";
index efb277f81a24d27a77c9e01261edc9861b23cd14..650a7eb2bc400aaf9eefc9c0e0ce265525f0e2e7 100644 (file)
@@ -145,12 +145,6 @@ class ModuleJoinFlood : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(jf);
-               ServerInstance->Modules->AddService(jf.ext);
-       }
-
        ModResult OnUserPreJoin(LocalUser* user, Channel* chan, const std::string& cname, std::string& privs, const std::string& keygiven) CXX11_OVERRIDE
        {
                if (chan)
index c8a196832a92bba113e65076b72b15fb794d894d..3441bb0735c85b250c6f5a2054ddd5ac812883af 100644 (file)
@@ -152,11 +152,6 @@ class ModuleJumpServer : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(js);
-       }
-
        ModResult OnUserRegister(LocalUser* user) CXX11_OVERRIDE
        {
                if (js.redirect_new_users)
index bb04610dea8dbb5c9bf1bc81e22620794e79aae8..e51eb37a42048c99c38481f8b5cb7e0b688ce489 100644 (file)
@@ -76,12 +76,6 @@ public:
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(kr);
-               ServerInstance->Modules->AddService(kr.ext);
-       }
-
        ModResult OnUserPreJoin(LocalUser* user, Channel* chan, const std::string& cname, std::string& privs, const std::string& keygiven) CXX11_OVERRIDE
        {
                if (chan)
index 79d8cddb63262818b4d5840ea9650b0785306872..36a6933dc511aa3e057dce37a29116dad9c877c0 100644 (file)
@@ -95,12 +95,6 @@ class ModuleKnock : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(kn);
-               ServerInstance->Modules->AddService(cmd);
-       }
-
        void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
        {
                std::string knocknotify = ServerInstance->Config->ConfValue("knock")->getString("notify");
index a31e4d32494e418d47203cec2c5f0b52619e98e4..ea5ad52de18db04b5a28f06c16cf31e5a91b92f6 100644 (file)
@@ -89,8 +89,6 @@ class ModuleLockserv : public Module
        void init() CXX11_OVERRIDE
        {
                locked = false;
-               ServerInstance->Modules->AddService(lockcommand);
-               ServerInstance->Modules->AddService(unlockcommand);
        }
 
        void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
index dd72fe9eacb42e700585940406af843f71c0a26c..ecf76d07cb8cd7ff06045d8a7e95ee2675fe2d9b 100644 (file)
@@ -275,7 +275,6 @@ class ModuleMD5 : public Module
  public:
        ModuleMD5() : md5(this)
        {
-               ServerInstance->Modules->AddService(md5);
        }
 
        Version GetVersion() CXX11_OVERRIDE
index ef7bf9d5266b2cf005c91647d95831fdeaa5c1e1..ffac281377a70b848093c14da19c6a558ff27682 100644 (file)
@@ -124,12 +124,6 @@ class ModuleMsgFlood : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(mf);
-               ServerInstance->Modules->AddService(mf.ext);
-       }
-
        ModResult ProcessMessages(User* user,Channel* dest, const std::string &text)
        {
                if ((!IS_LOCAL(user)) || !dest->IsModeSet(mf))
index abcd79667b13664c83d5a8ef46b51bcafba22b5f..43eadf63ee5d4222764c90ecdf3d5013e2928bda 100644 (file)
@@ -26,11 +26,6 @@ class ModuleMLock : public Module
 public:
        ModuleMLock() : mlock("mlock", this) {};
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(this->mlock);
-       }
-
        Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Implements the ability to have server-side MLOCK enforcement.", VF_VENDOR);
index 8647cebb454daa4cd9aacfa8a78a78a2de78e39b..46ecb8bfd1aacb4a174e87fc68ab0b4afcab20f3 100644 (file)
@@ -103,12 +103,6 @@ class ModuleNamedModes : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(cmd);
-               ServerInstance->Modules->AddService(dummyZ);
-       }
-
        Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Provides the ability to manipulate modes via long names.",VF_VENDOR);
index 66e7ca520970e6bfbfb7f1dee8ee4cf32401ca20..6526e6960f04caed31200005f6c856ca5cfc8354 100644 (file)
@@ -136,12 +136,6 @@ class ModuleNickFlood : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(nf);
-               ServerInstance->Modules->AddService(nf.ext);
-       }
-
        ModResult OnUserPreNick(User* user, const std::string &newnick) CXX11_OVERRIDE
        {
                for (UCListIter i = user->chans.begin(); i != user->chans.end(); i++)
index 6c4101bc5fe4b7e7df359d2c1b905dea3b53ca55..790df59c0fc8b126c3f472d80eec3034d94b48e8 100644 (file)
@@ -148,13 +148,6 @@ class ModuleNickLock : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(cmd1);
-               ServerInstance->Modules->AddService(cmd2);
-               ServerInstance->Modules->AddService(locked);
-       }
-
        Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Provides the NICKLOCK command, allows an oper to change a users nick and lock them to it until they quit", VF_OPTCOMMON | VF_VENDOR);
index d791dca365ab363378a21d965fddffd15ac76f05..6be3d79afb26cb63b2f8ee01b770a12f4de329e4 100644 (file)
@@ -37,11 +37,6 @@ class ModuleNoCTCP : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(nc);
-       }
-
        Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Provides channel mode +C to block CTCPs", VF_VENDOR);
index 5e58f002c502984c0f164722407bc5b6184586e3..e9885f49eec735e4727f55a5aed482767c947e9c 100644 (file)
@@ -38,11 +38,6 @@ class ModuleNoKicks : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(nk);
-       }
-
        void On005Numeric(std::map<std::string, std::string>& tokens) CXX11_OVERRIDE
        {
                tokens["EXTBAN"].push_back('Q');
index b9010d3302770c1a918b8294409ba56e67be9c7f..3ae54f2ebc64c23c33df6a4ef2d323bbc30eeb26 100644 (file)
@@ -36,11 +36,6 @@ class ModuleNoNickChange : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(nn);
-       }
-
        Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Provides support for channel mode +N & extban +b N: which prevents nick changes on channel", VF_VENDOR);
index cf8da5f5532bbdc05aec9db6dc9b5eb368a9aef7..7aa30ea786ce508a998c0da3a0b414e235ca93ae 100644 (file)
@@ -37,11 +37,6 @@ class ModuleNoNotice : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(nt);
-       }
-
        void On005Numeric(std::map<std::string, std::string>& tokens) CXX11_OVERRIDE
        {
                tokens["EXTBAN"].push_back('T');
index 83a0494805a5aa4a0b9f8ec5385d5d787177e584..54c7bfa73ca96c27a6a5140588fb82e1b390671e 100644 (file)
@@ -138,7 +138,6 @@ class ModuleOjoin : public Module
                mycommand.npmh = np;
 
                ServerInstance->Modules->AddService(*np);
-               ServerInstance->Modules->AddService(mycommand);
        }
 
        ModResult OnUserPreJoin(LocalUser* user, Channel* chan, const std::string& cname, std::string& privs, const std::string& keygiven) CXX11_OVERRIDE
index 73ef130b9ace68d4946a1d93f2f1ae5ac6321a6d..20aa6dfeaa71b18b864bef25f9c4384409bb7644 100644 (file)
@@ -40,11 +40,6 @@ class ModuleOperChans : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(oc);
-       }
-
        ModResult OnUserPreJoin(LocalUser* user, Channel* chan, const std::string& cname, std::string& privs, const std::string& keygiven) CXX11_OVERRIDE
        {
                if (chan && chan->IsModeSet(oc) && !user->IsOper())
index 543fa685469511062588dce1380878766163c26d..bd1853d43da43a37a78739e1420aa9ddc47d6e97 100644 (file)
@@ -80,11 +80,6 @@ class ModuleOpermotd : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(cmd);
-       }
-
        Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Shows a message to opers after oper-up, adds /opermotd", VF_VENDOR | VF_OPTCOMMON);
index 43346a4d033518776de9913c4c7f6dbfd66435d9..23390baea5fe6331d4c141cbb46b68cd813f0e57 100644 (file)
@@ -79,8 +79,6 @@ class ModuleOperPrefixMode : public Module
 
        void init() CXX11_OVERRIDE
        {
-               ServerInstance->Modules->AddService(opm);
-
                /* To give clients a chance to learn about the new prefix we don't give +y to opers
                 * right now. That means if the module was loaded after opers have joined channels
                 * they need to rejoin them in order to get the oper prefix.
index c8532e2ff7cb7f5c5e6d3842d235a0c54c24dc4a..0e3afb9661c48ba8ff3edcda44aae3776d3b1e32 100644 (file)
@@ -80,11 +80,6 @@ class ModuleOperHash : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(cmd);
-       }
-
        ModResult OnPassCompare(Extensible* ex, const std::string &data, const std::string &input, const std::string &hashtype) CXX11_OVERRIDE
        {
                if (hashtype.substr(0,5) == "hmac-")
index ec04c7a4547b4b5e7a23c562b09a62841abf68eb..2190a5206cf82f0c49bd98010ec2bc8fd278b21b 100644 (file)
@@ -166,11 +166,6 @@ public:
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(p);
-       }
-
        CullResult cull()
        {
                /*
index 89097ade4cc07b318cea5722f90e4dc076dbb1d4..69fc5e136072091529bc38988e2287b1100a65ab 100644 (file)
@@ -88,7 +88,11 @@ class Redirect : public ModeHandler
 class AntiRedirect : public SimpleUserModeHandler
 {
        public:
-               AntiRedirect(Module* Creator) : SimpleUserModeHandler(Creator, "antiredirect", 'L') {}
+               AntiRedirect(Module* Creator) : SimpleUserModeHandler(Creator, "antiredirect", 'L')
+               {
+                       if (!ServerInstance->Config->ConfValue("redirect")->getBool("antiredirect"))
+                               DisableAutoRegister();
+               }
 };
 
 class ModuleRedirect : public Module
@@ -110,19 +114,6 @@ class ModuleRedirect : public Module
        {
                /* Setting this here so it isn't changable by rehasing the config later. */
                UseUsermode = ServerInstance->Config->ConfValue("redirect")->getBool("antiredirect");
-
-               /* Channel mode */
-               ServerInstance->Modules->AddService(re);
-
-               /* Check to see if the usermode is enabled in the config */
-               if (UseUsermode)
-               {
-                       /* Log noting that this breaks compatability. */
-                       ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "REDIRECT: Enabled usermode +L. This breaks linking with servers that do not have this enabled. This is disabled by default in the 2.0 branch but will be enabled in the next version.");
-
-                       /* Try to add the usermode */
-                       ServerInstance->Modules->AddService(re_u);
-               }
        }
 
        ModResult OnUserPreJoin(LocalUser* user, Channel* chan, const std::string& cname, std::string& privs, const std::string& keygiven) CXX11_OVERRIDE
index eb7cf4ece5d383032ee0d9d4d8cf996014305fbc..9c316288523528477f299baa7ac46555e8206a0e 100644 (file)
@@ -49,8 +49,9 @@ class ModuleRegexGlob : public Module
 {
        GlobFactory gf;
 public:
-       ModuleRegexGlob() : gf(this) {
-               ServerInstance->Modules->AddService(gf);
+       ModuleRegexGlob()
+               : gf(this)
+       {
        }
 
        Version GetVersion() CXX11_OVERRIDE
index 4a8574a6a60e8557bc4013ce5363fb4cfb7de6a1..48f0f02764108f05a4cbb0b335d7ddf06c56055c 100644 (file)
@@ -202,12 +202,6 @@ class ModuleRemove : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(cmd1);
-               ServerInstance->Modules->AddService(cmd2);
-       }
-
        void On005Numeric(std::map<std::string, std::string>& tokens) CXX11_OVERRIDE
        {
                tokens["REMOVE"];
index 6ba65a7672f788869e0367bcb8e2a9cd5c1fce8d..69946ed0c47e9a003d3d45f4eab0621ce8589008 100644 (file)
@@ -347,13 +347,6 @@ class RepeatModule : public Module
  public:
        RepeatModule() : rm(this) {}
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(rm);
-               ServerInstance->Modules->AddService(rm.ChanSet);
-               ServerInstance->Modules->AddService(rm.MemberInfoExt);
-       }
-
        void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
        {
                rm.ReadConfig();
index 183b75452d519af96ed97f0d50be724722744d03..41331543acee35a5a4962c6ca78c90039ad6a7d1 100644 (file)
@@ -447,7 +447,6 @@ class ModuleRIPEMD160 : public Module
        RIProv mr;
        ModuleRIPEMD160() : mr(this)
        {
-               ServerInstance->Modules->AddService(mr);
        }
 
        Version GetVersion() CXX11_OVERRIDE
index 01d8b753a23ac7bf2b83be83b2ed6bcd1980bfa9..0bfdc35653b9229cd5dd7755a94eef02902a605c 100644 (file)
@@ -223,7 +223,6 @@ class ModuleRLine : public Module
 
        void init() CXX11_OVERRIDE
        {
-               ServerInstance->Modules->AddService(r);
                ServerInstance->XLines->RegisterFactory(&f);
        }
 
index 542df70a536afca414643073e4eb3c24d9a0026d..1bbbb37bf8f76590d6de7e144718f758ad676247 100644 (file)
@@ -113,11 +113,6 @@ class ModuleRMode : public Module
  public:
        ModuleRMode() : cmd(this) { }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(cmd);
-       }
-
        Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Allows glob-based removal of list modes", VF_VENDOR);
index 9cc6a72d295634bbd2f0ea37683c08f5ef7fad3e..17d07cc057fa437f4997af705310034a9306cdb2 100644 (file)
@@ -108,11 +108,6 @@ class ModuleSajoin : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(cmd);
-       }
-
        Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Provides command SAJOIN to allow opers to force-join users to channels", VF_OPTCOMMON | VF_VENDOR);
index e7dd86d6f6c0eb3ccbbd20769a9847adb8de943b..92e56644a3bf70c006f27c7113b5d61c2b3dc6fa 100644 (file)
@@ -105,11 +105,6 @@ class ModuleSakick : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(cmd);
-       }
-
        Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Provides a SAKICK command", VF_OPTCOMMON|VF_VENDOR);
index a549f89a7a6484b4840a01bb46f5d900e44a5f57..129ad3f7ba7c824f8639c496876f430883196722 100644 (file)
@@ -61,11 +61,6 @@ class ModuleSaMode : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(cmd);
-       }
-
        Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Provides command SAMODE to allow opers to change modes on channels and users", VF_VENDOR);
index 82e8508dd46640876af1a485a6560ef00d70c1fa..39711564788b79e5b94a80dbeb467e255824e31b 100644 (file)
@@ -96,11 +96,6 @@ class ModuleSanick : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(cmd);
-       }
-
        Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Provides support for SANICK command", VF_OPTCOMMON | VF_VENDOR);
index c6137c561d216e32823bc5cb3d0ad9cffee4a23e..07b79bfc91a33739b481a3dab30e425fb8e1d0e0 100644 (file)
@@ -107,11 +107,6 @@ class ModuleSapart : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(cmd);
-       }
-
        Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Provides command SAPART to force-part users from a channel.", VF_OPTCOMMON | VF_VENDOR);
index 8525a94feb7129ecab4f34cb5252c9b43e951b35..ffd07492f5e9d3e0e5e5071ef009ad885fc5d61e 100644 (file)
@@ -77,11 +77,6 @@ class ModuleSaquit : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(cmd);
-       }
-
        Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Provides support for an SAQUIT command, exits user with a reason", VF_OPTCOMMON | VF_VENDOR);
index 1ef1fa073df4ae04e811a60ac6dc2d1f0be110c9..6c9ba14e6b90a31df2214c482cf41ac2ab20f22e 100644 (file)
@@ -256,9 +256,6 @@ class ModuleSASL : public Module
 
        void init() CXX11_OVERRIDE
        {
-               ServiceProvider* providelist[] = { &auth, &sasl, &authExt };
-               ServerInstance->Modules->AddServices(providelist, 3);
-
                if (!ServerInstance->Modules->Find("m_services_account.so") || !ServerInstance->Modules->Find("m_cap.so"))
                        ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "WARNING: m_services_account.so and m_cap.so are not loaded! m_sasl.so will NOT function correctly until these two modules are loaded!");
        }
index 053f13789bd3e52c52b4c9f9f4d44f58ee5e8d4d..620feb657d7dc4459c17be4ebedfc671c7649cd0 100644 (file)
@@ -61,11 +61,6 @@ class ModuleSATopic : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(cmd);
-       }
-
        Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Provides a SATOPIC command", VF_VENDOR);
index 4f2125a975616cfc3b80d6dc7e947d43b0b8563b..2726f835cbd2d707942c2a962c356058af72a31a 100644 (file)
@@ -116,12 +116,6 @@ class ModuleServicesAccount : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServiceProvider* providerlist[] = { &m1, &m2, &m3, &m4, &m5, &accountname };
-               ServerInstance->Modules->AddServices(providerlist, sizeof(providerlist)/sizeof(ServiceProvider*));
-       }
-
        void On005Numeric(std::map<std::string, std::string>& tokens) CXX11_OVERRIDE
        {
                tokens["EXTBAN"].push_back('R');
index 2b550408cebb8f0fd96b0bdcf3a5496ff1a3e88c..e1b35e54564a9ad32cb2c3e12b9e2b62ac514887 100644 (file)
@@ -51,11 +51,6 @@ class ModuleServProtectMode : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(bm);
-       }
-
        Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Provides usermode +k to protect services from kicks, kills, and mode changes.", VF_VENDOR);
index 80953ee6f8102d76d55bc05072ed189d3ffa1892..ee0fc01e4cb6fc58a77e84cb40e3e32ed55934ca 100644 (file)
@@ -74,11 +74,6 @@ class ModuleSetHost : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(cmd);
-       }
-
        void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
        {
                std::string hmap = ServerInstance->Config->ConfValue("hostname")->getString("charmap", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.-_/0123456789");
index 024421347e94370decd8a65a9effd8fec26e314f..93dd4c332bb2f97a4c1cd158feb5c3091562ea8d 100644 (file)
@@ -63,11 +63,6 @@ class ModuleSetIdent : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(cmd);
-       }
-
        Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Provides support for the SETIDENT command", VF_VENDOR);
index e246b801f1dfadaf401f19b888ec93f0b86bb084..c2d1ed0db679a8efe829eaba23073da17074e4d4 100644 (file)
@@ -60,11 +60,6 @@ class ModuleSetIdle : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(cmd);
-       }
-
        Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Allows opers to set their idle time", VF_VENDOR);
index 4c9d6ae537f93010c655c60267237fd470dabdcc..0e71840f733a820ed3bd9dfeef3c6b66974df657 100644 (file)
@@ -59,11 +59,6 @@ class ModuleSetName : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(cmd);
-       }
-
        Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Provides support for the SETNAME command", VF_VENDOR);
index 82ac8c1606a43d5e73d592590517e46589c96013..d2755baccf806754a71397dc0d5a57297a14a8df 100644 (file)
@@ -263,7 +263,6 @@ class ModuleSHA256 : public Module
  public:
        ModuleSHA256() : sha(this)
        {
-               ServerInstance->Modules->AddService(sha);
        }
 
        Version GetVersion() CXX11_OVERRIDE
index bf3028c122e233febc6664b1a6596bd45ee57625..bedaf6236bb718d10829f1e34056820872b9c953 100644 (file)
@@ -86,7 +86,6 @@ class ModuleShowwhois : public Module
 
                sw = new SeeWhois(this, OpersOnly);
                ServerInstance->Modules->AddService(*sw);
-               ServerInstance->Modules->AddService(cmd);
        }
 
        ~ModuleShowwhois()
index b5d579d00bce85718aa714909d8d5e23c8a272f0..f0524435b6a1363d8ee829494620a8aa7338bb1f 100644 (file)
@@ -180,7 +180,6 @@ class ModuleShun : public Module
        void init() CXX11_OVERRIDE
        {
                ServerInstance->XLines->RegisterFactory(&f);
-               ServerInstance->Modules->AddService(cmd);
        }
 
        ~ModuleShun()
index c17cd8e360ba8ad88a262e1807a28c32aea5778c..02005367df05121c7300bc52d0690c183d006145 100644 (file)
@@ -299,13 +299,6 @@ class ModuleSilence : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(cmdsilence);
-               ServerInstance->Modules->AddService(cmdsvssilence);
-               ServerInstance->Modules->AddService(cmdsilence.ext);
-       }
-
        void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
        {
                maxsilence = ServerInstance->Config->ConfValue("showwhois")->getInt("maxentries", 32);
index 1e59e1607c52ff83eab584af002d535d4cfa1a65..fed55d4fd9e53ea0d0352eb4f1e6c2d1f1a61193 100644 (file)
@@ -59,9 +59,6 @@ void ModuleSpanningTree::init()
        Utils = new SpanningTreeUtilities(this);
        Utils->TreeRoot = new TreeServer;
        commands = new SpanningTreeCommands(this);
-       ServerInstance->Modules->AddService(commands->rconnect);
-       ServerInstance->Modules->AddService(commands->rsquit);
-       ServerInstance->Modules->AddService(commands->map);
 
        delete ServerInstance->PI;
        ServerInstance->PI = new SpanningTreeProtocolInterface;
index fe5a38a9e472cc62f4bd6ac1ccb33e1a6256be25..016788f51642d8b3d9cb7deea99665c46f53ab19 100644 (file)
@@ -24,6 +24,7 @@
 ServerCommand::ServerCommand(Module* Creator, const std::string& Name, unsigned int MinParams, unsigned int MaxParams)
        : CommandBase(Creator, Name, MinParams, MaxParams)
 {
+       this->ServiceProvider::DisableAutoRegister();
        ModuleSpanningTree* st = static_cast<ModuleSpanningTree*>(Creator);
        st->CmdManager.AddCommand(this);
 }
index fe65d2805a5bbf3b82a68f8767b3fc81d88124f9..0c055a0851e605d7212bd912e14a5c36f14019bf 100644 (file)
@@ -81,11 +81,6 @@ class ModuleSQLAuth : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(pendingExt);
-       }
-
        void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
        {
                ConfigTag* conf = ServerInstance->Config->ConfValue("sqlauth");
index c6fb2165c5a3436480439853ccdca8b2d3796696..b24814fe3e7e621d643eeae2abdc49b4265cbd41 100644 (file)
@@ -146,13 +146,6 @@ class ModuleSSLInfo : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(APIImpl);
-               ServerInstance->Modules->AddService(cmd);
-               ServerInstance->Modules->AddService(cmd.CertExt);
-       }
-
        Version GetVersion() CXX11_OVERRIDE
        {
                return Version("SSL Certificate Utilities", VF_VENDOR);
index 191ca10f1c5cc06b92ca4124bdcb89c70438479e..790ed5b0363416faabe4446183daae2bd9504512 100644 (file)
@@ -91,11 +91,6 @@ class ModuleSSLModes : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(sslm);
-       }
-
        ModResult OnUserPreJoin(LocalUser* user, Channel* chan, const std::string& cname, std::string& privs, const std::string& keygiven) CXX11_OVERRIDE
        {
                if(chan && chan->IsModeSet(sslm))
index b50c22297255a40bca75e93c42951f0ae8d82cda..0d4bdb877ff44845e24ff6ddb8ef71e03f69d38c 100644 (file)
@@ -48,12 +48,6 @@ class ModuleStripColor : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(usc);
-               ServerInstance->Modules->AddService(csc);
-       }
-
        void On005Numeric(std::map<std::string, std::string>& tokens) CXX11_OVERRIDE
        {
                tokens["EXTBAN"].push_back('S');
index fc1eb5381a84505395b2c9954f190cc75f027178..aeb622aed4aa51bf8c642eb424c90e26afc4ca71 100644 (file)
@@ -157,7 +157,6 @@ class ModuleSVSHold : public Module
        void init() CXX11_OVERRIDE
        {
                ServerInstance->XLines->RegisterFactory(&s);
-               ServerInstance->Modules->AddService(cmd);
        }
 
        ModResult OnStats(char symbol, User* user, string_list &out) CXX11_OVERRIDE
index c2659f6aa53909b7e28b175d84bf804de392f7f9..aaa6ff5b42c270bd4fd432a5c48c425a60d15384 100644 (file)
@@ -88,12 +88,6 @@ class ModuleSWhois : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(cmd);
-               ServerInstance->Modules->AddService(cmd.swhois);
-       }
-
        // :kenny.chatspike.net 320 Brain Azhrarn :is getting paid to play games.
        ModResult OnWhoisLine(User* user, User* dest, int &numeric, std::string &text) CXX11_OVERRIDE
        {
index 4e99abd324cecdb0415766bb8ac66c395513b832..6e05ed681662f53c156804e828d13e9afa3d8874 100644 (file)
@@ -56,7 +56,6 @@ class ModuleTest : public Module
        {
                if (!strstr(ServerInstance->Config->ServerName.c_str(), ".test"))
                        throw ModuleException("Don't load modules without reading their descriptions!");
-               ServerInstance->Modules->AddService(cmd);
        }
 
        Version GetVersion() CXX11_OVERRIDE
index 29691b338b54161f6e0dcf6d7b9707f9696ab142..0801c9c52a3c62f829fabb95834720a49eb4a99a 100644 (file)
@@ -150,7 +150,6 @@ class ModuleTimedBans : public Module
 
        void init() CXX11_OVERRIDE
        {
-               ServerInstance->Modules->AddService(cmd);
                ServerInstance->Modes->AddModeWatcher(&banwatcher);
        }
 
index bf1476bb541a2810b1d82fecf5001af6fa4da5e6..cf5814fd185eae0f21de96df4e6273c9d5036702 100644 (file)
@@ -73,11 +73,6 @@ class ModuleTLine : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(cmd);
-       }
-
        Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Provides /tline command used to test who a mask matches", VF_VENDOR);
index 760283c952eefb9b3ea49d40a5ccc5f10dffc81d..2d539dcabd0e8679d94eb17ea83debc479082ef6 100644 (file)
@@ -149,12 +149,6 @@ class ModuleTopicLock : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(cmd);
-               ServerInstance->Modules->AddService(topiclock);
-       }
-
        ModResult OnPreTopicChange(User* user, Channel* chan, const std::string &topic) CXX11_OVERRIDE
        {
                // Only fired for local users currently, but added a check anyway
index 3ee23c95a7fa17a0194b8209a50bf654c6eb1de5..7404fa45ca9685e611c1ca30b6f8a60d949aad0a 100644 (file)
@@ -102,11 +102,6 @@ class ModuleUninvite : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(cmd);
-       }
-
        Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Provides the UNINVITE command which lets users un-invite other users from channels", VF_VENDOR | VF_OPTCOMMON);
index 79e69ec5e85b96fbc01943610fdbba4499f134d9..e8d08d34613e7ba235a04a6d4c9e84a5adda97dc 100644 (file)
@@ -85,11 +85,6 @@ class ModuleUserIP : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(cmd);
-       }
-
        void On005Numeric(std::map<std::string, std::string>& tokens) CXX11_OVERRIDE
        {
                tokens["USERIP"];
index e938da297560b47c7a1ba1992fdc88b47312653d..2e25849aed832876faea0e0800d0dc06e3734ebb 100644 (file)
@@ -68,11 +68,6 @@ class ModuleVHost : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(cmd);
-       }
-
        Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Provides masking of user hostnames via traditional /VHOST command",VF_VENDOR);
index be1dcfc91e4600df5e71299ad53a9dbb89dca32b..f1581ac0290cf4b185e2b33c9190101d708797aa 100644 (file)
@@ -374,13 +374,6 @@ class Modulewatch : public Module
                whos_watching_me = new watchentries();
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(cmdw);
-               ServerInstance->Modules->AddService(sw);
-               ServerInstance->Modules->AddService(cmdw.ext);
-       }
-
        void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
        {
                maxwatch = ServerInstance->Config->ConfValue("watch")->getInt("maxentries", 32);