Catch SendFailedException when replying back in Connection::Receive()
[oweals/minetest.git] / src / main.cpp
index 02cae0317858310073f7aed49e4186b583403ba0..be983676e31f11f6615b028b475dbf48be5aa2b3 100644 (file)
@@ -1074,15 +1074,15 @@ void drawMenuBackground(video::IVideoDriver* driver)
        }
 }
 
-class DstreamLogOutput: public ILogOutput
+class StderrLogOutput: public ILogOutput
 {
 public:
        /* line: Full line with timestamp, level and thread */
        void printLog(const std::string &line)
        {
-               dstream<<line<<std::endl;
+               std::cerr<<line<<std::endl;
        }
-} main_dstream_log_out;
+} main_stderr_log_out;
 
 class DstreamNoStderrLogOutput: public ILogOutput
 {
@@ -1100,7 +1100,7 @@ int main(int argc, char *argv[])
                Initialization
        */
 
-       log_add_output_maxlev(&main_dstream_log_out, LMT_ACTION);
+       log_add_output_maxlev(&main_stderr_log_out, LMT_ACTION);
        log_add_output_all_levs(&main_dstream_no_stderr_log_out);
 
        log_register_thread("main");
@@ -1175,7 +1175,7 @@ int main(int argc, char *argv[])
 #endif
        
        if(cmd_args.getFlag("info-on-stderr"))
-               log_add_output(&main_dstream_log_out, LMT_INFO);
+               log_add_output(&main_stderr_log_out, LMT_INFO);
 
        porting::signal_handler_init();
        bool &kill = *porting::signal_handler_killstatus();
@@ -1186,13 +1186,13 @@ int main(int argc, char *argv[])
        // Create user data directory
        fs::CreateDir(porting::path_userdata);
 
-       init_gettext((porting::path_data+"/../locale").c_str());
+       init_gettext((porting::path_data+DIR_DELIM+".."+DIR_DELIM+"locale").c_str());
        
        // Initialize debug streams
 #ifdef RUN_IN_PLACE
        std::string debugfile = DEBUGFILE;
 #else
-       std::string debugfile = porting::path_userdata+"/"+DEBUGFILE;
+       std::string debugfile = porting::path_userdata+DIR_DELIM+DEBUGFILE;
 #endif
        debugstreams_init(disable_stderr, debugfile.c_str());
        // Initialize debug stacks
@@ -1244,9 +1244,11 @@ int main(int argc, char *argv[])
        else
        {
                core::array<std::string> filenames;
-               filenames.push_back(porting::path_userdata + "/minetest.conf");
+               filenames.push_back(porting::path_userdata +
+                               DIR_DELIM + "minetest.conf");
 #ifdef RUN_IN_PLACE
-               filenames.push_back(porting::path_userdata + "/../minetest.conf");
+               filenames.push_back(porting::path_userdata +
+                               DIR_DELIM + ".." + DIR_DELIM + "minetest.conf");
 #endif
 
                for(u32 i=0; i<filenames.size(); i++)
@@ -1308,7 +1310,7 @@ int main(int argc, char *argv[])
                port = 30000;
        
        // Map directory
-       std::string map_dir = porting::path_userdata+"/world";
+       std::string map_dir = porting::path_userdata+DIR_DELIM+"world";
        if(cmd_args.exists("map-dir"))
                map_dir = cmd_args.get("map-dir");
        else if(g_settings->exists("map-dir"))