diff --git a/assignment-client/src/octree/OctreeServer.cpp b/assignment-client/src/octree/OctreeServer.cpp index 7cca9d3ef5..266183745f 100644 --- a/assignment-client/src/octree/OctreeServer.cpp +++ b/assignment-client/src/octree/OctreeServer.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include #include "../AssignmentClient.h" @@ -252,7 +253,7 @@ OctreeServer::OctreeServer(const QByteArray& packet) : // make sure the AccountManager has an Auth URL for payment redemptions - AccountManager::getInstance().setAuthURL(DEFAULT_NODE_AUTH_URL); + AccountManager::getInstance().setAuthURL(NetworkingConstants::METAVERSE_SERVER_URL); } OctreeServer::~OctreeServer() { diff --git a/domain-server/src/DomainServer.cpp b/domain-server/src/DomainServer.cpp index 0918b85a63..263444f30a 100644 --- a/domain-server/src/DomainServer.cpp +++ b/domain-server/src/DomainServer.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -181,7 +182,7 @@ bool DomainServer::optionallySetupOAuth() { // if we don't have an oauth provider URL then we default to the default node auth url if (_oauthProviderURL.isEmpty()) { - _oauthProviderURL = DEFAULT_NODE_AUTH_URL; + _oauthProviderURL = NetworkingConstants::METAVERSE_SERVER_URL; } AccountManager& accountManager = AccountManager::getInstance(); diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index fba126309e..e1f66e1e89 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -68,6 +68,7 @@ #include #include #include +#include #include #include #include @@ -138,8 +139,8 @@ // ON WIndows PC, NVidia Optimus laptop, we want to enable NVIDIA GPU #if defined(Q_OS_WIN) -extern "C" { - _declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001; +extern "C" { + _declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001; } #endif @@ -425,7 +426,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : connect(&accountManager, &AccountManager::usernameChanged, this, &Application::updateWindowTitle); // set the account manager's root URL and trigger a login request if we don't have the access token - accountManager.setAuthURL(DEFAULT_NODE_AUTH_URL); + accountManager.setAuthURL(NetworkingConstants::METAVERSE_SERVER_URL); UserActivityLogger::getInstance().launch(applicationVersion()); // once the event loop has started, check and signal for an access token diff --git a/interface/src/ui/DataWebDialog.cpp b/interface/src/ui/DataWebDialog.cpp index e28dcf8df7..f405ef50c5 100644 --- a/interface/src/ui/DataWebDialog.cpp +++ b/interface/src/ui/DataWebDialog.cpp @@ -13,7 +13,7 @@ #include #include -#include +#include #include "Application.h" #include "DataWebPage.h" @@ -39,7 +39,7 @@ DataWebDialog* DataWebDialog::dialogForPath(const QString& path, connect(dialogWebView->page()->mainFrame(), &QWebFrame::javaScriptWindowObjectCleared, dialogWebView, &DataWebDialog::addJavascriptObjectsToWindow); - QUrl dataWebUrl(DEFAULT_NODE_AUTH_URL); + QUrl dataWebUrl(NetworkingConstants::METAVERSE_SERVER_URL); dataWebUrl.setPath(path); qDebug() << "Opening a data web dialog for" << dataWebUrl.toString(); diff --git a/interface/src/ui/LoginDialog.cpp b/interface/src/ui/LoginDialog.cpp index 4e7a4a7dc9..690489fdb2 100644 --- a/interface/src/ui/LoginDialog.cpp +++ b/interface/src/ui/LoginDialog.cpp @@ -14,6 +14,7 @@ #include #include +#include #include #include "Application.h" @@ -23,7 +24,7 @@ #include "LoginDialog.h" #include "UIUtil.h" -const QString FORGOT_PASSWORD_URL = "https://metaverse.highfidelity.com/users/password/new"; +const QString FORGOT_PASSWORD_URL = NetworkingConstants::METAVERSE_SERVER_URL.toString() + "/users/password/new"; LoginDialog::LoginDialog(QWidget* parent) : FramelessDialog(parent, 0, FramelessDialog::POSITION_TOP), diff --git a/libraries/networking/src/LimitedNodeList.cpp b/libraries/networking/src/LimitedNodeList.cpp index ebd10b67a6..b7ac33bba9 100644 --- a/libraries/networking/src/LimitedNodeList.cpp +++ b/libraries/networking/src/LimitedNodeList.cpp @@ -36,8 +36,6 @@ const char SOLO_NODE_TYPES[2] = { NodeType::AudioMixer }; -const QUrl DEFAULT_NODE_AUTH_URL = QUrl("https://metaverse.highfidelity.com"); - LimitedNodeList::LimitedNodeList(unsigned short socketListenPort, unsigned short dtlsListenPort) : linkedDataCreateCallback(NULL), _sessionUUID(), diff --git a/libraries/networking/src/LimitedNodeList.h b/libraries/networking/src/LimitedNodeList.h index 532e8ffcf4..be142fb036 100644 --- a/libraries/networking/src/LimitedNodeList.h +++ b/libraries/networking/src/LimitedNodeList.h @@ -42,8 +42,6 @@ const quint64 NODE_SILENCE_THRESHOLD_MSECS = 2 * 1000; extern const char SOLO_NODE_TYPES[2]; -extern const QUrl DEFAULT_NODE_AUTH_URL; - const char DEFAULT_ASSIGNMENT_SERVER_HOSTNAME[] = "localhost"; const char STUN_SERVER_HOSTNAME[] = "stun.highfidelity.io"; diff --git a/libraries/networking/src/NetworkingConstants.h b/libraries/networking/src/NetworkingConstants.h new file mode 100644 index 0000000000..00de0a7f17 --- /dev/null +++ b/libraries/networking/src/NetworkingConstants.h @@ -0,0 +1,21 @@ +// +// NetworkingConstants.h +// libraries/networking/src +// +// Created by Stephen Birarda on 2015-03-31. +// Copyright 2015 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + +#ifndef hifi_NetworkingConstants_h +#define hifi_NetworkingConstants_h + +#include + +namespace NetworkingConstants { + const QUrl METAVERSE_SERVER_URL = QUrl("https://metaverse.highfidelity.com"); +} + +#endif // hifi_NetworkingConstants_h \ No newline at end of file diff --git a/libraries/networking/src/OAuthNetworkAccessManager.cpp b/libraries/networking/src/OAuthNetworkAccessManager.cpp index 89a73d5984..fa6f3b8340 100644 --- a/libraries/networking/src/OAuthNetworkAccessManager.cpp +++ b/libraries/networking/src/OAuthNetworkAccessManager.cpp @@ -15,6 +15,7 @@ #include "AccountManager.h" #include "LimitedNodeList.h" +#include "NetworkingConstants.h" #include "SharedUtil.h" #include "OAuthNetworkAccessManager.h" @@ -33,7 +34,8 @@ QNetworkReply* OAuthNetworkAccessManager::createRequest(QNetworkAccessManager::O QIODevice* outgoingData) { AccountManager& accountManager = AccountManager::getInstance(); - if (accountManager.hasValidAccessToken() && req.url().host() == DEFAULT_NODE_AUTH_URL.host()) { + if (accountManager.hasValidAccessToken() + && req.url().host() == NetworkingConstants::METAVERSE_SERVER_URL.host()) { QNetworkRequest authenticatedRequest(req); authenticatedRequest.setHeader(QNetworkRequest::UserAgentHeader, HIGH_FIDELITY_USER_AGENT); authenticatedRequest.setRawHeader(ACCESS_TOKEN_AUTHORIZATION_HEADER, diff --git a/libraries/script-engine/src/XMLHttpRequestClass.cpp b/libraries/script-engine/src/XMLHttpRequestClass.cpp index 3054472a3c..ae0486dd0c 100644 --- a/libraries/script-engine/src/XMLHttpRequestClass.cpp +++ b/libraries/script-engine/src/XMLHttpRequestClass.cpp @@ -17,12 +17,13 @@ #include #include +#include #include #include "XMLHttpRequestClass.h" #include "ScriptEngine.h" -const QString METAVERSE_API_URL = "https://metaverse.highfidelity.com/api/"; +const QString METAVERSE_API_URL = NetworkingConstants::METAVERSE_SERVER_URL.toString() + "/api/"; Q_DECLARE_METATYPE(QByteArray*)