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] Plugin not letting game load #64

Closed Dhovin closed 5 months ago

Dhovin commented 5 months ago

After the most recent update I am getting the below error. I can get into the main menu and start to log into the server. I'm prompted for the password and then I just get a blank screen.

[Warning:  HarmonyX] AccessTools.DeclaredMethod: Could not find method for type Minimap and name GetClosestPin and parameters (UnityEngine.Vector3, float)
[Error  : Unity Log] ArgumentException: Undefined target method for patch method static void ServerSideMap.PinSync+MinimapPatchGetClosestPin::Postfix(Minimap __instance, Minimap+PinData& __result, UnityEngine.Vector3 pos, float radius)
Stack trace:
HarmonyLib.PatchClassProcessor.PatchWithAttributes (System.Reflection.MethodBase& lastOriginal) (at <474744d65d8e460fa08cd5fd82b5d65f>:0)
HarmonyLib.PatchClassProcessor.Patch () (at <474744d65d8e460fa08cd5fd82b5d65f>:0)
Rethrow as HarmonyException: Patching exception in method null
HarmonyLib.PatchClassProcessor.ReportException (System.Exception exception, System.Reflection.MethodBase original) (at <474744d65d8e460fa08cd5fd82b5d65f>:0)
HarmonyLib.PatchClassProcessor.Patch () (at <474744d65d8e460fa08cd5fd82b5d65f>:0)
HarmonyLib.Harmony.<PatchAll>b__11_0 (System.Type type) (at <474744d65d8e460fa08cd5fd82b5d65f>:0)
HarmonyLib.CollectionExtensions.Do[T] (System.Collections.Generic.IEnumerable`1[T] sequence, System.Action`1[T] action) (at <474744d65d8e460fa08cd5fd82b5d65f>:0)
HarmonyLib.Harmony.PatchAll (System.Reflection.Assembly assembly) (at <474744d65d8e460fa08cd5fd82b5d65f>:0)
HarmonyLib.Harmony.CreateAndPatchAll (System.Reflection.Assembly assembly, System.String harmonyInstanceId) (at <474744d65d8e460fa08cd5fd82b5d65f>:0)
ServerSideMap.ServerSideMap.Awake () (at <97dbf37697dc4d5090d565b3fcc14d77>:0)
UnityEngine.GameObject:AddComponent(Type)
BepInEx.Bootstrap.Chainloader:Start()
UnityEngine.GameObject:.cctor()
PlatformTools.Common.SingletonMonoBehaviour`1:get_Instance()
PlatformTools.PlatformManagerInitializer:OnRuntimeMethodLoad()

The following is likely cause i was testing with out the mod installed on the server.

[Error  : Unity Log] NullReferenceException: Object reference not set to an instance of an object
Stack trace:
ServerSideMap.InitialMapSync+MinimapPatchSetMapData.Postfix (Minimap __instance) (at <97dbf37697dc4d5090d565b3fcc14d77>:0)
(wrapper dynamic-method) Minimap.DMD<Minimap::SetMapData>(Minimap,byte[])
Minimap.LoadMapData () (at <da52c09f594f4a7480000b7420815ba7>:0)
Minimap.Update () (at <da52c09f594f4a7480000b7420815ba7>:0)
Mydayyy commented 5 months ago

Greetings,

that indeed hints that they did breaking changes in the latest update. Thank you for the report, I will look into it.

Best Regards Mydayyy

Mydayyy commented 5 months ago

Greetings,

I looked into it and the change appears to have been a simple signature change of one of the function.

I patched it and did a quick test and could not find any further issues. Below you can find a debug build of the new version. Please keep in mind that there could be other unknown consequences of the new patch, so I advise to have a backup before testing it.

Unfortunately, today I will not find the time to test it properly and release it. If anyone wants to give the debug version below a test drive and report back whether it works on the new patch that would be helpful as well

In any case, I will find the time to test and release it tomorrow evening.

ServerSideMap.zip Test Build

Best Regards Mydayyy

Dhovin commented 5 months ago

Looks to be working fine for me! No issues so far! Thank you!

Mydayyy commented 5 months ago

Update released as v1.3.11 here, on Thunderstore and on NexusMods

Best Regards Mydayyy