mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 16:45:20 +02:00
Fixed a temporary solution of server shutting down to an assert(0) when a too large block metadata is sent to an old client
This commit is contained in:
@@ -2109,9 +2109,17 @@ void MapBlock::serialize(std::ostream &os, u8 version)
|
||||
{
|
||||
if(version <= 15)
|
||||
{
|
||||
std::ostringstream oss(std::ios_base::binary);
|
||||
m_node_metadata.serialize(oss);
|
||||
os<<serializeString(oss.str());
|
||||
try{
|
||||
std::ostringstream oss(std::ios_base::binary);
|
||||
m_node_metadata.serialize(oss);
|
||||
os<<serializeString(oss.str());
|
||||
}
|
||||
// This will happen if the string is longer than 65535
|
||||
catch(SerializationError &e)
|
||||
{
|
||||
// Use an empty string
|
||||
os<<serializeString("");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user