![]() |
FastEngine 0.9.3
A multiplayer oriented 2D engine made with Vulkan.
|
A packet with configurable options to transmit via a network thread. More...
#include <C_client.hpp>
Classes | |
struct | Option |
Public Types | |
enum class | Options { UPDATE_TIMESTAMP , UPDATE_FULL_TIMESTAMP , UPDATE_CORRECTION_LATENCY } |
Options to pass to the network thread when sending a packet. More... | |
Public Member Functions | |
TransmissionPacket (TransmissionPacket const &r)=delete | |
TransmissionPacket (TransmissionPacket &&r) noexcept=delete | |
TransmissionPacket & | operator= (TransmissionPacket const &r)=delete |
TransmissionPacket & | operator= (TransmissionPacket &&r) noexcept=delete |
ProtocolPacket const & | packet () const |
ProtocolPacket & | packet () |
std::vector< Option > const & | options () const |
std::vector< Option > & | options () |
TransmissionPacket & | doNotDiscard () |
TransmissionPacket & | doNotReorder () |
void | applyOptions (Client const &client) |
Apply packet options to the packet. | |
void | applyOptions () |
Apply packet options to the packet. | |
Static Public Member Functions | |
static std::shared_ptr< TransmissionPacket > | create (ProtocolPacket::Header header=FGE_NET_BAD_HEADERID) |
static std::shared_ptr< TransmissionPacket > | create (Packet &&packet) |
A packet with configurable options to transmit via a network thread.
Options will be applied at the moment when the packet will be sent.
|
strong |
Options to pass to the network thread when sending a packet.
Enumerator | |
---|---|
UPDATE_TIMESTAMP | The timestamp of the packet will be updated when sending. |
UPDATE_FULL_TIMESTAMP | The full timestamp of the packet will be updated when sending. |
UPDATE_CORRECTION_LATENCY | The latency of the packet will be updated with the corrector latency from the Client. |
void fge::net::TransmissionPacket::applyOptions | ( | ) |
Apply packet options to the packet.
Same as applyOptions(Client const& client) but without the client parameter. UPDATE_CORRECTION_LATENCY will throw.
void fge::net::TransmissionPacket::applyOptions | ( | Client const & | client | ) |
Apply packet options to the packet.
client | The client to apply the options |