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

#include <GuildPackets.h>

Classes

struct  GuildInfo
 

Public Member Functions

 QueryGuildInfoResponse ()
 
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

ObjectGuid GuildGuid
 
Optional< GuildInfoInfo
 

Additional Inherited Members

- Protected Attributes inherited from WorldPackets::Packet
WorldPacket _worldPacket
 

Constructor & Destructor Documentation

WorldPackets::Guild::QueryGuildInfoResponse::QueryGuildInfoResponse ( )
ServerPacket(OpcodeServer opcode, size_t initialSize=200, ConnectionType connection=CONNECTION_TYPE_DEFAULT)
Definition: Packet.h:49
Definition: Opcodes.h:1395

Member Function Documentation

WorldPacket const * WorldPackets::Guild::QueryGuildInfoResponse::Write ( )
overridevirtual

Implements WorldPackets::Packet.

30 {
32  _worldPacket.WriteBit(Info.is_initialized());
34 
35  if (Info)
36  {
37  _worldPacket << Info->GuildGUID;
38  _worldPacket << uint32(Info->VirtualRealmAddress);
39  _worldPacket << uint32(Info->Ranks.size());
40  _worldPacket << uint32(Info->EmblemStyle);
41  _worldPacket << uint32(Info->EmblemColor);
42  _worldPacket << uint32(Info->BorderStyle);
43  _worldPacket << uint32(Info->BorderColor);
44  _worldPacket << uint32(Info->BackgroundColor);
45 
46  for (GuildInfo::GuildInfoRank const& rank : Info->Ranks)
47  {
48  _worldPacket << uint32(rank.RankID);
49  _worldPacket << uint32(rank.RankOrder);
50 
51  _worldPacket.WriteBits(rank.RankName.size(), 7);
53 
54  _worldPacket.WriteString(rank.RankName);
55  }
56 
57  _worldPacket.WriteBits(Info->GuildName.size(), 7);
59 
60  _worldPacket.WriteString(Info->GuildName);
61  }
62 
63  return &_worldPacket;
64 }
ObjectGuid GuildGuid
Definition: GuildPackets.h:80
void FlushBits()
Definition: ByteBuffer.h:150
WorldPacket _worldPacket
Definition: Packet.h:43
bool WriteBit(uint32 bit)
Definition: ByteBuffer.h:170
Optional< GuildInfo > Info
Definition: GuildPackets.h:81
void WriteString(std::string const &str)
Definition: ByteBuffer.h:540
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

ObjectGuid WorldPackets::Guild::QueryGuildInfoResponse::GuildGuid
Optional<GuildInfo> WorldPackets::Guild::QueryGuildInfoResponse::Info

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