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

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

#include <TransmittedPackets.hpp>

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

Public Member Functions

 ZC_GROUP_LIST (std::shared_ptr< ZoneSession > s)
 
virtual ~ZC_GROUP_LIST ()
 
void deliver (std::string party_name, std::vector< s_members >)
 ZC_GROUP_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_len { 0 }
 
char _party_name [MAX_PARTY_NAME_LENGTH]
 
std::vector< s_members_members
 

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

Constructor & Destructor Documentation

◆ ZC_GROUP_LIST()

Horizon::Zone::ZC_GROUP_LIST::ZC_GROUP_LIST ( std::shared_ptr< ZoneSession s)
inline
26883 : NetworkPacket<ZoneSession>(ID_ZC_GROUP_LIST, s)
26884 {}
@ ID_ZC_GROUP_LIST
Definition: TransmittedPackets.hpp:26838

◆ ~ZC_GROUP_LIST()

virtual Horizon::Zone::ZC_GROUP_LIST::~ZC_GROUP_LIST ( )
inlinevirtual
26885{}

Member Function Documentation

◆ deliver()

void ZC_GROUP_LIST::deliver ( std::string  party_name,
std::vector< s_members members 
)

ZC_GROUP_LIST.

1304{
1305 std::strncpy(_party_name, party_name.c_str(), MAX_PARTY_NAME_LENGTH);
1306
1307 _members = members;
1308
1309 serialize();
1310 transmit();
1311}
#define MAX_PARTY_NAME_LENGTH
Definition: Client.hpp:35
void transmit()
Send an Asynchronous packet by queueing a buffer of a particular size to the connected session.
Definition: NetworkPacket.hpp:94
std::vector< s_members > _members
Definition: TransmittedPackets.hpp:26893
ByteBuffer & serialize()
Definition: TransmittedPackets.cpp:1313
char _party_name[MAX_PARTY_NAME_LENGTH]
Definition: TransmittedPackets.hpp:26892

References _members, _party_name, MAX_PARTY_NAME_LENGTH, serialize(), and Horizon::Base::NetworkPacket< ZoneSession >::transmit().

+ Here is the call graph for this function:

◆ serialize()

ByteBuffer & ZC_GROUP_LIST::serialize ( )
1314{
1315 buf() << _packet_id;
1316 buf() << 28 + (sizeof(struct s_members) * _members.size());
1318 for (int i = 0; i < _members.size(); i++) {
1319 buf() << _members[i].account_id;
1320#if PACKET_VERSION >= 20171207
1321 buf() << _members[i].char_id;
1322#endif
1325 buf() << _members[i].leader;
1326 buf() << _members[i].offline;
1327#if (CLIENT_TYPE == 'M' && PACKET_VERSION >= 20170524) || \
1328 (CLIENT_TYPE == 'R' && PACKET_VERSION >= 20170502) || \
1329 (CLIENT_TYPE == 'Z')
1330 buf() << _members[i].class_;
1331 buf() << _members[i].base_level;
1332#endif
1333 }
1334 return buf();
1335}
#define MAX_UNIT_NAME_LENGTH
Definition: Client.hpp:34
#define MAP_NAME_LENGTH_EXT
Definition: Client.hpp:47
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
Definition: ClientDefinitions.hpp:172
char map_name[MAP_NAME_LENGTH_EXT]
Definition: ClientDefinitions.hpp:178
char player_name[MAX_UNIT_NAME_LENGTH]
Definition: ClientDefinitions.hpp:177

References _members, Horizon::Base::NetworkPacket< ZoneSession >::_packet_id, _party_name, ByteBuffer::append(), Horizon::Base::NetworkPacket< ZoneSession >::buf(), s_members::map_name, MAP_NAME_LENGTH_EXT, MAX_PARTY_NAME_LENGTH, MAX_UNIT_NAME_LENGTH, and s_members::player_name.

Referenced by deliver().

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

Member Data Documentation

◆ _members

std::vector<s_members> Horizon::Zone::ZC_GROUP_LIST::_members

Referenced by deliver(), and serialize().

◆ _packet_len

int16_t Horizon::Zone::ZC_GROUP_LIST::_packet_len { 0 }

◆ _party_name

char Horizon::Zone::ZC_GROUP_LIST::_party_name[MAX_PARTY_NAME_LENGTH]

Referenced by deliver(), and serialize().


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