aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-11-29 22:23:03 +0200
committerPerttu Ahola <celeron55@gmail.com>2011-11-29 22:23:03 +0200
commit4bcff65ad08db0aba80505602ea2a4844b7c3ea4 (patch)
tree0197fcd48bb62833b90f8861a859c443abfbdf0b /src
parente5d372f2389c74ae7660048dc3e98df6a940dee4 (diff)
downloadminetest-4bcff65ad08db0aba80505602ea2a4844b7c3ea4.tar.gz
minetest-4bcff65ad08db0aba80505602ea2a4844b7c3ea4.tar.bz2
minetest-4bcff65ad08db0aba80505602ea2a4844b7c3ea4.zip
Better version match fail messages from server
Diffstat (limited to 'src')
-rw-r--r--src/server.cpp24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/server.cpp b/src/server.cpp
index 4cabcda0c..64e67c465 100644
--- a/src/server.cpp
+++ b/src/server.cpp
@@ -2069,8 +2069,11 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
infostream<<"Server: Cannot negotiate "
"serialization version with peer "
<<peer_id<<std::endl;
- SendAccessDenied(m_con, peer_id,
- L"Your client is too old (map format)");
+ SendAccessDenied(m_con, peer_id, std::wstring(
+ L"Your client's version is not supported.\n"
+ L"Server version is ")
+ + narrow_to_wide(VERSION_STRING) + L"."
+ );
return;
}
@@ -2088,18 +2091,23 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
if(net_proto_version == 0)
{
- SendAccessDenied(m_con, peer_id,
- L"Your client is too old. Please upgrade.");
+ SendAccessDenied(m_con, peer_id, std::wstring(
+ L"Your client's version is not supported.\n"
+ L"Server version is ")
+ + narrow_to_wide(VERSION_STRING) + L"."
+ );
return;
}
- /* Uhh... this should actually be a warning but let's do it like this */
if(g_settings->getBool("strict_protocol_version_checking"))
{
- if(net_proto_version < PROTOCOL_VERSION)
+ if(net_proto_version != PROTOCOL_VERSION)
{
- SendAccessDenied(m_con, peer_id,
- L"Your client is too old. Please upgrade.");
+ SendAccessDenied(m_con, peer_id, std::wstring(
+ L"Your client's version is not supported.\n"
+ L"Server version is ")
+ + narrow_to_wide(VERSION_STRING) + L"."
+ );
return;
}
}