eolib-cpp 0.1.0-beta.7
Core C++ library for writing Endless Online applications
Loading...
Searching...
No Matches
eolib::protocol::net::server::WarpRequestServerPacket Class Referencefinal

Warp request from server. More...

#include <eolib/protocol/net/server/packets.hpp>

Inherits eolib::protocol::net::Packet.

Classes

class  WarpTypeDataMapSwitch
 Data associated with warp_type value MapSwitch. More...

Public Types

using WarpTypeData = std::variant<std::monostate, WarpTypeDataMapSwitch>
 Data associated with different values of the warp_type field.

Public Member Functions

const WarpTypeDataMapSwitch * AsMapSwitch () const noexcept
 Gets the data associated with warp_type value MapSwitch.
WarpTypeDataMapSwitch * AsMapSwitch () noexcept
 Gets the data associated with warp_type value MapSwitch.
PacketFamily Family () const noexcept override
 Gets the packet family associated with this packet.
PacketAction Action () const noexcept override
 Gets the packet action associated with this packet.
int ByteSize () const noexcept override
 Gets the size of the data that this object was deserialized from.
void Serialize (data::EoWriter &writer) const override
 Serializes this object to the provided writer.
void Deserialize (data::EoReader &reader) override
 Deserializes this object from the provided reader, replacing its current data.
std::string ToString () const override
 Gets a human-readable representation of this object, for debugging purposes.
bool operator== (const WarpRequestServerPacket &other) const
 Compares this object with another for equality.
bool operator!= (const WarpRequestServerPacket &other) const
 Compares this object with another for inequality.
Public Member Functions inherited from eolib::protocol::Serializable
virtual ~Serializable ()=default

Static Public Member Functions

static WarpRequestServerPacket ForLocal ()
 Creates a new WarpRequestServerPacket with warp_type set to Local.
static WarpRequestServerPacket ForMapSwitch (WarpTypeDataMapSwitch data)
 Creates a new WarpRequestServerPacket with warp_type set to MapSwitch.

Public Attributes

WarpType warp_type {}
int map_id {}
WarpTypeData warp_type_data {}
 Data associated with the warp_type field.
int session_id {}

Static Public Attributes

static constexpr PacketFamily FAMILY = PacketFamily::Warp
 The packet family associated with this packet.
static constexpr PacketAction ACTION = PacketAction::Request
 The packet action associated with this packet.

Additional Inherited Members

Protected Member Functions inherited from eolib::protocol::Serializable
 Serializable ()=default
 Serializable (const Serializable &)=default
 Serializable (Serializable &&)=default
Serializable & operator= (const Serializable &)=default
Serializable & operator= (Serializable &&)=default

Detailed Description

Warp request from server.

Member Typedef Documentation

◆ WarpTypeData

Data associated with different values of the warp_type field.

Member Function Documentation

◆ AsMapSwitch() [1/2]

const WarpTypeDataMapSwitch * eolib::protocol::net::server::WarpRequestServerPacket::AsMapSwitch ( ) const
inlinenoexcept

Gets the data associated with warp_type value MapSwitch.

Returns
the data, or nullptr if warp_type_data holds the data for a different value.

◆ AsMapSwitch() [2/2]

WarpTypeDataMapSwitch * eolib::protocol::net::server::WarpRequestServerPacket::AsMapSwitch ( )
inlinenoexcept

Gets the data associated with warp_type value MapSwitch.

Returns
the data, or nullptr if warp_type_data holds the data for a different value.

◆ ForLocal()

WarpRequestServerPacket eolib::protocol::net::server::WarpRequestServerPacket::ForLocal ( )
static

Creates a new WarpRequestServerPacket with warp_type set to Local.

Returns
the created object.

◆ ForMapSwitch()

WarpRequestServerPacket eolib::protocol::net::server::WarpRequestServerPacket::ForMapSwitch ( WarpTypeDataMapSwitch data)
static

Creates a new WarpRequestServerPacket with warp_type set to MapSwitch.

Parameters
datathe data associated with warp_type MapSwitch.
Returns
the created object.

◆ Family()

PacketFamily eolib::protocol::net::server::WarpRequestServerPacket::Family ( ) const
inlineoverridevirtualnoexcept

Gets the packet family associated with this packet.

Returns
the packet family.

Implements eolib::protocol::net::Packet.

◆ Action()

PacketAction eolib::protocol::net::server::WarpRequestServerPacket::Action ( ) const
inlineoverridevirtualnoexcept

Gets the packet action associated with this packet.

Returns
the packet action.

Implements eolib::protocol::net::Packet.

◆ ByteSize()

int eolib::protocol::net::server::WarpRequestServerPacket::ByteSize ( ) const
overridevirtualnoexcept

Gets the size of the data that this object was deserialized from.

Returns
the deserialized size in bytes, or 0 for an object that was not deserialized.

Implements eolib::protocol::Serializable.

◆ Serialize()

void eolib::protocol::net::server::WarpRequestServerPacket::Serialize ( data::EoWriter & writer) const
overridevirtual

Serializes this object to the provided writer.

Parameters
writerthe writer that the data will be written to.
Exceptions
SerializationErrorif the object's data is invalid for serialization.

Implements eolib::protocol::Serializable.

◆ Deserialize()

void eolib::protocol::net::server::WarpRequestServerPacket::Deserialize ( data::EoReader & reader)
overridevirtual

Deserializes this object from the provided reader, replacing its current data.

Parameters
readerthe reader that the data will be read from.

Implements eolib::protocol::Serializable.

◆ ToString()

std::string eolib::protocol::net::server::WarpRequestServerPacket::ToString ( ) const
overridevirtual

Gets a human-readable representation of this object, for debugging purposes.

Returns
the object's fields and values, as a string.

Implements eolib::protocol::Serializable.

◆ operator==()

bool eolib::protocol::net::server::WarpRequestServerPacket::operator== ( const WarpRequestServerPacket & other) const

Compares this object with another for equality.

The deserialized byte size is not compared.

Parameters
otherthe object to compare with.
Returns
true if all fields are equal, otherwise false.

◆ operator!=()

bool eolib::protocol::net::server::WarpRequestServerPacket::operator!= ( const WarpRequestServerPacket & other) const

Compares this object with another for inequality.

The deserialized byte size is not compared.

Parameters
otherthe object to compare with.
Returns
true if any field differs, otherwise false.

Member Data Documentation

◆ FAMILY

PacketFamily eolib::protocol::net::server::WarpRequestServerPacket::FAMILY = PacketFamily::Warp
staticconstexpr

The packet family associated with this packet.

◆ ACTION

PacketAction eolib::protocol::net::server::WarpRequestServerPacket::ACTION = PacketAction::Request
staticconstexpr

The packet action associated with this packet.

◆ warp_type

WarpType eolib::protocol::net::server::WarpRequestServerPacket::warp_type {}

◆ map_id

int eolib::protocol::net::server::WarpRequestServerPacket::map_id {}
Note
  • Value range is 0-64008.

◆ warp_type_data

WarpTypeData eolib::protocol::net::server::WarpRequestServerPacket::warp_type_data {}

Data associated with the warp_type field.

◆ session_id

int eolib::protocol::net::server::WarpRequestServerPacket::session_id {}
Note
  • Value range is 0-64008.