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

#include <BattlegroundPackets.h>

Classes

struct  HonorData
 
struct  PlayerData
 
struct  RatingData
 

Public Member Functions

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

Optional< uint8Winner
 
std::vector< PlayerDataPlayers
 
Optional< RatingDataRatings
 
int8 PlayerCount [2] = { }
 

Additional Inherited Members

- Protected Attributes inherited from WorldPackets::Packet
WorldPacket _worldPacket
 

Constructor & Destructor Documentation

WorldPackets::Battleground::PVPLogData::PVPLogData ( )
inline
ServerPacket(OpcodeServer opcode, size_t initialSize=200, ConnectionType connection=CONNECTION_TYPE_DEFAULT)
Definition: Packet.h:49
Definition: Opcodes.h:1388

Member Function Documentation

WorldPacket const * WorldPackets::Battleground::PVPLogData::Write ( )
overridevirtual

Implements WorldPackets::Packet.

103 {
104  _worldPacket.reserve(Players.size() * sizeof(PlayerData) + sizeof(PVPLogData));
105 
106  _worldPacket.WriteBit(Ratings.is_initialized());
107  _worldPacket.WriteBit(Winner.is_initialized());
108  _worldPacket << uint32(Players.size());
110 
111  if (Ratings.is_initialized())
112  _worldPacket << *Ratings;
113 
114  if (Winner)
116 
117  for (PlayerData const& player : Players)
118  _worldPacket << player;
119 
120  return &_worldPacket;
121 }
Optional< uint8 > Winner
Definition: BattlegroundPackets.h:129
Optional< RatingData > Ratings
Definition: BattlegroundPackets.h:131
WorldPacket _worldPacket
Definition: Packet.h:43
bool WriteBit(uint32 bit)
Definition: ByteBuffer.h:170
int8 PlayerCount[2]
Definition: BattlegroundPackets.h:132
void reserve(size_t ressize)
Definition: ByteBuffer.h:597
void append(T value)
Definition: ByteBuffer.h:143
uint8_t uint8
Definition: g3dmath.h:164
uint32_t uint32
Definition: g3dmath.h:168
std::vector< PlayerData > Players
Definition: BattlegroundPackets.h:130
PVPLogData()
Definition: BattlegroundPackets.h:92

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

int8 WorldPackets::Battleground::PVPLogData::PlayerCount[2] = { }
std::vector<PlayerData> WorldPackets::Battleground::PVPLogData::Players
Optional<RatingData> WorldPackets::Battleground::PVPLogData::Ratings
Optional<uint8> WorldPackets::Battleground::PVPLogData::Winner

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