mirror of
https://github.com/bdnugget/freeminer.git
synced 2026-11-07 06:57:27 +00:00
fix
This commit is contained in:
1 parent
d1f466c051
commit
ef76905652
5 files changed
+36
-28
No files matched your search
@@ -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)
|
||||
|
||||
+1
-1
@@ -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());
|
||||
|
||||
+12
-17
@@ -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 "<<getPos()
|
||||
<<": Bulk node data"<<std::endl);
|
||||
u8 content_width = readU8(is);
|
||||
@@ -909,15 +896,23 @@ bool MapBlock::deSerialize(std::istream &in_compressed, u8 version, bool disk)
|
||||
}
|
||||
|
||||
if (flags & (1 << 7)) {
|
||||
size_t size = 0;
|
||||
std::string data = deSerializeString32(is);
|
||||
size = data.size();
|
||||
if (!data.empty()) {
|
||||
msgpack::unpacked msg;
|
||||
msgpack::unpack(msg, data.data(), data.size());
|
||||
auto &obj = msg.get();
|
||||
auto packet = obj.as<MsgpackPacket>();
|
||||
auto packet = msg.get().as<MsgpackPacket>();
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -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);
|
||||
|
||||
+19
-9
@@ -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()
|
||||
|
||||
Reference in new issue
Block a user