1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-28 15:17:46 +00:00
sapphire/src/world/Network/PacketWrappers/MoveActorPacket.h

47 lines
1.3 KiB
C
Raw Normal View History

2017-08-08 13:53:47 +02:00
#ifndef _MOVEACTORPACKET_H
#define _MOVEACTORPACKET_H
2018-03-06 22:22:19 +01:00
#include <Network/GamePacketNew.h>
#include <Network/PacketDef/Zone/ServerZoneDef.h>
#include <Util/UtilMath.h>
#include "Actor/Player.h"
#include "Forwards.h"
2017-08-08 13:53:47 +02: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.
*/
class MoveActorPacket :
public ZoneChannelPacket< FFXIVIpcActorMove >
{
2018-10-28 21:53:21 +01:00
public:
MoveActorPacket( Entity::Chara& actor, uint8_t unk1, uint8_t animationType, uint8_t unk3, uint16_t unk4 ) :
2018-10-28 21:53:21 +01:00
ZoneChannelPacket< FFXIVIpcActorMove >( actor.getId(), actor.getId() )
{
initialize( actor, unk1, animationType, unk3, unk4 );
2018-10-28 21:53:21 +01:00
};
private:
void initialize( Entity::Chara& actor, uint8_t unk1, uint8_t animationType, uint8_t unk3, uint16_t unk4 )
2018-10-28 21:53:21 +01:00
{
2018-12-02 02:01:41 +01:00
m_data.rotation = Util::floatToUInt8Rot( actor.getRot() );
2018-10-28 21:53:21 +01:00
m_data.unknown_1 = unk1;
m_data.animationType = animationType;
2018-10-28 21:53:21 +01:00
m_data.unknown_3 = unk3;
m_data.unknown_4 = unk4;
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
};
};
2017-08-08 13:53:47 +02:00
}
#endif /*_MOVEACTORPACKET_H*/