History

Merge pull request #10606 from huffman/feat/startup-went-to-event

Add startup_sent_to user activity event

Ryan Huffman committed 9 years ago

Commit c0bca732 parents 34201ea 0fdbf4a1 file · +32 −4Browse files

Showing the changes to interface/src/Application.cpp (1 of 1 file). Show all

Unified · Split

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