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

#include <CharacterPackets.h>

Public Member Functions

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

ObjectGuid Player
 
DeclinedName DeclinedNames
 

Additional Inherited Members

- Protected Attributes inherited from WorldPackets::Packet
WorldPacket _worldPacket
 

Constructor & Destructor Documentation

WorldPackets::Character::SetPlayerDeclinedNames::SetPlayerDeclinedNames ( WorldPacket &&  packet)
inline
724 : ClientPacket(CMSG_SET_PLAYER_DECLINED_NAMES, std::move(packet)) { }
Definition: Opcodes.h:627
ClientPacket(WorldPacket &&packet)
Definition: Packet.h:62

Member Function Documentation

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

Implements WorldPackets::Packet.

552 {
553  _worldPacket >> Player;
554 
555  uint8 stringLengths[MAX_DECLINED_NAME_CASES];
556 
557  for (uint8 i = 0; i < MAX_DECLINED_NAME_CASES; ++i)
558  stringLengths[i] = _worldPacket.ReadBits(7);
559 
560  for (uint8 i = 0; i < MAX_DECLINED_NAME_CASES; ++i)
561  DeclinedNames.name[i] = _worldPacket.ReadString(stringLengths[i]);
562 }
uint32 ReadBits(int32 bits)
Definition: ByteBuffer.h:204
#define MAX_DECLINED_NAME_CASES
Definition: Unit.h:1099
WorldPacket _worldPacket
Definition: Packet.h:43
DeclinedName DeclinedNames
Definition: CharacterPackets.h:729
std::string ReadString(uint32 length)
Definition: ByteBuffer.h:524
ObjectGuid Player
Definition: CharacterPackets.h:728
uint8_t uint8
Definition: Define.h:152
std::string name[MAX_DECLINED_NAME_CASES]
Definition: Unit.h:1103

Member Data Documentation

DeclinedName WorldPackets::Character::SetPlayerDeclinedNames::DeclinedNames
ObjectGuid WorldPackets::Character::SetPlayerDeclinedNames::Player

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