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

Update the guild description or rank list. More...

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

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

Classes

class  InfoTypeDataDescription
 Data associated with info_type value Description. More...
class  InfoTypeDataRanks
 Data associated with info_type value Ranks. More...

Public Types

using InfoTypeData = std::variant<std::monostate, InfoTypeDataDescription, InfoTypeDataRanks>
 Data associated with different values of the info_type field.

Public Member Functions

const InfoTypeDataDescription * AsDescription () const noexcept
 Gets the data associated with info_type value Description.
InfoTypeDataDescription * AsDescription () noexcept
 Gets the data associated with info_type value Description.
const InfoTypeDataRanks * AsRanks () const noexcept
 Gets the data associated with info_type value Ranks.
InfoTypeDataRanks * AsRanks () noexcept
 Gets the data associated with info_type value Ranks.
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 GuildAgreeClientPacket &other) const
 Compares this object with another for equality.
bool operator!= (const GuildAgreeClientPacket &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 GuildAgreeClientPacket ForDescription (InfoTypeDataDescription data)
 Creates a new GuildAgreeClientPacket with info_type set to Description.
static GuildAgreeClientPacket ForRanks (InfoTypeDataRanks data)
 Creates a new GuildAgreeClientPacket with info_type set to Ranks.
static GuildAgreeClientPacket ForBank ()
 Creates a new GuildAgreeClientPacket with info_type set to Bank.

Public Attributes

int session_id {}
GuildInfoType info_type {}
InfoTypeData info_type_data {}
 Data associated with the info_type field.

Static Public Attributes

static constexpr PacketFamily FAMILY = PacketFamily::Guild
 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

Update the guild description or rank list.

Member Typedef Documentation

◆ InfoTypeData

Data associated with different values of the info_type field.

Member Function Documentation

◆ AsDescription() [1/2]

const InfoTypeDataDescription * eolib::protocol::net::client::GuildAgreeClientPacket::AsDescription ( ) const
inlinenoexcept

Gets the data associated with info_type value Description.

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

◆ AsDescription() [2/2]

InfoTypeDataDescription * eolib::protocol::net::client::GuildAgreeClientPacket::AsDescription ( )
inlinenoexcept

Gets the data associated with info_type value Description.

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

◆ AsRanks() [1/2]

const InfoTypeDataRanks * eolib::protocol::net::client::GuildAgreeClientPacket::AsRanks ( ) const
inlinenoexcept

Gets the data associated with info_type value Ranks.

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

◆ AsRanks() [2/2]

InfoTypeDataRanks * eolib::protocol::net::client::GuildAgreeClientPacket::AsRanks ( )
inlinenoexcept

Gets the data associated with info_type value Ranks.

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

◆ ForDescription()

GuildAgreeClientPacket eolib::protocol::net::client::GuildAgreeClientPacket::ForDescription ( InfoTypeDataDescription data)
static

Creates a new GuildAgreeClientPacket with info_type set to Description.

Parameters
datathe data associated with info_type Description.
Returns
the created object.

◆ ForRanks()

GuildAgreeClientPacket eolib::protocol::net::client::GuildAgreeClientPacket::ForRanks ( InfoTypeDataRanks data)
static

Creates a new GuildAgreeClientPacket with info_type set to Ranks.

Parameters
datathe data associated with info_type Ranks.
Returns
the created object.

◆ ForBank()

GuildAgreeClientPacket eolib::protocol::net::client::GuildAgreeClientPacket::ForBank ( )
static

Creates a new GuildAgreeClientPacket with info_type set to Bank.

Returns
the created object.

◆ Family()

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

The packet family associated with this packet.

◆ ACTION

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

The packet action associated with this packet.

◆ session_id

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

◆ info_type

GuildInfoType eolib::protocol::net::client::GuildAgreeClientPacket::info_type {}

◆ info_type_data

InfoTypeData eolib::protocol::net::client::GuildAgreeClientPacket::info_type_data {}

Data associated with the info_type field.