feat(net): Configurable peer timeout #2872
Open
+91
−5
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.
Goal of this PR
Clients that don't send or accept data for a longer period of time can have a negative impact on the gameplay behavior of specific game modes (especially PVP-focused), due to the nature of existing RAGE net code and missing patches for any server-authoritative control over synced entity data that is game-state critical (position correction, damage control system, etc.)
Some examples:
While the goal should be to have some sort of correction for these types of desync issues, this is probably not accomplishable in the short run. In the meantime, we can allow servers to define shorter (or longer) peer timeout values to at least give them some sort of countermeasure for the above-described problems, as the default value of 30 seconds is quite long.
How is this PR achieving the goal
This change introduces a new replicated ConVar named 'sv_peerTimeout' that allows to configure a per-server peer timeout, which can be set via the (server-sided) console command 'set_peer_timeout [timeout]'.
The (client-sided) enet timeout will get reset to the default value of 30 seconds after disconnect.
This PR applies to the following area(s)
FiveM, Server, Net
Successfully tested on
Game builds: Not applicable
Platforms: Windows, Linux
Checklist
Fixes issues
/