From c715182bf86532d767c939a344bd4f304d25df09 Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Sun, 17 May 2015 18:08:49 +0200 Subject: Move code that quits all users from InspIRCd::Cleanup() to cmd_die --- src/coremods/core_oper/cmd_die.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/coremods') 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 = ""; } +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& parameters, User *user) @@ -41,6 +49,7 @@ CmdResult CommandDie::Handle (const std::vector& parameters, User * ServerInstance->SendError(diebuf); } + QuitAll(); ServerInstance->Exit(EXIT_STATUS_DIE); } else -- cgit v1.2.3