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/cPluginManager.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'source/cPluginManager.cpp') diff --git a/source/cPluginManager.cpp b/source/cPluginManager.cpp index 13a67ee28..8f52839c8 100644 --- a/source/cPluginManager.cpp +++ b/source/cPluginManager.cpp @@ -627,6 +627,26 @@ bool cPluginManager::CallHookUpdatedSign(cWorld * a_World, int a_BlockX, int a_B +bool cPluginManager::CallHookHandshake(cClientHandle * a_ClientHandle, const AString & a_Username) +{ + HookMap::iterator Plugins = m_Hooks.find(HOOK_HANDSHAKE); + if (Plugins == m_Hooks.end()) + { + return false; + } + for (PluginList::iterator itr = Plugins->second.begin(); itr != Plugins->second.end(); ++itr) + { + if ((*itr)->OnHandshake(a_ClientHandle, a_Username)) + { + return true; + } + } + return false; +} + + + + cPlugin* cPluginManager::GetPlugin( const AString & a_Plugin ) const { -- cgit v1.2.3