MelonLoader

MelonLoader

242 Downloads

[Bug]: Possible incompatibility of Il2CppInterop with generated assemblies

Seva167 opened this issue ยท 1 comments

commented

All of the following criteria must be met

  • All Requirements must be installed.
  • Changed the title so that it doesn't just says "[Bug]: "
  • I have searched the GitHub issues for my bug, even in the closed issues.

All of the following are optional to answer

  • Tried reinstalling the Game.
  • Tried reinstalling MelonLoader.
  • Tried restarting PC.
  • Was able to see the Start Screen.

Describe the issue.

Latest.log
This issue occured when i tried to register class in Il2Cpp that inherits from ingame Il2Cpp type.
Ingame type had virtual method with arguments that have ingame Il2Cpp type.
It looks like all ingame types are in "Il2Cpp" namespace when referencing generated assembly: Il2Cpp.CubeConnector, Assembly-CSharp, while Il2CppInterop ClassInjector tries to find type name and ignores that: CubeConnector, Assembly-CSharp

I fixed it with this patch:

[HarmonyPatch(typeof(ClassInjector), "GetIl2CppTypeFullName")]
internal static class ClassInjectorPatch
{
    public static void Postfix(ref string __result)
    {
        if (__result.Contains("Assembly-CSharp"))
        {
            __result = "Il2Cpp." + __result;
            MelonLogger.Msg(__result);
        }
    }
}

Did you attach your log file?

Yes, I attached my log file to the text box above.

commented

Should be fixed in the upcoming v0.6.5 update