mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00: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:
parent
04dc4a10f0
commit
7e143cb33d
7 changed files with 43 additions and 7 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue