Skip to content

Commit

Permalink
Scripts: Make all scripts immediately reloadable and threadsafe and a…
Browse files Browse the repository at this point in the history
…dd several testing chat commands
  • Loading branch information
killerwife committed Feb 19, 2023
1 parent 3a9cdf2 commit 729a2bb
Show file tree
Hide file tree
Showing 39 changed files with 446 additions and 377 deletions.
4 changes: 4 additions & 0 deletions sql/base/mangos.sql
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,10 @@ INSERT INTO `command` VALUES
('debug arena',3,'Syntax: .debug arena\r\n\r\nToggle debug mode for arenas. In debug mode GM can start arena with single player.'),
('debug areatriggers', 1, 'Syntax: .debug areatriggers\n\nToggle debug mode for areatriggers. In debug mode GM will be notified if reaching an areatrigger.'),
('debug bg',3,'Syntax: .debug bg\r\n\r\nToggle debug mode for battlegrounds. In debug mode GM can start battleground with single player.'),
('debug dbscript',3,'.debug dbscript\r\n\r\nStarts dbscript type param0 id param1 from player(source) to selected(target)'),
('debug dbscripttargeted',3,'.debug dbscript\r\n\r\nStarts dbscript type param0 id param1 from selected(source) to param2 dbguid(target creature)'),
('debug dbscriptsourced',3,'.debug dbscript\r\n\r\nStarts dbscript type param0 id param1 from param2 dbguid(source creature) to selected(target)'),
('debug dbscriptguided',3,'.debug dbscript\r\n\r\nStarts dbscript type param0 id param1 from param2 dbguid(source creature) to param3 dbguid(target creature)'),
('debug getitemvalue',3,'Syntax: .debug getitemvalue #itemguid #field [int|hex|bit|float]\r\n\r\nGet the field #field of the item #itemguid in your inventroy.\r\n\r\nUse type arg for set output format: int (decimal number), hex (hex value), bit (bitstring), float. By default use integer output.'),
('debug getvaluebyindex', 3, 'Syntax: .debug getvaluebyindex #field [int|hex|bit|float]\r\n\r\nGet the field index #field (integer) of the selected target. If no target is selected, get the content of your field.\r\n\r\nUse type arg for set output format: int (decimal number), hex (hex value), bit (bitstring), float. By default use integer output.'),
('debug getvaluebyname', 3, 'Syntax: .debug getvaluebyname #field [int|hex|bit|float]\r\n\r\nGet the field name #field (string) of the selected target. If no target is selected, get the content of your field.\r\n\r\nUse type arg for set output format: int (decimal number), hex (hex value), bit (bitstring), float. By default use integer output.'),
Expand Down
2 changes: 1 addition & 1 deletion src/game/AI/BaseAI/UnitAI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1226,7 +1226,7 @@ void UnitAI::UpdateSpellLists()
success = true;
OnSpellCast(sSpellTemplate.LookupEntry<SpellEntry>(spellId), target);
if (scriptId)
m_unit->GetMap()->ScriptsStart(sRelayScripts, scriptId, m_unit, target);
m_unit->GetMap()->ScriptsStart(SCRIPT_TYPE_RELAY, scriptId, m_unit, target);
break;
}
itr = eligibleSpells.erase(itr);
Expand Down
4 changes: 2 additions & 2 deletions src/game/AI/EventAI/CreatureEventAI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1279,10 +1279,10 @@ bool CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
uint32 relayId = sScriptMgr.GetRandomRelayDbscriptFromTemplate(uint32(-action.relayScript.relayId));
if (relayId == 0)
break;
m_creature->GetMap()->ScriptsStart(sRelayScripts, relayId, target, m_creature);
m_creature->GetMap()->ScriptsStart(SCRIPT_TYPE_RELAY, relayId, target, m_creature);
}
else
m_creature->GetMap()->ScriptsStart(sRelayScripts, action.relayScript.relayId, target, m_creature);
m_creature->GetMap()->ScriptsStart(SCRIPT_TYPE_RELAY, action.relayScript.relayId, target, m_creature);
break;
}
case ACTION_T_TEXT_NEW:
Expand Down
3 changes: 2 additions & 1 deletion src/game/AI/EventAI/CreatureEventAIMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,8 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
case ACTION_T_START_RELAY_SCRIPT:
if (action.relayScript.relayId > 0)
{
if (sRelayScripts.second.find(action.relayScript.relayId) == sRelayScripts.second.end())
auto relayScripts = sScriptMgr.GetScriptMap(SCRIPT_TYPE_RELAY);
if (relayScripts->second.find(action.relayScript.relayId) == relayScripts->second.end())
{
sLog.outErrorEventAI("Event %u Action %u references invalid dbscript_on_relay id %u", eventId, j + 1, action.relayScript.relayId);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ struct npc_shattered_sun_fighterAI : public ScriptedAI
}
}
if (transformScriptId)
m_creature->GetMap()->ScriptsStart(sRelayScripts, transformScriptId, m_creature, m_creature);
m_creature->GetMap()->ScriptsStart(SCRIPT_TYPE_RELAY, transformScriptId, m_creature, m_creature);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ struct boss_scarlet_commander_mograineAI : public CombatAI
{
if (m_instance->GetData(TYPE_ASHBRINGER_EVENT) == IN_PROGRESS)
{
pWho->GetMap()->ScriptsStart(sRelayScripts, ASHBRINGER_RELAY_SCRIPT_ID, m_creature, pWho);
pWho->GetMap()->ScriptsStart(SCRIPT_TYPE_RELAY, ASHBRINGER_RELAY_SCRIPT_ID, m_creature, pWho);
m_instance->SetData(TYPE_ASHBRINGER_EVENT, DONE);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ struct npc_warlock_mount_ritualAI : public Scripted_NoMovementAI

void DoSummonPack(uint8 uiIndex)
{
m_creature->GetMap()->ScriptsStart(sRelayScripts, SUMMON_WAVES_RELAY_SCRIPT_START_ID + uiIndex, m_creature, m_creature);
m_creature->GetMap()->ScriptsStart(SCRIPT_TYPE_RELAY, SUMMON_WAVES_RELAY_SCRIPT_START_ID + uiIndex, m_creature, m_creature);
m_pInstance->DoRespawnGameObject(m_pInstance->GetRitualSymbolGuids().at(uiIndex - 1), 900);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1334,7 +1334,7 @@ bool QuestAccept_npc_major_mills(Player* player, Creature* creature, const Quest
{
if (npc_major_mills* ai = static_cast<npc_major_mills*>(creature->AI()))
ai->m_playerGuid = player->GetObjectGuid();
creature->GetMap()->ScriptsStart(sRelayScripts, DBSCRIPT_RELAY_TAKE_DOWN_TETHYR, creature, player);
creature->GetMap()->ScriptsStart(SCRIPT_TYPE_RELAY, DBSCRIPT_RELAY_TAKE_DOWN_TETHYR, creature, player);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2438,7 +2438,7 @@ bool QuestRewarded_into_the_soulgrinder(Player* player, Creature* pCreature, Que
{
DoScriptText(SAY_MOGDORG_1, pCreature, player);
player->CastSpell(player, SPELL_OGRE_FORCE_REACTION, TRIGGERED_OLD_TRIGGERED);
player->GetMap()->ScriptsStart(sRelayScripts, DBSCRIPT_SPAWN_OGRES, player, pCreature);
player->GetMap()->ScriptsStart(SCRIPT_TYPE_RELAY, DBSCRIPT_SPAWN_OGRES, player, pCreature);
}

return true;
Expand Down Expand Up @@ -2965,7 +2965,7 @@ struct npc_evergrove_druidAI : public ScriptedAI
m_creature->SetLevitate(true);
m_creature->SetHover(false);
m_creature->SetCanFly(false);
m_creature->GetMap()->ScriptsStart(sRelayScripts, DBSCRIPT_LANDING_SCRIPT, m_creature, who);
m_creature->GetMap()->ScriptsStart(SCRIPT_TYPE_RELAY, DBSCRIPT_LANDING_SCRIPT, m_creature, who);
}
}

Expand All @@ -2980,7 +2980,7 @@ struct npc_evergrove_druidAI : public ScriptedAI

returnTimer = 0;
Unit* summoned = m_creature->GetMap()->GetUnit(m_summonerGuid);
m_creature->GetMap()->ScriptsStart(sRelayScripts, DBSCRIPT_FLY_OFF_SCRIPT, m_creature, summoned);
m_creature->GetMap()->ScriptsStart(SCRIPT_TYPE_RELAY, DBSCRIPT_FLY_OFF_SCRIPT, m_creature, summoned);
}

void ReceiveAIEvent(AIEventType eventType, Unit* sender, Unit* /*invoker*/, uint32 /*miscValue*/) override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ struct npc_wounded_blood_elfAI : public npc_escortAI
break;
case 41:
pPlayer->RewardPlayerAndGroupAtEventExplored(QUEST_ROAD_TO_FALCON_WATCH, m_creature);
pPlayer->GetMap()->ScriptsStart(sRelayScripts, DBSCRIPT_END_TALERIS_INT, m_creature, m_creature);
pPlayer->GetMap()->ScriptsStart(SCRIPT_TYPE_RELAY, DBSCRIPT_END_TALERIS_INT, m_creature, m_creature);
break;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/game/AI/ScriptDevAI/scripts/outland/shattrath_city.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,7 @@ bool QuestRewarded_npc_adal(Player* player, Creature* creature, Quest const* que
break;
case QUEST_KAELTHAS_AND_THE_VERDANT_SPHERE:
sWorldState.HandleExternalEvent(CUSTOM_EVENT_ADALS_SONG_OF_BATTLE, 0);
player->GetMap()->ScriptsStart(sRelayScripts, SCRIPT_RELAY_ID, creature, player, Map::SCRIPT_EXEC_PARAM_UNIQUE_BY_SOURCE); // only once active per adal
player->GetMap()->ScriptsStart(SCRIPT_TYPE_RELAY, SCRIPT_RELAY_ID, creature, player, Map::SCRIPT_EXEC_PARAM_UNIQUE_BY_SOURCE); // only once active per adal
return true; // handled
}

Expand Down
6 changes: 3 additions & 3 deletions src/game/AI/ScriptDevAI/scripts/outland/terokkar_forest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1310,7 +1310,7 @@ struct npc_draenei_tomb_guardian : public ScriptedAI
//m_creature->RemoveGuardians();

// Despawn Bone Wastes - Orb Waypoint 01, Bone Wastes - Event Trigger B, Nether Cloud
m_creature->GetMap()->ScriptsStart(sRelayScripts, DBSCRIPT_EVENT_RESET, m_creature, m_creature);
m_creature->GetMap()->ScriptsStart(SCRIPT_TYPE_RELAY, DBSCRIPT_EVENT_RESET, m_creature, m_creature);

// Despawn Vengeful Harbinger and Vengeful Draenei
for (ObjectGuid &guid : summons)
Expand Down Expand Up @@ -1351,7 +1351,7 @@ struct npc_draenei_tomb_guardian : public ScriptedAI
if (uiMovementType == POINT_MOTION_TYPE && uiData == POINT_HARBINGER_POSITION && harbinger)
{
m_creature->CastSpell(harbinger, SPELL_COSMETIC_CHAIN_LIGHTNING, TRIGGERED_OLD_TRIGGERED);
m_creature->GetMap()->ScriptsStart(sRelayScripts, DBSCRIPT_TOMB_GUARDIAN, m_creature, m_creature);
m_creature->GetMap()->ScriptsStart(SCRIPT_TYPE_RELAY, DBSCRIPT_TOMB_GUARDIAN, m_creature, m_creature);
}
}
};
Expand Down Expand Up @@ -1491,7 +1491,7 @@ struct npc_vengeful_harbinger : public ScriptedAI
m_creature->ClearAllReactives();
m_creature->GetMotionMaster()->Clear(false, true);
m_creature->GetMotionMaster()->MoveIdle();
m_creature->GetMap()->ScriptsStart(sRelayScripts, DBSCRIPT_VENGEFUL_HARBINGER_FAKE_DEATH, m_creature, m_creature);
m_creature->GetMap()->ScriptsStart(SCRIPT_TYPE_RELAY, DBSCRIPT_VENGEFUL_HARBINGER_FAKE_DEATH, m_creature, m_creature);
}
};

Expand Down
2 changes: 1 addition & 1 deletion src/game/AI/ScriptDevAI/scripts/outland/world_outland.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,7 @@ struct world_map_outland : public ScriptedMap, public TimerManager
{
if (GameObject* go = GetSingleGameObjectFromStorage(GO_BASHIR_CRYSTALFORGE, true))
if (Creature* controller = GetClosestCreatureWithEntry(go, CRYSTALFORGE_SLAVE_EVENT_CONTROLLER_ENTRY, 10.f))
instance->ScriptsStart(sRelayScripts, CRYSTALFORGE_SLAVE_EVENT_RELAY_ID, controller, controller);
instance->ScriptsStart(SCRIPT_TYPE_RELAY, CRYSTALFORGE_SLAVE_EVENT_RELAY_ID, controller, controller);
}

void HandleBashirSpawnEnemy()
Expand Down
2 changes: 1 addition & 1 deletion src/game/AI/ScriptDevAI/scripts/outland/zangarmarsh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ struct StormcrowAmulet : public AuraScript
{
if (Creature* ysiel = scriptedMap->GetSingleCreatureFromStorage(NPC_YSIEL_WINDSINGER))
{
caster->GetMap()->ScriptsStart(sRelayScripts, RELAY_SCRIPT_CROW_FLIES, ysiel, caster);
caster->GetMap()->ScriptsStart(SCRIPT_TYPE_RELAY, RELAY_SCRIPT_CROW_FLIES, ysiel, caster);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/game/AI/ScriptDevAI/scripts/world/midsummer_festival.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ struct RevelerApplauseCheer : public SpellScript
{
caster->SetFacingToObject(spell->GetUnitTarget());
target->SetFacingToObject(caster);
caster->GetMap()->ScriptsStart(sRelayScripts, RELAY_SCRIPT_ID_DELAY_RESET_ORIENTATION, caster, caster);
target->GetMap()->ScriptsStart(sRelayScripts, RELAY_SCRIPT_ID_DELAY_RESET_ORIENTATION, target, target);
caster->GetMap()->ScriptsStart(SCRIPT_TYPE_RELAY, RELAY_SCRIPT_ID_DELAY_RESET_ORIENTATION, caster, caster);
target->GetMap()->ScriptsStart(SCRIPT_TYPE_RELAY, RELAY_SCRIPT_ID_DELAY_RESET_ORIENTATION, target, target);
caster->HandleEmote(EMOTE_ONESHOT_BOW);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/game/AI/ScriptDevAI/scripts/world/quest_scripts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ struct npc_xiri : public ScriptedAI

void RunAkamaRPEvent()
{
m_creature->GetMap()->ScriptsStart(sRelayScripts, RELAY_SCRIPT_AKAMA, m_creature, m_creature);
m_creature->GetMap()->ScriptsStart(SCRIPT_TYPE_RELAY, RELAY_SCRIPT_AKAMA, m_creature, m_creature);

m_bAkamaInteractionPerformed = true;
}
Expand Down
3 changes: 3 additions & 0 deletions src/game/Chat/Chat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,9 @@ ChatCommand* ChatHandler::getCommandTable()
{ "debugflags", SEC_ADMINISTRATOR, true, &ChatHandler::HandleDebugObjectFlags, "", nullptr },
{ "packetlog", SEC_ADMINISTRATOR, true, &ChatHandler::HandleDebugPacketLog, "", nullptr },
{ "dbscript", SEC_ADMINISTRATOR, true, &ChatHandler::HandleDebugDbscript, "", nullptr },
{ "dbscripttargeted", SEC_ADMINISTRATOR, true, &ChatHandler::HandleDebugDbscriptTargeted, "", nullptr },
{ "dbscriptsourced", SEC_ADMINISTRATOR, true, &ChatHandler::HandleDebugDbscriptSourced, "", nullptr },
{ "dbscriptguided", SEC_ADMINISTRATOR, true, &ChatHandler::HandleDebugDbscriptGuided, "", nullptr },
{ nullptr, 0, false, nullptr, "", nullptr }
};

Expand Down
3 changes: 3 additions & 0 deletions src/game/Chat/Chat.h
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,9 @@ class ChatHandler

bool HandleDebugPacketLog(char* args);
bool HandleDebugDbscript(char* args);
bool HandleDebugDbscriptTargeted(char* args);
bool HandleDebugDbscriptSourced(char* args);
bool HandleDebugDbscriptGuided(char* args);

bool HandleSD2HelpCommand(char* args);
bool HandleSD2ScriptCommand(char* args);
Expand Down
81 changes: 9 additions & 72 deletions src/game/Chat/Level3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,13 +243,6 @@ bool ChatHandler::HandleReloadAllQuestCommand(char* /*args*/)

bool ChatHandler::HandleReloadAllScriptsCommand(char* /*args*/)
{
if (sScriptMgr.IsScriptScheduled())
{
PSendSysMessage("DB scripts used currently, please attempt reload later.");
SetSentErrorMessage(true);
return false;
}

sLog.outString("Re-Loading Scripts...");
HandleReloadDBScriptsOnCreatureDeathCommand((char*)"a");
HandleReloadDBScriptsOnGoUseCommand((char*)"a");
Expand Down Expand Up @@ -830,17 +823,10 @@ bool ChatHandler::HandleReloadEventAIScriptsCommand(char* /*args*/)

bool ChatHandler::HandleReloadDBScriptsOnGossipCommand(char* args)
{
if (sScriptMgr.IsScriptScheduled())
{
SendSysMessage("DB scripts used currently, please attempt reload later.");
SetSentErrorMessage(true);
return false;
}

if (*args != 'a')
sLog.outString("Re-Loading Scripts from `dbscripts_on_gossip`...");

sScriptMgr.LoadGossipScripts();
sScriptMgr.LoadScriptMap(SCRIPT_TYPE_GOSSIP, true);

if (*args != 'a')
SendGlobalSysMessage("DB table `dbscripts_on_gossip` reloaded.");
Expand All @@ -850,17 +836,10 @@ bool ChatHandler::HandleReloadDBScriptsOnGossipCommand(char* args)

bool ChatHandler::HandleReloadDBScriptsOnSpellCommand(char* args)
{
if (sScriptMgr.IsScriptScheduled())
{
SendSysMessage("DB scripts used currently, please attempt reload later.");
SetSentErrorMessage(true);
return false;
}

if (*args != 'a')
sLog.outString("Re-Loading Scripts from `dbscripts_on_spell`...");

sScriptMgr.LoadSpellScripts();
sScriptMgr.LoadScriptMap(SCRIPT_TYPE_SPELL, true);

if (*args != 'a')
SendGlobalSysMessage("DB table `dbscripts_on_spell` reloaded.");
Expand All @@ -870,17 +849,10 @@ bool ChatHandler::HandleReloadDBScriptsOnSpellCommand(char* args)

bool ChatHandler::HandleReloadDBScriptsOnQuestStartCommand(char* args)
{
if (sScriptMgr.IsScriptScheduled())
{
SendSysMessage("DB scripts used currently, please attempt reload later.");
SetSentErrorMessage(true);
return false;
}

if (*args != 'a')
sLog.outString("Re-Loading Scripts from `dbscripts_on_quest_start`...");

sScriptMgr.LoadQuestStartScripts();
sScriptMgr.LoadScriptMap(SCRIPT_TYPE_QUEST_START, true);

if (*args != 'a')
SendGlobalSysMessage("DB table `dbscripts_on_quest_start` reloaded.");
Expand All @@ -890,17 +862,10 @@ bool ChatHandler::HandleReloadDBScriptsOnQuestStartCommand(char* args)

bool ChatHandler::HandleReloadDBScriptsOnQuestEndCommand(char* args)
{
if (sScriptMgr.IsScriptScheduled())
{
SendSysMessage("DB scripts used currently, please attempt reload later.");
SetSentErrorMessage(true);
return false;
}

if (*args != 'a')
sLog.outString("Re-Loading Scripts from `dbscripts_on_quest_end`...");

sScriptMgr.LoadQuestEndScripts();
sScriptMgr.LoadScriptMap(SCRIPT_TYPE_QUEST_END, true);

if (*args != 'a')
SendGlobalSysMessage("DB table `dbscripts_on_quest_end` reloaded.");
Expand All @@ -910,17 +875,10 @@ bool ChatHandler::HandleReloadDBScriptsOnQuestEndCommand(char* args)

bool ChatHandler::HandleReloadDBScriptsOnEventCommand(char* args)
{
if (sScriptMgr.IsScriptScheduled())
{
SendSysMessage("DB scripts used currently, please attempt reload later.");
SetSentErrorMessage(true);
return false;
}

if (*args != 'a')
sLog.outString("Re-Loading Scripts from `dbscripts_on_event`...");

sScriptMgr.LoadEventScripts();
sScriptMgr.LoadScriptMap(SCRIPT_TYPE_EVENT, true);

if (*args != 'a')
SendGlobalSysMessage("DB table `dbscripts_on_event` reloaded.");
Expand All @@ -930,18 +888,11 @@ bool ChatHandler::HandleReloadDBScriptsOnEventCommand(char* args)

bool ChatHandler::HandleReloadDBScriptsOnGoUseCommand(char* args)
{
if (sScriptMgr.IsScriptScheduled())
{
SendSysMessage("DB scripts used currently, please attempt reload later.");
SetSentErrorMessage(true);
return false;
}

if (*args != 'a')
sLog.outString("Re-Loading Scripts from `dbscripts_on_go[_template]_use`...");

sScriptMgr.LoadGameObjectScripts();
sScriptMgr.LoadGameObjectTemplateScripts();
sScriptMgr.LoadScriptMap(SCRIPT_TYPE_GAMEOBJECT, true);
sScriptMgr.LoadScriptMap(SCRIPT_TYPE_GAMEOBJECT_TEMPLATE, true);

if (*args != 'a')
SendGlobalSysMessage("DB table `dbscripts_on_go[_template]_use` reloaded.");
Expand All @@ -951,17 +902,10 @@ bool ChatHandler::HandleReloadDBScriptsOnGoUseCommand(char* args)

bool ChatHandler::HandleReloadDBScriptsOnCreatureDeathCommand(char* args)
{
if (sScriptMgr.IsScriptScheduled())
{
SendSysMessage("DB scripts used currently, please attempt reload later.");
SetSentErrorMessage(true);
return false;
}

if (*args != 'a')
sLog.outString("Re-Loading Scripts from `dbscripts_on_creature_death`...");

sScriptMgr.LoadCreatureDeathScripts();
sScriptMgr.LoadScriptMap(SCRIPT_TYPE_CREATURE_DEATH, true);

if (*args != 'a')
SendGlobalSysMessage("DB table `dbscripts_on_creature_death` reloaded.");
Expand All @@ -971,17 +915,10 @@ bool ChatHandler::HandleReloadDBScriptsOnCreatureDeathCommand(char* args)

bool ChatHandler::HandleReloadDBScriptsOnRelayCommand(char* args)
{
if (sScriptMgr.IsScriptScheduled())
{
SendSysMessage("DB scripts used currently, please attempt reload later.");
SetSentErrorMessage(true);
return false;
}

if (*args != 'a')
sLog.outString("Re-Loading Scripts from `dbscripts_on_relay`...");

sScriptMgr.LoadRelayScripts();
sScriptMgr.LoadScriptMap(SCRIPT_TYPE_RELAY, true);

if (*args != 'a')
SendGlobalSysMessage("DB table `dbscripts_on_relay` reloaded.");
Expand Down
Loading

0 comments on commit 729a2bb

Please sign in to comment.