TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
WorldPackets::Character::EnumCharactersResult::CharacterInfo Struct Reference

#include <CharacterPackets.h>

Classes

struct  PetInfo
 
struct  VisualItemInfo
 

Public Member Functions

 CharacterInfo (Field *fields)
 Initialize the struct with values from QueryResult. More...
 

Public Attributes

ObjectGuid Guid
 
std::string Name
 
uint8 ListPosition = 0
 Order of the characters in list. More...
 
uint8 Race = 0
 
uint8 Class = 0
 
uint8 Sex = 0
 
uint8 Skin = 0
 
uint8 Face = 0
 
uint8 HairStyle = 0
 
uint8 HairColor = 0
 
uint8 FacialHair = 0
 
uint8 Level = 0
 
int32 ZoneId = 0
 
int32 MapId = 0
 
G3D::Vector3 PreLoadPosition
 
ObjectGuid GuildGuid
 
uint32 Flags = 0
 Character flag. More...
 
uint32 CustomizationFlag = 0
 Character customization flags. More...
 
uint32 Flags3 = 0
 Character flags 3. More...
 
bool FirstLogin = false
 
uint8 unkWod61x = 0
 
uint32 LastPlayedTime = 0
 
struct
WorldPackets::Character::EnumCharactersResult::CharacterInfo::PetInfo 
Pet
 
bool BoostInProgress = false
 
int32 ProfessionIds [2]
 
VisualItemInfo VisualItems [INVENTORY_SLOT_BAG_END]
 

Constructor & Destructor Documentation

void WorldPackets::Character::EnumCharactersResult::CharacterInfo::CharacterInfo ( Field fields)

Initialize the struct with values from QueryResult.

Parameters
fieldsField set of CharacterDatabaseStatements::CHAR_SEL_ENUM
24 {
25  // 0 1 2 3 4 5 6 7
26  // "SELECT characters.guid, characters.name, characters.race, characters.class, characters.gender, characters.skin, characters.face, characters.hairStyle, "
27  // 8 9 10 11 12 13 14 15
28  // "characters.hairColor, characters.facialStyle, characters.level, characters.zone, characters.map, characters.position_x, characters.position_y, characters.position_z, "
29  // 16 17 18 19 20 21 22
30  // "guild_member.guildid, characters.playerFlags, characters.at_login, character_pet.entry, character_pet.modelid, character_pet.level, characters.equipmentCache, "
31  // 23 24 25 26
32  // "character_banned.guid, characters.slot, characters.logout_time, character_declinedname.genitive"
33 
34  Guid = ObjectGuid::Create<HighGuid::Player>(fields[0].GetUInt64());
35  Name = fields[1].GetString();
36  Race = fields[2].GetUInt8();
37  Class = fields[3].GetUInt8();
38  Sex = fields[4].GetUInt8();
39  Skin = fields[5].GetUInt8();
40  Face = fields[6].GetUInt8();
41  HairStyle = fields[7].GetUInt8();
42  HairColor = fields[8].GetUInt8();
43  FacialHair = fields[9].GetUInt8();
44  Level = fields[10].GetUInt8();
45  ZoneId = int32(fields[11].GetUInt16());
46  MapId = int32(fields[12].GetUInt16());
47  PreLoadPosition.x = fields[13].GetFloat();
48  PreLoadPosition.y = fields[14].GetFloat();
49  PreLoadPosition.z = fields[15].GetFloat();
50 
51  if (ObjectGuid::LowType guildId = fields[16].GetUInt64())
52  GuildGuid = ObjectGuid::Create<HighGuid::Guild>(guildId);
53 
54  uint32 playerFlags = fields[17].GetUInt32();
55  uint32 atLoginFlags = fields[18].GetUInt16();
56 
57  if (atLoginFlags & AT_LOGIN_RESURRECT)
58  playerFlags &= ~PLAYER_FLAGS_GHOST;
59 
60  if (playerFlags & PLAYER_FLAGS_HIDE_HELM)
62 
63  if (playerFlags & PLAYER_FLAGS_HIDE_CLOAK)
65 
66  if (playerFlags & PLAYER_FLAGS_GHOST)
68 
69  if (atLoginFlags & AT_LOGIN_RENAME)
71 
72  if (fields[23].GetUInt64())
74 
75  if (sWorld->getBoolConfig(CONFIG_DECLINED_NAMES_USED) && !fields[26].GetString().empty())
77 
78  if (atLoginFlags & AT_LOGIN_CUSTOMIZE)
80  else if (atLoginFlags & AT_LOGIN_CHANGE_FACTION)
82  else if (atLoginFlags & AT_LOGIN_CHANGE_RACE)
84 
85  Flags3 = 0;
86  FirstLogin = (atLoginFlags & AT_LOGIN_FIRST) != 0;
87 
88  // show pet at selection character in character list only for non-ghost character
89  if (!(playerFlags & PLAYER_FLAGS_GHOST) && (Class == CLASS_WARLOCK || Class == CLASS_HUNTER || Class == CLASS_DEATH_KNIGHT))
90  {
91  if (CreatureTemplate const* creatureInfo = sObjectMgr->GetCreatureTemplate(fields[19].GetUInt32()))
92  {
93  Pet.CreatureDisplayId = fields[20].GetUInt32();
94  Pet.Level = fields[21].GetUInt16();
95  Pet.CreatureFamily = creatureInfo->family;
96  }
97  }
98 
99  BoostInProgress = false;
100  ProfessionIds[0] = 0;
101  ProfessionIds[1] = 0;
102 
103  Tokenizer equipment(fields[22].GetString(), ' ');
104  ListPosition = fields[24].GetUInt8();
105  LastPlayedTime = fields[25].GetUInt32();
106 
107  for (uint8 slot = 0; slot < INVENTORY_SLOT_BAG_END; ++slot)
108  {
109  uint32 visualBase = slot * 3;
110  VisualItems[slot].InventoryType = Player::GetUInt32ValueFromArray(equipment, visualBase);
111  VisualItems[slot].DisplayId = Player::GetUInt32ValueFromArray(equipment, visualBase + 1);
112  VisualItems[slot].DisplayEnchantId = Player::GetUInt32ValueFromArray(equipment, visualBase + 2);
113  }
114 }
Definition: SharedDefines.h:931
uint8 FacialHair
Definition: CharacterPackets.h:125
float x
Definition: Vector3.h:62
Definition: SharedDefines.h:902
Definition: SharedDefines.h:905
uint8 HairColor
Definition: CharacterPackets.h:124
uint32 CustomizationFlag
Character customization flags.
Definition: CharacterPackets.h:132
uint64 GetUInt64() const
Definition: Field.h:184
Definition: World.h:133
Definition: SharedDefines.h:172
Definition: Player.h:521
uint8 Class
Definition: CharacterPackets.h:119
float GetFloat() const
Definition: Field.h:222
uint8 ListPosition
Order of the characters in list.
Definition: CharacterPackets.h:117
int32 MapId
Definition: CharacterPackets.h:128
uint32 Flags3
Character flags 3.
Definition: CharacterPackets.h:133
Definition: SharedDefines.h:930
Definition: SharedDefines.h:916
Definition: Util.h:45
uint8 Face
Definition: CharacterPackets.h:122
int32 ProfessionIds[2]
Definition: CharacterPackets.h:146
G3D::Vector3 PreLoadPosition
Definition: CharacterPackets.h:129
Definition: SharedDefines.h:906
Definition: SharedDefines.h:917
#define sWorld
Definition: World.h:887
int32 ZoneId
Definition: CharacterPackets.h:127
uint64 LowType
Definition: ObjectGuid.h:199
#define sObjectMgr
Definition: ObjectMgr.h:1567
float y
Definition: Vector3.h:62
uint8 Level
Definition: CharacterPackets.h:126
uint8 GetUInt8() const
Definition: Field.h:70
Definition: SharedDefines.h:903
Definition: Player.h:527
ObjectGuid GuildGuid
Definition: CharacterPackets.h:130
Definition: Player.h:528
uint32_t uint32
Definition: Define.h:150
VisualItemInfo VisualItems[INVENTORY_SLOT_BAG_END]
Definition: CharacterPackets.h:155
ObjectGuid Guid
Definition: CharacterPackets.h:115
uint16 GetUInt16() const
Definition: Field.h:108
bool FirstLogin
Definition: CharacterPackets.h:134
uint8 HairStyle
Definition: CharacterPackets.h:123
std::string Name
Definition: CharacterPackets.h:116
float z
Definition: Vector3.h:62
bool BoostInProgress
Definition: CharacterPackets.h:145
uint32 Flags
Character flag.
Definition: CharacterPackets.h:131
Definition: SharedDefines.h:169
uint32 GetUInt32() const
Definition: Field.h:146
int32_t int32
Definition: g3dmath.h:167
uint8 Skin
Definition: CharacterPackets.h:121
uint8_t uint8
Definition: Define.h:152
uint32 LastPlayedTime
Definition: CharacterPackets.h:136
Definition: SharedDefines.h:175
std::string GetString() const
Definition: Field.h:276
uint8 Race
Definition: CharacterPackets.h:118
Definition: SharedDefines.h:929
Definition: Creature.h:79
Definition: Pet.h:46

+ Here is the call graph for this function:

Member Data Documentation

bool WorldPackets::Character::EnumCharactersResult::CharacterInfo::BoostInProgress = false
uint8 WorldPackets::Character::EnumCharactersResult::CharacterInfo::Class = 0
uint32 WorldPackets::Character::EnumCharactersResult::CharacterInfo::CustomizationFlag = 0

Character customization flags.

See also
enum CharacterCustomizeFlags
uint8 WorldPackets::Character::EnumCharactersResult::CharacterInfo::Face = 0
uint8 WorldPackets::Character::EnumCharactersResult::CharacterInfo::FacialHair = 0
bool WorldPackets::Character::EnumCharactersResult::CharacterInfo::FirstLogin = false
uint32 WorldPackets::Character::EnumCharactersResult::CharacterInfo::Flags = 0

Character flag.

See also
enum CharacterFlags
uint32 WorldPackets::Character::EnumCharactersResult::CharacterInfo::Flags3 = 0

Character flags 3.

Todo:
research
ObjectGuid WorldPackets::Character::EnumCharactersResult::CharacterInfo::Guid
ObjectGuid WorldPackets::Character::EnumCharactersResult::CharacterInfo::GuildGuid
uint8 WorldPackets::Character::EnumCharactersResult::CharacterInfo::HairColor = 0
uint8 WorldPackets::Character::EnumCharactersResult::CharacterInfo::HairStyle = 0
uint32 WorldPackets::Character::EnumCharactersResult::CharacterInfo::LastPlayedTime = 0
uint8 WorldPackets::Character::EnumCharactersResult::CharacterInfo::Level = 0
uint8 WorldPackets::Character::EnumCharactersResult::CharacterInfo::ListPosition = 0

Order of the characters in list.

int32 WorldPackets::Character::EnumCharactersResult::CharacterInfo::MapId = 0
std::string WorldPackets::Character::EnumCharactersResult::CharacterInfo::Name
struct WorldPackets::Character::EnumCharactersResult::CharacterInfo::PetInfo WorldPackets::Character::EnumCharactersResult::CharacterInfo::Pet
G3D::Vector3 WorldPackets::Character::EnumCharactersResult::CharacterInfo::PreLoadPosition
int32 WorldPackets::Character::EnumCharactersResult::CharacterInfo::ProfessionIds[2]
uint8 WorldPackets::Character::EnumCharactersResult::CharacterInfo::Race = 0
uint8 WorldPackets::Character::EnumCharactersResult::CharacterInfo::Sex = 0
uint8 WorldPackets::Character::EnumCharactersResult::CharacterInfo::Skin = 0
uint8 WorldPackets::Character::EnumCharactersResult::CharacterInfo::unkWod61x = 0
VisualItemInfo WorldPackets::Character::EnumCharactersResult::CharacterInfo::VisualItems[INVENTORY_SLOT_BAG_END]
int32 WorldPackets::Character::EnumCharactersResult::CharacterInfo::ZoneId = 0

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