diff --git a/indra/newview/rlvdefines.h b/indra/newview/rlvdefines.h index 5c778b9aeb..cade53caa9 100644 --- a/indra/newview/rlvdefines.h +++ b/indra/newview/rlvdefines.h @@ -135,6 +135,10 @@ enum ERlvBehaviour { RLV_BHVR_REMATTACH, // "remattach" RLV_BHVR_ADDOUTFIT, // "addoutfit" RLV_BHVR_REMOUTFIT, // "remoutfit" + RLV_BHVR_SHAREDWEAR, // "sharedwear" + RLV_BHVR_SHAREDUNWEAR, // "sharedunwear" + RLV_BHVR_UNSHAREDWEAR, // "unsharedwear" + RLV_BHVR_UNSHAREDUNWEAR, // "unsharedunwear" RLV_BHVR_EMOTE, // "emote" RLV_BHVR_SENDCHAT, // "sendchat" RLV_BHVR_RECVCHAT, // "recvchat" diff --git a/indra/newview/rlvhandler.cpp b/indra/newview/rlvhandler.cpp index a0aabbdc23..d048048169 100644 --- a/indra/newview/rlvhandler.cpp +++ b/indra/newview/rlvhandler.cpp @@ -1055,6 +1055,44 @@ ERlvCmdRet RlvHandler::processAddRemCommand(const RlvCommand& rlvCmd) } } break; + case RLV_BHVR_SHAREDWEAR: // @sharedwear=n|y - Checked: 2011-03-28 (RLVa-1.3.0g) | Added: RLVa-1.3.0g + case RLV_BHVR_SHAREDUNWEAR: // @sharedunwear=n|y - Checked: 2011-03-28 (RLVa-1.3.0g) | Added: RLVa-1.3.0g + { + VERIFY_OPTION_REF(strOption.empty()); + + RlvFolderLocks::folderlock_source_t lockSource(RlvFolderLocks::ST_SHAREDPATH, LLStringUtil::null); + RlvFolderLocks::ELockScope eLockScope = RlvFolderLocks::SCOPE_SUBTREE; + ERlvLockMask eLockType = (RLV_BHVR_SHAREDUNWEAR == eBhvr) ? RLV_LOCK_REMOVE : RLV_LOCK_ADD; + + if (RLV_TYPE_ADD == eType) + gRlvFolderLocks.addFolderLock(lockSource, RlvFolderLocks::PERM_DENY, eLockScope, rlvCmd.getObjectID(), eLockType); + else + gRlvFolderLocks.removeFolderLock(lockSource, RlvFolderLocks::PERM_DENY, eLockScope, rlvCmd.getObjectID(), eLockType); + } + break; + case RLV_BHVR_UNSHAREDWEAR: // @unsharedwear=n|y - Checked: 2011-03-28 (RLVa-1.3.0g) | Added: RLVa-1.3.0g + case RLV_BHVR_UNSHAREDUNWEAR: // @unsharedunwear=n|y - Checked: 2011-03-28 (RLVa-1.3.0g) | Added: RLVa-1.3.0g + { + VERIFY_OPTION_REF(strOption.empty()); + + // Lock down the inventory root + RlvFolderLocks::folderlock_source_t lockSource(RlvFolderLocks::ST_FOLDER, gInventory.getRootFolderID()); + RlvFolderLocks::ELockScope eLockScope = RlvFolderLocks::SCOPE_SUBTREE; + ERlvLockMask eLockType = (RLV_BHVR_UNSHAREDUNWEAR == eBhvr) ? RLV_LOCK_REMOVE : RLV_LOCK_ADD; + + if (RLV_TYPE_ADD == eType) + gRlvFolderLocks.addFolderLock(lockSource, RlvFolderLocks::PERM_DENY, eLockScope, rlvCmd.getObjectID(), eLockType); + else + gRlvFolderLocks.removeFolderLock(lockSource, RlvFolderLocks::PERM_DENY, eLockScope, rlvCmd.getObjectID(), eLockType); + + // Add the #RLV shared folder as an exception + lockSource = RlvFolderLocks::folderlock_source_t(RlvFolderLocks::ST_SHAREDPATH, LLStringUtil::null); + if (RLV_TYPE_ADD == eType) + gRlvFolderLocks.addFolderLock(lockSource, RlvFolderLocks::PERM_ALLOW, eLockScope, rlvCmd.getObjectID(), eLockType); + else + gRlvFolderLocks.removeFolderLock(lockSource, RlvFolderLocks::PERM_ALLOW, eLockScope, rlvCmd.getObjectID(), eLockType); + } + break; case RLV_BHVR_REDIRCHAT: // @redirchat:=n|y - Checked: 2010-03-26 (RLVa-1.2.0b) | Modified: RLVa-1.1.0h case RLV_BHVR_REDIREMOTE: // @rediremote:=n|y - Checked: 2010-03-26 (RLVa-1.2.0b) | Modified: RLVa-1.1.0h { diff --git a/indra/newview/rlvhelper.cpp b/indra/newview/rlvhelper.cpp index 8dcf50b0be..e34afe7e0e 100644 --- a/indra/newview/rlvhelper.cpp +++ b/indra/newview/rlvhelper.cpp @@ -149,19 +149,19 @@ void RlvCommand::initLookupTable() // NOTE: keep this matched with the enumeration at all times std::string arBehaviours[RLV_BHVR_COUNT] = { - "detach", "attach", "addattach", "remattach", "addoutfit", "remoutfit", "emote", "sendchat", "recvchat", "recvchatfrom", - "recvemote", "recvemotefrom", "redirchat", "rediremote", "chatwhisper", "chatnormal", "chatshout", "sendchannel", - "sendim", "sendimto", "recvim", "recvimfrom", "permissive", "notify", "showinv", "showminimap", "showworldmap", - "showloc", "shownames", "showhovertext", "showhovertexthud", "showhovertextworld", "showhovertextall", - "tplm", "tploc", "tplure", "viewnote", "viewscript", "viewtexture", "acceptpermission", "accepttp", "allowidle", - "displayname", "edit", "editobj", "rez", "fartouch", "interact", "touchobj", "touchattach", "touchattachself", - "touchattachother", "touchhud", "touchworld", "touchall", "fly", "unsit", "sit", "sittp", "standtp", "setdebug", "setenv", - "detachme", "attachover", "attachthis", "attachthisover", "attachthis_except", "detachthis", "detachthis_except", - "attachall", "attachallover", "detachall", "attachallthis", "attachallthis_except", "attachallthisover", - "detachallthis", "detachallthis_except", "tpto", "version", "versionnew", "versionnum", "getattach", "getattachnames", - "getaddattachnames", "getremattachnames", "getoutfit", "getoutfitnames", "getaddoutfitnames", "getremoutfitnames", - "findfolder", "findfolders", "getpath", "getpathnew", "getinv", "getinvworn", "getsitid", "getcommand", - "getstatus", "getstatusall" + "detach", "attach", "addattach", "remattach", "addoutfit", "remoutfit", "sharedwear", "sharedunwear", + "unsharedwear", "unsharedunwear", "emote", "sendchat", "recvchat", "recvchatfrom", "recvemote", "recvemotefrom", + "redirchat", "rediremote", "chatwhisper", "chatnormal", "chatshout", "sendchannel", "sendim", "sendimto", + "recvim", "recvimfrom", "permissive", "notify", "showinv", "showminimap", "showworldmap", "showloc", "shownames", + "showhovertext", "showhovertexthud", "showhovertextworld", "showhovertextall", "tplm", "tploc", "tplure", "viewnote", + "viewscript", "viewtexture", "acceptpermission", "accepttp", "allowidle", "displayname", "edit", "editobj", "rez", + "fartouch", "interact", "touchobj", "touchattach", "touchattachself", "touchattachother", "touchhud", "touchworld", + "touchall", "fly", "unsit", "sit", "sittp", "standtp", "setdebug", "setenv", "detachme", "attachover", "attachthis", + "attachthisover", "attachthis_except", "detachthis", "detachthis_except", "attachall", "attachallover", "detachall", + "attachallthis", "attachallthis_except", "attachallthisover", "detachallthis", "detachallthis_except", "tpto", + "version", "versionnew", "versionnum", "getattach", "getattachnames", "getaddattachnames", "getremattachnames", + "getoutfit", "getoutfitnames", "getaddoutfitnames", "getremoutfitnames", "findfolder", "findfolders", + "getpath", "getpathnew", "getinv", "getinvworn", "getsitid", "getcommand", "getstatus", "getstatusall" }; for (int idxBvhr = 0; idxBvhr < RLV_BHVR_COUNT; idxBvhr++)