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.
FiresSteamworksPatcher
BepInEx preloader patcher for FiresGhettoNetworking: adds the missing Steamworks recv-buffer enum members and raises the ZDOMan.SendZDOs queue cap so FGN's tuning reaches its full ceiling. Runs on servers and clients wherever FGN is installed.
| Date uploaded | a week ago |
| Version | 1.1.0 |
| Download link | VerdantsAscent-FiresSteamworksPatcher-1.1.0.zip |
| Downloads | 118 |
| Dependency string | VerdantsAscent-FiresSteamworksPatcher-1.1.0 |
This mod requires the following mods to function
denikson-BepInExPack_Valheim
BepInEx pack for Valheim. Preconfigured and includes unstripped Unity DLLs.
Preferred version: 5.4.2202VerdantsAscent-FiresGhettoNetworking
Comprehensive networking + server-authority mod with ZDO delta compression, WearNTear server/client CPU skips for invulnerable pieces, AoI-filtered RPC broadcasts, and a built-in per-client config auto-tuner.
Preferred version: 1.3.0README
FiresSteamworksPatcher
BepInEx preloader patcher that makes two surgical changes to Valheim's bundled assemblies, so FiresGhettoNetworking can use the Steam networking knobs and ZDO queue sizes it ships configs for. Install it wherever FGN runs — the dedicated server and every client.
This package only does anything when both of these are true on the machine:
- FiresGhettoNetworking is installed (a
*GhettoNetwork*.dllis present anywhere underBepInEx/plugins/). - BepInEx loads the patcher at preload (i.e. the DLL is in
BepInEx/patchers/).
If FGN isn't present, the patcher writes a single log line and touches nothing — it has no effect of its own and no config file to tune.
Need help, found a bug, want a feature? https://discord.gg/H9uKGcAujs
What it patches
| Target | What it does |
|---|---|
Steamworks.ESteamNetworkingConfigValue (in com.rlabrecque.steamworks.net.dll) |
Adds four missing enum literals — k_ESteamNetworkingConfig_RecvBufferSize (47), RecvBufferMessages (48), RecvMaxMessageSize (49), RecvMaxSegmentsPerPacket (50). Valheim ships an older Steamworks SDK that doesn't expose these; without them, FGN's recv-buffer config knobs would throw MissingFieldException when it looks them up via reflection. |
ZDOMan.SendZDOs (in assembly_valheim.dll) |
Locates the outbound send-queue cap constant (10240 bytes in vanilla) near a GetSendQueueSize call and rewrites it to 102400 (10×). FGN's per-peer send-rate tiers can configure Steam to push far past vanilla rates; the 10 KB queue caps that ceiling regardless of what Steam will accept. This bump lets the queue actually hold a frame of high-tier traffic. |
Both edits are done via Cecil at preload time — BEFORE Harmony exists, BEFORE any plugin Awakes. There's no Harmony-equivalent for either patch:
- The Steamworks enum members are missing from the types Valheim ships, so no Harmony patch could surface them — you can't
__instance.SomeField = …if the field doesn't exist in the loaded assembly. - The ZDO queue cap is a const-int load (
ldc.i4) inside an IL branch. Harmony can transpile that, but the transpiler IL search and re-emit is heavier than rewriting one constant at preload.
Where it helps — server and client
Earlier builds gated this patcher to dedicated servers only. As of 1.1.0 it runs anywhere FGN is installed, because both edits pull their weight on the client too:
- Dedicated server — the heavy outbound sender: it pushes ZDO updates to every peer each tick and configures a Steam socket per connection. The recv-buffer enums size its accept-from-peer receive buffers, and the
SendZDOsqueue cap raises its outbound ceiling during initial-sync floods. - Client — a client receiving a high-throughput server (FGN's HyperBoost or high AutoTune tiers push well past vanilla rates) needs matching receive headroom or it bottlenecks on ingest. The recv-buffer enums are what let FGN enlarge the client's receive buffers to keep up. The
SendZDOsqueue cap is a smaller win client-side — a client sends comparatively little — but it's harmless and applies in the cases where a client does own and push more.
Without this patcher, FGN still runs: its recv-buffer settings simply cap at Steam's defaults instead of erroring. The patcher is what unlocks the full receive ceiling on both ends.
FGN gate
The patcher scans BepInEx/plugins/ recursively for any DLL whose name matches *GhettoNetwork*.dll. If nothing matches:
TargetDLLsreturns an empty list, so BepInEx never loads Cecil for Steamworks / assembly_valheim.- Defensively,
Patch()also short-circuits if it's somehow called anyway. - A single log line is written:
FiresGhettoNetworking not detected … will not patch any assemblies.
This gate exists because the enum additions are inert without FGN reading them, and the queue-cap raise is small on its own — the win comes from pairing both with FGN's send-rate tiers. Shipping the patcher to a non-FGN install would be a no-op at best, so the gate keeps it from quietly altering other networking mods' headroom.
The gate is evaluated once per process and cached — one Directory.GetFiles(... AllDirectories) at startup, then nothing.
Installation
Install on every machine running FGN — the dedicated server and each client:
- Install BepInEx — the BepInExPack_Valheim on Thunderstore is the standard one.
- Install FiresGhettoNetworking — this patcher does nothing without it.
- Install this package. The
patchers/folder from the zip drops intoBepInEx/so the DLL lands atBepInEx/patchers/<author>-FiresSteamworksPatcher/patchers/FiresSteamworksPatcher.dll. r2modman / Thunderstore Mod Manager handle this automatically. - Restart the game / server.
Preloader patchers have no config file — there's nothing to tune. Either FGN is present and the two patches land, or it isn't and the patcher idles.
Where to install
| Side | Install the patcher? |
|---|---|
| Dedicated server | ✓ — sizes accept-from-peer recv buffers + raises the outbound queue cap |
| Client | ✓ — sizes the client's recv buffers to keep up with a high-throughput server |
| Listen-server host (hosting via the in-game menu) | ✓ — acts as both server and client; install it like any client |
Compatibility
- FiresGhettoNetworking — designed for. If FGN is installed, the patcher activates; if not, it's a no-op.
- BetterNetworking / Serverside Simulations / any other networking overhaul — the FGN gate ensures we won't accidentally alter them. If you uninstall FGN to try another mod, this patcher detects it's gone and stops patching on the next launch.
- Other preloader patchers — coexists. Cecil load order is deterministic (alphabetical by patcher folder). Our edits are additive (one new enum member set, one constant rewrite) and don't conflict with anything I'm aware of.
License
MIT — see LICENSE.
Issues / questions
CHANGELOG
-
v1.1.1 packaging fix — installs to BepInEx/patchers/ correctly
- Fixed the Thunderstore package layout: the patcher DLL now sits inside a
patchers/folder, so mod managers install it toBepInEx/patchers/instead ofBepInEx/plugins/. The 1.1.0 package shipped the DLL at the zip root, which r2modman/Thunderstore route toplugins/— where a preloader patcher never runs. - No code change: identical client + server patcher to 1.1.0, just packaged correctly.
- Fixed the Thunderstore package layout: the patcher DLL now sits inside a
-
v1.1.0
- The patcher now runs on clients as well as dedicated servers — anywhere FiresGhettoNetworking is installed. The previous dedicated-server-only process gate is gone; the FGN-presence check is the only remaining gate.
- Why the client matters now: FGN's receive-buffer settings apply on the client too. A client needs matching receive headroom to keep up with a high-throughput server (HyperBoost / high AutoTune tiers push well past vanilla rates), and the patched enum members are what let FGN enlarge the client's receive buffers. Without the patcher those settings cap at Steam's defaults instead of erroring.
- No change to what gets patched: same recv-buffer enum members and the same ZDOMan.SendZDOs queue-cap raise (10240 -> 102400) as 1.0.0.
-
v1.0.0 first release
- Adds the missing Steamworks recv-buffer enum members (RecvBufferSize / RecvBufferMessages / RecvMaxMessageSize / RecvMaxSegmentsPerPacket) to Steamworks.ESteamNetworkingConfigValue at preload time, so FGN can wire its recv-buffer config knobs without crashing on missing enum values.
- Raises ZDOMan.SendZDOs outbound queue cap from 10240 to 102400 bytes (10x) by rewriting the constant in IL. Lets FGN's send-rate tier presets actually push more data per tick.
- Dedicated-server gate: process name has to contain "server" (matches valheim_server.exe / valheim_server.x86_64 / user-renamed variants) or the patcher exits early and touches nothing. Both patches only affect server-side network behavior so a client install would be wasted IL rewrites and the gate keeps the impact strictly where it's intended.
- FGN-presence gate: if no DLL matching
*GhettoNetwork*.dllis found underBepInEx/plugins/, the patcher exits early. Both gates are checked in TargetDLLs (so BepInEx never even loads Cecil) and again defensively in Patch().