From f94456dd3eccc65a6f304d4b804ca09a67fa6008 Mon Sep 17 00:00:00 2001 From: faketruth Date: Wed, 5 Sep 2012 20:30:27 +0000 Subject: Added the possibility of reserved player slots by implementing the HandleHandshake hook! More info: http://forum.mc-server.org/showthread.php?tid=555 git-svn-id: http://mc-server.googlecode.com/svn/trunk@836 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/Protocol125.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source/Protocol125.cpp') diff --git a/source/Protocol125.cpp b/source/Protocol125.cpp index 4f162dab6..7047f1f30 100644 --- a/source/Protocol125.cpp +++ b/source/Protocol125.cpp @@ -974,10 +974,9 @@ int cProtocol125::ParseHandshake(void) LOGD("HANDSHAKE %s", Username.c_str()); - if (cRoot::Get()->GetDefaultWorld()->GetNumPlayers() >= cRoot::Get()->GetDefaultWorld()->GetMaxPlayers()) + if (!m_Client->HandleHandshake( m_Username )) { - m_Client->Kick("The server is currently full :(-- Try again later"); - return PARSE_OK; + return PARSE_OK; // Player is not allowed into the server } SendHandshake(cRoot::Get()->GetServer()->GetServerID()); -- cgit v1.2.3