mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2025-07-03 08:15:35 +00:00
start building the clear
command
This commit is contained in:
parent
817bd4b588
commit
6e46d5aca9
@ -35,6 +35,7 @@ private:
|
||||
void Command_List(const std::string& cmd, const std::vector<std::string>& args);
|
||||
void Command_Status(const std::string& cmd, const std::vector<std::string>& args);
|
||||
void Command_Settings(const std::string& cmd, const std::vector<std::string>& args);
|
||||
void Command_Clear(const std::string&, const std::vector<std::string>& args);
|
||||
|
||||
void Command_Say(const std::string& FullCommand);
|
||||
bool EnsureArgsCount(const std::vector<std::string>& args, size_t n);
|
||||
@ -50,6 +51,7 @@ private:
|
||||
{ "list", [this](const auto& a, const auto& b) { Command_List(a, b); } },
|
||||
{ "status", [this](const auto& a, const auto& b) { Command_Status(a, b); } },
|
||||
{ "settings", [this](const auto& a, const auto& b) { Command_Settings(a, b); } },
|
||||
{ "clear", [this](const auto& a, const auto& b) { Command_Clear(a, b); } },
|
||||
{ "say", [this](const auto&, const auto&) { Command_Say(""); } }, // shouldn't actually be called
|
||||
};
|
||||
|
||||
|
@ -227,7 +227,8 @@ void TConsole::Command_Help(const std::string&, const std::vector<std::string>&
|
||||
say <message> sends the message to all players in chat
|
||||
lua [state id] switches to lua, optionally into a specific state id's lua
|
||||
settings [command] sets or gets settings for the server, run `settings help` for more info
|
||||
status how the server is doing and what it's up to)";
|
||||
status how the server is doing and what it's up to
|
||||
clear clears the console window)";
|
||||
Application::Console().WriteRaw("BeamMP-Server Console: " + std::string(sHelpString));
|
||||
}
|
||||
|
||||
@ -240,6 +241,13 @@ std::string TConsole::ConcatArgs(const std::vector<std::string>& args, char spac
|
||||
return Result;
|
||||
}
|
||||
|
||||
void TConsole::Command_Clear(const std::string&, const std::vector<std::string>& args) {
|
||||
if (!EnsureArgsCount(args, 0, size_t(-1))) {
|
||||
return;
|
||||
}
|
||||
mCommandline.write("\x1b[;H\x1b[2J");
|
||||
}
|
||||
|
||||
void TConsole::Command_Kick(const std::string&, const std::vector<std::string>& args) {
|
||||
if (!EnsureArgsCount(args, 1, size_t(-1))) {
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user