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

Few things to cleanup in the network code #9069

merged 3 commits into from Apr 20, 2021


Copy link

@TrueBrain TrueBrain commented Apr 20, 2021

Motivation / Problem

While working on adding STUN to the network code, I found some bits and pieces that are not really doing it for me. So I addressed them :D


  • ParseConnectionString was, most likely out of laziness, abused a few times. I un-lazied-it.
  • NetworkContentSocketHandler had a never-write-only-read variable.
  • Docs were a bit confusing to me

Nothing shocking here, just upkeep.


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')
src/network/network.cpp Outdated Show resolved Hide resolved
src/network/network.cpp Outdated Show resolved Hide resolved
TrueBrain added 3 commits Apr 20, 2021
One also looks for a company, the other doesn't. There were more
uses of the latter than the first, leaving very weird code all
over the place.

When ever you saw this debug lines (which you never should), they
showed an empty address. It is also not very useful to have, as it
always points to a known server anyway.
Strictly seen the comment is true, as it says 'e.g.', but it is
misleading. The server name is just that: the name of the server
as configured. No need to mention advertising.
src/network/network.cpp Show resolved Hide resolved
@TrueBrain TrueBrain merged commit ce6a744 into OpenTTD:master Apr 20, 2021
12 checks passed
@TrueBrain TrueBrain deleted the network-cleanup branch Apr 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants