diff options
author | Peter Powell <petpow@saberuk.com> | 2019-02-05 17:26:19 +0000 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2019-02-05 17:26:19 +0000 |
commit | 01451ab26ef427267effead17d526d2b20fd3e8b (patch) | |
tree | b90c0611b7abc8756d1720ae9f9f1bc40df4f47a /src | |
parent | bf046f87c8d322939c6a883a405056003b8b1abd (diff) |
Quit users during cleanup instead of when /DIE is executed.
Diffstat (limited to 'src')
-rw-r--r-- | src/coremods/core_oper/cmd_die.cpp | 9 | ||||
-rw-r--r-- | src/inspircd.cpp | 6 |
2 files changed, 6 insertions, 9 deletions
diff --git a/src/coremods/core_oper/cmd_die.cpp b/src/coremods/core_oper/cmd_die.cpp index 8b80dd115..724db2f32 100644 --- a/src/coremods/core_oper/cmd_die.cpp +++ b/src/coremods/core_oper/cmd_die.cpp @@ -30,14 +30,6 @@ CommandDie::CommandDie(Module* parent, std::string& hashref) syntax = "<server>"; } -static void QuitAll() -{ - const std::string quitmsg = "Server shutdown"; - const UserManager::LocalList& list = ServerInstance->Users.GetLocalUsers(); - while (!list.empty()) - ServerInstance->Users.QuitUser(list.front(), quitmsg); -} - void DieRestart::SendError(const std::string& message) { ClientProtocol::Messages::Error errormsg(message); @@ -70,7 +62,6 @@ CmdResult CommandDie::Handle(User* user, const Params& parameters) DieRestart::SendError(diebuf); } - QuitAll(); ServerInstance->Exit(EXIT_STATUS_DIE); } else diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 94132cf95..b6c252104 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -94,6 +94,12 @@ void InspIRCd::Cleanup() } ports.clear(); + // Disconnect all local users + const std::string quitmsg = "Server shutting down"; + const UserManager::LocalList& list = Users.GetLocalUsers(); + while (!list.empty()) + ServerInstance->Users.QuitUser(list.front(), quitmsg); + GlobalCulls.Apply(); Modules->UnloadAll(); |