Coder Social home page Coder Social logo

mydayyy / valheim-serversidemap Goto Github PK

View Code? Open in Web Editor NEW
38.0 5.0 1.0 69 KB

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.

C# 100.00%
valheim server client map share pins marker exploration

valheim-serversidemap's Introduction

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.

Hildir Update

Due to an unknown reason, the .explored file got wipe and set to zero bytes. If you were using the pin system, you will need to restore a backup of the file. Otherwise, no action is required as it will be regenerated and the explored progress from players will be synchronized when they log back in again.

Installation

  1. This mod requires BepinEx
  2. Place the ServerSideMap.dll inside your BepInX plugin folder on your server and client
  3. Restart Server and Client

How it works

(If you didnt read any other text, please at least read this one)

Marker Share:

  1. MARKERS DEFAULT TO FALSE AND NEED TO BE ENABLED IF YOU WANT TO USE THAT FEATURE
  2. The config file will be created after your first launch with the new version. You can edit the config files inside BepInEx/config/eu.mydayyy.plugins.serversidemap.cfg
  3. YOU NEED TO RESTART AFTER EDITING THE CONFIG
  4. Existing markers from clients are not synced to the server
  5. Every newly created marker will only exist on the server, not on the client
  6. When a client connects, he downloads all markers from the server
  7. When the client disables the sharing of markers, he will opt out of it, others on the server continue to share their markers
  8. When the server turns off marker share, no client will be able to share their markers no matter what they set inside their config file

Map Share:

  1. As usual, existing explored areas are synced to the server and merged
  2. The server sends the current map exploration to the client and the client merged it
  3. When the client disables the sharing of map data, he will opt of it, others on the server continue to share their map exploration
  4. When the server turns off map share, no client will be able to share their map exploration no matter what they set inside their config file

The pin and exploration data is saved along with the map in a new file.

You can toggle marker and map share separately, refer to Marker Share 2&3 for instruction

Commands:

Currently there are three available chat commands:

  • /convertpins: Uploads all pins which are currently clientside to the server.
  • /convertpins ignorelocaldupes: Uploads all pins which are currently clientside to the server. Pins which have a pin on the server near them are not uploaded. Default radius 15.0, can be adjusted in the config.
  • /deletealllocalpins: DELETES all local pins. Those will not be recoverable, use it when you are absolutely sure you want to do that.
  • /downloadpins: Downloads all pins from the server and converts them to local pins again. The reverse process of convertpins.

Hotkeys:

You can enable hotkeys for the convertpins and 'convertpins ignorelocaldupes'. To enable, adjust the Hotkeys section in the config accordingly. A list of valid strings can be found here: https://docs.unity3d.com/ScriptReference/KeyCode.html. Leave empty for no hotkey (default) Example:

[Hotkeys]

## Hotkey to run /convertpins
# Setting type: String
# Default value: 
KeyConvertAll = F10

## Hotkey to run /convertpins ignorelocaldupes
# Setting type: String
# Default value: 
KeyConvertIgnoreDupes = F11

Known Issues

Currently, the mod is incompatible with crossplay/PlayFab. PR's are welcome if someone wants to look into this.

Bug Reports

Please use Github for bug reports and feedback.

Development

Development takes place on github: https://github.com/Mydayyy/Valheim-ServerSideMap

You need to copy the following dlls into the Libs folder:

  • 0Harmony.dll
  • assembly_utils.dll
  • assembly_valheim.dll
  • BepInEx.dll
  • BepInEx.Harmony.dll
  • UnityEngine.CoreModule.dll
  • UnityEngine.dll
  • UnityEngine.ImageConversionModule.dll
  • UnityEngine.UI.dll
  • UnityEngine.InputLegacyModule.dll
  • Unity.TextMeshPro.dll

KoFi

My kofi can be found here

valheim-serversidemap's People

Contributors

mydayyy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

jvdbout

valheim-serversidemap's Issues

Bug: Switching between worlds overlays map markers onto unrelated map

There's a buggy behaviour where jumping between worlds on the same game session overlays map pins, i.e. if I log out of world1 and log into world2, then I see world1's map markers overlaid on world2's map. Only way to fix it right now is to quit Valheim and restart in world2.

  1. With the mod (v1.3.1) loaded, start the game and go into a world with map markers
  2. Open the map
  3. Close the map and Log Out (retain the game session)
  4. Open another world with map markers using a character who has made markers there (it could be the same character, or maybe you have made one for each world. I used a different character)
  5. Open the map. Notice there are markers that shouldn't be here, most obvious when markers appear in fogged parts of the map

Expected result:
Map should only show markers for its own map

Actual result:
Map is showing markers for another map

Screenshots:

Map 1 Character 1:
image

Map 2 Character 2:
image

Same issues that others have mentioned.

First, thank you so much for looking into this issue. I am having what I believe to be the same issue. I deleted the .exe file, restarted server and am getting stuck on black screen after entering password. attached is my server log. I am not sure if having multiple logs helps at all, but I thought I would share it.

LogOutput.log

ServerSideMap not syncing maps despite plugin being loaded

Hey, as per the title I have myself, 1 other player, and a dedicated Ubuntu 18 server running with the plugin and sharing enabled, but the map does not appear to ever sync. Startup logs show no related error that I can see.

Startup Logs

[Message:   BepInEx] BepInEx 5.4.9.0 - valheim_server
[Info   :   BepInEx] Running under Unity vUnknown (post-2017)
[Info   :   BepInEx] CLR runtime version: 4.0.30319.42000
[Info   :   BepInEx] Supports SRE: True
[Info   :   BepInEx] System platform: Bits64, Linux
[Message:   BepInEx] Preloader started
[Info   :   BepInEx] 1 patcher plugin loaded
[Info   :   BepInEx] Patching [UnityEngine.CoreModule] with [BepInEx.Chainloader]
[Message:   BepInEx] Preloader finished
[Info   :   BepInEx] Detected Unity version: v2019.4.20f1
[Message:   BepInEx] Chainloader ready
[Message:   BepInEx] Chainloader started
[Info   :   BepInEx] 2 plugins to load
[Info   :   BepInEx] Loading [ServerSideMap 1.3.0.0]
[Info   :   BepInEx] Loading [Display BepInEx Info In-Game 1.0.1]
[Message:   BepInEx] Chainloader startup complete
[Info   : Unity Log] 04/07/2021 20:25:10: Starting to load scene:start

Server config file

## Settings file was created by plugin ServerSideMap v1.3.0.0
## Plugin GUID: eu.mydayyy.plugins.serversidemap

[General]

## Client: Whether or not to participate in sharing the map. Server: Whether or not to allow map sharing
# Setting type: Boolean
# Default value: true
EnableMapShare = true

## Client: Whether or not to participate in sharing markers. Server: Whether or not to allow marker sharing
# Setting type: Boolean
# Default value: false
EnableMarkerShare = true

[PinShare]

## A local pin will not be uploaded if a pin exists in the given radius on the server (when using /convertpins removelocaldupes)
# Setting type: Single
# Default value: 15
DuplicatePinRadius = 15

You mention in the README that DLLs need copied to a libs folder - are you referencing the doorstop_libs folder with this, or some other folder?

Locally hosted server does seem to not share initial map data correctly

As per a report on nexus mods, a locally hostedserver does not seem to share initial map data correctly.

Report:

Thank you for this mod. I'm using it hosted with friends outside of a dedicated server and it syncs new map data properly. Our current individual map data from before the mod however has not been merged. Is this meant to happen? or is there a way to merge the maps in a different way?

It is via the game yes. That scenario fits. Neither my data(the host) nor my friends data has been shared. We have tried reconnecting to no avail. New map data being explored whilst we're both online does get shared properly however. Thanks

TODO:

  • Retest initial map sync on dedicated servers
  • Retest initial map sync on locally hosted servers

Update map sync to include map markers

Update map sync to include map markers

The map markers are not currently synced. For this, we would need to compare user and server existing marks, delete / add as required and track marks the user creates/deletes while on the server and sync it with the server

As requested on nexusmods, we also need an option to make marker and exploration sync optional and toggle it separately

Option to share markers but not share map exploration? I want to make a custom server where each players explores separately but they share markers.

Question for understanding, before install

One of my players asks:

what happens to people's existing maps and points of interest? do I lose everything? do everyone's existing POIs upload and stack on the server map?

It's really this last part that I'm wondering about. If we install it after several people have been playing, how does that work?

Broken since Update to Valheim 0.153.2

Since update to Valheim 0.153.2 the mod seems to be broken.
We can see the map but it's not syncing new progress and all pins are gone.
Any ideas how to solve this?

Plugin hangs on local, non dedicated server

Hangup on local, non dedicated server

This was reported by a user on nexus mods:

Just tried this out, but the game just hung and wouldn't load. Loaded fine after removing this mod.

Local and Dedicated Servers act slightly different. If a server is hosted locally, there is GetServerRPC returns null. We need to check whether ZNet.IsServer returns true and just call the function locally which would otherwise be invoked via RPC

FPS and/or network lag while browsing the map zoomed out

I've noticed that while browsing the map when zoomed out even just a bit, there is significant FPS (and possibly some network) latency. Is this normal for this mod? Anything that can be done to fix this? Thanks for your support!

Map not sync

I play on my server and not snyc wither map from other

Any way to reset mapshare?

Trying to figure out how to reset the map share. While setting up the server and config testing different mods I used the exploremap command to help me with testing and now I would like to be able to reset the map so the fully explored map doesnt get shared out to everyone who joins.

I have tried resetting my own map with the "resetmap" and "resetsharedmap" commands. I have tried deleting the .explored files in the server as well and still no matter what when someone logs into the server their map gets set to fully explored. I've even tried uninstalling the mod and reinstalling after reseting the map.

any way for me to fix this?

1.3.8 not starting up.

The version that was just released doesn't seem to work:

[Info   :   BepInEx] Loading [ServerSideMap 1.3.8.0]
[Warning:  HarmonyX] AccessTools.DeclaredMethod: Could not find method for type Minimap and name OnPinTextEntered and parameters 
[Error  : Unity Log] ArgumentException: Undefined target method for patch method static void ServerSideMap.PinSync+MinimapPatchOnPinTextEntered::Prefix(Minimap __instance, Minimap+PinData& __state, Minimap+PinData ___m_namePin)
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 <34f8597ca0884df4a3f9dc910f122947>:0)
UnityEngine.GameObject:AddComponent(Type)
BepInEx.Bootstrap.Chainloader:Start()
UnityEngine.UI.Image:OnCanvasHierarchyChanged()

Hildirs Update

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.DMDZRpc::HandlePackage(ZRpc,ZPackage)
at ZRpc.Update (System.Single dt) [0x0003e] in <093074b9eeb64fd38b114a3b8fa25238>:0 `

Feature request: Copy map pins from mod files to local

I used this mod on a shared server with some friends (and it was immensely useful!), and while this mod was active I also played on my personal world. The shared world doesn't seem to have much activity now so there's no longer a need for a shared map. On removing this mod though all my map markers I added to my personal world since I installed this mod vanish unless I bring the mod back.

I suggest a feature to copy the map marker locations down into my world files.
Your suggestion of:

My idea would be to implement a new command to sync pins from the server back to the client. Basically the opposite of the convertpins command.

would work just fine

Server completely un-joinable after restart, corrupted .explored files?

First off-- love the mod concept. Until a restart it works great! My friends and I were loving the sharing. If theres any way I can help to further debug this or anything please let me know. I'm a Software Engineer in Test so, testing/debugging is my jam. Is there a way to activate like a debug mode for BepInEx or just this mod, to get some logging from the events I describe below? Currently nothing at all happens in the logs.

The issue

This issue is consistently replicable in my environment. I have not yet tried isolating just this mod to replicate but if I have time to do so I will post my findings.

My server is scheduled to do check for updates nightly, which currently results in a restart. Each morning this results in being completely unable to reconnect to the server. There are no errors in the server log or client log-- when connecting, instead of prompting for my password, I get the following two screens:

image
image

The connection issue applies to all users, not only users with the mod installed. One of our players is still running completely vanilla client and cannot connect either once this issue begins.

I've deduced this to be an issue with SSM. It's the only mod I had added since the crashes started, and I can resolve the issue without removing the mod from the server or by simply deleting or moving Wootheim2.mod.serversidemap.explored and restarting.

This issue has replicated each time my server has restarted to check for updates, and can be replicated in my environment below with a simple docker-compose restart command.

I have also attached two of the "corrupted" (I guess?) .explored files, not sure if they're helpful.
wootheim-explored-files.zip

Environment

latest version of Valheim dedicated server, linux (containerized in docker), with only a handful of mods:

I also attached my zipped config directory in case anything in there helps.
wootheim-config.zip

I run the entire thing in docker, using mbround18/valheim docker image and the following docker-compose.yml

version: "3"
services:
  valheim:
    image: mbround18/valheim:latest
    ports:
      - 2456:2456/udp
      - 2457:2467/udp
      - 2458:2458/udp
    environment:
      - PORT=2456
      - NAME="Wootheim"
      - WORLD="Wootheim2"
      - PASSWORD="coolkids!"
      - TZ=America/Chicago
      - PUBLIC=1
      - AUTO_UPDATE=1
      - AUTO_UPDATE_SCHEDULE="0 1 * * *"
      - AUTO_BACKUP=1
      - AUTO_BACKUP_SCHEDULE="*/15 * * * *"
      - AUTO_BACKUP_REMOVE_OLD=1
      - AUTO_BACKUP_DAYS_TO_LIVE=3
      - AUTO_BACKUP_ON_UPDATE=1
      - AUTO_BACKUP_ON_SHUTDOWN=1
      - UPDATE_ON_STARTUP=0
    volumes:
      - /home/valheim/saves:/home/steam/.config/unity3d/IronGate/Valheim
      - /home/valheim/server:/home/steam/valheim
      - /home/valheim/backups:/home/steam/backups

Address performance concerns about map up and down syncing

Address performance concerns about map up and down syncing

Currently, connecting to a server uploads the entire discovered map from the client and downloads the existing map from the server. This may be a huge network load. The goal should be to reduce this to a minimum, while still providing all the current features. For this, batching and sending the calls over time should be implemented.

E.g group the discovered map into Y packets with X coordinates and sending Z packets per second.

Add a command to convert existing local pins to server pins

  • Create a basic command to upload all existing local pins to the server, no exceptions
  • Create an advanced command to upload all existing pins to the server:
    • Do not upload pins to the server, when the server has a similar pin placed
    • similar pin is decided by the radius alone, other factors (type, text) are ignored
  • Create a command to delete all local pins

Enforce sharing option

I want a setting to enable mandating sharing of map information

Thank you for this amazing mod

[Issue] Patch 0.209.9 may have broken the mod

Hey @Mydayyy . Not even sure if you're maintaining this anymore.

But the valheim devs have moved their new "worlds" location to a new folder, "worlds_local".

Therefore the ServerSideMap can't access the .explored file(s) anymore. Atleast that what to log says. I just did a reinstall of the entire server, so I don't have the log snippet anymore sorry. But it said something along the lines of "can't access .explored files, permission denied".

It would be awesome if you could update the mod 👍

Not syncing to players

I can not seem to get this to work, the server does seem to sync.
But player maps does not update at all.

[Issue] Plugin not letting game load

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)

[Warning: BepInEx] Skipping [ServerSideMap 1.3.9.0] because a newer version exists (ServerSideMap 1.3.9.0)

I'm getting the following error" [Warning: BepInEx] Skipping [ServerSideMap 1.3.9.0] because a newer version exists (ServerSideMap 1.3.9.0) error_log.txt

I'm using r2modman with a profile that's shared between a dedicated server I'm hosting, and my own client. All other mods work as expected.

A few other questions:

  • I've not been able to find the .explored file anywhere. I'm using
  • Should the ServerSideMap.dll be placed in the BepInEx>Plugins folder, or in the BepInEx>Plugins>Mydayyy-ServerSideMap folder?
  • Since I use r2modman I only have 1 single BepInEx folder. Does this interfere with this mod?

Thanks!

Valheim Update: Mod crashes due to newly introduced network requirements

The latest Valheim update fixed a new things, one of which is switching to another method of sending data via steam.

Prior to the update:

private void SendQueuedPackages()
{
if (!this.IsConnected())
return;
while (this.m_sendQueue.Count > 0)
{
byte[] numArray = this.m_sendQueue.Peek();
EP2PSend ep2Psend = (EP2PSend) 2;
if (!SteamNetworking.SendP2PPacket(this.m_peerID, numArray, (uint) numArray.Length, ep2Psend, 0))
break;
this.m_totalSent += numArray.Length;
this.m_sendQueue.Dequeue();
}
}

After the update:

private void SendQueuedPackages()
{
if (!this.IsConnected())
return;
while (this.m_sendQueue.Count > 0)
{
byte[] source = this.m_sendQueue.Peek();
IntPtr num1 = Marshal.AllocHGlobal(source.Length);
Marshal.Copy(source, 0, num1, source.Length);
long num2;
EResult connection = SteamNetworkingSockets.SendMessageToConnection(this.m_con, num1, (uint) source.Length, 9, ref num2);
Marshal.FreeHGlobal(num1);
if (connection == 1)
{
this.m_totalSent += source.Length;
this.m_sendQueue.Dequeue();
}
else
{
ZLog.Log((object) ("Failed to send data " + (object) connection));
break;
}
}
}

The main change is switching from SendP2PPacket to SendMessageToConnection.
SendMessageToConnection has a limit on package size which we slighty exceed:

Reliable message send. Can send up to k_cbMaxSteamNetworkingSocketsMessageSizeSend bytes in a single message.
Does fragmentation/re-assembly of messages under the hood, as well as a
sliding window for efficient sends of large chunks of data.

Where k_cbMaxSteamNetworkingSocketsMessageSizeSend is defined as:
const int k_cbMaxSteamNetworkingSocketsMessageSizeSend = 512 * 1024;

The fix for this is to implement chunking for sending the map data

[Issue] Update v0.216.9+ broke the mod

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()

strange conflict with valheimRAFT using this mod

I wouldn't think these two would conflict, but I narrowed done the bug to just happening between this mod and the fork of valheimRAFT by zolantris on thunderstore.

on reload, existing rafts will appear to break apart and become unusable, the main base of the raft will separate from the unique buildpieces like steering wheel and sails.

edit: they will come back together just fine once serversidemap is disabled

Unable to Delete or Red X Markers with Mod

Everything is working fine except for 2 things.

  • Old Markers cannot be deleted: You can create a new marker and delete it, but if you create a new marker, then leave the server and come back in, you cannot delete that marker, it is there permanently.
  • Unable to Red X markers: Once you place a marker, whether its new or old, you cannot place the red x on it. We use the red x feature to mark cleared dungeons.

Neither of these issues came up until after H&H update. We removed the mod and were able to red x and delete new and old markers, the issue is only with this mod. I don't know if it is conflicting with another mod in some way as not all mods have updated for H&H, however all mods we currently have installed are working like were before the update, and we are using the same mods as before the update.

Current Mods Installed - We do not have any other map mods installed

  • BepInExPack
  • EquimentAndQuickSlots
  • CraftingWithContainers
  • SimpleRecycling
  • FarmGrid
  • InstantMonsterLootDrop
  • BiggerPicupRadius
  • FloatingItems
  • AutoFuel
  • BiggerBoatMapExploreRadius

No Config

After following every step, there still is no eu.mydayyy.plugins.serversidemap.cfg on my server that i can edit

ServerSideMap fails to sync in the presence of the RRRCore mod

Hi!

I've been having some trouble getting my server's mods set up, in particular ServerSideMap. After some experimentation today, I was able to confirm that the trouble seems to arise from including the RRRCore mod (https://valheim.thunderstore.io/package/neurodr0me/RRRCore/).

The server logs don't seem to indicate any errors happening, but the client is a different story. I get an ugly looking traceback in the logs when it, presumably, tries to sync. This ultimately fails for some reason and the map on the client is not updated, though otherwise the game appears unaffected by the error.

I'd love to get both of these working together at some point, and hopefully the logs provided help with that. Please let me know if I can provide any additional information.

Server Log:
https://gist.github.com/thecsapprentice/ba00963be44f87f9187c1db512f74bf2

Client Log (Error around line 709):
https://gist.github.com/thecsapprentice/00624e09f4724ffabc65d050dccfcc64

The mod does not create .explore

Hey. I have been using this mod for a long time but now that i made a new server it does not work anymore.
I cant seem to find any logs on this server side, but my client post me this when i start it:
[Info : BepInEx] Loading [ServerSideMap 1.3.7.0]
[Info :ServerSideMap] Store1: False
[Info :ServerSideMap] Store2: False

The dll's are in the proper locations but it simply doesnt work.
The .explore file is not created both on client and server side, with the world files etc as they should.
Can you please help me out here?

Stuck on the game loading screen and cannot enter the game

Mod version: v1.3.8
Game version: 0.217.14 (Hildir Request)

Game Log:

[Info   : Unity Log] ConnectPortals => Connected 0 portals.
[Info   : Unity Log] ConnectSpawners => Connected 226 spawners and 512 'done' spawners.
[Info   : Unity Log] 08/26/2023 18:05:34: Loaded 10150 locations

[Info   : Unity Log] 08/26/2023 18:05:34: Unloading unused assets

[Error  : Unity Log] MissingMethodException: void ZNet.Save(bool)
Stack trace:
(wrapper dynamic-method) ZNet.DMD<ZNet::LoadWorld>(ZNet)
ZNet.ServerLoadWorld () (at <447b19510f604ca3807cd6cce3a7c1ef>:0)
ZNet.Start () (at <447b19510f604ca3807cd6cce3a7c1ef>:0)

[Info   : Unity Log] 08/26/2023 18:05:34: Starting respawn

[Info   : Unity Log] 08/26/2023 18:05:34: Lobby was created k_EResultOK  109775242601756503  error:False

[Info   : Unity Log] 08/26/2023 18:05:34: Got requested lobby data

[Info   : Unity Log] 08/26/2023 18:05:34: Session auth respons callback

[Info   : Unity Log] 08/26/2023 18:05:42: Unpacking compressed mapdata 11346

[Info   :ServerSideMap] ClientAppendPins 0
[Error  : Unity Log] NullReferenceException: Object reference not set to an instance of an object
Stack trace:
ServerSideMap.ExplorationDatabase.PackBoolArray (System.Boolean[] arr, System.Int32 chunkId, System.Int32 startIndex, System.Int32 size) (at <34f8597ca0884df4a3f9dc910f122947>:0)
ServerSideMap.InitialMapSync.SendChunkToClient (ZRpc client, System.Int32 chunk) (at <34f8597ca0884df4a3f9dc910f122947>:0)
ServerSideMap.InitialMapSync+MinimapPatchSetMapData.Postfix (Minimap __instance) (at <34f8597ca0884df4a3f9dc910f122947>:0)
(wrapper dynamic-method) Minimap.DMD<Minimap::SetMapData>(Minimap,byte[])
(wrapper dynamic-method) Minimap.DMD<Minimap::LoadMapData>(Minimap)
Minimap.Update () (at <447b19510f604ca3807cd6cce3a7c1ef>:0)

[Info   : Unity Log] 08/26/2023 18:05:42: tip:$loadscreen_tip23

[Info   : Unity Log] 08/26/2023 18:05:42: Got requested lobby data

[Info   : Unity Log] 08/26/2023 18:05:50: Unpacking compressed mapdata 11346

[Info   :ServerSideMap] ClientAppendPins 0
[Error  : Unity Log] NullReferenceException: Object reference not set to an instance of an object
Stack trace:
ServerSideMap.ExplorationDatabase.PackBoolArray (System.Boolean[] arr, System.Int32 chunkId, System.Int32 startIndex, System.Int32 size) (at <34f8597ca0884df4a3f9dc910f122947>:0)
ServerSideMap.InitialMapSync.SendChunkToClient (ZRpc client, System.Int32 chunk) (at <34f8597ca0884df4a3f9dc910f122947>:0)
ServerSideMap.InitialMapSync+MinimapPatchSetMapData.Postfix (Minimap __instance) (at <34f8597ca0884df4a3f9dc910f122947>:0)
(wrapper dynamic-method) Minimap.DMD<Minimap::SetMapData>(Minimap,byte[])
(wrapper dynamic-method) Minimap.DMD<Minimap::LoadMapData>(Minimap)
Minimap.Update () (at <447b19510f604ca3807cd6cce3a7c1ef>:0)

[Info   : Unity Log] 08/26/2023 18:05:57: Unpacking compressed mapdata 11346

[Info   :ServerSideMap] ClientAppendPins 0
[Error  : Unity Log] NullReferenceException: Object reference not set to an instance of an object
Stack trace:
ServerSideMap.ExplorationDatabase.PackBoolArray (System.Boolean[] arr, System.Int32 chunkId, System.Int32 startIndex, System.Int32 size) (at <34f8597ca0884df4a3f9dc910f122947>:0)
ServerSideMap.InitialMapSync.SendChunkToClient (ZRpc client, System.Int32 chunk) (at <34f8597ca0884df4a3f9dc910f122947>:0)
ServerSideMap.InitialMapSync+MinimapPatchSetMapData.Postfix (Minimap __instance) (at <34f8597ca0884df4a3f9dc910f122947>:0)
(wrapper dynamic-method) Minimap.DMD<Minimap::SetMapData>(Minimap,byte[])
(wrapper dynamic-method) Minimap.DMD<Minimap::LoadMapData>(Minimap)
Minimap.Update () (at <447b19510f604ca3807cd6cce3a7c1ef>:0)

[Info   : Unity Log] 08/26/2023 18:06:05: Unpacking compressed mapdata 11346

[Info   :ServerSideMap] ClientAppendPins 0
[Error  : Unity Log] NullReferenceException: Object reference not set to an instance of an object
Stack trace:
ServerSideMap.ExplorationDatabase.PackBoolArray (System.Boolean[] arr, System.Int32 chunkId, System.Int32 startIndex, System.Int32 size) (at <34f8597ca0884df4a3f9dc910f122947>:0)
ServerSideMap.InitialMapSync.SendChunkToClient (ZRpc client, System.Int32 chunk) (at <34f8597ca0884df4a3f9dc910f122947>:0)
ServerSideMap.InitialMapSync+MinimapPatchSetMapData.Postfix (Minimap __instance) (at <34f8597ca0884df4a3f9dc910f122947>:0)
(wrapper dynamic-method) Minimap.DMD<Minimap::SetMapData>(Minimap,byte[])
(wrapper dynamic-method) Minimap.DMD<Minimap::LoadMapData>(Minimap)
Minimap.Update () (at <447b19510f604ca3807cd6cce3a7c1ef>:0)

[Info   : Unity Log] 08/26/2023 18:06:12: Unpacking compressed mapdata 11346

[Info   :ServerSideMap] ClientAppendPins 0
[Error  : Unity Log] NullReferenceException: Object reference not set to an instance of an object
Stack trace:
ServerSideMap.ExplorationDatabase.PackBoolArray (System.Boolean[] arr, System.Int32 chunkId, System.Int32 startIndex, System.Int32 size) (at <34f8597ca0884df4a3f9dc910f122947>:0)
ServerSideMap.InitialMapSync.SendChunkToClient (ZRpc client, System.Int32 chunk) (at <34f8597ca0884df4a3f9dc910f122947>:0)
ServerSideMap.InitialMapSync+MinimapPatchSetMapData.Postfix (Minimap __instance) (at <34f8597ca0884df4a3f9dc910f122947>:0)
(wrapper dynamic-method) Minimap.DMD<Minimap::SetMapData>(Minimap,byte[])
(wrapper dynamic-method) Minimap.DMD<Minimap::LoadMapData>(Minimap)
Minimap.Update () (at <447b19510f604ca3807cd6cce3a7c1ef>:0)

[Info   : Unity Log] 08/26/2023 18:06:20: Unpacking compressed mapdata 11346

[Info   :ServerSideMap] ClientAppendPins 0
[Error  : Unity Log] NullReferenceException: Object reference not set to an instance of an object
Stack trace:
ServerSideMap.ExplorationDatabase.PackBoolArray (System.Boolean[] arr, System.Int32 chunkId, System.Int32 startIndex, System.Int32 size) (at <34f8597ca0884df4a3f9dc910f122947>:0)
ServerSideMap.InitialMapSync.SendChunkToClient (ZRpc client, System.Int32 chunk) (at <34f8597ca0884df4a3f9dc910f122947>:0)
ServerSideMap.InitialMapSync+MinimapPatchSetMapData.Postfix (Minimap __instance) (at <34f8597ca0884df4a3f9dc910f122947>:0)
(wrapper dynamic-method) Minimap.DMD<Minimap::SetMapData>(Minimap,byte[])
(wrapper dynamic-method) Minimap.DMD<Minimap::LoadMapData>(Minimap)
Minimap.Update () (at <447b19510f604ca3807cd6cce3a7c1ef>:0)

[Info   : Unity Log] 08/26/2023 18:06:27: Unpacking compressed mapdata 11346

[Info   :ServerSideMap] ClientAppendPins 0
[Error  : Unity Log] NullReferenceException: Object reference not set to an instance of an object
Stack trace:
ServerSideMap.ExplorationDatabase.PackBoolArray (System.Boolean[] arr, System.Int32 chunkId, System.Int32 startIndex, System.Int32 size) (at <34f8597ca0884df4a3f9dc910f122947>:0)
ServerSideMap.InitialMapSync.SendChunkToClient (ZRpc client, System.Int32 chunk) (at <34f8597ca0884df4a3f9dc910f122947>:0)
ServerSideMap.InitialMapSync+MinimapPatchSetMapData.Postfix (Minimap __instance) (at <34f8597ca0884df4a3f9dc910f122947>:0)
(wrapper dynamic-method) Minimap.DMD<Minimap::SetMapData>(Minimap,byte[])
(wrapper dynamic-method) Minimap.DMD<Minimap::LoadMapData>(Minimap)
Minimap.Update () (at <447b19510f604ca3807cd6cce3a7c1ef>:0)

[Info   : Unity Log] 08/26/2023 18:06:35: Unpacking compressed mapdata 11346

[Info   :ServerSideMap] ClientAppendPins 0
[Error  : Unity Log] NullReferenceException: Object reference not set to an instance of an object
Stack trace:
ServerSideMap.ExplorationDatabase.PackBoolArray (System.Boolean[] arr, System.Int32 chunkId, System.Int32 startIndex, System.Int32 size) (at <34f8597ca0884df4a3f9dc910f122947>:0)
ServerSideMap.InitialMapSync.SendChunkToClient (ZRpc client, System.Int32 chunk) (at <34f8597ca0884df4a3f9dc910f122947>:0)
ServerSideMap.InitialMapSync+MinimapPatchSetMapData.Postfix (Minimap __instance) (at <34f8597ca0884df4a3f9dc910f122947>:0)
(wrapper dynamic-method) Minimap.DMD<Minimap::SetMapData>(Minimap,byte[])
(wrapper dynamic-method) Minimap.DMD<Minimap::LoadMapData>(Minimap)
Minimap.Update () (at <447b19510f604ca3807cd6cce3a7c1ef>:0)

[Info   : Unity Log] 08/26/2023 18:06:43: Unpacking compressed mapdata 11346

[Info   :ServerSideMap] ClientAppendPins 0
[Error  : Unity Log] NullReferenceException: Object reference not set to an instance of an object
Stack trace:
ServerSideMap.ExplorationDatabase.PackBoolArray (System.Boolean[] arr, System.Int32 chunkId, System.Int32 startIndex, System.Int32 size) (at <34f8597ca0884df4a3f9dc910f122947>:0)
ServerSideMap.InitialMapSync.SendChunkToClient (ZRpc client, System.Int32 chunk) (at <34f8597ca0884df4a3f9dc910f122947>:0)
ServerSideMap.InitialMapSync+MinimapPatchSetMapData.Postfix (Minimap __instance) (at <34f8597ca0884df4a3f9dc910f122947>:0)
(wrapper dynamic-method) Minimap.DMD<Minimap::SetMapData>(Minimap,byte[])
(wrapper dynamic-method) Minimap.DMD<Minimap::LoadMapData>(Minimap)
Minimap.Update () (at <447b19510f604ca3807cd6cce3a7c1ef>:0)

[Info   : Unity Log] 08/26/2023 18:06:51: Unpacking compressed mapdata 11346

[Info   :ServerSideMap] ClientAppendPins 0
[Error  : Unity Log] NullReferenceException: Object reference not set to an instance of an object
Stack trace:
ServerSideMap.ExplorationDatabase.PackBoolArray (System.Boolean[] arr, System.Int32 chunkId, System.Int32 startIndex, System.Int32 size) (at <34f8597ca0884df4a3f9dc910f122947>:0)
ServerSideMap.InitialMapSync.SendChunkToClient (ZRpc client, System.Int32 chunk) (at <34f8597ca0884df4a3f9dc910f122947>:0)
ServerSideMap.InitialMapSync+MinimapPatchSetMapData.Postfix (Minimap __instance) (at <34f8597ca0884df4a3f9dc910f122947>:0)
(wrapper dynamic-method) Minimap.DMD<Minimap::SetMapData>(Minimap,byte[])
(wrapper dynamic-method) Minimap.DMD<Minimap::LoadMapData>(Minimap)
Minimap.Update () (at <447b19510f604ca3807cd6cce3a7c1ef>:0)

[Info   : Unity Log] 08/26/2023 18:06:58: Unpacking compressed mapdata 11346

[Info   :ServerSideMap] ClientAppendPins 0
[Error  : Unity Log] NullReferenceException: Object reference not set to an instance of an object
Stack trace:
ServerSideMap.ExplorationDatabase.PackBoolArray (System.Boolean[] arr, System.Int32 chunkId, System.Int32 startIndex, System.Int32 size) (at <34f8597ca0884df4a3f9dc910f122947>:0)
ServerSideMap.InitialMapSync.SendChunkToClient (ZRpc client, System.Int32 chunk) (at <34f8597ca0884df4a3f9dc910f122947>:0)
ServerSideMap.InitialMapSync+MinimapPatchSetMapData.Postfix (Minimap __instance) (at <34f8597ca0884df4a3f9dc910f122947>:0)
(wrapper dynamic-method) Minimap.DMD<Minimap::SetMapData>(Minimap,byte[])
(wrapper dynamic-method) Minimap.DMD<Minimap::LoadMapData>(Minimap)
Minimap.Update () (at <447b19510f604ca3807cd6cce3a7c1ef>:0)

[Info   : Unity Log] 08/26/2023 18:07:06: Unpacking compressed mapdata 11346

[Info   :ServerSideMap] ClientAppendPins 0
[Error  : Unity Log] NullReferenceException: Object reference not set to an instance of an object
Stack trace:
ServerSideMap.ExplorationDatabase.PackBoolArray (System.Boolean[] arr, System.Int32 chunkId, System.Int32 startIndex, System.Int32 size) (at <34f8597ca0884df4a3f9dc910f122947>:0)
ServerSideMap.InitialMapSync.SendChunkToClient (ZRpc client, System.Int32 chunk) (at <34f8597ca0884df4a3f9dc910f122947>:0)
ServerSideMap.InitialMapSync+MinimapPatchSetMapData.Postfix (Minimap __instance) (at <34f8597ca0884df4a3f9dc910f122947>:0)
(wrapper dynamic-method) Minimap.DMD<Minimap::SetMapData>(Minimap,byte[])
(wrapper dynamic-method) Minimap.DMD<Minimap::LoadMapData>(Minimap)
Minimap.Update () (at <447b19510f604ca3807cd6cce3a7c1ef>:0)

[Info   : Unity Log] 08/26/2023 18:07:14: Unpacking compressed mapdata 11346

[Info   :ServerSideMap] ClientAppendPins 0
[Error  : Unity Log] NullReferenceException: Object reference not set to an instance of an object
Stack trace:
ServerSideMap.ExplorationDatabase.PackBoolArray (System.Boolean[] arr, System.Int32 chunkId, System.Int32 startIndex, System.Int32 size) (at <34f8597ca0884df4a3f9dc910f122947>:0)
ServerSideMap.InitialMapSync.SendChunkToClient (ZRpc client, System.Int32 chunk) (at <34f8597ca0884df4a3f9dc910f122947>:0)
ServerSideMap.InitialMapSync+MinimapPatchSetMapData.Postfix (Minimap __instance) (at <34f8597ca0884df4a3f9dc910f122947>:0)
(wrapper dynamic-method) Minimap.DMD<Minimap::SetMapData>(Minimap,byte[])
(wrapper dynamic-method) Minimap.DMD<Minimap::LoadMapData>(Minimap)
Minimap.Update () (at <447b19510f604ca3807cd6cce3a7c1ef>:0)

[Info   : Unity Log] 08/26/2023 18:07:21: Unpacking compressed mapdata 11346

[Info   :ServerSideMap] ClientAppendPins 0
[Error  : Unity Log] NullReferenceException: Object reference not set to an instance of an object
Stack trace:
ServerSideMap.ExplorationDatabase.PackBoolArray (System.Boolean[] arr, System.Int32 chunkId, System.Int32 startIndex, System.Int32 size) (at <34f8597ca0884df4a3f9dc910f122947>:0)
ServerSideMap.InitialMapSync.SendChunkToClient (ZRpc client, System.Int32 chunk) (at <34f8597ca0884df4a3f9dc910f122947>:0)
ServerSideMap.InitialMapSync+MinimapPatchSetMapData.Postfix (Minimap __instance) (at <34f8597ca0884df4a3f9dc910f122947>:0)
(wrapper dynamic-method) Minimap.DMD<Minimap::SetMapData>(Minimap,byte[])
(wrapper dynamic-method) Minimap.DMD<Minimap::LoadMapData>(Minimap)
Minimap.Update () (at <447b19510f604ca3807cd6cce3a7c1ef>:0)

[Info   : Unity Log] 08/26/2023 18:07:29: Unpacking compressed mapdata 11346

[Info   :ServerSideMap] ClientAppendPins 0
[Error  : Unity Log] NullReferenceException: Object reference not set to an instance of an object
Stack trace:
ServerSideMap.ExplorationDatabase.PackBoolArray (System.Boolean[] arr, System.Int32 chunkId, System.Int32 startIndex, System.Int32 size) (at <34f8597ca0884df4a3f9dc910f122947>:0)
ServerSideMap.InitialMapSync.SendChunkToClient (ZRpc client, System.Int32 chunk) (at <34f8597ca0884df4a3f9dc910f122947>:0)
ServerSideMap.InitialMapSync+MinimapPatchSetMapData.Postfix (Minimap __instance) (at <34f8597ca0884df4a3f9dc910f122947>:0)
(wrapper dynamic-method) Minimap.DMD<Minimap::SetMapData>(Minimap,byte[])
(wrapper dynamic-method) Minimap.DMD<Minimap::LoadMapData>(Minimap)
Minimap.Update () (at <447b19510f604ca3807cd6cce3a7c1ef>:0)

[Info   : Unity Log] 08/26/2023 18:07:37: Unpacking compressed mapdata 11346

[Info   :ServerSideMap] ClientAppendPins 0
[Error  : Unity Log] NullReferenceException: Object reference not set to an instance of an object
Stack trace:
ServerSideMap.ExplorationDatabase.PackBoolArray (System.Boolean[] arr, System.Int32 chunkId, System.Int32 startIndex, System.Int32 size) (at <34f8597ca0884df4a3f9dc910f122947>:0)
ServerSideMap.InitialMapSync.SendChunkToClient (ZRpc client, System.Int32 chunk) (at <34f8597ca0884df4a3f9dc910f122947>:0)
ServerSideMap.InitialMapSync+MinimapPatchSetMapData.Postfix (Minimap __instance) (at <34f8597ca0884df4a3f9dc910f122947>:0)
(wrapper dynamic-method) Minimap.DMD<Minimap::SetMapData>(Minimap,byte[])
(wrapper dynamic-method) Minimap.DMD<Minimap::LoadMapData>(Minimap)
Minimap.Update () (at <447b19510f604ca3807cd6cce3a7c1ef>:0)

[Info   : Unity Log] 08/26/2023 18:07:45: Unpacking compressed mapdata 11346

[Info   :ServerSideMap] ClientAppendPins 0
[Error  : Unity Log] NullReferenceException: Object reference not set to an instance of an object
Stack trace:
ServerSideMap.ExplorationDatabase.PackBoolArray (System.Boolean[] arr, System.Int32 chunkId, System.Int32 startIndex, System.Int32 size) (at <34f8597ca0884df4a3f9dc910f122947>:0)
ServerSideMap.InitialMapSync.SendChunkToClient (ZRpc client, System.Int32 chunk) (at <34f8597ca0884df4a3f9dc910f122947>:0)
ServerSideMap.InitialMapSync+MinimapPatchSetMapData.Postfix (Minimap __instance) (at <34f8597ca0884df4a3f9dc910f122947>:0)
(wrapper dynamic-method) Minimap.DMD<Minimap::SetMapData>(Minimap,byte[])
(wrapper dynamic-method) Minimap.DMD<Minimap::LoadMapData>(Minimap)
Minimap.Update () (at <447b19510f604ca3807cd6cce3a7c1ef>:0)

[Info   : Unity Log] 08/26/2023 18:07:52: Unpacking compressed mapdata 11346

[Info   :ServerSideMap] ClientAppendPins 0
[Error  : Unity Log] NullReferenceException: Object reference not set to an instance of an object
Stack trace:
ServerSideMap.ExplorationDatabase.PackBoolArray (System.Boolean[] arr, System.Int32 chunkId, System.Int32 startIndex, System.Int32 size) (at <34f8597ca0884df4a3f9dc910f122947>:0)
ServerSideMap.InitialMapSync.SendChunkToClient (ZRpc client, System.Int32 chunk) (at <34f8597ca0884df4a3f9dc910f122947>:0)
ServerSideMap.InitialMapSync+MinimapPatchSetMapData.Postfix (Minimap __instance) (at <34f8597ca0884df4a3f9dc910f122947>:0)
(wrapper dynamic-method) Minimap.DMD<Minimap::SetMapData>(Minimap,byte[])
(wrapper dynamic-method) Minimap.DMD<Minimap::LoadMapData>(Minimap)
Minimap.Update () (at <447b19510f604ca3807cd6cce3a7c1ef>:0)

[Info   : Unity Log] 08/26/2023 18:08:00: Unpacking compressed mapdata 11346

[Info   :ServerSideMap] ClientAppendPins 0
[Error  : Unity Log] NullReferenceException: Object reference not set to an instance of an object
Stack trace:
ServerSideMap.ExplorationDatabase.PackBoolArray (System.Boolean[] arr, System.Int32 chunkId, System.Int32 startIndex, System.Int32 size) (at <34f8597ca0884df4a3f9dc910f122947>:0)
ServerSideMap.InitialMapSync.SendChunkToClient (ZRpc client, System.Int32 chunk) (at <34f8597ca0884df4a3f9dc910f122947>:0)
ServerSideMap.InitialMapSync+MinimapPatchSetMapData.Postfix (Minimap __instance) (at <34f8597ca0884df4a3f9dc910f122947>:0)
(wrapper dynamic-method) Minimap.DMD<Minimap::SetMapData>(Minimap,byte[])
(wrapper dynamic-method) Minimap.DMD<Minimap::LoadMapData>(Minimap)
Minimap.Update () (at <447b19510f604ca3807cd6cce3a7c1ef>:0)

[Info   : Unity Log] 08/26/2023 18:08:07: Unpacking compressed mapdata 11346

[Info   :ServerSideMap] ClientAppendPins 0
[Error  : Unity Log] NullReferenceException: Object reference not set to an instance of an object
Stack trace:
ServerSideMap.ExplorationDatabase.PackBoolArray (System.Boolean[] arr, System.Int32 chunkId, System.Int32 startIndex, System.Int32 size) (at <34f8597ca0884df4a3f9dc910f122947>:0)
ServerSideMap.InitialMapSync.SendChunkToClient (ZRpc client, System.Int32 chunk) (at <34f8597ca0884df4a3f9dc910f122947>:0)
ServerSideMap.InitialMapSync+MinimapPatchSetMapData.Postfix (Minimap __instance) (at <34f8597ca0884df4a3f9dc910f122947>:0)
(wrapper dynamic-method) Minimap.DMD<Minimap::SetMapData>(Minimap,byte[])
(wrapper dynamic-method) Minimap.DMD<Minimap::LoadMapData>(Minimap)
Minimap.Update () (at <447b19510f604ca3807cd6cce3a7c1ef>:0)

[Info   : Unity Log] 08/26/2023 18:08:15: Unpacking compressed mapdata 11346

[Info   :ServerSideMap] ClientAppendPins 0
[Error  : Unity Log] NullReferenceException: Object reference not set to an instance of an object
Stack trace:
ServerSideMap.ExplorationDatabase.PackBoolArray (System.Boolean[] arr, System.Int32 chunkId, System.Int32 startIndex, System.Int32 size) (at <34f8597ca0884df4a3f9dc910f122947>:0)
ServerSideMap.InitialMapSync.SendChunkToClient (ZRpc client, System.Int32 chunk) (at <34f8597ca0884df4a3f9dc910f122947>:0)
ServerSideMap.InitialMapSync+MinimapPatchSetMapData.Postfix (Minimap __instance) (at <34f8597ca0884df4a3f9dc910f122947>:0)
(wrapper dynamic-method) Minimap.DMD<Minimap::SetMapData>(Minimap,byte[])
(wrapper dynamic-method) Minimap.DMD<Minimap::LoadMapData>(Minimap)
Minimap.Update () (at <447b19510f604ca3807cd6cce3a7c1ef>:0)

[Info   : Unity Log] 08/26/2023 18:08:22: Unpacking compressed mapdata 11346

[Info   :ServerSideMap] ClientAppendPins 0
[Error  : Unity Log] NullReferenceException: Object reference not set to an instance of an object
Stack trace:
ServerSideMap.ExplorationDatabase.PackBoolArray (System.Boolean[] arr, System.Int32 chunkId, System.Int32 startIndex, System.Int32 size) (at <34f8597ca0884df4a3f9dc910f122947>:0)
ServerSideMap.InitialMapSync.SendChunkToClient (ZRpc client, System.Int32 chunk) (at <34f8597ca0884df4a3f9dc910f122947>:0)
ServerSideMap.InitialMapSync+MinimapPatchSetMapData.Postfix (Minimap __instance) (at <34f8597ca0884df4a3f9dc910f122947>:0)
(wrapper dynamic-method) Minimap.DMD<Minimap::SetMapData>(Minimap,byte[])
(wrapper dynamic-method) Minimap.DMD<Minimap::LoadMapData>(Minimap)
Minimap.Update () (at <447b19510f604ca3807cd6cce3a7c1ef>:0)

rc1-1.2.1 -- possible random client crashes?

Since updating, myself and one of my players have experienced random client freeze/crash to desktop. There are no log entries in the player log or server log to indicate what happened. Upon re-joining the game, inventory and player location is reset to what it was at previous login. The only change to our server/client environment is this mod update. Is there a way to get debug logging from the mod, or all the mods?

The crashes are infrequent (twice in 6 hours for my friend, twice in about 6 hours for me) so I've disabled the mod again to see if I continue to observe the crashes. But with no evidence of an issue in the logs I'm not sure how I could correlate the crash to anything in particular. (we also enabled pin sharing last night. Unsure if that could have anything to do with it.)

Cant get the Serversidemap to work

Hi, so im hosting a server and cant get the mod to work, i have it both server and client side, i tried everything from reinstalling it, changing configs etc. I could use some help. Thanks

[Issue] Map markers disappearing after exiting and entering world

Hey Mydayyy :)

Since the Mistlands update, the markers you place on the map are no longer shared or even saved. You can place them and they'll be gone the next time you log in.

Reproducing

  1. Enable the EnableMarkerShare in the config file
  2. Go into a world
  3. Place some markers
  4. Log out
  5. Log back in, and realize the markers are gone

I guess you probably don't maintain this mod anymore, but I'd really appreciate it if you had the time to look into it.

Thanks a lot!

Update Destroyed Server Map

Really not sure if this is a game issue or a mod issue. With the new update, i have updated both client and server. I did not think that it would cause issues with this mod since the updates had nothing to do with the maps, but somehow all markers from my game have completely erased. It almost looks like it returned to an old instance of the map from the game as far as the markers go. All of my own markers disappeared which makes me wonder if this is a game glitch. The map as far as discovered area being uncovered is still, there, just the markers are gone. If you have any insight as to what to look for to assist with troubleshooting i would be happy to provide anything you need. I went through the logs and both client and server are running with matching config files.
1: Client Side Logs
2: Server Side Logs
LogOutput.log
LogOutput.log

Cannot connect to server when mod is active, similar to #18

Hello. I'm running a server with several players and had been using your mod for the past 10 or so days without issue, it has improved our experience very much, so thank you!

Today I noticed that the Valheim service had been running out of memory and crashing, so I allocated more RAM to the server. After that I tried joining the server as a player only to be met with timeouts like those described in issue #18 . (I did not try connecting to the server in-game today before this so I'm unsure when the timeout problem began).

While troubleshooting with another player we observed that these timeout only occur while this mod (the only mod installed on the server) is active; removing the dll from the plugins folder allows us to connect. I also noticed that the .explored file on the server was 0 bytes; looking through world backups this appears to have changed some point between yesterday and today. There was quite a bit of exploring done yesterday so I'm wondering if this triggered some kind of issue with the file.

Unlike issue #18 , removing the .explored file and allowing the server to generate a new one does not allow us to connect.

I'm running on a Ubuntu 20.04.2 LTS server with the latest Valheim software and BepInEx packages installed, as well as 1.2.1 of ServerSideMap. I've attached the most recent copy of the .explored file I have before it went blank, from yesterday morning before the aforementioned exploring.

Poopsylvannia.mod.serversidemap.zip

error due to the latest valheim patch

Hello Mydayyy!

After the last patch I'm getting this error in the console

[Warning:  HarmonyX] AccessTools.DeclaredMethod: Could not find method for type Minimap and name AddPin and parameters (UnityEngine.Vector3, Minimap+PinType, string, bool, bool, long)
[Error  : Unity Log] InvalidProgramException: Invalid IL code in (wrapper dynamic-method) ServerSideMap._Minimap:DMD<ServerSideMap._Minimap::AddPin> (Minimap,UnityEngine.Vector3,Minimap/PinType,string,bool,bool,long): IL_000f: add


Stack trace:
System.RuntimeMethodHandle.GetFunctionPointer () (at <695d1cc93cca45069c528c15c9fdd749>:0)
MonoMod.RuntimeDetour.Platforms.DetourRuntimeILPlatform.GetFunctionPointer (System.Reflection.MethodBase method, System.RuntimeMethodHandle handle) (at <4e2760c7517c4ea79c633d67e84b319f>:0)
MonoMod.RuntimeDetour.Platforms.DetourRuntimeILPlatform.GetNativeStart (System.Reflection.MethodBase method) (at <4e2760c7517c4ea79c633d67e84b319f>:0)
MonoMod.RuntimeDetour.DetourHelper.GetNativeStart (System.Reflection.MethodBase method) (at <4e2760c7517c4ea79c633d67e84b319f>:0)
MonoMod.RuntimeDetour.Detour._TopApply () (at <4e2760c7517c4ea79c633d67e84b319f>:0)
MonoMod.RuntimeDetour.Detour._RefreshChain (System.Reflection.MethodBase method) (at <4e2760c7517c4ea79c633d67e84b319f>:0)
MonoMod.RuntimeDetour.Detour.Apply () (at <4e2760c7517c4ea79c633d67e84b319f>:0)
MonoMod.RuntimeDetour.Detour..ctor (System.Reflection.MethodBase from, System.Reflection.MethodBase to, MonoMod.RuntimeDetour.DetourConfig& config) (at <4e2760c7517c4ea79c633d67e84b319f>: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>?824839168(object)
HarmonyLib.Internal.RuntimeFixes.StackTraceFixes.OnILChainRefresh (System.Object self) (at <474744d65d8e460fa08cd5fd82b5d65f>:0)
MonoMod.RuntimeDetour.ILHook.Apply () (at <4e2760c7517c4ea79c633d67e84b319f>:0)
HarmonyLib.PatchFunctions.ReversePatch (HarmonyLib.HarmonyMethod standin, System.Reflection.MethodBase original, System.Reflection.MethodInfo postTranspiler, System.Reflection.MethodInfo postManipulator) (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>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 <9cdf6fb653304c9e9aa8601778e37152>:0)
UnityEngine.GameObject:AddComponent(Type)
BepInEx.Bootstrap.Chainloader:Start()
UnityEngine.UI.Graphic:get_canvas()
TMPro.TextMeshProUGUI:OnCanvasHierarchyChanged()

Please merge with Valheim Plus

I would greatly appreciate it.
Benefits include wider deployment, large developer/user community and less mods for users to install to join public servers (1 would be ideal).

V+ is always looking for more developers and will welcome you with open arms. V+ is already using github so merging efforts will be super easy.

Thank you for this amazing mod

Incompatibility with Universal Portals

Reported on NexusMods:

first off, AMAZING mod! Biggest thanks for this! Second, we have been using this on our dedicated server for a while now, with no issues, but when we added a few mods, we noticed one incompatibility I felt should be mentioned. Universal Portals, first config option (something about map pins) makes all the map pins we've set disappear permanently. Gone forever, poof. NBD on this map as we're just starting so there's only about 4 pins right now, but later, or on our other map, would be catastrophic. Is there a way that map pins could be backed up without saving a copy of the map from the user files? I've turned off the option on the other mod, and map pins are saving again, but I wanted to be sure to report this so others don't loose their pins.

[Minor Typo] Typo in the generated config file

Hey Mydayyy, again, much thanks for the great mod. Appreciate it a lot 👍

In the v1.3.0 generated config file, eu.mydayyy.plugins.serversidemap.cfg, the description still says:

A local pin will not be uploaded if a pin exists in the given radius on the server (when using /convertpins removelocaldupes)

It should be

A local pin will not be uploaded if a pin exists in the given radius on the server (when using /convertpins ignorelocaldupes)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.