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¶
| 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¶
| 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¶
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.
Returns:
the address
function getGameMode¶
Get the current game mode.
Returns:
the game mode
function getLevelName¶
Get the level name.
Returns:
the level name
function getLocalPort¶
Get the local port of the server.
Returns:
The local port
function getLocalPortV6¶
Get the local port of the server for IPv6 support.
Returns:
The local port for IPv6
function getMaxPlayers¶
Get the maximum number of players allowed.
Returns:
the maximum number of players
function getMinecraftVersionNetwork¶
Get the network version of Minecraft that is supported by this server.
Returns:
the network version of Minecraft
function getMotd¶
Get the message of the day message.
Returns:
the message of the day
function getNetworkProtocolVersion¶
Get the network protocol version of this server.
Returns:
the network protocol version
function getNumPlayers¶
Get the number of players online.
Returns:
the number of players
function getServerGuid¶
Get the unique identifier of the server.
Returns:
The server guid
function setGameMode¶
Set the current game mode.
Parameters:
game_modethe game mode
function setLevelName¶
Set the level name.
Parameters:
level_namethe level name
function setLocalPort¶
Set the local port of the server.
Parameters:
portthe local port
function setLocalPortV6¶
Set the local port of the server for IPv6 support.
Parameters:
portthe local port for IPv6
function setMaxPlayers¶
Set the maximum number of players allowed.
Parameters:
max_playersthe 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_networkthe network version of Minecraft
function setMotd¶
Change the message of the day message.
Parameters:
motdthe message of the day
function setNumPlayers¶
Set the number of players online.
Parameters:
num_playersthe number of players
function setServerGuid¶
Set the unique identifier of the server.
Parameters:
guidthe server guid
The documentation for this class was generated from the following file include/endstone/event/server/server_list_ping_event.h