Skip to content

Commit 86a8d40

Browse files
committed
Most likely fixed the Read() method not allowing any more command input
1 parent 0b564fc commit 86a8d40

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

LabExtended/Commands/CommandManager.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,19 @@ private static void OnCommand(CommandExecutingEventArgs ev)
181181
if (!ExPlayer.TryGet(ev.Sender, out var player))
182182
return;
183183

184+
if (!string.IsNullOrEmpty(ev.CommandName) && string.Equals(ev.CommandName, "labexcmddebug", StringComparison.OrdinalIgnoreCase))
185+
{
186+
ev.IsAllowed = false;
187+
188+
player.SendRemoteAdminMessage(
189+
$"Player: {player.ToCommandString()}\n" +
190+
$"Runner: {player.activeRunner?.GetType().Name ?? "(null)"}\n" +
191+
$"AllowOverride: {ApiLoader.ApiConfig.CommandSection.AllowOverride}\n" +
192+
$"AllowPooling: {ApiLoader.ApiConfig.CommandSection.AllowInstancePooling}", true, true, "CMDDEBUG");
193+
194+
return;
195+
}
196+
184197
if (player.activeRunner != null && player.activeRunner.ShouldContinue(ev, player))
185198
{
186199
ev.IsAllowed = false;

LabExtended/Commands/Runners/InputCommandRunner.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ public bool ShouldContinue(CommandExecutingEventArgs ev, ExPlayer sender)
6767

6868
context.WriteResponse(out _);
6969
context.InvokeExecuted();
70+
71+
if (context.Response != null && (!context.Response.IsInput || context.Response.onInput == null))
72+
context.Sender.activeRunner = null;
7073

7174
return true;
7275
}

LabExtended/Commands/Runners/RegularCommandRunner.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
using LabExtended.Commands.Interfaces;
66
using LabExtended.Commands.Utilities;
7+
78
using LabExtended.Core;
89

910
namespace LabExtended.Commands.Runners;

0 commit comments

Comments
 (0)