jg224-BoatMapExploreRadiusServerSync icon

BoatMapExploreRadiusServerSync

Server-authoritative BoatExploreRadius for BiggerBoatMapExploreRadius. Server pushes radius to clients via ServerSync. Fixes the FieldAccessException in 224-ServerSyncedBoatMapExploreRadius.

By jg224
Last updated 2 days ago
Total downloads 52
Total rating 0 
Categories Mods Server-side
Dependency string jg224-BoatMapExploreRadiusServerSync-1.0.0
Dependants 0 other packages depend on this package

This mod requires the following mods to function

denikson-BepInExPack_Valheim-5.4.2202 icon
denikson-BepInExPack_Valheim

BepInEx pack for Valheim. Preconfigured and includes unstripped Unity DLLs.

Preferred version: 5.4.2202
nearbear-BiggerBoatMapExploreRadius-1.0.3 icon
nearbear-BiggerBoatMapExploreRadius

This is a Bepinex mod for Valheim that increases the exploration radius while in a boat.

Preferred version: 1.0.3

README

BoatMapExploreRadiusServerSync

A server-authoritative wrapper for nearbear's BiggerBoatMapExploreRadius.

The dedicated server owns the BoatExploreRadius value, pushes it to every client on connect via ServerSync, and writes it into nearbear's config at runtime. Clients cannot override the radius locally.

Why this exists

The 224-ServerSyncedBoatMapExploreRadius fork crashes on recent Valheim builds with FieldAccessException: Field 'Minimap:m_exploreTimer' is inaccessible, which spams the log every frame and prevents the map from opening. This wrapper achieves the same server-authoritative behavior without patching Minimap at all, so the bug is structurally impossible.

Requirements

Do NOT install alongside 224-ServerSyncedBoatMapExploreRadius — pick one. This mod supersedes it.

Install

  1. Install both required dependencies above (r2modman will handle this automatically).
  2. Install this mod.
  3. On the dedicated server, edit the config (see below) to set your radius.
  4. Restart the server.
  5. Clients just connect — no client-side config needed.

Configuration

Located in BepInEx/config/JG224_BoatMapExploreRadiusServerSync.cfg (auto-generated on first boot):

Setting Default Range Description
BoatExploreRadius 200 10-10000 Map reveal radius in meters while sailing. Synced from the server.
LockConfiguration true bool When true, the server's BoatExploreRadius is authoritative and clients cannot change it locally.

How to set the radius

  1. On the dedicated server, open BepInEx/config/JG224_BoatMapExploreRadiusServerSync.cfg.
  2. Set BoatExploreRadius = <your value>. Leave LockConfiguration = true.
  3. Restart the server.
  4. When clients connect, they automatically receive the server's value — no client-side edit required.

If you'd rather let each player keep their own radius, set LockConfiguration = false on the server. Clients will then use whatever is in their local config file.

How it works

On Awake, this plugin:

  1. Creates a ServerSync.ConfigSync instance registered under GUID JG224_BoatMapExploreRadiusServerSync.
  2. Registers BoatExploreRadius and LockConfiguration as synced config entries.
  3. Locates BiggerBoatMapExploreRadius.Main.boatExploreRadius (a public static ConfigEntry<float>) via reflection.
  4. Subscribes to BoatExploreRadius.SettingChanged, so any update received from the server is pushed into nearbear's config immediately.

nearbear's existing postfix on Minimap.UpdateExplore reads Main.boatExploreRadius.Value every frame, so the synced value takes effect automatically — no Minimap patch of our own, so no FieldAccessException.

ServerSync license

ServerSync by blaxxun-boop is distributed under the MIT-0 license and bundled inside this mod's DLL.

Credits

Source

Available on request. The wrapper is ~120 lines of C#; the bulk of the work is done by nearbear's mod and blaxxun-boop's ServerSync.

Changelog

1.0.0

  • Initial release.
  • Fork of the broken 224-ServerSyncedBoatMapExploreRadius approach, restructured to avoid the FieldAccessException bug by not patching Minimap directly.