mirror of
https://github.com/luanti-org/luanti.git
synced 2025-11-12 20:55:27 +01: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:
@@ -135,10 +135,10 @@ void Server::handleCommand_Init(NetworkPacket* pkt)
|
||||
|
||||
// Figure out a working version if it is possible at all
|
||||
if (max_net_proto_version >= SERVER_PROTOCOL_VERSION_MIN ||
|
||||
min_net_proto_version <= SERVER_PROTOCOL_VERSION_MAX) {
|
||||
min_net_proto_version <= LATEST_PROTOCOL_VERSION) {
|
||||
// If maximum is larger than our maximum, go with our maximum
|
||||
if (max_net_proto_version > SERVER_PROTOCOL_VERSION_MAX)
|
||||
net_proto_version = SERVER_PROTOCOL_VERSION_MAX;
|
||||
if (max_net_proto_version > LATEST_PROTOCOL_VERSION)
|
||||
net_proto_version = LATEST_PROTOCOL_VERSION;
|
||||
// Else go with client's maximum
|
||||
else
|
||||
net_proto_version = max_net_proto_version;
|
||||
|
||||
Reference in New Issue
Block a user