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

Fix: [Network] State conditions for sending client info/quit packets #8959

Merged
merged 1 commit into from Apr 6, 2021

Conversation

JGRennison
Copy link
Contributor

Motivation / Problem

The client connection state conditions under which clients connections are informed by the server of the presence or lack thereof of other connected clients are not consistent.
In particular, in the case where a client quits at approximately the same time as another clients joins, the joining client can informed of the presence of the other client, but not informed that it has quit, resulting in a stale entry in the joining client's client list window which remains indefinitely.

This can be artificially triggered by inserting a suitable sleep into ClientNetworkGameSocketHandler::SendGetMap.
A report was sent to me indicating that this can occur under normal conditions.

Description

Use status >= STATUS_AUTHORIZED as the state criteria for all cases where updates about other clients are sent.
This avoids the case where a client is informed that another client is present but not informed when it later quits, resulting in stale entries in the client list window.

Limitations

N/A

Checklist for review

Some things are not automated, and forgotten often. This list is a reminder for the reviewers.

  • The bug fix is important enough to be backported? (label: 'backport requested')
  • This PR affects the save game format? (label 'savegame upgrade')
  • This PR affects the GS/AI API? (label 'needs review: Script API')
    • ai_changelog.hpp, gs_changelog.hpp need updating.
    • The compatibility wrappers (compat_*.nut) need updating.
  • This PR affects the NewGRF API? (label 'needs review: NewGRF')

Use status >= STATUS_AUTHORIZED as the state criteria for all cases
where updates about other clients are sent.
This avoids the case where a client is informed that another client
has joined but not informed when it later quits, resulting in
stale entries in the client list window.
@LordAro LordAro added the backport requested This PR should be backport to current release (RC / stable) label Apr 6, 2021
@LordAro LordAro merged commit 825867f into OpenTTD:master Apr 6, 2021
LordAro pushed a commit to LordAro/OpenTTD that referenced this pull request Apr 17, 2021
…penTTD#8959)

Use status >= STATUS_AUTHORIZED as the state criteria for all cases
where updates about other clients are sent.
This avoids the case where a client is informed that another client
has joined but not informed when it later quits, resulting in
stale entries in the client list window.
LordAro pushed a commit that referenced this pull request Apr 18, 2021
…8959)

Use status >= STATUS_AUTHORIZED as the state criteria for all cases
where updates about other clients are sent.
This avoids the case where a client is informed that another client
has joined but not informed when it later quits, resulting in
stale entries in the client list window.
@LordAro LordAro added backported This PR is backported to a current release (RC / stable) and removed backport requested This PR should be backport to current release (RC / stable) labels Apr 18, 2021
@JGRennison JGRennison deleted the pr-8959 branch January 9, 2024 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backported This PR is backported to a current release (RC / stable)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants