Skip to content

Commit

Permalink
Merge branch 'develop' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
Pathoschild committed Jan 17, 2022
2 parents 1b9ff9c + dbed028 commit 451b709
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 16 deletions.
2 changes: 1 addition & 1 deletion build/common.targets
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!--set general build properties -->
<Version>3.13.3</Version>
<Version>3.13.4</Version>
<Product>SMAPI</Product>
<LangVersion>latest</LangVersion>
<AssemblySearchPaths>$(AssemblySearchPaths);{GAC}</AssemblySearchPaths>
Expand Down
8 changes: 7 additions & 1 deletion docs/release-notes.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
[README](README.md)

# Release notes
## 3.13.4
Released 16 January 2022 for Stardew Valley 1.5.6 or later.

* For players:
* Fixed Linux/macOS launch error in 3.13.3.

## 3.13.3
Released 16 January 2021 for Stardew Valley 1.5.6 or later.
Released 16 January 2022 for Stardew Valley 1.5.6 or later.

* For players:
* **SMAPI now needs Stardew Valley 1.5.6 or later.**
Expand Down
4 changes: 2 additions & 2 deletions src/SMAPI.Mods.ConsoleCommands/manifest.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"Name": "Console Commands",
"Author": "SMAPI",
"Version": "3.13.3",
"Version": "3.13.4",
"Description": "Adds SMAPI console commands that let you manipulate the game.",
"UniqueID": "SMAPI.ConsoleCommands",
"EntryDll": "ConsoleCommands.dll",
"MinimumApiVersion": "3.13.3"
"MinimumApiVersion": "3.13.4"
}
4 changes: 2 additions & 2 deletions src/SMAPI.Mods.ErrorHandler/manifest.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"Name": "Error Handler",
"Author": "SMAPI",
"Version": "3.13.3",
"Version": "3.13.4",
"Description": "Handles some common vanilla errors to log more useful info or avoid breaking the game.",
"UniqueID": "SMAPI.ErrorHandler",
"EntryDll": "ErrorHandler.dll",
"MinimumApiVersion": "3.13.3"
"MinimumApiVersion": "3.13.4"
}
4 changes: 2 additions & 2 deletions src/SMAPI.Mods.SaveBackup/manifest.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"Name": "Save Backup",
"Author": "SMAPI",
"Version": "3.13.3",
"Version": "3.13.4",
"Description": "Automatically backs up all your saves once per day into its folder.",
"UniqueID": "SMAPI.SaveBackup",
"EntryDll": "SaveBackup.dll",
"MinimumApiVersion": "3.13.3"
"MinimumApiVersion": "3.13.4"
}
2 changes: 1 addition & 1 deletion src/SMAPI/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ internal static class EarlyConstants
internal static int? LogScreenId { get; set; }

/// <summary>SMAPI's current raw semantic version.</summary>
internal static string RawApiVersion = "3.13.3";
internal static string RawApiVersion = "3.13.4";
}

/// <summary>Contains SMAPI's constants and assumptions.</summary>
Expand Down
38 changes: 31 additions & 7 deletions src/SMAPI/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
Expand All @@ -16,7 +17,10 @@ internal class Program
** Fields
*********/
/// <summary>The absolute path to search for SMAPI's internal DLLs.</summary>
internal static readonly string DllSearchPath = EarlyConstants.InternalFilesPath;
private static readonly string DllSearchPath = EarlyConstants.InternalFilesPath;

/// <summary>The assembly paths in the search folders indexed by assembly name.</summary>
private static Dictionary<string, string> AssemblyPathsByName;


/*********
Expand Down Expand Up @@ -57,16 +61,36 @@ public static void Main(string[] args)
/// <param name="e">The event arguments.</param>
private static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs e)
{
try
// cache assembly paths by name
if (Program.AssemblyPathsByName == null)
{
AssemblyName name = new AssemblyName(e.Name);
foreach (FileInfo dll in new DirectoryInfo(Program.DllSearchPath).EnumerateFiles("*.dll"))
Program.AssemblyPathsByName = new(StringComparer.OrdinalIgnoreCase);

foreach (string searchPath in new[] { EarlyConstants.ExecutionPath, Program.DllSearchPath })
{
if (name.Name.Equals(AssemblyName.GetAssemblyName(dll.FullName).Name, StringComparison.OrdinalIgnoreCase))
return Assembly.LoadFrom(dll.FullName);
foreach (string dllPath in Directory.EnumerateFiles(searchPath, "*.dll"))
{
try
{
string curName = AssemblyName.GetAssemblyName(dllPath).Name;
if (curName != null)
Program.AssemblyPathsByName[curName] = dllPath;
}
catch
{
continue;
}
}
}
}

return null;
// resolve
try
{
string searchName = new AssemblyName(e.Name).Name;
return searchName != null && Program.AssemblyPathsByName.TryGetValue(searchName, out string assemblyPath)
? Assembly.LoadFrom(assemblyPath)
: null;
}
catch (Exception ex)
{
Expand Down

0 comments on commit 451b709

Please sign in to comment.