Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(net): Configurable peer timeout #2872

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tens0rfl0w
Copy link
Contributor

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:

  • Player 'teleporting': clients that reconnect before timing out do not get reset to the last known server position
  • Dropped damage data: clients that don't receive game frame updates don't have their entity states updated afterward.
  • ...

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

  • Code compiles and has been tested successfully.
  • Code explains itself well and/or is documented.
  • My commit message explains what the changes do and what they are for.
  • No extra compilation warnings are added by these changes.

Fixes issues

/

This 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]'.
@github-actions github-actions bot added the invalid Requires changes before it's considered valid and can be (re)triaged label Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid Requires changes before it's considered valid and can be (re)triaged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant