1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 04:49:54 +00:00
openmw-tes3mp/apps/openmw/mwmp/processors/player/ProcessorPlayerCellChange.hpp

36 lines
934 B
C++
Raw Normal View History

2017-04-16 07:00:25 +00:00
#ifndef OPENMW_PROCESSORPLAYERCELLCHANGE_HPP
#define OPENMW_PROCESSORPLAYERCELLCHANGE_HPP
2017-06-06 16:06:10 +00:00
#include "../PlayerProcessor.hpp"
2017-04-16 07:00:25 +00:00
namespace mwmp
{
class ProcessorPlayerCellChange final: public PlayerProcessor
2017-04-16 07:00:25 +00:00
{
public:
ProcessorPlayerCellChange()
{
BPP_INIT(ID_PLAYER_CELL_CHANGE)
}
virtual void Do(PlayerPacket &packet, BasePlayer *player)
{
if (isLocal())
{
LOG_MESSAGE_SIMPLE(TimedLog::LOG_INFO, "Received ID_PLAYER_CELL_CHANGE from server about me");
2017-04-16 07:00:25 +00:00
if (isRequest())
static_cast<LocalPlayer *>(player)->updateCell(true);
else
static_cast<LocalPlayer *>(player)->setCell();
}
else if (player != 0)
static_cast<DedicatedPlayer*>(player)->setCell();
2017-04-16 07:00:25 +00:00
}
};
}
#endif //OPENMW_PROCESSORPLAYERCELLCHANGE_HPP