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

Hildirs Update #55

Closed Caaruzo closed 1 year ago

Caaruzo commented 1 year ago

Don' work on current update on Dedicated Server

08/23/2023 17:32:07: Exception in ZRpc::HandlePackage: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object at ServerSideMap.ExplorationDatabase.PackBoolArray (System.Boolean[] arr, System.Int32 chunkId, System.Int32 startIndex, System.Int32 size) [0x00015] in <34f8597ca0884df4a3f9dc910f122947>:0 at ServerSideMap.InitialMapSync.SendChunkToClient (ZRpc client, System.Int32 chunk) [0x00028] in <34f8597ca0884df4a3f9dc910f122947>:0 at ServerSideMap.InitialMapSync+ZnetPatchRPC_PeerInfo.Postfix (ZRpc rpc, ZNet __instance) [0x00010] in <34f8597ca0884df4a3f9dc910f122947>:0 at (wrapper dynamic-method) ZNet.DMD<ZNet::RPC_PeerInfo>(ZNet,ZRpc,ZPackage) at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in <695d1cc93cca45069c528c15c9fdd749>:0 --- End of inner exception stack trace --- at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00048] in <695d1cc93cca45069c528c15c9fdd749>:0 at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0 at System.Delegate.DynamicInvokeImpl (System.Object[] args) [0x000e7] in <695d1cc93cca45069c528c15c9fdd749>:0 at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) [0x00008] in <695d1cc93cca45069c528c15c9fdd749>:0 at System.Delegate.DynamicInvoke (System.Object[] args) [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0 at ZRpc+RpcMethod1[T].Invoke (ZRpc rpc, ZPackage pkg) [0x0001d] in <093074b9eeb64fd38b114a3b8fa25238>:0 at (wrapper dynamic-method) ZRpc.DMD(ZRpc,ZPackage) at ZRpc.Update (System.Single dt) [0x0003e] in <093074b9eeb64fd38b114a3b8fa25238>:0 `

Mydayyy commented 1 year ago

Greetings,

Thanks for the report, I will look into this.

Best Regards Mydayyy

Mydayyy commented 1 year ago

After looking into it, I'm a bit confused.

First of all, there was one minor change which I fixed, but this was only causing issues on new worlds. The issue with existing worlds was that the .explored file got wiped, which lead to errors on startup. After I deleted the file and it got recreated I cannot reproduce any issues anymore and the file is not wiped anymore.

Edit:

A preliminary version with the fix I spoke of. But you need to manually check your .explored file and if its 0 bytes either delete it or replace with a backup: ServerSideMap.zip

I have yet not found why the wipe happened and cannot reproduce it.

Caaruzo commented 1 year ago

Thx much, will you push that to the Thunderstore pls, so me and my Players can test that together? (Most of them arn't able to manually add or update mods xD)

Mydayyy commented 1 year ago

Greetings,

currently I'm still hesitating on releasing the update since I have not tracked down the issue where the .explored file got wiped. Did you find time to check on your server whether this was the case too?

Best Regards Mydayyy

Caaruzo commented 1 year ago

ok. Where is the .explored file located?

Mydayyy commented 1 year ago

It is adjacent to your world save, same folder and its prefixed with your world name, e.g WORLDNAME.mod.serversidemap.explored

Caaruzo commented 1 year ago

Received this error

[Info :Jotunn.Managers.SynchronizationManager+<>c__DisplayClass31_0+<<ZNet_RPC_Post_PeerInfo>g__SynchronizeInitialData|0>d] Sending initial data to peer #2511049585 [Info : Unity Log] 08/23/2023 21:15:11: Exception in ZRpc::HandlePackage: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object at ServerSideMap.ExplorationDatabase.PackBoolArray (System.Boolean[] arr, System.Int32 chunkId, System.Int32 startIndex, System.Int32 size) [0x00015] in <a4222310dc674323b712c767a078416e>:0 at ServerSideMap.InitialMapSync.SendChunkToClient (ZRpc client, System.Int32 chunk) [0x00028] in <a4222310dc674323b712c767a078416e>:0 at ServerSideMap.InitialMapSync+ZnetPatchRPC_PeerInfo.Postfix (ZRpc rpc, ZNet __instance) [0x00010] in <a4222310dc674323b712c767a078416e>:0 at (wrapper dynamic-method) ZNet.DMD<ZNet::RPC_PeerInfo>(ZNet,ZRpc,ZPackage) at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in <695d1cc93cca45069c528c15c9fdd749>:0 --- End of inner exception stack trace --- at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00048] in <695d1cc93cca45069c528c15c9fdd749>:0 at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0 at System.Delegate.DynamicInvokeImpl (System.Object[] args) [0x000e7] in <695d1cc93cca45069c528c15c9fdd749>:0 at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) [0x00008] in <695d1cc93cca45069c528c15c9fdd749>:0 at System.Delegate.DynamicInvoke (System.Object[] args) [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0 at ZRpc+RpcMethod1[T].Invoke (ZRpc rpc, ZPackage pkg) [0x0001d] in <093074b9eeb64fd38b114a3b8fa25238>:0 at (wrapper dynamic-method) ZRpc.DMD(ZRpc,ZPackage) at ZRpc.Update (System.Single dt) [0x0003e] in <093074b9eeb64fd38b114a3b8fa25238>:0 `

after deleting .explored file and restarting server, it worked. *.explored file was 0 byte.

Yakameen commented 1 year ago

Greetings,

currently I'm still hesitating on releasing the update since I have not tracked down the issue where the .explored file got wiped. Did you find time to check on your server whether this was the case too?

Best Regards Mydayyy

I can confirm my server had the same issue and the .explored was 0 Bytes. Deleting the file allows the client to join the server again.

In addition I am getting a new error with the updated version you posted here: https://github.com/Mydayyy/Valheim-ServerSideMap/issues/55#issuecomment-1690315627

[Error  : Unity Log] NullReferenceException: Object reference not set to an instance of an object
Stack trace:
ServerSideMap.CommandsPinUpsync+ChatPatchInputText.Prefix (Chat __instance, UnityEngine.UI.InputField ___m_input) (at <a4222310dc674323b712c767a078416e>:0)
(wrapper dynamic-method) Chat.DMD<Chat::InputText>(Chat)
Terminal.SendInput () (at <447b19510f604ca3807cd6cce3a7c1ef>:0)
Chat.SendInput () (at <447b19510f604ca3807cd6cce3a7c1ef>:0)
UnityEngine.Events.InvokableCall.Invoke () (at <80fe1a4e36fe44618284312cb721a597>:0)
UnityEngine.Events.UnityEvent`1[T0].Invoke (T0 arg0) (at <80fe1a4e36fe44618284312cb721a597>:0)
Fishlabs.GuiInputField.onInputSubmit (System.String text) (at <abc2973239274336a7c65e00c9f4ab0e>:0)
UnityEngine.Events.InvokableCall`1[T1].Invoke (T1 args0) (at <80fe1a4e36fe44618284312cb721a597>:0)
UnityEngine.Events.UnityEvent`1[T0].Invoke (T0 arg0) (at <80fe1a4e36fe44618284312cb721a597>:0)
TMPro.TMP_InputField.SendOnSubmit () (at <c3806d8b402548cebcdac84224b2a2a9>:0)
TMPro.TMP_InputField.OnSubmit (UnityEngine.EventSystems.BaseEventData eventData) (at <c3806d8b402548cebcdac84224b2a2a9>:0)
Fishlabs.GuiInputField.OnSubmit (UnityEngine.EventSystems.BaseEventData eventData) (at <abc2973239274336a7c65e00c9f4ab0e>:0)
UnityEngine.EventSystems.ExecuteEvents.Execute (UnityEngine.EventSystems.ISubmitHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at <e97aac8d17514bea83fadfd039e9187a>:0)
UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1] functor) (at <e97aac8d17514bea83fadfd039e9187a>:0)
UnityEngine.EventSystems.EventSystem:Update()

This happens when attempting to type anything in chat. I cannot send messages or commands of any kind.

Caaruzo commented 1 year ago

Greetings, currently I'm still hesitating on releasing the update since I have not tracked down the issue where the .explored file got wiped. Did you find time to check on your server whether this was the case too? Best Regards Mydayyy

I can confirm my server had the same issue and the .explored was 0 Bytes. Deleting the file allows the client to join the server again.

In addition I am getting a new error with the updated version you posted here: #55 (comment)

[Error  : Unity Log] NullReferenceException: Object reference not set to an instance of an object
Stack trace:
ServerSideMap.CommandsPinUpsync+ChatPatchInputText.Prefix (Chat __instance, UnityEngine.UI.InputField ___m_input) (at <a4222310dc674323b712c767a078416e>:0)
(wrapper dynamic-method) Chat.DMD<Chat::InputText>(Chat)
Terminal.SendInput () (at <447b19510f604ca3807cd6cce3a7c1ef>:0)
Chat.SendInput () (at <447b19510f604ca3807cd6cce3a7c1ef>:0)
UnityEngine.Events.InvokableCall.Invoke () (at <80fe1a4e36fe44618284312cb721a597>:0)
UnityEngine.Events.UnityEvent`1[T0].Invoke (T0 arg0) (at <80fe1a4e36fe44618284312cb721a597>:0)
Fishlabs.GuiInputField.onInputSubmit (System.String text) (at <abc2973239274336a7c65e00c9f4ab0e>:0)
UnityEngine.Events.InvokableCall`1[T1].Invoke (T1 args0) (at <80fe1a4e36fe44618284312cb721a597>:0)
UnityEngine.Events.UnityEvent`1[T0].Invoke (T0 arg0) (at <80fe1a4e36fe44618284312cb721a597>:0)
TMPro.TMP_InputField.SendOnSubmit () (at <c3806d8b402548cebcdac84224b2a2a9>:0)
TMPro.TMP_InputField.OnSubmit (UnityEngine.EventSystems.BaseEventData eventData) (at <c3806d8b402548cebcdac84224b2a2a9>:0)
Fishlabs.GuiInputField.OnSubmit (UnityEngine.EventSystems.BaseEventData eventData) (at <abc2973239274336a7c65e00c9f4ab0e>:0)
UnityEngine.EventSystems.ExecuteEvents.Execute (UnityEngine.EventSystems.ISubmitHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at <e97aac8d17514bea83fadfd039e9187a>:0)
UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1] functor) (at <e97aac8d17514bea83fadfd039e9187a>:0)
UnityEngine.EventSystems.EventSystem:Update()

This happens when attempting to type anything in chat. I cannot send messages or commands of any kind.

Did you tried without any other mod, only ServersideMap? Sounds for me like an problem witrh another mod, that accesses the interface. But not sure. What i want to say, i dont have this error you described.

Mydayyy commented 1 year ago

Greetings, currently I'm still hesitating on releasing the update since I have not tracked down the issue where the .explored file got wiped. Did you find time to check on your server whether this was the case too? Best Regards Mydayyy

I can confirm my server had the same issue and the .explored was 0 Bytes. Deleting the file allows the client to join the server again.

In addition I am getting a new error with the updated version you posted here: #55 (comment)

[Error  : Unity Log] NullReferenceException: Object reference not set to an instance of an object
Stack trace:
ServerSideMap.CommandsPinUpsync+ChatPatchInputText.Prefix (Chat __instance, UnityEngine.UI.InputField ___m_input) (at <a4222310dc674323b712c767a078416e>:0)
(wrapper dynamic-method) Chat.DMD<Chat::InputText>(Chat)
Terminal.SendInput () (at <447b19510f604ca3807cd6cce3a7c1ef>:0)
Chat.SendInput () (at <447b19510f604ca3807cd6cce3a7c1ef>:0)
UnityEngine.Events.InvokableCall.Invoke () (at <80fe1a4e36fe44618284312cb721a597>:0)
UnityEngine.Events.UnityEvent`1[T0].Invoke (T0 arg0) (at <80fe1a4e36fe44618284312cb721a597>:0)
Fishlabs.GuiInputField.onInputSubmit (System.String text) (at <abc2973239274336a7c65e00c9f4ab0e>:0)
UnityEngine.Events.InvokableCall`1[T1].Invoke (T1 args0) (at <80fe1a4e36fe44618284312cb721a597>:0)
UnityEngine.Events.UnityEvent`1[T0].Invoke (T0 arg0) (at <80fe1a4e36fe44618284312cb721a597>:0)
TMPro.TMP_InputField.SendOnSubmit () (at <c3806d8b402548cebcdac84224b2a2a9>:0)
TMPro.TMP_InputField.OnSubmit (UnityEngine.EventSystems.BaseEventData eventData) (at <c3806d8b402548cebcdac84224b2a2a9>:0)
Fishlabs.GuiInputField.OnSubmit (UnityEngine.EventSystems.BaseEventData eventData) (at <abc2973239274336a7c65e00c9f4ab0e>:0)
UnityEngine.EventSystems.ExecuteEvents.Execute (UnityEngine.EventSystems.ISubmitHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at <e97aac8d17514bea83fadfd039e9187a>:0)
UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1] functor) (at <e97aac8d17514bea83fadfd039e9187a>:0)
UnityEngine.EventSystems.EventSystem:Update()

This happens when attempting to type anything in chat. I cannot send messages or commands of any kind.

Hi,

yes, you were in fact correct that there are some issues with the chat. This should be fixed by this version: ServerSideMap.zip

Best Regards Mydayyy

Yakameen commented 1 year ago

Greetings, currently I'm still hesitating on releasing the update since I have not tracked down the issue where the .explored file got wiped. Did you find time to check on your server whether this was the case too? Best Regards Mydayyy

I can confirm my server had the same issue and the .explored was 0 Bytes. Deleting the file allows the client to join the server again. In addition I am getting a new error with the updated version you posted here: #55 (comment)

[Error  : Unity Log] NullReferenceException: Object reference not set to an instance of an object
Stack trace:
ServerSideMap.CommandsPinUpsync+ChatPatchInputText.Prefix (Chat __instance, UnityEngine.UI.InputField ___m_input) (at <a4222310dc674323b712c767a078416e>:0)
(wrapper dynamic-method) Chat.DMD<Chat::InputText>(Chat)
Terminal.SendInput () (at <447b19510f604ca3807cd6cce3a7c1ef>:0)
Chat.SendInput () (at <447b19510f604ca3807cd6cce3a7c1ef>:0)
UnityEngine.Events.InvokableCall.Invoke () (at <80fe1a4e36fe44618284312cb721a597>:0)
UnityEngine.Events.UnityEvent`1[T0].Invoke (T0 arg0) (at <80fe1a4e36fe44618284312cb721a597>:0)
Fishlabs.GuiInputField.onInputSubmit (System.String text) (at <abc2973239274336a7c65e00c9f4ab0e>:0)
UnityEngine.Events.InvokableCall`1[T1].Invoke (T1 args0) (at <80fe1a4e36fe44618284312cb721a597>:0)
UnityEngine.Events.UnityEvent`1[T0].Invoke (T0 arg0) (at <80fe1a4e36fe44618284312cb721a597>:0)
TMPro.TMP_InputField.SendOnSubmit () (at <c3806d8b402548cebcdac84224b2a2a9>:0)
TMPro.TMP_InputField.OnSubmit (UnityEngine.EventSystems.BaseEventData eventData) (at <c3806d8b402548cebcdac84224b2a2a9>:0)
Fishlabs.GuiInputField.OnSubmit (UnityEngine.EventSystems.BaseEventData eventData) (at <abc2973239274336a7c65e00c9f4ab0e>:0)
UnityEngine.EventSystems.ExecuteEvents.Execute (UnityEngine.EventSystems.ISubmitHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at <e97aac8d17514bea83fadfd039e9187a>:0)
UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1] functor) (at <e97aac8d17514bea83fadfd039e9187a>:0)
UnityEngine.EventSystems.EventSystem:Update()

This happens when attempting to type anything in chat. I cannot send messages or commands of any kind.

Hi,

yes, you were in fact correct that there are some issues with the chat. This should be fixed by this version: ServerSideMap.zip

Best Regards Mydayyy

Fixed the issue, thanks!

Mydayyy commented 1 year ago

New version which deletes a zero bytes explored file and regenerates it:

ServerSideMap.zip

This is what I will plan to release later tonight on nexusmods/thunderstore

Mydayyy commented 1 year ago

1.3.9 released here, on nexusmods and thunderstore

Caaruzo commented 1 year ago

Thx for the Release. Implemented it and seem to work perfect for all.

mrheault commented 1 year ago

I still get this error even with v1.3.9 and deleting the 0 byte .explored file, happens as soon as you join the server. Tested with all other mods disabled.

08/29/2023 10:05:03: Exception in ZRpc::HandlePackage: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object
  at ServerSideMap.ExplorationDatabase.PackBoolArray (System.Boolean[] arr, System.Int32 chunkId, System.Int32 startIndex, System.Int32 size) [0x00015] in <34f8597ca0884df4a3f9dc910f122947>:0
  at ServerSideMap.InitialMapSync.SendChunkToClient (ZRpc client, System.Int32 chunk) [0x00028] in <34f8597ca0884df4a3f9dc910f122947>:0
  at ServerSideMap.InitialMapSync+ZnetPatchRPC_PeerInfo.Postfix (ZRpc rpc, ZNet __instance) [0x00010] in <34f8597ca0884df4a3f9dc910f122947>:0
  at (wrapper dynamic-method) ZNet.DMD<ZNet::RPC_PeerInfo>(ZNet,ZRpc,ZPackage)
  at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in <695d1cc93cca45069c528c15c9fdd749>:0
   --- End of inner exception stack trace ---
  at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00048] in <695d1cc93cca45069c528c15c9fdd749>:0
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0
  at System.Delegate.DynamicInvokeImpl (System.Object[] args) [0x000e7] in <695d1cc93cca45069c528c15c9fdd749>:0
  at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) [0x00008] in <695d1cc93cca45069c528c15c9fdd749>:0

  at System.Delegate.DynamicInvoke (System.Object[] args) [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0
  at ZRpc+RpcMethod1[T].Invoke (ZRpc rpc, ZPackage pkg) [0x0001d] in <4798e185fd564169a8df86776e47c747>:0
  at ZRpc.HandlePackage (ZPackage package) [0x00049] in <4798e185fd564169a8df86776e47c747>:0
  at ZRpc.Update (System.Single dt) [0x0003e] in <4798e185fd564169a8df86776e47c747>:0
Mydayyy commented 1 year ago

Greetings,

that is certainly strange.

Did you make sure to update the plugin on the server as well as the client? Can you confirm the version via the log files?

If the problem persists, I would ask you to create a separate issue and attach more of the log files, I believe there should be another error somewhere in that case.

mrheault commented 1 year ago

@Mydayyy I re-installed the latest version and the issue went away so all good!