From c8c143e7741d2b93b589d770b64c265228293564 Mon Sep 17 00:00:00 2001 From: Glenn Glazer Date: Thu, 18 Aug 2016 13:05:30 -0700 Subject: SL-323: first pass at ripping out old updater --- indra/newview/lllogininstance.h | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'indra/newview/lllogininstance.h') diff --git a/indra/newview/lllogininstance.h b/indra/newview/lllogininstance.h index c6773bbf68..dfd39e4752 100644 --- a/indra/newview/lllogininstance.h +++ b/indra/newview/lllogininstance.h @@ -34,7 +34,6 @@ class LLLogin; class LLEventStream; class LLNotificationsInterface; -class LLUpdaterService; // This class hosts the login module and is used to // negotiate user authentication attempts. @@ -60,10 +59,6 @@ public: // Only valid when authSuccess == true. const F64 getLastTransferRateBPS() { return mTransferRate; } - - // Whether to tell login to skip optional update request. - // False by default. - void setSkipOptionalUpdate(bool state) { mSkipOptionalUpdate = state; } void setSerialNumber(const std::string& sn) { mSerialNumber = sn; } void setLastExecEvent(int lee) { mLastExecEvent = lee; } void setLastExecDuration(S32 duration) { mLastExecDuration = duration; } @@ -72,10 +67,6 @@ public: void setNotificationsInterface(LLNotificationsInterface* ni) { mNotifications = ni; } LLNotificationsInterface& getNotificationsInterface() const { return *mNotifications; } - typedef boost::function UpdaterLauncherCallback; - void setUpdaterLauncher(const UpdaterLauncherCallback& ulc) { mUpdaterLauncher = ulc; } - - void setUpdaterService(LLUpdaterService * updaterService) { mUpdaterService = updaterService; } private: void constructAuthParams(LLPointer user_credentials); void updateApp(bool mandatory, const std::string& message); @@ -97,7 +88,6 @@ private: std::string mLoginState; LLSD mRequestData; LLSD mResponseData; - bool mSkipOptionalUpdate; bool mAttemptComplete; F64 mTransferRate; std::string mSerialNumber; @@ -105,10 +95,7 @@ private: S32 mLastExecDuration; std::string mPlatform; std::string mPlatformVersion; - UpdaterLauncherCallback mUpdaterLauncher; LLEventDispatcher mDispatcher; - LLUpdaterService * mUpdaterService; - boost::scoped_ptr mUpdateStateMachine; }; #endif -- cgit v1.3 From 612ff7b6b3f3abb56ff6bf8331e2a1cd04c04066 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Mon, 14 Aug 2017 07:15:18 -0400 Subject: MAINT-7640: Notify the user if login is blocked for a required viewer update --- indra/newview/lllogininstance.cpp | 41 ++- indra/newview/lllogininstance.h | 1 + .../newview/skins/default/xui/en/notifications.xml | 333 +-------------------- indra/newview/tests/lllogininstance_test.cpp | 14 + 4 files changed, 56 insertions(+), 333 deletions(-) (limited to 'indra/newview/lllogininstance.h') diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp index 229703bb39..b953534e13 100644 --- a/indra/newview/lllogininstance.cpp +++ b/indra/newview/lllogininstance.cpp @@ -31,6 +31,7 @@ // llcommon #include "llevents.h" #include "stringize.h" +#include "llsdserialize.h" // llmessage (!) #include "llfiltersd2xmlrpc.h" // for xml_escape_string() @@ -47,12 +48,10 @@ #include "llstartup.h" #include "llfloaterreg.h" #include "llnotifications.h" +#include "llnotificationsutil.h" #include "llwindow.h" #include "llviewerwindow.h" #include "llprogressview.h" -#if LL_LINUX -#include "lltrans.h" -#endif #include "llsecapi.h" #include "llstartup.h" #include "llmachineid.h" @@ -250,8 +249,6 @@ bool LLLoginInstance::handleLoginEvent(const LLSD& event) void LLLoginInstance::handleLoginFailure(const LLSD& event) { - - // Login has failed. // Figure out why and respond... LLSD response = event["data"]; @@ -302,13 +299,42 @@ void LLLoginInstance::handleLoginFailure(const LLSD& event) boost::bind(&LLLoginInstance::handleTOSResponse, this, _1, "read_critical")); } + else if(reason_response == "update") + { + // This shouldn't happen - the viewer manager should have forced an update; + // possibly the user ran the viewer directly and bypassed the update check + std::string required_version = response["message_args"]["VERSION"]; + LL_WARNS() << "Login failed because an update to version " << required_version << " is required." << LL_ENDL; + + if (gViewerWindow) + gViewerWindow->setShowProgress(FALSE); + + LLSD data(LLSD::emptyMap()); + data["VERSION"] = required_version; + LLNotificationsUtil::add("RequiredUpdate", data, LLSD::emptyMap(), boost::bind(&LLLoginInstance::handleLoginDisallowed, this, _1, _2)); + } + else if(reason_response == "key") + { + // this is a password problem or other restriction + // an appropriate message has already been displayed + attemptComplete(); + } else { - LL_INFOS() << "LLLoginInstance::handleLoginFailure attemptComplete" << LL_ENDL; - attemptComplete(); + LL_WARNS() << "Login failed for an unknown reason: " << LLSDOStreamer(response) << LL_ENDL; + + if (gViewerWindow) + gViewerWindow->setShowProgress(FALSE); + + LLNotificationsUtil::add("LoginFailedUnknown", LLSD::emptyMap(), LLSD::emptyMap(), boost::bind(&LLLoginInstance::handleLoginDisallowed, this, _1, _2)); } } +void LLLoginInstance::handleLoginDisallowed(const LLSD& notification, const LLSD& response) +{ + attemptComplete(); +} + void LLLoginInstance::handleLoginSuccess(const LLSD& event) { LL_INFOS() << "LLLoginInstance::handleLoginSuccess" << LL_ENDL; @@ -363,6 +389,7 @@ bool LLLoginInstance::handleTOSResponse(bool accepted, const std::string& key) return true; } + std::string construct_start_string() { std::string start; diff --git a/indra/newview/lllogininstance.h b/indra/newview/lllogininstance.h index 67d0f01ba6..f53c02c6e1 100644 --- a/indra/newview/lllogininstance.h +++ b/indra/newview/lllogininstance.h @@ -77,6 +77,7 @@ private: void handleLoginSuccess(const LLSD& event); void handleDisconnect(const LLSD& event); void handleIndeterminate(const LLSD& event); + void handleLoginDisallowed(const LLSD& notification, const LLSD& response); bool handleTOSResponse(bool v, const std::string& key); diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 1a7c9229a3..c1e82d7be3 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -3825,151 +3825,12 @@ Please set the object for sale and try again. -Finished download of raw terrain file to: -[DOWNLOAD_PATH]. - - - -A new version of [APP_NAME] is available. -[MESSAGE] -You must download this update to use [APP_NAME]. +Version [VERSION] is required for login. +This should have been updated for you but apparently was not. +Please download from https://secondlife.com/support/downloads/ confirm - - - - -An updated version of [APP_NAME] is available. -[MESSAGE] -This update is not required, but we suggest you install it to improve performance and stability. - confirm - - - - -An updated version of [APP_NAME] is available. -[MESSAGE] -This update is not required, but we suggest you install it to improve performance and stability. - confirm - - - - -A new version of [APP_NAME] is available. -[MESSAGE] -You must download this update to use [APP_NAME]. - confirm - - - - -An updated version of [APP_NAME] is available. -[MESSAGE] -This update is not required, but we suggest you install it to improve performance and stability. - confirm - - - - -An updated version of [APP_NAME] is available. -[MESSAGE] -This update is not required, but we suggest you install it to improve performance and stability. - confirm - - - - -A new version of [APP_NAME] is available. -[MESSAGE] -You must download this update to use [APP_NAME]. - -Download to your Applications folder? - confirm - - - - -An updated version of [APP_NAME] is available. -[MESSAGE] -This update is not required, but we suggest you install it to improve performance and stability. - -Download to your Applications folder? - confirm - - - - -An updated version of [APP_NAME] is available. -[MESSAGE] -This update is not required, but we suggest you install it to improve performance and stability. - -Download to your Applications folder? - confirm - - - - -An error occurred installing the viewer update. -Please download and install the latest viewer from -http://secondlife.com/download. @@ -3977,193 +3838,13 @@ http://secondlife.com/download. -We were unable to install a required update. -You will be unable to log in until [APP_NAME] has been updated. - -Please download and install the latest viewer from -http://secondlife.com/download. - fail - - - - -There is a required update for your Second Life Installation. - -You may download this update from http://www.secondlife.com/downloads -or you can install it now. - confirm - - - - -We have downloaded an update to your [APP_NAME] installation. -Version [VERSION] [[INFO_URL] Information about this update] - confirm - - - - -We have downloaded an update to your [APP_NAME] installation. - Version [VERSION] [[INFO_URL] Information about this update] - confirm - - - - -We have downloaded a required software update. -Version [VERSION] [[INFO_URL] Information about this update] - -We must restart [APP_NAME] to install the update. +Login failed for an unrecognized reason. confirm - - - -We must restart [APP_NAME] to install the update. -[[INFO_URL] Information about this update] - confirm - - - - -We have downloaded an update to your [APP_NAME] installation. -Version [VERSION] -This experimental viewer has been replaced by a [NEW_CHANNEL] viewer; -see [[INFO_URL] for details about this update] - confirm - - - - -We have downloaded an update to your [APP_NAME] installation. -Version [VERSION] -This experimental viewer has been replaced by a [NEW_CHANNEL] viewer; -see [[INFO_URL] Information about this update] - confirm - - - - -We have downloaded a required software update. -Version [VERSION] -This experimental viewer has been replaced by a [NEW_CHANNEL] viewer; -see [[INFO_URL] Information about this update] - -We must restart [APP_NAME] to install the update. - confirm - - - - -We must restart [APP_NAME] to install the update. -This experimental viewer has been replaced by a [NEW_CHANNEL] viewer; -see [[INFO_URL] Information about this update] - confirm - - - - -An update is available! -It's downloading in the background and we will prompt you to restart your viewer to finish installing it as soon as it's ready. - confirm - - - - -An update was downloaded. It will be installed during restart. - confirm - - - - -An update was downloaded that you previously chose to skip or defer to the next start up. - confirm - - - - -Your viewer is up to date! -If you can't wait to try out the latest features and fixes, check out the Alternate Viewers page. http://wiki.secondlife.com/wiki/Linden_Lab_Official:Alternate_Viewers. - confirm - + yestext="Sorry"/> functor) +{ + return LLNotificationPtr((LLNotification*)NULL); +} + +LLNotificationPtr LLNotificationsUtil::add(const std::string& name, const LLSD& args) +{ + return LLNotificationPtr((LLNotification*)NULL); +} + //----------------------------------------------------------------------------- #include "../llviewernetwork.h" LLGridManager::~LLGridManager() -- cgit v1.3 From 6980f5bcc247bc12fd0672164cc713db2e93198a Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Tue, 22 Aug 2017 16:38:15 -0400 Subject: MAINT-7594: add platform name string to login request (and add request parameter logging at DEBUG) --- indra/newview/llappviewer.cpp | 2 +- indra/newview/lllogininstance.cpp | 22 +++++- indra/newview/lllogininstance.h | 3 +- indra/newview/tests/lllogininstance_test.cpp | 107 +-------------------------- 4 files changed, 22 insertions(+), 112 deletions(-) (limited to 'indra/newview/lllogininstance.h') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index cfdc752db4..ef26c3fe5e 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -734,7 +734,7 @@ LLAppViewer::LLAppViewer() // LLLoginInstance::instance().setUpdaterService(mUpdater.get()); - LLLoginInstance::instance().setPlatformInfo(gPlatform, getOSInfo().getOSVersionString()); + LLLoginInstance::instance().setPlatformInfo(gPlatform, getOSInfo().getOSVersionString(), getOSInfo().getOSStringSimple()); } LLAppViewer::~LLAppViewer() diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp index b4d0bb6823..4eb1909042 100644 --- a/indra/newview/lllogininstance.cpp +++ b/indra/newview/lllogininstance.cpp @@ -493,10 +493,12 @@ LLLoginInstance::LLLoginInstance() : } void LLLoginInstance::setPlatformInfo(const std::string platform, - const std::string platform_version) + const std::string platform_version, + const std::string platform_name) { mPlatform = platform; mPlatformVersion = platform_version; + mPlatformVersionName = platform_name; } LLLoginInstance::~LLLoginInstance() @@ -565,7 +567,6 @@ void LLLoginInstance::constructAuthParams(LLPointer user_credentia requested_options.append("event_notifications"); requested_options.append("classified_categories"); requested_options.append("adult_compliant"); - //requested_options.append("inventory-targets"); requested_options.append("buddy-list"); requested_options.append("newuser-config"); requested_options.append("ui-config"); @@ -587,8 +588,7 @@ void LLLoginInstance::constructAuthParams(LLPointer user_credentia requested_options.append("god-connect"); } - // (re)initialize the request params with creds. - LLSD request_params = user_credential->getLoginParams(); + LLSD request_params; unsigned char hashed_unique_id_string[MD5HEX_STR_SIZE]; if ( ! llHashedUniqueID(hashed_unique_id_string) ) @@ -606,10 +606,24 @@ void LLLoginInstance::constructAuthParams(LLPointer user_credentia request_params["channel"] = LLVersionInfo::getChannel(); request_params["platform"] = mPlatform; request_params["platform_version"] = mPlatformVersion; + request_params["platform_string"] = mPlatformVersionName; request_params["id0"] = mSerialNumber; request_params["host_id"] = gSavedSettings.getString("HostID"); request_params["extended_errors"] = true; // request message_id and message_args + // log request_params _before_ adding the credentials + LL_DEBUGS("LLLogin") << "Login parameters: " << LLSDOStreamer(request_params) << LL_ENDL; + + // Copy the credentials into the request after logging the rest + LLSD credentials(user_credential->getLoginParams()); + for (LLSD::map_const_iterator it = credentials.beginMap(); + it != credentials.endMap(); + it++ + ) + { + request_params[it->first] = it->second; + } + mRequestData.clear(); mRequestData["method"] = "login_to_simulator"; mRequestData["params"] = request_params; diff --git a/indra/newview/lllogininstance.h b/indra/newview/lllogininstance.h index 282ddc1cea..1adea67189 100644 --- a/indra/newview/lllogininstance.h +++ b/indra/newview/lllogininstance.h @@ -67,7 +67,7 @@ public: void setSerialNumber(const std::string& sn) { mSerialNumber = sn; } void setLastExecEvent(int lee) { mLastExecEvent = lee; } void setLastExecDuration(S32 duration) { mLastExecDuration = duration; } - void setPlatformInfo(const std::string platform, const std::string platform_version); + void setPlatformInfo(const std::string platform, const std::string platform_version, const std::string platform_name); void setNotificationsInterface(LLNotificationsInterface* ni) { mNotifications = ni; } LLNotificationsInterface& getNotificationsInterface() const { return *mNotifications; } @@ -105,6 +105,7 @@ private: S32 mLastExecDuration; std::string mPlatform; std::string mPlatformVersion; + std::string mPlatformVersionName; UpdaterLauncherCallback mUpdaterLauncher; LLEventDispatcher mDispatcher; LLUpdaterService * mUpdaterService; diff --git a/indra/newview/tests/lllogininstance_test.cpp b/indra/newview/tests/lllogininstance_test.cpp index b603157ca7..978678a09c 100644 --- a/indra/newview/tests/lllogininstance_test.cpp +++ b/indra/newview/tests/lllogininstance_test.cpp @@ -362,7 +362,7 @@ namespace tut accountCredential->setCredentialData(identifier, authenticator); logininstance->setNotificationsInterface(¬ifications); - logininstance->setPlatformInfo("win", "1.3.5"); + logininstance->setPlatformInfo("win", "1.3.5", "Windows Bogus Version 100.6.6.6"); } LLLoginInstance* logininstance; @@ -478,109 +478,4 @@ namespace tut ensure_equals("Default for agree to tos", gLoginCreds["params"]["read_critical"].asBoolean(), false); } - template<> template<> - void lllogininstance_object::test<3>() - { - set_test_name("Test Mandatory Update User Accepts"); - - // Part 1 - Mandatory Update, with User accepts response. - // Test connect with update needed. - logininstance->connect(agentCredential); - - ensure_equals("Default connect uri", gLoginURI, VIEWERLOGIN_URI); - - // Update needed failure response. - LLSD response; - response["state"] = "offline"; - response["change"] = "fail.login"; - response["progress"] = 0.0; - response["transfer_rate"] = 7; - response["data"]["reason"] = "update"; - gTestPump.post(response); - - ensure_equals("Notification added", notifications.addedCount(), 1); - - notifications.sendYesResponse(); - - ensure("Disconnected", !(logininstance->authSuccess())); - } - - template<> template<> - void lllogininstance_object::test<4>() - { - set_test_name("Test Mandatory Update User Decline"); - - // Test connect with update needed. - logininstance->connect(agentCredential); - - ensure_equals("Default connect uri", gLoginURI, VIEWERLOGIN_URI); - - // Update needed failure response. - LLSD response; - response["state"] = "offline"; - response["change"] = "fail.login"; - response["progress"] = 0.0; - response["transfer_rate"] = 7; - response["data"]["reason"] = "update"; - gTestPump.post(response); - - ensure_equals("Notification added", notifications.addedCount(), 1); - notifications.sendNoResponse(); - - ensure("Disconnected", !(logininstance->authSuccess())); - } - - template<> template<> - void lllogininstance_object::test<6>() - { - set_test_name("Test Optional Update User Accept"); - - // Part 3 - Mandatory Update, with bogus response. - // Test connect with update needed. - logininstance->connect(agentCredential); - - ensure_equals("Default connect uri", gLoginURI, VIEWERLOGIN_URI); - - // Update needed failure response. - LLSD response; - response["state"] = "offline"; - response["change"] = "fail.login"; - response["progress"] = 0.0; - response["transfer_rate"] = 7; - response["data"]["reason"] = "optional"; - gTestPump.post(response); - - ensure_equals("Notification added", notifications.addedCount(), 1); - notifications.sendYesResponse(); - - ensure("Disconnected", !(logininstance->authSuccess())); - } - - template<> template<> - void lllogininstance_object::test<7>() - { - set_test_name("Test Optional Update User Denies"); - - // Part 3 - Mandatory Update, with bogus response. - // Test connect with update needed. - logininstance->connect(agentCredential); - - ensure_equals("Default connect uri", gLoginURI, VIEWERLOGIN_URI); - - // Update needed failure response. - LLSD response; - response["state"] = "offline"; - response["change"] = "fail.login"; - response["progress"] = 0.0; - response["transfer_rate"] = 7; - response["data"]["reason"] = "optional"; - gTestPump.post(response); - - ensure_equals("Notification added", notifications.addedCount(), 1); - notifications.sendNoResponse(); - - // User skips, should be reconnecting. - ensure_equals("reconnect uri", gLoginURI, VIEWERLOGIN_URI); - ensure_equals("skipping optional update", gLoginCreds["params"]["skipoptional"].asBoolean(), true); - } } -- cgit v1.3