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
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user