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

#include <CharacterPackets.h>

Public Member Functions

 CreateCharacter (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

std::shared_ptr
< CharacterCreateInfo
CreateInfo
 

Additional Inherited Members

- Protected Attributes inherited from WorldPackets::Packet
WorldPacket _worldPacket
 

Constructor & Destructor Documentation

WorldPackets::Character::CreateCharacter::CreateCharacter ( WorldPacket &&  packet)
inline
181 : ClientPacket(CMSG_CREATE_CHARACTER, std::move(packet)) { }
Definition: Opcodes.h:231
ClientPacket(WorldPacket &&packet)
Definition: Packet.h:62

Member Function Documentation

void WorldPackets::Character::CreateCharacter::Read ( )
overridevirtual

Implements WorldPackets::Packet.

179 {
180  CreateInfo.reset(new CharacterCreateInfo());
181  uint32 nameLength = _worldPacket.ReadBits(6);
182  bool const hasTemplateSet = _worldPacket.ReadBit();
183 
184  _worldPacket >> CreateInfo->Race;
185  _worldPacket >> CreateInfo->Class;
186  _worldPacket >> CreateInfo->Sex;
187  _worldPacket >> CreateInfo->Skin;
188  _worldPacket >> CreateInfo->Face;
189  _worldPacket >> CreateInfo->HairStyle;
190  _worldPacket >> CreateInfo->HairColor;
191  _worldPacket >> CreateInfo->FacialHairStyle;
192  _worldPacket >> CreateInfo->OutfitId;
193  CreateInfo->Name = _worldPacket.ReadString(nameLength);
194  if (hasTemplateSet)
195  CreateInfo->TemplateSet = _worldPacket.read<int32>();
196 }
uint32 ReadBits(int32 bits)
Definition: ByteBuffer.h:204
WorldPacket _worldPacket
Definition: Packet.h:43
std::string ReadString(uint32 length)
Definition: ByteBuffer.h:524
int32_t int32
Definition: Define.h:146
uint32_t uint32
Definition: Define.h:150
std::shared_ptr< CharacterCreateInfo > CreateInfo
Definition: CharacterPackets.h:198
bool ReadBit()
Definition: ByteBuffer.h:186
T read()
Definition: ByteBuffer.h:484

+ Here is the call graph for this function:

Member Data Documentation

std::shared_ptr<CharacterCreateInfo> WorldPackets::Character::CreateCharacter::CreateInfo

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