From 099e58f75b3edc036cff9f6cf5587dacaf16e3fc Mon Sep 17 00:00:00 2001
From: "Brad Payne (Vir Linden)" <vir@lindenlab.com>
Date: Tue, 23 Apr 2019 15:13:38 +0100
Subject: SL-10401 - get agent attachment limit from SimulatorFeatures if
 available

---
 indra/newview/llcofwearables.cpp    |  3 ++-
 indra/newview/llinventorybridge.cpp |  2 +-
 indra/newview/llvoavatar.cpp        | 25 +++++++++++++++++++++++--
 indra/newview/llvoavatar.h          |  1 +
 4 files changed, 27 insertions(+), 4 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llcofwearables.cpp b/indra/newview/llcofwearables.cpp
index 307f93e28c..b47e0930a3 100644
--- a/indra/newview/llcofwearables.cpp
+++ b/indra/newview/llcofwearables.cpp
@@ -42,6 +42,7 @@
 #include "llwearableitemslist.h"
 #include "llpaneloutfitedit.h"
 #include "lltrans.h"
+#include "llvoavatarself.h"
 
 static LLPanelInjector<LLCOFWearables> t_cof_wearables("cof_wearables");
 
@@ -330,7 +331,7 @@ void LLCOFWearables::setAttachmentsTitle()
 {
 	if (mAttachmentsTab)
 	{
-		U32 free_slots = MAX_AGENT_ATTACHMENTS - mAttachments->size();
+		U32 free_slots = gAgentAvatarp->getMaxAttachments() - mAttachments->size();
 
 		LLStringUtil::format_map_t args_attachments;
 		args_attachments["[COUNT]"] = llformat ("%d", free_slots);
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 1987e15850..b3f6d354df 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -6307,7 +6307,7 @@ bool confirm_attachment_rez(const LLSD& notification, const LLSD& response)
 	if (!gAgentAvatarp->canAttachMoreObjects())
 	{
 		LLSD args;
-		args["MAX_ATTACHMENTS"] = llformat("%d", MAX_AGENT_ATTACHMENTS);
+		args["MAX_ATTACHMENTS"] = llformat("%d", gAgentAvatarp->getMaxAttachments());
 		LLNotificationsUtil::add("MaxAttachmentsOnOutfit", args);
 		return false;
 	}
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 321f774210..c9f2ba1a3c 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -7036,13 +7036,34 @@ U32 LLVOAvatar::getNumAttachments() const
 	return num_attachments;
 }
 
+//-----------------------------------------------------------------------------
+// getMaxAttachments()
+//-----------------------------------------------------------------------------
+S32 LLVOAvatar::getMaxAttachments() const
+{
+	const S32 MAX_AGENT_ATTACHMENTS = 38;
+
+	S32 max_attach = MAX_AGENT_ATTACHMENTS;
+	
+	if (gAgent.getRegion())
+	{
+		LLSD features;
+		gAgent.getRegion()->getSimulatorFeatures(features);
+		if (features.has("MaxAgentAttachments"))
+		{
+			max_attach = features["MaxAgentAttachments"].asInteger();
+		}
+	}
+	return max_attach;
+}
+
 //-----------------------------------------------------------------------------
 // canAttachMoreObjects()
 // Returns true if we can attach <n> more objects.
 //-----------------------------------------------------------------------------
 BOOL LLVOAvatar::canAttachMoreObjects(U32 n) const
 {
-	return (getNumAttachments() + n) <= MAX_AGENT_ATTACHMENTS;
+	return (getNumAttachments() + n) <= getMaxAttachments();
 }
 
 //-----------------------------------------------------------------------------
@@ -7070,7 +7091,7 @@ S32 LLVOAvatar::getMaxAnimatedObjectAttachments() const
     S32 max_attach = 0;
     if (gSavedSettings.getBOOL("AnimatedObjectsIgnoreLimits"))
     {
-        max_attach = MAX_AGENT_ATTACHMENTS;
+        max_attach = getMaxAttachments(); 
     }
     else
     {
diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h
index deb22617a4..e1ea7c619b 100644
--- a/indra/newview/llvoavatar.h
+++ b/indra/newview/llvoavatar.h
@@ -809,6 +809,7 @@ public:
 	BOOL 				hasHUDAttachment() const;
 	LLBBox 				getHUDBBox() const;
 	void 				resetHUDAttachments();
+	S32					getMaxAttachments() const;
 	BOOL				canAttachMoreObjects(U32 n=1) const;
     S32					getMaxAnimatedObjectAttachments() const;
     BOOL				canAttachMoreAnimatedObjects(U32 n=1) const;
-- 
cgit v1.2.3


From d1f5e87ad08f63cf8bdf0421566d6e646f76a6d0 Mon Sep 17 00:00:00 2001
From: "Brad Payne (Vir Linden)" <vir@lindenlab.com>
Date: Tue, 23 Apr 2019 15:31:25 +0100
Subject: via viewer-neko - don't crash test viewer due to missing version
 checker

---
 indra/newview/llappviewer.cpp | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 1bc21ec469..f54d87e5a3 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -1167,8 +1167,18 @@ bool LLAppViewer::init()
 	// ForceAddressSize
 	updater.args.add(stringize(gSavedSettings.getU32("ForceAddressSize")));
 
-	// Run the updater. An exception from launching the updater should bother us.
+#if LL_WINDOWS && !LL_RELEASE_FOR_DOWNLOAD && !LL_SEND_CRASH_REPORTS
+	// This is neither a release package, nor crash-reporting enabled test build
+	// try to run version updater, but don't bother if it fails (file might be missing)
+	LLLeap *leap_p = LLLeap::create(updater, false);
+	if (!leap_p)
+	{
+		LL_WARNS("LLLeap") << "Failed to run LLLeap" << LL_ENDL;
+	}
+#else
+ 	// Run the updater. An exception from launching the updater should bother us.
 	LLLeap::create(updater, true);
+#endif
 
 	// Iterate over --leap command-line options. But this is a bit tricky: if
 	// there's only one, it won't be an array at all.
-- 
cgit v1.2.3


From 06009e9b533fe65841c31214afdadb78a79a43ae Mon Sep 17 00:00:00 2001
From: "Brad Payne (Vir Linden)" <vir@lindenlab.com>
Date: Thu, 25 Apr 2019 22:02:47 +0100
Subject: SL-10400 - get group limits from SimulatorFeatures

---
 indra/newview/llpanelpeople.cpp | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 1cbff37287..3f48ac63b4 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -67,6 +67,7 @@
 #include "llrecentpeople.h"
 #include "llviewercontrol.h"		// for gSavedSettings
 #include "llviewermenu.h"			// for gMenuHolder
+#include "llviewerregion.h"
 #include "llvoiceclient.h"
 #include "llworld.h"
 #include "llspeakers.h"
@@ -1165,8 +1166,25 @@ void LLPanelPeople::onFilterEdit(const std::string& search_string)
 void LLPanelPeople::onGroupLimitInfo()
 {
 	LLSD args;
-	args["MAX_BASIC"] = BASE_MAX_AGENT_GROUPS;
-	args["MAX_PREMIUM"] = PREMIUM_MAX_AGENT_GROUPS;
+
+	S32 max_basic = BASE_MAX_AGENT_GROUPS;
+	S32 max_premium = PREMIUM_MAX_AGENT_GROUPS;
+	if (gAgent.getRegion())
+	{
+		LLSD features;
+		gAgent.getRegion()->getSimulatorFeatures(features);
+		if (features.has("MaxAgentGroupsBasic"))
+		{
+			max_basic = features["MaxAgentGroupsBasic"].asInteger();
+		}
+		if (features.has("MaxAgentGroupsPremium"))
+		{
+			max_premium = features["MaxAgentGroupsPremium"].asInteger();
+		}
+	}
+	args["MAX_BASIC"] = max_basic; 
+	args["MAX_PREMIUM"] = max_premium; 
+
 	LLNotificationsUtil::add("GroupLimitInfo", args);
 }
 
-- 
cgit v1.2.3


From a44f03573d5d64102775922ff0e61f1bce2d1a22 Mon Sep 17 00:00:00 2001
From: "Brad Payne (Vir Linden)" <vir@lindenlab.com>
Date: Fri, 26 Apr 2019 14:23:57 +0100
Subject: SL-10400 - more on group limits from SimulatorFeatures

---
 indra/newview/llpanelpeople.cpp | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 3f48ac63b4..617ca05281 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -614,12 +614,23 @@ void LLPanelPeople::removePicker()
 
 BOOL LLPanelPeople::postBuild()
 {
+	S32 max_premium = PREMIUM_MAX_AGENT_GROUPS; 
+	if (gAgent.getRegion())
+	{
+		LLSD features;
+		gAgent.getRegion()->getSimulatorFeatures(features);
+		if (features.has("MaxAgentGroupsPremium"))
+		{
+			max_premium = features["MaxAgentGroupsPremium"].asInteger();
+		}
+	}
+
 	getChild<LLFilterEditor>("nearby_filter_input")->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2));
 	getChild<LLFilterEditor>("friends_filter_input")->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2));
 	getChild<LLFilterEditor>("groups_filter_input")->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2));
 	getChild<LLFilterEditor>("recent_filter_input")->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2));
 
-	if(gMaxAgentGroups <= BASE_MAX_AGENT_GROUPS)
+	if(gMaxAgentGroups < max_premium)
 	{
 	    getChild<LLTextBox>("groupcount")->setText(getString("GroupCountWithInfo"));
 	    getChild<LLTextBox>("groupcount")->setURLClickedCallback(boost::bind(&LLPanelPeople::onGroupLimitInfo, this));
-- 
cgit v1.2.3