Skip to content

Commit

Permalink
Bump Version. Fix ResoniteModdingGroup/MonkeyLoader.GamePacks.Resonite/
Browse files Browse the repository at this point in the history
  • Loading branch information
Banane9 committed Apr 17, 2024
1 parent 5fb396e commit eb63ffa
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 15 deletions.
14 changes: 14 additions & 0 deletions MonkeyLoader/Entrypoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,20 @@ public static void Start()
{
var log = new FileLoggingHandler("MonkeyLoader/MonkeyLog.log");

foreach (var file in Directory.EnumerateFiles("./"))
{
try
{
if (Path.GetFileName(file).StartsWith("doorstop", StringComparison.OrdinalIgnoreCase)
&& Path.GetExtension(file).Equals(".log", StringComparison.OrdinalIgnoreCase))
File.Delete(file);
}
catch
{
log.Warn(() => $"Failed to delete doorstop logfile - probably the active one: {file}");
}
}

try
{
AppDomain.CurrentDomain.UnhandledException += (sender, e) => log.Fatal(() => (e.ExceptionObject as Exception)?.Format("Unhandled Exception!") ?? "Unhandled Exception!");
Expand Down
20 changes: 10 additions & 10 deletions MonkeyLoader/EnumerableExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,8 @@ public static IEnumerable<TNode> TopologicalSort<TNode>(this IEnumerable<TNode>
/// <param name="del">The delegate to safely invoke.</param>
/// <param name="args">The arguments for the invocation.</param>
/// <exception cref="AggregateException">Thrown when any invoked methods threw. Contains all nested Exceptions.</exception>
public static void TryInvokeAll(this Delegate del, params object[] args)
=> del.GetInvocationList().TryInvokeAll(args);
public static void TryInvokeAll(this Delegate? del, params object[] args)
=> del?.GetInvocationList().TryInvokeAll(args);

/// <summary>
/// Individually calls all given <paramref name="delegates"/> in a try-catch-block,
Expand All @@ -305,14 +305,14 @@ public static void TryInvokeAll(this Delegate del, params object[] args)
/// <param name="delegates">The delegates to safely invoke.</param>
/// <param name="args">The arguments for the invocation.</param>
/// <exception cref="AggregateException">Thrown when any invoked methods threw. Contains all nested Exceptions.</exception>
public static void TryInvokeAll(this IEnumerable<Delegate> delegates, params object[] args)
public static void TryInvokeAll(this IEnumerable<Delegate>? delegates, params object[] args)
{
if (!delegates.Any())
if (!delegates?.Any() ?? true)
return;

var exceptions = new List<Exception>();

foreach (var handler in delegates)
foreach (var handler in delegates!)
{
try
{
Expand All @@ -338,8 +338,8 @@ public static void TryInvokeAll(this IEnumerable<Delegate> delegates, params obj
/// <param name="del">The <see cref="Task"/>-returning delegate to safely invoke.</param>
/// <param name="args">The arguments for the invocation.</param>
/// <exception cref="AggregateException">Thrown when any invoked methods threw. Contains all nested Exceptions.</exception>
public static Task TryInvokeAllAsync(this Delegate del, params object[] args)
=> del.GetInvocationList().TryInvokeAllAsync(args);
public static Task TryInvokeAllAsync(this Delegate? del, params object[] args)
=> del?.GetInvocationList().TryInvokeAllAsync(args) ?? Task.CompletedTask;

/// <summary>
/// Sequentially calls and awaits all given <paramref name="delegates"/>
Expand All @@ -349,14 +349,14 @@ public static Task TryInvokeAllAsync(this Delegate del, params object[] args)
/// <param name="delegates">The <see cref="Task"/>-returning delegates to safely invoke.</param>
/// <param name="args">The arguments for the invocation.</param>
/// <exception cref="AggregateException">Thrown when any invoked methods threw. Contains all nested Exceptions.</exception>
public static async Task TryInvokeAllAsync(this IEnumerable<Delegate> delegates, params object[] args)
public static async Task TryInvokeAllAsync(this IEnumerable<Delegate>? delegates, params object[] args)
{
if (!delegates.Any())
if (!delegates?.Any() ?? true)
return;

var exceptions = new List<Exception>();

foreach (var handler in delegates)
foreach (var handler in delegates!)
{
try
{
Expand Down
6 changes: 3 additions & 3 deletions MonkeyLoader/Meta/LocationConfigSection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ namespace MonkeyLoader.Meta
/// </summary>
public sealed class LocationConfigSection : ConfigSection
{
public readonly DefiningConfigKey<string> ConfigsKey = new("Configs", "Paths to check for configuration files.", () => "./MonkeyLoader/Configs", valueValidator: PathValidator);
public readonly DefiningConfigKey<string> GamePacksKey = new("GamePacks", "Paths to check for game packs.", () => "./MonkeyLoader/GamePacks", valueValidator: PathValidator);
public readonly DefiningConfigKey<string> LibsKey = new("Libs", "Paths to check for dependency libraries.", () => "./MonkeyLoader/Libs", valueValidator: PathValidator);
public readonly DefiningConfigKey<string> ConfigsKey = new("Configs", "Path to check for configuration files.", () => "./MonkeyLoader/Configs", valueValidator: PathValidator);
public readonly DefiningConfigKey<string> GamePacksKey = new("GamePacks", "Path to check for game packs.", () => "./MonkeyLoader/GamePacks", valueValidator: PathValidator);
public readonly DefiningConfigKey<string> LibsKey = new("Libs", "Path to check for dependency libraries.", () => "./MonkeyLoader/Libs", valueValidator: PathValidator);
public readonly DefiningConfigKey<List<ModLoadingLocation>> ModsKey = new("Mods", "Loading locations to check for mods.", () => new() { new ModLoadingLocation("./MonkeyLoader/Mods", true, true, "\\.disabled$") }, valueValidator: locations => locations?.Count > 0);
public readonly DefiningConfigKey<string> PatchedAssembliesKey = new("PatchedAssemblies", "Path to save pre-patched assemblies to. Set null to disable.", () => "./MonkeyLoader/PatchedAssemblies", valueValidator: PathValidator);

Expand Down
2 changes: 1 addition & 1 deletion MonkeyLoader/MonkeyLoader.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<Title>MonkeyLoader</Title>
<Authors>Banane9</Authors>
<Version>0.14.2-beta</Version>
<Version>0.15.0-beta</Version>
<Description>A convenience and extendability focused mod loader using NuGet packages.</Description>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageLicenseExpression>LGPL-3.0-or-later</PackageLicenseExpression>
Expand Down
2 changes: 1 addition & 1 deletion docfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
],
"globalMetadata": {
"_appName": "MonkeyLoader",
"_appTitle": "Monkey Loader",
"_appTitle": "MonkeyLoader",
"_enableSearch": true,
"pdf": false,
"sitemap": {
Expand Down

0 comments on commit eb63ffa

Please sign in to comment.