Comments (5)
There are a few reasons why this is, mostly that HarmonyX is binary compatible with any mod that uses the original Harmony 2 when loaded in its place. The intended case here is to just outright replace the original Harmony DLL if you need HarmonyX for something, like UnityExplorer apparently does.
As for changing the assembly name, that is an obviously breaking change for anything that currently uses HarmonyX, and loading both Harmony and HarmonyX if you were to allow it would break a multitude of things in silent ways if the community at large were to begin to depend on both seperately. Communities are forced to chose one or the other because doing otherwise will break things.
It seems UnityExplorer might just be compiled against HarmonyX where it could compile against Harmony (mods compiled against HarmonyX are not binary compatible with Harmony sometimes, due to a few extra method overloads, like the Patch method UnityExplorer is looking for in that stack trace). So if you wanted to use it with the original Harmony instead of swapping for HarmonyX, you can just swap out the dependency for Harmony and recompile and it (should?) work fine.
from harmonyx.
There are a few reasons why this is, mostly that HarmonyX is binary compatible with any mod that uses the original Harmony 2 when loaded in its place.
Unfortunately that logic is flawed, as the reverse isn't true. Since HarmonyX implements features not available in the original Harmony, Harmony can't be used as a replacement. UnityExplorer make heavy use of some HarmonyX-only features like extern
method patching.
from harmonyx.
Why does the reverse need to be true? In cases where it is used, HarmonyX is intended to be the replacement for Harmony, not the other way around.
from harmonyx.
Why does the reverse need to be true?
Well, in the game I'm targeting (KSP), Harmony (original fork) is the norm. Trying to make everyone update to HarmonyX instead is doable but I would rather not go that route unless there are no other options.
from harmonyx.
Greetings!
As @Windows10CE mentioned, one of the project goals is to introduce features, improve the core patching process and extend the original patching targets while maintaining compatibility with patches written for Harmony 2. As per the README, one of the features is:
Patching feature parity with Harmony while reducing code duplication using MonoMod.RuntimeDetour
More goals and differences are listed in the wiki, but one of the main ones was to maintain binary compatibility. In other words, plugins originally written for Harmony can be run with HarmonyX without recompiling. This was done because many plugins for BepInEx (the modding framework that HarmonyX was made for originally) used Harmony. We had some basic shims at some time, but maintaining them became much harder than the changes we wanted to make to Harmony. This allowed us to add features that otherwise wouldn't get PR'd into Harmony or that would get in, but we would have to wait for months for a release.
As said, the project's goal is to maintain binary compatibility from Harmony, not the other way around. We aim to maintain this approach, so this request is a wontfix. We already have had similar situations of people trying to use mixed assemblies, and in those cases, we have suggested doing one of the following:
- Switch to HarmonyX. It's specifically aimed at Unity games, is binary compatible with Harmony and has a much faster release schedule. If you have compatibility issues (e.g. something that worked in Harmony doesn't work in HarmonyX), feel free to create an issue with the specific case.
- Use Harmony. If the community already uses Harmony extensively, continue to use it. If any tools are written for HarmonyX, switching back to Harmony can require a bit of code editing (most of the features can be shimmed via MonoMod.RuntimeDetour), but overall is not an impossible task.
- Feel free to fork HarmonyX and change it to your needs/tastes. That said, we welcome PRs and try to get features into upstream Harmony as well (e.g.
EmitDelegate
was originally from HarmonyX but is now in upstream).
To summarise, this is a big wontfix. Even if we ignore that changing the assembly name and namespaces is a breaking change, it will go against our goal for binary compatibility with Harmony API. I'll close this issue as such, but feel free to continue the conversation.
from harmonyx.
Related Issues (20)
- [Wiki] Typos in section 1.4 HOT 1
- [Wiki] Error using the provided postfix in section 1.4 HOT 1
- When will v2.11.0 be published on NuGet? HOT 2
- Android IL2CPP Support
- v2.11.0: patch with "ref string" on "static external" method produces garbage HOT 5
- Harmony doesn't work when path contains non-ANSI characters HOT 1
- How do I call a private function within a postpatch HOT 8
- How do I find the asset directory of stuff stored in a unity game? HOT 1
- Reverse patches appears to be broken
- Assembly.GetExecutingAssembly causing game to crash HOT 8
- Does it support NET6? HOT 1
- Label Jump HOT 2
- Empty Transpiler Causing Issues HOT 1
- How to override explicit interface methods? HOT 1
- When did it start to support net 7 or 8? HOT 1
- Cannot unpatch extern method patch
- Patching ref parameter with IL2Cpp results in invalid IL
- Usage with unity
- Empty Harmony Annotations Cause ArguementException: No Target Method Found HOT 2
- Skipping a patch when a method isnt found HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from harmonyx.