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

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

#include <TransmittedPackets.hpp>

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

Public Member Functions

 ZC_NOTIFY_TIME (std::shared_ptr< ZoneSession > s)
 
virtual ~ZC_NOTIFY_TIME ()
 
void deliver ()
 ZC_NOTIFY_TIME. 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

int32_t _timestamp {0}
 

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

Constructor & Destructor Documentation

◆ ZC_NOTIFY_TIME()

Horizon::Zone::ZC_NOTIFY_TIME::ZC_NOTIFY_TIME ( std::shared_ptr< ZoneSession s)
inline
35182 : NetworkPacket<ZoneSession>(ID_ZC_NOTIFY_TIME, s)
35183 {}
@ ID_ZC_NOTIFY_TIME
Definition: TransmittedPackets.hpp:35155

◆ ~ZC_NOTIFY_TIME()

virtual Horizon::Zone::ZC_NOTIFY_TIME::~ZC_NOTIFY_TIME ( )
inlinevirtual
35184{}

Member Function Documentation

◆ deliver()

void ZC_NOTIFY_TIME::deliver ( )

ZC_NOTIFY_TIME.

2270{
2271 _timestamp = (int32_t) get_sys_time();
2272 serialize();
2273 transmit();
2274}
int64_t get_sys_time()
Definition: Utility.cpp:68
void transmit()
Send an Asynchronous packet by queueing a buffer of a particular size to the connected session.
Definition: NetworkPacket.hpp:94
int32_t _timestamp
Definition: TransmittedPackets.hpp:35190
ByteBuffer & serialize()
Definition: TransmittedPackets.cpp:2276

References _timestamp, get_sys_time(), serialize(), and Horizon::Base::NetworkPacket< ZoneSession >::transmit().

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

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

◆ serialize()

ByteBuffer & ZC_NOTIFY_TIME::serialize ( )
2277{
2278 buf() << _packet_id;
2279 buf() << _timestamp;
2280 return buf();
2281}
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, _timestamp, and Horizon::Base::NetworkPacket< ZoneSession >::buf().

Referenced by deliver().

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

Member Data Documentation

◆ _timestamp

int32_t Horizon::Zone::ZC_NOTIFY_TIME::_timestamp {0}

Referenced by deliver(), and serialize().


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