aboutsummaryrefslogtreecommitdiff
path: root/src/servermain.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/servermain.cpp')
-rw-r--r--src/servermain.cpp18
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)