From 9edf8a52277269435b7c5518e429027001fc25f9 Mon Sep 17 00:00:00 2001 From: miniduikboot <5243971+miniduikboot@users.noreply.github.com> Date: Thu, 25 Feb 2021 22:08:12 +0100 Subject: [PATCH] Warn if plugin loader paths don't exist This is a common misconfiguration for AUProximity users. Warn more explicitly --- src/Impostor.Server/Plugins/PluginLoader.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/Impostor.Server/Plugins/PluginLoader.cs b/src/Impostor.Server/Plugins/PluginLoader.cs index f753bd135..9620eb4bb 100644 --- a/src/Impostor.Server/Plugins/PluginLoader.cs +++ b/src/Impostor.Server/Plugins/PluginLoader.cs @@ -24,6 +24,8 @@ public static IHostBuilder UsePluginLoader(this IHostBuilder builder, PluginConf // 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,18 @@ public static IHostBuilder UsePluginLoader(this IHostBuilder builder, PluginConf return builder; } + private static void CheckPaths(IEnumerable paths) + { + foreach (var path in paths) + { + if (!Directory.Exists(path)) + { + Logger.Warning("Directory \"{path}\" was specified in the PluginLoader configuration, but this directory doesn't exist!", path); + } + } + + } + private static void RegisterAssemblies( IEnumerable paths, Matcher matcher,