Output formatting
This commit is contained in:
parent
6a200dbb64
commit
23f9581383
@ -39,7 +39,7 @@ public class CS2GSI
|
||||
if (_lastLocalGameState is not null && _allGameStates.Count > 0)
|
||||
{
|
||||
List<ValueTuple<CS2Event, CS2EventArgs>> generatedEvents = CS2EventGenerator.GenerateEvents(_lastLocalGameState, newState, _allGameStates.Last());
|
||||
this._logger?.Log(LogLevel.Information, $"Generated {generatedEvents.Count} events:\n\t{string.Join("\n\t", generatedEvents)}");
|
||||
this._logger?.Log(LogLevel.Information, $"Generated {generatedEvents.Count} event{(generatedEvents.Count > 1 ? 's' : null)}:\n- {string.Join("\n- ", generatedEvents)}");
|
||||
InvokeEvents(generatedEvents);
|
||||
}
|
||||
this._lastLocalGameState = newState.UpdateGameStateForLocal(_lastLocalGameState);
|
||||
|
@ -44,7 +44,7 @@ internal class GSIServer
|
||||
|
||||
StreamReader reader = new (request.InputStream, request.ContentEncoding);
|
||||
string content = await reader.ReadToEndAsync();
|
||||
this.logger?.Log(LogLevel.Debug, content);
|
||||
this.logger?.Log(LogLevel.Debug, $"Message Content:\n{content}");
|
||||
OnMessage?.Invoke(content);
|
||||
}
|
||||
HttpListener.Close();
|
||||
|
@ -12,7 +12,7 @@ public abstract record GameState
|
||||
string filler = GetType().GetFields().Last() != field ? "\u251c\u2500" : "\u2514\u2500";
|
||||
string filler2 = GetType().GetFields().Last() != field ? "\u2502" : " ";
|
||||
if (field.FieldType.BaseType == typeof(GameState))
|
||||
ret += $"\b{filler}\u2510{field.Name}\n{field.GetValue(this)?.ToString()?.Replace("\b", $"\b{filler2} ")}";
|
||||
ret += $"\b{filler}\u2510 {field.Name}\n{field.GetValue(this)?.ToString()?.Replace("\b", $"\b{filler2} ")}";
|
||||
else
|
||||
ret += $"\b{filler} {field.Name}{new string('.', field.Name.Length > 25 ? 0 : 25-field.Name.Length)}{field.GetValue(this)}\n";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user