mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-02-04 08:07:09 +01:00
Core/Commands: Add .debug guidlimits <optional map id> chat command
Add .debug guidlimits <optional map id> chat command to show the highest low guid counter for Creature and GameObject, useful when reaching Respawn.GuidWarnLevel
(cherry picked from commit 7421ccaf7e)
This commit is contained in:
@@ -122,6 +122,7 @@ public:
|
||||
{ "wsexpression" , rbac::RBAC_PERM_COMMAND_DEBUG, false, &HandleDebugWSExpressionCommand, "" },
|
||||
{ "dummy", rbac::RBAC_PERM_COMMAND_DEBUG_DUMMY, false, &HandleDebugDummyCommand, "" },
|
||||
{ "asan", rbac::RBAC_PERM_COMMAND_DEBUG_ASAN, true, nullptr, "", debugAsanCommandTable },
|
||||
{ "guidlimits", rbac::RBAC_PERM_COMMAND_DEBUG, true, &HandleDebugGuidLimitsCommand, "" },
|
||||
};
|
||||
static std::vector<ChatCommand> commandTable =
|
||||
{
|
||||
@@ -1723,6 +1724,39 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleDebugGuidLimitsCommand(ChatHandler* handler, CommandArgs* args)
|
||||
{
|
||||
auto mapId = args->TryConsume<uint32>();
|
||||
if (mapId)
|
||||
{
|
||||
sMapMgr->DoForAllMapsWithMapId(mapId.get(),
|
||||
[handler](Map* map) -> void
|
||||
{
|
||||
HandleDebugGuidLimitsMap(handler, map);
|
||||
}
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
sMapMgr->DoForAllMaps(
|
||||
[handler](Map* map) -> void
|
||||
{
|
||||
HandleDebugGuidLimitsMap(handler, map);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
handler->PSendSysMessage("Guid Warn Level: %u", sWorld->getIntConfig(CONFIG_RESPAWN_GUIDWARNLEVEL));
|
||||
handler->PSendSysMessage("Guid Alert Level: %u", sWorld->getIntConfig(CONFIG_RESPAWN_GUIDALERTLEVEL));
|
||||
return true;
|
||||
}
|
||||
|
||||
static void HandleDebugGuidLimitsMap(ChatHandler* handler, Map* map)
|
||||
{
|
||||
handler->PSendSysMessage("Map Id: %u Name: '%s' Instance Id: %u Highest Guid Creature: " UI64FMTD " GameObject: " UI64FMTD,
|
||||
map->GetId(), map->GetMapName(), map->GetInstanceId(), uint64(map->GenerateLowGuid<HighGuid::Creature>()), uint64(map->GetMaxLowGuid<HighGuid::GameObject>()));
|
||||
}
|
||||
|
||||
static bool HandleDebugDummyCommand(ChatHandler* handler, CommandArgs* /*args*/)
|
||||
{
|
||||
handler->SendSysMessage("This command does nothing right now. Edit your local core (cs_debug.cpp) to make it do whatever you need for testing.");
|
||||
|
||||
Reference in New Issue
Block a user