sound_is_dummy = true;
}
+ Server *server = NULL;
+
+ try{
// Event manager
EventManager eventmgr;
/*
Create server.
- SharedPtr will delete it when it goes out of scope.
*/
- SharedPtr<Server> server;
+
if(address == ""){
draw_load_screen(L"Creating server...", driver, font);
infostream<<"Creating server"<<std::endl;
server->start(port);
}
- try{
do{ // Client scope (breakable do-while(0))
/*
L" running a different version of Minetest.";
errorstream<<wide_to_narrow(error_message)<<std::endl;
}
+ catch(ServerError &e)
+ {
+ error_message = narrow_to_wide(e.what());
+ errorstream<<wide_to_narrow(error_message)<<std::endl;
+ }
+ catch(ModError &e)
+ {
+ errorstream<<e.what()<<std::endl;
+ error_message = narrow_to_wide(e.what()) + wgettext("\nCheck debug.txt for details.");
+ }
+
+
if(!sound_is_dummy)
delete sound;
+ //has to be deleted first to stop all server threads
+ delete server;
+
delete tsrc;
delete shsrc;
delete nodedef;
error_message = wgettext("Connection error (timed out?)");
errorstream<<wide_to_narrow(error_message)<<std::endl;
}
- catch(ServerError &e)
- {
- error_message = narrow_to_wide(e.what());
- errorstream<<wide_to_narrow(error_message)<<std::endl;
- }
- catch(ModError &e)
- {
- errorstream<<e.what()<<std::endl;
- error_message = narrow_to_wide(e.what()) + wgettext("\nCheck debug.txt for details.");
- }
#ifdef NDEBUG
catch(std::exception &e)
{