mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-24 19:06:49 +01:00
Core/RBAC: Add .reload rbac command and prevent possible crash if rbac_permissions has wrong data
This commit is contained in:
@@ -22,6 +22,7 @@ Comment: All reload related commands
|
||||
Category: commandscripts
|
||||
EndScriptData */
|
||||
|
||||
#include "AccountMgr.h"
|
||||
#include "AchievementMgr.h"
|
||||
#include "AuctionHouseMgr.h"
|
||||
#include "Chat.h"
|
||||
@@ -128,6 +129,7 @@ public:
|
||||
{ "prospecting_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesProspectingCommand, "", NULL },
|
||||
{ "quest_poi", SEC_ADMINISTRATOR, true, &HandleReloadQuestPOICommand, "", NULL },
|
||||
{ "quest_template", SEC_ADMINISTRATOR, true, &HandleReloadQuestTemplateCommand, "", NULL },
|
||||
{ "rbac", SEC_ADMINISTRATOR, true, &HandleReloadRBACCommand, "", NULL },
|
||||
{ "reference_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesReferenceCommand, "", NULL },
|
||||
{ "reserved_name", SEC_ADMINISTRATOR, true, &HandleReloadReservedNameCommand, "", NULL },
|
||||
{ "reputation_reward_rate", SEC_ADMINISTRATOR, true, &HandleReloadReputationRewardRateCommand, "", NULL },
|
||||
@@ -1242,6 +1244,15 @@ public:
|
||||
handler->SendGlobalGMSysMessage("Vehicle template accessories reloaded.");
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadRBACCommand(ChatHandler* handler, const char* /*args*/)
|
||||
{
|
||||
sLog->outInfo(LOG_FILTER_GENERAL, "Reloading RBAC tables...");
|
||||
sAccountMgr->LoadRBAC();
|
||||
sWorld->ReloadRBAC();
|
||||
handler->SendGlobalGMSysMessage("RBAC data reloaded.");
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_reload_commandscript()
|
||||
|
||||
Reference in New Issue
Block a user