summaryrefslogtreecommitdiffstats
path: root/src/ClientHandle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ClientHandle.cpp')
-rw-r--r--src/ClientHandle.cpp22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp
index ffb968a0c..9d236e4d5 100644
--- a/src/ClientHandle.cpp
+++ b/src/ClientHandle.cpp
@@ -1981,14 +1981,7 @@ void cClientHandle::Tick(float a_Dt)
m_BreakProgress += m_Player->GetMiningProgressPerTick(Block);
}
- try
- {
- ProcessProtocolIn();
- }
- catch (const std::exception & Oops)
- {
- Kick(Oops.what());
- }
+ ProcessProtocolIn();
if (IsDestroyed())
{
@@ -3171,7 +3164,7 @@ void cClientHandle::PacketBufferFull(void)
{
// Too much data in the incoming queue, the server is probably too busy, kick the client:
LOGERROR("Too much data in queue for client \"%s\" @ %s, kicking them.", m_Username.c_str(), m_IPString.c_str());
- SendDisconnect("Server busy");
+ SendDisconnect("The server is busy; please try again later.");
}
@@ -3249,10 +3242,19 @@ void cClientHandle::ProcessProtocolIn(void)
std::swap(IncomingData, m_IncomingData);
}
- if (!IncomingData.empty())
+ if (IncomingData.empty())
+ {
+ return;
+ }
+
+ try
{
m_Protocol.HandleIncomingData(*this, IncomingData);
}
+ catch (const std::exception & Oops)
+ {
+ Kick(Oops.what());
+ }
}