diff options
author | Adam <Adam@anope.org> | 2011-04-28 22:44:34 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2011-05-16 04:09:32 -0400 |
commit | 583954d3a1db658281a9afb7b7dd6773726c8c11 (patch) | |
tree | 6a00865d5738c6d0bc42efb35f3f468c5876eb3e /src/init.cpp | |
parent | 8fb1604f649bec6f356770daf5df6bb8ab811bbf (diff) |
Use module type to determine what type each module is instead of its location in the configuration file.
Diffstat (limited to 'src/init.cpp')
-rw-r--r-- | src/init.cpp | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/src/init.cpp b/src/init.cpp index 039067191..ad95e4d4b 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -334,19 +334,9 @@ void Init(int ac, char **av) /* Initialize the socket engine */ SocketEngine::Init(); - /* Add IRCD Protocol Module; exit if there are errors */ - if (protocol_module_init()) - throw FatalException("Unable to load protocol module"); - /* Create me */ Me = new Server(NULL, Config->ServerName, 0, Config->ServerDesc, Config->Numeric); - /* Add Encryption Modules */ - ModuleManager::LoadModuleList(Config->EncModuleList); - - /* Add Database Modules */ - ModuleManager::LoadModuleList(Config->DBModuleList); - DNSEngine = new DNSManager(); #ifndef _WIN32 @@ -385,7 +375,7 @@ void Init(int ac, char **av) write_pidfile(); /* Announce ourselves to the logfile. */ - Log() << "Anope " << Anope::Version() << " (ircd protocol: " << ircd->name << ") starting up" << (debug || readonly ? " (options:" : "") << (debug ? " debug" : "") << (readonly ? " readonly" : "") << (debug || readonly ? ")" : ""); + Log() << "Anope " << Anope::Version() << " starting up" << (debug || readonly ? " (options:" : "") << (debug ? " debug" : "") << (readonly ? " readonly" : "") << (debug || readonly ? ")" : ""); start_time = Anope::CurTime; /* Set signal handlers. Catch certain signals to let us do things or @@ -401,14 +391,21 @@ void Init(int ac, char **av) Log(LOG_DEBUG) << "Loading Languages..."; InitLanguages(); - /* load any custom modules */ - if (!nothird) - ModuleManager::LoadModuleList(Config->ModulesAutoLoad); - /* Initialize random number generator */ rand_init(); add_entropy_userkeys(); + /* load modules */ + ModuleManager::LoadModuleList(Config->ModulesAutoLoad); + + Module *protocol = ModuleManager::FindFirstOf(PROTOCOL); + if (protocol == NULL) + throw FatalException("You must load a protocol module!"); + else if (ModuleManager::FindFirstOf(ENCRYPTION) == NULL) + throw FatalException("You must load at least one encryption module"); + + Log() << "Using IRCd protocol " << protocol->name; + /* Load up databases */ Log() << "Loading databases..."; EventReturn MOD_RESULT; |