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

Requesting a file. More...

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

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

Classes

class  FileTypeDataEmf
 Data associated with file_type value Emf. More...
class  FileTypeDataEif
 Data associated with file_type value Eif. More...
class  FileTypeDataEnf
 Data associated with file_type value Enf. More...
class  FileTypeDataEsf
 Data associated with file_type value Esf. More...
class  FileTypeDataEcf
 Data associated with file_type value Ecf. More...

Public Types

using FileTypeData = std::variant<std::monostate, FileTypeDataEmf, FileTypeDataEif, FileTypeDataEnf, FileTypeDataEsf, FileTypeDataEcf>
 Data associated with different values of the file_type field.

Public Member Functions

const FileTypeDataEmf * AsEmf () const noexcept
 Gets the data associated with file_type value Emf.
FileTypeDataEmf * AsEmf () noexcept
 Gets the data associated with file_type value Emf.
const FileTypeDataEif * AsEif () const noexcept
 Gets the data associated with file_type value Eif.
FileTypeDataEif * AsEif () noexcept
 Gets the data associated with file_type value Eif.
const FileTypeDataEnf * AsEnf () const noexcept
 Gets the data associated with file_type value Enf.
FileTypeDataEnf * AsEnf () noexcept
 Gets the data associated with file_type value Enf.
const FileTypeDataEsf * AsEsf () const noexcept
 Gets the data associated with file_type value Esf.
FileTypeDataEsf * AsEsf () noexcept
 Gets the data associated with file_type value Esf.
const FileTypeDataEcf * AsEcf () const noexcept
 Gets the data associated with file_type value Ecf.
FileTypeDataEcf * AsEcf () noexcept
 Gets the data associated with file_type value Ecf.
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 WelcomeAgreeClientPacket &other) const
 Compares this object with another for equality.
bool operator!= (const WelcomeAgreeClientPacket &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 WelcomeAgreeClientPacket ForEmf (FileTypeDataEmf data)
 Creates a new WelcomeAgreeClientPacket with file_type set to Emf.
static WelcomeAgreeClientPacket ForEif (FileTypeDataEif data)
 Creates a new WelcomeAgreeClientPacket with file_type set to Eif.
static WelcomeAgreeClientPacket ForEnf (FileTypeDataEnf data)
 Creates a new WelcomeAgreeClientPacket with file_type set to Enf.
static WelcomeAgreeClientPacket ForEsf (FileTypeDataEsf data)
 Creates a new WelcomeAgreeClientPacket with file_type set to Esf.
static WelcomeAgreeClientPacket ForEcf (FileTypeDataEcf data)
 Creates a new WelcomeAgreeClientPacket with file_type set to Ecf.

Public Attributes

FileType file_type {}
int session_id {}
FileTypeData file_type_data {}
 Data associated with the file_type field.

Static Public Attributes

static constexpr PacketFamily FAMILY = PacketFamily::Welcome
 The packet family associated with this packet.
static constexpr PacketAction ACTION = PacketAction::Agree
 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

Requesting a file.

Member Typedef Documentation

◆ FileTypeData

Data associated with different values of the file_type field.

Member Function Documentation

◆ AsEmf() [1/2]

const FileTypeDataEmf * eolib::protocol::net::client::WelcomeAgreeClientPacket::AsEmf ( ) const
inlinenoexcept

Gets the data associated with file_type value Emf.

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

◆ AsEmf() [2/2]

FileTypeDataEmf * eolib::protocol::net::client::WelcomeAgreeClientPacket::AsEmf ( )
inlinenoexcept

Gets the data associated with file_type value Emf.

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

◆ AsEif() [1/2]

const FileTypeDataEif * eolib::protocol::net::client::WelcomeAgreeClientPacket::AsEif ( ) const
inlinenoexcept

Gets the data associated with file_type value Eif.

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

◆ AsEif() [2/2]

FileTypeDataEif * eolib::protocol::net::client::WelcomeAgreeClientPacket::AsEif ( )
inlinenoexcept

Gets the data associated with file_type value Eif.

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

◆ AsEnf() [1/2]

const FileTypeDataEnf * eolib::protocol::net::client::WelcomeAgreeClientPacket::AsEnf ( ) const
inlinenoexcept

Gets the data associated with file_type value Enf.

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

◆ AsEnf() [2/2]

FileTypeDataEnf * eolib::protocol::net::client::WelcomeAgreeClientPacket::AsEnf ( )
inlinenoexcept

Gets the data associated with file_type value Enf.

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

◆ AsEsf() [1/2]

const FileTypeDataEsf * eolib::protocol::net::client::WelcomeAgreeClientPacket::AsEsf ( ) const
inlinenoexcept

Gets the data associated with file_type value Esf.

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

◆ AsEsf() [2/2]

FileTypeDataEsf * eolib::protocol::net::client::WelcomeAgreeClientPacket::AsEsf ( )
inlinenoexcept

Gets the data associated with file_type value Esf.

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

◆ AsEcf() [1/2]

const FileTypeDataEcf * eolib::protocol::net::client::WelcomeAgreeClientPacket::AsEcf ( ) const
inlinenoexcept

Gets the data associated with file_type value Ecf.

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

◆ AsEcf() [2/2]

FileTypeDataEcf * eolib::protocol::net::client::WelcomeAgreeClientPacket::AsEcf ( )
inlinenoexcept

Gets the data associated with file_type value Ecf.

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

◆ ForEmf()

WelcomeAgreeClientPacket eolib::protocol::net::client::WelcomeAgreeClientPacket::ForEmf ( FileTypeDataEmf data)
static

Creates a new WelcomeAgreeClientPacket with file_type set to Emf.

Parameters
datathe data associated with file_type Emf.
Returns
the created object.

◆ ForEif()

WelcomeAgreeClientPacket eolib::protocol::net::client::WelcomeAgreeClientPacket::ForEif ( FileTypeDataEif data)
static

Creates a new WelcomeAgreeClientPacket with file_type set to Eif.

Parameters
datathe data associated with file_type Eif.
Returns
the created object.

◆ ForEnf()

WelcomeAgreeClientPacket eolib::protocol::net::client::WelcomeAgreeClientPacket::ForEnf ( FileTypeDataEnf data)
static

Creates a new WelcomeAgreeClientPacket with file_type set to Enf.

Parameters
datathe data associated with file_type Enf.
Returns
the created object.

◆ ForEsf()

WelcomeAgreeClientPacket eolib::protocol::net::client::WelcomeAgreeClientPacket::ForEsf ( FileTypeDataEsf data)
static

Creates a new WelcomeAgreeClientPacket with file_type set to Esf.

Parameters
datathe data associated with file_type Esf.
Returns
the created object.

◆ ForEcf()

WelcomeAgreeClientPacket eolib::protocol::net::client::WelcomeAgreeClientPacket::ForEcf ( FileTypeDataEcf data)
static

Creates a new WelcomeAgreeClientPacket with file_type set to Ecf.

Parameters
datathe data associated with file_type Ecf.
Returns
the created object.

◆ Family()

PacketFamily eolib::protocol::net::client::WelcomeAgreeClientPacket::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::client::WelcomeAgreeClientPacket::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::client::WelcomeAgreeClientPacket::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::client::WelcomeAgreeClientPacket::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::client::WelcomeAgreeClientPacket::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::client::WelcomeAgreeClientPacket::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::client::WelcomeAgreeClientPacket::operator== ( const WelcomeAgreeClientPacket & 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::client::WelcomeAgreeClientPacket::operator!= ( const WelcomeAgreeClientPacket & 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::client::WelcomeAgreeClientPacket::FAMILY = PacketFamily::Welcome
staticconstexpr

The packet family associated with this packet.

◆ ACTION

PacketAction eolib::protocol::net::client::WelcomeAgreeClientPacket::ACTION = PacketAction::Agree
staticconstexpr

The packet action associated with this packet.

◆ file_type

FileType eolib::protocol::net::client::WelcomeAgreeClientPacket::file_type {}

◆ session_id

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

◆ file_type_data

FileTypeData eolib::protocol::net::client::WelcomeAgreeClientPacket::file_type_data {}

Data associated with the file_type field.