Rev 31 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
#include "pch.h"
#pragma hdrstop
#include "Player_C.h"
#include <WowSvcs/ClientServices.h>
#include <Console/ConsoleClient.h>
#define PLAYERCLIENTINITIALIZE 0x006E8EE0;
#define PLAYERCLIENTSHUTDOWN 0x006E0300;
void (*PlayerClientInitializePtr)() = *(void(*)())PLAYERCLIENTINITIALIZE;
void (*PlayerClientShutdownPtr)() = *(void(*)())PLAYERCLIENTSHUTDOWN;
void WowGM::PlayerClientInitialize()
{
DETOUR_INIT;
DETOUR_ATTACH(PlayerClientInitializePtr,::PlayerClientInitialize);
DETOUR_ATTACH(PlayerClientShutdownPtr,::PlayerClientShutdown);
DETOUR_COMMIT;
}
void WowGM::PlayerClientShutdown()
{
DETOUR_INIT;
DETOUR_DETACH(PlayerClientInitializePtr,::PlayerClientInitialize);
DETOUR_DETACH(PlayerClientShutdownPtr,::PlayerClientShutdown);
DETOUR_COMMIT;
}
//===========================================================================
BOOL GmResurrectFailedHandler(void* formal,
NETMESSAGE msgId,
unsigned int eventTime,
CDataStore* msg)
{
BOOL failed;
msg->Get(failed);
if (!failed) {
ConsoleWrite("Player resurrected", DEFAULT_COLOR);
}
else {
ConsoleWrite("resurrect failed", DEFAULT_COLOR);
}
return TRUE;
}
//===========================================================================
void PlayerClientInitialize()
{
PlayerClientInitializePtr();
ClientServices_SetMessageHandler(SMSG_RESURRECT_FAILED,GmResurrectFailedHandler,0);
}
//===========================================================================
void PlayerClientShutdown()
{
PlayerClientShutdownPtr();
ClientServices_ClearMessageHandler(SMSG_RESURRECT_FAILED);
}