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
|
|
|
|
{
|
2019-10-24 19:16:17 +00:00
|
|
|
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)
|
|
|
|
{
|
2019-08-19 18:39:33 +00:00
|
|
|
LOG_MESSAGE_SIMPLE(TimedLog::LOG_INFO, "Received ID_PLAYER_DEATH from server");
|
2020-11-14 23:02:58 +00:00
|
|
|
|
2017-04-16 07:00:25 +00:00
|
|
|
if (isLocal())
|
|
|
|
{
|
2019-08-19 18:39:33 +00:00
|
|
|
LOG_APPEND(TimedLog::LOG_INFO, "- Packet was about me");
|
2017-04-16 07:00:25 +00:00
|
|
|
|
2020-11-14 23:02:58 +00:00
|
|
|
static_cast<LocalPlayer*>(player)->die();
|
2017-04-16 07:00:25 +00:00
|
|
|
}
|
2017-04-23 22:46:27 +00:00
|
|
|
else if (player != 0)
|
2017-04-16 07:00:25 +00:00
|
|
|
{
|
2019-08-19 18:39:33 +00:00
|
|
|
LOG_APPEND(TimedLog::LOG_INFO, "- Packet was about %s", player->npc.mName.c_str());
|
2017-04-16 07:00:25 +00:00
|
|
|
|
2020-11-14 23:30:13 +00:00
|
|
|
static_cast<DedicatedPlayer*>(player)->die();
|
2017-04-16 07:00:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif //OPENMW_PROCESSORPLAYERDEATH_HPP
|