From: Perttu Ahola Date: Mon, 4 Jun 2012 19:34:22 +0000 (+0300) Subject: Add ignore_world_load_errors configuration option and provide better error messages X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=f48882213e31c47660cf0c87df1e04e51db9b50a;p=zefram%2Fminetest%2Fminetest_engine.git Add ignore_world_load_errors configuration option and provide better error messages --- diff --git a/minetest.conf.example b/minetest.conf.example index 14e3f776..7a8a2719 100644 --- a/minetest.conf.example +++ b/minetest.conf.example @@ -178,4 +178,7 @@ # To reduce lag, block transfers are slowed down when a player is building something. # This determines how long they are slowed down after placing or removing a node. #full_block_send_enable_min_time_from_building = 2.0 - +# Length of a server tick in dedicated server +#dedicated_server_step = 0.05 +# Can be set to true to disable shutting down on invalid world data +#ignore_world_load_errors = false diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp index ab6866ce..d0ed22c2 100644 --- a/src/defaultsettings.cpp +++ b/src/defaultsettings.cpp @@ -137,5 +137,6 @@ void set_default_settings(Settings *settings) settings->setDefault("server_map_save_interval", "5.3"); settings->setDefault("full_block_send_enable_min_time_from_building", "2.0"); settings->setDefault("dedicated_server_step", "0.05"); + settings->setDefault("ignore_world_load_errors", "false"); } diff --git a/src/map.cpp b/src/map.cpp index 10dba3de..647b9fe1 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -3378,14 +3378,20 @@ void ServerMap::loadBlock(std::string *blob, v3s16 p3d, MapSector *sector, bool } catch(SerializationError &e) { - infostream<<"WARNING: Invalid block data in database " - <<" (SerializationError). " - <<"what()="<getBool("ignore_world_load_errors")){ + errorstream<<"Ignoring block load error. Duck and cover! " + <<"(ignore_world_load_errors)"<= 23) + if(version >= 23){ + TRACESTREAM(<<"MapBlock::deSerialize "<getBool("enable_mapgen_debug_info"); + + v3s16 last_tried_pos(-32768,-32768,-32768); // For error output /* Get block info from queue, emerge them and send them @@ -181,6 +183,8 @@ void * EmergeThread::Thread() v3s16 &p = q->pos; v2s16 p2d(p.X,p.Z); + + last_tried_pos = p; /* Do not generate over-limit @@ -377,8 +381,23 @@ void * EmergeThread::Thread() } catch(VersionMismatchException &e) { - m_server->setAsyncFatalError(std::string( - "World data version mismatch (server-side) (world probably saved by a newer version of Minetest): ")+e.what()); + std::ostringstream err; + err<<"World data version mismatch in MapBlock "<setAsyncFatalError(err.str()); + } + catch(SerializationError &e) + { + std::ostringstream err; + err<<"Invalid data in MapBlock "<setAsyncFatalError(err.str()); } END_DEBUG_EXCEPTION_HANDLER(errorstream)