aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Commands
diff options
context:
space:
mode:
authorTreeston <treeston.mmoc@gmail.com>2020-08-19 00:25:44 +0200
committerShauren <shauren.trinity@gmail.com>2022-02-02 22:47:55 +0100
commiteaa3c7e5a07802916ab00dd74aac6e0eb9cde957 (patch)
tree12328ce2993479f82c9fdf4f29c365d4cbd4d865 /src/server/scripts/Commands
parent222b0c16a4b6bd7e06edb68bb76df1556c8668ad (diff)
Core/Warden: Add .debug warden force, allowing you to force specific warden checks to be sent
(cherry picked from commit f04f4e91ff3afbf89f30659b85e8593c3206138e)
Diffstat (limited to 'src/server/scripts/Commands')
-rw-r--r--src/server/scripts/Commands/cs_debug.cpp23
1 files changed, 23 insertions, 0 deletions
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 <fstream>
@@ -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<ChatCommand> debugWardenCommandTable =
+ {
+ { "force", rbac::RBAC_PERM_COMMAND_DEBUG, true, &HandleDebugWardenForce, "" }
+ };
static std::vector<ChatCommand> 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<ChatCommand> commandTable =
@@ -1701,6 +1707,23 @@ public:
return true;
}
+ static bool HandleDebugWardenForce(ChatHandler* handler, std::vector<uint16> 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<uint32> mapId)
{
if (mapId)