Fix disconnect after joining, building desync, and a few crashes#2686
Conversation
5a1eb21 to
0215669
Compare
|
Whoops, sorry about that. Forgot to sync after the merge. Rebased now. |
|
@Measurity anything else you'd like me to change? |
|
yes please. See #2686 (comment) |
0215669 to
0aaa203
Compare
|
Done! |
…esync + client packet guards - LiteNetLibServer/Client: set DisconnectTimeout=30000ms in release (was default 5000ms) Prevents false disconnects ~8s after initial sync completes when post-sync game loading briefly stalls LiteNetLib ping delivery. - BuildingManager.UpdateBase: call NotifyPlayerDesync on ghost/base entity not found paths (previously dropped packet silently instead of warning client) - BuildingDesyncWarningProcessor: reset LocalOperations=0 on desync warning so next build uses correct serverOp+1 operation ID - BuildingHandler.InitializeOperations: only call ResetToId when tracker is behind, preventing stale join-time snapshot from clobbering a tracker already advanced by relayed packets during the sync wait window - PlayerHeldItemChangedProcessor: guard against packet arriving before RemotePlayerInitialSyncProcessor runs (was throwing OptionalEmptyException) - ToggleLightsProcessor: guard with TryGetObjectFrom instead of RequireObjectFrom (was throwing on missing object) - Items.Dropped: null guard PrefabIdentifier.ClassId before use (was NullRef causing silent dropped-item desync)
0aaa203 to
2e83938
Compare
|
@Measurity I'm now realizing I made conflicting changes to the branch instead of just accepting the review with your changes. I apologize, I'm still a bit new to git. Where would you like for me to go from here? |
That's fine. As long as the code is right I don't mind the method to get there. Continue as you prefer. |
|
Did you test that InGame ? |
I did indeed. Still had a couple issues, but couldn't tell if they were related or if it was something else. |
This comment was marked as spam.
This comment was marked as spam.
Coding-Hen
left a comment
There was a problem hiding this comment.
LGTM however I think we still want to do the opPlayer change, though there is an argument it's not feature effecting but more code clarity
49a7428 to
dfee52c
Compare
Second player was disconnecting ~8 seconds after joining because LiteNetLib's default 5s timeout was never overridden in release builds. Also fixed building desync when joining mid-session, a few packet processors crashing on missing entities instead of skipping, and a race condition where two players loading the same area could end up with missing entities.
TLDR