Skip to content

Fix stale replication bindings for doors and containers - #891

Open
sfedev wants to merge 1 commit into
tiltedphoques:devfrom
sfedev:feat/object-lifecycle-sync
Open

sfedev wants to merge 1 commit into
tiltedphoques:devfrom
sfedev:feat/object-lifecycle-sync

Conversation

@sfedev

@sfedev sfedev commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Clients can retain stale object replication bindings after the server retires a cell's objects or a connection ends. This change keeps a single binding per local door/container reference, updates reassigned server IDs, and clears object bindings on disconnect.

The server broadcasts NotifyRemoveObjects before destroying retired entities. Clients remove matching bindings using the full server entity ID, including generation bits. This removes replication state without deleting the underlying Skyrim references.

Includes regression tests for client binding assignment/removal, message serialization and server cell retirement. Quest progression, scenes and dialogue are outside this change.

Validation

  • Built SkyrimTogetherClient, SkyrimTogetherServer and SkyrimServerRunner on the object-only branch with xmake 3.1.0 and MSVC 14.51.
  • TPTests: 63 assertions passed in 9 cases.
  • TPServerTests: 28 assertions passed in 5 cases.
  • The launcher build fails at unchanged MemoryLayout.cpp:35: this toolset rejects the existing constinit initializer containing reinterpret_cast. The separate compiler compatibility fix is excluded here.
  • Manual container interactions and cell/interior transitions were checked with two local Skyrim clients on the earlier combined build. In-game validation of this extracted branch remains pending; the automated tests do not execute Skyrim.

Client and server must use matching builds because this adds a server message. The existing current-cell retention policy is preserved; tracking all loaded exterior cells and persistent container state are not addressed here.

Separates the object lifecycle changes previously included in #890.

Keep one door/container binding per local reference and update reassigned
server IDs. Notify clients before server objects are retired, preserve
entity generation bits, and clear object bindings on disconnect.

Add regression coverage for client bindings, message encoding, and server
cell retirement. Quest progression, scenes, and dialogue are unchanged.
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