
NebulaLocalResync
Host-authoritative local factory and Dark Fog ground-enemy resync for Nebula multiplayer.Nebula Local Resync 0.1.4
A client-triggered, host-authoritative local repair tool for Dyson Sphere Program + Nebula multiplayer.
Nebula Local Resync is intended for cases where a connected client remains in the session but its local planet state has diverged from the host. Pressing the resync hotkey asks the host for authoritative state around the local mech and reconciles supported state without reloading the whole planet or reconnecting the player.
The same DLL is installed on the normal client and on the Nebula host/headless server. The client initiates the request; the server remains authoritative.
What 0.1.4 repairs
Dark Fog ground enemies
0.1.4 adds a dedicated Dark Fog reconciliation layer for the failure mode where enemies remain visibly rendered on a client but can no longer be targeted or attacked.
For the requested area, the host sends:
- a planet-wide set of authoritative active ground-enemy IDs, and
- identity/position information for authoritative enemies inside the requested radius.
The client then safely reconciles nearby ground enemies:
- Phantom local enemies whose IDs no longer exist anywhere in the host's active ground-enemy pool are removed through DSP's normal
RemoveEnemyFinalcleanup path. - Pending/invincible local enemy entries are repaired when the host confirms that the same enemy is still alive nearby. This restores the transient identity/targetability flags used by Nebula's combat synchronization.
- Enemies that exist on the host but are missing locally are reported, but are not synthesized by this version. Creating a complete live Dark Fog unit requires additional lifecycle state; Nebula's
/reconnectremains the safe fallback for that case.
The planet-wide host ID set is intentional: an enemy is never deleted merely because it moved outside the 150 m resync radius.
Factory component state
The existing bounded factory repair remains in place:
- Audits entity identity, prototype, and component IDs around the mech.
- Repairs matching storage components using DSP's own component serialization (
Export-> network ->Import). - Repairs supported runtime state for matching assemblers, miners, and labs.
- Reports host-only, client-only, and structurally mismatched factory entities.
- Audits nearby belts.
Deliberate limits
Nebula Local Resync remains conservative about live topology.
It does not create or delete factory buildings when host/client factory topology differs. Rebuilding arbitrary live DSP factory entities under the player has significantly more lifecycle risk than repairing state on an existing matching component.
It also does not overwrite belt cargo-path contents. Belt entities are audited, but cargo paths remain unchanged.
For Dark Fog, 0.1.4 can clear authoritative phantoms and repair the specific pending/invincible state that can leave a unit visible but untargetable. It does not recreate a host enemy that is completely absent from the client's enemy pool.
If a reported mismatch remains after resync, use Nebula's built-in /reconnect command as the fallback.
Safety model
- The host is authoritative.
- DSP factory/enemy reads and client repairs are queued onto Unity's game thread.
- Resync requests are radius-bounded and rate-limited.
- The server enforces entity-count, enemy-count, and payload-size limits.
- A local Dark Fog enemy is removed only when its enemy ID is absent from the host's entire active ground-enemy pool for that planet, not merely absent from the requested radius.
- Dark Fog removal executes inside Nebula's incoming-combat synchronization scope so the local cleanup is not treated as a new outgoing combat event.
Build
The included PowerShell script compiles against your installed DSP, BepInEx, Nebula API, and Nebula DLLs. This avoids shipping a binary compiled against guessed game assemblies.
From PowerShell:
Set-ExecutionPolicy -Scope Process Bypass
cd <where-you-extracted-NebulaLocalResync>
.\Build-And-Install.ps1 `
-ProfileDir "$env:APPDATA\r2modmanPlus-local\DysonSphereProgram\profiles\YOUR_CLIENT_PROFILE" `
-Install
If DSP cannot be auto-detected, add -GameDir with the DSP installation directory.
The script resolves the .NET Standard 2.1 facade used by current DSP/Nebula assemblies and produces:
dist\NebulaLocalResync.dll
dist\NebulaLocalResync-0.1.4-Thunderstore.zip
dist\NebulaLocalResync-0.1.4-r2modman.zip
The project root contains icon.png. Keep that file next to Build-And-Install.ps1; the build validates that it is a real 256x256 PNG before packaging. A successful build therefore always produces a complete Thunderstore upload ZIP containing the compiled DLL, manifest.json, README.md, CHANGELOG.md, LICENSE.txt, and icon.png. No manual ZIP editing is required.
Upload this file directly to Thunderstore:
dist\NebulaLocalResync-0.1.4-Thunderstore.zip
The -r2modman.zip file is an identical convenience alias.
Install on client and remote server
Build once on the client PC. The installed/compiled DLL is:
dist\NebulaLocalResync.dll
Install that same DLL on both machines:
<client profile>\BepInEx\plugins\NebulaLocalResync\NebulaLocalResync.dll
<server profile>\BepInEx\plugins\NebulaLocalResync\NebulaLocalResync.dll
For a headless server on another machine, simply copy the newly compiled DLL to the server's active BepInEx plugin folder and restart the server. No second build is required.
Both client and server must run the same Nebula Local Resync version because the custom packet payload version must match.
Use
While connected as a Nebula client and standing on a planet, press:
Ctrl + Shift + R
Default radius: 150 m.
The first launch creates:
BepInEx\config\com.local.nebulalocalresync.cfg
Relevant settings:
[Client]
ResyncHotkey = LeftControl + LeftShift + R
DefaultRadiusMeters = 150
ShowRealtimeTip = true
[Server]
MaximumRadiusMeters = 500
MaximumEntitiesPerRequest = 5000
MaximumGroundEnemiesPerPlanet = 100000
MaximumPayloadBytes = 16777216
MinimumSecondsBetweenRequestsPerConnection = 2
Result messages
For the visible-but-untargetable Dark Fog failure, a successful repair should report one of these counters as non-zero:
Dark Fog phantoms cleared
or:
enemy pending flags repaired
The full diagnostic result is written to BepInEx LogOutput.log / the r2modman console. If it instead reports host enemies missing locally, the local client is missing complete enemy units; 0.1.4 deliberately reports that condition rather than fabricating an incomplete Dark Fog unit.
Compatibility
Nebula Local Resync is an auxiliary Nebula multiplayer mod. DSP and Nebula are actively updated, so the included build script compiles against the assemblies in the user's active r2modman profile. If an API signature changes, compilation fails explicitly rather than silently targeting stale game binaries.
Package installation
Install and update this mod through Thunderstore/r2modman. The release package contains NebulaLocalResync.dll at the package root; r2modman deploys it into the profile's managed BepInEx/plugins/<Author-ModName>/ directory.
The included build script does not install files into any r2modman profile. -ProfileDir is used only to locate the installed BepInEx/Nebula assemblies needed to compile against your actual local versions.