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,9 +958,17 @@ std::vector<std::string> 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"))