1
0
mirror of https://github.com/anope/anope.git synced 2026-06-27 18:46:39 +02:00

Added more useful functions to our LDAP API, allow adding newly registered accounts to LDAP, removed some unnecessary OnPre events and fixed unloading all modules

This commit is contained in:
Adam
2011-04-27 10:56:20 -04:00
parent e7887c1f01
commit 284af258bf
11 changed files with 321 additions and 57 deletions
+9 -16
View File
@@ -133,10 +133,12 @@ void do_restart_services()
}
Log() << "Restarting";
FOREACH_MOD(I_OnPreRestart, OnPreRestart());
if (quitmsg.empty())
quitmsg = "Restarting";
FOREACH_MOD(I_OnRestart, OnRestart());
ModuleManager::UnloadAll();
/* Send a quit for all of our bots */
for (Anope::insensitive_map<BotInfo *>::const_iterator it = BotListByNick.begin(), it_end = BotListByNick.end(); it != it_end; ++it)
{
@@ -150,9 +152,6 @@ void do_restart_services()
UserListByUID.erase(bi->GetUID());
}
FOREACH_MOD(I_OnRestart, OnRestart());
ModuleManager::UnloadAll();
ircdproto->SendSquit(Config->ServerName, quitmsg);
delete UplinkSock;
SocketEngine::Shutdown();
@@ -174,11 +173,13 @@ void do_restart_services()
static void services_shutdown()
{
FOREACH_MOD(I_OnPreShutdown, OnPreShutdown());
if (quitmsg.empty())
quitmsg = "Terminating, reason unknown";
Log() << quitmsg;
FOREACH_MOD(I_OnShutdown, OnShutdown());
ModuleManager::UnloadAll();
if (started && UplinkSock)
{
/* Send a quit for all of our bots */
@@ -203,9 +204,6 @@ static void services_shutdown()
delete u;
}
}
FOREACH_MOD(I_OnShutdown, OnShutdown());
ModuleManager::UnloadAll();
ircdproto->SendSquit(Config->ServerName, quitmsg);
delete UplinkSock;
SocketEngine::Shutdown();
@@ -225,7 +223,6 @@ void sighandler(int signum)
#else
quitmsg = Anope::string("Services terminating via signal ") + stringify(signum);
#endif
bool fatal = false;
if (started)
{
@@ -267,17 +264,13 @@ void sighandler(int signum)
#endif
save_databases();
services_shutdown();
quitting = true;
default:
fatal = true;
break;
}
}
FOREACH_MOD(I_OnSignal, OnSignal(signum, quitmsg));
if (fatal)
throw FatalException(quitmsg);
}
/*************************************************************************/