From b3b103efe59c347a7268d820876888fe9297d7dd Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 12 Nov 2019 22:26:10 +0000 Subject: SL-10498 - benefits info received at login, persisted in new LLAgentBenefits singleton. --- indra/newview/llstartup.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'indra/newview/llstartup.cpp') diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index c8c39ae00f..73e8d3cf5f 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -88,6 +88,7 @@ #include "v3math.h" #include "llagent.h" +#include "llagentbenefits.h" #include "llagentcamera.h" #include "llagentpicksinfo.h" #include "llagentwearables.h" @@ -3258,6 +3259,12 @@ bool process_login_success_response() { LLSD response = LLLoginInstance::getInstance()->getResponse(); + //LL_INFOS() << "login success response:" << ll_pretty_print_sd(response) << LL_ENDL; + if (!LLAgentBenefits::instance().init(response["account_level_benefits"])) + { + LL_ERRS() << "Benefits error" << LL_ENDL; + } + std::string text(response["udp_blacklist"]); if(!text.empty()) { -- cgit v1.2.3 From 7df0a4ddd0c48358e7152733aaba01464f2620be Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 14 Nov 2019 15:01:50 +0000 Subject: SL-10499, SL-10497 - use LLAgentBenefits info --- indra/newview/llstartup.cpp | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) (limited to 'indra/newview/llstartup.cpp') diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 73e8d3cf5f..979fe63432 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -247,7 +247,6 @@ static std::string gAgentStartLocation = "safe"; static bool mLoginStatePastUI = false; const S32 DEFAULT_MAX_AGENT_GROUPS = 42; -const S32 ALLOWED_MAX_AGENT_GROUPS = 500; const F32 STATE_AGENT_WAIT_TIMEOUT = 240; //seconds boost::scoped_ptr LLStartUp::sStateWatcher(new LLEventStream("StartupState")); @@ -3607,26 +3606,9 @@ bool process_login_success_response() LLViewerMedia::getInstance()->openIDSetup(openid_url, openid_token); } - gMaxAgentGroups = DEFAULT_MAX_AGENT_GROUPS; - if(response.has("max-agent-groups")) - { - S32 agent_groups = atoi(std::string(response["max-agent-groups"]).c_str()); - if (agent_groups > 0 && agent_groups <= ALLOWED_MAX_AGENT_GROUPS) - { - gMaxAgentGroups = agent_groups; - LL_INFOS("LLStartup") << "gMaxAgentGroups read from login.cgi: " - << gMaxAgentGroups << LL_ENDL; - } - else - { - LL_INFOS("LLStartup") << "Invalid value received, using defaults for gMaxAgentGroups: " - << gMaxAgentGroups << LL_ENDL; - } - } - else { - LL_INFOS("LLStartup") << "Missing max-agent-groups, using default value for gMaxAgentGroups: " - << gMaxAgentGroups << LL_ENDL; - } + gMaxAgentGroups = LLAgentBenefits::instance().getGroupMembershipLimit(); + LL_INFOS("LLStartup") << "gMaxAgentGroups set from agent benefits: " + << gMaxAgentGroups << LL_ENDL; bool success = false; // JC: gesture loading done below, when we have an asset system -- cgit v1.2.3 From 65550520ed00699098b221a1166e4c1763333d58 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 15 Nov 2019 15:13:11 +0000 Subject: SL-10499 - benefits. Removed no-longer-needed lleconomy files and classes. Group-related costs and limits via benefits. --- indra/newview/llstartup.cpp | 8 -------- 1 file changed, 8 deletions(-) (limited to 'indra/newview/llstartup.cpp') diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 979fe63432..2f9bc786ca 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -209,7 +209,6 @@ // exported globals // bool gAgentMovementCompleted = false; -S32 gMaxAgentGroups; const std::string SCREEN_HOME_FILENAME = "screen_home%s.png"; const std::string SCREEN_LAST_FILENAME = "screen_last%s.png"; @@ -246,7 +245,6 @@ static LLVector3 gAgentStartLookAt(1.0f, 0.f, 0.f); static std::string gAgentStartLocation = "safe"; static bool mLoginStatePastUI = false; -const S32 DEFAULT_MAX_AGENT_GROUPS = 42; const F32 STATE_AGENT_WAIT_TIMEOUT = 240; //seconds boost::scoped_ptr LLStartUp::sStateWatcher(new LLEventStream("StartupState")); @@ -1574,8 +1572,6 @@ bool idle_startup() send_complete_agent_movement(regionp->getHost()); gAssetStorage->setUpstream(regionp->getHost()); gCacheName->setUpstream(regionp->getHost()); - msg->newMessageFast(_PREHASH_EconomyDataRequest); - gAgent.sendReliableMessage(); } display_startup(); @@ -3606,10 +3602,6 @@ bool process_login_success_response() LLViewerMedia::getInstance()->openIDSetup(openid_url, openid_token); } - gMaxAgentGroups = LLAgentBenefits::instance().getGroupMembershipLimit(); - LL_INFOS("LLStartup") << "gMaxAgentGroups set from agent benefits: " - << gMaxAgentGroups << LL_ENDL; - bool success = false; // JC: gesture loading done below, when we have an asset system // in place. Don't delete/clear gUserCredentials until then. -- cgit v1.2.3 From eb6e64ec401382fd2fbbbb27830e828035a6e5af Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 19 Nov 2019 16:15:19 +0000 Subject: SL-10499 - Fixes for benefits info and upload, especially bulk upload --- indra/newview/llstartup.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llstartup.cpp') diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 2f9bc786ca..c144ea2f8e 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -3254,7 +3254,7 @@ bool process_login_success_response() { LLSD response = LLLoginInstance::getInstance()->getResponse(); - //LL_INFOS() << "login success response:" << ll_pretty_print_sd(response) << LL_ENDL; + LL_DEBUGS("Benefits") << "login success response:" << response << LL_ENDL; if (!LLAgentBenefits::instance().init(response["account_level_benefits"])) { LL_ERRS() << "Benefits error" << LL_ENDL; -- cgit v1.2.3 From 4300b204f0fc519d3e2dabc7e1296284e5908611 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 20 Nov 2019 14:03:57 +0000 Subject: SL-10499 - handle package info from benefits service --- indra/newview/llstartup.cpp | 59 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 56 insertions(+), 3 deletions(-) (limited to 'indra/newview/llstartup.cpp') diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index c144ea2f8e..3f65d69719 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -3250,14 +3250,67 @@ void apply_udp_blacklist(const std::string& csv) } +void on_benefits_failed_callback(const LLSD& notification, const LLSD& response) +{ + LL_WARNS("Benefits") << "Failed to load benefits information" << LL_ENDL; +} + +bool init_benefits(LLSD& response) +{ + LL_DEBUGS("Benefits") << "login success response:" << response << LL_ENDL; + + bool succ = true; + + std::string package_name = response["account_type"].asString(); + const LLSD& benefits_sd = response["account_level_benefits"]; + if (!LLAgentBenefitsMgr::init(package_name, benefits_sd) || + !LLAgentBenefitsMgr::initCurrent(package_name, benefits_sd)) + { + succ = false; + } + else + { + LL_DEBUGS("Benefits") << "Initialized current benefits, level " << package_name << " from " << benefits_sd << LL_ENDL; + } + const LLSD& packages_sd = response["premium_packages"]; + for(LLSD::map_const_iterator package_iter = packages_sd.beginMap(); + package_iter != packages_sd.endMap(); + ++package_iter) + { + std::string package_name = package_iter->first; + const LLSD& benefits_sd = package_iter->second["benefits"]; + if (LLAgentBenefitsMgr::init(package_name, benefits_sd)) + { + LL_DEBUGS("Benefits") << "Initialized benefits for package " << package_name << " from " << benefits_sd << LL_ENDL; + } + else + { + LL_WARNS("Benefits") << "Failed init for package " << package_name << " from " << benefits_sd << LL_ENDL; + succ = false; + } + } + + if (!LLAgentBenefitsMgr::has("Base")) + { + LL_WARNS("Benefits") << "Benefits info did not include required package Base" << LL_ENDL; + succ = false; + } + if (!LLAgentBenefitsMgr::has("Premium")) + { + LL_WARNS("Benefits") << "Benefits info did not include required package Premium" << LL_ENDL; + succ = false; + } + return succ; +} + bool process_login_success_response() { LLSD response = LLLoginInstance::getInstance()->getResponse(); - LL_DEBUGS("Benefits") << "login success response:" << response << LL_ENDL; - if (!LLAgentBenefits::instance().init(response["account_level_benefits"])) + bool benefits_ok = init_benefits(response); + if (!benefits_ok) { - LL_ERRS() << "Benefits error" << LL_ENDL; + LLNotificationsUtil::add("FailedToGetBenefits", LLSD(), LLSD(), boost::bind(on_benefits_failed_callback, _1, _2)); } std::string text(response["udp_blacklist"]); -- cgit v1.2.3 From d0abb6e1e091e89186df1d1fe6c8256f0bac497c Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 26 Nov 2019 17:15:42 +0000 Subject: SL-12100, SL-12317 - benefits handling fixes --- indra/newview/llstartup.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'indra/newview/llstartup.cpp') diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 3f65d69719..b4aa74f1dc 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -3300,6 +3300,13 @@ bool init_benefits(LLSD& response) LL_WARNS("Benefits") << "Benefits info did not include required package Premium" << LL_ENDL; succ = false; } + + // FIXME PREMIUM - for testing if login does not yet provide Premium Plus. Should be removed thereafter. + //if (succ && !LLAgentBenefitsMgr::has("Premium Plus")) + //{ + // LLAgentBenefitsMgr::init("Premium Plus", packages_sd["Premium"]["benefits"]); + // llassert(LLAgentBenefitsMgr::has("Premium Plus")); + //} return succ; } -- cgit v1.2.3 From caac8f57f0cc7a6bf0720473ad77fe1e3923c821 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Mon, 9 Dec 2019 14:28:58 +0200 Subject: SL-12415 FIXED Link "MoTD" is not clickable on the loading screen while logining to Viewer --- indra/newview/llstartup.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'indra/newview/llstartup.cpp') diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index b4aa74f1dc..a55cef90cd 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -244,6 +244,7 @@ static std::string gFirstSimSeedCap; static LLVector3 gAgentStartLookAt(1.0f, 0.f, 0.f); static std::string gAgentStartLocation = "safe"; static bool mLoginStatePastUI = false; +static bool mBenefitsSuccessfullyInit = false; const F32 STATE_AGENT_WAIT_TIMEOUT = 240; //seconds @@ -275,6 +276,7 @@ void general_cert_done(const LLSD& notification, const LLSD& response); void trust_cert_done(const LLSD& notification, const LLSD& response); void apply_udp_blacklist(const std::string& csv); bool process_login_success_response(); +void on_benefits_failed_callback(const LLSD& notification, const LLSD& response); void transition_back_to_login_panel(const std::string& emsg); void callback_cache_name(const LLUUID& id, const std::string& full_name, bool is_group) @@ -2150,6 +2152,11 @@ bool idle_startup() set_startup_status(1.0, "", ""); display_startup(); + if (!mBenefitsSuccessfullyInit) + { + LLNotificationsUtil::add("FailedToGetBenefits", LLSD(), LLSD(), boost::bind(on_benefits_failed_callback, _1, _2)); + } + // Let the map know about the inventory. LLFloaterWorldMap* floater_world_map = LLFloaterWorldMap::getInstance(); if(floater_world_map) @@ -3314,11 +3321,7 @@ bool process_login_success_response() { LLSD response = LLLoginInstance::getInstance()->getResponse(); - bool benefits_ok = init_benefits(response); - if (!benefits_ok) - { - LLNotificationsUtil::add("FailedToGetBenefits", LLSD(), LLSD(), boost::bind(on_benefits_failed_callback, _1, _2)); - } + mBenefitsSuccessfullyInit = init_benefits(response); std::string text(response["udp_blacklist"]); if(!text.empty()) -- cgit v1.2.3 From 05e2efb283a8578abe073e4188bc64347814c679 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 21 Feb 2020 19:56:44 +0000 Subject: SL-10498 - made benefits debug output a bit less verbose --- indra/newview/llstartup.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'indra/newview/llstartup.cpp') diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index e6ad2373bf..be6e9e520a 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -3294,8 +3294,6 @@ void on_benefits_failed_callback(const LLSD& notification, const LLSD& response) bool init_benefits(LLSD& response) { - LL_DEBUGS("Benefits") << "login success response:" << response << LL_ENDL; - bool succ = true; std::string package_name = response["account_type"].asString(); -- cgit v1.2.3