Fix reload command security (#774)

This commit is contained in:
SaW 2024-12-14 17:55:06 +01:00 committed by GitHub
parent c436781d39
commit 453fa4b4f5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -958,10 +958,18 @@ std::vector<std::string> PlayerbotHolder::HandlePlayerbotCommand(char const* arg
if (!strcmp(cmd, "reload")) if (!strcmp(cmd, "reload"))
{ {
messages.push_back("Reloading config"); if (master->GetSession()->GetSecurity() >= SEC_GAMEMASTER)
{
sPlayerbotAIConfig->Initialize(); sPlayerbotAIConfig->Initialize();
messages.push_back("Config reloaded.");
return messages; return messages;
} }
else
{
messages.push_back("ERROR: Only GM can use this command.");
return messages;
}
}
if (!strcmp(cmd, "tweak")) if (!strcmp(cmd, "tweak"))
{ {