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(-) 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.2.3