summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/clientserver.h2
-rw-r--r--src/defaultsettings.cpp11
-rw-r--r--src/server.cpp15
3 files changed, 17 insertions, 11 deletions
diff --git a/src/clientserver.h b/src/clientserver.h
index b96cc61aa..0f6925696 100644
--- a/src/clientserver.h
+++ b/src/clientserver.h
@@ -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
diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp
index 05b0611e9..2f4147a99 100644
--- a/src/defaultsettings.cpp
+++ b/src/defaultsettings.cpp
@@ -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");
}
diff --git a/src/server.cpp b/src/server.cpp
index 59f7477a9..828eadbf3 100644
--- a/src/server.cpp
+++ b/src/server.cpp
@@ -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");
}
/*