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

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

#include <TransmittedPackets.hpp>

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

Public Member Functions

 ZC_SKILLINFO_LIST (std::shared_ptr< ZoneSession > s)
 
virtual ~ZC_SKILLINFO_LIST ()
 
void deliver (const std::vector< zc_skill_info_data > &_skills)
 ZC_SKILLINFO_LIST. 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
 
std::vector< zc_skill_info_data_skills
 

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_SKILLINFO_LIST.

Constructor & Destructor Documentation

◆ ZC_SKILLINFO_LIST()

Horizon::Zone::ZC_SKILLINFO_LIST::ZC_SKILLINFO_LIST ( std::shared_ptr< ZoneSession s)
inline
42802 : NetworkPacket<ZoneSession>(ID_ZC_SKILLINFO_LIST, s)
42803 {}
@ ID_ZC_SKILLINFO_LIST
Definition: TransmittedPackets.hpp:42763

◆ ~ZC_SKILLINFO_LIST()

virtual Horizon::Zone::ZC_SKILLINFO_LIST::~ZC_SKILLINFO_LIST ( )
inlinevirtual
42804{}

Member Function Documentation

◆ deliver()

void ZC_SKILLINFO_LIST::deliver ( const std::vector< zc_skill_info_data > &  _skills)

ZC_SKILLINFO_LIST.

2922{
2923 _packet_length = 4;
2924
2925 for (auto s : skills) {
2926#if (CLIENT_VERSION == 'R' && PACKET_VERSION >= 20190807) || \
2927 (CLIENT_VERSION == 'Z' && PACKET_VERSION >= 20190918)
2928 _packet_length += 15;
2929#else
2930 _packet_length += 37;
2931#endif
2932 }
2933
2934 _skills = skills;
2935
2936 serialize();
2937 transmit();
2938}
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:2940
int16_t _packet_length
Definition: TransmittedPackets.hpp:42810
std::vector< zc_skill_info_data > _skills
Definition: TransmittedPackets.hpp:42811

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

Referenced by Horizon::Zone::ZoneClientInterface::notify_learnt_skill_list().

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

◆ serialize()

ByteBuffer & ZC_SKILLINFO_LIST::serialize ( )
2941{
2942 buf() << _packet_id;
2943 buf() << _packet_length;
2944
2945 for (auto s : _skills) {
2946 buf() << s.skill_id;
2947 buf() << s.skill_type;
2948 buf() << s.level;
2949 buf() << s.sp_cost;
2950 buf() << s.range;
2951#if (CLIENT_VERSION == 'R' && PACKET_VERSION >= 20190807) || \
2952 (CLIENT_VERSION == 'Z' && PACKET_VERSION >= 20190918)
2953 buf() << s.upgradeable;
2954 buf() << s.level2;
2955#else
2956 buf().append(s.name, MAX_SKILL_NAME_LENGTH);
2957 buf() << s.upgradeable;
2958#endif
2959 }
2960
2961 return buf();
2962}
#define MAX_SKILL_NAME_LENGTH
Definition: SkillDefinitions.hpp:43
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, _skills, ByteBuffer::append(), Horizon::Base::NetworkPacket< ZoneSession >::buf(), and MAX_SKILL_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_SKILLINFO_LIST::_packet_length

Referenced by deliver(), and serialize().

◆ _skills

std::vector<zc_skill_info_data> Horizon::Zone::ZC_SKILLINFO_LIST::_skills

Referenced by deliver(), and serialize().


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