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::Cancellable

Public Functions

Type Name
ENDSTONE_EVENT (ServerListPingEvent)
ServerListPingEvent (SocketAddress address, std::string motd, int network_protocol_version, std::string minecraft_version_network, int num_players, int max_players, std::string server_guid, std::string level_name, GameMode game_mode, int local_port, int local_port_v6)
SocketAddress getAddress () const
Get the address the ping is coming from.
GameMode getGameMode () const
Get the current game mode.
std::string getLevelName () const
Get the level name.
int getLocalPort () const
Get the local port of the server.
int getLocalPortV6 () const
Get the local port of the server for IPv6 support.
int getMaxPlayers () const
Get the maximum number of players allowed.
std::string getMinecraftVersionNetwork () const
Get the network version of Minecraft that is supported by this server.
std::string getMotd () const
Get the message of the day message.
int getNetworkProtocolVersion () const
Get the network protocol version of this server.
int getNumPlayers () const
Get the number of players online.
std::string getServerGuid () const
Get the unique identifier of the server.
void setGameMode (GameMode game_mode)
Set the current game mode.
void setLevelName (std::string level_name)
Set the level name.
void setLocalPort (int port)
Set the local port of the server.
void setLocalPortV6 (int port)
Set the local port of the server for IPv6 support.
void setMaxPlayers (int max_players)
Set the maximum number of players allowed.
void setMinecraftVersionNetwork (std::string minecraft_version_network)
Set the network version of Minecraft that is supported by this server.
void setMotd (std::string motd)
Change the message of the day message.
void setNumPlayers (int num_players)
Set the number of players online.
void setServerGuid (std::string guid)
Set the unique identifier of the server.

Public Functions inherited from endstone::Cancellable

See endstone::Cancellable

Type Name
virtual void cancel ()
Cancel this event. A cancelled event will not be executed in the server, but will still pass to other plugins.
virtual bool isCancelled () override const
Gets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins.
virtual void setCancelled (bool cancel) override
Sets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins.

Public Functions inherited from endstone::ICancellable

See endstone::ICancellable

Type Name
virtual void cancel () = 0
virtual bool isCancelled () const = 0
virtual void setCancelled (bool cancel) = 0
virtual ~ICancellable () = default

Public Functions Documentation

function ENDSTONE_EVENT

endstone::ServerListPingEvent::ENDSTONE_EVENT (
    ServerListPingEvent
) 

function ServerListPingEvent

inline endstone::ServerListPingEvent::ServerListPingEvent (
    SocketAddress address,
    std::string motd,
    int network_protocol_version,
    std::string minecraft_version_network,
    int num_players,
    int max_players,
    std::string server_guid,
    std::string level_name,
    GameMode game_mode,
    int local_port,
    int local_port_v6
) 

function getAddress

Get the address the ping is coming from.

inline SocketAddress endstone::ServerListPingEvent::getAddress () const

Returns:

the address


function getGameMode

Get the current game mode.

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

Returns:

the game mode


function getLevelName

Get the level name.

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

Returns:

the level name


function getLocalPort

Get the local port of the server.

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

Returns:

The local port


function getLocalPortV6

Get the local port of the server for IPv6 support.

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

Returns:

The local port for IPv6


function getMaxPlayers

Get the maximum number of players allowed.

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

Returns:

the maximum number of players


function getMinecraftVersionNetwork

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

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

Returns:

the network version of Minecraft


function getMotd

Get the message of the day message.

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

Returns:

the message of the day


function getNetworkProtocolVersion

Get the network protocol version of this server.

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

Returns:

the network protocol version


function getNumPlayers

Get the number of players online.

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

Returns:

the number of players


function getServerGuid

Get the unique identifier of the server.

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

Returns:

The server guid


function setGameMode

Set the current game mode.

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

Parameters:

  • game_mode the game mode

function setLevelName

Set the level name.

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

Parameters:

  • level_name the level name

function setLocalPort

Set the local port of the server.

inline void endstone::ServerListPingEvent::setLocalPort (
    int port
) 

Parameters:

  • port the local port

function setLocalPortV6

Set the local port of the server for IPv6 support.

inline void endstone::ServerListPingEvent::setLocalPortV6 (
    int port
) 

Parameters:

  • port the local port for IPv6

function setMaxPlayers

Set the maximum number of players allowed.

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

Parameters:

  • max_players the maximum number of players

function setMinecraftVersionNetwork

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

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

Parameters:

  • minecraft_version_network the network version of Minecraft

function setMotd

Change the message of the day message.

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

Parameters:

  • motd the message of the day

function setNumPlayers

Set the number of players online.

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

Parameters:

  • num_players the number of players

function setServerGuid

Set the unique identifier of the server.

inline void endstone::ServerListPingEvent::setServerGuid (
    std::string guid
) 

Parameters:

  • guid the server guid


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