LethalMods / LethalExpansionCore

MIT License
7 stars 4 forks source link

[compatibility issues]NullReferenceException issues when running with BepInEx_MLLoader #9

Closed legionofnod closed 8 months ago

legionofnod commented 8 months ago

It seems that the mod gets an error when coexisting with BepInEx_MLLoader. This error causes the plugin to fail to load

The console logs are as follows :

[Info : BepInEx] Loading [LethalExpansion(core) 1.3.14] [Info :LethalExpansion(core)] Plugin: LethalExpansion(core) (version: 1.3.14) is loading... [Error : Unity Log] NullReferenceException: Object reference not set to an instance of an object Stack trace: MelonLoader.MonoInternals.ResolveInternals.AssemblyManager+<>c.b__1_0 (System.Object sender, System.ResolveEventArgs args) (at <25dbf314fe56482eac5c1b90ce520669>:IL_0025) System.AppDomain.DoAssemblyResolve (System.String name, System.Reflection.Assembly requestingAssembly, System.Boolean refonly) (at <787acc3c9a4c471ba7d971300105af24>:IL_0075) System.AppDomain.Load (System.String assemblyString, System.Security.Policy.Evidence assemblySecurity, System.Boolean refonly, System.Threading.StackCrawlMark& stackMark) (at <787acc3c9a4c471ba7d971300105af24>:IL_0021) System.AppDomain.Load (System.String assemblyString) (at <787acc3c9a4c471ba7d971300105af24>:IL_0002) (wrapper remoting-invoke-with-check) System.AppDomain.Load(string) LethalExpansionCore.LethalExpansion.LoadLethalExpansion () (at <6046be4366b84619b0b5d79efa41a0ce>:IL_0005) LethalExpansionCore.LethalExpansion.Awake () (at <6046be4366b84619b0b5d79efa41a0ce>:IL_0051) UnityEngine.GameObject:AddComponent(Type) BepInEx.Bootstrap.Chainloader:Start() UnityEngine.Rendering.HighDefinition.HDRenderPipelineAsset:OnEnable()

21Joakim commented 8 months ago

I am not familiar with how MelonLoader works but I can look into it, I might need some more context though. Do you also have LethalExpansion installed or just LethalExpansionCore?

UPDATE: From skimming the source code I am guessing you don't have LethalExpansion installed and installing LethalExpansion would probably fix it, the issue seems more like it's something on BepInEx_MLLoader's end

legionofnod commented 8 months ago

This error occurs regardless of whether LethalExpansion (1.3.19) is installed or not But when LethalExpansion was installed, some functionality was restored, although core still reported the same error When LethalExpansion was installed, There is no mod setting in the main page and some custom maps are loaded correctly

Also thanks for making the core. This really solves a lot of the original problem

21Joakim commented 8 months ago

Could you send the full log of when you have both LethalExpansion and LethalExpansionCore installed?

legionofnod commented 8 months ago

Here's the full log. Includes starting the game, selecting online mode, creating lobbies, ending the game

I logged installing both and just core. LogLevels = All Log(WITH LethalExpansion).zip Log(WITHOUT LethalExpansion).zip

I hope that helps.

UPDATE: Oh, and here's a list of the mod I've installed. {B6BFF029-A170-45b4-B72F-9272FA27C287}

21Joakim commented 8 months ago

This error occurs regardless of whether LethalExpansion (1.3.19) is installed or not

I don't see the original error you posted when you have LethalExpansion installed, only these three (see below), which aren't related to LethalExpansionCore so I think my original observation is probably correct. I will see if there's anything I can do about it on my end or if it's something BepInEx_MLLoader would have to fix, for now you can just have LethalExpansion installed and it should work on LethalExpansionCore's end

But when LethalExpansion was installed, some functionality was restored

What do you mean with some functionality? What was restored and what wasn't?

Remaining Errors

[Error  : Unity Log] FileNotFoundException: Could not load file or assembly 'XUnity.Common, Version=1.0.3.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
Stack trace:
UnityEngine.GameObject:AddComponent()
XUnity.AutoTranslator.Plugin.Core.PluginLoader:LoadWithConfig(IPluginEnvironment)
XUnity.AutoTranslator.Plugin.BepInEx.AutoTranslatorPlugin:Awake()
UnityEngine.GameObject:AddComponent(Type)
BepInEx.Bootstrap.Chainloader:Start()
UnityEngine.Rendering.HighDefinition.HDRenderPipelineAsset:OnEnable()

[Error  : Unity Log] FileNotFoundException: Could not load file or assembly 'XUnity.Common, Version=1.0.3.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
Stack trace:

[Error  : Unity Log] TypeLoadException: Failure has occurred while loading a type.
Stack trace:
Pinger.Plugin.StartLogicLoop () (at <dd0add877db043699ee3c5fe66d1af82>:IL_01E2)
System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__7_0 (System.Object state) (at <787acc3c9a4c471ba7d971300105af24>:IL_0000)
UnityEngine.UnitySynchronizationContext+WorkRequest.Invoke () (at <e27997765c1848b09d8073e5d642717a>:IL_0002)
UnityEngine.UnitySynchronizationContext.Exec () (at <e27997765c1848b09d8073e5d642717a>:IL_005D)
UnityEngine.UnitySynchronizationContext.ExecuteTasks () (at <e27997765c1848b09d8073e5d642717a>:IL_0014)
legionofnod commented 8 months ago

Sorry for not replying in time. There were some avoidable problems in the previous reply that perhaps interfered with fixing the error

What do you mean with some functionality? What was restored and what wasn't? Because I didn't have time to do a full functional test of the game yesterday. So I thought at the time that the mod's functionality looked like it was restored. Currently it seems that when LethalExpansionCore and LethalExpansion are installed at the same time, everything in core will function normally again. Including the core version number in the bottom left corner of the main page. Blocking the modsetting that comes with LethalExpansion. adding custom moons and scrap functions also works fine I think installing LethalExpansion at the same time would solve the problem for now.

PS: I'm wondering if, based on the version number of your mod, I should stop updating LethalExpansion's version after that?

Remaining Errors These errors have nothing to do with LethalExpansion or the core. The first two are problems with the auto-translation module The last one is a problem with the pinger module, which I forgot to remove

Thanks again for the mod!

21Joakim commented 8 months ago

PS: I'm wondering if, based on the version number of your mod, I should stop updating LethalExpansion's version after that?

The original plan was to have the LethalExpansionCore version reflect the LethalExpansion version by having an extra digit, e.g, 1.3.14.1 but thunderstore did not allow that, right now the version is completely unrelated to LethalExpansion's version, LECore's 1.3.14 is up to date with LE's 1.3.18