]> git.deb.at Git - rhonda/impostor.git/commitdiff
Warn if plugin loader paths don't exist (#330)
authorminiduikboot <5243971+miniduikboot@users.noreply.github.com>
Wed, 3 Mar 2021 14:36:17 +0000 (15:36 +0100)
committerGitHub <noreply@github.com>
Wed, 3 Mar 2021 14:36:17 +0000 (14:36 +0000)
src/Impostor.Server/Plugins/PluginLoader.cs

index f753bd13570bf2b50a67dd30032f86cd21c55e80..4b5d07a5070cd1628078f6c607f613e53ff19c26 100644 (file)
@@ -24,6 +24,8 @@ namespace Impostor.Server.Plugins
             // Add the plugins and libraries.
             var pluginPaths = new List<string>(config.Paths);
             var libraryPaths = new List<string>(config.LibraryPaths);
+            CheckPaths(pluginPaths);
+            CheckPaths(libraryPaths);
 
             var rootFolder = Directory.GetCurrentDirectory();
 
@@ -120,6 +122,17 @@ namespace Impostor.Server.Plugins
             return builder;
         }
 
+        private static void CheckPaths(IEnumerable<string> paths)
+        {
+            foreach (var path in paths)
+            {
+                if (!Directory.Exists(path))
+                {
+                    Logger.Warning("Path {path} was specified in the PluginLoader configuration, but this folder doesn't exist!", path);
+                }
+            }
+        }
+
         private static void RegisterAssemblies(
             IEnumerable<string> paths,
             Matcher matcher,