diff options
-rw-r--r-- | modules/protocol/inspircd12.cpp | 10 | ||||
-rw-r--r-- | modules/protocol/inspircd20.cpp | 10 | ||||
-rw-r--r-- | modules/protocol/plexus.cpp | 10 | ||||
-rw-r--r-- | modules/protocol/ratbox.cpp | 10 | ||||
-rw-r--r-- | src/init.cpp | 22 |
5 files changed, 46 insertions, 16 deletions
diff --git a/modules/protocol/inspircd12.cpp b/modules/protocol/inspircd12.cpp index 80a40311c..88d45bd79 100644 --- a/modules/protocol/inspircd12.cpp +++ b/modules/protocol/inspircd12.cpp @@ -759,6 +759,16 @@ class ProtoInspIRCd : public Module Implementation i[] = { I_OnUserNickChange, I_OnServerSync }; ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); + + if (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(); } ~ProtoInspIRCd() diff --git a/modules/protocol/inspircd20.cpp b/modules/protocol/inspircd20.cpp index 6586044aa..23924a2cc 100644 --- a/modules/protocol/inspircd20.cpp +++ b/modules/protocol/inspircd20.cpp @@ -771,6 +771,16 @@ class ProtoInspIRCd : public Module Implementation i[] = { I_OnUserNickChange, I_OnServerSync }; ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); + + if (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(); } ~ProtoInspIRCd() diff --git a/modules/protocol/plexus.cpp b/modules/protocol/plexus.cpp index df03ce940..356adfe2c 100644 --- a/modules/protocol/plexus.cpp +++ b/modules/protocol/plexus.cpp @@ -673,6 +673,16 @@ class ProtoPlexus : public Module Implementation i[] = { I_OnServerSync }; ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); + + if (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(); } ~ProtoPlexus() diff --git a/modules/protocol/ratbox.cpp b/modules/protocol/ratbox.cpp index e5f7a759a..fb65b80b4 100644 --- a/modules/protocol/ratbox.cpp +++ b/modules/protocol/ratbox.cpp @@ -598,6 +598,16 @@ class ProtoRatbox : public Module Implementation i[] = { I_OnServerSync }; ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); + + if (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(); } ~ProtoRatbox() diff --git a/src/init.cpp b/src/init.cpp index e1ccf6c17..3f41630f0 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -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 */ |