mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 18:13:05 +02:00
code review
This commit is contained in:
parent
9b97e408f5
commit
a56f3f4a10
4 changed files with 24 additions and 10 deletions
|
@ -3147,7 +3147,8 @@ void Application::loadServerlessDomain(QUrl domainURL) {
|
||||||
}
|
}
|
||||||
|
|
||||||
std::map<QString, QString> namedPaths = tmpTree->getNamedPaths();
|
std::map<QString, QString> namedPaths = tmpTree->getNamedPaths();
|
||||||
nodeList->getDomainHandler().setIsConnected(true, namedPaths);
|
nodeList->getDomainHandler().connectedToServerless(namedPaths);
|
||||||
|
|
||||||
|
|
||||||
_fullSceneReceivedCounter++;
|
_fullSceneReceivedCounter++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
#include "UserActivityLogger.h"
|
#include "UserActivityLogger.h"
|
||||||
#include "udt/PacketHeaders.h"
|
#include "udt/PacketHeaders.h"
|
||||||
|
|
||||||
const QString DEFAULT_HIFI_ADDRESS = "file:///~/serverless/tutorial.json?location=/";
|
const QString DEFAULT_HIFI_ADDRESS = "file:///~/serverless/tutorial.json";
|
||||||
const QString ADDRESS_MANAGER_SETTINGS_GROUP = "AddressManager";
|
const QString ADDRESS_MANAGER_SETTINGS_GROUP = "AddressManager";
|
||||||
const QString SETTINGS_CURRENT_ADDRESS_KEY = "address";
|
const QString SETTINGS_CURRENT_ADDRESS_KEY = "address";
|
||||||
|
|
||||||
|
@ -318,6 +318,8 @@ bool AddressManager::handleUrl(const QUrl& lookupUrl, LookupTrigger trigger) {
|
||||||
const QString LOCATION_QUERY_KEY = "location";
|
const QString LOCATION_QUERY_KEY = "location";
|
||||||
if (queryArgs.hasQueryItem(LOCATION_QUERY_KEY)) {
|
if (queryArgs.hasQueryItem(LOCATION_QUERY_KEY)) {
|
||||||
path = queryArgs.queryItemValue(LOCATION_QUERY_KEY);
|
path = queryArgs.queryItemValue(LOCATION_QUERY_KEY);
|
||||||
|
} else {
|
||||||
|
path = DEFAULT_NAMED_PATH;
|
||||||
}
|
}
|
||||||
|
|
||||||
handlePath(path, LookupTrigger::Internal, false);
|
handlePath(path, LookupTrigger::Internal, false);
|
||||||
|
|
|
@ -177,9 +177,11 @@ void DomainHandler::setURLAndID(QUrl domainURL, QUuid domainID) {
|
||||||
qCDebug(networking) << "Updated domain hostname to" << domainURL.host();
|
qCDebug(networking) << "Updated domain hostname to" << domainURL.host();
|
||||||
|
|
||||||
if (!domainURL.host().isEmpty()) {
|
if (!domainURL.host().isEmpty()) {
|
||||||
// re-set the sock addr to null and fire off a lookup of the IP address for this domain-server's hostname
|
if (domainURL.scheme() == URL_SCHEME_HIFI) {
|
||||||
qCDebug(networking, "Looking up DS hostname %s.", domainURL.host().toLocal8Bit().constData());
|
// re-set the sock addr to null and fire off a lookup of the IP address for this domain-server's hostname
|
||||||
QHostInfo::lookupHost(domainURL.host(), this, SLOT(completedHostnameLookup(const QHostInfo&)));
|
qCDebug(networking, "Looking up DS hostname %s.", domainURL.host().toLocal8Bit().constData());
|
||||||
|
QHostInfo::lookupHost(domainURL.host(), this, SLOT(completedHostnameLookup(const QHostInfo&)));
|
||||||
|
}
|
||||||
|
|
||||||
DependencyManager::get<NodeList>()->flagTimeForConnectionStep(
|
DependencyManager::get<NodeList>()->flagTimeForConnectionStep(
|
||||||
LimitedNodeList::ConnectionStep::SetDomainHostname);
|
LimitedNodeList::ConnectionStep::SetDomainHostname);
|
||||||
|
@ -253,7 +255,10 @@ QString DomainHandler::getViewPointFromNamedPath(QString namedPath) {
|
||||||
if (lookup != _namedPaths.end()) {
|
if (lookup != _namedPaths.end()) {
|
||||||
return lookup->second;
|
return lookup->second;
|
||||||
}
|
}
|
||||||
return DOMAIN_SPAWNING_POINT;
|
if (namedPath == DEFAULT_NAMED_PATH) {
|
||||||
|
return DOMAIN_SPAWNING_POINT;
|
||||||
|
}
|
||||||
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
void DomainHandler::completedHostnameLookup(const QHostInfo& hostInfo) {
|
void DomainHandler::completedHostnameLookup(const QHostInfo& hostInfo) {
|
||||||
|
@ -285,8 +290,7 @@ void DomainHandler::completedIceServerHostnameLookup() {
|
||||||
emit iceSocketAndIDReceived();
|
emit iceSocketAndIDReceived();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DomainHandler::setIsConnected(bool isConnected, std::map<QString, QString> namedPaths) {
|
void DomainHandler::setIsConnected(bool isConnected) {
|
||||||
_namedPaths = namedPaths;
|
|
||||||
if (_isConnected != isConnected) {
|
if (_isConnected != isConnected) {
|
||||||
_isConnected = isConnected;
|
_isConnected = isConnected;
|
||||||
|
|
||||||
|
@ -304,6 +308,11 @@ void DomainHandler::setIsConnected(bool isConnected, std::map<QString, QString>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DomainHandler::connectedToServerless(std::map<QString, QString> namedPaths) {
|
||||||
|
_namedPaths = namedPaths;
|
||||||
|
setIsConnected(true);
|
||||||
|
}
|
||||||
|
|
||||||
void DomainHandler::requestDomainSettings() {
|
void DomainHandler::requestDomainSettings() {
|
||||||
qCDebug(networking) << "Requesting settings from domain server";
|
qCDebug(networking) << "Requesting settings from domain server";
|
||||||
|
|
||||||
|
|
|
@ -73,9 +73,11 @@ public:
|
||||||
void activateICEPublicSocket();
|
void activateICEPublicSocket();
|
||||||
|
|
||||||
bool isConnected() const { return _isConnected; }
|
bool isConnected() const { return _isConnected; }
|
||||||
void setIsConnected(bool isConnected, std::map<QString, QString> namedPaths = std::map<QString, QString>());
|
void setIsConnected(bool isConnected);
|
||||||
bool isServerless() const { return _domainURL.scheme() != URL_SCHEME_HIFI; }
|
bool isServerless() const { return _domainURL.scheme() != URL_SCHEME_HIFI; }
|
||||||
|
|
||||||
|
void connectedToServerless(std::map<QString, QString> namedPaths);
|
||||||
|
|
||||||
QString getViewPointFromNamedPath(QString namedPath);
|
QString getViewPointFromNamedPath(QString namedPath);
|
||||||
|
|
||||||
bool hasSettings() const { return !_settingsObject.isEmpty(); }
|
bool hasSettings() const { return !_settingsObject.isEmpty(); }
|
||||||
|
@ -207,6 +209,6 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
const QString DOMAIN_SPAWNING_POINT { "/0, -10, 0" };
|
const QString DOMAIN_SPAWNING_POINT { "/0, -10, 0" };
|
||||||
|
const QString DEFAULT_NAMED_PATH { "/" };
|
||||||
|
|
||||||
#endif // hifi_DomainHandler_h
|
#endif // hifi_DomainHandler_h
|
||||||
|
|
Loading…
Reference in a new issue