mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-12-23 05:53:34 +00:00
Check user input for the "/runmacro" command
Presents users from specifying a file path, and looking up macros in the expected folder.
This commit is contained in:
parent
73718fe9af
commit
f2b3b0bf66
@ -611,6 +611,10 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
if (chatCommand == "runmacro" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER) {
|
||||
if (args.size() != 1) return;
|
||||
|
||||
// Only process if input does not contain separator charaters
|
||||
if (args[0].find("/") != std::string::npos) return;
|
||||
if (args[0].find("\\") != std::string::npos) return;
|
||||
|
||||
std::ifstream infile("./res/macros/" + args[0] + ".scm");
|
||||
|
||||
if (infile.good()) {
|
||||
|
Loading…
Reference in New Issue
Block a user