X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fservermain.cpp;h=254b1f28aade159080df0d2f6eaa26d6e037e2c6;hb=31572eaf8abd45c0f59bb53004e8521f3ab25e3e;hp=7dcc304a014e585f8c1bac0c95bc5aa7756ba872;hpb=6b6c2d37ea1f9075c4fbf0d7e2d52e527e1f86aa;p=oweals%2Fminetest.git diff --git a/src/servermain.cpp b/src/servermain.cpp index 7dcc304a0..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,12 +128,21 @@ int main(int argc, char *argv[]) DSTACK(__FUNCTION_NAME); - porting.initializePaths(); + 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 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) {