From 019c8b5bc71708e2d895a95757643406f75b4149 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Fri, 1 Feb 2013 19:55:42 +0000 Subject: Moved command API into cPluginManager. As specified in http://forum.mc-server.org/showthread.php?tid=765 , commands are now bound using a single function, cPluginManager:BindCommand(). git-svn-id: http://mc-server.googlecode.com/svn/trunk@1183 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/Plugin.cpp | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) (limited to 'source/Plugin.cpp') diff --git a/source/Plugin.cpp b/source/Plugin.cpp index 2b26ae2cb..491acaa5b 100644 --- a/source/Plugin.cpp +++ b/source/Plugin.cpp @@ -10,10 +10,9 @@ cPlugin::cPlugin( const AString & a_PluginDirectory ) - : m_Version( 0 ) - , m_Language( E_CPP ) - , m_bCanBindCommands( false ) - , m_Directory( a_PluginDirectory ) + : m_Version(0) + , m_Language(E_CPP) + , m_Directory(a_PluginDirectory) { } @@ -126,6 +125,17 @@ bool cPlugin::OnDisconnect(cPlayer * a_Player, const AString & a_Reason) +bool cPlugin::OnHandshake(cClientHandle * a_Client, const AString & a_Username) +{ + UNUSED(a_Client); + UNUSED(a_Username); + return false; +} + + + + + bool cPlugin::OnKilling(cPawn & a_Victim, cEntity * a_Killer) { UNUSED(a_Victim); @@ -464,10 +474,10 @@ bool cPlugin::OnWeatherChanged(cWorld * a_World) -bool cPlugin::OnHandshake(cClientHandle * a_Client, const AString & a_Username) +bool cPlugin::HandleCommand(const AStringVector & a_Split, cPlayer * a_Player) { - UNUSED(a_Client); - UNUSED(a_Username); + UNUSED(a_Split); + UNUSED(a_Player); return false; } @@ -475,19 +485,6 @@ bool cPlugin::OnHandshake(cClientHandle * a_Client, const AString & a_Username) -void cPlugin::AddCommand(const AString & a_Command, const AString & a_Description, const AString & a_Permission) -{ - CommandStruct Command; - Command.Command = a_Command; - Command.Description = a_Description; - Command.Permission = a_Permission; - m_Commands.push_back( Command ); -} - - - - - AString cPlugin::GetLocalDirectory(void) const { return std::string("Plugins/") + m_Directory; -- cgit v1.2.3