summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build/0Harmony.dllbin115200 -> 166912 bytes
-rw-r--r--build/0Harmony.xml3130
-rw-r--r--build/common.targets6
-rw-r--r--build/prepare-install-package.targets4
-rw-r--r--docs/release-notes.md20
-rw-r--r--docs/technical/smapi.md1
-rw-r--r--src/SMAPI.Installer/InteractiveInstaller.cs3
-rw-r--r--src/SMAPI.Internal.Patching/BasePatcher.cs54
-rw-r--r--src/SMAPI.Internal.Patching/HarmonyPatcher.cs36
-rw-r--r--src/SMAPI.Internal.Patching/IPatcher.cs16
-rw-r--r--src/SMAPI.Internal.Patching/PatchHelper.cs77
-rw-r--r--src/SMAPI.Internal.Patching/SMAPI.Internal.Patching.projitems17
-rw-r--r--src/SMAPI.Internal.Patching/SMAPI.Internal.Patching.shproj13
-rw-r--r--src/SMAPI.Internal/ExceptionExtensions.cs41
-rw-r--r--src/SMAPI.Internal/SMAPI.Internal.projitems1
-rw-r--r--src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/ClearCommand.cs10
-rw-r--r--src/SMAPI.Mods.ConsoleCommands/manifest.json4
-rw-r--r--src/SMAPI.Mods.ErrorHandler/ModEntry.cs40
-rw-r--r--src/SMAPI.Mods.ErrorHandler/Patches/DialogueErrorPatch.cs184
-rw-r--r--src/SMAPI.Mods.ErrorHandler/Patches/DialoguePatcher.cs75
-rw-r--r--src/SMAPI.Mods.ErrorHandler/Patches/DictionaryPatcher.cs75
-rw-r--r--src/SMAPI.Mods.ErrorHandler/Patches/EventPatcher.cs (renamed from src/SMAPI.Mods.ErrorHandler/Patches/EventPatches.cs)26
-rw-r--r--src/SMAPI.Mods.ErrorHandler/Patches/GameLocationPatcher.cs79
-rw-r--r--src/SMAPI.Mods.ErrorHandler/Patches/GameLocationPatches.cs158
-rw-r--r--src/SMAPI.Mods.ErrorHandler/Patches/IClickableMenuPatcher.cs44
-rw-r--r--src/SMAPI.Mods.ErrorHandler/Patches/LoadErrorPatch.cs150
-rw-r--r--src/SMAPI.Mods.ErrorHandler/Patches/NpcPatcher.cs85
-rw-r--r--src/SMAPI.Mods.ErrorHandler/Patches/ObjectErrorPatch.cs136
-rw-r--r--src/SMAPI.Mods.ErrorHandler/Patches/ObjectPatcher.cs71
-rw-r--r--src/SMAPI.Mods.ErrorHandler/Patches/SaveGamePatcher.cs145
-rw-r--r--src/SMAPI.Mods.ErrorHandler/Patches/ScheduleErrorPatch.cs108
-rw-r--r--src/SMAPI.Mods.ErrorHandler/Patches/SpriteBatchPatcher.cs (renamed from src/SMAPI.Mods.ErrorHandler/Patches/SpriteBatchValidationPatches.cs)30
-rw-r--r--src/SMAPI.Mods.ErrorHandler/Patches/UtilityErrorPatches.cs89
-rw-r--r--src/SMAPI.Mods.ErrorHandler/Patches/UtilityPatcher.cs43
-rw-r--r--src/SMAPI.Mods.ErrorHandler/SMAPI.Mods.ErrorHandler.csproj2
-rw-r--r--src/SMAPI.Mods.ErrorHandler/manifest.json4
-rw-r--r--src/SMAPI.Mods.SaveBackup/manifest.json4
-rw-r--r--src/SMAPI.Toolkit/Framework/LowLevelEnvironmentUtility.cs9
-rw-r--r--src/SMAPI.Toolkit/SMAPI.Toolkit.csproj2
-rw-r--r--src/SMAPI.sln6
-rw-r--r--src/SMAPI.sln.DotSettings2
-rw-r--r--src/SMAPI/Constants.cs15
-rw-r--r--src/SMAPI/Framework/Commands/HarmonySummaryCommand.cs26
-rw-r--r--src/SMAPI/Framework/Content/AssetInterceptorChange.cs1
-rw-r--r--src/SMAPI/Framework/ContentManagers/GameContentManager.cs1
-rw-r--r--src/SMAPI/Framework/ContentManagers/ModContentManager.cs5
-rw-r--r--src/SMAPI/Framework/Events/ManagedEvent.cs1
-rw-r--r--src/SMAPI/Framework/InternalExtensions.cs35
-rw-r--r--src/SMAPI/Framework/Logging/LogManager.cs8
-rw-r--r--src/SMAPI/Framework/ModLoading/RewriteFacades/AccessToolsFacade.cs2
-rw-r--r--src/SMAPI/Framework/ModLoading/RewriteFacades/HarmonyInstanceFacade.cs2
-rw-r--r--src/SMAPI/Framework/ModLoading/RewriteFacades/HarmonyMethodFacade.cs2
-rw-r--r--src/SMAPI/Framework/ModLoading/Rewriters/Harmony1AssemblyRewriter.cs65
-rw-r--r--src/SMAPI/Framework/Patching/GamePatcher.cs53
-rw-r--r--src/SMAPI/Framework/Patching/IHarmonyPatch.cs23
-rw-r--r--src/SMAPI/Framework/Patching/PatchHelper.cs36
-rw-r--r--src/SMAPI/Framework/Reflection/InterfaceProxyFactory.cs33
-rw-r--r--src/SMAPI/Framework/SCore.cs19
-rw-r--r--src/SMAPI/Framework/SGame.cs1
-rw-r--r--src/SMAPI/Framework/TemporaryHacks/MiniMonoModHotfix.cs239
-rw-r--r--src/SMAPI/Metadata/CoreAssetPropagator.cs17
-rw-r--r--src/SMAPI/Metadata/InstructionMetadata.cs8
-rw-r--r--src/SMAPI/Patches/Game1Patcher.cs (renamed from src/SMAPI/Patches/LoadContextPatch.cs)83
-rw-r--r--src/SMAPI/Patches/TitleMenuPatcher.cs55
-rw-r--r--src/SMAPI/Program.cs32
-rw-r--r--src/SMAPI/Properties/AssemblyInfo.cs1
-rw-r--r--src/SMAPI/SMAPI.csproj4
67 files changed, 4570 insertions, 1197 deletions
diff --git a/build/0Harmony.dll b/build/0Harmony.dll
index 2e893d0e..bab3bb4d 100644
--- a/build/0Harmony.dll
+++ b/build/0Harmony.dll
Binary files differ
diff --git a/build/0Harmony.xml b/build/0Harmony.xml
new file mode 100644
index 00000000..ba2f340e
--- /dev/null
+++ b/build/0Harmony.xml
@@ -0,0 +1,3130 @@
+<?xml version="1.0"?>
+<doc>
+ <assembly>
+ <name>0Harmony</name>
+ </assembly>
+ <members>
+ <member name="T:HarmonyLib.DelegateTypeFactory">
+ <summary>A factory to create delegate types</summary>
+ </member>
+ <member name="M:HarmonyLib.DelegateTypeFactory.#ctor">
+ <summary>Default constructor</summary>
+ </member>
+ <member name="M:HarmonyLib.DelegateTypeFactory.CreateDelegateType(System.Reflection.MethodInfo)">
+ <summary>Creates a delegate type for a method</summary>
+ <param name="method">The method</param>
+ <returns>The new delegate type</returns>
+
+ </member>
+ <member name="T:HarmonyLib.GetterHandler`2">
+ <summary>A getter delegate type</summary>
+ <typeparam name="T">Type that getter gets field/property value from</typeparam>
+ <typeparam name="S">Type of the value that getter gets</typeparam>
+ <param name="source">The instance get getter uses</param>
+ <returns>An delegate</returns>
+
+ </member>
+ <member name="T:HarmonyLib.SetterHandler`2">
+ <summary>A setter delegate type</summary>
+ <typeparam name="T">Type that setter sets field/property value for</typeparam>
+ <typeparam name="S">Type of the value that setter sets</typeparam>
+ <param name="source">The instance the setter uses</param>
+ <param name="value">The value the setter uses</param>
+ <returns>An delegate</returns>
+
+ </member>
+ <member name="T:HarmonyLib.InstantiationHandler`1">
+ <summary>A constructor delegate type</summary>
+ <typeparam name="T">Type that constructor creates</typeparam>
+ <returns>An delegate</returns>
+
+ </member>
+ <member name="T:HarmonyLib.FastAccess">
+ <summary>A helper class for fast access to getters and setters</summary>
+ </member>
+ <member name="M:HarmonyLib.FastAccess.CreateInstantiationHandler``1">
+ <summary>Creates an instantiation delegate</summary>
+ <typeparam name="T">Type that constructor creates</typeparam>
+ <returns>The new instantiation delegate</returns>
+
+ </member>
+ <member name="M:HarmonyLib.FastAccess.CreateGetterHandler``2(System.Reflection.PropertyInfo)">
+ <summary>Creates an getter delegate for a property</summary>
+ <typeparam name="T">Type that getter reads property from</typeparam>
+ <typeparam name="S">Type of the property that gets accessed</typeparam>
+ <param name="propertyInfo">The property</param>
+ <returns>The new getter delegate</returns>
+
+ </member>
+ <member name="M:HarmonyLib.FastAccess.CreateGetterHandler``2(System.Reflection.FieldInfo)">
+ <summary>Creates an getter delegate for a field</summary>
+ <typeparam name="T">Type that getter reads field from</typeparam>
+ <typeparam name="S">Type of the field that gets accessed</typeparam>
+ <param name="fieldInfo">The field</param>
+ <returns>The new getter delegate</returns>
+
+ </member>
+ <member name="M:HarmonyLib.FastAccess.CreateFieldGetter``2(System.String[])">
+ <summary>Creates an getter delegate for a field (with a list of possible field names)</summary>
+ <typeparam name="T">Type that getter reads field/property from</typeparam>
+ <typeparam name="S">Type of the field/property that gets accessed</typeparam>
+ <param name="names">A list of possible field names</param>
+ <returns>The new getter delegate</returns>
+
+ </member>
+ <member name="M:HarmonyLib.FastAccess.CreateSetterHandler``2(System.Reflection.PropertyInfo)">
+ <summary>Creates an setter delegate</summary>
+ <typeparam name="T">Type that setter assigns property value to</typeparam>
+ <typeparam name="S">Type of the property that gets assigned</typeparam>
+ <param name="propertyInfo">The property</param>
+ <returns>The new setter delegate</returns>
+
+ </member>
+ <member name="M:HarmonyLib.FastAccess.CreateSetterHandler``2(System.Reflection.FieldInfo)">
+ <summary>Creates an setter delegate for a field</summary>
+ <typeparam name="T">Type that setter assigns field value to</typeparam>
+ <typeparam name="S">Type of the field that gets assigned</typeparam>
+ <param name="fieldInfo">The field</param>
+ <returns>The new getter delegate</returns>
+
+ </member>
+ <member name="T:HarmonyLib.FastInvokeHandler">
+ <summary>A delegate to invoke a method</summary>
+ <param name="target">The instance</param>
+ <param name="parameters">The method parameters</param>
+ <returns>The method result</returns>
+ </member>
+ <member name="T:HarmonyLib.MethodInvoker">
+ <summary>A helper class to invoke method with delegates</summary>
+ </member>
+ <member name="M:HarmonyLib.MethodInvoker.GetHandler(System.Reflection.MethodInfo,System.Boolean)">
+ <summary>Creates a fast invocation handler from a method</summary>
+ <param name="methodInfo">The method to invoke</param>
+ <param name="directBoxValueAccess">Controls if boxed value object is accessed/updated directly</param>
+ <returns>The <see cref="T:HarmonyLib.FastInvokeHandler"/></returns>
+ <remarks>
+ <para>
+ The <c>directBoxValueAccess</c> option controls how value types passed by reference (e.g. ref int, out my_struct) are handled in the arguments array
+ passed to the fast invocation handler.
+ Since the arguments array is an object array, any value types contained within it are actually references to a boxed value object.
+ Like any other object, there can be other references to such boxed value objects, other than the reference within the arguments array.
+ <example>For example,
+ <code>
+ var val = 5;
+ var box = (object)val;
+ var arr = new object[] { box };
+ handler(arr); // for a method with parameter signature: ref/out/in int
+ </code>
+ </example>
+ </para>
+ <para>
+ If <c>directBoxValueAccess</c> is <c>true</c>, the boxed value object is accessed (and potentially updated) directly when the handler is called,
+ such that all references to the boxed object reflect the potentially updated value.
+ In the above example, if the method associated with the handler updates the passed (boxed) value to 10, both <c>box</c> and <c>arr[0]</c>
+ now reflect the value 10. Note that the original <c>val</c> is not updated, since boxing always copies the value into the new boxed value object.
+ </para>
+ <para>
+ If <c>directBoxValueAccess</c> is <c>false</c> (default), the boxed value object in the arguments array is replaced with a "reboxed" value object,
+ such that potential updates to the value are reflected only in the arguments array.
+ In the above example, if the method associated with the handler updates the passed (boxed) value to 10, only <c>arr[0]</c> now reflects the value 10.
+ </para>
+ </remarks>
+ </member>
+ <member name="T:HarmonyLib.Memory">
+ <summary>A low level memory helper</summary>
+
+ </member>
+ <member name="M:HarmonyLib.Memory.MarkForNoInlining(System.Reflection.MethodBase)">
+ <summary>Mark method for no inlining (currently only works on Mono)</summary>
+ <param name="method">The method/constructor to change</param>
+
+ </member>
+ <member name="M:HarmonyLib.Memory.DetourMethod(System.Reflection.MethodBase,System.Reflection.MethodBase)">
+ <summary>Detours a method</summary>
+ <param name="original">The original method/constructor</param>
+ <param name="replacement">The replacement method/constructor</param>
+ <returns>An error string</returns>
+
+ </member>
+ <member name="M:HarmonyLib.Memory.WriteJump(System.Int64,System.Int64)">
+ <summary>Writes a jump to memory</summary>
+ <param name="memory">The memory address</param>
+ <param name="destination">Jump destination</param>
+ <returns>An error string</returns>
+
+ </member>
+ <member name="M:HarmonyLib.Memory.GetMethodStart(System.Reflection.MethodBase,System.Exception@)">
+ <summary>Gets the start of a method in memory</summary>
+ <param name="method">The method/constructor</param>
+ <param name="exception">[out] Details of the exception</param>
+ <returns>The method start address</returns>
+
+ </member>
+ <member name="F:HarmonyLib.MethodPatcher.INSTANCE_PARAM">
+ special parameter names that can be used in prefix and postfix methods
+ </member>
+ <member name="T:HarmonyLib.PatchFunctions">
+ <summary>Patch function helpers</summary>
+ </member>
+ <member name="M:HarmonyLib.PatchFunctions.GetSortedPatchMethods(System.Reflection.MethodBase,HarmonyLib.Patch[],System.Boolean)">
+ <summary>Sorts patch methods by their priority rules</summary>
+ <param name="original">The original method</param>
+ <param name="patches">Patches to sort</param>
+ <param name="debug">Use debug mode</param>
+ <returns>The sorted patch methods</returns>
+
+ </member>
+ <member name="M:HarmonyLib.PatchFunctions.UpdateWrapper(System.Reflection.MethodBase,HarmonyLib.PatchInfo)">
+ <summary>Creates new replacement method with the latest patches and detours the original method</summary>
+ <param name="original">The original method</param>
+ <param name="patchInfo">Information describing the patches</param>
+ <returns>The newly created replacement method</returns>
+
+ </member>
+ <member name="M:HarmonyLib.PatchSorter.#ctor(HarmonyLib.Patch[],System.Boolean)">
+ <summary>Creates a patch sorter</summary>
+ <param name="patches">Array of patches that will be sorted</param>
+ <param name="debug">Use debugging</param>
+ </member>
+ <member name="M:HarmonyLib.PatchSorter.Sort(System.Reflection.MethodBase)">
+ <summary>Sorts internal PatchSortingWrapper collection and caches the results.
+ After first run the result is provided from the cache.</summary>
+ <param name="original">The original method</param>
+ <returns>The sorted patch methods</returns>
+ </member>
+ <member name="M:HarmonyLib.PatchSorter.ComparePatchLists(HarmonyLib.Patch[])">
+ <summary>Checks if the sorter was created with the same patch list and as a result can be reused to
+ get the sorted order of the patches.</summary>
+ <param name="patches">List of patches to check against</param>
+ <returns>true if equal</returns>
+ </member>
+ <member name="M:HarmonyLib.PatchSorter.CullDependency">
+ <summary>Removes one unresolved dependency from the least important patch.</summary>
+ </member>
+ <member name="M:HarmonyLib.PatchSorter.ProcessWaitingList">
+ <summary>Outputs all unblocked patches from the waiting list to results list</summary>
+ </member>
+ <member name="M:HarmonyLib.PatchSorter.AddNodeToResult(HarmonyLib.PatchSorter.PatchSortingWrapper)">
+ <summary>Adds patch to both results list and handled patches set</summary>
+ <param name="node">Patch to add</param>
+ </member>
+ <member name="T:HarmonyLib.PatchSorter.PatchSortingWrapper">
+ <summary>Wrapper used over the Patch object to allow faster dependency access and
+ dependency removal in case of cyclic dependencies</summary>
+ </member>
+ <member name="M:HarmonyLib.PatchSorter.PatchSortingWrapper.#ctor(HarmonyLib.Patch)">
+ <summary>Create patch wrapper object used for sorting</summary>
+ <param name="patch">Patch to wrap</param>
+ </member>
+ <member name="M:HarmonyLib.PatchSorter.PatchSortingWrapper.CompareTo(System.Object)">
+ <summary>Determines how patches sort</summary>
+ <param name="obj">The other patch</param>
+ <returns>integer to define sort order (-1, 0, 1)</returns>
+ </member>
+ <member name="M:HarmonyLib.PatchSorter.PatchSortingWrapper.Equals(System.Object)">
+ <summary>Determines whether patches are equal</summary>
+ <param name="obj">The other patch</param>
+ <returns>true if equal</returns>
+ </member>
+ <member name="M:HarmonyLib.PatchSorter.PatchSortingWrapper.GetHashCode">
+ <summary>Hash function</summary>
+ <returns>A hash code</returns>
+ </member>
+ <member name="M:HarmonyLib.PatchSorter.PatchSortingWrapper.AddBeforeDependency(System.Collections.Generic.IEnumerable{HarmonyLib.PatchSorter.PatchSortingWrapper})">
+ <summary>Bidirectionally registers Patches as after dependencies</summary>
+ <param name="dependencies">List of dependencies to register</param>
+ </member>
+ <member name="M:HarmonyLib.PatchSorter.PatchSortingWrapper.AddAfterDependency(System.Collections.Generic.IEnumerable{HarmonyLib.PatchSorter.PatchSortingWrapper})">
+ <summary>Bidirectionally registers Patches as before dependencies</summary>
+ <param name="dependencies">List of dependencies to register</param>
+ </member>
+ <member name="M:HarmonyLib.PatchSorter.PatchSortingWrapper.RemoveAfterDependency(HarmonyLib.PatchSorter.PatchSortingWrapper)">
+ <summary>Bidirectionally removes Patch from after dependencies</summary>
+ <param name="afterNode">Patch to remove</param>
+ </member>
+ <member name="M:HarmonyLib.PatchSorter.PatchSortingWrapper.RemoveBeforeDependency(HarmonyLib.PatchSorter.PatchSortingWrapper)">
+ <summary>Bidirectionally removes Patch from before dependencies</summary>
+ <param name="beforeNode">Patch to remove</param>
+ </member>
+ <member name="T:HarmonyLib.MethodType">
+ <summary>Specifies the type of method</summary>
+
+ </member>
+ <member name="F:HarmonyLib.MethodType.Normal">
+ <summary>This is a normal method</summary>
+ </member>
+ <member name="F:HarmonyLib.MethodType.Getter">
+ <summary>This is a getter</summary>
+ </member>
+ <member name="F:HarmonyLib.MethodType.Setter">
+ <summary>This is a setter</summary>
+ </member>
+ <member name="F:HarmonyLib.MethodType.Constructor">
+ <summary>This is a constructor</summary>
+ </member>
+ <member name="F:HarmonyLib.MethodType.StaticConstructor">
+ <summary>This is a static constructor</summary>
+ </member>
+ <member name="T:HarmonyLib.ArgumentType">
+ <summary>Specifies the type of argument</summary>
+
+ </member>
+ <member name="F:HarmonyLib.ArgumentType.Normal">
+ <summary>This is a normal argument</summary>
+ </member>
+ <member name="F:HarmonyLib.ArgumentType.Ref">
+ <summary>This is a reference argument (ref)</summary>
+ </member>
+ <member name="F:HarmonyLib.ArgumentType.Out">
+ <summary>This is an out argument (out)</summary>
+ </member>
+ <member name="F:HarmonyLib.ArgumentType.Pointer">
+ <summary>This is a pointer argument (&amp;)</summary>
+ </member>
+ <member name="T:HarmonyLib.HarmonyPatchType">
+ <summary>Specifies the type of patch</summary>
+
+ </member>
+ <member name="F:HarmonyLib.HarmonyPatchType.All">
+ <summary>Any patch</summary>
+ </member>
+ <member name="F:HarmonyLib.HarmonyPatchType.Prefix">
+ <summary>A prefix patch</summary>
+ </member>
+ <member name="F:HarmonyLib.HarmonyPatchType.Postfix">
+ <summary>A postfix patch</summary>
+ </member>
+ <member name="F:HarmonyLib.HarmonyPatchType.Transpiler">
+ <summary>A transpiler</summary>
+ </member>
+ <member name="F:HarmonyLib.HarmonyPatchType.Finalizer">
+ <summary>A finalizer</summary>
+ </member>
+ <member name="F:HarmonyLib.HarmonyPatchType.ReversePatch">
+ <summary>A reverse patch</summary>
+ </member>
+ <member name="T:HarmonyLib.HarmonyReversePatchType">
+ <summary>Specifies the type of reverse patch</summary>
+
+ </member>
+ <member name="F:HarmonyLib.HarmonyReversePatchType.Original">
+ <summary>Use the unmodified original method (directly from IL)</summary>
+ </member>
+ <member name="F:HarmonyLib.HarmonyReversePatchType.Snapshot">
+ <summary>Use the original as it is right now including previous patches but excluding future ones</summary>
+ </member>
+ <member name="T:HarmonyLib.MethodDispatchType">
+ <summary>Specifies the type of method call dispatching mechanics</summary>
+
+ </member>
+ <member name="F:HarmonyLib.MethodDispatchType.VirtualCall">
+ <summary>Call the method using dynamic dispatching if method is virtual (including overriden)</summary>
+ <remarks>
+ <para>
+ This is the built-in form of late binding (a.k.a. dynamic binding) and is the default dispatching mechanic in C#.
+ This directly corresponds with the <see cref="F:System.Reflection.Emit.OpCodes.Callvirt"/> instruction.
+ </para>
+ <para>
+ For virtual (including overriden) methods, the instance type's most-derived/overriden implementation of the method is called.
+ For non-virtual (including static) methods, same behavior as <see cref="F:HarmonyLib.MethodDispatchType.Call"/>: the exact specified method implementation is called.
+ </para>
+ <para>
+ Note: This is not a fully dynamic dispatch, since non-virtual (including static) methods are still called non-virtually.
+ A fully dynamic dispatch in C# involves using
+ the <see href="https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/reference-types#the-dynamic-type"><c>dynamic</c> type</see>
+ (actually a fully dynamic binding, since even the name and overload resolution happens at runtime), which <see cref="T:HarmonyLib.MethodDispatchType"/> does not support.
+ </para>
+ </remarks>
+ </member>
+ <member name="F:HarmonyLib.MethodDispatchType.Call">
+ <summary>Call the method using stati