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

Feature: allow the use of STUN to connect client and server together #9443

Merged
merged 3 commits into from Jul 16, 2021

Conversation

TrueBrain
Copy link
Member

@TrueBrain TrueBrain commented Jul 15, 2021

Motivation / Problem

STUN is a method of connecting a client with a server without either of them using port-forwarding while either or both can be behind one or several NATs. In other words: it is so much easier to connect to a server.

This PR (finally) allows this method of connecting. The Game Coordinator is the broker between the two to make this a reality.

Description

This method doesn't require port-forwarding to be used, and works for
most common NAT routers in home setups. But, for sure it doesn't work
for all setups, and not everyone will be able to use this.

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

@TrueBrain TrueBrain force-pushed the stun-support branch 2 times, most recently from f165e52 to 9f4e994 Compare July 15, 2021 14:21
src/network/core/tcp_connect.cpp Outdated Show resolved Hide resolved
src/network/core/tcp_coordinator.h Outdated Show resolved Hide resolved
src/network/core/tcp_coordinator.h Outdated Show resolved Hide resolved
src/network/network_coordinator.cpp Outdated Show resolved Hide resolved
src/network/network_coordinator.h Outdated Show resolved Hide resolved
src/network/network_coordinator.h Show resolved Hide resolved
src/network/network_coordinator.cpp Show resolved Hide resolved
This method doesn't require port-forwarding to be used, and works for
most common NAT routers in home setups. But, for sure it doesn't work
for all setups, and not everyone will be able to use this.
@TrueBrain TrueBrain marked this pull request as ready for review July 15, 2021 17:23
@TrueBrain
Copy link
Member Author

Deployed on staging. Ready for testing :)

docs/game_coordinator.md Outdated Show resolved Hide resolved
docs/game_coordinator.md Outdated Show resolved Hide resolved
docs/game_coordinator.md Outdated Show resolved Hide resolved
docs/game_coordinator.md Outdated Show resolved Hide resolved
@TrueBrain TrueBrain merged commit 29cceb5 into OpenTTD:master Jul 16, 2021
@TrueBrain TrueBrain deleted the stun-support branch July 16, 2021 17:50
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

2 participants