diff --git a/api/BitMod/BitMod.cs b/api/BitMod/BitMod.cs index f92a565..fc5dc25 100644 --- a/api/BitMod/BitMod.cs +++ b/api/BitMod/BitMod.cs @@ -66,6 +66,11 @@ public void Start() Logger.Information("[BitMod] Starting server on {@IP}:{@Port}", ip.ToString(), port); _server.Start(ip, port); + + while (true) + { + + } } public void Stop() diff --git a/api/BitMod/BitMod.csproj b/api/BitMod/BitMod.csproj index 525e1fc..460a9c9 100644 --- a/api/BitMod/BitMod.csproj +++ b/api/BitMod/BitMod.csproj @@ -8,13 +8,12 @@ bitmod EdgeGamers embedded - Debug;Release AnyCPU latest - + diff --git a/api/BitMod/Handler/BaseHandler.cs b/api/BitMod/Handler/BaseHandler.cs index 82e6a09..414b848 100644 --- a/api/BitMod/Handler/BaseHandler.cs +++ b/api/BitMod/Handler/BaseHandler.cs @@ -23,7 +23,7 @@ public abstract class BaseHandler : IDisposable public BaseHandler(ServerListener server) { _server = server; - _server.LogLevel |= LogLevel.All; + _server.LogLevel = LogLevel.All; _server.OnGameServerConnecting += OnGameServerConnecting; _server.OnCreatingGameServerInstance += OnCreatingGameServerInstance; diff --git a/api/BitMod/Handler/RoutingHandler.cs b/api/BitMod/Handler/RoutingHandler.cs index 703901e..9121be5 100644 --- a/api/BitMod/Handler/RoutingHandler.cs +++ b/api/BitMod/Handler/RoutingHandler.cs @@ -33,5 +33,5 @@ public override BitPlayer OnCreatingPlayerInstance(ulong steamid) => new BitPlayer(); public override void OnLog(LogLevel name, string value, object? sender) - => _logger.Verbose("[API] {@Level} {@Value} ({@Sender})", name, value, sender); + => _logger.Verbose("[API] {@Level} {@Value}", name, value); } diff --git a/builtin/BitMod.Whitelist/BitMod.Whitelist.csproj b/builtin/BitMod.Whitelist/BitMod.Whitelist.csproj index 6eee348..b4704af 100644 --- a/builtin/BitMod.Whitelist/BitMod.Whitelist.csproj +++ b/builtin/BitMod.Whitelist/BitMod.Whitelist.csproj @@ -15,7 +15,6 @@ - diff --git a/standalone/BitMod.Config/Cache/ConfigWatcher.cs b/standalone/BitMod.Config/Cache/ConfigWatcher.cs index 0c59cc1..5188c24 100644 --- a/standalone/BitMod.Config/Cache/ConfigWatcher.cs +++ b/standalone/BitMod.Config/Cache/ConfigWatcher.cs @@ -45,7 +45,6 @@ public ConfigWatcher(string configFileName, ILogger logger, KVSerializer seriali _configObject = new ConfigObject( new KVObject(_configFileName, Enumerable.Empty())); - _watcher = new FileSystemWatcher(); _watcher = new FileSystemWatcher(); _watcher.Path = Path.Join(System.Environment.CurrentDirectory, CONFIG_PATH); _watcher.NotifyFilter = NotifyFilters.FileName | NotifyFilters.LastWrite | NotifyFilters.Size | NotifyFilters.Size; diff --git a/standalone/BitMod.Launcher/BitMod.Launcher.csproj b/standalone/BitMod.Launcher/BitMod.Launcher.csproj index 7be53f3..7ccebeb 100644 --- a/standalone/BitMod.Launcher/BitMod.Launcher.csproj +++ b/standalone/BitMod.Launcher/BitMod.Launcher.csproj @@ -10,6 +10,8 @@ Debug;Release AnyCPU + true + $(BitModBuild) $(BitModDev) latest diff --git a/standalone/BitMod.Launcher/Program.cs b/standalone/BitMod.Launcher/Program.cs index a2ca527..d99ff1a 100644 --- a/standalone/BitMod.Launcher/Program.cs +++ b/standalone/BitMod.Launcher/Program.cs @@ -1,20 +1,21 @@ -// See https://aka.ms/new-console-template for more information - - -using BitMod.Config; +using BitMod.Config; using BitMod.Logging; using BitMod.Plugins; -var configSystem = new ConfigurationSystem(); -var logging = new LoggingSystem(configSystem); -var pluginSystem = new PluginSystem(); - -var log = logging.GetLogger(); +public static class Program +{ + public static void Main() + { + var configSystem = new ConfigurationSystem(); + var logging = new LoggingSystem(configSystem); + var pluginSystem = new PluginSystem(); -var bitmod = new BitMod.BitMod(log, configSystem, pluginSystem); + var log = logging.GetLogger(); -bitmod.Start(); + log.Information("Launching BitMod..."); -ManualResetEvent close = new ManualResetEvent(false); + var bitmod = new BitMod.BitMod(log, configSystem, pluginSystem); -close.WaitOne(); + bitmod.Start(); + } +} diff --git a/standalone/BitMod.Logging/LoggingSystem.cs b/standalone/BitMod.Logging/LoggingSystem.cs index a5a10d7..4330e75 100644 --- a/standalone/BitMod.Logging/LoggingSystem.cs +++ b/standalone/BitMod.Logging/LoggingSystem.cs @@ -1,4 +1,6 @@ -using BitMod.Public; +using System.IO; + +using BitMod.Public; using Serilog; using Serilog.Events; @@ -28,7 +30,7 @@ public ILogger GetLogger() LevelAlias.Minimum, theme: AnsiConsoleTheme.Sixteen, outputTemplate: "[{Timestamp:HH:mm:ss}] {Properties} {Level:u4}: {Message:lj}{NewLine}{Exception}" ) - .WriteTo.File(Path.Join(System.Environment.CurrentDirectory, LOG_PATH, LOG_NAME), LogEventLevel.Debug) + .WriteTo.File(Path.Join(System.Environment.CurrentDirectory, LOG_PATH, LOG_NAME), LogEventLevel.Debug, rollingInterval: RollingInterval.Day, retainedFileCountLimit: 60) .CreateLogger(); } } diff --git a/standalone/BitMod.Plugins/Plugin.cs b/standalone/BitMod.Plugins/Plugin.cs index 47bff7b..e27632f 100644 --- a/standalone/BitMod.Plugins/Plugin.cs +++ b/standalone/BitMod.Plugins/Plugin.cs @@ -1,4 +1,7 @@ -using System.Reflection; +using System; +using System.IO; +using System.Linq; +using System.Reflection; using BitMod.Public; diff --git a/standalone/BitMod.Plugins/PluginWatcher.cs b/standalone/BitMod.Plugins/PluginWatcher.cs index b80117b..127909b 100644 --- a/standalone/BitMod.Plugins/PluginWatcher.cs +++ b/standalone/BitMod.Plugins/PluginWatcher.cs @@ -1,4 +1,5 @@ -using System.Reflection; +using System.IO; +using System.Reflection; using McMaster.NETCore.Plugins;