Class endstone::Server¶
Represents a server implementation.
#include <endstone/server.h>
Public Static Attributes¶
| Type | Name |
|---|---|
| const std::string | BroadcastChannelAdmin = = "endstone.broadcast.admin" Used for all administrative messages, such as an operator using a command. |
| const std::string | BroadcastChannelUser = = "endstone.broadcast.user" Used for all announcement messages, such as informing users that a player has joined. |
Public Functions¶
| Type | Name |
|---|---|
| Server () = default |
|
| Server (const Server &) = delete |
|
| virtual void | broadcast (const std::string & message, const std::string & permission) const = 0 Broadcasts the specified message to every user with the given permission name. |
| virtual void | broadcastMessage (const std::string & message) const = 0 Broadcasts the specified message to every user with permission endstone.broadcast.user. |
| void | broadcastMessage (const fmt::format_string< Args... > format, Args &&... args) const |
| virtual bool | dispatchCommand (CommandSender & sender, std::string command) const = 0 Dispatches a command on this server, and executes it if found. |
| virtual CommandSender & | getCommandSender () const = 0 Gets a CommandSender for this server. |
| virtual Level * | getLevel (std::string name) const = 0 Gets the level with the given name. |
| virtual std::vector< Level * > | getLevels () const = 0 Gets a list of all levels on this server. |
| virtual Logger & | getLogger () const = 0 Returns the primary logger associated with this server instance. |
| virtual int | getMaxPlayers () const = 0 Get the maximum amount of players which can login to this server. |
| virtual std::string | getMinecraftVersion () const = 0 Gets the Minecraft version that this server is running. |
| virtual std::string | getName () const = 0 Gets the name of this server implementation. |
| virtual std::vector< Player * > | getOnlinePlayers () const = 0 Gets a list of all currently online players. |
| virtual Player * | getPlayer (endstone::UUID id) const = 0 Gets the player with the given UUID . |
| virtual Player * | getPlayer (std::string name) const = 0 Gets the player with the exact given name, case insensitive. |
| virtual PluginCommand * | getPluginCommand (std::string name) const = 0 Gets a PluginCommand with the given name or alias. |
| virtual PluginManager & | getPluginManager () const = 0 Gets the plugin manager for interfacing with plugins. |
| virtual Scheduler & | getScheduler () const = 0 Gets the scheduler for managing scheduled events. |
| virtual std::string | getVersion () const = 0 Gets the version string of this server implementation. |
| virtual bool | isPrimaryThread () const = 0 Checks the current thread against the expected primary server thread. |
| Server & | operator= (const Server &) = delete |
| virtual void | setMaxPlayers (int max_players) = 0 Set the maximum amount of players allowed to be logged in at once. |
| virtual | ~Server () = default |
Public Static Attributes Documentation¶
variable BroadcastChannelAdmin¶
variable BroadcastChannelUser¶
Public Functions Documentation¶
function Server [½]¶
function Server [2/2]¶
function broadcast¶
Broadcasts the specified message to every user with the given permission name.
virtual void endstone::Server::broadcast (
const std::string & message,
const std::string & permission
) const = 0
Parameters:
messagemessage to broadcastpermissionthe required permission Permissibles must have to receive the broadcast
function broadcastMessage [½]¶
Broadcasts the specified message to every user with permission endstone.broadcast.user.
Parameters:
messagethe message
function broadcastMessage [2/2]¶
template<typename... Args>
inline void endstone::Server::broadcastMessage (
const fmt::format_string< Args... > format,
Args &&... args
) const
function dispatchCommand¶
Dispatches a command on this server, and executes it if found.
virtual bool endstone::Server::dispatchCommand (
CommandSender & sender,
std::string command
) const = 0
Parameters:
senderthe apparent sender of the commandcommandthe command + arguments.
Returns:
true if execution is successful, false otherwise
function getCommandSender¶
Gets a CommandSender for this server.
Returns:
a console command sender
function getLevel¶
Gets the level with the given name.
Parameters:
namethe name of the level to retrieve
Returns:
a level with the given name, or nullptr if none exists
function getLevels¶
Gets a list of all levels on this server.
Returns:
a list of levels
function getLogger¶
Returns the primary logger associated with this server instance.
Returns:
Logger associated with this server
function getMaxPlayers¶
Get the maximum amount of players which can login to this server.
Returns:
the amount of players this server allows
function getMinecraftVersion¶
Gets the Minecraft version that this server is running.
Returns:
version of Minecraft
function getName¶
Gets the name of this server implementation.
Returns:
name of this server implementation
function getOnlinePlayers¶
Gets a list of all currently online players.
Returns:
a list of currently online players.
function getPlayer [½]¶
Gets the player with the given UUID .
Parameters:
idUUID of the player to retrieve
Returns:
a player object if one was found, null otherwise
function getPlayer [2/2]¶
Gets the player with the exact given name, case insensitive.
Parameters:
nameExact name of the player to retrieve
Returns:
a player object if one was found, null otherwise
function getPluginCommand¶
Gets a PluginCommand with the given name or alias.
Parameters:
namethe name of the command to retrieve
Returns:
a plugin command if found, null otherwise
function getPluginManager¶
Gets the plugin manager for interfacing with plugins.
Returns:
a plugin manager for this Server instance
function getScheduler¶
Gets the scheduler for managing scheduled events.
Returns:
a scheduling service for this server
function getVersion¶
Gets the version string of this server implementation.
Returns:
version of this server implementation
function isPrimaryThread¶
Checks the current thread against the expected primary server thread.
Returns:
true if the current thread matches the expected primary thread, false otherwise
function operator=¶
function setMaxPlayers¶
Set the maximum amount of players allowed to be logged in at once.
Parameters:
maxPlayersThe maximum amount of concurrent players
function ~Server¶
The documentation for this class was generated from the following file include/endstone/server.h