aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client.h3
-rw-r--r--src/defaultsettings.cpp2
-rw-r--r--src/game.cpp21
3 files changed, 24 insertions, 2 deletions
diff --git a/src/client.h b/src/client.h
index a7eb22ad9..b479062a0 100644
--- a/src/client.h
+++ b/src/client.h
@@ -499,6 +499,9 @@ public:
u8 getProtoVersion()
{ return m_proto_ver; }
+ bool connectedToServer()
+ { return m_con.Connected(); }
+
float mediaReceiveProgress();
void afterContentReceived(IrrlichtDevice *device);
diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp
index 42b232afc..7c6f7ef3d 100644
--- a/src/defaultsettings.cpp
+++ b/src/defaultsettings.cpp
@@ -190,7 +190,7 @@ void set_default_settings(Settings *settings)
settings->setDefault("minimap_shape_round", "true");
settings->setDefault("minimap_double_scan_height", "true");
- settings->setDefault("send_pre_v25_init", "true");
+ settings->setDefault("send_pre_v25_init", "false");
settings->setDefault("curl_timeout", "5000");
settings->setDefault("curl_parallel_limit", "8");
diff --git a/src/game.cpp b/src/game.cpp
index 1a036d03a..5a3b10879 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -2403,7 +2403,26 @@ bool Game::connectToServer(const std::string &playername,
wait_time += dtime;
// Only time out if we aren't waiting for the server we started
if ((*address != "") && (wait_time > 10)) {
- *error_message = "Connection timed out.";
+ bool sent_old_init = g_settings->getFlag("send_pre_v25_init");
+ // If no pre v25 init was sent, and no answer was received,
+ // but the low level connection could be established
+ // (meaning that we have a peer id), then we probably wanted
+ // to connect to a legacy server. In this case, tell the user
+ // to enable the option to be able to connect.
+ if (!sent_old_init &&
+ (client->getProtoVersion() == 0) &&
+ client->connectedToServer()) {
+ *error_message = "Connection failure: init packet not "
+ "recognized by server.\n"
+ "Most likely the server uses an old protocol version (<v25).\n"
+ "Please ask the server owner to update to 0.4.13 or later.\n"
+ "To still connect to the server in the meantime,\n"
+ "you can enable the 'send_pre_v25_init' setting by editing minetest.conf,\n"
+ "or by enabling the 'Client -> Network -> Support older Servers'\n"
+ "entry in the advanced settings menu.";
+ } else {
+ *error_message = "Connection timed out.";
+ }
errorstream << *error_message << std::endl;
break;
}