aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/updates/world/3.3.5/2019_07_13_01_world.sql6
-rw-r--r--src/server/scripts/Commands/cs_debug.cpp35
2 files changed, 41 insertions, 0 deletions
diff --git a/sql/updates/world/3.3.5/2019_07_13_01_world.sql b/sql/updates/world/3.3.5/2019_07_13_01_world.sql
new file mode 100644
index 00000000000..235fdd27d7a
--- /dev/null
+++ b/sql/updates/world/3.3.5/2019_07_13_01_world.sql
@@ -0,0 +1,6 @@
+--
+DELETE FROM `command` WHERE `name`='debug guidlimits';
+INSERT INTO `command` (`name`,`permission`,`help`) VALUES
+('debug guidlimits',300,'Syntax: .debug guidlimits <optional map id>
+Shows the current Creature and GameObject highest Guid for the specified map id or for all maps if none is specified
+');
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.");