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 #9490: [Network] a full server couldn't be queried either #9508

Merged
merged 1 commit into from Aug 23, 2021

Conversation

@TrueBrain
Copy link
Member

@TrueBrain TrueBrain commented Aug 23, 2021

Motivation / Problem

#9490 shows that querying a full server wasn't possible. In most cases there isn't really a reason to not allow this.

Description

You can now still query a full server, as long as the maximum
amount of allowed connections isn't reached. This means that as
long as there are not 255 clients connected to a server, you can
always connect to query.

Basically, you are now allowed to do a GAME_INFO packet despite the server being full. CLIENT_JOIN is the first packet checking if the server is really full (and drops the connection if it is). All other packets require that CLIENT_JOIN was successful, and otherwise they return a NOT_EXPECTED error.

Limitations

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 touches english.txt or translations? Check the guidelines
  • 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')
You can now still query a full server, as long as the maximum
amount of allowed connections isn't reached. This means that as
long as there are not 255 clients connected to a server, you can
always connect to query.
Copy link
Contributor

@rubidium42 rubidium42 left a comment

Still leaves the concurrency issue open that clients_on is checked upon join but only incremented much later, so multiple clients could pass this "gate" before the count in incremented thus essentially allowing more clients to join than the configured maximum.
It's fine to move that to a separate story though.

Loading

@TrueBrain TrueBrain merged commit e31b5d3 into OpenTTD:master Aug 23, 2021
14 checks passed
Loading
@TrueBrain TrueBrain deleted the check-full-server branch Aug 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants