Fix warpPedIntoVehicle desync right after createVehicle#4979
Open
TheCrazy17 wants to merge 2 commits into
Open
Fix warpPedIntoVehicle desync right after createVehicle#4979TheCrazy17 wants to merge 2 commits into
TheCrazy17 wants to merge 2 commits into
Conversation
Warping a player into a vehicle created moments earlier (like in onResourceStart) used to send the warp before clients even knew the vehicle existed, so they just ignored it. The server kept thinking the player was in the vehicle, the client never agreed, and that mismatch is what caused the endless "NETWORK TROUBLE" freeze. Now it waits until clients actually know about the vehicle before sending the warp, instead of dropping it.
The server stops answering a player's position updates the instant they're marked as being in a vehicle, since it expects vehicle updates instead from then on. Usually that's a split-second gap, but it was enough to occasionally trigger the client's network trouble warning.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes two related problems with
warpPedIntoVehicle:onResourceStart) used to send the warp to clients before they even knew the vehicle existed. They'd just ignore it, but the server kept thinking the player was inside the vehicle anyway, that permanent mismatch is what caused the "NETWORK TROUBLE" freeze. The warp now waits until clients actually know about the vehicle before being sent, instead of getting silently dropped.Motivation
Fixes #475. Also addresses the same underlying issue reported in #3119 (warping into a train), since both come down to the server and client disagreeing about vehicle occupancy for longer than the client's network-trouble timeout allows; so: Fixes #3119.
Test plan
Checklist