AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
WorldPackets::WorldState::InitWorldStates Class Referencefinal

#include "WorldStatePackets.h"

Inheritance diagram for WorldPackets::WorldState::InitWorldStates:
WorldPackets::ServerPacket WorldPackets::Packet

Classes

struct  WorldStateInfo
 

Public Member Functions

 InitWorldStates ()
 
WorldPacket const * Write () override
 
- Public Member Functions inherited from WorldPackets::ServerPacket
 ServerPacket (OpcodeServer opcode, std::size_t initialSize=200)
 
void Read () final
 
void Clear ()
 
WorldPacket && Move ()
 
void ShrinkToFit ()
 
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
 
virtual WorldPacket const * Write ()=0
 
virtual void Read ()=0
 
WorldPacket const * GetRawPacket () const
 
std::size_t GetSize () const
 

Public Attributes

int32 MapID = 0
 
int32 ZoneID = 0
 
int32 AreaID = 0
 
std::vector< WorldStateInfoWorldstates
 

Additional Inherited Members

- Protected Attributes inherited from WorldPackets::Packet
WorldPacket _worldPacket
 

Detailed Description

Constructor & Destructor Documentation

◆ InitWorldStates()

WorldPackets::WorldState::InitWorldStates::InitWorldStates ( )
20: ServerPacket(SMSG_INIT_WORLD_STATES, 4 + 4 + 4 + 2) { }
@ SMSG_INIT_WORLD_STATES
Definition: Opcodes.h:736
ServerPacket(OpcodeServer opcode, std::size_t initialSize=200)
Definition: Packet.cpp:25

Member Function Documentation

◆ Write()

WorldPacket const * WorldPackets::WorldState::InitWorldStates::Write ( )
overridevirtual

Implements WorldPackets::Packet.

23{
24 _worldPacket.reserve(4 + 4 + 4 + 2 + Worldstates.size() * 8);
25
29
31 for (WorldStateInfo const& wsi : Worldstates)
32 {
33 _worldPacket << int32(wsi.VariableID);
34 _worldPacket << int32(wsi.Value);
35 }
36
37 return &_worldPacket;
38}
std::int32_t int32
Definition: Define.h:103
std::uint16_t uint16
Definition: Define.h:108
Worldstates
Definition: zone_undercity.cpp:727
WorldPacket _worldPacket
Definition: Packet.h:42
int32 MapID
Definition: WorldStatePackets.h:42
int32 AreaID
Definition: WorldStatePackets.h:44
int32 ZoneID
Definition: WorldStatePackets.h:43
void reserve(std::size_t ressize)
Definition: ByteBuffer.h:454

References ByteBuffer::reserve().

Member Data Documentation

◆ AreaID

int32 WorldPackets::WorldState::InitWorldStates::AreaID = 0

◆ MapID

int32 WorldPackets::WorldState::InitWorldStates::MapID = 0

◆ Worldstates

std::vector<WorldStateInfo> WorldPackets::WorldState::InitWorldStates::Worldstates

◆ ZoneID

int32 WorldPackets::WorldState::InitWorldStates::ZoneID = 0