mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 22:10:25 +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
|
// Update Steam
|
||||||
if (auto steamClient = PluginManager::getInstance()->getSteamClientPlugin()) {
|
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) {
|
QFile* Snapshot::savedFileForSnapshot(QImage & shot, bool isTemporary, const QString& userSelectedFilename) {
|
||||||
|
|
||||||
// adding URL to snapshot
|
// adding URL to snapshot
|
||||||
QUrl currentURL = DependencyManager::get<AddressManager>()->currentShareableAddress();
|
QUrl currentURL = DependencyManager::get<AddressManager>()->currentPublicAddress();
|
||||||
shot.setText(URL, currentURL.toString());
|
shot.setText(URL, currentURL.toString());
|
||||||
|
|
||||||
QString username = DependencyManager::get<AccountManager>()->getAccountInfo().getUsername();
|
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 {
|
QUrl AddressManager::currentFacingShareableAddress() const {
|
||||||
auto hifiURL = currentShareableAddress();
|
auto hifiURL = currentShareableAddress();
|
||||||
if (hifiURL.scheme() == URL_SCHEME_HIFI) {
|
if (hifiURL.scheme() == URL_SCHEME_HIFI) {
|
||||||
|
@ -86,6 +97,17 @@ QUrl AddressManager::currentFacingShareableAddress() const {
|
||||||
return hifiURL;
|
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) {
|
void AddressManager::loadSettings(const QString& lookupString) {
|
||||||
#if defined(USE_GLES) && defined(Q_OS_WIN)
|
#if defined(USE_GLES) && defined(Q_OS_WIN)
|
||||||
handleUrl(QUrl("hifi://127.0.0.0"), LookupTrigger::StartupFromSettings);
|
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_HTTP ||
|
||||||
// lookupUrl.scheme() == URL_SCHEME_HTTPS ||
|
// lookupUrl.scheme() == URL_SCHEME_HTTPS ||
|
||||||
_previousLookup.clear();
|
_previousLookup.clear();
|
||||||
|
_shareablePlaceName.clear();
|
||||||
QUrl domainURL = PathUtils::expandToLocalDataAbsolutePath(lookupUrl);
|
QUrl domainURL = PathUtils::expandToLocalDataAbsolutePath(lookupUrl);
|
||||||
setDomainInfo(domainURL, trigger);
|
setDomainInfo(domainURL, trigger);
|
||||||
emit lookupResultsFinished();
|
emit lookupResultsFinished();
|
||||||
|
|
|
@ -150,7 +150,9 @@ public:
|
||||||
QUrl currentAddress(bool domainOnly = false) const;
|
QUrl currentAddress(bool domainOnly = false) const;
|
||||||
QUrl currentFacingAddress() const;
|
QUrl currentFacingAddress() const;
|
||||||
QUrl currentShareableAddress(bool domainOnly = false) const;
|
QUrl currentShareableAddress(bool domainOnly = false) const;
|
||||||
|
QUrl currentPublicAddress(bool domainOnly = false) const;
|
||||||
QUrl currentFacingShareableAddress() const;
|
QUrl currentFacingShareableAddress() const;
|
||||||
|
QUrl currentFacingPublicAddress() const;
|
||||||
QString currentPath(bool withOrientation = true) const;
|
QString currentPath(bool withOrientation = true) const;
|
||||||
QString currentFacingPath() const;
|
QString currentFacingPath() const;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue