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

OpenTTD Source 15.3

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 <https://www.gnu.org/licenses/old-licenses/gpl-2.0>.
6 */
7
12#include "../../stdafx.h"
13
14#include "../../string_func.h"
15
16#include "../../safeguards.h"
17
23std::string_view NetworkCoordinatorConnectionString()
24{
25 return GetEnv("OTTD_COORDINATOR_CS").value_or("coordinator.openttd.org");
26}
27
33std::string_view NetworkStunConnectionString()
34{
35 return GetEnv("OTTD_STUN_CS").value_or("stun.openttd.org");
36}
37
43std::string_view NetworkContentServerConnectionString()
44{
45 return GetEnv("OTTD_CONTENT_SERVER_CS").value_or("content.openttd.org");
46}
47
53std::string_view NetworkContentMirrorUriString()
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}
NetworkStunConnectionString
std::string_view NetworkStunConnectionString()
Get the connection string for the STUN server from the environment variable OTTD_STUN_CS,...
Definition config.cpp:33
NetworkCoordinatorConnectionString
std::string_view NetworkCoordinatorConnectionString()
Get the connection string for the game coordinator from the environment variable OTTD_COORDINATOR_CS,...
Definition config.cpp:23
NetworkContentMirrorUriString
std::string_view NetworkContentMirrorUriString()
Get the URI string for the content mirror from the environment variable OTTD_CONTENT_MIRROR_URI,...
Definition config.cpp:53
NetworkSurveyUriString
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
NetworkContentServerConnectionString
std::string_view NetworkContentServerConnectionString()
Get the connection string for the content server from the environment variable OTTD_CONTENT_SERVER_CS...
Definition config.cpp:43
GetEnv
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:854