Rudeman-NetSyncGuard icon

NetSyncGuard

Stops one mod-spawned network object with an unset scene flag from breaking every join (joiner stuck on the loading screen, host retrying forever). Sets the missing flag on the host and logs which object it was.

By Rudeman
Last updated 2 days ago
Total downloads 25
Total rating 0 
Categories Mods BepInEx Server-side Bug Fixes AI Generated
Dependency string Rudeman-NetSyncGuard-1.0.0
Dependants 0 other packages depend on this package

This mod requires the following mods to function

BepInEx-BepInExPack-5.4.2305 icon
BepInEx-BepInExPack

BepInEx pack for Mono Unity games. Preconfigured and ready to use.

Preferred version: 5.4.2305

README

NetSyncGuard

A guard for one specific joining bug in heavily modded lobbies: a friend tries to join, sits on the loading screen forever, and the host's log fills with the same error every few seconds.

The bug

While the host sends the world to a joining player, Unity Netcode checks every spawned network object with NetworkObject.HostCheckForGlobalObjectIdHashOverride. That method reads IsSceneObject.Value. Some objects spawned by mods never get IsSceneObject set, so the read throws, the whole synchronisation message is dropped and the join never finishes.

The fix

A Harmony prefix on that method. If IsSceneObject has no value, it sets it to false, which is what the rest of Netcode's serialiser already assumes for a missing value. Then it logs a warning naming the object, its hierarchy path, IDs and the components on it (with their assemblies), so you can tell which mod spawned it and report it there. Each object is reported once.

Objects that already have a value are left alone. After 10 internal errors the guard stops trying.

Who needs it

The host. The check only runs on the machine sending the world. Installing it on every player does no harm and covers whoever ends up hosting, which is why the ChobblePack modpack includes it for everyone.

Config

None.

Compatibility

  • Lethal Company v81 (Unity Netcode as shipped with it), BepInEx 5. No other mods needed.
  • If a future game update renames either member, the mod logs one warning and does nothing.
  • Log lines start with NetSyncGuard; the fix line reads "Fixed an object that would have broken joining". PackCheck counts these in its join reports.

AI disclosure

The code, documentation and icon of this mod were generated with Anthropic's Claude (Claude Opus 5.5 and other Claude models, via Claude Code). The author designed the mod, directed the work and tested it in game.