1
0
mirror of https://github.com/anope/anope.git synced 2026-06-28 06:16:37 +02:00

Reorder some stuff in Init & the ts6 proto mods to fix weirdness from bots being introduced by 3rd party modules

This commit is contained in:
Adam
2011-10-18 01:48:05 -04:00
parent 2c614d5aab
commit faea45245d
5 changed files with 46 additions and 16 deletions
+6 -16
View File
@@ -401,9 +401,6 @@ void Init(int ac, char **av)
throw FatalException("Configuration file failed to validate");
}
/* Create me */
Me = new Server(NULL, Config->ServerName, 0, Config->ServerDesc, Config->Numeric);
#ifdef _WIN32
if (!SupportedWindowsVersion())
throw FatalException(GetWindowsVersion() + " is not a supported version of Windows");
@@ -428,10 +425,14 @@ void Init(int ac, char **av)
}
#endif
/* Write our PID to the PID file. */
write_pidfile();
/* Create me */
Me = new Server(NULL, Config->ServerName, 0, Config->ServerDesc, Config->Numeric);
for (botinfo_map::iterator it = BotListByNick.begin(), it_end = BotListByNick.end(); it != it_end; ++it)
it->second->server = Me;
/* Announce ourselves to the logfile. */
Log() << "Anope " << Anope::Version() << " starting up" << (debug || readonly ? " (options:" : "") << (debug ? " debug" : "") << (readonly ? " readonly" : "") << (debug || readonly ? ")" : "");
@@ -453,6 +454,7 @@ void Init(int ac, char **av)
#endif
/* load modules */
Log() << "Loading modules...";
for (std::list<Anope::string>::iterator it = Config->ModulesAutoLoad.begin(), it_end = Config->ModulesAutoLoad.end(); it != it_end; ++it)
ModuleManager::LoadModule(*it, NULL);
@@ -462,18 +464,6 @@ void Init(int ac, char **av)
else if (ModuleManager::FindFirstOf(ENCRYPTION) == NULL)
throw FatalException("You must load at least one encryption module");
if (ircd->ts6 && Config->Numeric.empty())
{
Anope::string numeric = ts6_sid_retrieve();
Me->SetSID(numeric);
Config->Numeric = numeric;
}
for (botinfo_map::iterator it = BotListByNick.begin(), it_end = BotListByNick.end(); it != it_end; ++it)
{
it->second->GenerateUID();
it->second->server = Me;
}
Log() << "Using IRCd protocol " << protocol->name;
/* Load up databases */