Added 'RLVaExperienceMaturityThreshold' and 'RLVaBlockedExperiences' debug settings
-> Current default threshold is mature and higher -> AVsitter is a compromised experience and blocked by default --HG-- branch : RLVamaster
parent
8940db0e19
commit
b8cd2f8933
|
|
@ -90,6 +90,17 @@
|
|||
<key>Value</key>
|
||||
<string>+</string>
|
||||
</map>
|
||||
<key>RLVaBlockedExperiences</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>List of experiences blocked from interacting with RLVa</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>String</string>
|
||||
<key>Value</key>
|
||||
<string>bfe25fb4-222c-11e5-85a2-fa4c4ccaa202</string>
|
||||
</map>
|
||||
<key>RLVaCompatibilityModeList</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
|
@ -189,6 +200,17 @@
|
|||
<key>Value</key>
|
||||
<boolean>1</boolean>
|
||||
</map>
|
||||
<key>RLVaExperienceMaturityThreshold</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Specifies the minimum maturity an experience has to be before it can interact with RLVa (0: never; 1: PG; 2: Mature; 3: Adult)</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>S32</string>
|
||||
<key>Value</key>
|
||||
<integer>2</integer>
|
||||
</map>
|
||||
<key>RLVaHideLockedLayers</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
|
|
|||
|
|
@ -84,9 +84,11 @@ void RlvNotifications::onGiveToRLVConfirmation(const LLSD& notification, const L
|
|||
bool RlvSettings::s_fCompositeFolders = false;
|
||||
#endif // RLV_EXPERIMENTAL_COMPOSITEFOLDERS
|
||||
bool RlvSettings::s_fCanOOC = true;
|
||||
U8 RlvSettings::s_nExperienceMinMaturity = 0;
|
||||
bool RlvSettings::s_fLegacyNaming = true;
|
||||
bool RlvSettings::s_fNoSetEnv = false;
|
||||
bool RlvSettings::s_fTempAttach = true;
|
||||
std::list<std::string> RlvSettings::s_BlockedExperiences;
|
||||
std::list<LLUUID> RlvSettings::s_CompatItemCreators;
|
||||
std::list<std::string> RlvSettings::s_CompatItemNames;
|
||||
|
||||
|
|
@ -122,6 +124,10 @@ void RlvSettings::initClass()
|
|||
if (gSavedSettings.controlExists(RLV_SETTING_TOPLEVELMENU))
|
||||
gSavedSettings.getControl(RLV_SETTING_TOPLEVELMENU)->getSignal()->connect(boost::bind(&onChangedMenuLevel));
|
||||
|
||||
int nMinMaturity = gSavedSettings.getS32("RLVaExperienceMaturityThreshold");
|
||||
s_nExperienceMinMaturity = (nMinMaturity == 0) ? 0 : ((nMinMaturity == 1) ? SIM_ACCESS_PG : ((nMinMaturity == 2) ? SIM_ACCESS_MATURE : SIM_ACCESS_ADULT));
|
||||
boost::split(s_BlockedExperiences, gSavedSettings.getString("RLVaBlockedExperiences"), boost::is_any_of(";"));
|
||||
|
||||
fInitialized = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -224,6 +230,18 @@ bool RlvSettings::isCompatibilityModeObject(const LLUUID& idRlvObject)
|
|||
return fCompatMode;
|
||||
}
|
||||
|
||||
bool RlvSettings::isAllowedExperience(const LLUUID& idExperience, U8 nMaturity)
|
||||
{
|
||||
// An experience is allowed to interact with RLVa if:
|
||||
// - temporary attachments can interact with RLVa
|
||||
// - the user set a minimum maturity and the specified maturity is equal or higher
|
||||
// - the experience isn't explicitly blocked (NOTE: case-sensitive string comparison)
|
||||
return
|
||||
(getEnableTemporaryAttachments()) &&
|
||||
(s_nExperienceMinMaturity) && (s_nExperienceMinMaturity <= nMaturity) &&
|
||||
(s_BlockedExperiences.end() == std::find(s_BlockedExperiences.begin(), s_BlockedExperiences.end(), idExperience.asString()));
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// RlvStrings
|
||||
//
|
||||
|
|
|
|||
|
|
@ -106,6 +106,8 @@ public:
|
|||
static void initCompatibilityMode(std::string strCompatList);
|
||||
static bool isCompatibilityModeObject(const LLUUID& idRlvObject);
|
||||
|
||||
static bool isAllowedExperience(const LLUUID& idExperience, U8 nMaturity);
|
||||
|
||||
static void initClass();
|
||||
static void onChangedSettingMain(const LLSD& sdValue);
|
||||
protected:
|
||||
|
|
@ -121,9 +123,11 @@ protected:
|
|||
*/
|
||||
protected:
|
||||
static bool s_fCanOOC;
|
||||
static U8 s_nExperienceMinMaturity;
|
||||
static bool s_fLegacyNaming;
|
||||
static bool s_fNoSetEnv;
|
||||
static bool s_fTempAttach;
|
||||
static std::list<std::string> s_BlockedExperiences;
|
||||
static std::list<LLUUID> s_CompatItemCreators;
|
||||
static std::list<std::string> s_CompatItemNames;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -883,7 +883,7 @@ void RlvHandler::onDetach(const LLViewerObject* pAttachObj, const LLViewerJointA
|
|||
|
||||
void RlvHandler::onExperienceAttach(const LLSD& sdExperience, const std::string& strObjName)
|
||||
{
|
||||
if (sdExperience["maturity"].asInteger() != SIM_ACCESS_ADULT)
|
||||
if (!RlvSettings::isAllowedExperience(sdExperience[LLExperienceCache::EXPERIENCE_ID].asUUID(), sdExperience[LLExperienceCache::MATURITY].asInteger()))
|
||||
{
|
||||
addBlockedObject(LLUUID::null, strObjName);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue