legoandmars / BiggerLobby

Functional version of kermeet's biglobby mod.
MIT License
15 stars 4 forks source link

Bigger Lobby crashes if the path to the executable includes doubles-byte ASCII characters #8

Closed lucasreis1 closed 11 months ago

lucasreis1 commented 11 months ago

Basically title. When the path to the game includes a non-ASCII character (such as Á in Área de Trabalho), loading a DLL crashes the game as Unity fails to convert the string. Here's a quick stack trace:

[Error  : Unity Log] ExecutionEngineException: String conversion error: Illegal byte sequence encounted in the input.
Stack trace:
System.Reflection.RuntimeAssembly.GetCodeBase (System.Reflection.Assembly a, System.Boolean escaped) (at <787acc3c9a4c471ba7d971300105af24>:0)
System.Reflection.RuntimeAssembly.get_CodeBase () (at <787acc3c9a4c471ba7d971300105af24>:0)
System.Reflection.AssemblyName.Create (System.Reflection.Assembly assembly, System.Boolean fillCodebase) (at <787acc3c9a4c471ba7d971300105af24>:0)
System.Reflection.RuntimeAssembly.GetName (System.Boolean copiedName) (at <787acc3c9a4c471ba7d971300105af24>:0)
System.Reflection.Assembly.GetName () (at <787acc3c9a4c471ba7d971300105af24>:0)
MonoMod.Utils.MMReflectionImporter.ImportReference (System.Reflection.Assembly asm) (at <6733e342b5b549bba815373898724469>:0)
MonoMod.Utils.MMReflectionImporter._ImportReference (System.Type type, Mono.Cecil.IGenericParameterProvider context, MonoMod.Utils.MMReflectionImporter+GenericImportKind importKind) (at <6733e342b5b549bba815373898724469>:0)
MonoMod.Utils.MMReflectionImporter._ImportReference (System.Reflection.MethodBase method, Mono.Cecil.IGenericParameterProvider context, MonoMod.Utils.MMReflectionImporter+GenericImportKind importKind) (at <6733e342b5b549bba815373898724469>:0)
MonoMod.Utils.MMReflectionImporter.ImportReference (System.Reflection.MethodBase method, Mono.Cecil.IGenericParameterProvider context) (at <6733e342b5b549bba815373898724469>:0)
Mono.Cecil.ModuleDefinition.ImportReference (System.Reflection.MethodBase method, Mono.Cecil.IGenericParameterProvider context) (at <6034b380a22b41a596c9dc29d282c0a9>:0)
Mono.Cecil.ModuleDefinition.ImportReference (System.Reflection.MethodBase method) (at <6034b380a22b41a596c9dc29d282c0a9>:0)
MonoMod.Utils.DynamicMethodDefinition+<>c__DisplayClass3_0.<_CopyMethodToDefinition>g__ResolveTokenAs|1 (System.Int32 token, MonoMod.Utils.DynamicMethodDefinition+TokenResolutionMode resolveMode) (at <6733e342b5b549bba815373898724469>:0)
MonoMod.Utils.DynamicMethodDefinition+<>c__DisplayClass3_0.<_CopyMethodToDefinition>g__ReadOperand|0 (System.IO.BinaryReader reader, Mono.Cecil.Cil.Instruction instr) (at <6733e342b5b549bba815373898724469>:0)
MonoMod.Utils.DynamicMethodDefinition._CopyMethodToDefinition () (at <6733e342b5b549bba815373898724469>:0)
MonoMod.Utils.DynamicMethodDefinition.Reload () (at <6733e342b5b549bba815373898724469>:0)
MonoMod.Utils.DynamicMethodDefinition..ctor (System.Reflection.MethodBase method) (at <6733e342b5b549bba815373898724469>:0)
(wrapper dynamic-method) MonoMod.RuntimeDetour.ILHook+Context.DMD<MonoMod.RuntimeDetour.ILHook+Context::Refresh>(MonoMod.RuntimeDetour.ILHook/Context)
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition.Trampoline<MonoMod.RuntimeDetour.ILHook+Context::Refresh>?2062355146(object)
HarmonyLib.Internal.RuntimeFixes.StackTraceFixes.OnILChainRefresh (System.Object self) (at <474744d65d8e460fa08cd5fd82b5d65f>:0)
MonoMod.RuntimeDetour.ILHook.Apply () (at <4e2760c7517c4ea79c633d67e84b319f>:0)
HarmonyLib.Public.Patching.ManagedMethodPatcher.DetourTo (System.Reflection.MethodBase replacement) (at <474744d65d8e460fa08cd5fd82b5d65f>:0)
Rethrow as HarmonyException: IL Compile Error (unknown location)
HarmonyLib.Public.Patching.ManagedMethodPatcher.DetourTo (System.Reflection.MethodBase replacement) (at <474744d65d8e460fa08cd5fd82b5d65f>:0)
HarmonyLib.PatchFunctions.UpdateWrapper (System.Reflection.MethodBase original, HarmonyLib.PatchInfo patchInfo) (at <474744d65d8e460fa08cd5fd82b5d65f>:0)
Rethrow as HarmonyException: IL Compile Error (unknown location)
HarmonyLib.PatchClassProcessor.ReportException (System.Exception exception, System.Reflection.MethodBase original) (at <474744d65d8e460fa08cd5fd82b5d65f>:0)
HarmonyLib.PatchClassProcessor.Patch () (at <474744d65d8e460fa08cd5fd82b5d65f>:0)
HarmonyLib.Harmony.PatchAll (System.Type type) (at <474744d65d8e460fa08cd5fd82b5d65f>:0)
BiggerLobby.Plugin.Awake () (at <efbc5c7b754349f49c9a78f1f337d44f>:0)
UnityEngine.GameObject:AddComponent(Type)
BepInEx.Bootstrap.Chainloader:Start()
UnityEngine.Rendering.HighDefinition.HDRenderPipelineAsset:OnEnable()
lucasreis1 commented 11 months ago

Seems to be an issue with Mono: https://github.com/mono/mono/issues/20968. Sadly feels like it never got corrected.