mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-02 16:38:41 +00:00
Ctrl+C handling on POSIX, some commands for server and other tweaking
This commit is contained in:
parent
be7391c2b1
commit
d065bae323
13 changed files with 384 additions and 111 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue