Skip to content

Class endstone::ServerListPingEvent

ClassList > endstone > ServerListPingEvent

Called when a server ping is coming in.

  • #include <endstone/event/server/server_list_ping_event.h>

Inherits the following classes: endstone::ServerEvent

Public Static Attributes

Type Name
const std::string NAME = = "ServerListPingEvent"

Public Functions

Type Name
ServerListPingEvent (std::string remote_host, int remote_port, std::string ping_response)
bool deserialize ()
virtual std::string getEventName () override const
GameMode getGameMode () const
std::string getLevelName () const
int getLocalPort () const
int getLocalPortV6 () const
int getMaxPlayers () const
std::string getMinecraftVersionNetwork () const
std::string getMotd () const
int getNetworkProtocolVersion () const
int getNumPlayers () const
std::string getRemoteHost () const
int getRemotePort () const
std::string getServerGuid () const
virtual bool isCancellable () override const
std::string serialize ()
void setGameMode (GameMode game_mode)
void setLevelName (std::string level_name)
void setMaxPlayers (int max_players)
void setMinecraftVersionNetwork (std::string minecraft_version_network)
void setMotd (std::string motd)
void setNumPlayers (int num_players)

Public Functions inherited from endstone::ServerEvent

See endstone::ServerEvent

Type Name
Event (bool async=false)
Event (const Event &) = delete

Public Functions inherited from endstone::Event

See endstone::Event

Type Name
Event (bool async=false)
Event (const Event &) = delete
virtual std::string getEventName () const = 0
bool isAsynchronous () const
virtual bool isCancellable () const = 0
bool isCancelled () const
Event & operator= (const Event &) = delete
void setCancelled (bool cancel)
virtual ~Event () = default

Public Static Attributes Documentation

variable NAME

const std::string endstone::ServerListPingEvent::NAME;

Public Functions Documentation

function ServerListPingEvent

inline endstone::ServerListPingEvent::ServerListPingEvent (
    std::string remote_host,
    int remote_port,
    std::string ping_response
) 

function deserialize

bool endstone::ServerListPingEvent::deserialize () 

function getEventName

inline virtual std::string endstone::ServerListPingEvent::getEventName () override const

Gets a user-friendly identifier for this event.

Returns:

name of this event

Implements endstone::Event::getEventName


function getGameMode

inline GameMode endstone::ServerListPingEvent::getGameMode () const

Get the current game mode.

Returns:

the game mode


function getLevelName

inline std::string endstone::ServerListPingEvent::getLevelName () const

Get the level name.

Returns:

the level name


function getLocalPort

inline int endstone::ServerListPingEvent::getLocalPort () const

Get the local port of the server.

Returns:

The local port


function getLocalPortV6

inline int endstone::ServerListPingEvent::getLocalPortV6 () const

Get the local port of the server for IPv6 support

Returns:

The local port for IPv6


function getMaxPlayers

inline int endstone::ServerListPingEvent::getMaxPlayers () const

Get the maximum number of players allowed.

Returns:

the maximum number of players


function getMinecraftVersionNetwork

inline std::string endstone::ServerListPingEvent::getMinecraftVersionNetwork () const

Get the network version of Minecraft that is supported by this server

Returns:

the network version of Minecraft


function getMotd

inline std::string endstone::ServerListPingEvent::getMotd () const

Get the message of the day message.

Returns:

the message of the day


function getNetworkProtocolVersion

inline int endstone::ServerListPingEvent::getNetworkProtocolVersion () const

Get the network protocol version of this server

Returns:

the network protocol version


function getNumPlayers

inline int endstone::ServerListPingEvent::getNumPlayers () const

Get the number of players online

Returns:

the number of players


function getRemoteHost

inline std::string endstone::ServerListPingEvent::getRemoteHost () const

Get the host the ping is coming from.

Returns:

The host


function getRemotePort

inline int endstone::ServerListPingEvent::getRemotePort () const

Get the port the ping is coming from.

Returns:

The port


function getServerGuid

inline std::string endstone::ServerListPingEvent::getServerGuid () const

Get the unique identifier of the server.

Returns:

The server guid


function isCancellable

inline virtual bool endstone::ServerListPingEvent::isCancellable () override const

Whether the event can be cancelled by a plugin or the server.

Returns:

true if this event can be cancelled

Implements endstone::Event::isCancellable


function serialize

std::string endstone::ServerListPingEvent::serialize () 

function setGameMode

inline void endstone::ServerListPingEvent::setGameMode (
    GameMode game_mode
) 

Set the current game mode.

Parameters:

  • game_mode the game mode

function setLevelName

inline void endstone::ServerListPingEvent::setLevelName (
    std::string level_name
) 

Set the level name.

Parameters:

  • level_name the level name

function setMaxPlayers

inline void endstone::ServerListPingEvent::setMaxPlayers (
    int max_players
) 

Set the maximum number of players allowed.

Parameters:

  • max_players the maximum number of players

function setMinecraftVersionNetwork

inline void endstone::ServerListPingEvent::setMinecraftVersionNetwork (
    std::string minecraft_version_network
) 

Set the network version of Minecraft that is supported by this server

Parameters:

  • minecraft_version_network the network version of Minecraft

function setMotd

inline void endstone::ServerListPingEvent::setMotd (
    std::string motd
) 

Change the message of the day message.

Parameters:

  • motd the message of the day

function setNumPlayers

inline void endstone::ServerListPingEvent::setNumPlayers (
    int num_players
) 

Set the number of players online.

Parameters:

  • num_players the number of players


The documentation for this class was generated from the following file include/endstone/event/server/server_list_ping_event.h