diff options
author | Perttu Ahola <celeron55@gmail.com> | 2011-02-15 16:11:24 +0200 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2011-02-15 16:11:24 +0200 |
commit | d065bae323838734556de2693b6b004c98c95092 (patch) | |
tree | c51888cc0c2628f1a3e5cd2ba05b4297c2a22869 /src/servermain.cpp | |
parent | be7391c2b1153c817a69aabd2a34e082c79df58f (diff) | |
download | minetest-d065bae323838734556de2693b6b004c98c95092.tar.gz minetest-d065bae323838734556de2693b6b004c98c95092.tar.bz2 minetest-d065bae323838734556de2693b6b004c98c95092.zip |
Ctrl+C handling on POSIX, some commands for server and other tweaking
Diffstat (limited to 'src/servermain.cpp')
-rw-r--r-- | src/servermain.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
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) |