1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-27 17:28:41 +00:00

Network: Fix serialization version checks (#15477)

This fixes some incorrect assumptions that the read and write version ranges are identical - whereas they're in fact not.
This commit is contained in:
SmallJoker 2024-11-27 18:39:57 +01:00 committed by GitHub
parent 6c324cb871
commit c175046d30
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 46 additions and 49 deletions

View file

@ -8,6 +8,7 @@
#include "network/connection.h"
#include "network/serveropcodes.h"
#include "remoteplayer.h"
#include "serialization.h" // SER_FMT_VER_INVALID
#include "settings.h"
#include "mapblock.h"
#include "serverenvironment.h"
@ -51,6 +52,8 @@ std::string ClientInterface::state2Name(ClientState state)
}
RemoteClient::RemoteClient() :
serialization_version(SER_FMT_VER_INVALID),
m_pending_serialization_version(SER_FMT_VER_INVALID),
m_max_simul_sends(g_settings->getU16("max_simultaneous_block_sends_per_client")),
m_min_time_from_building(
g_settings->getFloat("full_block_send_enable_min_time_from_building")),

View file

@ -7,7 +7,6 @@
#include "irr_v3d.h" // for irrlicht datatypes
#include "constants.h"
#include "serialization.h" // for SER_FMT_VER_INVALID
#include "network/networkpacket.h"
#include "network/networkprotocol.h"
#include "network/address.h"
@ -219,7 +218,7 @@ public:
// Also, the client must be moved to some other container.
session_t peer_id = PEER_ID_INEXISTENT;
// The serialization version to use with the client
u8 serialization_version = SER_FMT_VER_INVALID;
u8 serialization_version;
//
u16 net_proto_version = 0;
@ -333,7 +332,7 @@ public:
private:
// Version is stored in here after INIT before INIT2
u8 m_pending_serialization_version = SER_FMT_VER_INVALID;
u8 m_pending_serialization_version;
/* current state of client */
ClientState m_state = CS_Created;