summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2022-05-06 20:13:45 +0200
committersfan5 <sfan5@live.de>2022-05-21 17:49:55 +0200
commit2f32044273d107e82fb1c35d4a0f616fa480cdf0 (patch)
tree65f73c5190558f7b067f482ac89f0eac92a4434b
parent371f21fb350a29ad1ade4ffaf38c07ca1742cd63 (diff)
downloadminetest-2f32044273d107e82fb1c35d4a0f616fa480cdf0.tar.gz
minetest-2f32044273d107e82fb1c35d4a0f616fa480cdf0.tar.bz2
minetest-2f32044273d107e82fb1c35d4a0f616fa480cdf0.zip
Don't ignore server disconnects in client code
If the server stops talking to us without saying bye we should actually end the in-game session with an error message.
-rw-r--r--src/client/client.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/client/client.cpp b/src/client/client.cpp
index cb556c1ce..8ab96b7d1 100644
--- a/src/client/client.cpp
+++ b/src/client/client.cpp
@@ -786,16 +786,18 @@ void Client::peerAdded(con::Peer *peer)
infostream << "Client::peerAdded(): peer->id="
<< peer->id << std::endl;
}
+
void Client::deletingPeer(con::Peer *peer, bool timeout)
{
infostream << "Client::deletingPeer(): "
"Server Peer is getting deleted "
<< "(timeout=" << timeout << ")" << std::endl;
- if (timeout) {
- m_access_denied = true;
+ m_access_denied = true;
+ if (timeout)
m_access_denied_reason = gettext("Connection timed out.");
- }
+ else
+ m_access_denied_reason = gettext("Connection aborted (protocol error?).");
}
/*