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

#include <QueryPackets.h>

Public Member Functions

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

uint32 TextID = 0
 
bool Allow = false
 
float Probabilities [MAX_NPC_TEXT_OPTIONS]
 
uint32 BroadcastTextID [MAX_NPC_TEXT_OPTIONS]
 

Additional Inherited Members

- Protected Attributes inherited from WorldPackets::Packet
WorldPacket _worldPacket
 

Constructor & Destructor Documentation

WorldPackets::Query::QueryNPCTextResponse::QueryNPCTextResponse ( )
inline
ServerPacket(OpcodeServer opcode, size_t initialSize=200, ConnectionType connection=CONNECTION_TYPE_DEFAULT)
Definition: Packet.h:49
Definition: Opcodes.h:1397

Member Function Documentation

WorldPacket const * WorldPackets::Query::QueryNPCTextResponse::Write ( )
overridevirtual

Implements WorldPackets::Packet.

226 {
227  _worldPacket << TextID;
229 
231 
232  _worldPacket << int32(Allow ? (MAX_NPC_TEXT_OPTIONS * (sizeof(float) + sizeof(uint32))) : 0);
233 
234  if (Allow)
235  {
236  for (uint32 i = 0; i < MAX_NPC_TEXT_OPTIONS; ++i)
238  for (uint32 i = 0; i < MAX_NPC_TEXT_OPTIONS; ++i)
240  }
241 
242  return &_worldPacket;
243 }
bool Allow
Definition: QueryPackets.h:170
void FlushBits()
Definition: ByteBuffer.h:150
WorldPacket _worldPacket
Definition: Packet.h:43
bool WriteBit(uint32 bit)
Definition: ByteBuffer.h:170
#define MAX_NPC_TEXT_OPTIONS
Definition: NPCHandler.h:28
uint32 BroadcastTextID[MAX_NPC_TEXT_OPTIONS]
Definition: QueryPackets.h:172
uint32_t uint32
Definition: Define.h:150
float Probabilities[MAX_NPC_TEXT_OPTIONS]
Definition: QueryPackets.h:171
int32_t int32
Definition: g3dmath.h:167
uint32 TextID
Definition: QueryPackets.h:169

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

bool WorldPackets::Query::QueryNPCTextResponse::Allow = false
uint32 WorldPackets::Query::QueryNPCTextResponse::BroadcastTextID[MAX_NPC_TEXT_OPTIONS]
float WorldPackets::Query::QueryNPCTextResponse::Probabilities[MAX_NPC_TEXT_OPTIONS]
uint32 WorldPackets::Query::QueryNPCTextResponse::TextID = 0

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