2017-08-08 13:53:47 +02:00
|
|
|
#ifndef _MOVEACTORPACKET_H
|
|
|
|
#define _MOVEACTORPACKET_H
|
|
|
|
|
2019-03-08 15:34:38 +01:00
|
|
|
#include <Network/GamePacket.h>
|
2018-03-06 22:22:19 +01:00
|
|
|
#include <Network/PacketDef/Zone/ServerZoneDef.h>
|
|
|
|
#include <Util/UtilMath.h>
|
2017-12-08 23:27:59 +01:00
|
|
|
#include "Actor/Player.h"
|
|
|
|
#include "Forwards.h"
|
2017-08-08 13:53:47 +02:00
|
|
|
|
|
|
|
|
2018-11-29 16:55:48 +01:00
|
|
|
namespace Sapphire::Network::Packets::Server
|
2017-08-08 13:53:47 +02:00
|
|
|
{
|
|
|
|
|
2018-10-28 21:53:21 +01:00
|
|
|
/**
|
|
|
|
* @brief The Client UI Initialization packet. This must be sent to the client
|
|
|
|
* once upon connection to configure the UI.
|
|
|
|
*/
|
2019-04-04 23:29:52 +02:00
|
|
|
class MoveActorPacket : public ZoneChannelPacket< FFXIVIpcActorMove >
|
2018-08-29 21:40:59 +02:00
|
|
|
{
|
2018-10-28 21:53:21 +01:00
|
|
|
public:
|
2019-02-06 09:27:30 +01:00
|
|
|
MoveActorPacket( Entity::Chara& actor, uint8_t headRotation, uint8_t animationType, uint8_t state, uint16_t animationSpeed, uint8_t unknownRotation = 0 ) :
|
2018-10-28 21:53:21 +01:00
|
|
|
ZoneChannelPacket< FFXIVIpcActorMove >( actor.getId(), actor.getId() )
|
|
|
|
{
|
2019-02-06 09:27:30 +01:00
|
|
|
initialize( actor, headRotation, animationType, state, animationSpeed, unknownRotation );
|
2018-10-28 21:53:21 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
private:
|
2019-02-06 09:27:30 +01:00
|
|
|
void initialize( Entity::Chara& actor, uint8_t headRotation, uint8_t animationType, uint8_t state, uint16_t animationSpeed, uint8_t unknownRotation )
|
2018-10-28 21:53:21 +01:00
|
|
|
{
|
|
|
|
|
2018-12-02 02:01:41 +01:00
|
|
|
m_data.rotation = Util::floatToUInt8Rot( actor.getRot() );
|
2019-02-06 08:49:57 +01:00
|
|
|
m_data.headRotation = headRotation;
|
2019-01-26 11:39:25 +11:00
|
|
|
m_data.animationType = animationType;
|
2019-02-06 08:49:57 +01:00
|
|
|
m_data.animationState = state;
|
2019-02-06 09:27:30 +01:00
|
|
|
m_data.animationSpeed = animationSpeed;
|
|
|
|
m_data.unknownRotation = unknownRotation;
|
2018-12-02 02:01:41 +01:00
|
|
|
m_data.posX = Util::floatToUInt16( actor.getPos().x );
|
|
|
|
m_data.posY = Util::floatToUInt16( actor.getPos().y );
|
|
|
|
m_data.posZ = Util::floatToUInt16( actor.getPos().z );
|
2018-10-28 21:53:21 +01:00
|
|
|
|
|
|
|
};
|
2018-08-29 21:40:59 +02:00
|
|
|
};
|
2017-08-08 13:53:47 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2017-12-08 11:46:47 +01:00
|
|
|
#endif /*_MOVEACTORPACKET_H*/
|