From e371aa8ba5223f81f8d1bacbd39371ed25e54d5a Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Thu, 21 Jan 2016 17:37:00 -0800 Subject: [PATCH 1/4] remove the hard coded path from domain link --- server-console/src/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server-console/src/main.js b/server-console/src/main.js index 4524c69644..2e6b0e1e9b 100644 --- a/server-console/src/main.js +++ b/server-console/src/main.js @@ -336,7 +336,7 @@ LogWindow.prototype = { function goHomeClicked() { if (interfacePath) { - startInterface('hifi://localhost/7.91966,23.2104,20.7416/0,-0.476144,0,0.879367'); + startInterface('hifi://localhost'); } else { // show an error to say that we can't go home without an interface instance dialog.showErrorBox("Client Not Found", binaryMissingMessage("High Fidelity client", "Interface", false)); From 15c922f4a57b026f464373126fa1bc1dd72a45ea Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Thu, 21 Jan 2016 17:59:33 -0800 Subject: [PATCH 2/4] always respond with default index path --- .../resources/describe-settings.json | 2 +- domain-server/src/DomainServer.cpp | 21 ++++++++++++++----- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/domain-server/resources/describe-settings.json b/domain-server/resources/describe-settings.json index 3116b072d8..e38aa2a75a 100644 --- a/domain-server/resources/describe-settings.json +++ b/domain-server/resources/describe-settings.json @@ -65,7 +65,7 @@ { "name": "viewpoint", "label": "Viewpoint", - "placeholder": "/512,512,512" + "placeholder": "/0,0,0" } ] } diff --git a/domain-server/src/DomainServer.cpp b/domain-server/src/DomainServer.cpp index 6d49b39d10..31ecd8a257 100644 --- a/domain-server/src/DomainServer.cpp +++ b/domain-server/src/DomainServer.cpp @@ -1872,16 +1872,27 @@ void DomainServer::processPathQueryPacket(QSharedPointer messag const QString PATHS_SETTINGS_KEYPATH_FORMAT = "%1.%2"; const QString PATH_VIEWPOINT_KEY = "viewpoint"; + const QString INDEX_PATH = "/"; // check out paths in the _configMap to see if we have a match - const QVariant* pathMatch = valueForKeyPath(_settingsManager.getSettingsMap(), - QString(PATHS_SETTINGS_KEYPATH_FORMAT).arg(SETTINGS_PATHS_KEY) - .arg(pathQuery)); - if (pathMatch) { + auto keypath = QString(PATHS_SETTINGS_KEYPATH_FORMAT).arg(SETTINGS_PATHS_KEY).arg(pathQuery); + const QVariant* pathMatch = valueForKeyPath(_settingsManager.getSettingsMap(), keypath); + + // if we didn't match the path BUT this is for the index path then send back our default + + + if (pathMatch || pathQuery == INDEX_PATH) { // we got a match, respond with the resulting viewpoint auto nodeList = DependencyManager::get(); - QString responseViewpoint = pathMatch->toMap()[PATH_VIEWPOINT_KEY].toString(); + QString responseViewpoint; + + if (pathMatch) { + responseViewpoint = pathMatch->toMap()[PATH_VIEWPOINT_KEY].toString(); + } else { + const QString DEFAULT_INDEX_PATH = "/0,0,0/0,0,0,1"; + responseViewpoint = DEFAULT_INDEX_PATH; + } if (!responseViewpoint.isEmpty()) { QByteArray viewpointUTF8 = responseViewpoint.toUtf8(); From fac30bb0aee4e2b5abcec1e4e59ea76917e07266 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Thu, 21 Jan 2016 18:01:24 -0800 Subject: [PATCH 3/4] use the index path as default with network address --- libraries/networking/src/AddressManager.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libraries/networking/src/AddressManager.cpp b/libraries/networking/src/AddressManager.cpp index f99e498ebf..03b33eae38 100644 --- a/libraries/networking/src/AddressManager.cpp +++ b/libraries/networking/src/AddressManager.cpp @@ -149,8 +149,15 @@ bool AddressManager::handleUrl(const QUrl& lookupUrl, LookupTrigger trigger) { // check if it is a network address first if (handleNetworkAddress(lookupUrl.host() + (lookupUrl.port() == -1 ? "" : ":" + QString::number(lookupUrl.port())), trigger)) { + + // if we were not passed a path, use the index path + auto path = lookupUrl.path(); + if (path.isEmpty()) { + path = INDEX_PATH; + } + // we may have a path that defines a relative viewpoint - if so we should jump to that now - handlePath(lookupUrl.path(), trigger); + handlePath(path, trigger); } else if (handleDomainID(lookupUrl.host())){ // no place name - this is probably a domain ID // try to look up the domain ID on the metaverse API From 9061e33a1f8746d06732bcf3cca26bfe94350254 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Thu, 21 Jan 2016 18:22:51 -0800 Subject: [PATCH 4/4] send path query once connected to domain --- domain-server/src/DomainServer.cpp | 4 +--- libraries/networking/src/NodeList.cpp | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/domain-server/src/DomainServer.cpp b/domain-server/src/DomainServer.cpp index 31ecd8a257..f0ffd8ff73 100644 --- a/domain-server/src/DomainServer.cpp +++ b/domain-server/src/DomainServer.cpp @@ -1878,15 +1878,13 @@ void DomainServer::processPathQueryPacket(QSharedPointer messag auto keypath = QString(PATHS_SETTINGS_KEYPATH_FORMAT).arg(SETTINGS_PATHS_KEY).arg(pathQuery); const QVariant* pathMatch = valueForKeyPath(_settingsManager.getSettingsMap(), keypath); - // if we didn't match the path BUT this is for the index path then send back our default - - if (pathMatch || pathQuery == INDEX_PATH) { // we got a match, respond with the resulting viewpoint auto nodeList = DependencyManager::get(); QString responseViewpoint; + // if we didn't match the path BUT this is for the index path then send back our default if (pathMatch) { responseViewpoint = pathMatch->toMap()[PATH_VIEWPOINT_KEY].toString(); } else { diff --git a/libraries/networking/src/NodeList.cpp b/libraries/networking/src/NodeList.cpp index 7870e61723..b0cd8cce39 100644 --- a/libraries/networking/src/NodeList.cpp +++ b/libraries/networking/src/NodeList.cpp @@ -60,7 +60,7 @@ NodeList::NodeList(char newOwnerType, unsigned short socketListenPort, unsigned // in case we don't know how to talk to DS when a path change is requested // fire off any pending DS path query when we get socket information - connect(&_domainHandler, &DomainHandler::completedSocketDiscovery, this, &NodeList::sendPendingDSPathQuery); + connect(&_domainHandler, &DomainHandler::connectedToDomain, this, &NodeList::sendPendingDSPathQuery); // send a domain server check in immediately once the DS socket is known connect(&_domainHandler, &DomainHandler::completedSocketDiscovery, this, &NodeList::sendDomainServerCheckIn);