1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-24 19:23:52 +00:00
openmw-tes3mp/apps/openmw/mwmp/processors/player/ProcessorPlayerDeath.hpp

38 lines
945 B
C++
Raw Normal View History

2017-04-16 07:00:25 +00:00
#ifndef OPENMW_PROCESSORPLAYERDEATH_HPP
#define OPENMW_PROCESSORPLAYERDEATH_HPP
2017-06-06 16:06:10 +00:00
#include "../PlayerProcessor.hpp"
2017-04-16 07:00:25 +00:00
namespace mwmp
{
class ProcessorPlayerDeath final: public PlayerProcessor
2017-04-16 07:00:25 +00:00
{
public:
ProcessorPlayerDeath()
{
BPP_INIT(ID_PLAYER_DEATH)
}
virtual void Do(PlayerPacket &packet, BasePlayer *player)
{
LOG_MESSAGE_SIMPLE(TimedLog::LOG_INFO, "Received ID_PLAYER_DEATH from server");
2017-04-16 07:00:25 +00:00
if (isLocal())
{
LOG_APPEND(TimedLog::LOG_INFO, "- Packet was about me");
2017-04-16 07:00:25 +00:00
static_cast<LocalPlayer*>(player)->die();
2017-04-16 07:00:25 +00:00
}
else if (player != 0)
2017-04-16 07:00:25 +00:00
{
LOG_APPEND(TimedLog::LOG_INFO, "- Packet was about %s", player->npc.mName.c_str());
2017-04-16 07:00:25 +00:00
static_cast<DedicatedPlayer*>(player)->die();
2017-04-16 07:00:25 +00:00
}
}
};
}
#endif //OPENMW_PROCESSORPLAYERDEATH_HPP