Skip to main content

WindowsServerConsole

A class in Root.Township, the global namespace.

The local console window opened by ServerConsoleManager. It runs on its own thread, prints queued log lines coloured by level and passes typed lines back as commands.

Constructors​

MemberWhat it is
WindowsServerConsole()Creates a WindowsServerConsole with default values.

Fields​

4 private and internal fields
MemberWhat it is
private ConsoleWindow consoleThe console window.
private Thread consoleThreadThe thread running ConsoleThread.
private ConcurrentQueue<WindowsServerConsole.ConsoleLogEntry> entryQueueLog lines waiting to be printed.
private ConsoleInput inputReads and redraws the input line.

Methods​

MemberWhat it is
override void HandleLog(string message, LogLevel level)Queues a log line for the console thread; drops it when more than 5000 are waiting.
override void Shutdown()Closes the console window.
2 private and internal methods
MemberWhat it is
private void ChangeConsoleTitle()Retitles the window "A Township Tale SERVER" once the server starts.
private void ConsoleThread()Thread body: opens the window, then every 50 ms prints queued log lines (yellow for warnings, red above) and reads input until closed.