mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 10:17:40 +02:00
First pass at consolidation
This commit is contained in:
parent
7793506d0f
commit
c64c2e17c8
29 changed files with 39 additions and 80 deletions
|
@ -22,7 +22,6 @@
|
||||||
#include <HTTPConnection.h>
|
#include <HTTPConnection.h>
|
||||||
#include <LogHandler.h>
|
#include <LogHandler.h>
|
||||||
#include <shared/NetworkUtils.h>
|
#include <shared/NetworkUtils.h>
|
||||||
#include <NetworkingConstants.h>
|
|
||||||
#include <NumericalConstants.h>
|
#include <NumericalConstants.h>
|
||||||
#include <UUID.h>
|
#include <UUID.h>
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,6 @@
|
||||||
#include <HifiConfigVariantMap.h>
|
#include <HifiConfigVariantMap.h>
|
||||||
#include <HTTPConnection.h>
|
#include <HTTPConnection.h>
|
||||||
#include <LogUtils.h>
|
#include <LogUtils.h>
|
||||||
#include <NetworkingConstants.h>
|
|
||||||
#include <udt/PacketHeaders.h>
|
#include <udt/PacketHeaders.h>
|
||||||
#include <SettingHandle.h>
|
#include <SettingHandle.h>
|
||||||
#include <SharedUtil.h>
|
#include <SharedUtil.h>
|
||||||
|
@ -340,12 +339,12 @@ bool DomainServer::optionallySetupOAuth() {
|
||||||
const QVariantMap& settingsMap = _settingsManager.getSettingsMap();
|
const QVariantMap& settingsMap = _settingsManager.getSettingsMap();
|
||||||
_oauthProviderURL = QUrl(settingsMap.value(OAUTH_PROVIDER_URL_OPTION).toString());
|
_oauthProviderURL = QUrl(settingsMap.value(OAUTH_PROVIDER_URL_OPTION).toString());
|
||||||
|
|
||||||
|
auto accountManager = DependencyManager::get<AccountManager>();
|
||||||
// if we don't have an oauth provider URL then we default to the default node auth url
|
// if we don't have an oauth provider URL then we default to the default node auth url
|
||||||
if (_oauthProviderURL.isEmpty()) {
|
if (_oauthProviderURL.isEmpty()) {
|
||||||
_oauthProviderURL = NetworkingConstants::METAVERSE_SERVER_URL;
|
_oauthProviderURL = accountManager->getMetaverseServerURL();
|
||||||
}
|
}
|
||||||
|
|
||||||
auto accountManager = DependencyManager::get<AccountManager>();
|
|
||||||
accountManager->setAuthURL(_oauthProviderURL);
|
accountManager->setAuthURL(_oauthProviderURL);
|
||||||
|
|
||||||
_oauthClientID = settingsMap.value(OAUTH_CLIENT_ID_OPTION).toString();
|
_oauthClientID = settingsMap.value(OAUTH_CLIENT_ID_OPTION).toString();
|
||||||
|
|
|
@ -18,9 +18,9 @@
|
||||||
#include <QtNetwork/QNetworkReply>
|
#include <QtNetwork/QNetworkReply>
|
||||||
#include <QtNetwork/QNetworkRequest>
|
#include <QtNetwork/QNetworkRequest>
|
||||||
|
|
||||||
|
#include <AccountManager.h>
|
||||||
#include <LimitedNodeList.h>
|
#include <LimitedNodeList.h>
|
||||||
#include <NetworkAccessManager.h>
|
#include <NetworkAccessManager.h>
|
||||||
#include <NetworkingConstants.h>
|
|
||||||
#include <udt/PacketHeaders.h>
|
#include <udt/PacketHeaders.h>
|
||||||
#include <SharedUtil.h>
|
#include <SharedUtil.h>
|
||||||
|
|
||||||
|
@ -208,7 +208,7 @@ void IceServer::requestDomainPublicKey(const QUuid& domainID) {
|
||||||
// send a request to the metaverse API for the public key for this domain
|
// send a request to the metaverse API for the public key for this domain
|
||||||
auto& networkAccessManager = NetworkAccessManager::getInstance();
|
auto& networkAccessManager = NetworkAccessManager::getInstance();
|
||||||
|
|
||||||
QUrl publicKeyURL { NetworkingConstants::METAVERSE_SERVER_URL };
|
QUrl publicKeyURL { DependencyManager::get<AccountManager>()->getMetaverseServerURL() };
|
||||||
QString publicKeyPath = QString("/api/v1/domains/%1/public_key").arg(uuidStringWithoutCurlyBraces(domainID));
|
QString publicKeyPath = QString("/api/v1/domains/%1/public_key").arg(uuidStringWithoutCurlyBraces(domainID));
|
||||||
publicKeyURL.setPath(publicKeyPath);
|
publicKeyURL.setPath(publicKeyPath);
|
||||||
|
|
||||||
|
|
|
@ -87,7 +87,7 @@ Window {
|
||||||
onReceivedHifiSchemeURL: resetAfterTeleport();
|
onReceivedHifiSchemeURL: resetAfterTeleport();
|
||||||
|
|
||||||
// Update location after using back and forward buttons.
|
// Update location after using back and forward buttons.
|
||||||
onMetaverseServerUrlChanged: updateLocationTextTimer.start();
|
onHostChanged: updateLocationTextTimer.start();
|
||||||
|
|
||||||
ListModel { id: suggestions }
|
ListModel { id: suggestions }
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ import "../styles-uit"
|
||||||
import "../controls-uit" as HifiControls
|
import "../controls-uit" as HifiControls
|
||||||
import "toolbars"
|
import "toolbars"
|
||||||
|
|
||||||
// references Users, UserActivityLogger, MyAvatar, Vec3, Quat, AddressManager from root context
|
// references Users, UserActivityLogger, MyAvatar, Vec3, Quat, AddressManager, Account from root context
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: thisNameCard
|
id: thisNameCard
|
||||||
|
@ -30,7 +30,7 @@ Item {
|
||||||
|
|
||||||
// Properties
|
// Properties
|
||||||
property string profileUrl: "";
|
property string profileUrl: "";
|
||||||
property string defaultBaseUrl: AddressManager.metaverseServerUrl;
|
property string defaultBaseUrl: Account.metaverseServerURL;
|
||||||
property string connectionStatus : ""
|
property string connectionStatus : ""
|
||||||
property string uuid: ""
|
property string uuid: ""
|
||||||
property string displayName: ""
|
property string displayName: ""
|
||||||
|
|
|
@ -134,7 +134,7 @@ StackView {
|
||||||
bottom: parent.bottom
|
bottom: parent.bottom
|
||||||
}
|
}
|
||||||
|
|
||||||
onMetaverseServerUrlChanged: updateLocationTextTimer.start();
|
onHostChanged: updateLocationTextTimer.start();
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: navBar
|
id: navBar
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
|
|
@ -94,7 +94,6 @@
|
||||||
#include <MessagesClient.h>
|
#include <MessagesClient.h>
|
||||||
#include <ModelEntityItem.h>
|
#include <ModelEntityItem.h>
|
||||||
#include <NetworkAccessManager.h>
|
#include <NetworkAccessManager.h>
|
||||||
#include <NetworkingConstants.h>
|
|
||||||
#include <ObjectMotionState.h>
|
#include <ObjectMotionState.h>
|
||||||
#include <OctalCode.h>
|
#include <OctalCode.h>
|
||||||
#include <OctreeSceneStats.h>
|
#include <OctreeSceneStats.h>
|
||||||
|
@ -960,7 +959,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
||||||
|
|
||||||
// set the account manager's root URL and trigger a login request if we don't have the access token
|
// set the account manager's root URL and trigger a login request if we don't have the access token
|
||||||
accountManager->setIsAgent(true);
|
accountManager->setIsAgent(true);
|
||||||
accountManager->setAuthURL(NetworkingConstants::METAVERSE_SERVER_URL);
|
accountManager->setAuthURL(accountManager->getMetaverseServerURL());
|
||||||
|
|
||||||
auto addressManager = DependencyManager::get<AddressManager>();
|
auto addressManager = DependencyManager::get<AddressManager>();
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
#include "Wallet.h"
|
#include "Wallet.h"
|
||||||
#include "Ledger.h"
|
#include "Ledger.h"
|
||||||
#include "CommerceLogging.h"
|
#include "CommerceLogging.h"
|
||||||
#include <NetworkingConstants.h>
|
|
||||||
|
|
||||||
// inventory answers {status: 'success', data: {assets: [{id: "guid", title: "name", preview: "url"}....]}}
|
// inventory answers {status: 'success', data: {assets: [{id: "guid", title: "name", preview: "url"}....]}}
|
||||||
// balance answers {status: 'success', data: {balance: integer}}
|
// balance answers {status: 'success', data: {balance: integer}}
|
||||||
|
@ -121,7 +120,6 @@ QString nameFromKey(const QString& key, const QStringList& publicKeys) {
|
||||||
return "Someone";
|
return "Someone";
|
||||||
}
|
}
|
||||||
|
|
||||||
static const QString MARKETPLACE_ITEMS_BASE_URL = NetworkingConstants::METAVERSE_SERVER_URL.toString() + "/marketplace/items/";
|
|
||||||
void Ledger::historySuccess(QNetworkReply& reply) {
|
void Ledger::historySuccess(QNetworkReply& reply) {
|
||||||
// here we send a historyResult with some extra stuff in it
|
// here we send a historyResult with some extra stuff in it
|
||||||
// Namely, the styled text we'd like to show. The issue is the
|
// Namely, the styled text we'd like to show. The issue is the
|
||||||
|
@ -154,7 +152,7 @@ void Ledger::historySuccess(QNetworkReply& reply) {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
coloredQuantityAndAssetTitle = QString("\"<font color='#0093C5'><a href='") +
|
coloredQuantityAndAssetTitle = QString("\"<font color='#0093C5'><a href='") +
|
||||||
MARKETPLACE_ITEMS_BASE_URL +
|
DependencyManager::get<AccountManager>()->getMetaverseServerURL().toString() + "/marketplace/items/" +
|
||||||
valueObject["asset_id"].toString() +
|
valueObject["asset_id"].toString() +
|
||||||
QString("'>") +
|
QString("'>") +
|
||||||
coloredQuantityAndAssetTitle +
|
coloredQuantityAndAssetTitle +
|
||||||
|
|
|
@ -17,7 +17,6 @@
|
||||||
#include <ThreadHelpers.h>
|
#include <ThreadHelpers.h>
|
||||||
#include <AccountManager.h>
|
#include <AccountManager.h>
|
||||||
#include <NetworkAccessManager.h>
|
#include <NetworkAccessManager.h>
|
||||||
#include <NetworkingConstants.h>
|
|
||||||
#include <NetworkLogging.h>
|
#include <NetworkLogging.h>
|
||||||
#include <UserActivityLogger.h>
|
#include <UserActivityLogger.h>
|
||||||
#include <UUID.h>
|
#include <UUID.h>
|
||||||
|
@ -27,13 +26,13 @@
|
||||||
QNetworkRequest createNetworkRequest() {
|
QNetworkRequest createNetworkRequest() {
|
||||||
|
|
||||||
QNetworkRequest request;
|
QNetworkRequest request;
|
||||||
|
auto accountManager = DependencyManager::get<AccountManager>();
|
||||||
|
|
||||||
QUrl requestURL = NetworkingConstants::METAVERSE_SERVER_URL;
|
QUrl requestURL = accountManager->getMetaverseServerURL();
|
||||||
requestURL.setPath(USER_ACTIVITY_URL);
|
requestURL.setPath(USER_ACTIVITY_URL);
|
||||||
|
|
||||||
request.setUrl(requestURL);
|
request.setUrl(requestURL);
|
||||||
|
|
||||||
auto accountManager = DependencyManager::get<AccountManager>();
|
|
||||||
|
|
||||||
if (accountManager->hasValidAccessToken()) {
|
if (accountManager->hasValidAccessToken()) {
|
||||||
request.setRawHeader(ACCESS_TOKEN_AUTHORIZATION_HEADER,
|
request.setRawHeader(ACCESS_TOKEN_AUTHORIZATION_HEADER,
|
||||||
|
|
|
@ -39,7 +39,7 @@ AddressBarDialog::AddressBarDialog(QQuickItem* parent) : OffscreenQmlDialog(pare
|
||||||
});
|
});
|
||||||
_backEnabled = !(DependencyManager::get<AddressManager>()->getBackStack().isEmpty());
|
_backEnabled = !(DependencyManager::get<AddressManager>()->getBackStack().isEmpty());
|
||||||
_forwardEnabled = !(DependencyManager::get<AddressManager>()->getForwardStack().isEmpty());
|
_forwardEnabled = !(DependencyManager::get<AddressManager>()->getForwardStack().isEmpty());
|
||||||
connect(addressManager.data(), &AddressManager::hostChanged, this, &AddressBarDialog::metaverseServerUrlChanged);
|
connect(addressManager.data(), &AddressManager::hostChanged, this, &AddressBarDialog::hostChanged);
|
||||||
connect(DependencyManager::get<DialogsManager>().data(), &DialogsManager::setUseFeed, this, &AddressBarDialog::setUseFeed);
|
connect(DependencyManager::get<DialogsManager>().data(), &DialogsManager::setUseFeed, this, &AddressBarDialog::setUseFeed);
|
||||||
connect(qApp, &Application::receivedHifiSchemeURL, this, &AddressBarDialog::receivedHifiSchemeURL);
|
connect(qApp, &Application::receivedHifiSchemeURL, this, &AddressBarDialog::receivedHifiSchemeURL);
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,8 +13,8 @@
|
||||||
#ifndef hifi_AddressBarDialog_h
|
#ifndef hifi_AddressBarDialog_h
|
||||||
#define hifi_AddressBarDialog_h
|
#define hifi_AddressBarDialog_h
|
||||||
|
|
||||||
|
#include <AccountManager.h>
|
||||||
#include <OffscreenQmlDialog.h>
|
#include <OffscreenQmlDialog.h>
|
||||||
#include <NetworkingConstants.h>
|
|
||||||
|
|
||||||
class AddressBarDialog : public OffscreenQmlDialog {
|
class AddressBarDialog : public OffscreenQmlDialog {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
@ -22,7 +22,7 @@ class AddressBarDialog : public OffscreenQmlDialog {
|
||||||
Q_PROPERTY(bool backEnabled READ backEnabled NOTIFY backEnabledChanged)
|
Q_PROPERTY(bool backEnabled READ backEnabled NOTIFY backEnabledChanged)
|
||||||
Q_PROPERTY(bool forwardEnabled READ forwardEnabled NOTIFY forwardEnabledChanged)
|
Q_PROPERTY(bool forwardEnabled READ forwardEnabled NOTIFY forwardEnabledChanged)
|
||||||
Q_PROPERTY(bool useFeed READ useFeed WRITE setUseFeed NOTIFY useFeedChanged)
|
Q_PROPERTY(bool useFeed READ useFeed WRITE setUseFeed NOTIFY useFeedChanged)
|
||||||
Q_PROPERTY(QString metaverseServerUrl READ metaverseServerUrl NOTIFY metaverseServerUrlChanged)
|
Q_PROPERTY(QString metaverseServerUrl READ metaverseServerUrl)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
AddressBarDialog(QQuickItem* parent = nullptr);
|
AddressBarDialog(QQuickItem* parent = nullptr);
|
||||||
|
@ -30,14 +30,14 @@ public:
|
||||||
bool forwardEnabled() { return _forwardEnabled; }
|
bool forwardEnabled() { return _forwardEnabled; }
|
||||||
bool useFeed() { return _useFeed; }
|
bool useFeed() { return _useFeed; }
|
||||||
void setUseFeed(bool useFeed) { if (_useFeed != useFeed) { _useFeed = useFeed; emit useFeedChanged(); } }
|
void setUseFeed(bool useFeed) { if (_useFeed != useFeed) { _useFeed = useFeed; emit useFeedChanged(); } }
|
||||||
QString metaverseServerUrl() { return NetworkingConstants::METAVERSE_SERVER_URL.toString(); }
|
QString metaverseServerUrl() { return DependencyManager::get<AccountManager>()->getMetaverseServerURL().toString(); }
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void backEnabledChanged();
|
void backEnabledChanged();
|
||||||
void forwardEnabledChanged();
|
void forwardEnabledChanged();
|
||||||
void useFeedChanged();
|
void useFeedChanged();
|
||||||
void receivedHifiSchemeURL(const QString& url);
|
void receivedHifiSchemeURL(const QString& url);
|
||||||
void metaverseServerUrlChanged();
|
void hostChanged();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void displayAddressOfflineMessage();
|
void displayAddressOfflineMessage();
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
#include <QtCore/QJsonDocument>
|
#include <QtCore/QJsonDocument>
|
||||||
#include <QtNetwork/QNetworkReply>
|
#include <QtNetwork/QNetworkReply>
|
||||||
|
|
||||||
#include <NetworkingConstants.h>
|
|
||||||
#include <plugins/PluginManager.h>
|
#include <plugins/PluginManager.h>
|
||||||
#include <plugins/SteamClientPlugin.h>
|
#include <plugins/SteamClientPlugin.h>
|
||||||
#include <ui/TabletScriptingInterface.h>
|
#include <ui/TabletScriptingInterface.h>
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
#include <AudioClient.h>
|
#include <AudioClient.h>
|
||||||
#include <avatar/AvatarManager.h>
|
#include <avatar/AvatarManager.h>
|
||||||
#include <devices/DdeFaceTracker.h>
|
#include <devices/DdeFaceTracker.h>
|
||||||
#include <NetworkingConstants.h>
|
|
||||||
#include <ScriptEngines.h>
|
#include <ScriptEngines.h>
|
||||||
#include <OffscreenUi.h>
|
#include <OffscreenUi.h>
|
||||||
#include <Preferences.h>
|
#include <Preferences.h>
|
||||||
|
|
|
@ -12,8 +12,8 @@
|
||||||
#include "ContextOverlayInterface.h"
|
#include "ContextOverlayInterface.h"
|
||||||
#include "Application.h"
|
#include "Application.h"
|
||||||
|
|
||||||
|
#include <AccountManager.h>
|
||||||
#include <EntityTreeRenderer.h>
|
#include <EntityTreeRenderer.h>
|
||||||
#include <NetworkingConstants.h>
|
|
||||||
|
|
||||||
#ifndef MIN
|
#ifndef MIN
|
||||||
#define MIN(a,b) ((a) < (b) ? (a) : (b))
|
#define MIN(a,b) ((a) < (b) ? (a) : (b))
|
||||||
|
@ -260,8 +260,6 @@ void ContextOverlayInterface::openInspectionCertificate() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static const QString MARKETPLACE_BASE_URL = NetworkingConstants::METAVERSE_SERVER_URL.toString() + "/marketplace/items/";
|
|
||||||
|
|
||||||
void ContextOverlayInterface::openMarketplace() {
|
void ContextOverlayInterface::openMarketplace() {
|
||||||
// lets open the tablet and go to the current item in
|
// lets open the tablet and go to the current item in
|
||||||
// the marketplace (if the current entity has a
|
// the marketplace (if the current entity has a
|
||||||
|
@ -269,7 +267,7 @@ void ContextOverlayInterface::openMarketplace() {
|
||||||
if (!_currentEntityWithContextOverlay.isNull() && _entityMarketplaceID.length() > 0) {
|
if (!_currentEntityWithContextOverlay.isNull() && _entityMarketplaceID.length() > 0) {
|
||||||
auto tablet = dynamic_cast<TabletProxy*>(_tabletScriptingInterface->getTablet("com.highfidelity.interface.tablet.system"));
|
auto tablet = dynamic_cast<TabletProxy*>(_tabletScriptingInterface->getTablet("com.highfidelity.interface.tablet.system"));
|
||||||
// construct the url to the marketplace item
|
// construct the url to the marketplace item
|
||||||
QString url = MARKETPLACE_BASE_URL + _entityMarketplaceID;
|
QString url = DependencyManager::get<AccountManager>()->getMetaverseServerURL().toString() + "/marketplace/items/" + _entityMarketplaceID;
|
||||||
QString MARKETPLACES_INJECT_SCRIPT_PATH = "file:///" + qApp->applicationDirPath() + "/scripts/system/html/js/marketplacesInject.js";
|
QString MARKETPLACES_INJECT_SCRIPT_PATH = "file:///" + qApp->applicationDirPath() + "/scripts/system/html/js/marketplacesInject.js";
|
||||||
tablet->gotoWebScreen(url, MARKETPLACES_INJECT_SCRIPT_PATH);
|
tablet->gotoWebScreen(url, MARKETPLACES_INJECT_SCRIPT_PATH);
|
||||||
_hmdScriptingInterface->openTablet();
|
_hmdScriptingInterface->openTablet();
|
||||||
|
|
|
@ -15,7 +15,6 @@
|
||||||
#include <QNetworkRequest>
|
#include <QNetworkRequest>
|
||||||
|
|
||||||
#include <NetworkAccessManager.h>
|
#include <NetworkAccessManager.h>
|
||||||
#include <NetworkingConstants.h>
|
|
||||||
#include <SharedUtil.h>
|
#include <SharedUtil.h>
|
||||||
|
|
||||||
#include "FSTReader.h"
|
#include "FSTReader.h"
|
||||||
|
|
|
@ -28,7 +28,6 @@
|
||||||
|
|
||||||
#include <SettingHandle.h>
|
#include <SettingHandle.h>
|
||||||
|
|
||||||
#include "NetworkingConstants.h"
|
|
||||||
#include "NetworkLogging.h"
|
#include "NetworkLogging.h"
|
||||||
#include "NodeList.h"
|
#include "NodeList.h"
|
||||||
#include "udt/PacketHeaders.h"
|
#include "udt/PacketHeaders.h"
|
||||||
|
@ -240,7 +239,7 @@ void AccountManager::sendRequest(const QString& path,
|
||||||
QUrl requestURL = _authURL;
|
QUrl requestURL = _authURL;
|
||||||
|
|
||||||
if (requestURL.isEmpty()) { // Assignment client doesn't set _authURL.
|
if (requestURL.isEmpty()) { // Assignment client doesn't set _authURL.
|
||||||
requestURL = NetworkingConstants::METAVERSE_SERVER_URL;
|
requestURL = getMetaverseServerURL();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (path.startsWith("/")) {
|
if (path.startsWith("/")) {
|
||||||
|
|
|
@ -58,6 +58,8 @@ using UserAgentGetter = std::function<QString()>;
|
||||||
|
|
||||||
const auto DEFAULT_USER_AGENT_GETTER = []() -> QString { return HIGH_FIDELITY_USER_AGENT; };
|
const auto DEFAULT_USER_AGENT_GETTER = []() -> QString { return HIGH_FIDELITY_USER_AGENT; };
|
||||||
|
|
||||||
|
const QUrl METAVERSE_SERVER_URL = "https://metaverse.highfidelity.com";
|
||||||
|
|
||||||
class AccountManager : public QObject, public Dependency {
|
class AccountManager : public QObject, public Dependency {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
|
@ -96,6 +98,9 @@ public:
|
||||||
void setTemporaryDomain(const QUuid& domainID, const QString& key);
|
void setTemporaryDomain(const QUuid& domainID, const QString& key);
|
||||||
const QString& getTemporaryDomainKey(const QUuid& domainID) { return _accountInfo.getTemporaryDomainKey(domainID); }
|
const QString& getTemporaryDomainKey(const QUuid& domainID) { return _accountInfo.getTemporaryDomainKey(domainID); }
|
||||||
|
|
||||||
|
Q_PROPERTY(QUrl metaverseServerURL READ getMetaverseServerURL)
|
||||||
|
QUrl getMetaverseServerURL() { return METAVERSE_SERVER_URL; }
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void requestAccessToken(const QString& login, const QString& password);
|
void requestAccessToken(const QString& login, const QString& password);
|
||||||
void requestAccessTokenWithSteam(QByteArray authSessionTicket);
|
void requestAccessTokenWithSteam(QByteArray authSessionTicket);
|
||||||
|
|
|
@ -24,7 +24,6 @@
|
||||||
|
|
||||||
#include "AddressManager.h"
|
#include "AddressManager.h"
|
||||||
#include "NodeList.h"
|
#include "NodeList.h"
|
||||||
#include "NetworkingConstants.h"
|
|
||||||
#include "NetworkLogging.h"
|
#include "NetworkLogging.h"
|
||||||
#include "UserActivityLogger.h"
|
#include "UserActivityLogger.h"
|
||||||
#include "udt/PacketHeaders.h"
|
#include "udt/PacketHeaders.h"
|
||||||
|
@ -770,10 +769,6 @@ QString AddressManager::getDomainId() const {
|
||||||
return DependencyManager::get<NodeList>()->getDomainHandler().getUUID().toString();
|
return DependencyManager::get<NodeList>()->getDomainHandler().getUUID().toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
const QUrl AddressManager::getMetaverseServerUrl() const {
|
|
||||||
return NetworkingConstants::METAVERSE_SERVER_URL;
|
|
||||||
}
|
|
||||||
|
|
||||||
void AddressManager::handleShareableNameAPIResponse(QNetworkReply& requestReply) {
|
void AddressManager::handleShareableNameAPIResponse(QNetworkReply& requestReply) {
|
||||||
// make sure that this response is for the domain we're currently connected to
|
// make sure that this response is for the domain we're currently connected to
|
||||||
auto domainID = DependencyManager::get<NodeList>()->getDomainHandler().getUUID();
|
auto domainID = DependencyManager::get<NodeList>()->getDomainHandler().getUUID();
|
||||||
|
|
|
@ -41,7 +41,6 @@ class AddressManager : public QObject, public Dependency {
|
||||||
Q_PROPERTY(QString pathname READ currentPath)
|
Q_PROPERTY(QString pathname READ currentPath)
|
||||||
Q_PROPERTY(QString placename READ getPlaceName)
|
Q_PROPERTY(QString placename READ getPlaceName)
|
||||||
Q_PROPERTY(QString domainId READ getDomainId)
|
Q_PROPERTY(QString domainId READ getDomainId)
|
||||||
Q_PROPERTY(QUrl metaverseServerUrl READ getMetaverseServerUrl NOTIFY metaverseServerUrlChanged)
|
|
||||||
public:
|
public:
|
||||||
Q_INVOKABLE QString protocolVersion();
|
Q_INVOKABLE QString protocolVersion();
|
||||||
using PositionGetter = std::function<glm::vec3()>;
|
using PositionGetter = std::function<glm::vec3()>;
|
||||||
|
@ -71,7 +70,6 @@ public:
|
||||||
const QUuid& getRootPlaceID() const { return _rootPlaceID; }
|
const QUuid& getRootPlaceID() const { return _rootPlaceID; }
|
||||||
const QString& getPlaceName() const { return _shareablePlaceName.isEmpty() ? _placeName : _shareablePlaceName; }
|
const QString& getPlaceName() const { return _shareablePlaceName.isEmpty() ? _placeName : _shareablePlaceName; }
|
||||||
QString getDomainId() const;
|
QString getDomainId() const;
|
||||||
const QUrl getMetaverseServerUrl() const;
|
|
||||||
|
|
||||||
const QString& getHost() const { return _host; }
|
const QString& getHost() const { return _host; }
|
||||||
|
|
||||||
|
@ -123,8 +121,6 @@ signals:
|
||||||
void goBackPossible(bool isPossible);
|
void goBackPossible(bool isPossible);
|
||||||
void goForwardPossible(bool isPossible);
|
void goForwardPossible(bool isPossible);
|
||||||
|
|
||||||
void metaverseServerUrlChanged();
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
AddressManager();
|
AddressManager();
|
||||||
private slots:
|
private slots:
|
||||||
|
|
|
@ -1,21 +0,0 @@
|
||||||
//
|
|
||||||
// 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 <QtCore/QUrl>
|
|
||||||
|
|
||||||
namespace NetworkingConstants {
|
|
||||||
const QUrl METAVERSE_SERVER_URL = QUrl("https://metaverse.highfidelity.com");
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // hifi_NetworkingConstants_h
|
|
|
@ -15,7 +15,6 @@
|
||||||
|
|
||||||
#include "AccountManager.h"
|
#include "AccountManager.h"
|
||||||
#include "LimitedNodeList.h"
|
#include "LimitedNodeList.h"
|
||||||
#include "NetworkingConstants.h"
|
|
||||||
#include "SharedUtil.h"
|
#include "SharedUtil.h"
|
||||||
|
|
||||||
#include "OAuthNetworkAccessManager.h"
|
#include "OAuthNetworkAccessManager.h"
|
||||||
|
@ -35,7 +34,7 @@ QNetworkReply* OAuthNetworkAccessManager::createRequest(QNetworkAccessManager::O
|
||||||
auto accountManager = DependencyManager::get<AccountManager>();
|
auto accountManager = DependencyManager::get<AccountManager>();
|
||||||
|
|
||||||
if (accountManager->hasValidAccessToken()
|
if (accountManager->hasValidAccessToken()
|
||||||
&& req.url().host() == NetworkingConstants::METAVERSE_SERVER_URL.host()) {
|
&& req.url().host() == accountManager->getMetaverseServerURL().host()) {
|
||||||
QNetworkRequest authenticatedRequest(req);
|
QNetworkRequest authenticatedRequest(req);
|
||||||
authenticatedRequest.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
|
authenticatedRequest.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
|
||||||
authenticatedRequest.setHeader(QNetworkRequest::UserAgentHeader, HIGH_FIDELITY_USER_AGENT);
|
authenticatedRequest.setHeader(QNetworkRequest::UserAgentHeader, HIGH_FIDELITY_USER_AGENT);
|
||||||
|
|
|
@ -17,13 +17,10 @@
|
||||||
|
|
||||||
#include <AccountManager.h>
|
#include <AccountManager.h>
|
||||||
#include <NetworkAccessManager.h>
|
#include <NetworkAccessManager.h>
|
||||||
#include <NetworkingConstants.h>
|
|
||||||
|
|
||||||
#include "ScriptEngine.h"
|
#include "ScriptEngine.h"
|
||||||
#include "XMLHttpRequestClass.h"
|
#include "XMLHttpRequestClass.h"
|
||||||
|
|
||||||
const QString METAVERSE_API_URL = NetworkingConstants::METAVERSE_SERVER_URL.toString() + "/api/";
|
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(QByteArray*)
|
Q_DECLARE_METATYPE(QByteArray*)
|
||||||
|
|
||||||
XMLHttpRequestClass::XMLHttpRequestClass(QScriptEngine* engine) :
|
XMLHttpRequestClass::XMLHttpRequestClass(QScriptEngine* engine) :
|
||||||
|
@ -140,7 +137,9 @@ void XMLHttpRequestClass::open(const QString& method, const QString& url, bool a
|
||||||
_url.setUrl(url);
|
_url.setUrl(url);
|
||||||
_async = async;
|
_async = async;
|
||||||
|
|
||||||
if (url.toLower().left(METAVERSE_API_URL.length()) == METAVERSE_API_URL) {
|
auto metaverseApiUrl = DependencyManager::get<AccountManager>()->getMetaverseServerURL().toString() + "/api/";
|
||||||
|
|
||||||
|
if (url.toLower().left(metaverseApiUrl.length()) == metaverseApiUrl) {
|
||||||
auto accountManager = DependencyManager::get<AccountManager>();
|
auto accountManager = DependencyManager::get<AccountManager>();
|
||||||
|
|
||||||
if (accountManager->hasValidAccessToken()) {
|
if (accountManager->hasValidAccessToken()) {
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
#include "RequestFilters.h"
|
#include "RequestFilters.h"
|
||||||
#include "NetworkingConstants.h"
|
|
||||||
|
|
||||||
#include <QtCore/QDebug>
|
#include <QtCore/QDebug>
|
||||||
#include <SettingHandle.h>
|
#include <SettingHandle.h>
|
||||||
|
@ -26,9 +25,10 @@ namespace {
|
||||||
};
|
};
|
||||||
const auto& scheme = url.scheme();
|
const auto& scheme = url.scheme();
|
||||||
const auto& host = url.host();
|
const auto& host = url.host();
|
||||||
|
auto metaverseServerURL = DependencyManager::get<AccountManager>()->getMetaverseServerURL();
|
||||||
|
|
||||||
return (scheme == "https" && HF_HOSTS.contains(host)) ||
|
return (scheme == "https" && HF_HOSTS.contains(host)) ||
|
||||||
((scheme == NetworkingConstants::METAVERSE_SERVER_URL.scheme()) && (host == NetworkingConstants::METAVERSE_SERVER_URL.host()));
|
((scheme == metaverseServerURL.scheme()) && (host == metaverseServerURL.host()));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isScript(const QString filename) {
|
bool isScript(const QString filename) {
|
||||||
|
|
|
@ -444,7 +444,7 @@
|
||||||
}, WAITING_INTERVAL);
|
}, WAITING_INTERVAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
var pollCount = 0, requestUrl = location.metaverseServerUrl + '/api/v1/user/connection_request';
|
var pollCount = 0, requestUrl = Account.metaverseServerURL + '/api/v1/user/connection_request';
|
||||||
// As currently implemented, we select the closest waiting avatar (if close enough) and send
|
// As currently implemented, we select the closest waiting avatar (if close enough) and send
|
||||||
// them a connectionRequest. If nobody is close enough we send a waiting message, and wait for a
|
// them a connectionRequest. If nobody is close enough we send a waiting message, and wait for a
|
||||||
// connectionRequest. If the 2 people who want to connect are both somewhat out of range when they
|
// connectionRequest. If the 2 people who want to connect are both somewhat out of range when they
|
||||||
|
@ -569,7 +569,7 @@
|
||||||
// IWBNI we also did some fail sound/visual effect.
|
// IWBNI we also did some fail sound/visual effect.
|
||||||
Window.makeConnection(false, result.connection);
|
Window.makeConnection(false, result.connection);
|
||||||
if (Account.isLoggedIn()) { // Give extra failure info
|
if (Account.isLoggedIn()) { // Give extra failure info
|
||||||
request(location.metaverseServerUrl + '/api/v1/users/' + Account.username + '/location', function (error, response) {
|
request(Account.metaverseServerURL + '/api/v1/users/' + Account.username + '/location', function (error, response) {
|
||||||
var message = '';
|
var message = '';
|
||||||
if (error || response.status !== 'success') {
|
if (error || response.status !== 'success') {
|
||||||
message = 'Unable to get location.';
|
message = 'Unable to get location.';
|
||||||
|
|
|
@ -334,7 +334,7 @@ function updateUser(data) {
|
||||||
// User management services
|
// User management services
|
||||||
//
|
//
|
||||||
// These are prototype versions that will be changed when the back end changes.
|
// These are prototype versions that will be changed when the back end changes.
|
||||||
var METAVERSE_BASE = location.metaverseServerUrl;
|
var METAVERSE_BASE = Account.metaverseServerURL;
|
||||||
|
|
||||||
function requestJSON(url, callback) { // callback(data) if successfull. Logs otherwise.
|
function requestJSON(url, callback) { // callback(data) if successfull. Logs otherwise.
|
||||||
request({
|
request({
|
||||||
|
|
|
@ -35,7 +35,7 @@ var imageData = [];
|
||||||
var storyIDsToMaybeDelete = [];
|
var storyIDsToMaybeDelete = [];
|
||||||
var shareAfterLogin = false;
|
var shareAfterLogin = false;
|
||||||
var snapshotToShareAfterLogin = [];
|
var snapshotToShareAfterLogin = [];
|
||||||
var METAVERSE_BASE = location.metaverseServerUrl;
|
var METAVERSE_BASE = Account.metaverseServerURL;
|
||||||
var isLoggedIn;
|
var isLoggedIn;
|
||||||
var numGifSnapshotUploadsPending = 0;
|
var numGifSnapshotUploadsPending = 0;
|
||||||
var numStillSnapshotUploadsPending = 0;
|
var numStillSnapshotUploadsPending = 0;
|
||||||
|
|
|
@ -115,7 +115,7 @@
|
||||||
var stories = {}, pingPong = false;
|
var stories = {}, pingPong = false;
|
||||||
function expire(id) {
|
function expire(id) {
|
||||||
var options = {
|
var options = {
|
||||||
uri: location.metaverseServerUrl + '/api/v1/user_stories/' + id,
|
uri: Account.metaverseServerURL + '/api/v1/user_stories/' + id,
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
json: true,
|
json: true,
|
||||||
body: {expire: "true"}
|
body: {expire: "true"}
|
||||||
|
@ -139,7 +139,7 @@
|
||||||
'protocol=' + encodeURIComponent(location.protocolVersion()),
|
'protocol=' + encodeURIComponent(location.protocolVersion()),
|
||||||
'per_page=' + count
|
'per_page=' + count
|
||||||
];
|
];
|
||||||
var url = location.metaverseServerUrl + '/api/v1/user_stories?' + options.join('&');
|
var url = Account.metaverseServerURL + '/api/v1/user_stories?' + options.join('&');
|
||||||
request({
|
request({
|
||||||
uri: url
|
uri: url
|
||||||
}, function (error, data) {
|
}, function (error, data) {
|
||||||
|
|
|
@ -14,7 +14,6 @@
|
||||||
#include <QLoggingCategory>
|
#include <QLoggingCategory>
|
||||||
#include <QCommandLineParser>
|
#include <QCommandLineParser>
|
||||||
#include <NetworkLogging.h>
|
#include <NetworkLogging.h>
|
||||||
#include <NetworkingConstants.h>
|
|
||||||
#include <SharedLogging.h>
|
#include <SharedLogging.h>
|
||||||
#include <AddressManager.h>
|
#include <AddressManager.h>
|
||||||
#include <DependencyManager.h>
|
#include <DependencyManager.h>
|
||||||
|
@ -106,7 +105,7 @@ ACClientApp::ACClientApp(int argc, char* argv[]) :
|
||||||
|
|
||||||
auto accountManager = DependencyManager::get<AccountManager>();
|
auto accountManager = DependencyManager::get<AccountManager>();
|
||||||
accountManager->setIsAgent(true);
|
accountManager->setIsAgent(true);
|
||||||
accountManager->setAuthURL(NetworkingConstants::METAVERSE_SERVER_URL);
|
accountManager->setAuthURL(accountManager->getMetaverseServerURL());
|
||||||
|
|
||||||
auto nodeList = DependencyManager::get<NodeList>();
|
auto nodeList = DependencyManager::get<NodeList>();
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,6 @@
|
||||||
#include <QCommandLineParser>
|
#include <QCommandLineParser>
|
||||||
|
|
||||||
#include <NetworkLogging.h>
|
#include <NetworkLogging.h>
|
||||||
#include <NetworkingConstants.h>
|
|
||||||
#include <SharedLogging.h>
|
#include <SharedLogging.h>
|
||||||
#include <AddressManager.h>
|
#include <AddressManager.h>
|
||||||
#include <DependencyManager.h>
|
#include <DependencyManager.h>
|
||||||
|
@ -145,7 +144,7 @@ ATPClientApp::ATPClientApp(int argc, char* argv[]) :
|
||||||
|
|
||||||
auto accountManager = DependencyManager::get<AccountManager>();
|
auto accountManager = DependencyManager::get<AccountManager>();
|
||||||
accountManager->setIsAgent(true);
|
accountManager->setIsAgent(true);
|
||||||
accountManager->setAuthURL(NetworkingConstants::METAVERSE_SERVER_URL);
|
accountManager->setAuthURL(accountManager->getMetaverseServerURL());
|
||||||
|
|
||||||
auto nodeList = DependencyManager::get<NodeList>();
|
auto nodeList = DependencyManager::get<NodeList>();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue