diff --git a/CS2GSI.sln b/CS2GSI.sln
index 7c7184d..251d154 100644
--- a/CS2GSI.sln
+++ b/CS2GSI.sln
@@ -1,6 +1,8 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CS2GSI", "CS2GSI.csproj", "{F2272524-6CDD-4ACD-8CFF-64B9AF98D54A}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CS2GSI", "CS2GSI\CS2GSI.csproj", "{F2272524-6CDD-4ACD-8CFF-64B9AF98D54A}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestApp", "TestApp\TestApp.csproj", "{A4FE89AD-F89B-4ABC-BA88-DF4AC2CADE09}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -12,5 +14,9 @@ Global
{F2272524-6CDD-4ACD-8CFF-64B9AF98D54A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F2272524-6CDD-4ACD-8CFF-64B9AF98D54A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F2272524-6CDD-4ACD-8CFF-64B9AF98D54A}.Release|Any CPU.Build.0 = Release|Any CPU
+ {A4FE89AD-F89B-4ABC-BA88-DF4AC2CADE09}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {A4FE89AD-F89B-4ABC-BA88-DF4AC2CADE09}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {A4FE89AD-F89B-4ABC-BA88-DF4AC2CADE09}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {A4FE89AD-F89B-4ABC-BA88-DF4AC2CADE09}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
diff --git a/CS2EventArgs.cs b/CS2GSI/CS2EventArgs.cs
similarity index 100%
rename from CS2EventArgs.cs
rename to CS2GSI/CS2EventArgs.cs
diff --git a/CS2EventGenerator.cs b/CS2GSI/CS2EventGenerator.cs
similarity index 100%
rename from CS2EventGenerator.cs
rename to CS2GSI/CS2EventGenerator.cs
diff --git a/CS2GSI.cs b/CS2GSI/CS2GSI.cs
similarity index 99%
rename from CS2GSI.cs
rename to CS2GSI/CS2GSI.cs
index 574f6b2..b0f2222 100644
--- a/CS2GSI.cs
+++ b/CS2GSI/CS2GSI.cs
@@ -25,7 +25,7 @@ public class CS2GSI
this.logger?.Log(LogLevel.Critical, "Could not install GSI-Configfile. Exiting.");
return;
}
- this._gsiServer = new GSIServer(3000);
+ this._gsiServer = new GSIServer(3000, logger);
this._gsiServer.OnMessage += GsiServerOnOnMessage;
while(this._gsiServer.IsRunning)
diff --git a/CS2GSI.csproj b/CS2GSI/CS2GSI.csproj
similarity index 100%
rename from CS2GSI.csproj
rename to CS2GSI/CS2GSI.csproj
index 1ec8b1f..ce2b4d3 100644
--- a/CS2GSI.csproj
+++ b/CS2GSI/CS2GSI.csproj
@@ -6,6 +6,11 @@
enable
+
+
+
+
+
ResXFileCodeGenerator
@@ -21,9 +26,4 @@
-
-
-
-
-
diff --git a/CS2GSI.sln.DotSettings b/CS2GSI/CS2GSI.sln.DotSettings
similarity index 100%
rename from CS2GSI.sln.DotSettings
rename to CS2GSI/CS2GSI.sln.DotSettings
diff --git a/GSIConfigInstaller.cs b/CS2GSI/GSIConfigInstaller.cs
similarity index 100%
rename from GSIConfigInstaller.cs
rename to CS2GSI/GSIConfigInstaller.cs
diff --git a/GSIServer.cs b/CS2GSI/GSIServer.cs
similarity index 100%
rename from GSIServer.cs
rename to CS2GSI/GSIServer.cs
diff --git a/GameState/CS2GameState.cs b/CS2GSI/GameState/CS2GameState.cs
similarity index 100%
rename from GameState/CS2GameState.cs
rename to CS2GSI/GameState/CS2GameState.cs
diff --git a/GameState/CS2Team.cs b/CS2GSI/GameState/CS2Team.cs
similarity index 100%
rename from GameState/CS2Team.cs
rename to CS2GSI/GameState/CS2Team.cs
diff --git a/GameState/GameStateTeam.cs b/CS2GSI/GameState/GameStateTeam.cs
similarity index 100%
rename from GameState/GameStateTeam.cs
rename to CS2GSI/GameState/GameStateTeam.cs
diff --git a/GameState/Map.cs b/CS2GSI/GameState/Map.cs
similarity index 100%
rename from GameState/Map.cs
rename to CS2GSI/GameState/Map.cs
diff --git a/GameState/Player.cs b/CS2GSI/GameState/Player.cs
similarity index 100%
rename from GameState/Player.cs
rename to CS2GSI/GameState/Player.cs
diff --git a/GameState/PlayerMatchStats.cs b/CS2GSI/GameState/PlayerMatchStats.cs
similarity index 100%
rename from GameState/PlayerMatchStats.cs
rename to CS2GSI/GameState/PlayerMatchStats.cs
diff --git a/GameState/PlayerState.cs b/CS2GSI/GameState/PlayerState.cs
similarity index 100%
rename from GameState/PlayerState.cs
rename to CS2GSI/GameState/PlayerState.cs
diff --git a/GameState/Round.cs b/CS2GSI/GameState/Round.cs
similarity index 100%
rename from GameState/Round.cs
rename to CS2GSI/GameState/Round.cs
diff --git a/Resources.Designer.cs b/CS2GSI/Resources.Designer.cs
similarity index 100%
rename from Resources.Designer.cs
rename to CS2GSI/Resources.Designer.cs
diff --git a/Resources.resx b/CS2GSI/Resources.resx
similarity index 100%
rename from Resources.resx
rename to CS2GSI/Resources.resx
diff --git a/gamestate_integration_cs2gsi.cfg b/CS2GSI/gamestate_integration_cs2gsi.cfg
similarity index 100%
rename from gamestate_integration_cs2gsi.cfg
rename to CS2GSI/gamestate_integration_cs2gsi.cfg
diff --git a/TestApp/Logger.cs b/TestApp/Logger.cs
new file mode 100644
index 0000000..82a1624
--- /dev/null
+++ b/TestApp/Logger.cs
@@ -0,0 +1,60 @@
+using Microsoft.Extensions.Logging;
+
+namespace CS2GSI.TestApp;
+
+public class Logger : ILogger
+{
+ private readonly LogLevel _enabledLoglevel;
+ private readonly ConsoleColor _defaultForegroundColor = Console.ForegroundColor;
+ private readonly ConsoleColor _defaultBackgroundColor = Console.BackgroundColor;
+
+ public Logger(LogLevel logLevel = LogLevel.Information)
+ {
+ _enabledLoglevel = logLevel;
+ }
+
+ public void Log(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func formatter)
+ {
+ if (!IsEnabled(logLevel))
+ return;
+ Console.ForegroundColor = ForegroundColorForLogLevel(logLevel);
+ Console.BackgroundColor = BackgroundColorForLogLevel(logLevel);
+ Console.Write(logLevel.ToString()[..3].ToUpper());
+ Console.ResetColor();
+ // ReSharper disable once LocalizableElement
+ Console.Write($" [{DateTime.UtcNow:HH:mm:ss.fff}] ");
+ Console.WriteLine(formatter.Invoke(state, exception));
+ }
+
+ public bool IsEnabled(LogLevel logLevel)
+ {
+ return logLevel >= _enabledLoglevel;
+ }
+
+ public IDisposable? BeginScope(TState state) where TState : notnull
+ {
+ return null;
+ }
+
+ private ConsoleColor ForegroundColorForLogLevel(LogLevel logLevel)
+ {
+ return logLevel switch
+ {
+ LogLevel.Error or LogLevel.Critical => ConsoleColor.Black,
+ LogLevel.Debug => ConsoleColor.Black,
+ LogLevel.Information => ConsoleColor.White,
+ _ => _defaultForegroundColor
+ };
+ }
+
+ private ConsoleColor BackgroundColorForLogLevel(LogLevel logLevel)
+ {
+ return logLevel switch
+ {
+ LogLevel.Error or LogLevel.Critical => ConsoleColor.Red,
+ LogLevel.Debug => ConsoleColor.Yellow,
+ LogLevel.Information => ConsoleColor.Black,
+ _ => _defaultBackgroundColor
+ };
+ }
+}
\ No newline at end of file
diff --git a/TestApp/Program.cs b/TestApp/Program.cs
new file mode 100644
index 0000000..ae6f76c
--- /dev/null
+++ b/TestApp/Program.cs
@@ -0,0 +1,11 @@
+// See https://aka.ms/new-console-template for more information
+
+using CS2GSI.TestApp;
+
+public class TestApp
+{
+ public static void Main(string[] args)
+ {
+ new CS2GSI.CS2GSI(new Logger());
+ }
+}
\ No newline at end of file
diff --git a/TestApp/TestApp.csproj b/TestApp/TestApp.csproj
new file mode 100644
index 0000000..3babba9
--- /dev/null
+++ b/TestApp/TestApp.csproj
@@ -0,0 +1,18 @@
+
+
+
+ Exe
+ net7.0
+ enable
+ enable
+
+
+
+
+
+
+
+
+
+
+