TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
WhoPackets.cpp File Reference
#include "WhoPackets.h"
+ Include dependency graph for WhoPackets.cpp:

Functions

ByteBufferoperator>> (ByteBuffer &data, WorldPackets::Who::WhoWord &word)
 
ByteBufferoperator>> (ByteBuffer &data, Optional< WorldPackets::Who::WhoRequestServerInfo > &serverInfo)
 
ByteBufferoperator>> (ByteBuffer &data, WorldPackets::Who::WhoRequest &request)
 
ByteBufferoperator<< (ByteBuffer &data, WorldPackets::Who::WhoEntry const &entry)
 
ByteBufferoperator<< (ByteBuffer &data, WorldPackets::Who::WhoResponse const &response)
 

Function Documentation

ByteBuffer& operator<< ( ByteBuffer data,
WorldPackets::Who::WhoEntry const entry 
)
97 {
98  data << entry.PlayerData;
99 
100  data << entry.GuildGUID;
101  data << uint32(entry.GuildVirtualRealmAddress);
102  data << int32(entry.AreaID);
103 
104  data.WriteBits(entry.GuildName.length(), 7);
105  data.WriteBit(entry.IsGM);
106  data.FlushBits();
107 
108  data.WriteString(entry.GuildName);
109 
110  return data;
111 }
void FlushBits()
Definition: ByteBuffer.h:150
bool WriteBit(uint32 bit)
Definition: ByteBuffer.h:170
void WriteString(std::string const &str)
Definition: ByteBuffer.h:540
int32_t int32
Definition: g3dmath.h:167
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:

ByteBuffer& operator<< ( ByteBuffer data,
WorldPackets::Who::WhoResponse const response 
)
114 {
115  data.WriteBits(response.Entries.size(), 6);
116  data.FlushBits();
117 
118  for (size_t i = 0; i < response.Entries.size(); ++i)
119  data << response.Entries[i];
120 
121  return data;
122 }
void FlushBits()
Definition: ByteBuffer.h:150
void WriteBits(T value, int32 bits)
Definition: ByteBuffer.h:198

+ Here is the call graph for this function:

ByteBuffer& operator>> ( ByteBuffer data,
WorldPackets::Who::WhoWord word 
)
36 {
37  data.ResetBitPos();
38  word.Word = data.ReadString(data.ReadBits(7));
39 
40  return data;
41 }
uint32 ReadBits(int32 bits)
Definition: ByteBuffer.h:204
void ResetBitPos()
Definition: ByteBuffer.h:161
std::string ReadString(uint32 length)
Definition: ByteBuffer.h:524
std::string Word
Definition: WhoPackets.h:51

+ Here is the call graph for this function:

ByteBuffer& operator>> ( ByteBuffer data,
Optional< WorldPackets::Who::WhoRequestServerInfo > &  serverInfo 
)
44 {
45  serverInfo = boost::in_place();
46 
47  data >> serverInfo->FactionGroup;
48  data >> serverInfo->Locale;
49  data >> serverInfo->RequesterVirtualRealmAddress;
50 
51  return data;
52 }
ByteBuffer& operator>> ( ByteBuffer data,
WorldPackets::Who::WhoRequest request 
)
55 {
56  data >> request.MinLevel;
57  data >> request.MaxLevel;
58  data >> request.RaceFilter;
59  data >> request.ClassFilter;
60 
61  uint32 nameLength = data.ReadBits(6);
62  uint32 virtualRealmNameLength = data.ReadBits(9);
63  uint32 guildNameLength = data.ReadBits(7);
64  uint32 guildVirtualRealmNameLength = data.ReadBits(9);
65  request.Words.resize(data.ReadBits(3));
66 
67  request.ShowEnemies = data.ReadBit();
68  request.ShowArenaPlayers = data.ReadBit();
69  request.ExactName = data.ReadBit();
70 
71  bool const hasWhoRequest = data.ReadBit();
72 
73  request.Name = data.ReadString(nameLength);
74  request.VirtualRealmName = data.ReadString(virtualRealmNameLength);
75  request.Guild = data.ReadString(guildNameLength);
76  request.GuildVirtualRealmName = data.ReadString(guildVirtualRealmNameLength);
77 
78  for (size_t i = 0; i < request.Words.size(); ++i)
79  data >> request.Words[i];
80  if (hasWhoRequest)
81  data >> request.ServerInfo;
82 
83  return data;
84 }
std::string Guild
Definition: WhoPackets.h:67
std::string GuildVirtualRealmName
Definition: WhoPackets.h:68
uint32 ReadBits(int32 bits)
Definition: ByteBuffer.h:204
bool ShowEnemies
Definition: WhoPackets.h:72
Optional< WhoRequestServerInfo > ServerInfo
Definition: WhoPackets.h:75
int32 MaxLevel
Definition: WhoPackets.h:64
bool ExactName
Definition: WhoPackets.h:74
std::string ReadString(uint32 length)
Definition: ByteBuffer.h:524
uint32_t uint32
Definition: Define.h:150
int32 RaceFilter
Definition: WhoPackets.h:69
bool ShowArenaPlayers
Definition: WhoPackets.h:73
int32 ClassFilter
Definition: WhoPackets.h:70
std::string Name
Definition: WhoPackets.h:65
std::vector< WhoWord > Words
Definition: WhoPackets.h:71
std::string VirtualRealmName
Definition: WhoPackets.h:66
bool ReadBit()
Definition: ByteBuffer.h:186
int32 MinLevel
Definition: WhoPackets.h:63

+ Here is the call graph for this function: