OpenTTD Source 20250524-master-gc366e6a48e
config.cpp
Go to the documentation of this file.
1/*
2 * This file is part of OpenTTD.
3 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
6 */
7
12#include "../../stdafx.h"
13
14#include "../../string_func.h"
15
16#include "../../safeguards.h"
17
24{
25 return GetEnv("OTTD_COORDINATOR_CS").value_or("coordinator.openttd.org");
26}
27
34{
35 return GetEnv("OTTD_STUN_CS").value_or("stun.openttd.org");
36}
37
44{
45 return GetEnv("OTTD_CONTENT_SERVER_CS").value_or("content.openttd.org");
46}
47
54{
55 return GetEnv("OTTD_CONTENT_MIRROR_URI").value_or("https://binaries.openttd.org/bananas");
56}
57
63std::string_view NetworkSurveyUriString()
64{
65 return GetEnv("OTTD_SURVEY_URI").value_or("https://survey-participate.openttd.org/");
66}
std::string_view NetworkStunConnectionString()
Get the connection string for the STUN server from the environment variable OTTD_STUN_CS,...
Definition config.cpp:33
std::string_view NetworkCoordinatorConnectionString()
Get the connection string for the game coordinator from the environment variable OTTD_COORDINATOR_CS,...
Definition config.cpp:23
std::string_view NetworkContentMirrorUriString()
Get the URI string for the content mirror from the environment variable OTTD_CONTENT_MIRROR_URI,...
Definition config.cpp:53
std::string_view NetworkSurveyUriString()
Get the URI string for the survey from the environment variable OTTD_SURVEY_URI, or when it has not b...
Definition config.cpp:63
std::string_view NetworkContentServerConnectionString()
Get the connection string for the content server from the environment variable OTTD_CONTENT_SERVER_CS...
Definition config.cpp:43
std::optional< std::string_view > GetEnv(const char *variable)
Get the environment variable using std::getenv and when it is an empty string (or nullptr),...
Definition string.cpp:860