mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:44:02 +02:00
Merge pull request #12801 from sethalves/fix-serverless-sharable
fix -- don't tell steam about serverless domain urls
This commit is contained in:
commit
55154b670a
4 changed files with 27 additions and 2 deletions
|
@ -129,7 +129,7 @@ void DiscoverabilityManager::updateLocation() {
|
|||
|
||||
// Update Steam
|
||||
if (auto steamClient = PluginManager::getInstance()->getSteamClientPlugin()) {
|
||||
steamClient->updateLocation(domainHandler.getHostname(), addressManager->currentFacingShareableAddress());
|
||||
steamClient->updateLocation(domainHandler.getHostname(), addressManager->currentFacingPublicAddress());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@ QTemporaryFile* Snapshot::saveTempSnapshot(QImage image) {
|
|||
QFile* Snapshot::savedFileForSnapshot(QImage & shot, bool isTemporary, const QString& userSelectedFilename) {
|
||||
|
||||
// adding URL to snapshot
|
||||
QUrl currentURL = DependencyManager::get<AddressManager>()->currentShareableAddress();
|
||||
QUrl currentURL = DependencyManager::get<AddressManager>()->currentPublicAddress();
|
||||
shot.setText(URL, currentURL.toString());
|
||||
|
||||
QString username = DependencyManager::get<AccountManager>()->getAccountInfo().getUsername();
|
||||
|
|
|
@ -77,6 +77,17 @@ QUrl AddressManager::currentShareableAddress(bool domainOnly) const {
|
|||
}
|
||||
}
|
||||
|
||||
QUrl AddressManager::currentPublicAddress(bool domainOnly) const {
|
||||
// return an address that can be used by others to visit this client's current location. If
|
||||
// in a serverless domain (which can't be visited) return an empty URL.
|
||||
QUrl shareableAddress = currentShareableAddress(domainOnly);
|
||||
if (shareableAddress.scheme() != URL_SCHEME_HIFI) {
|
||||
return QUrl(); // file: urls aren't public
|
||||
}
|
||||
return shareableAddress;
|
||||
}
|
||||
|
||||
|
||||
QUrl AddressManager::currentFacingShareableAddress() const {
|
||||
auto hifiURL = currentShareableAddress();
|
||||
if (hifiURL.scheme() == URL_SCHEME_HIFI) {
|
||||
|
@ -86,6 +97,17 @@ QUrl AddressManager::currentFacingShareableAddress() const {
|
|||
return hifiURL;
|
||||
}
|
||||
|
||||
QUrl AddressManager::currentFacingPublicAddress() const {
|
||||
// return an address that can be used by others to visit this client's current location. If
|
||||
// in a serverless domain (which can't be visited) return an empty URL.
|
||||
QUrl shareableAddress = currentFacingShareableAddress();
|
||||
if (shareableAddress.scheme() != URL_SCHEME_HIFI) {
|
||||
return QUrl(); // file: urls aren't public
|
||||
}
|
||||
return shareableAddress;
|
||||
}
|
||||
|
||||
|
||||
void AddressManager::loadSettings(const QString& lookupString) {
|
||||
#if defined(USE_GLES) && defined(Q_OS_WIN)
|
||||
handleUrl(QUrl("hifi://127.0.0.0"), LookupTrigger::StartupFromSettings);
|
||||
|
@ -288,6 +310,7 @@ bool AddressManager::handleUrl(const QUrl& lookupUrl, LookupTrigger trigger) {
|
|||
// lookupUrl.scheme() == URL_SCHEME_HTTP ||
|
||||
// lookupUrl.scheme() == URL_SCHEME_HTTPS ||
|
||||
_previousLookup.clear();
|
||||
_shareablePlaceName.clear();
|
||||
QUrl domainURL = PathUtils::expandToLocalDataAbsolutePath(lookupUrl);
|
||||
setDomainInfo(domainURL, trigger);
|
||||
emit lookupResultsFinished();
|
||||
|
|
|
@ -150,7 +150,9 @@ public:
|
|||
QUrl currentAddress(bool domainOnly = false) const;
|
||||
QUrl currentFacingAddress() const;
|
||||
QUrl currentShareableAddress(bool domainOnly = false) const;
|
||||
QUrl currentPublicAddress(bool domainOnly = false) const;
|
||||
QUrl currentFacingShareableAddress() const;
|
||||
QUrl currentFacingPublicAddress() const;
|
||||
QString currentPath(bool withOrientation = true) const;
|
||||
QString currentFacingPath() const;
|
||||
|
||||
|
|
Loading…
Reference in a new issue