mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-14 17:15:21 +02:00
Manually configurable minimum protocol version (#14054)
Partially address #13483. Server operators can set a minimum protocol version to match the game requirements (or any other restriction they may want), and it's applied as an additional constraint on top of the baseline compatibility range, optional strict_protocol_version_checking, and any kick-on-join used by the game/mods.
This commit is contained in:
@@ -147,10 +147,8 @@ void Server::handleCommand_Init(NetworkPacket* pkt)
|
||||
|
||||
client->net_proto_version = net_proto_version;
|
||||
|
||||
if ((g_settings->getBool("strict_protocol_version_checking") &&
|
||||
net_proto_version != LATEST_PROTOCOL_VERSION) ||
|
||||
net_proto_version < SERVER_PROTOCOL_VERSION_MIN ||
|
||||
net_proto_version > SERVER_PROTOCOL_VERSION_MAX) {
|
||||
if (net_proto_version < Server::getProtocolVersionMin() ||
|
||||
net_proto_version > Server::getProtocolVersionMax()) {
|
||||
actionstream << "Server: A mismatched client tried to connect from " <<
|
||||
addr_s << " proto_max=" << (int)max_net_proto_version << std::endl;
|
||||
DenyAccess(peer_id, SERVER_ACCESSDENIED_WRONG_VERSION);
|
||||
|
Reference in New Issue
Block a user