1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-31 20:45:32 +00:00
openmw-tes3mp/apps/openmw-mp/processors/player/ProcessorPlayerDeath.hpp

34 lines
844 B
C++

//
// Created by koncord on 01.04.17.
//
#ifndef OPENMW_PROCESSORPLAYERDEATH_HPP
#define OPENMW_PROCESSORPLAYERDEATH_HPP
#include "../PlayerProcessor.hpp"
#include <chrono>
namespace mwmp
{
class ProcessorPlayerDeath final: public PlayerProcessor
{
public:
ProcessorPlayerDeath()
{
BPP_INIT(ID_PLAYER_DEATH)
}
void Do(PlayerPacket &packet, const std::shared_ptr<Player> &player) override
{
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received %s from %s", strPacketID.c_str(), player->npc.mName.c_str());
player->creatureStats.mDead = true;
packet.Send(true);
Networking::get().getState().getEventCtrl().Call<CoreEvent::ON_PLAYER_DEATH>(player.get(), player->deathReason);
}
};
}
#endif //OPENMW_PROCESSORPLAYERDEATH_HPP