From 613d69a0591fd80c8dac7ac35a5a3416508be0d2 Mon Sep 17 00:00:00 2001 From: CWX Date: Fri, 7 Feb 2025 21:29:42 +0000 Subject: [PATCH] updated logging --- Server/ModDllLoader.cs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Server/ModDllLoader.cs b/Server/ModDllLoader.cs index 854945f2..5ea531e4 100644 --- a/Server/ModDllLoader.cs +++ b/Server/ModDllLoader.cs @@ -8,13 +8,6 @@ namespace Server; public class ModDllLoader { private const string ModPath = "./user/mods/"; - private static ISptLogger _logger; - - public ModDllLoader(ISptLogger logger) - { - _logger = logger; - } - public static List LoadAllMods() { @@ -81,6 +74,11 @@ public class ModDllLoader } } + if (asmCount == 0 && packCount == 0) + { + throw new Exception($"No Assembly or package.json found in {Path.GetFullPath(path)}"); + } + if (packCount == 0) { throw new Exception($"No package.json found in path: {Path.GetFullPath(path)}"); @@ -93,7 +91,7 @@ public class ModDllLoader if (result.Assembly is not null && result.PackageJson is not null) { - Console.WriteLine($"Loaded {result.PackageJson.Name}"); + Console.WriteLine($"Loaded {result.PackageJson.Name} mod by {result.PackageJson.Author}"); } return result;