Feature: allow the use of STUN to connect client and server together
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.
This commit is contained in:
committed by
Patric Stout
parent
55eed246b8
commit
8adade26ed
@@ -38,10 +38,20 @@ const char *NetworkCoordinatorConnectionString()
|
||||
return GetEnv("OTTD_COORDINATOR_CS", "coordinator.openttd.org");
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the connection string for the STUN server from the environment variable OTTD_STUN_CS,
|
||||
* or when it has not been set a hard coded default DNS hostname of the production server.
|
||||
* @return The STUN server's connection string.
|
||||
*/
|
||||
const char *NetworkStunConnectionString()
|
||||
{
|
||||
return GetEnv("OTTD_STUN_CS", "stun.openttd.org");
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the connection string for the content server from the environment variable OTTD_CONTENT_SERVER_CS,
|
||||
* or when it has not been set a hard coded default DNS hostname of the production server.
|
||||
* @return The game coordinator's connection string.
|
||||
* @return The content server's connection string.
|
||||
*/
|
||||
const char *NetworkContentServerConnectionString()
|
||||
{
|
||||
@@ -51,7 +61,7 @@ const char *NetworkContentServerConnectionString()
|
||||
/**
|
||||
* Get the connection string for the content mirror from the environment variable OTTD_CONTENT_MIRROR_CS,
|
||||
* or when it has not been set a hard coded default DNS hostname of the production server.
|
||||
* @return The game coordinator's connection string.
|
||||
* @return The content mirror's connection string.
|
||||
*/
|
||||
const char *NetworkContentMirrorConnectionString()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user