From b0364c3f77f0cd86a198868b8e992e585a055e91 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Thu, 29 Jul 2021 11:44:57 -0300 Subject: Add Moubootaur Legends top-notch debug commands @callfunc and @doevent Require a special global variable to be set server-wide. --- npc/commands/debug.txt | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/npc/commands/debug.txt b/npc/commands/debug.txt index b86dab04..e8e28290 100644 --- a/npc/commands/debug.txt +++ b/npc/commands/debug.txt @@ -640,6 +640,30 @@ OnAllPerms: @allperms=true; end; +// These are really dangerous functions +// Force ADMs to set a variable to use, so I know they are aware of server code +OnCallFunc: + if (!$@ALLOW_SUPERDEBUG) { + dispbottom col("This command is restricted for senior dev-admins. Please do not use it again.", 1); + die(); + end; + } + .@request$ = ""; + .@request$ += implode(.@atcmd_parameters$, " "); + callfunc .@request$; + end; + +OnDoEvent: + if (!$@ALLOW_SUPERDEBUG) { + dispbottom col("This command is restricted for senior dev-admins. Please do not use it again.", 1); + die(); + end; + } + .@request$ = ""; + .@request$ += implode(.@atcmd_parameters$, " "); + doevent .@request$; + end; + OnInit: registercmd "@debug", "Debug Spell::OnDebug"; bindatcmd "getvar", "Debug Spell::OnGetVar", 99, 99, 1; @@ -648,6 +672,8 @@ OnInit: bindatcmd "set-var", "Debug Spell::OnSetVar", 99, 99, 1; bindatcmd "sclear", "Debug Spell::OnSClear", 99, 99, 1; bindatcmd "allperms", "Debug Spell::OnAllPerms", 99, 100, 1; + bindatcmd "callfunc", "@wgm::OnCallFunc", 99, 99, 1; + bindatcmd "doevent", "@wgm::OnDoEvent", 99, 99, 1; // Setup debug server command overrides if (debug) { add_group_command("str", 0, true, false); -- cgit v1.2.3-60-g2f50