1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-26 18:21:04 +00:00

strict_protocol_version_checking setting; PROTOCOL_VERSION in clientserver.h; clean up defaultsettings.cpp and minetest.conf.example

This commit is contained in:
Perttu Ahola 2011-10-15 15:02:28 +03:00
parent 74febd5c31
commit 94dfececf6
5 changed files with 32 additions and 16 deletions

View file

@ -22,6 +22,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "utility.h"
#define PROTOCOL_VERSION 3
#define PROTOCOL_ID 0x4f457403
#define PASSWORD_SIZE 28 // Maximum password length. Allows for

View file

@ -76,18 +76,19 @@ void set_default_settings(Settings *settings)
settings->setDefault("screenshot_path", ".");
// Server stuff
// "map-dir" doesn't exist by default.
settings->setDefault("motd", "");
settings->setDefault("max_users", "20");
settings->setDefault("enable_experimental", "false");
settings->setDefault("strict_protocol_version_checking", "true");
settings->setDefault("creative_mode", "false");
settings->setDefault("enable_damage", "true");
settings->setDefault("fixed_map_seed", "");
settings->setDefault("give_initial_stuff", "false");
settings->setDefault("default_password", "");
settings->setDefault("default_privs", "build, shout");
settings->setDefault("profiler_print_interval", "0");
settings->setDefault("enable_mapgen_debug_info", "false");
settings->setDefault("fixed_map_seed", "");
settings->setDefault("objectdata_interval", "0.2");
settings->setDefault("active_object_send_range_blocks", "3");
settings->setDefault("active_block_range", "5");
@ -100,8 +101,8 @@ void set_default_settings(Settings *settings)
settings->setDefault("time_send_interval", "20");
settings->setDefault("time_speed", "96");
settings->setDefault("server_unload_unused_data_timeout", "60");
settings->setDefault("server_map_save_interval", "60");
settings->setDefault("server_map_save_interval", "10");
settings->setDefault("full_block_send_enable_min_time_from_building", "2.0");
//settings->setDefault("dungeon_rarity", "0.025");
settings->setDefault("enable_experimental", "false");
}

View file

@ -1927,11 +1927,14 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
}
/* Uhh... this should actually be a warning but let's do it like this */
if(net_proto_version < 2)
if(g_settings->getBool("strict_protocol_version_checking"))
{
SendAccessDenied(m_con, peer_id,
L"Your client is too old. Please upgrade.");
return;
if(net_proto_version < PROTOCOL_VERSION)
{
SendAccessDenied(m_con, peer_id,
L"Your client is too old. Please upgrade.");
return;
}
}
/*
@ -2110,9 +2113,9 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
}
// Warnings about protocol version can be issued here
if(getClient(peer->id)->net_proto_version < 3)
if(getClient(peer->id)->net_proto_version < PROTOCOL_VERSION)
{
SendChatMessage(peer_id, L"# Server: WARNING: YOUR CLIENT IS OLD AND DOES NOT WORK PROPERLY WITH THIS SERVER");
SendChatMessage(peer_id, L"# Server: WARNING: YOUR CLIENT IS OLD AND MAY WORK PROPERLY WITH THIS SERVER");
}
/*