1
0

Added "player destroying" and "player destroyed" hooks

Hooks:
HOOK_PLAYER_DESTROYING
HOOK_PLAYER_DESTROYED

Idea from: https://github.com/mc-server/MCServer/issues/473
This commit is contained in:
daniel0916
2014-01-25 11:25:22 +01:00
parent 2407a67906
commit bac750b24e
6 changed files with 94 additions and 0 deletions

View File

@@ -120,6 +120,8 @@ cPlayer::cPlayer(cClientHandle* a_Client, const AString & a_PlayerName)
cPlayer::~cPlayer(void)
{
cRoot::Get()->GetPluginManager()->CallHookPlayerDestroying(*this);
LOGD("Deleting cPlayer \"%s\" at %p, ID %d", m_PlayerName.c_str(), this, GetUniqueID());
// Notify the server that the player is being destroyed
@@ -134,6 +136,8 @@ cPlayer::~cPlayer(void)
delete m_InventoryWindow;
LOGD("Player %p deleted", this);
cRoot::Get()->GetPluginManager()->CallHookPlayerDestroyed(*this);
}