OpenTTD Source: src/network/core/config.cpp File Reference

OpenTTD Source 15.3

Functions
config.cpp File Reference

Configuration of the connection strings for network stuff using environment variables. More...

`#include "../../stdafx.h"`
`#include "../../string_func.h"`
`#include "../../safeguards.h"`

Go to the source code of this file.

## Functions
std::string_view | NetworkCoordinatorConnectionString ()
| Get the connection string for the game coordinator from the environment variable OTTD_COORDINATOR_CS, or when it has not been set a hard coded default DNS hostname of the production server.
std::string_view | NetworkStunConnectionString ()
| 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.
std::string_view | NetworkContentServerConnectionString ()
| 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.
std::string_view | NetworkContentMirrorUriString ()
| Get the URI string for the content mirror from the environment variable OTTD_CONTENT_MIRROR_URI, or when it has not been set a hard coded URI of the production server.
std::string_view | NetworkSurveyUriString ()
| Get the URI string for the survey from the environment variable OTTD_SURVEY_URI, or when it has not been set a hard coded URI of the production server.

## Detailed Description

Configuration of the connection strings for network stuff using environment variables.

Definition in file config.cpp.

## Function Documentation

## ◆ NetworkContentMirrorUriString()

std::string_view NetworkContentMirrorUriString | ( |  | ) |

Get the URI string for the content mirror from the environment variable OTTD_CONTENT_MIRROR_URI, or when it has not been set a hard coded URI of the production server.

Returns
  The content mirror's URI string.

Definition at line 53 of file config.cpp.

References GetEnv().

Referenced by ClientNetworkContentSocketHandler::DownloadSelectedContentHTTP().

## ◆ NetworkContentServerConnectionString()

std::string_view NetworkContentServerConnectionString | ( |  | ) |

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.

Returns
  The content server's connection string.

Definition at line 43 of file config.cpp.

References GetEnv().

Referenced by ClientNetworkContentSocketHandler::Connect().

## ◆ NetworkCoordinatorConnectionString()

std::string_view NetworkCoordinatorConnectionString | ( |  | ) |

Get the connection string for the game coordinator from the environment variable OTTD_COORDINATOR_CS, or when it has not been set a hard coded default DNS hostname of the production server.

Returns
  The game coordinator's connection string.

Definition at line 23 of file config.cpp.

References GetEnv().

## ◆ NetworkStunConnectionString()

std::string_view NetworkStunConnectionString | ( |  | ) |

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.

Returns
  The STUN server's connection string.

Definition at line 33 of file config.cpp.

References GetEnv().

Referenced by ClientNetworkStunSocketHandler::Connect().

## ◆ NetworkSurveyUriString()

std::string_view NetworkSurveyUriString | ( |  | ) |

Get the URI string for the survey from the environment variable OTTD_SURVEY_URI, or when it has not been set a hard coded URI of the production server.

Returns
  The survey's URI string.

Definition at line 63 of file config.cpp.

References GetEnv().

Referenced by NetworkSurveyHandler::Transmit().