Showing the changes to interface/src/Application.cpp (1 of 7 files). Show all
Unified · Split
| @@ -1185,6 +1185,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 1184 unmodified lines | |||
| 1185 | const DomainHandler& domainHandler = nodeList->getDomainHandler(); | 1185 | const DomainHandler& domainHandler = nodeList->getDomainHandler(); |
| 1186 | 1186 | ||
| 1187 | connect(&domainHandler, SIGNAL(domainURLChanged(QUrl)), SLOT(domainURLChanged(QUrl))); | 1187 | connect(&domainHandler, SIGNAL(domainURLChanged(QUrl)), SLOT(domainURLChanged(QUrl))); |
| 1188 | connect(&domainHandler, SIGNAL(redirectToErrorDomainURL(QUrl)), SLOT(goToErrorDomainURL(QUrl))); | ||
| 1188 | connect(&domainHandler, &DomainHandler::domainURLChanged, [](QUrl domainURL){ | 1189 | connect(&domainHandler, &DomainHandler::domainURLChanged, [](QUrl domainURL){ |
| 1189 | setCrashAnnotation("domain", domainURL.toString().toStdString()); | 1190 | setCrashAnnotation("domain", domainURL.toString().toStdString()); |
| 1190 | }); | 1191 | }); |
| @@ -2251,6 +2252,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 1060 unmodified lines | |||
| 2251 | 2252 | ||
| 2252 | connect(this, &QCoreApplication::aboutToQuit, this, &Application::addAssetToWorldMessageClose); | 2253 | connect(this, &QCoreApplication::aboutToQuit, this, &Application::addAssetToWorldMessageClose); |
| 2253 | connect(&domainHandler, &DomainHandler::domainURLChanged, this, &Application::addAssetToWorldMessageClose); | 2254 | connect(&domainHandler, &DomainHandler::domainURLChanged, this, &Application::addAssetToWorldMessageClose); |
| 2255 | connect(&domainHandler, &DomainHandler::redirectToErrorDomainURL, this, &Application::addAssetToWorldMessageClose); | ||
| 2254 | 2256 | ||
| 2255 | updateSystemTabletMode(); | 2257 | updateSystemTabletMode(); |
| 2256 | 2258 | ||
| @@ -2343,14 +2345,6 @@ void Application::domainConnectionRefused(const QString& reasonMessage, int reas · 86 unmodified lines | |||
| 2343 | } | 2345 | } |
| 2344 | } | 2346 | } |
| 2345 | 2347 | ||
| 2346 | void Application::domainConnectionRedirect() { | ||
| 2347 | auto addressManager = DependencyManager::get<AddressManager>(); | ||
| 2348 | |||
| 2349 | addressManager->handleLookupString(REDIRECT_HIFI_ADDRESS); | ||
| 2350 | getMyAvatar()->setWorldVelocity(glm::vec3(0.0f)); | ||
| 2351 | } | ||
| 2352 | |||
| 2353 | |||
| 2354 | QString Application::getUserAgent() { | 2348 | QString Application::getUserAgent() { |
| 2355 | if (QThread::currentThread() != thread()) { | 2349 | if (QThread::currentThread() != thread()) { |
| 2356 | QString userAgent; | 2350 | QString userAgent; |
| @@ -3481,7 +3475,7 @@ void Application::setIsServerlessMode(bool serverlessDomain) { · 1124 unmodified lines | |||
| 3481 | } | 3475 | } |
| 3482 | } | 3476 | } |
| 3483 | 3477 | ||
| 3484 | void Application::loadServerlessDomain(QUrl domainURL) { | 3478 | void Application::loadServerlessDomain(QUrl domainURL, bool errorDomain) { |
| 3485 | if (QThread::currentThread() != thread()) { | 3479 | if (QThread::currentThread() != thread()) { |
| 3486 | QMetaObject::invokeMethod(this, "loadServerlessDomain", Q_ARG(QUrl, domainURL)); | 3480 | QMetaObject::invokeMethod(this, "loadServerlessDomain", Q_ARG(QUrl, domainURL)); |
| 3487 | return; | 3481 | return; |
| @@ -3515,8 +3509,11 @@ void Application::loadServerlessDomain(QUrl domainURL) { · 27 unmodified lines | |||
| 3515 | } | 3509 | } |
| 3516 | 3510 | ||
| 3517 | std::map<QString, QString> namedPaths = tmpTree->getNamedPaths(); | 3511 | std::map<QString, QString> namedPaths = tmpTree->getNamedPaths(); |
| 3518 | nodeList->getDomainHandler().connectedToServerless(namedPaths); | 3512 | if (errorDomain) { |
| 3519 | 3513 | nodeList->getDomainHandler().loadedErrorDomain(namedPaths); | |
| 3514 | } else { | ||
| 3515 | nodeList->getDomainHandler().connectedToServerless(namedPaths); | ||
| 3516 | } | ||
| 3520 | 3517 | ||
| 3521 | _fullSceneReceivedCounter++; | 3518 | _fullSceneReceivedCounter++; |
| 3522 | } | 3519 | } |
| @@ -6381,6 +6378,7 @@ void Application::clearDomainAvatars() { · 2858 unmodified lines | |||
| 6381 | void Application::domainURLChanged(QUrl domainURL) { | 6378 | void Application::domainURLChanged(QUrl domainURL) { |
| 6382 | // disable physics until we have enough information about our new location to not cause craziness. | 6379 | // disable physics until we have enough information about our new location to not cause craziness. |
| 6383 | resetPhysicsReadyInformation(); | 6380 | resetPhysicsReadyInformation(); |
| 6381 | auto urlStr = domainURL.toString().toStdString(); | ||
| 6384 | setIsServerlessMode(domainURL.scheme() != URL_SCHEME_HIFI); | 6382 | setIsServerlessMode(domainURL.scheme() != URL_SCHEME_HIFI); |
| 6385 | if (isServerlessMode()) { | 6383 | if (isServerlessMode()) { |
| 6386 | loadServerlessDomain(domainURL); | 6384 | loadServerlessDomain(domainURL); |
| @@ -6388,6 +6386,17 @@ void Application::domainURLChanged(QUrl domainURL) { · 1 unmodified line | |||
| 6388 | updateWindowTitle(); | 6386 | updateWindowTitle(); |
| 6389 | } | 6387 | } |
| 6390 | 6388 | ||
| 6389 | void Application::goToErrorDomainURL(QUrl errorDomainURL) { | ||
| 6390 | // disable physics until we have enough information about our new location to not cause craziness. | ||
| 6391 | resetPhysicsReadyInformation(); | ||
| 6392 | auto urlStr = errorDomainURL.toString().toStdString(); | ||
| 6393 | setIsServerlessMode(errorDomainURL.scheme() != URL_SCHEME_HIFI); | ||
| 6394 | if (isServerlessMode()) { | ||
| 6395 | loadServerlessDomain(errorDomainURL, true); | ||
| 6396 | } | ||
| 6397 | updateWindowTitle(); | ||
| 6398 | } | ||
| 6399 | |||
| 6391 | 6400 | ||
| 6392 | void Application::resettingDomain() { | 6401 | void Application::resettingDomain() { |
| 6393 | _notifiedPacketVersionMismatchThisDomain = false; | 6402 | _notifiedPacketVersionMismatchThisDomain = false; |