diff --git a/cmake/Modules/freeminer_src.cmake b/cmake/Modules/freeminer_src.cmake index 514250ba0..1f7476a02 100644 --- a/cmake/Modules/freeminer_src.cmake +++ b/cmake/Modules/freeminer_src.cmake @@ -113,6 +113,9 @@ if(ENABLE_OSMIUM AND (OSMIUM_INCLUDE_DIR OR EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/m set(BUILD_DATA_TESTS 0 CACHE INTERNAL "") set(BUILD_EXAMPLES 0 CACHE INTERNAL "") set(BUILD_BENCHMARKS 0 CACHE INTERNAL "") + set(Osmium_USE_GEOS 0 CACHE INTERNAL "") + set(Osmium_USE_GDAL 0 CACHE INTERNAL "") + set(CPPCHECK 0 CACHE INTERNAL "") if(NOT OSMIUM_INCLUDE_DIR) add_subdirectory(mapgen/earth/libosmium) diff --git a/src/fm_server.cpp b/src/fm_server.cpp index 7f6973a1f..ac78c0211 100644 --- a/src/fm_server.cpp +++ b/src/fm_server.cpp @@ -695,7 +695,7 @@ void Server::SendBlockFm(session_t peer_id, MapBlockPtr block, u8 ver, PACK(TOCLIENT_BLOCKDATA_POS, block->getPos()); std::ostringstream os(std::ios_base::binary); - block->serialize(os, ver, false, net_compression_level, net_proto_version >= 1); + block->serialize(os, ver, false, net_compression_level); block->serializeNetworkSpecific(os); PACK(TOCLIENT_BLOCKDATA_DATA, os.str()); diff --git a/src/mapblock.cpp b/src/mapblock.cpp index 27298dd1b..971bac05a 100644 --- a/src/mapblock.cpp +++ b/src/mapblock.cpp @@ -594,7 +594,7 @@ void MapBlock::correctBlockNodeIds(const NameIdMapping *nimap, MapNode *nodes, } } -void MapBlock::serialize(std::ostream &os_compressed, u8 version, bool disk, int compression_level, bool use_content_only) +void MapBlock::serialize(std::ostream &os_compressed, u8 version, bool disk, int compression_level) { if (!ser_ver_supported_write(version)) throw VersionMismatchException("ERROR: MapBlock format not supported"); @@ -630,10 +630,6 @@ void MapBlock::serialize(std::ostream &os_compressed, u8 version, bool disk, int writeU16(os, m_lighting_complete); } - // fmtodo: check version and dont pack data if more than 20150427 or 0.4.12.7+ -// if (!disk && use_content_only && m_is_mono_block) -// return; - /* Bulk node data */ @@ -797,15 +793,6 @@ bool MapBlock::deSerialize(std::istream &in_compressed, u8 version, bool disk) } } -/* - if (!disk && m_is_mono_block) { - auto n = MapNode(content_only, content_only_param1, content_only_param2); - for (u32 i = 0; i < MAP_BLOCKSIZE*MAP_BLOCKSIZE*MAP_BLOCKSIZE; i++) - data[i] = n; - return true; - } -*/ - TRACESTREAM(<<"MapBlock::deSerialize "<(); + auto packet = msg.get().as(); const auto it = packet.find(MAPBLOCK_LIGHT_POINTS); if (it != packet.end()) { - it->second.convert(m_light_points); + try { + it->second.convert(m_light_points); + } catch (const std::exception &ex) { + verbosestream << "MapBlock::deSerialize freeminer: pos=" << getPos() + << " size=" << data.size() + << " packet=" << packet.size() << " ex=" << ex.what() + << std::endl; + } } } } diff --git a/src/mapblock.h b/src/mapblock.h index c47874998..a2123a949 100644 --- a/src/mapblock.h +++ b/src/mapblock.h @@ -456,7 +456,7 @@ public: // These don't write or read version by itself // Set disk to true for on-disk format, false for over-the-network format // Precondition: version >= SER_FMT_VER_LOWEST_WRITE - void serialize(std::ostream &result, u8 version, bool disk, int compression_level, bool use_content_only = false); + void serialize(std::ostream &result, u8 version, bool disk, int compression_level); // If disk == true: In addition to doing other things, will add // unknown blocks from id-name mapping to wndef bool deSerialize(std::istream &is, u8 version, bool disk); diff --git a/src/server.cpp b/src/server.cpp index dbdf0b9d4..ec4d1268b 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -690,9 +690,14 @@ void Server::start() std::cerr << " ___ " << g_version_hash << std::endl; } - actionstream << "\033[1mfree\033[1;33mminer \033[1;36mv" << g_version_hash << "\033[0m \t" +#if USE_POS32 + << " map" << USE_POS32 << " \t" +#endif +#if USE_OPOS32 + << " obj" << USE_OPOS64 << " \t" +#endif #if ENABLE_THREADS << " threads \t" #endif @@ -717,12 +722,17 @@ void Server::start() << " msan \t" #endif #endif +#if defined(__has_feature) +#if __has_feature(undefined_behavior_sanitizer) + << " ubsan \t" +#endif +#endif #if USE_MULTI << " multi: \t" #endif #if MINETEST_PROTO && MINETEST_TRANSPORT - << " mt " << SERVER_PROTOCOL_VERSION_MIN << "-" - << LATEST_PROTOCOL_VERSION << "\t" + << " mt " << SERVER_PROTOCOL_VERSION_MIN << "-" << LATEST_PROTOCOL_VERSION + << "\t" #endif #if USE_SCTP << " sctp \t" @@ -750,12 +760,12 @@ void Server::start() #endif << std::endl; - actionstream << "World at [" << m_path_world << "]" << std::endl; - actionstream << "Server for gameid=\"" << m_gamespec.id - << "\" mapgen=\"" << Mapgen::getMapgenName(m_emerge->mgparams->mgtype) - << "\" listening on "; - m_bind_addr.print(actionstream); - actionstream << "." << std::endl; + actionstream << "World at [" << m_path_world << "]" << std::endl; + actionstream << "Server for gameid=\"" << m_gamespec.id << "\" mapgen=\"" + << Mapgen::getMapgenName(m_emerge->mgparams->mgtype) + << "\" listening on "; + m_bind_addr.print(actionstream); + actionstream << "." << std::endl; } void Server::stop()