2012-06-14 09:06:06 -04:00
|
|
|
|
|
|
|
#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules
|
|
|
|
|
|
|
|
#include "cPlugin.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cPlugin::cPlugin()
|
|
|
|
: m_Version( 0 )
|
|
|
|
, m_Language( E_CPP )
|
|
|
|
, m_bCanBindCommands( false )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
cPlugin::~cPlugin()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
// bool cPlugin::Initialize()
|
|
|
|
// {
|
|
|
|
// LOG("cPlugin::Initialize()");
|
|
|
|
// return false;
|
|
|
|
// }
|
|
|
|
|
2012-08-03 07:53:11 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-06-14 09:06:06 -04:00
|
|
|
void cPlugin::Tick(float a_Dt)
|
|
|
|
{
|
2012-08-03 07:53:11 -04:00
|
|
|
UNUSED(a_Dt);
|
2012-06-14 09:06:06 -04:00
|
|
|
}
|
|
|
|
|
2012-08-03 07:53:11 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-08-18 05:56:28 -04:00
|
|
|
bool cPlugin::OnBlockDig(cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, char a_Status, BLOCKTYPE a_OldBlock, NIBBLETYPE a_OldMeta)
|
2012-06-14 09:06:06 -04:00
|
|
|
{
|
2012-08-03 07:53:11 -04:00
|
|
|
UNUSED(a_Player);
|
2012-08-18 05:56:28 -04:00
|
|
|
UNUSED(a_BlockX);
|
|
|
|
UNUSED(a_BlockY);
|
|
|
|
UNUSED(a_BlockZ);
|
|
|
|
UNUSED(a_BlockFace);
|
|
|
|
UNUSED(a_Status);
|
|
|
|
UNUSED(a_OldBlock);
|
|
|
|
UNUSED(a_OldMeta);
|
2012-06-14 09:06:06 -04:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2012-08-03 07:53:11 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-08-18 05:56:28 -04:00
|
|
|
bool cPlugin::OnBlockPlace(cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, const cItem & a_HeldItem)
|
2012-06-14 09:06:06 -04:00
|
|
|
{
|
2012-08-03 07:53:11 -04:00
|
|
|
UNUSED(a_Player);
|
2012-08-18 05:56:28 -04:00
|
|
|
UNUSED(a_BlockX);
|
|
|
|
UNUSED(a_BlockY);
|
|
|
|
UNUSED(a_BlockZ);
|
|
|
|
UNUSED(a_BlockFace);
|
|
|
|
UNUSED(a_HeldItem);
|
2012-06-14 09:06:06 -04:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2012-08-03 07:53:11 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-08-18 05:56:28 -04:00
|
|
|
bool cPlugin::OnBlockToPickup(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, const cPlayer * a_Player, const cItem & a_EquippedItem, cItems & a_Pickups)
|
2012-06-14 09:06:06 -04:00
|
|
|
{
|
2012-08-18 05:56:28 -04:00
|
|
|
UNUSED(a_BlockType);
|
|
|
|
UNUSED(a_BlockMeta);
|
2012-08-03 07:53:11 -04:00
|
|
|
UNUSED(a_Player);
|
2012-08-18 05:56:28 -04:00
|
|
|
UNUSED(a_EquippedItem);
|
|
|
|
UNUSED(a_Pickups);
|
2012-06-14 09:06:06 -04:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2012-08-03 07:53:11 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-08-18 06:38:15 -04:00
|
|
|
bool cPlugin::OnChat(cPlayer * a_Player, const AString & a_Message)
|
2012-06-14 09:06:06 -04:00
|
|
|
{
|
2012-08-03 07:53:11 -04:00
|
|
|
UNUSED(a_Player);
|
2012-08-18 06:38:15 -04:00
|
|
|
UNUSED(a_Message);
|
2012-06-14 09:06:06 -04:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2012-08-03 07:53:11 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-08-18 05:56:28 -04:00
|
|
|
void cPlugin::OnChunkGenerated(cWorld * a_World, int a_ChunkX, int a_ChunkZ)
|
2012-06-14 09:06:06 -04:00
|
|
|
{
|
2012-08-18 05:56:28 -04:00
|
|
|
UNUSED(a_World);
|
|
|
|
UNUSED(a_ChunkX);
|
|
|
|
UNUSED(a_ChunkZ);
|
2012-06-14 09:06:06 -04:00
|
|
|
}
|
|
|
|
|
2012-08-03 07:53:11 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-08-18 05:56:28 -04:00
|
|
|
bool cPlugin::OnChunkGenerating(cWorld * a_World, int a_ChunkX, int a_ChunkZ, cLuaChunk * a_pLuaChunk)
|
2012-06-14 09:06:06 -04:00
|
|
|
{
|
2012-08-18 05:56:28 -04:00
|
|
|
UNUSED(a_World);
|
|
|
|
UNUSED(a_ChunkX);
|
|
|
|
UNUSED(a_ChunkZ);
|
|
|
|
UNUSED(a_pLuaChunk);
|
|
|
|
return false;
|
2012-08-03 07:53:11 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-08-24 05:49:00 -04:00
|
|
|
bool cPlugin::OnCollectPickup(cPlayer * a_Player, cPickup * a_Pickup)
|
2012-08-03 07:53:11 -04:00
|
|
|
{
|
|
|
|
UNUSED(a_Player);
|
2012-08-24 05:49:00 -04:00
|
|
|
UNUSED(a_Pickup);
|
2012-06-14 09:06:06 -04:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2012-08-03 07:53:11 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-08-18 05:56:28 -04:00
|
|
|
bool cPlugin::OnCraftingNoRecipe(const cPlayer * a_Player, const cCraftingGrid * a_Grid, cCraftingRecipe * a_Recipe)
|
2012-08-03 07:53:11 -04:00
|
|
|
{
|
|
|
|
UNUSED(a_Player);
|
2012-08-18 05:56:28 -04:00
|
|
|
UNUSED(a_Grid);
|
|
|
|
UNUSED(a_Recipe);
|
|
|
|
return false;
|
2012-08-03 07:53:11 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-08-19 15:42:32 -04:00
|
|
|
bool cPlugin::OnDisconnect(cPlayer * a_Player, const AString & a_Reason)
|
2012-08-03 07:53:11 -04:00
|
|
|
{
|
2012-08-18 05:56:28 -04:00
|
|
|
UNUSED(a_Reason);
|
|
|
|
UNUSED(a_Player);
|
|
|
|
return false;
|
2012-08-03 07:53:11 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool cPlugin::OnKilled(cPawn * a_Killed, cEntity * a_Killer)
|
|
|
|
{
|
|
|
|
UNUSED(a_Killed);
|
|
|
|
UNUSED(a_Killer);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-08-18 05:56:28 -04:00
|
|
|
bool cPlugin::OnLogin(cClientHandle * a_Client, int a_ProtocolVersion, const AString & a_Username)
|
2012-08-03 07:53:11 -04:00
|
|
|
{
|
2012-08-18 05:56:28 -04:00
|
|
|
UNUSED(a_Client);
|
|
|
|
UNUSED(a_ProtocolVersion);
|
|
|
|
UNUSED(a_Username);
|
|
|
|
return false;
|
2012-08-03 07:53:11 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-08-18 05:56:28 -04:00
|
|
|
bool cPlugin::OnPlayerJoin(cPlayer * a_Player)
|
2012-08-03 07:53:11 -04:00
|
|
|
{
|
2012-08-18 05:56:28 -04:00
|
|
|
UNUSED(a_Player);
|
2012-08-03 07:53:11 -04:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-08-18 05:56:28 -04:00
|
|
|
void cPlugin::OnPlayerMove(cPlayer * a_Player)
|
2012-08-03 07:53:11 -04:00
|
|
|
{
|
|
|
|
UNUSED(a_Player);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-08-18 05:56:28 -04:00
|
|
|
void cPlugin::OnPlayerSpawn(cPlayer * a_Player)
|
2012-08-03 07:53:11 -04:00
|
|
|
{
|
|
|
|
UNUSED(a_Player);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool cPlugin::OnPostCrafting(const cPlayer * a_Player, const cCraftingGrid * a_Grid, cCraftingRecipe * a_Recipe)
|
|
|
|
{
|
|
|
|
UNUSED(a_Player);
|
|
|
|
UNUSED(a_Grid);
|
|
|
|
UNUSED(a_Recipe);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-08-18 05:56:28 -04:00
|
|
|
bool cPlugin::OnPreCrafting(const cPlayer * a_Player, const cCraftingGrid * a_Grid, cCraftingRecipe * a_Recipe)
|
2012-08-03 07:53:11 -04:00
|
|
|
{
|
|
|
|
UNUSED(a_Player);
|
2012-08-18 05:56:28 -04:00
|
|
|
UNUSED(a_Grid);
|
|
|
|
UNUSED(a_Recipe);
|
2012-08-03 07:53:11 -04:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-08-18 05:56:28 -04:00
|
|
|
void cPlugin::OnTakeDamage(cPawn * a_Pawn, TakeDamageInfo * a_TakeDamageInfo)
|
2012-08-03 07:53:11 -04:00
|
|
|
{
|
2012-08-18 05:56:28 -04:00
|
|
|
UNUSED(a_Pawn);
|
|
|
|
UNUSED(a_TakeDamageInfo);
|
2012-08-03 07:53:11 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-09-01 17:31:20 -04:00
|
|
|
bool cPlugin::OnUpdatedSign(cWorld * a_World, int a_BlockX, int a_BlockY, int a_BlockZ, const AString & a_Line1, const AString & a_Line2, const AString & a_Line3, const AString & a_Line4, cPlayer * a_Player)
|
2012-08-03 07:53:11 -04:00
|
|
|
{
|
|
|
|
UNUSED(a_World);
|
|
|
|
UNUSED(a_BlockX);
|
|
|
|
UNUSED(a_BlockY);
|
|
|
|
UNUSED(a_BlockZ);
|
|
|
|
UNUSED(a_Line1);
|
|
|
|
UNUSED(a_Line2);
|
|
|
|
UNUSED(a_Line3);
|
|
|
|
UNUSED(a_Line4);
|
2012-09-01 17:31:20 -04:00
|
|
|
UNUSED(a_Player);
|
2012-08-03 07:53:11 -04:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-09-01 17:31:20 -04:00
|
|
|
bool cPlugin::OnUpdatingSign(cWorld * a_World, int a_BlockX, int a_BlockY, int a_BlockZ, AString & a_Line1, AString & a_Line2, AString & a_Line3, AString & a_Line4, cPlayer * a_Player)
|
2012-08-03 07:53:11 -04:00
|
|
|
{
|
|
|
|
UNUSED(a_World);
|
|
|
|
UNUSED(a_BlockX);
|
|
|
|
UNUSED(a_BlockY);
|
|
|
|
UNUSED(a_BlockZ);
|
|
|
|
UNUSED(a_Line1);
|
|
|
|
UNUSED(a_Line2);
|
|
|
|
UNUSED(a_Line3);
|
|
|
|
UNUSED(a_Line4);
|
2012-09-01 17:31:20 -04:00
|
|
|
UNUSED(a_Player);
|
2012-08-03 07:53:11 -04:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-08-18 05:56:28 -04:00
|
|
|
bool cPlugin::OnWeatherChanged(cWorld * a_World)
|
|
|
|
{
|
|
|
|
UNUSED(a_World);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-09-05 16:30:27 -04:00
|
|
|
bool cPlugin::OnHandshake(cClientHandle * a_Client, const AString & a_Username)
|
|
|
|
{
|
|
|
|
UNUSED(a_Client);
|
|
|
|
UNUSED(a_Username);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-08-03 07:53:11 -04:00
|
|
|
void cPlugin::AddCommand(const AString & a_Command, const AString & a_Description, const AString & a_Permission)
|
2012-06-14 09:06:06 -04:00
|
|
|
{
|
|
|
|
CommandStruct Command;
|
|
|
|
Command.Command = a_Command;
|
|
|
|
Command.Description = a_Description;
|
|
|
|
Command.Permission = a_Permission;
|
|
|
|
m_Commands.push_back( Command );
|
|
|
|
}
|
2012-08-03 07:53:11 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|