OpenTTD Source
12.0-beta2
|
Go to the documentation of this file.
12 #include "../../stdafx.h"
15 #include "../../string_func.h"
17 #include "../../safeguards.h"
25 static const char *
GetEnv(
const char *variable,
const char *fallback)
27 const char *value = std::getenv(variable);
28 return StrEmpty(value) ? fallback : value;
38 return GetEnv(
"OTTD_COORDINATOR_CS",
"coordinator.openttd.org");
48 return GetEnv(
"OTTD_STUN_CS",
"stun.openttd.org");
58 return GetEnv(
"OTTD_CONTENT_SERVER_CS",
"content.openttd.org");
68 return GetEnv(
"OTTD_CONTENT_MIRROR_CS",
"binaries.openttd.org");
const char * NetworkContentMirrorConnectionString()
Get the connection string for the content mirror from the environment variable OTTD_CONTENT_MIRROR_CS...
const char * NetworkCoordinatorConnectionString()
Get the connection string for the game coordinator from the environment variable OTTD_COORDINATOR_CS,...
const char * NetworkStunConnectionString()
Get the connection string for the STUN server from the environment variable OTTD_STUN_CS,...
const char * NetworkContentServerConnectionString()
Get the connection string for the content server from the environment variable OTTD_CONTENT_SERVER_CS...
static bool StrEmpty(const char *s)
Check if a string buffer is empty.
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),...