X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fservermain.cpp;h=254b1f28aade159080df0d2f6eaa26d6e037e2c6;hb=31572eaf8abd45c0f59bb53004e8521f3ab25e3e;hp=594f7f4a236c8657bc7f71f89b363dd366d14da0;hpb=4ba5cd580d86710b54f4b523db4e8710fb56fdb6;p=oweals%2Fminetest.git diff --git a/src/servermain.cpp b/src/servermain.cpp index 594f7f4a2..254b1f28a 100644 --- a/src/servermain.cpp +++ b/src/servermain.cpp @@ -25,12 +25,13 @@ with this program; if not, write to the Free Software Foundation, Inc., #ifndef SERVER #ifdef _WIN32 + #pragma error ("For a server build, SERVER must be defined globally") #else #error "For a server build, SERVER must be defined globally" #endif #endif -#ifdef UNITTEST_DISABLE +#ifdef NDEBUG #ifdef _WIN32 #pragma message ("Disabling unit tests") #else @@ -66,6 +67,8 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "strfnd.h" #include "porting.h" #include "materials.h" +#include "config.h" +#include "mineral.h" /* Settings. @@ -76,6 +79,9 @@ Settings g_settings; extern void set_default_settings(); +// A dummy thing +ITextureSource *g_texturesource = NULL; + /* Debug streams */ @@ -92,7 +98,6 @@ std::ostream *derr_server_ptr = &dstream; std::ostream *dout_client_ptr = &dstream; std::ostream *derr_client_ptr = &dstream; - /* gettime.h implementation */ @@ -123,8 +128,21 @@ int main(int argc, char *argv[]) DSTACK(__FUNCTION_NAME); + porting::signal_handler_init(); + bool &kill = *porting::signal_handler_killstatus(); + + porting::initializePaths(); + initializeMaterialProperties(); + BEGIN_DEBUG_EXCEPTION_HANDLER + + // Print startup message + dstream< filenames; + filenames.push_back(porting::path_userdata + "/minetest.conf"); +#ifdef RUN_IN_PLACE + filenames.push_back(porting::path_userdata + "/../minetest.conf"); +#endif - for(u32 i=0; i<2; i++) + for(u32 i=0; i list = server.getPlayerInfo(); - core::list::Iterator i; - static u32 sum_old = 0; - u32 sum = PIChecksum(list); - if(sum != sum_old) - { - std::cout<PrintLine(&std::cout); - } - } - sum_old = sum; - } - } - + // Run server + dedicated_server_loop(server, kill); + } //try catch(con::PeerNotFoundException &e) { dstream<