1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-05-04 09:47:46 +00:00
sapphire/src/servers/sapphire_zone/Network/PacketWrappers/ChatPacket.h

42 lines
857 B
C
Raw Normal View History

2017-08-08 13:53:47 +02:00
#ifndef _CHATPACKET_H
#define _CHATPACKET_H
#include <common/Network/GamePacketNew.h>
#include <common/Network/PacketDef/Zone/ServerZoneDef.h>
#include "Forwards.h"
2017-08-08 13:53:47 +02:00
namespace Core {
namespace Network {
namespace Packets {
namespace Server {
/**
* @brief The Chat packet.
*/
class ChatPacket :
2017-11-21 18:43:09 +01:00
public ZoneChannelPacket< FFXIVIpcChat >
2017-08-08 13:53:47 +02:00
{
public:
ChatPacket( Entity::Player& player, Common::ChatType chatType, const std::string& msg ) :
ZoneChannelPacket< FFXIVIpcChat >( player.getId(), player.getId() )
2017-08-08 13:53:47 +02:00
{
initialize( player, chatType, msg );
};
private:
void initialize( Entity::Player& player, Common::ChatType chatType, const std::string& msg )
2017-08-08 13:53:47 +02:00
{
m_data.chatType = chatType;
strcpy( m_data.name, player.getName().c_str() );
2017-08-08 13:53:47 +02:00
strcpy( m_data.msg, msg.c_str() );
};
};
}
}
}
}
#endif /*_CHATPACKET_H*/