mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 04:24:47 +02:00
adding property to location, updating domain
This commit is contained in:
parent
002c6547ee
commit
9e0fa08cf1
6 changed files with 545 additions and 819 deletions
File diff suppressed because it is too large
Load diff
|
@ -1211,6 +1211,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
||||||
|
|
||||||
auto discoverabilityManager = DependencyManager::get<DiscoverabilityManager>();
|
auto discoverabilityManager = DependencyManager::get<DiscoverabilityManager>();
|
||||||
connect(&locationUpdateTimer, &QTimer::timeout, discoverabilityManager.data(), &DiscoverabilityManager::updateLocation);
|
connect(&locationUpdateTimer, &QTimer::timeout, discoverabilityManager.data(), &DiscoverabilityManager::updateLocation);
|
||||||
|
connect(&domainHandler, &DomainHandler::domainConnectionErrorChanged, DependencyManager::get<AddressManager>().data(),
|
||||||
|
&AddressManager::setLastDomainConnectionError);
|
||||||
connect(&locationUpdateTimer, &QTimer::timeout,
|
connect(&locationUpdateTimer, &QTimer::timeout,
|
||||||
DependencyManager::get<AddressManager>().data(), &AddressManager::storeCurrentAddress);
|
DependencyManager::get<AddressManager>().data(), &AddressManager::storeCurrentAddress);
|
||||||
locationUpdateTimer.start(DATA_SERVER_LOCATION_CHANGE_UPDATE_MSECS);
|
locationUpdateTimer.start(DATA_SERVER_LOCATION_CHANGE_UPDATE_MSECS);
|
||||||
|
|
|
@ -343,9 +343,7 @@ bool AddressManager::handleUrl(const QUrl& lookupUrl, LookupTrigger trigger) {
|
||||||
|
|
||||||
_previousAPILookup.clear();
|
_previousAPILookup.clear();
|
||||||
_shareablePlaceName.clear();
|
_shareablePlaceName.clear();
|
||||||
if (lookupUrl.toString() != REDIRECT_HIFI_ADDRESS) {
|
setDomainInfo(lookupUrl, trigger);
|
||||||
setDomainInfo(lookupUrl, trigger);
|
|
||||||
}
|
|
||||||
emit lookupResultsFinished();
|
emit lookupResultsFinished();
|
||||||
|
|
||||||
QString path = DOMAIN_SPAWNING_POINT;
|
QString path = DOMAIN_SPAWNING_POINT;
|
||||||
|
|
|
@ -56,6 +56,8 @@ const QString GET_PLACE = "/api/v1/places/%1";
|
||||||
* <em>Read-only.</em>
|
* <em>Read-only.</em>
|
||||||
* @property {boolean} isConnected - <code>true</code> if you're connected to the domain in your current <code>href</code>
|
* @property {boolean} isConnected - <code>true</code> if you're connected to the domain in your current <code>href</code>
|
||||||
* metaverse address, otherwise <code>false</code>.
|
* metaverse address, otherwise <code>false</code>.
|
||||||
|
* @property {Window.ConnectionRefusedReason} lastDomainConnectionError - The last error saved from connecting to a domain
|
||||||
|
* unsuccessfully.
|
||||||
* <em>Read-only.</em>
|
* <em>Read-only.</em>
|
||||||
* @property {string} pathname - The location and orientation in your current <code>href</code> metaverse address
|
* @property {string} pathname - The location and orientation in your current <code>href</code> metaverse address
|
||||||
* (e.g., <code>"/15,-10,26/0,0,0,1"</code>).
|
* (e.g., <code>"/15,-10,26/0,0,0,1"</code>).
|
||||||
|
@ -74,6 +76,7 @@ class AddressManager : public QObject, public Dependency {
|
||||||
Q_PROPERTY(QUrl href READ currentShareableAddress)
|
Q_PROPERTY(QUrl href READ currentShareableAddress)
|
||||||
Q_PROPERTY(QString protocol READ getProtocol)
|
Q_PROPERTY(QString protocol READ getProtocol)
|
||||||
Q_PROPERTY(QString hostname READ getHost)
|
Q_PROPERTY(QString hostname READ getHost)
|
||||||
|
Q_PROPERTY(int lastDomainConnectionError READ getLastDomainConnectionError)
|
||||||
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)
|
||||||
|
@ -141,7 +144,8 @@ public:
|
||||||
* </table>
|
* </table>
|
||||||
* @typedef {number} location.LookupTrigger
|
* @typedef {number} location.LookupTrigger
|
||||||
*/
|
*/
|
||||||
enum LookupTrigger {
|
enum LookupTrigger
|
||||||
|
{
|
||||||
UserInput,
|
UserInput,
|
||||||
Back,
|
Back,
|
||||||
Forward,
|
Forward,
|
||||||
|
@ -184,6 +188,9 @@ public:
|
||||||
|
|
||||||
QUrl getDomainURL() { return _domainURL; }
|
QUrl getDomainURL() { return _domainURL; }
|
||||||
|
|
||||||
|
int getLastDomainConnectionError() { return _lastDomainConnectionError; }
|
||||||
|
void setLastDomainConnectionError(int reasonCode) { _lastDomainConnectionError = reasonCode; }
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Go to a specified metaverse address.
|
* Go to a specified metaverse address.
|
||||||
|
@ -195,7 +202,7 @@ public slots:
|
||||||
* Helps ensure that user's location history is correctly maintained.
|
* Helps ensure that user's location history is correctly maintained.
|
||||||
*/
|
*/
|
||||||
void handleLookupString(const QString& lookupString, bool fromSuggestions = false);
|
void handleLookupString(const QString& lookupString, bool fromSuggestions = false);
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Go to a position and orientation resulting from a lookup for a named path in the domain (set in the domain server's
|
* Go to a position and orientation resulting from a lookup for a named path in the domain (set in the domain server's
|
||||||
* settings).
|
* settings).
|
||||||
|
@ -208,8 +215,9 @@ public slots:
|
||||||
// functions and signals that should be exposed are moved to a scripting interface class.
|
// functions and signals that should be exposed are moved to a scripting interface class.
|
||||||
//
|
//
|
||||||
// we currently expect this to be called from NodeList once handleLookupString has been called with a path
|
// we currently expect this to be called from NodeList once handleLookupString has been called with a path
|
||||||
bool goToViewpointForPath(const QString& viewpointString, const QString& pathString)
|
bool goToViewpointForPath(const QString& viewpointString, const QString& pathString) {
|
||||||
{ return handleViewpoint(viewpointString, false, DomainPathResponse, false, pathString); }
|
return handleViewpoint(viewpointString, false, DomainPathResponse, false, pathString);
|
||||||
|
}
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Go back to the previous location in your navigation history, if there is one.
|
* Go back to the previous location in your navigation history, if there is one.
|
||||||
|
@ -230,8 +238,10 @@ public slots:
|
||||||
* @param {location.LookupTrigger} trigger=StartupFromSettings - The reason for the function call. Helps ensure that user's
|
* @param {location.LookupTrigger} trigger=StartupFromSettings - The reason for the function call. Helps ensure that user's
|
||||||
* location history is correctly maintained.
|
* location history is correctly maintained.
|
||||||
*/
|
*/
|
||||||
void goToLocalSandbox(QString path = "", LookupTrigger trigger = LookupTrigger::StartupFromSettings) { handleUrl(SANDBOX_HIFI_ADDRESS + path, trigger); }
|
void goToLocalSandbox(QString path = "", LookupTrigger trigger = LookupTrigger::StartupFromSettings) {
|
||||||
|
handleUrl(SANDBOX_HIFI_ADDRESS + path, trigger);
|
||||||
|
}
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Go to the default "welcome" metaverse address.
|
* Go to the default "welcome" metaverse address.
|
||||||
* @function location.goToEntry
|
* @function location.goToEntry
|
||||||
|
@ -362,7 +372,8 @@ signals:
|
||||||
* location.locationChangeRequired.connect(onLocationChangeRequired);
|
* location.locationChangeRequired.connect(onLocationChangeRequired);
|
||||||
*/
|
*/
|
||||||
void locationChangeRequired(const glm::vec3& newPosition,
|
void locationChangeRequired(const glm::vec3& newPosition,
|
||||||
bool hasOrientationChange, const glm::quat& newOrientation,
|
bool hasOrientationChange,
|
||||||
|
const glm::quat& newOrientation,
|
||||||
bool shouldFaceLocation);
|
bool shouldFaceLocation);
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
|
@ -433,7 +444,7 @@ private slots:
|
||||||
void handleShareableNameAPIResponse(QNetworkReply* requestReply);
|
void handleShareableNameAPIResponse(QNetworkReply* requestReply);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void goToAddressFromObject(const QVariantMap& addressMap, const QNetworkReply* reply);
|
void goToAddressFromObject(const QVariantMap& addressMap, const QNetworkReply* reply);
|
||||||
|
|
||||||
// Set host and port, and return `true` if it was changed.
|
// Set host and port, and return `true` if it was changed.
|
||||||
bool setHost(const QString& host, LookupTrigger trigger, quint16 port = 0);
|
bool setHost(const QString& host, LookupTrigger trigger, quint16 port = 0);
|
||||||
|
@ -445,8 +456,11 @@ private:
|
||||||
|
|
||||||
bool handleNetworkAddress(const QString& lookupString, LookupTrigger trigger, bool& hostChanged);
|
bool handleNetworkAddress(const QString& lookupString, LookupTrigger trigger, bool& hostChanged);
|
||||||
void handlePath(const QString& path, LookupTrigger trigger, bool wasPathOnly = false);
|
void handlePath(const QString& path, LookupTrigger trigger, bool wasPathOnly = false);
|
||||||
bool handleViewpoint(const QString& viewpointString, bool shouldFace, LookupTrigger trigger,
|
bool handleViewpoint(const QString& viewpointString,
|
||||||
bool definitelyPathOnly = false, const QString& pathString = QString());
|
bool shouldFace,
|
||||||
|
LookupTrigger trigger,
|
||||||
|
bool definitelyPathOnly = false,
|
||||||
|
const QString& pathString = QString());
|
||||||
bool handleUsername(const QString& lookupString);
|
bool handleUsername(const QString& lookupString);
|
||||||
bool handleDomainID(const QString& host);
|
bool handleDomainID(const QString& host);
|
||||||
|
|
||||||
|
@ -457,6 +471,8 @@ private:
|
||||||
|
|
||||||
QUrl _domainURL;
|
QUrl _domainURL;
|
||||||
QUrl _lastVisitedURL;
|
QUrl _lastVisitedURL;
|
||||||
|
// domain connection error from domain handler.
|
||||||
|
int _lastDomainConnectionError{ -1 };
|
||||||
|
|
||||||
QUuid _rootPlaceID;
|
QUuid _rootPlaceID;
|
||||||
PositionGetter _positionGetter;
|
PositionGetter _positionGetter;
|
||||||
|
@ -473,4 +489,4 @@ private:
|
||||||
QUrl _previousAPILookup;
|
QUrl _previousAPILookup;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_AddressManager_h
|
#endif // hifi_AddressManager_h
|
||||||
|
|
|
@ -480,6 +480,7 @@ void DomainHandler::processDomainServerConnectionDeniedPacket(QSharedPointer<Rec
|
||||||
} else {
|
} else {
|
||||||
emit domainConnectionRefused(reasonMessage, (int)reasonCode, extraInfo);
|
emit domainConnectionRefused(reasonMessage, (int)reasonCode, extraInfo);
|
||||||
}
|
}
|
||||||
|
emit domainConnectionErrorChanged((int)reasonCode);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -169,6 +169,8 @@ private slots:
|
||||||
signals:
|
signals:
|
||||||
void domainURLChanged(QUrl domainURL);
|
void domainURLChanged(QUrl domainURL);
|
||||||
|
|
||||||
|
void domainConnectionErrorChanged(int reasonCode);
|
||||||
|
|
||||||
// NOTE: the emission of completedSocketDiscovery does not mean a connection to DS is established
|
// NOTE: the emission of completedSocketDiscovery does not mean a connection to DS is established
|
||||||
// It means that, either from DNS lookup or ICE, we think we have a socket we can talk to DS on
|
// It means that, either from DNS lookup or ICE, we think we have a socket we can talk to DS on
|
||||||
void completedSocketDiscovery();
|
void completedSocketDiscovery();
|
||||||
|
|
Loading…
Reference in a new issue