Showing the changes to interface/src/Application.cpp (1 of 21 files). Show all
Unified · Split
| @@ -2413,15 +2413,16 @@ void Application::handleSandboxStatus(QNetworkReply* reply) { · 2412 unmodified lines | |||
| 2413 | 2413 | ||
| 2414 | // Check HMD use (may be technically available without being in use) | 2414 | // Check HMD use (may be technically available without being in use) |
| 2415 | bool hasHMD = PluginUtils::isHMDAvailable(); | 2415 | bool hasHMD = PluginUtils::isHMDAvailable(); |
| 2416 | bool isUsingHMD = hasHMD && hasHandControllers && _displayPlugin->isHmd(); | 2416 | bool isUsingHMD = _displayPlugin->isHmd(); |
| 2417 | bool isUsingHMDAndHandControllers = hasHMD && hasHandControllers && isUsingHMD; | ||
| 2417 | 2418 | ||
| 2418 | Setting::Handle<bool> tutorialComplete{ "tutorialComplete", false }; | 2419 | Setting::Handle<bool> tutorialComplete{ "tutorialComplete", false }; |
| 2419 | Setting::Handle<bool> firstRun{ Settings::firstRun, true }; | 2420 | Setting::Handle<bool> firstRun{ Settings::firstRun, true }; |
| 2420 | 2421 | ||
| 2421 | bool isTutorialComplete = tutorialComplete.get(); | 2422 | bool isTutorialComplete = tutorialComplete.get(); |
| 2422 | bool shouldGoToTutorial = isUsingHMD && hasTutorialContent && !isTutorialComplete; | 2423 | bool shouldGoToTutorial = isUsingHMDAndHandControllers && hasTutorialContent && !isTutorialComplete; |
| 2423 | 2424 | ||
| 2424 | qCDebug(interfaceapp) << "HMD:" << hasHMD << ", Hand Controllers: " << hasHandControllers << ", Using HMD: " << isUsingHMD; | 2425 | qCDebug(interfaceapp) << "HMD:" << hasHMD << ", Hand Controllers: " << hasHandControllers << ", Using HMD: " << isUsingHMDAndHandControllers; |
| 2425 | qCDebug(interfaceapp) << "Tutorial version:" << contentVersion << ", sufficient:" << hasTutorialContent << | 2426 | qCDebug(interfaceapp) << "Tutorial version:" << contentVersion << ", sufficient:" << hasTutorialContent << |
| 2426 | ", complete:" << isTutorialComplete << ", should go:" << shouldGoToTutorial; | 2427 | ", complete:" << isTutorialComplete << ", should go:" << shouldGoToTutorial; |
| 2427 | 2428 | ||
| @@ -2435,10 +2436,18 @@ void Application::handleSandboxStatus(QNetworkReply* reply) { · 7 unmodified lines | |||
| 2435 | 2436 | ||
| 2436 | const QString TUTORIAL_PATH = "/tutorial_begin"; | 2437 | const QString TUTORIAL_PATH = "/tutorial_begin"; |
| 2437 | 2438 | ||
| 2439 | static const QString SENT_TO_TUTORIAL = "tutorial"; | ||
| 2440 | static const QString SENT_TO_PREVIOUS_LOCATION = "previous_location"; | ||
| 2441 | static const QString SENT_TO_ENTRY = "entry"; | ||
| 2442 | static const QString SENT_TO_SANDBOX = "sandbox"; | ||
| 2443 | |||
| 2444 | QString sentTo; | ||
| 2445 | |||
| 2438 | if (shouldGoToTutorial) { | 2446 | if (shouldGoToTutorial) { |
| 2439 | if (sandboxIsRunning) { | 2447 | if (sandboxIsRunning) { |
| 2440 | qCDebug(interfaceapp) << "Home sandbox appears to be running, going to Home."; | 2448 | qCDebug(interfaceapp) << "Home sandbox appears to be running, going to Home."; |
| 2441 | DependencyManager::get<AddressManager>()->goToLocalSandbox(TUTORIAL_PATH); | 2449 | DependencyManager::get<AddressManager>()->goToLocalSandbox(TUTORIAL_PATH); |
| 2450 | sentTo = SENT_TO_TUTORIAL; | ||
| 2442 | } else { | 2451 | } else { |
| 2443 | qCDebug(interfaceapp) << "Home sandbox does not appear to be running, going to Entry."; | 2452 | qCDebug(interfaceapp) << "Home sandbox does not appear to be running, going to Entry."; |
| 2444 | if (firstRun.get()) { | 2453 | if (firstRun.get()) { |
| @@ -2446,8 +2455,10 @@ void Application::handleSandboxStatus(QNetworkReply* reply) { · 1 unmodified line | |||
| 2446 | } | 2455 | } |
| 2447 | if (addressLookupString.isEmpty()) { | 2456 | if (addressLookupString.isEmpty()) { |
| 2448 | DependencyManager::get<AddressManager>()->goToEntry(); | 2457 | DependencyManager::get<AddressManager>()->goToEntry(); |
| 2458 | sentTo = SENT_TO_ENTRY; | ||
| 2449 | } else { | 2459 | } else { |
| 2450 | DependencyManager::get<AddressManager>()->loadSettings(addressLookupString); | 2460 | DependencyManager::get<AddressManager>()->loadSettings(addressLookupString); |
| 2461 | sentTo = SENT_TO_PREVIOUS_LOCATION; | ||
| 2451 | } | 2462 | } |
| 2452 | } | 2463 | } |
| 2453 | } else { | 2464 | } else { |
| @@ -2460,23 +2471,40 @@ void Application::handleSandboxStatus(QNetworkReply* reply) { · 6 unmodified lines | |||
| 2460 | 2471 | ||
| 2461 | // If this is a first run we short-circuit the address passed in | 2472 | // If this is a first run we short-circuit the address passed in |
| 2462 | if (isFirstRun) { | 2473 | if (isFirstRun) { |
| 2463 | if (isUsingHMD) { | 2474 | if (isUsingHMDAndHandControllers) { |
| 2464 | if (sandboxIsRunning) { | 2475 | if (sandboxIsRunning) { |
| 2465 | qCDebug(interfaceapp) << "Home sandbox appears to be running, going to Home."; | 2476 | qCDebug(interfaceapp) << "Home sandbox appears to be running, going to Home."; |
| 2466 | DependencyManager::get<AddressManager>()->goToLocalSandbox(); | 2477 | DependencyManager::get<AddressManager>()->goToLocalSandbox(); |
| 2478 | sentTo = SENT_TO_SANDBOX; | ||
| 2467 | } else { | 2479 | } else { |
| 2468 | qCDebug(interfaceapp) << "Home sandbox does not appear to be running, going to Entry."; | 2480 | qCDebug(interfaceapp) << "Home sandbox does not appear to be running, going to Entry."; |
| 2469 | DependencyManager::get<AddressManager>()->goToEntry(); | 2481 | DependencyManager::get<AddressManager>()->goToEntry(); |
| 2482 | sentTo = SENT_TO_ENTRY; | ||
| 2470 | } | 2483 | } |
| 2471 | } else { | 2484 | } else { |
| 2472 | DependencyManager::get<AddressManager>()->goToEntry(); | 2485 | DependencyManager::get<AddressManager>()->goToEntry(); |
| 2486 | sentTo = SENT_TO_ENTRY; | ||
| 2473 | } | 2487 | } |
| 2474 | } else { | 2488 | } else { |
| 2475 | qCDebug(interfaceapp) << "Not first run... going to" << qPrintable(addressLookupString.isEmpty() ? QString("previous location") : addressLookupString); | 2489 | qCDebug(interfaceapp) << "Not first run... going to" << qPrintable(addressLookupString.isEmpty() ? QString("previous location") : addressLookupString); |
| 2476 | DependencyManager::get<AddressManager>()->loadSettings(addressLookupString); | 2490 | DependencyManager::get<AddressManager>()->loadSettings(addressLookupString); |
| 2491 | sentTo = SENT_TO_PREVIOUS_LOCATION; | ||
| 2477 | } | 2492 | } |
| 2478 | } | 2493 | } |
| 2479 | 2494 | ||
| 2495 | UserActivityLogger::getInstance().logAction("startup_sent_to", { | ||
| 2496 | { "sent_to", sentTo }, | ||
| 2497 | { "sandbox_is_running", sandboxIsRunning }, | ||
| 2498 | { "has_hmd", hasHMD }, | ||
| 2499 | { "has_hand_controllers", hasHandControllers }, | ||
| 2500 | { "is_using_hmd", isUsingHMD }, | ||
| 2501 | { "is_using_hmd_and_hand_controllers", isUsingHMDAndHandControllers }, | ||
| 2502 | { "content_version", contentVersion }, | ||
| 2503 | { "is_tutorial_complete", isTutorialComplete }, | ||
| 2504 | { "has_tutorial_content", hasTutorialContent }, | ||
| 2505 | { "should_go_to_tutorial", shouldGoToTutorial } | ||
| 2506 | }); | ||
| 2507 | |||
| 2480 | _connectionMonitor.init(); | 2508 | _connectionMonitor.init(); |
| 2481 | 2509 | ||
| 2482 | // After all of the constructor is completed, then set firstRun to false. | 2510 | // After all of the constructor is completed, then set firstRun to false. |