Mydayyy / Valheim-ServerSideMap

This plugin completely moves the explored map and created pins to the server. As clients explore, they will send their explored areas to the server who will then distribute it to all connected clients. When a client joins, the server will synchronize the currently explored areas to the client. Pins are shared as well but default to false and need to be enabled. When pin sharing is used, all newly created pins are send to the server who saves them along with the explored area.
38 stars 1 forks source link

[Issue] Update v0.216.9+ broke the mod #50

Closed ghost closed 1 year ago

ghost commented 1 year ago

Hey once again :)

It seems the new patch broke the mod. Loading the ServerSideMap spews out this error:

[Info   :   BepInEx] Loading [ServerSideMap 1.3.7.0]
[Error  :  HarmonyX] Failed to patch void Minimap::ShowPinNameInput(UnityEngine.Vector3 pos): System.Exception: Parameter "pin" not found in method void Minimap::ShowPinNameInput(UnityEngine.Vector3 pos)
  at HarmonyLib.Public.Patching.HarmonyManipulator.EmitCallParameter (System.Reflection.MethodInfo patch, System.Boolean allowFirsParamPassthrough, Mono.Cecil.Cil.VariableDefinition& tmpObjectVar, System.Collections.Generic.List`1[HarmonyLib.Public.Patching.HarmonyManipulator+ArgumentBoxInfo]& tmpBoxVars) [0x007ae] in <474744d65d8e460fa08cd5fd82b5d65f>:0 
  at HarmonyLib.Public.Patching.HarmonyManipulator.WritePostfixes (HarmonyLib.Internal.Util.ILEmitter+Label returnLabel) [0x001a5] in <474744d65d8e460fa08cd5fd82b5d65f>:0 
  at HarmonyLib.Public.Patching.HarmonyManipulator.WriteImpl () [0x00234] in <474744d65d8e460fa08cd5fd82b5d65f>:0 
Exception: Parameter "pin" not found in method void Minimap::ShowPinNameInput(UnityEngine.Vector3 pos)
  at HarmonyLib.Public.Patching.HarmonyManipulator.EmitCallParameter (System.Reflection.MethodInfo patch, System.Boolean allowFirsParamPassthrough, Mono.Cecil.Cil.VariableDefinition& tmpObjectVar, System.Collections.Generic.List`1[HarmonyLib.Public.Patching.HarmonyManipulator+ArgumentBoxInfo]& tmpBoxVars) [0x007ae] in <474744d65d8e460fa08cd5fd82b5d65f>:0 
  at HarmonyLib.Public.Patching.HarmonyManipulator.WritePostfixes (HarmonyLib.Internal.Util.ILEmitter+Label returnLabel) [0x001a5] in <474744d65d8e460fa08cd5fd82b5d65f>:0 
  at HarmonyLib.Public.Patching.HarmonyManipulator.WriteImpl () [0x00234] in <474744d65d8e460fa08cd5fd82b5d65f>:0 
Rethrow as HarmonyException: IL Compile Error (unknown location)
  at HarmonyLib.Public.Patching.HarmonyManipulator.WriteImpl () [0x00378] in <474744d65d8e460fa08cd5fd82b5d65f>:0 
  at HarmonyLib.Public.Patching.HarmonyManipulator.Process (MonoMod.Cil.ILContext ilContext, System.Reflection.MethodBase originalMethod) [0x00042] in <474744d65d8e460fa08cd5fd82b5d65f>:0 
  at HarmonyLib.Public.Patching.HarmonyManipulator.Manipulate (System.Reflection.MethodBase original, HarmonyLib.PatchInfo patchInfo, MonoMod.Cil.ILContext ctx) [0x00006] in <474744d65d8e460fa08cd5fd82b5d65f>:0 
  at HarmonyLib.Public.Patching.HarmonyManipulator.Manipulate (System.Reflection.MethodBase original, MonoMod.Cil.ILContext ctx) [0x00007] in <474744d65d8e460fa08cd5fd82b5d65f>:0 
  at HarmonyLib.Public.Patching.ManagedMethodPatcher.Manipulator (MonoMod.Cil.ILContext ctx) [0x00012] in <474744d65d8e460fa08cd5fd82b5d65f>:0 
  at MonoMod.Cil.ILContext.Invoke (MonoMod.Cil.ILContext+Manipulator manip) [0x00087] in <6733e342b5b549bba815373898724469>:0 
  at MonoMod.RuntimeDetour.ILHook+Context.InvokeManipulator (Mono.Cecil.MethodDefinition def, MonoMod.Cil.ILContext+Manipulator cb) [0x00012] in <4e2760c7517c4ea79c633d67e84b319f>:0 
  at (wrapper dynamic-method) MonoMod.RuntimeDetour.ILHook+Context.DMD<MonoMod.RuntimeDetour.ILHook+Context::Refresh>(MonoMod.RuntimeDetour.ILHook/Context)
  at (wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition.Trampoline<MonoMod.RuntimeDetour.ILHook+Context::Refresh>?766498816(object)
  at HarmonyLib.Internal.RuntimeFixes.StackTraceFixes.OnILChainRefresh (System.Object self) [0x00000] in <474744d65d8e460fa08cd5fd82b5d65f>:0 
  at MonoMod.RuntimeDetour.ILHook.Apply () [0x00059] in <4e2760c7517c4ea79c633d67e84b319f>:0 
  at HarmonyLib.Public.Patching.ManagedMethodPatcher.DetourTo (System.Reflection.MethodBase replacement) [0x00047] in <474744d65d8e460fa08cd5fd82b5d65f>:0 
Rethrow as HarmonyException: IL Compile Error (unknown location)
  at HarmonyLib.Public.Patching.ManagedMethodPatcher.DetourTo (System.Reflection.MethodBase replacement) [0x0005f] in <474744d65d8e460fa08cd5fd82b5d65f>:0 
  at HarmonyLib.PatchFunctions.UpdateWrapper (System.Reflection.MethodBase original, HarmonyLib.PatchInfo patchInfo) [0x00033] in <474744d65d8e460fa08cd5fd82b5d65f>:0 
Rethrow as HarmonyException: IL Compile Error (unknown location)
  at HarmonyLib.PatchClassProcessor.ReportException (System.Exception exception, System.Reflection.MethodBase original) [0x00045] in <474744d65d8e460fa08cd5fd82b5d65f>:0 
  at HarmonyLib.PatchClassProcessor.Patch () [0x00095] in <474744d65d8e460fa08cd5fd82b5d65f>:0 
  at HarmonyLib.Harmony.<PatchAll>b__11_0 (System.Type type) [0x00007] in <474744d65d8e460fa08cd5fd82b5d65f>:0 
  at HarmonyLib.CollectionExtensions.Do[T] (System.Collections.Generic.IEnumerable`1[T] sequence, System.Action`1[T] action) [0x00014] in <474744d65d8e460fa08cd5fd82b5d65f>:0 
  at HarmonyLib.Harmony.PatchAll (System.Reflection.Assembly assembly) [0x00006] in <474744d65d8e460fa08cd5fd82b5d65f>:0 
  at HarmonyLib.Harmony.CreateAndPatchAll (System.Reflection.Assembly assembly, System.String harmonyInstanceId) [0x0001e] in <474744d65d8e460fa08cd5fd82b5d65f>:0 
  at ServerSideMap.ServerSideMap.Awake () [0x00010] in <a612564660d84c23ad57c8128415ceac>:0 
UnityEngine.GameObject:Internal_AddComponentWithType(Type)
UnityEngine.GameObject:AddComponent(Type)
BepInEx.Bootstrap.Chainloader:Start()
UnityEngine.GameObject:.cctor()
UnityEngine.UI.Graphic:CacheCanvas()
UnityEngine.UI.Graphic:get_canvas()
UnityEngine.UI.Image:OnCanvasHierarchyChanged()
Mydayyy commented 1 year ago

Greetings,

thanks for bringing this to my attention. The log indeed indicates that there have been significant changes inside their structure - I'll look into it this weekend to see how much work the update would be.

Best Regards Mydayyy

ghost commented 1 year ago

Yeah, the new patch broke a huge chunk of mods. They apparently hired a network dev guy to the company, who did some quite heavy work on network/world optimizations.. Or so I've been told 😄

Mydayyy commented 1 year ago

Yea, that is.. correct. The entire netcode was less than optimal, a bit annoying they start making changes now.

I'm currently running into a weird problem where Bepinex loads and patches twice:

[Info   :   BepInEx] Patching [UnityEngine.CoreModule] with [BepInEx.Chainloader]
[Message:   BepInEx] Preloader finished
[Info   :   BepInEx] Detected Unity version: v2020.3.45f1
[Info   :   BepInEx] Detected Unity version: v2020.3.45f1
[Message:   BepInEx] Chainloader ready
[Message:   BepInEx] Chainloader ready
[Message:   BepInEx] Chainloader started
[Message:   BepInEx] Chainloader started
[Info   :   BepInEx] 2 plugins to load
[Info   :   BepInEx] 2 plugins to load
[Info   :   BepInEx] Loading [ServerSideMap 1.3.7.0]
[Info   :   BepInEx] Loading [ServerSideMap 1.3.7.0]

Is that also the case for you?

ghost commented 1 year ago

I'll try and spin up a new server with only ServerSideMap and BepInEx loaded.

Mydayyy commented 1 year ago

For me, weirdly, this only happens on the client and not the server, I already reinstalled valheim and bepinex completely, so I'm a little stumped whether its an issue with my setup (or linux) or something with valheim/bepinex

ghost commented 1 year ago

Server Logs: https://paste.ec/paste/h8g+wbXE#uHUotwPvAbp9hT5QIgjmeyClTSvERtdddkjUfFM+e0q

Client Logs: (these are the logs from a first launch) https://paste.ec/paste/lBM9tlpZ#C26pypqEjirMLKrRxKRqpzGLLc6jmwJ0jH9U00PSKkE

So I uninstalled Valheim, cleared the Game data folder of any excess files and installed it anew. Then I installed ServerSideMap using r2modman, which gets the newest version of BepInEx automatically.

So it might just be a Linux specific thing?? I'm using Windows 11 for my client and Ubuntu 22.04.1LTS for my server

Mydayyy commented 1 year ago

Yea, your logs look fine, the entire Bepinex thing only gets executed once.

Welp, I gotta find out why my bepinex patches twice, since that leads to my hooks being called twice and that leads to issues

Mydayyy commented 1 year ago

Alright, I nuked my entire cache and config and got it back to working.

Also, here's a beta build which appears to be working: ServerSideMap.dll.zip

ghost commented 1 year ago

I don't have any friends to test it with atm, but I can see if it launches normally on my server 👍

Mydayyy commented 1 year ago

Aight. I also tested it alone - created a few pins and explored the map and checked it with different characters and it was fine. Waiting for your feedback and I would create a release of the new version tomorrow. Maybe someone else also chimes in with some feedback, lets see.

ghost commented 1 year ago

Everything seems to work well on my end at least 👍 The pins stay, and I can see them getting added and removed in the server logs. So it's all good. Thanks for the quick update on the mod 😄

Mydayyy commented 1 year ago

Greetings,

glad to hear! I proceeded to created a Thunderstore and NexusMods release because I couldn't sleep anyways. So let's hope for the best and pray that IronGate does not continue to make any drastic changes in the next few updates ._.

Best Regards Mydayyy

icemansparks commented 1 year ago

@Mydayyy i installed the new Version on our dedicated server and all clients. Discovery progress is shared as expected, thank you very much!

Map pins have been nuked unfortunately (as well as already known boss locations. New pins also seem to only be present on the client who created them and not shared with the other clients.

Mydayyy commented 1 year ago

Greetings,

Map pins have been nuked unfortunately (as well as already known boss locations. New pins also seem to only be present on the client who created them and not shared with the other clients.

That actually sounds like the pins are not loaded at all. The pins should still exist on the server but they are not sent to the client. Can you check your logs? And also your config to make sure it did not get reset and pin sharing is still enabled (server and client)?

Best Regards Mydayyy