Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
ValheimRAFT Rewben
Rewben ValheimRAFT fork: native portal synchronization repairs and RaftRebalance behavior.
| Date uploaded | 3 weeks ago |
| Version | 5.1.108 |
| Download link | rewbensandwich-ValheimRAFT_Rewben-5.1.108.zip |
| Downloads | 177 |
| Dependency string | rewbensandwich-ValheimRAFT_Rewben-5.1.108 |
This mod requires the following mods to function
ValheimModding-Jotunn
Jötunn (/ˈjɔːtʊn/, 'giant'), the Valheim Library was created with the goal of making the lives of mod developers easier. It enables you to create mods for Valheim using an abstracted API so you can focus on the actual content creation.
Preferred version: 2.30.2README
ValheimRAFT Rewben
ValheimRAFT with native ship-portal synchronization fixes and integrated RaftRebalance behavior. Based on upstream ValheimRAFT 5.1.1.
Thunderstore package and runtime fork: 5.1.108. Every player can audit and repair ship portals, with server-enforced cooldowns and one cleanup job at a time. The server also automatically cleans up duplicate ship portals every ten minutes, without an admin online. Cleanup runs in small networked batches. Manual audits and repairs remain available. Update both the server and every client to 5.1.108 before connecting.
Installation
- Close Valheim and back up your profile and world before replacing mods.
- Remove upstream ValheimRAFT and the separate RaftRebalance plugin. When moving from a local ZIP installation to Thunderstore, remove that local fork copy too.
- Install rewbensandwich-ValheimRAFT_Rewben through Gale or another compatible
mod manager. Keep Jotunn installed. Manual installations place the contents of
this ZIP's
pluginsdirectory in a dedicated BepInEx plugins subdirectory. - All players and the server must use the same runtime fork version. Keep the
existing RAFT configuration and legacy
vhrf.RaftRebalance.cfgfor migration.
The first fork startup migrates settings once, preserving unrelated settings.
Rebalance controls are under [Rebalance] and [Rebalance Recipes] in RAFT's
configuration. [Rebalance Migration] Schema = 1 records completion. Remove
RaftRebalance's DLL; keeping its old configuration file is safe after migration.
Changes
- Ship portals keep their network IDs while their position and rotation update. Registry membership and tracking are deduplicated; duplicate live instances of the same record are guarded. TargetPortal-managed portals bypass vanilla pairing.
- Native rebalance policy caps hull clearance at 1.5 meters by default, disables flight/ballast under the policy, restricts administrative commands, and allows ordinary creative editing with at most 5 meters of lift.
- Rams target creatures. Cannon harvesting restrictions preserve damage to creatures, spawners and player buildings. Hauling uses 10 stamina per meter by default and stops at exhaustion.
- Supplied recipe overrides and
vhrf_paid_v1refund markers are supported.
Automatic portal maintenance
In zolantris.ValheimRAFT.cfg on the server:
[Portal Maintenance]
CleanupIntervalMinutes = 10
The default is ten minutes; use any whole number from 1 to 1440, or 0 to disable.
This is a synchronized admin-only setting. A new world session or changed interval
waits two minutes before its first pass (one minute for a one-minute interval).
Later passes use the configured interval. The timer runs on the server's main
thread independently of world saves and includes unloaded ships. No player or
admin needs to be connected. The setting takes effect when the config is loaded
or changed through the admin configuration UI; restart after editing a file offline.
Automatic cleanup uses the same saved-record matching as manual --dedupe:
same ship, portal prefab, coordinate frame and ship-relative position within 1 mm.
One portal survives each group, preferring a named portal; missing or invalid
local coordinates are skipped. Ordinary land portals and distinct ship portals
are preserved. As with manual dedupe, intentionally colocated portals count as
duplicates even if their tags differ. Disable automation if you need those stacks.
Back up the world before installing: automatic saved-record deletion is enabled
by default and cannot be undone through a console command.
Each deletion batch revalidates both selected records and their keepers. Cleanup yields between batches, waits for network deletion acknowledgements, and cannot overlap a manual cleanup. Disabling the setting stops further automatic batches; already queued deletions can finish. Failed or interrupted passes retry with a fresh selection at the next interval. Cleanup also repairs registry membership and extra live instances, then refreshes connected clients and TargetPortal.
The exact automatic keep/remove mapping and result are saved before deletion in
BepInEx/config/PortalAudits/automatic-latest.txt; the preceding deletion report
is retained as automatic-previous.txt. Clean passes create no report files.
Server logs show scan counts and cleanup completion/failure. No resources are
refunded. Manual audit files are retained separately.
Portal auditing and manual repair
F5 console commands available to every connected player (no admin or devcommands required):
vehicle portals audit [ship-id]
vehicle portals repair <audit-id>
vehicle portals repair <audit-id> --dedupe --confirm
vehicle portals repair <audit-id> --remove <record-id>,<record-id> --confirm
An audit prints its total and at most ten saved portal records. The final line
repeats AUDIT ID: A1B2C3 with the total portal count. IDs are six characters,
accept uppercase or lowercase, and expire after five minutes. They belong to the
requesting player's current connection; reconnecting requires a new audit. A new
audit replaces that player's previous active token. Complete
reports are saved on the server under BepInEx/config/PortalAudits/<id>.txt.
The client prints only a small loaded-instance counter, not another full report.
Periodic diagnostics also print counters without formatting all record details.
Reports include saved records, live instances, positions, ship IDs and registry
anomalies, plus duplicateGroups and duplicateRecords. The full file records
every saved ID, its unrounded local position, and the ID selected to survive.
Audit is read-only. To remove its detected extra saved records, run the printed
repair <id> --dedupe --confirm command. It matches the same ship, portal prefab,
coordinate frame and local 3D position within 1 mm. Missing/invalid local positions
are skipped. It keeps one named portal where available, then chooses a stable ID.
World-position rounding and ship-center coordinates are not used for selection.
Cleanup yields between batches of at most 32 and waits for Valheim to acknowledge
deletions. Keep the requesting player connected until CLEANUP <id> COMPLETE appears. A changed
record, moved keeper, disconnected requester or world change stops further work; run a
fresh audit before continuing. These connection requirements apply to manual
jobs; automatic maintenance runs without an admin session. Basic manual repair
without deletion flags still preserves saved records. Automatic maintenance can
invalidate an older audit by removing its duplicates; request a fresh audit then.
Repairs provide no resource refunds. TargetPortal's temporary pins are cleared
after repair; close and reopen the portal map to refresh it.
The server enforces a shared five-second cooldown between audit scans and a separate five-second cooldown between repair attempts. A player can audit and immediately run the printed repair command if no previous repair is cooling down. Repair attempts with a valid owned audit reserve the cooldown even if later validation fails. Saved-record cleanup holds a shared job lock until deletion acknowledgements and final refresh finish, then waits another five seconds before another repair. Automatic maintenance uses the same lock and repair cooldown.
Requests during an active cleanup return its ID/progress; cooldown replies give
the remaining wait. No request is queued or replayed later. Retry after completion
or the stated cooldown; a blocked request does not consume its audit token.
If cleanup changed its records, run a new audit. The server executes requests
serially on its main thread, so simultaneous players cannot start competing jobs.
The --remove form remains available to all players too: it selects specific
ship-portal records from their own audit, not only position duplicates, and still
requires --confirm. Automatic interval settings remain admin-only.
Status and source
Runtime 5.1.102 previously completed dedicated-server startup and configuration migration. Runtime 5.1.104 completed dedicated-server startup. Runtime 5.1.108 passes headless regression checks, including a 16,248-record confirmed cleanup, automatic scheduling, public audit/repair access, overlapping player/automatic requests, cooldowns, cancellation and report rotation. Built against local Valheim 1.0.21. Dedicated-server startup and multiplayer validation of 5.1.108 remain pending. Tests use inspected game contracts and do not simulate Unity networking or establish that all reported disconnects are resolved.
Source, maintenance, full snapshot rollback and upstream update instructions: Rewben/ValheimMods.
Licensing and attribution
ValheimRAFT/ValheimMods is by zolantris and contributors, retaining earlier
ValheimRAFT contributions by Sarcen and others. This fork retains GPL-3.0 licensing
and attribution. See LICENSE. RaftRebalance 1.2.0 (vhrf) contributed the balance
policy, recipes, migration keys and paid-cost compatibility requirements.
ServerSync v1.20 is bundled under its included license; only its unsigned PE debug
filename has been sanitized. See ServerSync.PROVENANCE.md.
The archive contains runtime mod assemblies, mod assets and public documentation. It does not include player saves, profile backups, server configs, logs, private deployment scripts, credentials, game reference assemblies or debug-symbol files.
CHANGELOG
Changelog
Package and runtime 5.1.108
- Open portal audit and every repair form to all connected players, including non-admin clients and local hosted players. No admin or devcommands required. Other administrative vehicle commands and interval settings retain their locks.
- Serialize manual and automatic cleanup with the same server job lock. Requests during cleanup return progress instead of creating a competing or queued job.
- Enforce global five-second audit and repair cooldowns independently, so audit can be followed immediately by repair. Revalidate snapshots only after reserving the repair slot; extend the repair cooldown through five seconds after completion.
- Keep audit ownership/expiry and explicit deletion confirmation. Retain at most one active audit per player connection; new audits replace that player's token. Cooldown/busy rejections preserve tokens. Stale audits require a fresh scan.
- Deliver progress/completion to non-admin requesters. Disconnects stop further batches for manual jobs. Unknown/disconnected RPC senders cannot request work.
- Add regression tests for simultaneous players, jobs lasting beyond the cooldown, automatic/manual contention, public client/host/explicit-ID access, requester ownership, disconnects and audit cooldowns. Server and clients need 5.1.108.
Package and runtime 5.1.107
- Add server-side automatic ship-portal cleanup, enabled every ten minutes by
default. Configure
[Portal Maintenance] CleanupIntervalMinutesfrom 1 to 1440;0disables it. No admin needs to be connected. First pass waits up to two minutes after world load or interval changes; world saves are unaffected. - Reuse the manual 1 mm ship/prefab/coordinate-frame duplicate selection and batched, acknowledged network deletion. Preserve keepers, recheck each batch, skip invalid positions, and serialize automatic/manual cleanup jobs.
- Write exact selections before deletion and retain the latest two automatic reports. Log results and retry failures at the next interval. Disable mid-job to stop new batches. Repair registries/live copies and refresh clients.
- Keep manual audit/repair commands and their admin permissions. An automatic pass can invalidate a prior manual audit; request a new audit when that happens.
- Add production-code regression coverage for scheduling, repeated passes, no-admin operation, client exclusion, config changes, cancellation, stale audits, report failures/rotation and preservation of distinct portals.
- Build against Valheim 1.0.21. Server and all clients must update to 5.1.107. Live dedicated-server and multiplayer acceptance remain pending.
Package and runtime 5.1.106
- Rebuild TargetPortal's cached portal set after explicit cleanup, including dead pooled ZDOs whose network IDs and hash codes changed. Clear temporary map pins after rebuilding so the deleted records cannot recreate them before the next TargetPortal refresh.
- Match the game record's mutable-ID equality/hash behavior in regression doubles and verify stale pooled records are removed while the surviving portal remains.
- Includes the confirmed position cleanup introduced in 5.1.105. Server and all clients must use 5.1.106. No saved-record cleanup runs during installation.
Package and runtime 5.1.105
- Audit position-based saved-portal duplicates using ship, prefab, coordinate frame and unrounded local 3D position with a 1 mm tolerance. Keep one portal per group; missing or invalid local positions are excluded from cleanup.
- Print duplicate counts and the exact short-ID
--dedupe --confirmcommand. Audit stays read-only; complete keep/remove selections remain in the report. - Delete only after explicit admin confirmation, in batches of at most 32 with network deletion acknowledgements. Stop on changed records, keepers, sessions or worlds. Append repair selections/results to the audit file without refunds.
- Rebuild portal registries in one pass and detach deletion batches efficiently. Replace the large repair-ID broadcast with a compact registry refresh signal.
- Clear TargetPortal's temporary map pins and prune stale cached records after repair. Unrelated saved map pins are unaffected.
- Add production-code tests for large cleanup, position boundaries, invalid coordinates, different ships/types, confirmation, cancellation and map refresh.
- Server and clients must all update to runtime 5.1.105.
Package and runtime 5.1.104
- Limit the server audit preview to ten portal records and show the total count and audit ID prominently at both the start and end of the response.
- Replace the client's unbounded full-record dump with a small loaded-instance
counter. Preserve complete server reports in
PortalAudits/<id>.txt. - Use six-character, case-insensitive audit IDs with collision checks against active audits and saved report filenames. Keep admin/session ownership and five-minute expiry checks.
- Periodic portal diagnostics no longer format a full per-record report only to discard it and print the first line.
- Add regression coverage using the production audit commands with 16,248 saved records. Existing saved portals and deletion rules remain unchanged.
- Server and clients must all update to runtime 5.1.104.
Package 5.1.103 / runtime 5.1.102
- Put runtime DLLs and their Assets hierarchy under an explicit
plugins/folder so Gale/r2modman preserve sail textures and translations. - Rebuild with virtual source paths and without debug symbols.
- Remove the bundled ServerSync binary's original machine-specific CodeView path; executable code, assembly identity and public attribution are retained.
- Ship public installation documentation instead of developer build/deployment notes.
- Validate allowed files, privacy patterns, checksums and asset placement before accepting the final ZIP. No changes to gameplay, saved identifiers or runtime network version are included in this packaging release.
Runtime 5.1.102
- Fix the deployment check's false alarm on the container's informational log-filter declaration and return startup evidence over the deployment connection.
Runtime 5.1.101
- Initial fork integrating portal synchronization corrections, TargetPortal pairing compatibility, admin portal tools and native RaftRebalance policy/migration/refunds.