1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +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

@ -63,7 +63,7 @@ void Client::handleCommand_Hello(NetworkPacket* pkt)
if (pkt->getSize() < 1)
return;
u8 serialization_ver;
u8 serialization_ver; // negotiated value
u16 proto_ver;
u16 unused_compression_mode;
u32 auth_mechs;
@ -80,9 +80,9 @@ void Client::handleCommand_Hello(NetworkPacket* pkt)
<< ", proto_ver=" << proto_ver
<< ". Doing auth with mech " << chosen_auth_mechanism << std::endl;
if (!ser_ver_supported(serialization_ver)) {
if (!ser_ver_supported_read(serialization_ver)) {
infostream << "Client: TOCLIENT_HELLO: Server sent "
<< "unsupported ser_fmt_ver"<< std::endl;
<< "unsupported ser_fmt_ver=" << (int)serialization_ver << std::endl;
return;
}