Show the backend socket's status and errors in chat, as the original did
Live, /mm ws enable printed nothing about the connection: the socket's connecting / CONNECTED / REGISTERED / error / reconnect / DISABLED lines went only to the host log, which the windowed client does not show. The original printed every one of them to chat. BackendClient now queues each status and error line (original wording) and still logs it; BackendSession drains the queue to chat on the tick, and right after a start or stop on the tick thread so "[WebSocket] connecting…" and "[WebSocket] DISABLED" come before the command's own reply, as in the original. The socket thread never writes to chat. The original's telemetry-loop and cleanup lines are emitted at the matching points, "Starting telemetry loop" comes from the telemetry listener, and "Vital sharing re-subscribed" is no longer verbose-only. No frame on the wire changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
336c5cfdf5
commit
28794299cb
7 changed files with 226 additions and 21 deletions
|
|
@ -295,12 +295,25 @@ public sealed class RecordingLogger : IPluginLogger
|
|||
{
|
||||
public List<string> Messages { get; } = [];
|
||||
|
||||
public void Info(string message) => Messages.Add("info: " + message);
|
||||
public void Info(string message) => Add("info: " + message);
|
||||
|
||||
public void Warn(string message) => Messages.Add("warn: " + message);
|
||||
public void Warn(string message) => Add("warn: " + message);
|
||||
|
||||
public void Error(string message, Exception? exception = null)
|
||||
=> Messages.Add("error: " + message);
|
||||
=> Add("error: " + message);
|
||||
|
||||
/// <summary>True when a logged line matches; safe while a background thread logs.</summary>
|
||||
public bool Any(Func<string, bool> match)
|
||||
{
|
||||
lock (Messages)
|
||||
return Messages.Any(match);
|
||||
}
|
||||
|
||||
private void Add(string line)
|
||||
{
|
||||
lock (Messages)
|
||||
Messages.Add(line);
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class FakeGameState : IGameState
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue