2017-04-16 07:00:25 +00:00
|
|
|
#ifndef OPENMW_PROCESSORPLAYERRESURRECT_HPP
|
|
|
|
#define OPENMW_PROCESSORPLAYERRESURRECT_HPP
|
|
|
|
|
2017-06-06 16:06:10 +00:00
|
|
|
#include "../PlayerProcessor.hpp"
|
2019-10-26 06:12:06 +00:00
|
|
|
|
|
|
|
#include "apps/openmw/mwmechanics/mechanicsmanagerimp.hpp"
|
|
|
|
|
2017-04-16 07:00:25 +00:00
|
|
|
#include "apps/openmw/mwmp/Main.hpp"
|
|
|
|
#include "apps/openmw/mwmp/Networking.hpp"
|
|
|
|
|
|
|
|
namespace mwmp
|
|
|
|
{
|
2019-10-24 19:16:17 +00:00
|
|
|
class ProcessorPlayerResurrect final: public PlayerProcessor
|
2017-04-16 07:00:25 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
ProcessorPlayerResurrect()
|
|
|
|
{
|
|
|
|
BPP_INIT(ID_PLAYER_RESURRECT)
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual void Do(PlayerPacket &packet, BasePlayer *player)
|
|
|
|
{
|
2019-08-19 18:39:33 +00:00
|
|
|
LOG_MESSAGE_SIMPLE(TimedLog::LOG_INFO, "Received ID_PLAYER_RESURRECT from server");
|
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 with resurrectType of %i", player->resurrectType);
|
2017-06-27 07:03:41 +00:00
|
|
|
|
2018-01-27 17:09:55 +00:00
|
|
|
static_cast<LocalPlayer*>(player)->resurrect();
|
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 22:44:10 +00:00
|
|
|
static_cast<DedicatedPlayer*>(player)->resurrect();
|
2017-04-16 07:00:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif //OPENMW_PROCESSORPLAYERRESURRECT_HPP
|