2017-04-16 07:00:25 +00:00
|
|
|
//
|
|
|
|
// Created by koncord on 16.04.17.
|
|
|
|
//
|
|
|
|
|
2017-04-25 19:11:33 +00:00
|
|
|
#ifndef OPENMW_PROCESSORPLAYERPOSITION_HPP
|
|
|
|
#define OPENMW_PROCESSORPLAYERPOSITION_HPP
|
2017-04-16 07:00:25 +00:00
|
|
|
|
|
|
|
|
2017-06-06 16:06:10 +00:00
|
|
|
#include "../PlayerProcessor.hpp"
|
2017-04-16 07:00:25 +00:00
|
|
|
|
|
|
|
namespace mwmp
|
|
|
|
{
|
2017-04-25 19:11:33 +00:00
|
|
|
class ProcessorPlayerPosition : public PlayerProcessor
|
2017-04-16 07:00:25 +00:00
|
|
|
{
|
|
|
|
public:
|
2017-04-25 19:11:33 +00:00
|
|
|
ProcessorPlayerPosition()
|
2017-04-16 07:00:25 +00:00
|
|
|
{
|
2017-04-25 19:11:33 +00:00
|
|
|
BPP_INIT(ID_PLAYER_POSITION)
|
2017-04-16 07:00:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
virtual void Do(PlayerPacket &packet, BasePlayer *player)
|
|
|
|
{
|
|
|
|
if (isLocal())
|
|
|
|
{
|
|
|
|
if (!isRequest())
|
|
|
|
{
|
2017-04-25 19:11:33 +00:00
|
|
|
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "ID_PLAYER_POSITION changed by server");
|
2017-04-16 07:00:25 +00:00
|
|
|
|
|
|
|
static_cast<LocalPlayer*>(player)->setPosition();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
static_cast<LocalPlayer*>(player)->updatePosition(true);
|
|
|
|
}
|
2017-04-23 22:46:27 +00:00
|
|
|
else if (player != 0) // dedicated player
|
2017-04-16 07:00:25 +00:00
|
|
|
static_cast<DedicatedPlayer*>(player)->updateMarker();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-04-25 19:11:33 +00:00
|
|
|
#endif //OPENMW_PROCESSORPLAYERPOSITION_HPP
|