diff --git a/src/blackcore/data/globalsetup.cpp b/src/blackcore/data/globalsetup.cpp index 9d7ef0f37..bfb8be213 100644 --- a/src/blackcore/data/globalsetup.cpp +++ b/src/blackcore/data/globalsetup.cpp @@ -29,13 +29,30 @@ namespace BlackCore namespace Data { CGlobalSetup::CGlobalSetup() : - ITimestampBased(0), - m_dbRootDirectoryUrl("https://datastore.swift-project.org/"), m_vatsimBookingsUrl("http://vatbook.euroutepro.com/xml2.php"), - m_vatsimMetarsUrls( {"http://metar.vatsim.net/metar.php"}), m_vatsimStatusFileUrls({ "https://status.vatsim.net" }), - m_vatsimDataFileUrls({ "http://info.vroute.net/vatsim-data.txt" }), m_sharedUrls({"https://datastore.swift-project.org/shared", "https://vatsim-germany.org:50443/datastore/shared"}), - m_newsUrls(QStringList({ "http://swift-project.org/" })), m_onlineHelpUrls(QStringList({ "help.swift-project.org/" })), - m_mapUrls(QStringList({ "map.swift-project.org/" })) - { } + ITimestampBased(0) + { + this->initDefaultUrls(); + } + + void CGlobalSetup::initDefaultUrls() + { + m_dbRootDirectoryUrl = CUrl("https://datastore.swift-project.org/"); + m_vatsimBookingsUrl = CUrl("http://vatbook.euroutepro.com/xml2.php"); + m_vatsimMetarsUrls = CUrlList({"http://metar.vatsim.net/metar.php"}); + m_vatsimStatusFileUrls = CUrlList({ "https://status.vatsim.net" }); + m_vatsimDataFileUrls = CUrlList({ "http://info.vroute.net/vatsim-data.txt" }); + m_sharedUrls = CUrlList( + { + "https://datastore.swift-project.org/shared", + "http://www.siliconmind.de/datastore/shared/", + "http://swift-project.org/datastore/shared/" + }); + + // spare: "https://vatsim-germany.org:50443/datastore/shared" + m_newsUrls = CUrlList({ "http://swift-project.org/" }); + m_onlineHelpUrls = CUrlList({ "help.swift-project.org/" }); + m_mapUrls = CUrlList({ "map.swift-project.org/" }); + } CUrl CGlobalSetup::getDbIcaoReaderUrl() const { @@ -91,6 +108,13 @@ namespace BlackCore withSwitchedScheme("https", m_dbHttpsPort); } + CUrl CGlobalSetup::getAlphaXSwiftBusFilesServiceUrl() const + { + return getDbRootDirectoryUrl(). + withAppendedPath("/service/jsonalphaxswiftbusfiles.php"). + withSwitchedScheme("https", m_dbHttpsPort); + } + bool CGlobalSetup::dbDebugFlag() const { if (!m_dbDebugFlag) { return false; } diff --git a/src/blackcore/data/globalsetup.h b/src/blackcore/data/globalsetup.h index 4a85e5ffb..2b9d90a5c 100644 --- a/src/blackcore/data/globalsetup.h +++ b/src/blackcore/data/globalsetup.h @@ -101,6 +101,9 @@ namespace BlackCore //! Login service BlackMisc::Network::CUrl getDbLoginServiceUrl() const; + //! alpha XSwiftBus files available + BlackMisc::Network::CUrl getAlphaXSwiftBusFilesServiceUrl() const; + //! Root directory of DB const BlackMisc::Network::CUrl &getDbRootDirectoryUrl() const { return m_dbRootDirectoryUrl; } @@ -205,6 +208,9 @@ namespace BlackCore // transient members, to be switched on/off via GUI or set from reader bool m_dbDebugFlag = false; //!< can trigger DEBUG on the server, so you need to know what you are doing + //! Set the default URLs + void initDefaultUrls(); + BLACK_METACLASS( CGlobalSetup, BLACK_METAMEMBER(wasLoaded),