mirror of
https://git.battle-of-pip.de/root/vpr-mitarbeiterverwaltung.git
synced 2025-10-15 02:24:53 +02:00
First Server Test | Next Update: Change Commands to Attributes
This commit is contained in:
@@ -155,6 +155,7 @@ namespace DX86
|
||||
catch (Exception ex)
|
||||
{
|
||||
ms.Error("[DX86] Error handling client: " + ex.Message);
|
||||
ms.Debug("[DX86] Stack Trace: " + ex.StackTrace);
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
@@ -37,6 +37,11 @@ public class MessageSender
|
||||
}
|
||||
|
||||
|
||||
public async void Debug(string message)
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.Green;
|
||||
this.Send($"[{DateTime.Now}] [DEBUG] {message}");
|
||||
}
|
||||
public async void Log(string message)
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.Gray;
|
||||
@@ -76,6 +81,8 @@ public class MessageSender
|
||||
int i = 0;
|
||||
foreach (var s in messageHistory)
|
||||
{
|
||||
if (s.Contains("[DEBUG]"))
|
||||
Console.ForegroundColor = ConsoleColor.Green;
|
||||
if (s.Contains("[INFO ]"))
|
||||
Console.ForegroundColor = ConsoleColor.Gray;
|
||||
if (s.Contains("[WARN ]"))
|
||||
|
@@ -12,6 +12,7 @@ public abstract class TcpServer
|
||||
protected MessageSender ms;
|
||||
private DX86 dx86;
|
||||
public List<string> optionsList;
|
||||
public Dictionary<TcpClient, string> LoggedInClients { get; }
|
||||
|
||||
|
||||
public TcpServer(string address, int port, MessageSender ms)
|
||||
@@ -26,8 +27,9 @@ public abstract class TcpServer
|
||||
ms.Log("[DX86] Server Setup Complete.");
|
||||
_ = RunServer();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private async Task RunServer()
|
||||
{
|
||||
ms.Log("[DX86] Starting server.");
|
||||
|
Reference in New Issue
Block a user