Skip to content

Commit 5b97061

Browse files
authored
log command invocation beforehand for silent crashes (#592)
1 parent e41a26d commit 5b97061

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

Torch/Commands/CommandManager.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ private List<TorchChatMessage> HandleCommandFromServerInternal(string message, A
9494

9595
var splitArgs = Regex.Matches(argText, "(\"[^\"]+\"|\\S+)").Cast<Match>().Select(x => x.ToString().Replace("\"", "")).ToList();
9696
_log.Trace($"Invoking {cmdPath} for server.");
97+
_log.Info($"Server is running command '{message}'...");
9798
var context = new ConsoleCommandContext(Torch, command.Plugin, Sync.MyId, argText, splitArgs);
9899
if (subscriber != null)
99100
context.OnResponse += subscriber;
@@ -166,6 +167,7 @@ public void HandleCommand(string message, ulong steamId, ref bool consumed, bool
166167

167168
var splitArgs = Regex.Matches(argText, "(\"[^\"]+\"|\\S+)").Cast<Match>().Select(x => x.ToString().Replace("\"", "")).ToList();
168169
_log.Trace($"Invoking {cmdPath} for player {player.DisplayName}");
170+
_log.Info($"Player {player.DisplayName} is running command '{message}'...");
169171
var context = new CommandContext(Torch, command.Plugin, steamId, argText, splitArgs);
170172
Torch.Invoke(() =>
171173
{

0 commit comments

Comments
 (0)