OpenTTD Source
12.0-beta2
|
#include "../../stdafx.h"
#include <cstdlib>
#include "../../string_func.h"
#include "../../safeguards.h"
Go to the source code of this file.
Functions | |
static const char * | GetEnv (const char *variable, const char *fallback) |
Get the environment variable using std::getenv and when it is an empty string (or nullptr), return a fallback value instead. More... | |
const char * | 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. More... | |
const char * | 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. More... | |
const char * | 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. More... | |
const char * | NetworkContentMirrorConnectionString () |
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. More... | |
Configuration of the connection strings for network stuff using environment variables.
Definition in file config.cpp.
|
static |
Get the environment variable using std::getenv and when it is an empty string (or nullptr), return a fallback value instead.
variable | The environment variable to read from. |
fallback | The fallback in case the environment variable is not set. |
Definition at line 25 of file config.cpp.
References StrEmpty().
Referenced by NetworkContentMirrorConnectionString(), NetworkContentServerConnectionString(), NetworkCoordinatorConnectionString(), and NetworkStunConnectionString().
const char* NetworkContentMirrorConnectionString | ( | ) |
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.
Definition at line 66 of file config.cpp.
References GetEnv().
const char* 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.
Definition at line 56 of file config.cpp.
References GetEnv().
Referenced by ClientNetworkContentSocketHandler::Connect().
const char* 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.
Definition at line 36 of file config.cpp.
References GetEnv().
const char* 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.
Definition at line 46 of file config.cpp.
References GetEnv().
Referenced by ClientNetworkStunSocketHandler::Connect().