Horizon Official Technical Documentation
Horizon::Zone::ZC_MYGUILD_BASIC_INFO Class Reference

Main object for the aegis packet: ZC_MYGUILD_BASIC_INFO. More...

#include <TransmittedPackets.hpp>

+ Inheritance diagram for Horizon::Zone::ZC_MYGUILD_BASIC_INFO:
+ Collaboration diagram for Horizon::Zone::ZC_MYGUILD_BASIC_INFO:

Public Member Functions

 ZC_MYGUILD_BASIC_INFO (std::shared_ptr< ZoneSession > s)
 
virtual ~ZC_MYGUILD_BASIC_INFO ()
 
void deliver (std::vector< s_related_guild_info > s)
 ZC_MYGUILD_BASIC_INFO. More...
 
ByteBufferserialize ()
 
- Public Member Functions inherited from Horizon::Base::NetworkPacket< ZoneSession >
 NetworkPacket (uint16_t packet_id, std::shared_ptr< ZoneSession > s)
 
virtual ~NetworkPacket ()
 
void set_packet_id (uint16_t id)
 
uint16_t get_packet_id ()
 
ByteBufferbuf ()
 
std::shared_ptr< ZoneSession > get_session ()
 Retrieves the session from this handler instance. More...
 
virtual void handle (ByteBuffer &&buf)
 
virtual void deserialize (ByteBuffer &buf)
 
void transmit ()
 Send an Asynchronous packet by queueing a buffer of a particular size to the connected session. More...
 
void transmit (std::size_t size)
 Send an Asynchronous packet by queueing a buffer of a particular size to the connected session. More...
 

Public Attributes

int16_t _packet_length { 0 }
 
std::vector< s_related_guild_info_rg_infos
 

Additional Inherited Members

- Protected Attributes inherited from Horizon::Base::NetworkPacket< ZoneSession >
ByteBuffer _buffer
 Buffer storage facility for the packet stream. More...
 
uint16_t _packet_id
 ID of the network packet. More...
 

Detailed Description

Main object for the aegis packet: ZC_MYGUILD_BASIC_INFO.

Constructor & Destructor Documentation

◆ ZC_MYGUILD_BASIC_INFO()

Horizon::Zone::ZC_MYGUILD_BASIC_INFO::ZC_MYGUILD_BASIC_INFO ( std::shared_ptr< ZoneSession s)
inline
31678 : NetworkPacket<ZoneSession>(ID_ZC_MYGUILD_BASIC_INFO, s)
31679 {}
@ ID_ZC_MYGUILD_BASIC_INFO
Definition: TransmittedPackets.hpp:31651

◆ ~ZC_MYGUILD_BASIC_INFO()

virtual Horizon::Zone::ZC_MYGUILD_BASIC_INFO::~ZC_MYGUILD_BASIC_INFO ( )
inlinevirtual
31680{}

Member Function Documentation

◆ deliver()

void ZC_MYGUILD_BASIC_INFO::deliver ( std::vector< s_related_guild_info s)

ZC_MYGUILD_BASIC_INFO.

1826{
1827 _packet_length = 4 + (sizeof(struct s_related_guild_info) * s.size());
1828 _rg_infos = s;
1829
1830 serialize();
1831 transmit();
1832}
void transmit()
Send an Asynchronous packet by queueing a buffer of a particular size to the connected session.
Definition: NetworkPacket.hpp:94
ByteBuffer & serialize()
Definition: TransmittedPackets.cpp:1834
int16_t _packet_length
Definition: TransmittedPackets.hpp:31686
std::vector< s_related_guild_info > _rg_infos
Definition: TransmittedPackets.hpp:31687

References _packet_length, _rg_infos, serialize(), and Horizon::Base::NetworkPacket< ZoneSession >::transmit().

+ Here is the call graph for this function:

◆ serialize()

ByteBuffer & ZC_MYGUILD_BASIC_INFO::serialize ( )
1835{
1836 buf() << _packet_id;
1837 buf() << _packet_length;
1838 for (auto r : _rg_infos) {
1839 buf() << r.relation;
1840 buf() << r.guild_id;
1841 buf().append(r.guild_name, MAX_GUILD_NAME_LENGTH);
1842 }
1843 return buf();
1844}
#define MAX_GUILD_NAME_LENGTH
Definition: Client.hpp:36
void append(T value)
Definition: ByteBuffer.hpp:140
uint16_t _packet_id
ID of the network packet.
Definition: NetworkPacket.hpp:87
ByteBuffer & buf()
Definition: NetworkPacket.hpp:59

References Horizon::Base::NetworkPacket< ZoneSession >::_packet_id, _packet_length, _rg_infos, ByteBuffer::append(), Horizon::Base::NetworkPacket< ZoneSession >::buf(), and MAX_GUILD_NAME_LENGTH.

Referenced by deliver().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ _packet_length

int16_t Horizon::Zone::ZC_MYGUILD_BASIC_INFO::_packet_length { 0 }

Referenced by deliver(), and serialize().

◆ _rg_infos

std::vector<s_related_guild_info> Horizon::Zone::ZC_MYGUILD_BASIC_INFO::_rg_infos

Referenced by deliver(), and serialize().


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