From: miniduikboot <5243971+miniduikboot@users.noreply.github.com> Date: Wed, 3 Mar 2021 14:36:17 +0000 (+0100) Subject: Warn if plugin loader paths don't exist (#330) X-Git-Tag: v1.3.0~16 X-Git-Url: https://git.deb.at/?a=commitdiff_plain;h=be19b1524bd77223d97ea37d704524391c28afb7;p=rhonda%2Fimpostor.git Warn if plugin loader paths don't exist (#330) --- 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,