Skip to content
This repository has been archived by the owner on Mar 3, 2021. It is now read-only.

Commit

Permalink
Warn if plugin loader paths don't exist
Browse files Browse the repository at this point in the history
This is a common misconfiguration for AUProximity users. Warn more explicitly
  • Loading branch information
miniduikboot committed Mar 1, 2021
1 parent dafbe3b commit f6d0a55
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/Impostor.Server/Plugins/PluginLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ public static IHostBuilder UsePluginLoader(this IHostBuilder builder, PluginConf
// 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();

Expand Down Expand Up @@ -120,6 +122,18 @@ public static IHostBuilder UsePluginLoader(this IHostBuilder builder, PluginConf
return builder;
}

private static void CheckPaths(IEnumerable<string> 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<string> paths,
Matcher matcher,
Expand Down

0 comments on commit f6d0a55

Please sign in to comment.