From eaa3c7e5a07802916ab00dd74aac6e0eb9cde957 Mon Sep 17 00:00:00 2001 From: Treeston Date: Wed, 19 Aug 2020 00:25:44 +0200 Subject: Core/Warden: Add .debug warden force, allowing you to force specific warden checks to be sent (cherry picked from commit f04f4e91ff3afbf89f30659b85e8593c3206138e) --- src/server/scripts/Commands/cs_debug.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/server/scripts/Commands') diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index 09f14dae1d2..63f183d319e 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -50,6 +50,7 @@ EndScriptData */ #include "SpellMgr.h" #include "SpellPackets.h" #include "Transport.h" +#include "Warden.h" #include "World.h" #include "WorldSession.h" #include @@ -97,6 +98,10 @@ public: { "memoryleak", rbac::RBAC_PERM_COMMAND_DEBUG_ASAN, true, &HandleDebugMemoryLeak, "" }, { "outofbounds", rbac::RBAC_PERM_COMMAND_DEBUG_ASAN, true, &HandleDebugOutOfBounds, "" }, }; + static std::vector debugWardenCommandTable = + { + { "force", rbac::RBAC_PERM_COMMAND_DEBUG, true, &HandleDebugWardenForce, "" } + }; static std::vector debugCommandTable = { { "threat", rbac::RBAC_PERM_COMMAND_DEBUG_THREAT, false, &HandleDebugThreatListCommand, "" }, @@ -134,6 +139,7 @@ public: { "guidlimits", rbac::RBAC_PERM_COMMAND_DEBUG, true, &HandleDebugGuidLimitsCommand, "" }, { "objectcount", rbac::RBAC_PERM_COMMAND_DEBUG, true, &HandleDebugObjectCountCommand, "" }, { "questreset", rbac::RBAC_PERM_COMMAND_DEBUG_QUESTRESET, true, &HandleDebugQuestResetCommand, "" }, + { "warden", rbac::RBAC_PERM_COMMAND_DEBUG, true, nullptr, "", debugWardenCommandTable }, { "personalclone", rbac::RBAC_PERM_COMMAND_DEBUG, false, &HandleDebugBecomePersonalClone, "" } }; static std::vector commandTable = @@ -1701,6 +1707,23 @@ public: return true; } + static bool HandleDebugWardenForce(ChatHandler* handler, std::vector checkIds) + { + if (checkIds.empty()) + return false; + + Warden* const warden = handler->GetSession()->GetWarden(); + if (!warden) + { + handler->SendSysMessage("Warden system is not enabled"); + return true; + } + + size_t const nQueued = warden->DEBUG_ForceSpecificChecks(checkIds); + handler->PSendSysMessage("%zu/%zu checks queued for your Warden, they should be sent over the next few minutes (depending on settings)", nQueued, checkIds.size()); + return true; + } + static bool HandleDebugGuidLimitsCommand(ChatHandler* handler, Optional mapId) { if (mapId) -- cgit v1.2.3