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 ser
About this mod Author’s original text
FiresSteamworksPatcher
Updated for Valheim 1.0.
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.
FiresGhettoNetworking is required, but not listed as a dependency. Earlier versions of this package listed
FGN as a dependency, which pinned a specific FGN version: every FGN update meant a new patcher release, and an
outdated pin could pull in an old FGN that no longer works on the current game. The dependency was removed so the
patcher never has to change when FGN does. You still need FGN installed for this patcher to do anything -
without it the patcher writes one log line and patches nothing.
This package only does anything when both of these are true on the machine:
- FiresGhettoNetworking is installed (a GhettoNetwork.dll is present anywhere under BepInEx/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?
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 SendZDOs queue 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 SendZDOs queue 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:
- TargetDLLs returns an empty
Install & use Install: BepInEx plugin
- The archive from playbuff is the mod itself — usually a BepInEx plugin (a .dll or a plugin folder once unzipped).
- Recommended: use a community mod manager (such as r2modman) — pick this game, import the mod, and the manager sets up BepInEx and its dependencies for you.
- Manual route: install the BepInEx loader in the game folder, then drop the unzipped .dll or plugin folder into BepInEx/plugins/.
- Launch the game — the BepInEx console logs every plugin it loads; seeing this mod in the log means it is installed.
Mods with listed dependencies need those installed too, or they will not load. Options are usually changed in-game or in the plugin's config file. In multiplayer, the host and every client need the same mods installed.
Install these first, or the mod will not work: