diff options
author | dolphin <dolphin@lindenlab.com> | 2014-05-16 15:52:39 -0700 |
---|---|---|
committer | dolphin <dolphin@lindenlab.com> | 2014-05-16 15:52:39 -0700 |
commit | 4c7b0cb528f61bc20866c2f7c43049ef7bc49bf2 (patch) | |
tree | 37c8d52aedb48e440ea66dfe734f08e3c708acd1 /indra/llinventory | |
parent | 9a7458f9e32773c07b689a6d490e5bfe9c6ec47f (diff) |
ACME-1459: Experience tab added to the about land tab for editing parcel Experiences
Diffstat (limited to 'indra/llinventory')
-rwxr-xr-x | indra/llinventory/llparcel.cpp | 14 | ||||
-rwxr-xr-x | indra/llinventory/llparcel.h | 4 |
2 files changed, 17 insertions, 1 deletions
diff --git a/indra/llinventory/llparcel.cpp b/indra/llinventory/llparcel.cpp index d2179308c1..0784986e3a 100755 --- a/indra/llinventory/llparcel.cpp +++ b/indra/llinventory/llparcel.cpp @@ -41,6 +41,7 @@ #include "message.h" #include "u64.h" #include "llregionflags.h" +#include <boost/range/adaptor/map.hpp> static const F32 SOME_BIG_NUMBER = 1000.0f; static const F32 SOME_BIG_NEG_NUMBER = -1000.0f; @@ -1256,6 +1257,17 @@ void LLParcel::setExperienceKeyType( const LLUUID& experience_key, U32 type ) } else { - mExperienceKeys[experience_key] = type; + if(countExperienceKeyType(type) < PARCEL_MAX_EXPERIENCE_LIST) + { + mExperienceKeys[experience_key] = type; + } } } + +U32 LLParcel::countExperienceKeyType( U32 type ) +{ + return std::count_if( + boost::begin(mExperienceKeys | boost::adaptors::map_values), + boost::end(mExperienceKeys | boost::adaptors::map_values), + std::bind2nd(std::equal_to<U32>(), type)); +} diff --git a/indra/llinventory/llparcel.h b/indra/llinventory/llparcel.h index fe76531317..e68331b99a 100755 --- a/indra/llinventory/llparcel.h +++ b/indra/llinventory/llparcel.h @@ -53,6 +53,9 @@ const S32 PARCEL_MAX_ACCESS_LIST = 300; //for access/ban lists. const F32 PARCEL_MAX_ENTRIES_PER_PACKET = 48.f; +// Maximum number of experiences +const S32 PARCEL_MAX_EXPERIENCE_LIST = 24; + // Weekly charge for listing a parcel in the directory const S32 PARCEL_DIRECTORY_FEE = 30; @@ -671,6 +674,7 @@ public: typedef std::map<LLUUID, U32> xp_type_map_t; void setExperienceKeyType(const LLUUID& experience_key, U32 type); + U32 countExperienceKeyType(U32 type); U32 getExperienceKeyType(const LLUUID& experience_key)const; LLAccessEntry::map getExperienceKeysByType(U32 type)const; void clearExperienceKeysByType(U32 type); |