diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/scripts/Commands/cs_debug.cpp | 35 | 
1 files changed, 35 insertions, 0 deletions
| diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index d5e9a003d25..65971bc1200 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -40,6 +40,7 @@ EndScriptData */  #include "RBAC.h"  #include "SpellMgr.h"  #include "Transport.h" +#include "World.h"  #include <fstream>  #include <limits>  #include <map> @@ -114,6 +115,7 @@ public:              { "instancespawn", rbac::RBAC_PERM_COMMAND_DEBUG_INSTANCESPAWN, false, &HandleDebugInstanceSpawns,          "" },              { "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 =          { @@ -1868,6 +1870,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->GetMaxLowGuid<HighGuid::Unit>()), 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."); | 
