This commit is contained in:
@@ -12,10 +12,13 @@ namespace ShrinkModFramework
|
||||
/// </summary>
|
||||
internal static class ShrinkModComponentDiscovery
|
||||
{
|
||||
public static IReadOnlyList<ShrinkModComponentSource> Discover(ShrinkModFrameworkSettings settings,
|
||||
bool verboseLogging)
|
||||
public static IReadOnlyList<ShrinkModComponentSource> Discover(
|
||||
ShrinkModFrameworkSettings settings,
|
||||
bool verboseLogging,
|
||||
IEnumerable<string> authorizedDllPaths)
|
||||
{
|
||||
ShrinkExternalModAssemblyLoader.ScanExternalAssemblyRevisions(settings, verboseLogging);
|
||||
ShrinkExternalModAssemblyLoader.ScanExternalAssemblyRevisions(
|
||||
settings, verboseLogging, authorizedDllPaths);
|
||||
var results = new List<ShrinkModComponentSource>();
|
||||
var prefixes = settings?.assemblyNamePrefixes;
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Cysharp.Threading.Tasks;
|
||||
|
||||
namespace ShrinkModFramework
|
||||
@@ -19,7 +20,8 @@ namespace ShrinkModFramework
|
||||
new Dictionary<string, ShrinkModHandle>();
|
||||
|
||||
public static async UniTask<IReadOnlyDictionary<string, ShrinkModHandle>> ApplyDiscoveredAsync(
|
||||
ShrinkModFrameworkSettings settings = null)
|
||||
ShrinkModFrameworkSettings settings = null,
|
||||
IEnumerable<string> authorizedDllPaths = null)
|
||||
{
|
||||
settings ??= ShrinkModFrameworkSettings.Instance;
|
||||
var verboseLogging = settings == null || settings.verboseLogging;
|
||||
@@ -34,7 +36,9 @@ namespace ShrinkModFramework
|
||||
ShrinkModNetworkManager.Configure(settings == null || settings.enableNetworkSync, verboseLogging);
|
||||
try
|
||||
{
|
||||
var sources = ShrinkModComponentDiscovery.Discover(settings, verboseLogging);
|
||||
var authorizedPaths = authorizedDllPaths?.ToArray() ?? Array.Empty<string>();
|
||||
var sources = ShrinkModComponentDiscovery.Discover(
|
||||
settings, verboseLogging, authorizedPaths);
|
||||
await _host.ApplyAsync(sources);
|
||||
}
|
||||
catch
|
||||
|
||||
Reference in New Issue
Block a user