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

Change: use TCP for everything except for master-server and initial server scan #9130

Merged
merged 1 commit into from Apr 30, 2021

Conversation

TrueBrain
Copy link
Member

@TrueBrain TrueBrain commented Apr 28, 2021

Motivation / Problem

In the next step to deprecate UDP more, we now also do refresh prior to the lobby over TCP.

This is the first commit that actually breaks the network protocol. Clients using master can no longer refresh older servers. That is to say: they see the list come in from the Master Server, they see them being queried over UDP, but as soon as they manually hit refresh, it shows an error the server is too old.

Also, the last server joined and manually added servers will give similar popups.

Further commits will set out to remove the rest of UDP as the master server is being replaced by Game Coordinator, but to keep things reviewable, this is another small step!

Description

This means that pressing Refresh button and adding servers manually
now uses TCP.

The master-server and initial scan are still UDP as they will be
replaced by Game Coordinator; no need to change this now.

If we query a server that is too old, show a proper warning to the
user informing him the server is too old.

Limitations

Using the nightly can be confusing to players, as all servers do show up, but refreshing gives an error. Mind you: they can never join them anyway.

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')

@LordAro LordAro changed the title Change: use TCP for everything except for master-server and initial server scan Change: use TCP for everything except for master-server and initial server scan Apr 29, 2021
@TrueBrain TrueBrain force-pushed the network-tcp-more branch 5 times, most recently from eeeac6d to dcc45d8 Compare April 29, 2021 18:20
src/network/network_client.cpp Outdated Show resolved Hide resolved
src/network/network_client.cpp Outdated Show resolved Hide resolved
src/network/network_internal.h Outdated Show resolved Hide resolved
os/emscripten/pre.js Outdated Show resolved Hide resolved
…erver scan

This means that pressing Refresh button and adding servers manually
now uses TCP.

The master-server and initial scan are still UDP as they will be
replaced by Game Coordinator; no need to change this now.

If we query a server that is too old, show a proper warning to the
user informing him the server is too old.
@embeddedt
Copy link
Contributor

👍 Removing UDP will make the game easier to host using tools like ngrok, which only support TCP. At the moment I hacked my fork to allow joining servers even if there is no response to UDP pings, but that hack has a number of drawbacks.

@TrueBrain TrueBrain merged commit 69118d0 into OpenTTD:master Apr 30, 2021
@TrueBrain TrueBrain deleted the network-tcp-more branch April 30, 2021 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants