Skip to content

Conversation

@MistaOmega
Copy link
Contributor

Draft whilst I keep looking for bugs and broken stuff that has come from this

added some event cleanups for PlayerCinematics.cs and StoryGoalInitialSyncProcessor.cs
removed application.quit from IngameMenu_QuitGame_Patch.cs
- Properly unhook events for multiplayer session lifecycle.
- Add `OnSessionEnd` handling to session-scoped behaviours for automatic cleanup.
- Clear registries and caches on session end.
- Fix issues w/ stale references in service lifetimes.
@github-actions
Copy link

github-actions bot commented Jan 25, 2026

Test Results

240 tests  ±0   239 ✅ ±0   7s ⏱️ -1s
  1 suites ±0     1 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 9130257. ± Comparison against base commit b98858a.

♻️ This comment has been updated with latest results.

@MistaOmega
Copy link
Contributor Author

MistaOmega commented Jan 25, 2026

Cleanups are as follows at the moment:

Non-destroyed Monos

components added in Multiplayer.InitMonoBehaviours():

  • UnderwaterStateTracker
  • PrecursorTracker
  • PlayerMovementBroadcaster
  • PlayerDeathBroadcaster
  • PlayerStatsBroadcaster
  • EntityPositionBroadcaster
  • BuildingHandler
  • MovementBroadcaster

Static Collections

  • NitroxEntity.gameObjectsById
  • EntityPositionBroadcaster.watchingEntityIds / splineUpdatesById
  • VirtualCyclops.cacheColliderCopy
  • CyclopsPawn.controllers

Lambda Event Subs

  • StoryGoalInitialSyncProcessor.cs:155: Multiplayer.OnLoadingComplete += () => ...
  • PlayerCinematics.cs:71: Multiplayer.OnLoadingComplete += () => ...

Couple Singletons with State

  • BuildingHandler.Main - holds queues and operations
  • MovementBroadcaster.Instance - holds replicator dictionary

Random Stuff I've Tested

  • Leave Server 1, Join Server 2: Good, no shared state, pos, stats, etc.
  • Leave and rejoin piloting cyclops: bugged (fixed)
  • Leave and rejoin inside cyclops: good
  • Leave and rejoin in seamoth: good
  • Leave and rejoin, have story event play: both synced
  • Leave and rejoin and build base pieces: good
  • Leave and rejoin a base built prior: good
  • Leave and rejoin within a base: good

Bug Tracking

Cyclops Rejoin Handling

  • Be driving the cyclops, leave and rejoin
  • Throws NPE within CyclopsPawn
  • Due to the Controllers not being cleared
  • Sln: Write designated cleanup code into VirtualCyclops.cs

@MistaOmega MistaOmega marked this pull request as ready for review January 27, 2026 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant