mirror of
https://github.com/lubosz/overte.git
synced 2025-04-24 09:23:17 +02:00
Rename 'URL_SCHEME_HIFI' -> 'URL_SCHEME_VIRCADIA'.
This commit is contained in:
parent
d8a0d13812
commit
51e6468abd
9 changed files with 39 additions and 39 deletions
|
@ -4004,7 +4004,7 @@ void Application::handleSandboxStatus(QNetworkReply* reply) {
|
|||
parser.parse(arguments());
|
||||
if (parser.isSet(urlOption)) {
|
||||
QUrl url = QUrl(parser.value(urlOption));
|
||||
if (url.scheme() == URL_SCHEME_HIFIAPP) {
|
||||
if (url.scheme() == URL_SCHEME_VIRCADIAAPP) {
|
||||
Setting::Handle<QVariant>("startUpApp").set(url.path());
|
||||
} else {
|
||||
addressLookupString = url.toString();
|
||||
|
@ -7285,7 +7285,7 @@ void Application::clearDomainOctreeDetails(bool clearAll) {
|
|||
|
||||
void Application::domainURLChanged(QUrl domainURL) {
|
||||
// disable physics until we have enough information about our new location to not cause craziness.
|
||||
setIsServerlessMode(domainURL.scheme() != URL_SCHEME_HIFI);
|
||||
setIsServerlessMode(domainURL.scheme() != URL_SCHEME_VIRCADIA);
|
||||
if (isServerlessMode()) {
|
||||
loadServerlessDomain(domainURL);
|
||||
}
|
||||
|
@ -7294,7 +7294,7 @@ void Application::domainURLChanged(QUrl domainURL) {
|
|||
|
||||
void Application::goToErrorDomainURL(QUrl errorDomainURL) {
|
||||
// disable physics until we have enough information about our new location to not cause craziness.
|
||||
setIsServerlessMode(errorDomainURL.scheme() != URL_SCHEME_HIFI);
|
||||
setIsServerlessMode(errorDomainURL.scheme() != URL_SCHEME_VIRCADIA);
|
||||
if (isServerlessMode()) {
|
||||
loadErrorDomain(errorDomainURL);
|
||||
}
|
||||
|
@ -7658,7 +7658,7 @@ bool Application::canAcceptURL(const QString& urlString) const {
|
|||
QUrl url(urlString);
|
||||
if (url.query().contains(WEB_VIEW_TAG)) {
|
||||
return false;
|
||||
} else if (urlString.startsWith(URL_SCHEME_HIFI)) {
|
||||
} else if (urlString.startsWith(URL_SCHEME_VIRCADIA)) {
|
||||
return true;
|
||||
}
|
||||
QString lowerPath = url.path().toLower();
|
||||
|
@ -7673,7 +7673,7 @@ bool Application::canAcceptURL(const QString& urlString) const {
|
|||
bool Application::acceptURL(const QString& urlString, bool defaultUpload) {
|
||||
QUrl url(urlString);
|
||||
|
||||
if (url.scheme() == URL_SCHEME_HIFI) {
|
||||
if (url.scheme() == URL_SCHEME_VIRCADIA) {
|
||||
// this is a hifi URL - have the AddressManager handle it
|
||||
QMetaObject::invokeMethod(DependencyManager::get<AddressManager>().data(), "handleLookupString",
|
||||
Qt::AutoConnection, Q_ARG(const QString&, urlString));
|
||||
|
|
|
@ -265,7 +265,7 @@ int main(int argc, const char* argv[]) {
|
|||
if (socket.waitForConnected(LOCAL_SERVER_TIMEOUT_MS)) {
|
||||
if (parser.isSet(urlOption)) {
|
||||
QUrl url = QUrl(parser.value(urlOption));
|
||||
if (url.isValid() && (url.scheme() == URL_SCHEME_HIFI || url.scheme() == URL_SCHEME_HIFIAPP
|
||||
if (url.isValid() && (url.scheme() == URL_SCHEME_VIRCADIA || url.scheme() == URL_SCHEME_VIRCADIAAPP
|
||||
|| url.scheme() == HIFI_URL_SCHEME_HTTP || url.scheme() == HIFI_URL_SCHEME_HTTPS
|
||||
|| url.scheme() == HIFI_URL_SCHEME_FILE)) {
|
||||
qDebug() << "Writing URL to local socket";
|
||||
|
|
|
@ -139,9 +139,9 @@ void WindowScriptingInterface::disconnectedFromDomain() {
|
|||
void WindowScriptingInterface::openUrl(const QUrl& url) {
|
||||
if (!url.isEmpty()) {
|
||||
auto scheme = url.scheme();
|
||||
if (scheme == URL_SCHEME_HIFI) {
|
||||
if (scheme == URL_SCHEME_VIRCADIA) {
|
||||
DependencyManager::get<AddressManager>()->handleLookupString(url.toString());
|
||||
} else if (scheme == URL_SCHEME_HIFIAPP) {
|
||||
} else if (scheme == URL_SCHEME_VIRCADIAAPP) {
|
||||
DependencyManager::get<QmlCommerce>()->openSystemApp(url.path());
|
||||
} else {
|
||||
#if defined(Q_OS_ANDROID)
|
||||
|
|
|
@ -39,7 +39,7 @@ const QString SETTINGS_CURRENT_ADDRESS_KEY = "address";
|
|||
const QString DEFAULT_VIRCADIA_ADDRESS = (!BuildInfo::PRELOADED_STARTUP_LOCATION.isEmpty())
|
||||
? BuildInfo::PRELOADED_STARTUP_LOCATION
|
||||
: NetworkingConstants::DEFAULT_VIRCADIA_ADDRESS;
|
||||
const QString DEFAULT_HOME_ADDRESS = (!BuildInfo::PRELOADED_STARTUP_LOCATION.isEmpty())
|
||||
const QString DEFAULT_HOME_ADDRESS = (!BuildInfo::PRELOADED_STARTUP_LOCATION.isEmpty())
|
||||
? BuildInfo::PRELOADED_STARTUP_LOCATION
|
||||
: NetworkingConstants::DEFAULT_VIRCADIA_ADDRESS;
|
||||
|
||||
|
@ -56,7 +56,7 @@ QString AddressManager::getProtocol() const {
|
|||
QUrl AddressManager::currentAddress(bool domainOnly) const {
|
||||
QUrl hifiURL = _domainURL;
|
||||
|
||||
if (!domainOnly && hifiURL.scheme() == URL_SCHEME_HIFI) {
|
||||
if (!domainOnly && hifiURL.scheme() == URL_SCHEME_VIRCADIA) {
|
||||
hifiURL.setPath(currentPath());
|
||||
}
|
||||
|
||||
|
@ -65,7 +65,7 @@ QUrl AddressManager::currentAddress(bool domainOnly) const {
|
|||
|
||||
QUrl AddressManager::currentFacingAddress() const {
|
||||
auto hifiURL = currentAddress();
|
||||
if (hifiURL.scheme() == URL_SCHEME_HIFI) {
|
||||
if (hifiURL.scheme() == URL_SCHEME_VIRCADIA) {
|
||||
hifiURL.setPath(currentFacingPath());
|
||||
}
|
||||
|
||||
|
@ -77,7 +77,7 @@ QUrl AddressManager::currentShareableAddress(bool domainOnly) const {
|
|||
// if we have a shareable place name use that instead of whatever the current host is
|
||||
QUrl hifiURL;
|
||||
|
||||
hifiURL.setScheme(URL_SCHEME_HIFI);
|
||||
hifiURL.setScheme(URL_SCHEME_VIRCADIA);
|
||||
hifiURL.setHost(_shareablePlaceName);
|
||||
|
||||
if (!domainOnly) {
|
||||
|
@ -94,7 +94,7 @@ 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) {
|
||||
if (shareableAddress.scheme() != URL_SCHEME_VIRCADIA) {
|
||||
return QUrl(); // file: urls aren't public
|
||||
}
|
||||
return shareableAddress;
|
||||
|
@ -103,7 +103,7 @@ QUrl AddressManager::currentPublicAddress(bool domainOnly) const {
|
|||
|
||||
QUrl AddressManager::currentFacingShareableAddress() const {
|
||||
auto hifiURL = currentShareableAddress();
|
||||
if (hifiURL.scheme() == URL_SCHEME_HIFI) {
|
||||
if (hifiURL.scheme() == URL_SCHEME_VIRCADIA) {
|
||||
hifiURL.setPath(currentFacingPath());
|
||||
}
|
||||
|
||||
|
@ -114,7 +114,7 @@ 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) {
|
||||
if (shareableAddress.scheme() != URL_SCHEME_VIRCADIA) {
|
||||
return QUrl(); // file: urls aren't public
|
||||
}
|
||||
return shareableAddress;
|
||||
|
@ -165,7 +165,7 @@ void AddressManager::storeCurrentAddress() {
|
|||
|
||||
if (url.scheme() == HIFI_URL_SCHEME_FILE ||
|
||||
url.scheme() == HIFI_URL_SCHEME_HTTP || url.scheme() == HIFI_URL_SCHEME_HTTPS ||
|
||||
(url.scheme() == URL_SCHEME_HIFI && !url.host().isEmpty())) {
|
||||
(url.scheme() == URL_SCHEME_VIRCADIA && !url.host().isEmpty())) {
|
||||
// TODO -- once Octree::readFromURL no-longer takes over the main event-loop, serverless-domain urls can
|
||||
// be loaded over http(s)
|
||||
// url.scheme() == HIFI_URL_SCHEME_HTTP ||
|
||||
|
@ -258,24 +258,24 @@ bool AddressManager::handleUrl(const QUrl& lookupUrlIn, LookupTrigger trigger) {
|
|||
if (lookupUrl.scheme().isEmpty() && !lookupUrl.path().startsWith("/")) {
|
||||
// 'urls' without schemes are taken as domain names, as opposed to
|
||||
// simply a path portion of a url, so we need to set the scheme
|
||||
lookupUrl.setScheme(URL_SCHEME_HIFI);
|
||||
lookupUrl.setScheme(URL_SCHEME_VIRCADIA);
|
||||
}
|
||||
|
||||
static const QRegExp PORT_REGEX = QRegExp("\\d{1,5}(\\/.*)?");
|
||||
if(!lookupUrl.scheme().isEmpty() && lookupUrl.host().isEmpty() && PORT_REGEX.exactMatch(lookupUrl.path())) {
|
||||
// this is in the form somewhere:<port>, convert it to hifi://somewhere:<port>
|
||||
lookupUrl = QUrl(URL_SCHEME_HIFI + "://" + lookupUrl.toString());
|
||||
lookupUrl = QUrl(URL_SCHEME_VIRCADIA + "://" + lookupUrl.toString());
|
||||
}
|
||||
// it should be noted that url's in the form
|
||||
// somewhere:<port> are not valid, as that
|
||||
// would indicate that the scheme is 'somewhere'
|
||||
// use hifi://somewhere:<port> instead
|
||||
|
||||
if (lookupUrl.scheme() == URL_SCHEME_HIFI) {
|
||||
if (lookupUrl.scheme() == URL_SCHEME_VIRCADIA) {
|
||||
if (lookupUrl.host().isEmpty()) {
|
||||
// this was in the form hifi:/somewhere or hifi:somewhere. Fix it by making it hifi://somewhere
|
||||
static const QRegExp HIFI_SCHEME_REGEX = QRegExp(URL_SCHEME_HIFI + ":\\/{0,2}", Qt::CaseInsensitive);
|
||||
lookupUrl = QUrl(lookupUrl.toString().replace(HIFI_SCHEME_REGEX, URL_SCHEME_HIFI + "://"));
|
||||
static const QRegExp HIFI_SCHEME_REGEX = QRegExp(URL_SCHEME_VIRCADIA + ":\\/{0,2}", Qt::CaseInsensitive);
|
||||
lookupUrl = QUrl(lookupUrl.toString().replace(HIFI_SCHEME_REGEX, URL_SCHEME_VIRCADIA + "://"));
|
||||
}
|
||||
|
||||
DependencyManager::get<NodeList>()->flagTimeForConnectionStep(LimitedNodeList::ConnectionStep::LookupAddress);
|
||||
|
@ -371,7 +371,7 @@ bool AddressManager::handleUrl(const QUrl& lookupUrlIn, LookupTrigger trigger) {
|
|||
return true;
|
||||
} else if (lookupUrl.scheme() == HIFI_URL_SCHEME_FILE || lookupUrl.scheme() == HIFI_URL_SCHEME_HTTPS
|
||||
|| lookupUrl.scheme() == HIFI_URL_SCHEME_HTTP) {
|
||||
|
||||
|
||||
// Save the last visited domain URL.
|
||||
_lastVisitedURL = lookupUrl;
|
||||
|
||||
|
@ -494,7 +494,7 @@ void AddressManager::goToAddressFromObject(const QVariantMap& dataObject, const
|
|||
qCDebug(networking) << "Possible domain change required to connect to" << domainHostname
|
||||
<< "on" << domainPort;
|
||||
QUrl domainURL;
|
||||
domainURL.setScheme(URL_SCHEME_HIFI);
|
||||
domainURL.setScheme(URL_SCHEME_VIRCADIA);
|
||||
domainURL.setHost(domainHostname);
|
||||
if (domainPort > 0) {
|
||||
domainURL.setPort(domainPort);
|
||||
|
@ -667,7 +667,7 @@ bool AddressManager::handleNetworkAddress(const QString& lookupString, LookupTri
|
|||
|
||||
emit lookupResultsFinished();
|
||||
QUrl domainURL;
|
||||
domainURL.setScheme(URL_SCHEME_HIFI);
|
||||
domainURL.setScheme(URL_SCHEME_VIRCADIA);
|
||||
domainURL.setHost(domainIPString);
|
||||
if (domainPort > 0) {
|
||||
domainURL.setPort(domainPort);
|
||||
|
@ -690,7 +690,7 @@ bool AddressManager::handleNetworkAddress(const QString& lookupString, LookupTri
|
|||
|
||||
emit lookupResultsFinished();
|
||||
QUrl domainURL;
|
||||
domainURL.setScheme(URL_SCHEME_HIFI);
|
||||
domainURL.setScheme(URL_SCHEME_VIRCADIA);
|
||||
domainURL.setHost(domainHostname);
|
||||
if (domainPort > 0) {
|
||||
domainURL.setPort(domainPort);
|
||||
|
@ -823,7 +823,7 @@ bool AddressManager::setHost(const QString& host, LookupTrigger trigger, quint16
|
|||
addCurrentAddressToHistory(trigger);
|
||||
|
||||
_domainURL = QUrl();
|
||||
_domainURL.setScheme(URL_SCHEME_HIFI);
|
||||
_domainURL.setScheme(URL_SCHEME_VIRCADIA);
|
||||
_domainURL.setHost(host);
|
||||
if (port > 0) {
|
||||
_domainURL.setPort(port);
|
||||
|
@ -860,7 +860,7 @@ bool AddressManager::setDomainInfo(const QUrl& domainURL, LookupTrigger trigger)
|
|||
// clear any current place information
|
||||
_rootPlaceID = QUuid();
|
||||
|
||||
if (_domainURL.scheme() == URL_SCHEME_HIFI) {
|
||||
if (_domainURL.scheme() == URL_SCHEME_VIRCADIA) {
|
||||
qCDebug(networking) << "Possible domain change required to connect to domain at" << hostname << "on" << port;
|
||||
} else {
|
||||
qCDebug(networking) << "Possible domain change required to serverless domain: " << domainURL.toString();
|
||||
|
|
|
@ -184,7 +184,7 @@ void DomainHandler::setSockAddr(const HifiSockAddr& sockAddr, const QString& hos
|
|||
|
||||
// some callers may pass a hostname, this is not to be used for lookup but for DTLS certificate verification
|
||||
_domainURL = QUrl();
|
||||
_domainURL.setScheme(URL_SCHEME_HIFI);
|
||||
_domainURL.setScheme(URL_SCHEME_VIRCADIA);
|
||||
_domainURL.setHost(hostname);
|
||||
_domainURL.setPort(_sockAddr.getPort());
|
||||
}
|
||||
|
@ -199,7 +199,7 @@ void DomainHandler::setUUID(const QUuid& uuid) {
|
|||
void DomainHandler::setURLAndID(QUrl domainURL, QUuid domainID) {
|
||||
_pendingDomainID = domainID;
|
||||
|
||||
if (domainURL.scheme() != URL_SCHEME_HIFI) {
|
||||
if (domainURL.scheme() != URL_SCHEME_VIRCADIA) {
|
||||
_sockAddr.clear();
|
||||
|
||||
// if this is a file URL we need to see if it has a ~ for us to expand
|
||||
|
@ -215,7 +215,7 @@ void DomainHandler::setURLAndID(QUrl domainURL, QUuid domainID) {
|
|||
|
||||
// if it's in the error state, reset and try again.
|
||||
if (_domainURL != domainURL
|
||||
|| (_sockAddr.getPort() != domainPort && domainURL.scheme() == URL_SCHEME_HIFI)
|
||||
|| (_sockAddr.getPort() != domainPort && domainURL.scheme() == URL_SCHEME_VIRCADIA)
|
||||
|| isServerless() // For reloading content in serverless domain.
|
||||
|| _isInErrorState) {
|
||||
// re-set the domain info so that auth information is reloaded
|
||||
|
@ -230,7 +230,7 @@ void DomainHandler::setURLAndID(QUrl domainURL, QUuid domainID) {
|
|||
qCDebug(networking) << "Updated domain hostname to" << domainURL.host();
|
||||
|
||||
if (!domainURL.host().isEmpty()) {
|
||||
if (domainURL.scheme() == URL_SCHEME_HIFI) {
|
||||
if (domainURL.scheme() == URL_SCHEME_VIRCADIA) {
|
||||
// re-set the sock addr to null and fire off a lookup of the IP address for this domain-server's hostname
|
||||
qCDebug(networking, "Looking up DS hostname %s.", domainURL.host().toLocal8Bit().constData());
|
||||
QHostInfo::lookupHost(domainURL.host(), this, SLOT(completedHostnameLookup(const QHostInfo&)));
|
||||
|
@ -303,7 +303,7 @@ void DomainHandler::setIceServerHostnameAndID(const QString& iceServerHostname,
|
|||
void DomainHandler::activateICELocalSocket() {
|
||||
DependencyManager::get<NodeList>()->flagTimeForConnectionStep(LimitedNodeList::ConnectionStep::SetDomainSocket);
|
||||
_sockAddr = _icePeer.getLocalSocket();
|
||||
_domainURL.setScheme(URL_SCHEME_HIFI);
|
||||
_domainURL.setScheme(URL_SCHEME_VIRCADIA);
|
||||
_domainURL.setHost(_sockAddr.getAddress().toString());
|
||||
emit domainURLChanged(_domainURL);
|
||||
emit completedSocketDiscovery();
|
||||
|
@ -312,7 +312,7 @@ void DomainHandler::activateICELocalSocket() {
|
|||
void DomainHandler::activateICEPublicSocket() {
|
||||
DependencyManager::get<NodeList>()->flagTimeForConnectionStep(LimitedNodeList::ConnectionStep::SetDomainSocket);
|
||||
_sockAddr = _icePeer.getPublicSocket();
|
||||
_domainURL.setScheme(URL_SCHEME_HIFI);
|
||||
_domainURL.setScheme(URL_SCHEME_VIRCADIA);
|
||||
_domainURL.setHost(_sockAddr.getAddress().toString());
|
||||
emit domainURLChanged(_domainURL);
|
||||
emit completedSocketDiscovery();
|
||||
|
@ -369,7 +369,7 @@ void DomainHandler::setIsConnected(bool isConnected) {
|
|||
// FIXME: Reinstate the requestDomainSettings() call here in version 2021.2.0 instead of having it in
|
||||
// NodeList::processDomainServerList().
|
||||
/*
|
||||
if (_domainURL.scheme() == URL_SCHEME_HIFI && !_domainURL.host().isEmpty()) {
|
||||
if (_domainURL.scheme() == URL_SCHEME_VIRCADIA && !_domainURL.host().isEmpty()) {
|
||||
// we've connected to new domain - time to ask it for global settings
|
||||
requestDomainSettings();
|
||||
}
|
||||
|
|
|
@ -137,7 +137,7 @@ public:
|
|||
void setCanConnectWithoutAvatarEntities(bool canConnect);
|
||||
bool canConnectWithoutAvatarEntities();
|
||||
|
||||
bool isServerless() const { return _domainURL.scheme() != URL_SCHEME_HIFI; }
|
||||
bool isServerless() const { return _domainURL.scheme() != URL_SCHEME_VIRCADIA; }
|
||||
bool getInterstitialModeEnabled() const;
|
||||
void setInterstitialModeEnabled(bool enableInterstitialMode);
|
||||
|
||||
|
|
|
@ -83,8 +83,8 @@ namespace NetworkingConstants {
|
|||
}
|
||||
|
||||
const QString HIFI_URL_SCHEME_ABOUT = "about";
|
||||
const QString URL_SCHEME_HIFI = "hifi";
|
||||
const QString URL_SCHEME_HIFIAPP = "hifiapp";
|
||||
const QString URL_SCHEME_VIRCADIA = "hifi";
|
||||
const QString URL_SCHEME_VIRCADIAAPP = "hifiapp";
|
||||
const QString URL_SCHEME_DATA = "data";
|
||||
const QString URL_SCHEME_QRC = "qrc";
|
||||
const QString HIFI_URL_SCHEME_FILE = "file";
|
||||
|
|
|
@ -824,7 +824,7 @@ void NodeList::processDomainServerList(QSharedPointer<ReceivedMessage> message)
|
|||
// FIXME: Remove this call to requestDomainSettings() and reinstate the one in DomainHandler::setIsConnected(), in version
|
||||
// 2021.2.0. (New protocol version implies a domain server upgrade.)
|
||||
if (!_domainHandler.isConnected()
|
||||
&& _domainHandler.getScheme() == URL_SCHEME_HIFI && !_domainHandler.getHostname().isEmpty()) {
|
||||
&& _domainHandler.getScheme() == URL_SCHEME_VIRCADIA && !_domainHandler.getHostname().isEmpty()) {
|
||||
// We're about to connect but we need the domain settings (in particular, the node permissions) in order to adjust the
|
||||
// canRezAvatarEntities permission above before using the permissions in determining whether or not to connect without
|
||||
// avatar entities rezzing below.
|
||||
|
|
|
@ -2405,7 +2405,7 @@ void ScriptEngine::entityScriptContentAvailable(const EntityItemID& entityID, co
|
|||
QString currentDomain = DependencyManager::get<AddressManager>()->getDomainURL().host();
|
||||
|
||||
QString domainSafeIP = nodeList->getDomainHandler().getHostname();
|
||||
QString domainSafeURL = URL_SCHEME_HIFI + "://" + currentDomain;
|
||||
QString domainSafeURL = URL_SCHEME_VIRCADIA + "://" + currentDomain;
|
||||
for (const auto& str : safeURLPrefixes) {
|
||||
if (domainSafeURL.startsWith(str) || domainSafeIP.startsWith(str)) {
|
||||
qCDebug(scriptengine) << whitelistPrefix << "Whitelist Bypassed, entire domain is whitelisted. Current Domain Host: "
|
||||
|
|
Loading…
Reference in a new issue