TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
WorldPackets::Mail::SendMail Class Referencefinal

#include <MailPackets.h>

Classes

struct  StructSendMail
 

Public Member Functions

 SendMail (WorldPacket &&packet)
 
void Read () override
 
- Public Member Functions inherited from WorldPackets::ClientPacket
 ClientPacket (WorldPacket &&packet)
 
 ClientPacket (OpcodeClient expectedOpcode, WorldPacket &&packet)
 
WorldPacket constWrite () overridefinal
 
OpcodeClient GetOpcode () const
 
- Public Member Functions inherited from WorldPackets::Packet
 Packet (WorldPacket &&worldPacket)
 
virtual ~Packet ()=default
 
 Packet (Packet const &right)=delete
 
Packetoperator= (Packet const &right)=delete
 
WorldPacket constGetRawPacket () const
 
size_t GetSize () const
 
ConnectionType GetConnection () const
 

Public Attributes

StructSendMail Info
 

Additional Inherited Members

- Protected Attributes inherited from WorldPackets::Packet
WorldPacket _worldPacket
 

Constructor & Destructor Documentation

WorldPackets::Mail::SendMail::SendMail ( WorldPacket &&  packet)
inline
127 : ClientPacket(CMSG_SEND_MAIL, std::move(packet)) { }
Definition: Opcodes.h:599
ClientPacket(WorldPacket &&packet)
Definition: Packet.h:62

Member Function Documentation

void WorldPackets::Mail::SendMail::Read ( )
overridevirtual

Implements WorldPackets::Packet.

162 {
166  _worldPacket >> Info.Cod;
167 
168  uint32 targetLength = _worldPacket.ReadBits(9);
169  uint32 subjectLength = _worldPacket.ReadBits(9);
170  uint32 bodyLength = _worldPacket.ReadBits(11);
171 
173 
174  Info.Target = _worldPacket.ReadString(targetLength);
175  Info.Subject = _worldPacket.ReadString(subjectLength);
176  Info.Body = _worldPacket.ReadString(bodyLength);
177 
178  for (auto& att : Info.Attachments)
179  {
180  _worldPacket >> att.AttachPosition;
181  _worldPacket >> att.ItemGUID;
182  }
183 }
uint32 ReadBits(int32 bits)
Definition: ByteBuffer.h:204
int32 StationeryID
Definition: MailPackets.h:118
int64 Cod
Definition: MailPackets.h:120
WorldPacket _worldPacket
Definition: Packet.h:43
std::string Target
Definition: MailPackets.h:121
std::vector< MailAttachment > Attachments
Definition: MailPackets.h:124
std::string ReadString(uint32 length)
Definition: ByteBuffer.h:524
uint32_t uint32
Definition: Define.h:150
int64 SendMoney
Definition: MailPackets.h:119
std::string Subject
Definition: MailPackets.h:122
std::string Body
Definition: MailPackets.h:123
ObjectGuid Mailbox
Definition: MailPackets.h:117
StructSendMail Info
Definition: MailPackets.h:131

Member Data Documentation

StructSendMail WorldPackets::Mail::SendMail::Info

The documentation for this class was generated from the following files: