Giter Club home page Giter Club logo

Comments (8)

Meivyn avatar Meivyn commented on July 1, 2024 2

It should be fixed by #97.

from harmonyx.

Meivyn avatar Meivyn commented on July 1, 2024 1

If you use HarmonyX v2.12.0, that's most likely the same issue #79 (comment) which was introduced in reorg. I don't think BepInEx is using the reorg version currently? That was supposed to be fixed with 6e3726f which isn't released yet though.

Using the latest version of HarmonyX produced the same behavior as you when I was using it in our mod loader. Sometimes it was crashing Unity, sometimes it threw a null ref.

You either should use v2.10.2 or wait for the next release. v2.12.0 is broken. And it was released knowing it was broken. For some reason.

from harmonyx.

ManlyMarco avatar ManlyMarco commented on July 1, 2024

Does it work fine when loaded by BepInEx?

from harmonyx.

MarshMello0 avatar MarshMello0 commented on July 1, 2024

Yep seemed to work all fine with with BepInEx_win_x64_5.4.23.1. (I assume HarmonyX is packaged up with it by default)

I created this basic plugin

using System.Reflection;
using BepInEx;

namespace BepInEx_Crash_Test
{
    [BepInPlugin(PluginInfo.PLUGIN_GUID, PluginInfo.PLUGIN_NAME, PluginInfo.PLUGIN_VERSION)]
    public class Plugin : BaseUnityPlugin
    {
        private void Awake()
        {
            // Plugin startup logic
            Logger.LogInfo($"Plugin {PluginInfo.PLUGIN_GUID} is loaded!");

            var assembly = Assembly.GetExecutingAssembly();
            Logger.LogInfo($"This is after calling {nameof(Assembly.GetExecutingAssembly)}, the result was {assembly}");
        }
    }
}

and it showed up all fine in the logs without crashing the game

[Message: BepInEx] BepInEx 5.4.23.1 - VTOLVR (22/05/2024 21:44:57)
[Info : BepInEx] Running under Unity v2020.3.30.2077119
[Info : BepInEx] CLR runtime version: 4.0.30319.42000
[Info : BepInEx] Supports SRE: True
[Info : BepInEx] System platform: Bits64, Windows
[Message: BepInEx] Preloader started
[Info : BepInEx] Loaded 1 patcher method from [BepInEx.Preloader 5.4.23.1]
[Info : BepInEx] 1 patcher plugin loaded
[Info : BepInEx] Patching [UnityEngine.CoreModule] with [BepInEx.Chainloader]
[Message: BepInEx] Preloader finished
[Message: BepInEx] Chainloader ready
[Message: BepInEx] Chainloader started
[Info : BepInEx] 1 plugin to load
[Info : BepInEx] Loading [BepInEx_Crash_Test 1.0.0]
[Info :BepInEx_Crash_Test] Plugin BepInEx_Crash_Test is loaded!
[Info :BepInEx_Crash_Test] This is after calling GetExecutingAssembly, the result was BepInEx_Crash_Test, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
[Message: BepInEx] Chainloader startup complete

from harmonyx.

ManlyMarco avatar ManlyMarco commented on July 1, 2024

I assume HarmonyX is packaged up with it by default

Yes, it is. This means you're missing something in your launcher then.

from harmonyx.

MarshMello0 avatar MarshMello0 commented on July 1, 2024

When you say something, are you meaning maybe an assembly? Comparing with dependencies HarmonyX brings in through Nuget vs what I have installed, there isn't anything missing.

Adding this just for context of the thread, now weirdly having:

var path = Assembly.GetExecutingAssembly();
Debug.Log(path);

Throw a null error in debug.log, even though decompiled dll shows its got a null check
image

NullReferenceException: Object reference not set to an instance of an object
  at UnityEngine.Logger.GetString (System.Object message) [0x00032] in <72b60a3dd8cd4f12a155b761a1af9144>:0 
  at UnityEngine.Logger.Log (UnityEngine.LogType logType, System.Object message) [0x00012] in <72b60a3dd8cd4f12a155b761a1af9144>:0 
  at UnityEngine.Debug.Log (System.Object message) [0x00006] in <72b60a3dd8cd4f12a155b761a1af9144>:0 
  at Pop.HelmetPop+<LoadAudioClip>d__2.MoveNext () [0x00030] in <62d0a4dbf2a34d38ba2e27292f55322c>:0 
  at UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) [0x00026] in <72b60a3dd8cd4f12a155b761a1af9144>:0 

from harmonyx.

ManlyMarco avatar ManlyMarco commented on July 1, 2024

I don't think BepInEx is using the reorg version currently?

It is not using it yet. This might be fixed by #114 ?

from harmonyx.

MarshMello0 avatar MarshMello0 commented on July 1, 2024

Added HarmonyX source to my project and compiled at the current latest on master. Ran it three times and it didn't crash!

Closing this as I've confirmed its fixed for me. Thank you so much @Meivyn for that insight

from harmonyx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.