12 #include "../../stdafx.h"
14 #include "../../string_func.h"
16 #include "../../safeguards.h"
24 static const char *
GetEnv(
const char *variable,
const char *fallback)
26 const char *value = std::getenv(variable);
27 return StrEmpty(value) ? fallback : value;
37 return GetEnv(
"OTTD_COORDINATOR_CS",
"coordinator.openttd.org");
47 return GetEnv(
"OTTD_STUN_CS",
"stun.openttd.org");
57 return GetEnv(
"OTTD_CONTENT_SERVER_CS",
"content.openttd.org");
67 return GetEnv(
"OTTD_CONTENT_MIRROR_URI",
"https://binaries.openttd.org/bananas");
77 return GetEnv(
"OTTD_SURVEY_URI",
"https://survey-participate.openttd.org/");
const char * NetworkSurveyUriString()
Get the URI string for the survey from the environment variable OTTD_SURVEY_URI, or when it has not b...
const char * NetworkContentMirrorUriString()
Get the URI string for the content mirror from the environment variable OTTD_CONTENT_MIRROR_URI,...
const char * NetworkStunConnectionString()
Get the connection string for the STUN server from the environment variable OTTD_STUN_CS,...
const char * NetworkCoordinatorConnectionString()
Get the connection string for the game coordinator from the environment variable OTTD_COORDINATOR_CS,...
const char * NetworkContentServerConnectionString()
Get the connection string for the content server from the environment variable OTTD_CONTENT_SERVER_CS...
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),...
bool StrEmpty(const char *s)
Check if a string buffer is empty.