diff options
author | Attila Molnar <attilamolnar@hush.com> | 2015-05-17 18:08:49 +0200 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2015-05-17 18:08:49 +0200 |
commit | c715182bf86532d767c939a344bd4f304d25df09 (patch) | |
tree | ea75e36d26d3a1872e1727f2bffe724c3229fc23 /src/coremods | |
parent | b28782c4a3cd52587d61541bcca4e0b217685c54 (diff) |
Move code that quits all users from InspIRCd::Cleanup() to cmd_die
Diffstat (limited to 'src/coremods')
-rw-r--r-- | src/coremods/core_oper/cmd_die.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/coremods/core_oper/cmd_die.cpp b/src/coremods/core_oper/cmd_die.cpp index 5a9415915..5e7a6afcf 100644 --- a/src/coremods/core_oper/cmd_die.cpp +++ b/src/coremods/core_oper/cmd_die.cpp @@ -29,6 +29,14 @@ CommandDie::CommandDie(Module* parent) syntax = "<password>"; } +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); +} + /** Handle /DIE */ CmdResult CommandDie::Handle (const std::vector<std::string>& parameters, User *user) @@ -41,6 +49,7 @@ CmdResult CommandDie::Handle (const std::vector<std::string>& parameters, User * ServerInstance->SendError(diebuf); } + QuitAll(); ServerInstance->Exit(EXIT_STATUS_DIE); } else |