1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Network: offload often changed constants to source file (#15207)

* Network: offload often changed constants to source file

This prevents unnecessary recompiling when using incremental builds.
There is also no need to have separate max proto version variables;
as they're subject to the handshake between client and server. The
code is also expected to support the same version (or higher).

Co-authored-by: sfan5 <sfan5@live.de>
This commit is contained in:
SmallJoker 2024-10-02 11:01:30 +02:00 committed by GitHub
parent 22ef4c8be1
commit 3797ca52c4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 92 additions and 241 deletions

View file

@ -1147,7 +1147,7 @@ void Client::sendInit(const std::string &playerName)
NetworkPacket pkt(TOSERVER_INIT, 1 + 2 + 2 + (1 + playerName.size()));
pkt << (u8) SER_FMT_VER_HIGHEST_READ << (u16) 0;
pkt << (u16) CLIENT_PROTOCOL_VERSION_MIN << (u16) CLIENT_PROTOCOL_VERSION_MAX;
pkt << CLIENT_PROTOCOL_VERSION_MIN << LATEST_PROTOCOL_VERSION;
pkt << playerName;
Send(&pkt);