diff options
Diffstat (limited to '')
-rw-r--r-- | source/cClientHandle.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/source/cClientHandle.cpp b/source/cClientHandle.cpp index 06325785e..c62be45ac 100644 --- a/source/cClientHandle.cpp +++ b/source/cClientHandle.cpp @@ -918,6 +918,23 @@ void cClientHandle::HandleKeepAlive(int a_KeepAliveID) +bool cClientHandle::HandleHandshake(const AString & a_Username) +{ + if (!cRoot::Get()->GetPluginManager()->CallHookHandshake(this, a_Username)) + { + if (cRoot::Get()->GetDefaultWorld()->GetNumPlayers() >= cRoot::Get()->GetDefaultWorld()->GetMaxPlayers()) + { + Kick("The server is currently full :(-- Try again later"); + return false; + } + } + return true; +} + + + + + void cClientHandle::SendData(const char * a_Data, int a_Size) { { |