Repository navigation
fix: invoke OnNetCodeDisconnect when a hybrid connection closes - #4209
NoelStephensUnity wants to merge 8 commits into
Conversation
A destroyed connection entity keeps only its cleanup components, so the query requiring NetworkId alongside ConnectionState never matched and the disconnect was only reported at shutdown. Read the id from ConnectionState instead, and set it when the connection goes in game.
There was a problem hiding this comment.
💡 Harness Review
The change caches connection IDs for disconnect reporting after entity cleanup and adds hybrid host/server regression coverage. I examined connection updates, shutdown handling, event subscribers, test lifecycle, and release notes, and found no actionable issues.
Reviewed commit 4a84c3e
🤖 Helpful? 👍/👎
There was a problem hiding this comment.
💡 Harness Review
The change preserves the connection ID for disconnect callbacks after entity destruction. I examined the cleanup flow, transport shutdown behavior, and hybrid test setup; I found no actionable issues.
Reviewed commit 4a84c3e
🤖 Helpful? 👍/👎
Codecov ReportAttention: Patch coverage is
@@ Coverage Diff @@
## develop-3.x.x #4209 +/- ##
=================================================
+ Coverage 76.03% 76.05% +0.02%
=================================================
Files 159 159
Lines 27344 27341 -3
=================================================
+ Hits 20791 20795 +4
+ Misses 6553 6546 -7
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1 file with indirect coverage changes
|
Purpose of this PR
In a hybrid mode session,
NetworkManager.OnNetCodeDisconnectwas only invoked when the session shut down, not when a connection closed.When N4E destroys a connection entity, only its cleanup components remain.
UnifiedUpdateConnectionsqueried forNetworkIdtogether withConnectionState, so it never matched a closed connection. TheNetworkIdis now stored inConnectionStatewhen the connection goes in game and read from there on disconnect.Jira ticket
N/A
Changelog
NetworkManager.OnNetCodeDisconnectwas not invoked when a connection closed during a hybrid mode session, only when the session shut down.Documentation
Testing & QA (How your changes can be verified during release Playtest)
Functional Testing
Automated tests:
Covered by new automated testsHybridConnectionEventsTests(UnifiedHost and UnifiedServer) checks the connect event fires once the client is synchronized and the server reports a client disconnect while the session is still running.Up-port
Not needed; hybrid mode is NGO 3.x only.
Backports
Not needed.