diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-01-16 16:10:57 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-01-16 16:10:57 -0500 |
commit | 6adf199987a506f8a65f6c1ddfad5aa9fa2a6a9f (patch) | |
tree | faa9155fae99533110853567003325486f208937 /src/StardewModdingAPI/Framework/AssemblyRewriting | |
parent | e8825947ca82c8f28ad9bc8a225fb4fb749814cb (diff) | |
parent | 1f3d3c8c93c7a427486b60cf649b86cef140e88b (diff) | |
download | SMAPI-6adf199987a506f8a65f6c1ddfad5aa9fa2a6a9f.tar.gz SMAPI-6adf199987a506f8a65f6c1ddfad5aa9fa2a6a9f.tar.bz2 SMAPI-6adf199987a506f8a65f6c1ddfad5aa9fa2a6a9f.zip |
Merge branch 'develop' into stable
Diffstat (limited to 'src/StardewModdingAPI/Framework/AssemblyRewriting')
-rw-r--r-- | src/StardewModdingAPI/Framework/AssemblyRewriting/CacheEntry.cs | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/StardewModdingAPI/Framework/AssemblyRewriting/CacheEntry.cs b/src/StardewModdingAPI/Framework/AssemblyRewriting/CacheEntry.cs index a747eaa8..4c3b86fe 100644 --- a/src/StardewModdingAPI/Framework/AssemblyRewriting/CacheEntry.cs +++ b/src/StardewModdingAPI/Framework/AssemblyRewriting/CacheEntry.cs @@ -1,4 +1,5 @@ using System.IO; +using StardewModdingAPI.AssemblyRewriters; namespace StardewModdingAPI.Framework.AssemblyRewriting { @@ -14,6 +15,12 @@ namespace StardewModdingAPI.Framework.AssemblyRewriting /// <summary>The SMAPI version used to rewrite the assembly.</summary> public readonly string ApiVersion; + /// <summary>The target platform.</summary> + public readonly Platform Platform; + + /// <summary>The <see cref="System.Environment.MachineName"/> value for the machine used to rewrite the assembly.</summary> + public readonly string MachineName; + /// <summary>Whether to use the cached assembly instead of the original assembly.</summary> public readonly bool UseCachedAssembly; @@ -24,11 +31,15 @@ namespace StardewModdingAPI.Framework.AssemblyRewriting /// <summary>Construct an instance.</summary> /// <param name="hash">The MD5 hash for the original assembly.</param> /// <param name="apiVersion">The SMAPI version used to rewrite the assembly.</param> + /// <param name="platform">The target platform.</param> + /// <param name="machineName">The <see cref="System.Environment.MachineName"/> value for the machine used to rewrite the assembly.</param> /// <param name="useCachedAssembly">Whether to use the cached assembly instead of the original assembly.</param> - public CacheEntry(string hash, string apiVersion, bool useCachedAssembly) + public CacheEntry(string hash, string apiVersion, Platform platform, string machineName, bool useCachedAssembly) { this.Hash = hash; this.ApiVersion = apiVersion; + this.Platform = platform; + this.MachineName = machineName; this.UseCachedAssembly = useCachedAssembly; } @@ -36,10 +47,14 @@ namespace StardewModdingAPI.Framework.AssemblyRewriting /// <param name="paths">The paths for the cached assembly.</param> /// <param name="hash">The MD5 hash of the original assembly.</param> /// <param name="currentVersion">The current SMAPI version.</param> - public bool IsUpToDate(CachePaths paths, string hash, ISemanticVersion currentVersion) + /// <param name="platform">The target platform.</param> + /// <param name="machineName">The <see cref="System.Environment.MachineName"/> value for the machine reading the assembly.</param> + public bool IsUpToDate(CachePaths paths, string hash, ISemanticVersion currentVersion, Platform platform, string machineName) { return hash == this.Hash && this.ApiVersion == currentVersion.ToString() + && this.Platform == platform + && this.MachineName == machineName && (!this.UseCachedAssembly || File.Exists(paths.Assembly)); } } |