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

#include <CharacterPackets.h>

Classes

struct  CharacterInfo
 
struct  RestrictedFactionChangeRuleInfo
 

Public Member Functions

 EnumCharactersResult ()
 
WorldPacket constWrite () override
 
- Public Member Functions inherited from WorldPackets::ServerPacket
 ServerPacket (OpcodeServer opcode, size_t initialSize=200, ConnectionType connection=CONNECTION_TYPE_DEFAULT)
 
void Read () overridefinal
 
void Clear ()
 
WorldPacket && Move ()
 
OpcodeServer 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

bool Success = false
 
bool IsDeletedCharacters = false
 used for character undelete list More...
 
std::list< CharacterInfoCharacters
 all characters on the list More...
 
std::list
< RestrictedFactionChangeRuleInfo
FactionChangeRestrictions
 

Additional Inherited Members

- Protected Attributes inherited from WorldPackets::Packet
WorldPacket _worldPacket
 

Constructor & Destructor Documentation

WorldPackets::Character::EnumCharactersResult::EnumCharactersResult ( )
inline
ServerPacket(OpcodeServer opcode, size_t initialSize=200, ConnectionType connection=CONNECTION_TYPE_DEFAULT)
Definition: Packet.h:49
Definition: Opcodes.h:974

Member Function Documentation

WorldPacket const * WorldPackets::Character::EnumCharactersResult::Write ( )
overridevirtual

Implements WorldPackets::Packet.

117 {
118  _worldPacket.reserve(9 + Characters.size() * sizeof(CharacterInfo) + FactionChangeRestrictions.size() * sizeof(RestrictedFactionChangeRuleInfo));
119 
122  _worldPacket << uint32(Characters.size());
124 
125  for (CharacterInfo const& charInfo : Characters)
126  {
127  _worldPacket << charInfo.Guid;
128  _worldPacket << uint8(charInfo.ListPosition);
129  _worldPacket << uint8(charInfo.Race);
130  _worldPacket << uint8(charInfo.Class);
131  _worldPacket << uint8(charInfo.Sex);
132  _worldPacket << uint8(charInfo.Skin);
133  _worldPacket << uint8(charInfo.Face);
134  _worldPacket << uint8(charInfo.HairStyle);
135  _worldPacket << uint8(charInfo.HairColor);
136  _worldPacket << uint8(charInfo.FacialHair);
137  _worldPacket << uint8(charInfo.Level);
138  _worldPacket << int32(charInfo.ZoneId);
139  _worldPacket << int32(charInfo.MapId);
140  _worldPacket << charInfo.PreLoadPosition;
141  _worldPacket << charInfo.GuildGuid;
142  _worldPacket << uint32(charInfo.Flags);
143  _worldPacket << uint32(charInfo.CustomizationFlag);
144  _worldPacket << uint32(charInfo.Flags3);
145  _worldPacket << uint32(charInfo.Pet.CreatureDisplayId);
146  _worldPacket << uint32(charInfo.Pet.Level);
147  _worldPacket << uint32(charInfo.Pet.CreatureFamily);
148 
149  _worldPacket << uint32(charInfo.ProfessionIds[0]);
150  _worldPacket << uint32(charInfo.ProfessionIds[1]);
151 
152  for (uint8 slot = 0; slot < INVENTORY_SLOT_BAG_END; ++slot)
153  {
154  _worldPacket << uint32(charInfo.VisualItems[slot].DisplayId);
155  _worldPacket << uint32(charInfo.VisualItems[slot].DisplayEnchantId);
156  _worldPacket << uint8(charInfo.VisualItems[slot].InventoryType);
157  }
158 
159  _worldPacket << uint32(charInfo.LastPlayedTime);
160  _worldPacket.WriteBits(charInfo.Name.length(), 6);
161  _worldPacket.WriteBit(charInfo.FirstLogin);
162  _worldPacket.WriteBit(charInfo.BoostInProgress);
163  _worldPacket.WriteBits(charInfo.unkWod61x, 5);
165 
166  _worldPacket.WriteString(charInfo.Name);
167  }
168 
169  for (RestrictedFactionChangeRuleInfo const& rule : FactionChangeRestrictions)
170  {
171  _worldPacket << int32(rule.Mask);
172  _worldPacket << uint8(rule.Race);
173  }
174 
175  return &_worldPacket;
176 }
std::list< CharacterInfo > Characters
all characters on the list
Definition: CharacterPackets.h:174
bool IsDeletedCharacters
used for character undelete list
Definition: CharacterPackets.h:172
std::list< RestrictedFactionChangeRuleInfo > FactionChangeRestrictions
Definition: CharacterPackets.h:175
void FlushBits()
Definition: ByteBuffer.h:150
WorldPacket _worldPacket
Definition: Packet.h:43
bool WriteBit(uint32 bit)
Definition: ByteBuffer.h:170
bool Success
Definition: CharacterPackets.h:171
void WriteString(std::string const &str)
Definition: ByteBuffer.h:540
Definition: World.h:532
void reserve(size_t ressize)
Definition: ByteBuffer.h:597
uint8_t uint8
Definition: g3dmath.h:164
int32_t int32
Definition: g3dmath.h:167
uint8_t uint8
Definition: Define.h:152
uint32_t uint32
Definition: g3dmath.h:168
void WriteBits(T value, int32 bits)
Definition: ByteBuffer.h:198

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

std::list<CharacterInfo> WorldPackets::Character::EnumCharactersResult::Characters

all characters on the list

std::list<RestrictedFactionChangeRuleInfo> WorldPackets::Character::EnumCharactersResult::FactionChangeRestrictions
Todo:
: research
bool WorldPackets::Character::EnumCharactersResult::IsDeletedCharacters = false

used for character undelete list

bool WorldPackets::Character::EnumCharactersResult::Success = false

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