mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 05:37:17 +02:00
expose metaverse url to javascript and use it rather than hardcoding
This commit is contained in:
parent
5b216578d7
commit
066a518142
3 changed files with 8 additions and 1 deletions
|
@ -24,6 +24,7 @@
|
||||||
|
|
||||||
#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"
|
||||||
|
@ -754,6 +755,10 @@ 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,6 +41,7 @@ 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)
|
||||||
public:
|
public:
|
||||||
Q_INVOKABLE QString protocolVersion();
|
Q_INVOKABLE QString protocolVersion();
|
||||||
using PositionGetter = std::function<glm::vec3()>;
|
using PositionGetter = std::function<glm::vec3()>;
|
||||||
|
@ -70,6 +71,7 @@ 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; }
|
||||||
|
|
||||||
|
|
|
@ -133,7 +133,7 @@ function isDomainOpen(id) {
|
||||||
'restriction=open,hifi' // If we're sharing, we're logged in
|
'restriction=open,hifi' // If we're sharing, we're logged in
|
||||||
// If we're here, protocol matches, and it is online
|
// If we're here, protocol matches, and it is online
|
||||||
];
|
];
|
||||||
var url = "https://metaverse.highfidelity.com/api/v1/user_stories?" + options.join('&');
|
var url = location.metaverseServerUrl + "/api/v1/user_stories?" + options.join('&');
|
||||||
request.open("GET", url, false);
|
request.open("GET", url, false);
|
||||||
request.send();
|
request.send();
|
||||||
if (request.status != 200) {
|
if (request.status != 200) {
|
||||||
|
|
Loading…
Reference in a new issue