diff options
Diffstat (limited to 'src/server/worldserver/Main.cpp')
-rw-r--r-- | src/server/worldserver/Main.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/server/worldserver/Main.cpp b/src/server/worldserver/Main.cpp index 0c051eae37a..206103608a4 100644 --- a/src/server/worldserver/Main.cpp +++ b/src/server/worldserver/Main.cpp @@ -158,6 +158,9 @@ extern int main(int argc, char** argv) // Set signal handlers (this must be done before starting io_service threads, because otherwise they would unblock and exit) boost::asio::signal_set signals(_ioService, SIGINT, SIGTERM); +#if PLATFORM == PLATFORM_WINDOWS + signals.add(SIGBREAK); +#endif signals.async_wait(SignalHandler); // Start the Boost based thread pool @@ -367,18 +370,10 @@ void WorldUpdateLoop() } } -void SignalHandler(const boost::system::error_code& error, int signalNumber) +void SignalHandler(const boost::system::error_code& error, int /*signalNumber*/) { if (!error) - { - switch (signalNumber) - { - case SIGINT: - case SIGTERM: - World::StopNow(SHUTDOWN_EXIT_CODE); - break; - } - } + World::StopNow(SHUTDOWN_EXIT_CODE); } void FreezeDetectorHandler(const boost::system::error_code& error) @@ -540,6 +535,9 @@ void ClearOnlineAccounts() variables_map GetConsoleArguments(int argc, char** argv, std::string& configFile, std::string& configService) { + // Silences warning about configService not be used if the OS is not Windows + (void)configService; + options_description all("Allowed options"); all.add_options() ("help,h", "print usage message") |