You are viewing a potentially older version of this package. View all versions.
Objective_DriveYards-NebulaLocalResync-0.1.4 icon

NebulaLocalResync

Host-authoritative local factory and Dark Fog ground-enemy resync for Nebula multiplayer.

Date uploaded 3 hours ago
Version 0.1.4
Download link Objective_DriveYards-NebulaLocalResync-0.1.4.zip
Downloads 3
Dependency string Objective_DriveYards-NebulaLocalResync-0.1.4

This mod requires the following mods to function

nebula-NebulaMultiplayerMod-0.9.22 icon
nebula-NebulaMultiplayerMod

With this mod you will be able to play with your friends in the same game! Now supports combat mode in game version 0.10.34

Preferred version: 0.9.22
nebula-NebulaMultiplayerModApi-2.1.0 icon
nebula-NebulaMultiplayerModApi

API for other mods to work with the Nebula Multiplayer Mod. (Does NOT require Nebula)

Preferred version: 2.1.0

README

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 RemoveEnemyFinal cleanup 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 /reconnect remains 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.

CHANGELOG

Changelog

0.1.4

  • Changed Thunderstore/r2modman packaging to place the plugin DLL directly at the package root so the mod manager owns deployment into the active BepInEx profile.
  • Removed all automatic/manual profile installation behavior from the build script. Building now compiles and packages only.
  • Added explicit package validation and output messaging so a successful build confirms the upload ZIP contains the compiled DLL and required public files.
  • No resync protocol or gameplay behavior changes from 0.1.3.

0.1.3

  • Adds host-authoritative Dark Fog ground-enemy reconciliation.
  • Fixes the client failure mode where a Dark Fog enemy can remain visibly rendered but become untargetable after combat synchronization diverges.
  • Host now includes a planet-wide active ground-enemy ID set plus nearby enemy identity/position data in the resync snapshot.
  • Removes nearby client-only phantom Dark Fog enemies only when the host confirms the enemy ID is absent from the entire planet.
  • Repairs Nebula's transient pending/invincible enemy flags when the host confirms the enemy is still alive nearby.
  • Performs enemy removal through DSP's normal RemoveEnemyFinal cleanup path while inside Nebula's incoming-combat scope.
  • Reports authoritative host enemies that are completely missing locally instead of attempting unsafe partial recreation.
  • Adds Server.MaximumGroundEnemiesPerPlanet as a safety bound.
  • Bumps the custom snapshot protocol to version 2; client and server must both run 0.1.3.
  • Build script now validates the project-root 256x256 icon.png and emits a complete, directly uploadable Thunderstore ZIP with all public package files.

0.1.2

  • Fixes compilation against current DSP/Nebula assemblies that target .NET Standard 2.1 by explicitly resolving and referencing netstandard.dll.
  • Adds available Unity/DSP .NET Standard facade assemblies to the PowerShell compiler reference set.
  • Prints the selected netstandard.dll path before compiling so the active reference can be verified from the console output.

0.1.1

  • Fixes a PowerShell parser error in Build-And-Install.ps1 caused by interpolating $Root: without braces.
  • Clarifies the remote-server workflow: build once locally, then copy the same DLL to the remote server.

0.1.0

  • Adds a client-requested, host-authoritative local factory resync.
  • Default activation is Ctrl+Shift+R on a connected client standing on a loaded planet.
  • Host scans a bounded radius around the request position and returns an authoritative entity manifest.
  • Matching storage components are serialized with DSP's own Export/Import methods.
  • Matching assembler, miner, and lab components receive primitive/primitive-array state from the host.
  • Host/client topology differences are detected and logged but are not created or deleted.
  • Belts are included in the topology audit; belt cargo-path contents are deliberately not rewritten in this release.
  • Packet processing queues all DSP reads/writes onto Unity's game thread.