12#ifndef MINESERVER_COMMANDSREG_H
13#define MINESERVER_COMMANDSREG_H
36 std::string finalString;
38 for (
auto &kv : mapCommands)
41 finalString +=
"/" + command.
name +
" " + command.
usage +
"\n";
71 std::string finalString;
73 for (
const auto& plugin : plugins)
75 finalString += plugin->name +
" (v" + plugin->version +
"), ";
78 finalString.pop_back();
79 finalString.pop_back();
81 finalString +=
" [" + std::to_string(plugins.size()) +
"]";
94 "",
"Returns help message");
99 "",
"Stops the server");
103 "",
"Shows a list of installed plugins");
Minecraft Chat Message implementation.
Definition chatmessage.h:28
void addCommand(const std::string &name, Command::HandlerType handler, const std::string &usage="", const std::string &description="")
Adds a command.
Definition commands.cpp:25
static CommandsManager & inst()
Gets Commands Manager instance.
Definition commands.h:230
const std::unordered_map< std::string, Command > & getCommands() const
Get all registered commands.
Definition commands.h:175
static void registerCommands()
Register config commands.
Definition config.cpp:383
static Config * inst()
Fetch the instance of the config.
Definition config.h:275
Sender Interface.
Definition commands.h:29
virtual void sendMessage(const ChatMessage &message)=0
Sends a message to the sender.
SenderType
Sender type.
Definition commands.h:38
static PluginsManager & inst()
Gets the instance of the plugin manager.
Definition plugins.h:112
const std::vector< std::shared_ptr< Plugin > > & getPlugins() const
Get the registered plugins.
Definition plugins.h:102
void stop()
Stops the server.
Definition server.cpp:109
static Server * inst()
Get the instance of the server.
Definition server.h:90
The file handling commands logic.
void pluginsMessage(const ISender::SenderType senderType, ISender &sender, const std::vector< std::string > &args)
Handler for plugins message.
Definition commandsreg.hpp:55
void registerCommands()
Register commands for the console and general usage.
Definition commandsreg.hpp:90
void helpMessage(const ISender::SenderType senderType, ISender &sender, const std::vector< std::string > &args)
Handler for help message.
Definition commandsreg.hpp:27
The main file for the config io.
The file handling plugin system.
The file containing most of the server logic.
Command struct.
Definition commands.h:76
std::string usage
The usage of the command.
Definition commands.h:106
std::string description
The description of the command.
Definition commands.h:113
std::string name
The name of the command.
Definition commands.h:88