aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKahrl <kahrl@gmx.net>2015-07-17 08:51:07 +0200
committerKahrl <kahrl@gmx.net>2015-07-17 12:06:30 +0200
commit9c76f379acb12246fb1e282661e67b9da4cdcb62 (patch)
treefc2c271a64da210fa5094ad772a87dd09354f8ca /src
parent2c359da8365fd7816f8dbf341af2d311c4af52ab (diff)
downloadminetest-9c76f379acb12246fb1e282661e67b9da4cdcb62.tar.gz
minetest-9c76f379acb12246fb1e282661e67b9da4cdcb62.tar.bz2
minetest-9c76f379acb12246fb1e282661e67b9da4cdcb62.zip
Display an access denied message when client detects a server timeout
Diffstat (limited to 'src')
-rw-r--r--src/client.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/client.cpp b/src/client.cpp
index 66aac6229..1bd8c39ae 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -743,14 +743,19 @@ bool Client::loadMedia(const std::string &data, const std::string &filename)
// Virtual methods from con::PeerHandler
void Client::peerAdded(con::Peer *peer)
{
- infostream<<"Client::peerAdded(): peer->id="
- <<peer->id<<std::endl;
+ infostream << "Client::peerAdded(): peer->id="
+ << peer->id << std::endl;
}
void Client::deletingPeer(con::Peer *peer, bool timeout)
{
- infostream<<"Client::deletingPeer(): "
+ infostream << "Client::deletingPeer(): "
"Server Peer is getting deleted "
- <<"(timeout="<<timeout<<")"<<std::endl;
+ << "(timeout=" << timeout << ")" << std::endl;
+
+ if (timeout) {
+ m_access_denied = true;
+ m_access_denied_reason = gettext("Connection timed out.");
+ }
}
/*