From dfbdcaaf136e2e7c3bdb9b0b9185797b406b3bf5 Mon Sep 17 00:00:00 2001 From: Armin Weatherwax Date: Thu, 20 Jan 2011 14:24:11 +0100 Subject: re-enable statistics packet for SL, firstuse warn about it (cherry picked from commit 282cb19508dcd38039454dfe71d23bb042fe376c) --- linden/indra/newview/app_settings/settings.xml | 11 +++++ linden/indra/newview/llappviewer.cpp | 27 ++++++----- linden/indra/newview/llfirstuse.cpp | 28 ++++++++++++ linden/indra/newview/llfirstuse.h | 3 +- linden/indra/newview/llstartup.cpp | 52 ++++++++++++++++++---- linden/indra/newview/llstartup.h | 4 +- .../skins/default/xui/en-us/notifications.xml | 18 ++++++++ 7 files changed, 122 insertions(+), 21 deletions(-) diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml index a857b7a..890d018 100644 --- a/linden/indra/newview/app_settings/settings.xml +++ b/linden/indra/newview/app_settings/settings.xml @@ -954,6 +954,17 @@ Value 1 + WarnFirstPrivacy + + Comment + Enables FirstPrivacy warning on login + Persist + 1 + Type + Boolean + Value + 1 + WarnFirstVoiceLicense Comment diff --git a/linden/indra/newview/llappviewer.cpp b/linden/indra/newview/llappviewer.cpp index 2e97f80..f281734 100644 --- a/linden/indra/newview/llappviewer.cpp +++ b/linden/indra/newview/llappviewer.cpp @@ -1823,6 +1823,7 @@ bool LLAppViewer::initConfiguration() LLFirstUse::addConfigVariable("FirstVoice"); LLFirstUse::addConfigVariable("FirstMedia"); LLFirstUse::addConfigVariable("FirstLoginScreen"); + LLFirstUse::addConfigVariable("FirstPrivacy"); // [RLVa:KB] - Checked: RLVa-1.0.3a (2009-09-10) | Added: RLVa-1.0.3a //LLFirstUse::addConfigVariable(RLV_SETTING_FIRSTUSE_DETACH); @@ -3420,18 +3421,22 @@ void LLAppViewer::idle() // Initialize the viewer_stats_timer with an already elapsed time // of SEND_STATS_PERIOD so that the initial stats report will // be sent immediately. - static LLFrameStatsTimer viewer_stats_timer(SEND_STATS_PERIOD); - reset_statistics(); - - // Update session stats every large chunk of time - // *FIX: (???) SAMANTHA - /* or don't! part of a larger effort to waste less CPU cycles. -Patrick Sapinski (Sunday, November 29, 2009) - if (viewer_stats_timer.getElapsedTimeF32() >= SEND_STATS_PERIOD && !gDisconnected) + if(!gDisconnected && gHippoGridManager->getConnectedGrid()->isSecondLife()) { - llinfos << "Transmitting sessions stats" << llendl; - send_stats(); - viewer_stats_timer.reset(); - } */ + static LLFrameStatsTimer viewer_stats_timer(SEND_STATS_PERIOD); + reset_statistics(); + + // Update session stats every large chunk of time + // *FIX: (???) SAMANTHA + + /* or don't! part of a larger effort to waste less CPU cycles. -Patrick Sapinski (Sunday, November 29, 2009)*/ + if (viewer_stats_timer.getElapsedTimeF32() >= SEND_STATS_PERIOD ) + { + llinfos << "Transmitting sessions stats" << llendl; + send_stats(); + viewer_stats_timer.reset(); + } + } // Print the object debugging stats static LLFrameTimer object_debug_timer; diff --git a/linden/indra/newview/llfirstuse.cpp b/linden/indra/newview/llfirstuse.cpp index e82aa96..a15b912 100644 --- a/linden/indra/newview/llfirstuse.cpp +++ b/linden/indra/newview/llfirstuse.cpp @@ -405,3 +405,31 @@ void LLFirstUse::voiceLicenseAgreement() LLStartUp::setStartupState(STATE_LOGIN_AUTH_INIT); } } + +void LLFirstUse::callbackPrivacy(const LLSD& notification, const LLSD& response) +{ + + S32 option = LLNotification::getSelectedOption(notification, response); + if ( 0 == option ) + { + gSavedSettings.setWarning("FirstPrivacy", FALSE); + LLStartUp::setStartupState(STATE_PRIVACY_LECTURED); + } + if ( 1 == option ) + { + LLStartUp::resetLogin(); + } +} + +// static +void LLFirstUse::Privacy() +{ + if (gSavedSettings.getWarning("FirstPrivacy")) + { + LLNotifications::instance().add("FirstPrivacy", LLSD(), LLSD(), callbackPrivacy); + } + else + { + LLStartUp::setStartupState(STATE_PRIVACY_LECTURED); + } +} diff --git a/linden/indra/newview/llfirstuse.h b/linden/indra/newview/llfirstuse.h index b0bf05f..d59e2ca 100644 --- a/linden/indra/newview/llfirstuse.h +++ b/linden/indra/newview/llfirstuse.h @@ -116,7 +116,8 @@ public: static void callbackClientTags(const LLSD& notification, const LLSD& response); static void ClientTags(); static void voiceLicenseAgreement(); - + static void callbackPrivacy(const LLSD& notification, const LLSD& response); + static void Privacy(); protected: static std::set sConfigVariables; diff --git a/linden/indra/newview/llstartup.cpp b/linden/indra/newview/llstartup.cpp index 3c8f810..77a2694 100644 --- a/linden/indra/newview/llstartup.cpp +++ b/linden/indra/newview/llstartup.cpp @@ -852,7 +852,47 @@ bool idle_startup() if (STATE_LOGIN_CLEANUP == LLStartUp::getStartupState()) { + LL_DEBUGS("AppInitStartupState") << "STATE_LOGIN_CLEANUP" << LL_ENDL; + + gDisconnected = TRUE; + + std::string cmd_line_grid_choice = gSavedSettings.getString("CmdLineGridChoice"); + std::string cmd_line_login_uri = gSavedSettings.getLLSD("CmdLineLoginURI").asString(); + if(!cmd_line_grid_choice.empty() && cmd_line_login_uri.empty()) + { + gHippoGridManager->setCurrentGrid(cmd_line_grid_choice); + } + + gHippoGridManager->setCurrentGridAsConnected(); + gHippoLimits->setLimits(); + + if (gHippoGridManager->getConnectedGrid()->isSecondLife()) + { + LLStartUp::setStartupState( STATE_LECTURE_PRIVACY ); + LLFirstUse::Privacy(); + } + else + { + LLStartUp::setStartupState( STATE_PRIVACY_LECTURED ); + } + + return FALSE; + + } + + if (STATE_LECTURE_PRIVACY == LLStartUp::getStartupState()) + { + LL_DEBUGS("AppInitStartupState") << "STATE_LECTURE_PRIVACY" << LL_ENDL; + + //wait for the user to decide + ms_sleep(1); + return FALSE; + } + + if (STATE_PRIVACY_LECTURED == LLStartUp::getStartupState()) + { + LL_DEBUGS("AppInitStartupState") << "STATE_PRIVACY_LECTURED" << LL_ENDL; //reset the values that could have come in from a slurl if (!gLoginHandler.getWebLoginKey().isNull()) { @@ -894,15 +934,9 @@ bool idle_startup() gDebugInfo["LoginName"] = firstname + " " + lastname; } - std::string cmd_line_grid_choice = gSavedSettings.getString("CmdLineGridChoice"); - std::string cmd_line_login_uri = gSavedSettings.getLLSD("CmdLineLoginURI").asString(); - if(!cmd_line_grid_choice.empty() && cmd_line_login_uri.empty()) - { - gHippoGridManager->setCurrentGrid(cmd_line_grid_choice); - } - gHippoGridManager->setCurrentGridAsConnected(); - gHippoLimits->setLimits(); + + // create necessary directories // *FIX: these mkdir's should error check gDirUtilp->setLindenUserDir(gHippoGridManager->getCurrentGridNick(), firstname, lastname); @@ -3686,6 +3720,8 @@ std::string LLStartUp::startupStateToString(EStartupState state) RTNENUM( STATE_LOGIN_SHOW ); RTNENUM( STATE_LOGIN_WAIT ); RTNENUM( STATE_LOGIN_CLEANUP ); + RTNENUM( STATE_LECTURE_PRIVACY ); + RTNENUM( STATE_PRIVACY_LECTURED ); RTNENUM( STATE_LOGIN_VOICE_LICENSE ); RTNENUM( STATE_UPDATE_CHECK ); RTNENUM( STATE_LOGIN_AUTH_INIT ); diff --git a/linden/indra/newview/llstartup.h b/linden/indra/newview/llstartup.h index 9a3c91c..e033582 100644 --- a/linden/indra/newview/llstartup.h +++ b/linden/indra/newview/llstartup.h @@ -49,7 +49,9 @@ typedef enum { STATE_BROWSER_INIT, // Initialize web browser for login screen STATE_LOGIN_SHOW, // Show login screen STATE_LOGIN_WAIT, // Wait for user input at login screen - STATE_LOGIN_CLEANUP, // Get rid of login screen and start login + STATE_LOGIN_CLEANUP, // lecture about privacy + STATE_LECTURE_PRIVACY, // wait until the lecture was read + STATE_PRIVACY_LECTURED, // Get rid of login screen and start login STATE_LOGIN_VOICE_LICENSE, // Show license agreement for using voice STATE_UPDATE_CHECK, // Wait for user at a dialog box (updates, term-of-service, etc) STATE_LOGIN_AUTH_INIT, // Start login to SL servers diff --git a/linden/indra/newview/skins/default/xui/en-us/notifications.xml b/linden/indra/newview/skins/default/xui/en-us/notifications.xml index 0301c3d..04f9f4b 100644 --- a/linden/indra/newview/skins/default/xui/en-us/notifications.xml +++ b/linden/indra/newview/skins/default/xui/en-us/notifications.xml @@ -7059,6 +7059,24 @@ Apply this region's settings? ("Ignore" will ignore all region setting The new font will appear after you restart [VIEWER_NAME]. + +Terms of service of the grid you are connecting to require sending a "statistics packet" every 5 minutes. +That is for example: Data about your hardware (CPU, RAM), number of avatars around, number of sims visited. +Please check *the grids* privacy policy about usage of that data. +
+