From 453fa4b4f59b21c682c56ee7316221ff9c842c0f Mon Sep 17 00:00:00 2001 From: SaW Date: Sat, 14 Dec 2024 17:55:06 +0100 Subject: [PATCH] Fix reload command security (#774) --- src/PlayerbotMgr.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/PlayerbotMgr.cpp b/src/PlayerbotMgr.cpp index 444401a1..fc7cead7 100644 --- a/src/PlayerbotMgr.cpp +++ b/src/PlayerbotMgr.cpp @@ -958,9 +958,17 @@ std::vector PlayerbotHolder::HandlePlayerbotCommand(char const* arg if (!strcmp(cmd, "reload")) { - messages.push_back("Reloading config"); - sPlayerbotAIConfig->Initialize(); - return messages; + if (master->GetSession()->GetSecurity() >= SEC_GAMEMASTER) + { + sPlayerbotAIConfig->Initialize(); + messages.push_back("Config reloaded."); + return messages; + } + else + { + messages.push_back("ERROR: Only GM can use this command."); + return messages; + } } if (!strcmp(cmd, "tweak"))