Table of Contents

Class AnsiEscapes

Namespace
McServerLauncher.Services
Assembly
McServerLauncher.dll

Removes the colour codes some servers write into their console output.

public static class AnsiEscapes
Inheritance
AnsiEscapes
Inherited Members

Remarks

Paper colours its console with ANSI escape sequences even when its output is a pipe, and since the join and leave messages became coloured the line the app receives is [16:41:52 INFO]: ESC[38;5;11mBot1 joined the gameESC[0m. Every detector reads the message from the start (so that a player typing the same words in chat cannot fake it), and a name that begins with an escape sequence is not a name: players joined Paper servers and the app never saw them, which also left every statistic that counts players at zero.

The sequences are removed where the output enters the app, once, so nothing downstream (the console, the log on disk, the player history, the speed probe) ever sees them.

Methods

Strip(string)

The text without colour or formatting sequences.

public static string Strip(string text)

Parameters

text string

Returns

string