2017-04-16 07:00:25 +00:00
|
|
|
#ifndef OPENMW_PROCESSORPLAYERATTRIBUTE_HPP
|
|
|
|
#define OPENMW_PROCESSORPLAYERATTRIBUTE_HPP
|
|
|
|
|
|
|
|
|
2017-06-06 16:06:10 +00:00
|
|
|
#include "../PlayerProcessor.hpp"
|
2017-04-16 07:00:25 +00:00
|
|
|
#include "apps/openmw/mwmechanics/npcstats.hpp"
|
|
|
|
#include "apps/openmw/mwclass/npc.hpp"
|
|
|
|
|
|
|
|
namespace mwmp
|
|
|
|
{
|
2019-10-24 19:16:17 +00:00
|
|
|
class ProcessorPlayerAttribute final: public PlayerProcessor
|
2017-04-16 07:00:25 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
ProcessorPlayerAttribute()
|
|
|
|
{
|
|
|
|
BPP_INIT(ID_PLAYER_ATTRIBUTE)
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual void Do(PlayerPacket &packet, BasePlayer *player)
|
|
|
|
{
|
|
|
|
if (isLocal())
|
|
|
|
{
|
2017-05-02 19:47:58 +00:00
|
|
|
if (isRequest())
|
2017-04-16 07:00:25 +00:00
|
|
|
static_cast<LocalPlayer *>(player)->updateAttributes(true);
|
|
|
|
else
|
|
|
|
static_cast<LocalPlayer *>(player)->setAttributes();
|
|
|
|
}
|
2017-04-23 22:46:27 +00:00
|
|
|
else if (player != 0)
|
2017-04-16 07:00:25 +00:00
|
|
|
{
|
2018-04-13 13:59:48 +00:00
|
|
|
static_cast<DedicatedPlayer *>(player)->setAttributes();
|
2017-04-16 07:00:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endif //OPENMW_PROCESSORPLAYERATTRIBUTE_HPP
|