1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-05-03 17:27:47 +00:00
sapphire/src/world/Network/PacketWrappers/ChatPacket.h

35 lines
824 B
C++

#ifndef _CHATPACKET_H
#define _CHATPACKET_H
#include <Network/GamePacket.h>
#include <Network/PacketDef/Zone/ServerZoneDef.h>
#include "Forwards.h"
namespace Sapphire::Network::Packets::Server
{
/**
* @brief The Chat packet.
*/
class ChatPacket : public ZoneChannelPacket< FFXIVIpcChat >
{
public:
ChatPacket( Entity::Player& player, Common::ChatType chatType, const std::string& msg ) :
ZoneChannelPacket< FFXIVIpcChat >( player.getId(), player.getId() )
{
initialize( player, chatType, msg );
};
private:
void initialize( Entity::Player& player, Common::ChatType chatType, const std::string& msg )
{
m_data.chatType = chatType;
strcpy( m_data.name, player.getName().c_str() );
strcpy( m_data.msg, msg.c_str() );
};
};
}
#endif /*_CHATPACKET_H*/