From d065bae323838734556de2693b6b004c98c95092 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Tue, 15 Feb 2011 16:11:24 +0200 Subject: Ctrl+C handling on POSIX, some commands for server and other tweaking --- src/servermain.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'src/servermain.cpp') diff --git a/src/servermain.cpp b/src/servermain.cpp index 1c301d4f5..254b1f28a 100644 --- a/src/servermain.cpp +++ b/src/servermain.cpp @@ -98,7 +98,6 @@ std::ostream *derr_server_ptr = &dstream; std::ostream *dout_client_ptr = &dstream; std::ostream *derr_client_ptr = &dstream; - /* gettime.h implementation */ @@ -129,6 +128,9 @@ int main(int argc, char *argv[]) DSTACK(__FUNCTION_NAME); + porting::signal_handler_init(); + bool &kill = *porting::signal_handler_killstatus(); + porting::initializePaths(); initializeMaterialProperties(); @@ -251,6 +253,11 @@ int main(int argc, char *argv[]) srand(time(0)); mysrand(time(0)); + // Initialize stuff + + init_mapnode(); + init_mineral(); + /* Run unit tests */ @@ -260,11 +267,6 @@ int main(int argc, char *argv[]) run_tests(); } - // Initialize stuff - - init_mapnode(); - init_mineral(); - /* Check parameters */ @@ -308,9 +310,9 @@ int main(int argc, char *argv[]) // Create server Server server(map_dir.c_str()); server.start(port); - + // Run server - dedicated_server_loop(server); + dedicated_server_loop(server, kill); } //try catch(con::PeerNotFoundException &e) -- cgit v1.2.3