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/ProcessorPlayerPosition.hpp
2017-06-07 00:06:10 +08:00

41 lines
1,010 B
C++

//
// Created by koncord on 16.04.17.
//
#ifndef OPENMW_PROCESSORPLAYERPOSITION_HPP
#define OPENMW_PROCESSORPLAYERPOSITION_HPP
#include "../PlayerProcessor.hpp"
namespace mwmp
{
class ProcessorPlayerPosition : public PlayerProcessor
{
public:
ProcessorPlayerPosition()
{
BPP_INIT(ID_PLAYER_POSITION)
}
virtual void Do(PlayerPacket &packet, BasePlayer *player)
{
if (isLocal())
{
if (!isRequest())
{
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "ID_PLAYER_POSITION changed by server");
static_cast<LocalPlayer*>(player)->setPosition();
}
else
static_cast<LocalPlayer*>(player)->updatePosition(true);
}
else if (player != 0) // dedicated player
static_cast<DedicatedPlayer*>(player)->updateMarker();
}
};
}
#endif //OPENMW_PROCESSORPLAYERPOSITION_HPP