From be19b1524bd77223d97ea37d704524391c28afb7 Mon Sep 17 00:00:00 2001 From: miniduikboot <5243971+miniduikboot@users.noreply.github.com> Date: Wed, 3 Mar 2021 15:36:17 +0100 Subject: [PATCH] Warn if plugin loader paths don't exist (#330) --- src/Impostor.Server/Plugins/PluginLoader.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Impostor.Server/Plugins/PluginLoader.cs b/src/Impostor.Server/Plugins/PluginLoader.cs index f753bd1..4b5d07a 100644 --- a/src/Impostor.Server/Plugins/PluginLoader.cs +++ b/src/Impostor.Server/Plugins/PluginLoader.cs @@ -24,6 +24,8 @@ namespace Impostor.Server.Plugins // Add the plugins and libraries. var pluginPaths = new List(config.Paths); var libraryPaths = new List(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 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 paths, Matcher matcher, -- 2.39.5