From 5a376379b6eeca8ecb709d5415ac130a1a99b4be Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Sat, 7 Nov 2009 16:21:26 -0700 Subject: Applied RLVa-1.0.5e_20091107_Imprudence-1.2.0-diff.patch --- linden/indra/newview/llagent.cpp | 4 +- linden/indra/newview/llfloateropenobject.cpp | 13 +- linden/indra/newview/llinventorybridge.cpp | 159 +++++--- linden/indra/newview/llpanelcontents.cpp | 8 +- linden/indra/newview/llpanelinventory.cpp | 51 ++- linden/indra/newview/llpreviewscript.cpp | 12 +- linden/indra/newview/lltooldraganddrop.cpp | 10 +- linden/indra/newview/llviewerdisplay.cpp | 4 +- linden/indra/newview/llviewermenu.cpp | 106 +++--- linden/indra/newview/llviewertexteditor.cpp | 7 + linden/indra/newview/llvoavatar.cpp | 31 +- linden/indra/newview/llvovolume.cpp | 8 +- linden/indra/newview/pipeline.cpp | 4 +- linden/indra/newview/rlvdefines.h | 21 +- linden/indra/newview/rlvextensions.cpp | 2 +- linden/indra/newview/rlvhandler.cpp | 519 ++++++++++++++------------- linden/indra/newview/rlvhandler.h | 139 ++++--- linden/indra/newview/rlvhelper.cpp | 257 +++++++++++-- linden/indra/newview/rlvhelper.h | 78 +++- 19 files changed, 905 insertions(+), 528 deletions(-) (limited to 'linden') diff --git a/linden/indra/newview/llagent.cpp b/linden/indra/newview/llagent.cpp index 8b118e0..a0ab4ab 100644 --- a/linden/indra/newview/llagent.cpp +++ b/linden/indra/newview/llagent.cpp @@ -7761,7 +7761,7 @@ void LLAgent::userRemoveAllAttachments( void* userdata ) return; } -// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | Added: RLVa-0.2.0c +// [RLVa:KB] - Checked: 2009-10-10 (RLVa-1.0.5a) | Modified: RLVa-1.0.5a // NOTE-RLVa: This function is called from inside RlvHandler as well, hence the rather heavy modifications std::list rlvAttachments; // TODO-RLVa: Once we have the improved "removeWearable" logic implemented we can just get rid of the whole "rlvCompFolders" hassle @@ -7779,7 +7779,7 @@ void LLAgent::userRemoveAllAttachments( void* userdata ) { if (rlv_handler_t::isEnabled()) { - if (!gRlvHandler.isDetachable(curiter->first)) + if (gRlvHandler.isLockedAttachment(curiter->first, RLV_LOCK_REMOVE)) continue; // Check if we're being called in response to an RLV command (that would be @detach=force) diff --git a/linden/indra/newview/llfloateropenobject.cpp b/linden/indra/newview/llfloateropenobject.cpp index fd4f9c6..a83b0c9 100644 --- a/linden/indra/newview/llfloateropenobject.cpp +++ b/linden/indra/newview/llfloateropenobject.cpp @@ -207,18 +207,7 @@ void LLFloaterOpenObject::onClickMoveToInventory(void* data) void LLFloaterOpenObject::onClickMoveAndWear(void* data) { LLFloaterOpenObject* self = (LLFloaterOpenObject*)data; -// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | Deprecated: RLVa-0.2.2a - if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment()) ) - { - // TODO-RLVa: once we have "Add to Outfit" and "Replace Outfit" working we don't need this anymore - self->moveToInventory(false); - } - else - { - self->moveToInventory(true); - } -// [/RLVa:KB] -// self->moveToInventory(true); + self->moveToInventory(true); self->close(); } diff --git a/linden/indra/newview/llinventorybridge.cpp b/linden/indra/newview/llinventorybridge.cpp index 5060d21..f706ad6 100644 --- a/linden/indra/newview/llinventorybridge.cpp +++ b/linden/indra/newview/llinventorybridge.cpp @@ -488,6 +488,20 @@ void LLInvFVBridge::buildContextMenu(LLMenuGL& menu, U32 flags) items.push_back(std::string("Open")); items.push_back(std::string("Properties")); +// [RLVa:KB] - Checked: 2009-10-13 (RLVa-1.0.5c) | Modified: RLVa-1.0.5c + if (rlv_handler_t::isEnabled()) + { + LLInventoryObject* pItem = (mInventoryPanel->getModel()) ? mInventoryPanel->getModel()->getObject(mUUID) : NULL; + if ( (pItem) && + ( ((LLAssetType::AT_NOTECARD == pItem->getType()) && (gRlvHandler.hasBehaviour(RLV_BHVR_VIEWNOTE))) || + ((LLAssetType::AT_LSL_TEXT == pItem->getType()) && (gRlvHandler.hasBehaviour(RLV_BHVR_VIEWSCRIPT))) || + ((LLAssetType::AT_NOTECARD == pItem->getType()) && (gRlvHandler.hasBehaviour(RLV_BHVR_VIEWTEXTURE))) ) ) + { + disabled_items.push_back(std::string("Open")); + } + } +// [/RLVa:KB] + getClipboardEntries(true, items, disabled_items, flags); } hideContextEntries(menu, items, disabled_items); @@ -2446,6 +2460,13 @@ void open_texture(const LLUUID& item_id, const LLUUID& source_id, BOOL take_focus) { +// [RLVa:KB] - Checked: 2009-10-13 (RLVa-1.0.5c) | Added: RLVa-1.0.5c + if (gRlvHandler.hasBehaviour(RLV_BHVR_VIEWTEXTURE)) + { + return; + } +// [/RLVa:KB] + // See if we can bring an exiting preview to the front if( !LLPreview::show( item_id, take_focus ) ) { @@ -3274,11 +3295,11 @@ void LLObjectBridge::performAction(LLFolderView* folder, LLInventoryModel* model item = (LLViewerInventoryItem*)gInventory.getItem(object_id); if(item && gInventory.isObjectDescendentOf(object_id, gAgent.getInventoryRootID())) { -// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) +// [RLVa:KB] - Checked: 2009-10-10 (RLVa-1.0.5a) | Modified: RLVa-1.0.5a // User picked "Wear" so either nothing is locked, or we need to look up the specific attach point from its name // (NOTE: rez_attachment will take care of deciding whether or not we *can* attach) rez_attachment(item, - ((!rlv_handler_t::isEnabled()) || (!gRlvHandler.hasLockedAttachment()) || (RlvSettings::getEnableWear())) + ((!rlv_handler_t::isEnabled()) || (!gRlvHandler.hasLockedAttachment(RLV_LOCK_ANY)) || (RlvSettings::getEnableWear())) ? NULL : gRlvHandler.getAttachPoint(item, true)); // [/RLVa:KB] // rez_attachment(item, NULL); @@ -3301,9 +3322,9 @@ void LLObjectBridge::performAction(LLFolderView* folder, LLInventoryModel* model { LLInventoryItem* item = gInventory.getItem(mUUID); -// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) +// [RLVa:KB] - Checked: 2009-10-10 (RLVa-1.0.5a) | Modified: RLVa-1.0.5a // Fall-through: if there's a "Detach from yourself" code path we missed then we'll still disallow the detach here - if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.isDetachable(item)) ) + if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.isLockedAttachment(item, RLV_LOCK_REMOVE)) ) { return; } @@ -3398,24 +3419,38 @@ void rez_attachment(LLViewerInventoryItem* item, LLViewerJointAttachment* attach rez_action->mAttachPt = attach_pt; if (attachment && attachment->getObject()) { -// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-06 (RLVa-1.0.0c) - if ( (!rlv_handler_t::isEnabled()) || (gRlvHandler.isDetachable(attach_pt)) ) - gViewerWindow->alertXml("ReplaceAttachment", confirm_replace_attachment_rez, (void*)rez_action); - else +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-10-10 (RLVa-1.0.5a) | Modified: RLVa-1.0.5a + if ( (rlv_handler_t::isEnabled()) && // Can't replace an existing object if it's undetachable + (gRlvHandler.isLockedAttachment(attach_pt, RLV_LOCK_ANY)) ) // or if we're not allowed to attach to that attach point + { delete rez_action; -// [/RLVa] -// gViewerWindow->alertXml("ReplaceAttachment", confirm_replace_attachment_rez, (void*)rez_action); + return; + } +// [/RLVa:KB] + gViewerWindow->alertXml("ReplaceAttachment", confirm_replace_attachment_rez, (void*)rez_action); } else { -// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-06 (RLVa-1.0.0c) - // Don't allow wear to default attach point if there are any locked attachments - if ( (!rlv_handler_t::isEnabled()) || (0 != attach_pt) || (!gRlvHandler.hasLockedAttachment()) || (RlvSettings::getEnableWear()) ) - confirm_replace_attachment_rez(0/*YES*/, (void*)rez_action); - else - delete rez_action; -// [/RLVa] -// confirm_replace_attachment_rez(0/*YES*/, (void*)rez_action); +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-10-10 (RLVa-1.0.5) | Modified: RLVa-1.0.5 + if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment(RLV_LOCK_ANY)) ) + { + if (0 == attach_pt) // Can't wear on the default attachment point + { + if (!RlvSettings::getEnableWear()) // (unless "Enable Wear" is enabled) + { + delete rez_action; + return; + } + gRlvHandler.onWearAttachment(item->getUUID()); + } + else if (gRlvHandler.isLockedAttachment(attach_pt, RLV_LOCK_ADD)) // and we can never wear on a non-attachable attach point + { + delete rez_action; + return; + } + } +// [/RLVa:KB] + confirm_replace_attachment_rez(0/*YES*/, (void*)rez_action); } } @@ -3485,9 +3520,12 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { items.push_back(std::string("Detach From Yourself")); -// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) - if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.isDetachable(item)) ) +// [RLVa:KB] - Checked: 2009-10-10 (RLVa-1.0.5a) | Modified: RLVa-1.0.5a + if ( (rlv_handler_t::isEnabled()) && + (gRlvHandler.hasLockedAttachment(RLV_LOCK_REMOVE)) && (gRlvHandler.isLockedAttachment(item, RLV_LOCK_REMOVE)) ) + { disabled_items.push_back(std::string("Detach From Yourself")); + } // [/RLVa:KB] } else @@ -3500,13 +3538,16 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) items.push_back(std::string("RestoreToWorld Separator")); items.push_back(std::string("Restore to Last Position")); -// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-06 (RLVa-1.0.0c) | Modified: RLVa-0.2.0c - // Only enable "Wear" if there is an attach point name *and* there isn't a worn attachment there that's currently locked - if ( (rlv_handler_t::isEnabled()) && (!RlvSettings::getEnableWear()) && (gRlvHandler.hasLockedAttachment()) ) +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-10-10 (RLVa-1.0.5a) | Modified: RLVa-1.0.5a + if ( (rlv_handler_t::isEnabled()) && (!RlvSettings::getEnableWear()) && (gRlvHandler.hasLockedAttachment(RLV_LOCK_ANY)) ) { - LLViewerJointAttachment* pAttachPt = gRlvHandler.getAttachPoint(item, true); - if ( (!pAttachPt) || (!gRlvHandler.isDetachable(pAttachPt)) ) + LLViewerJointAttachment* pAttachPt = gRlvHandler.getAttachPoint(item, true); // The item's name should specify + if ( (!pAttachPt) || // an attachment point that + (gRlvHandler.isLockedAttachment(pAttachPt->getObject(), RLV_LOCK_REMOVE)) || // doesn't have an undetachable object + (gRlvHandler.isLockedAttachment(pAttachPt, RLV_LOCK_ADD)) ) // and that can be attached to + { disabled_items.push_back(std::string("Object Wear")); + } } // [/RLVa:KB] @@ -3609,6 +3650,13 @@ LLUIImagePtr LLLSLTextBridge::getIcon() const void LLLSLTextBridge::openItem() { +// [RLVa:KB] - Checked: 2009-10-13 (RLVa-1.0.5c) | Modified: RLVa-1.0.5c + if (gRlvHandler.hasBehaviour(RLV_BHVR_VIEWSCRIPT)) + { + return; + } +// [/RLVa:KB] + // See if we can bring an exiting preview to the front if(!LLPreview::show(mUUID)) { @@ -4050,15 +4098,26 @@ void wear_inventory_category_on_avatar_step2( BOOL proceed, void* userdata ) is_gesture); S32 gest_count = gest_item_array.count(); -// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-06 (RLVa-1.0.0c) | Modified: RLVa-1.0.0c - if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment()) && (!RlvSettings::getEnableWear()) ) +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-10-10 (RLVa-1.0.5a) | Modified: RLVa-1.0.5a + if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment(RLV_LOCK_ANY)) ) { - // Filter anything that doesn't specify an attachment point (or that specifies one that's currently locked) + // Filter anything that we shouldn't be attaching for (S32 idxObj = obj_item_array.count() - 1; idxObj >= 0; idxObj--) { - LLViewerJointAttachment* pAttachPt = gRlvHandler.getAttachPoint(obj_item_array.get(idxObj).get(), true); - if ( ((!pAttachPt) || (!gRlvHandler.isDetachable(pAttachPt))) ) - obj_item_array.remove(idxObj); + if (!RlvSettings::getEnableWear()) + { + LLViewerJointAttachment* pAttachPt = gRlvHandler.getAttachPoint(obj_item_array.get(idxObj).get(), true); + if ( (!pAttachPt) || // Item should specify attachpt that + (gRlvHandler.isLockedAttachment(pAttachPt->getObject(), RLV_LOCK_REMOVE)) || // doesn't have an undetachable object + (gRlvHandler.isLockedAttachment(pAttachPt, RLV_LOCK_ADD)) ) // and that is attachable + { + obj_item_array.remove(idxObj); + } + } + else + { + gRlvHandler.onWearAttachment(obj_item_array.get(idxObj)->getUUID()); + } } obj_count = obj_item_array.count(); } @@ -4241,15 +4300,26 @@ void wear_attachments_on_avatar(const std::set& item_ids, BOOL remove) { if ( (gInventory.isObjectDescendentOf(*it, gAgent.getInventoryRootID())) ) { -// items.put(item); -// [RLVa:KB] - Checked: 2009-09-11 (RLVa-1.0.2c) | Modified: RLVa-1.0.2c - LLViewerJointAttachment* pAttachPt = NULL; - if ( (!rlv_handler_t::isEnabled()) || (RlvSettings::getEnableWear()) || (!gRlvHandler.hasLockedAttachment()) || - (((pAttachPt = gRlvHandler.getAttachPoint(item, true)) != NULL) && (gRlvHandler.isDetachable(pAttachPt))) ) +// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-10-15 (RLVa-1.0.5e) | Modified: RLVa-1.0.5e + if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment(RLV_LOCK_ANY)) ) { - items.put(item); + if (!RlvSettings::getEnableWear()) + { + LLViewerJointAttachment* pAttachPt = NULL; + if ( ((pAttachPt = gRlvHandler.getAttachPoint(item, true)) == NULL) || // Item should specify attachpt that + (gRlvHandler.isLockedAttachment(pAttachPt->getObject(), RLV_LOCK_REMOVE)) || // doesn't have an undetachable object + (gRlvHandler.isLockedAttachment(pAttachPt, RLV_LOCK_ADD)) ) // and that is attachable + { + continue; + } + } + else + { + gRlvHandler.onWearAttachment(item->getUUID()); + } } // [/RLVa:KB] + items.put(item); } else if ( (item->isComplete()) ) { @@ -4309,9 +4379,9 @@ void wear_attachments_on_avatar(const LLInventoryModel::item_array_t& items, BOO msg->addUUIDFast(_PREHASH_CompoundMsgID, compound_msg_id ); msg->addU8Fast(_PREHASH_TotalObjects, count ); // msg->addBOOLFast(_PREHASH_FirstDetachAll, remove ); -// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | Added: RLVa-0.2.2a +// [RLVa:KB] - Checked: 2009-10-10 (RLVa-1.0.5a) | Added: RLVa-1.0.5a // This really should just *always* be FALSE since TRUE can result in loss of the current asset state - msg->addBOOLFast(_PREHASH_FirstDetachAll, remove && (!gRlvHandler.hasLockedAttachment()) ); + msg->addBOOLFast(_PREHASH_FirstDetachAll, remove && (!gRlvHandler.hasLockedAttachment(RLV_LOCK_ANY)) ); // [/RLVa:KB] } @@ -4320,9 +4390,9 @@ void wear_attachments_on_avatar(const LLInventoryModel::item_array_t& items, BOO msg->addUUIDFast(_PREHASH_ItemID, item->getUUID() ); msg->addUUIDFast(_PREHASH_OwnerID, item->getPermissions().getOwner()); // msg->addU8Fast(_PREHASH_AttachmentPt, 0 ); // Wear at the previous or default attachment point -// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | Added: RLVa-0.2.2a +// [RLVa:KB] - Checked: 2009-10-10 (RLVa-1.0.5a) | Added: RLVa-1.0.5a msg->addU8Fast(_PREHASH_AttachmentPt, - ( (!rlv_handler_t::isEnabled()) || (RlvSettings::getEnableWear()) || (!gRlvHandler.hasLockedAttachment()) ) + ( (!rlv_handler_t::isEnabled()) || (RlvSettings::getEnableWear()) || (!gRlvHandler.hasLockedAttachment(RLV_LOCK_ANY)) ) ? 0 : gRlvHandler.getAttachPointIndex(gRlvHandler.getAttachPoint(item, true))); // [/RLVa:KB] @@ -4428,13 +4498,12 @@ void remove_inventory_category_from_avatar_step2( BOOL proceed, void* userdata) { for(i = 0; i < obj_count; ++i) { -// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | Modified: RLVa-0.2.2a - // TODO-RLVa: is there a reason why LL doesn't bother checking to see if you're actually wearing the object? - if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment()) ) +// [RLVa:KB] - Checked: 2009-10-10 (RLVa-1.0.5a) | Modified: RLVa-1.0.5a + if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment(RLV_LOCK_REMOVE)) ) { LLVOAvatar* pAvatar = gAgent.getAvatarObject(); if ( (!pAvatar) || (!pAvatar->isWearingAttachment(obj_item_array.get(i)->getUUID())) || - (!gRlvHandler.isDetachable(obj_item_array.get(i).get())) ) // Why does LLPointer have a cast to BOOL aka S32??? + (gRlvHandler.isLockedAttachment(obj_item_array.get(i).get(), RLV_LOCK_REMOVE)) ) { continue; } diff --git a/linden/indra/newview/llpanelcontents.cpp b/linden/indra/newview/llpanelcontents.cpp index e13ec46..6462d44 100644 --- a/linden/indra/newview/llpanelcontents.cpp +++ b/linden/indra/newview/llpanelcontents.cpp @@ -121,11 +121,11 @@ void LLPanelContents::getState(LLViewerObject *objectp ) && ( objectp->permYouOwner() || ( !group_id.isNull() && gAgent.isInGroup(group_id) ))); // solves SL-23488 BOOL all_volume = LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME ); -// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-06 (RLVa-1.0.0c) | Modified: RLVa-0.2.0g +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-10-10 (RLVa-1.0.5a) | Modified: RLVa-1.0.5a if ( (rlv_handler_t::isEnabled()) && (editable) ) { // Don't allow creation of new scripts if it's undetachable - editable = gRlvHandler.isDetachable(objectp); + editable = !gRlvHandler.isLockedAttachment(objectp, RLV_LOCK_REMOVE); // Don't allow creation of new scripts if we're @unsit=n or @sittp=n restricted and we're sitting on the selection if ( (editable) && ((gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) || (gRlvHandler.hasBehaviour(RLV_BHVR_SITTP))) ) @@ -182,10 +182,10 @@ void LLPanelContents::onClickNewScript(void *userdata) LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getFirstRootObject(children_ok); if(object) { -// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) +// [RLVa:KB] - Checked: 2009-10-10 (RLVa-1.0.5a) if (rlv_handler_t::isEnabled()) // Fallback code [see LLPanelContents::getState()] { - if (!gRlvHandler.isDetachable(object)) + if (gRlvHandler.isLockedAttachment(object, RLV_LOCK_REMOVE)) { return; // Disallow creating new scripts in a locked attachment } diff --git a/linden/indra/newview/llpanelinventory.cpp b/linden/indra/newview/llpanelinventory.cpp index 0ae2aec..d45b9d5 100644 --- a/linden/indra/newview/llpanelinventory.cpp +++ b/linden/indra/newview/llpanelinventory.cpp @@ -368,9 +368,9 @@ void LLTaskInvFVBridge::previewItem() BOOL LLTaskInvFVBridge::isItemRenameable() const { -// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) +// [RLVa:KB] - Checked: 2009-10-10 (RLVa-1.0.5a) | Modified: RLVa-1.0.5a LLViewerObject* object = gObjectList.findObject(mPanel->getTaskUUID()); - if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.isDetachable(object)) ) + if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.isLockedAttachment(object, RLV_LOCK_REMOVE)) ) { return FALSE; } @@ -394,8 +394,8 @@ BOOL LLTaskInvFVBridge::isItemRenameable() const BOOL LLTaskInvFVBridge::renameItem(const std::string& new_name) { LLViewerObject* object = gObjectList.findObject(mPanel->getTaskUUID()); -// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) - if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.isDetachable(object)) ) +// [RLVa:KB] - Checked: 2009-10-10 (RLVa-1.0.5a) | Modified: RLVa-1.0.5a + if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.isLockedAttachment(object, RLV_LOCK_REMOVE)) ) { return TRUE; // Fallback code [see LLTaskInvFVBridge::isItemRenameable()] } @@ -426,13 +426,13 @@ BOOL LLTaskInvFVBridge::isItemMovable() // return TRUE; //} //return FALSE; -// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | Modified: RLVa-0.2.0g +// [RLVa:KB] - Checked: 2009-10-10 (RLVa-1.0.5a) | Modified: RLVa-1.0.5a if (rlv_handler_t::isEnabled()) { LLViewerObject* pObj = gObjectList.findObject(mPanel->getTaskUUID()); if (pObj) { - if (!gRlvHandler.isDetachable(pObj)) + if (gRlvHandler.isLockedAttachment(pObj, RLV_LOCK_REMOVE)) { return FALSE; } @@ -451,10 +451,10 @@ BOOL LLTaskInvFVBridge::isItemMovable() BOOL LLTaskInvFVBridge::isItemRemovable() { LLViewerObject* object = gObjectList.findObject(mPanel->getTaskUUID()); -// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | Modified: RLVa-0.2.0g +// [RLVa:KB] - Checked: 2009-10-10 (RLVa-1.0.5a) | Modified: RLVa-1.0.5a if ( (object) && (rlv_handler_t::isEnabled()) ) { - if (!gRlvHandler.isDetachable(object)) + if (gRlvHandler.isLockedAttachment(object, RLV_LOCK_REMOVE)) { return FALSE; } @@ -611,9 +611,9 @@ BOOL LLTaskInvFVBridge::startDrag(EDragAndDropType* type, LLUUID* id) const const LLPermissions& perm = inv->getPermissions(); bool can_copy = gAgent.allowOperation(PERM_COPY, perm, GP_OBJECT_MANIPULATE); -// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) +// [RLVa:KB] - Checked: 2009-10-10 (RLVa-1.0.5a) | Modified: RLVa-1.0.5a // Kind of redundant due to the note below, but in case that ever gets fixed - if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.isDetachable(object)) ) + if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.isLockedAttachment(object, RLV_LOCK_REMOVE)) ) { return FALSE; } @@ -735,12 +735,16 @@ void LLTaskInvFVBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { disabled_items.push_back(std::string("Task Open")); } -// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) - else if ( (rlv_handler_t::isEnabled()) && - ((LLAssetType::AT_LSL_TEXT == item->getType()) || (LLAssetType::AT_NOTECARD == item->getType())) && - (!gRlvHandler.isDetachable(gObjectList.findObject(mPanel->getTaskUUID()))) ) +// [RLVa:KB] - Checked: 2009-10-13 (RLVa-1.0.5c) | Modified: RLVa-1.0.5c + else if (rlv_handler_t::isEnabled()) { - disabled_items.push_back(std::string("Task Open")); + bool fLocked = gRlvHandler.isLockedAttachment(gObjectList.findObject(mPanel->getTaskUUID()), RLV_LOCK_REMOVE); + if ( ((LLAssetType::AT_LSL_TEXT == item->getType()) && ((gRlvHandler.hasBehaviour(RLV_BHVR_VIEWSCRIPT)) || (fLocked))) || + ((LLAssetType::AT_NOTECARD == item->getType()) && ((gRlvHandler.hasBehaviour(RLV_BHVR_VIEWNOTE)) || (fLocked))) || + ((LLAssetType::AT_NOTECARD == item->getType()) && (gRlvHandler.hasBehaviour(RLV_BHVR_VIEWTEXTURE))) ) + { + disabled_items.push_back(std::string("Task Open")); + } } // [/RLVa:KB] } @@ -967,6 +971,13 @@ LLUIImagePtr LLTaskTextureBridge::getIcon() const void LLTaskTextureBridge::openItem() { +// [RLVa:KB] - Checked: 2009-10-13 (RLVa-1.0.5c) | Added: RLVa-1.0.5c + if (gRlvHandler.hasBehaviour(RLV_BHVR_VIEWTEXTURE)) + { + return; + } +// [/RLVa:KB] + llinfos << "LLTaskTextureBridge::openItem()" << llendl; if(!LLPreview::show(mUUID)) { @@ -1248,9 +1259,10 @@ LLTaskLSLBridge::LLTaskLSLBridge( void LLTaskLSLBridge::openItem() { -// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) +// [RLVa:KB] - Checked: 2009-10-13 (RLVa-1.0.5c) | Modified: RLVa-1.0.5c LLViewerObject* object = gObjectList.findObject(mPanel->getTaskUUID()); - if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.isDetachable(object)) ) + if ( (rlv_handler_t::isEnabled()) && + ((gRlvHandler.hasBehaviour(RLV_BHVR_VIEWSCRIPT)) || (gRlvHandler.isLockedAttachment(object, RLV_LOCK_REMOVE))) ) { return; } @@ -1376,8 +1388,9 @@ void LLTaskNotecardBridge::openItem() { return; } -// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) - if ( (rlv_handler_t::isEnabled()) && ((gRlvHandler.hasBehaviour(RLV_BHVR_VIEWNOTE)) || (!gRlvHandler.isDetachable(object))) ) +// [RLVa:KB] - Checked: 2009-10-10 (RLVa-1.0.5a) | Modified: RLVa-1.0.5a + if ( (rlv_handler_t::isEnabled()) && + ( (gRlvHandler.hasBehaviour(RLV_BHVR_VIEWNOTE)) || (gRlvHandler.isLockedAttachment(object, RLV_LOCK_REMOVE)) ) ) { return; } diff --git a/linden/indra/newview/llpreviewscript.cpp b/linden/indra/newview/llpreviewscript.cpp index 6273011..69b6864 100644 --- a/linden/indra/newview/llpreviewscript.cpp +++ b/linden/indra/newview/llpreviewscript.cpp @@ -1989,8 +1989,8 @@ void LLLiveLSLEditor::onRunningCheckboxClicked( LLUICtrl*, void* userdata ) LLCheckBoxCtrl* runningCheckbox = self->getChild("running"); BOOL running = runningCheckbox->get(); //self->mRunningCheckbox->get(); -// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) - if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.isDetachable(object)) ) +// [RLVa:KB] - Checked: 2009-10-10 (RLVa-1.0.5a) | Modified: RLVa-1.0.5a + if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.isLockedAttachment(object, RLV_LOCK_REMOVE)) ) { return; } @@ -2020,8 +2020,8 @@ void LLLiveLSLEditor::onReset(void *userdata) LLLiveLSLEditor* self = (LLLiveLSLEditor*) userdata; LLViewerObject* object = gObjectList.findObject( self->mObjectID ); -// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) - if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.isDetachable(object)) ) +// [RLVa:KB] - Checked: 2009-10-10 (RLVa-1.0.5a) | Modified: RLVa-1.0.5a + if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.isLockedAttachment(object, RLV_LOCK_REMOVE)) ) { return; } @@ -2448,8 +2448,8 @@ void LLLiveLSLEditor::onSave(void* userdata, BOOL close_after_save) { LLLiveLSLEditor* self = (LLLiveLSLEditor*)userdata; -// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) - if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.isDetachable(gObjectList.findObject(self->mObjectID))) ) +// [RLVa:KB] - Checked: 2009-10-10 (RLVa-1.0.5a) | Modified: RLVa-1.0.5a + if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.isLockedAttachment(gObjectList.findObject(self->mObjectID), RLV_LOCK_REMOVE)) ) { return; } diff --git a/linden/indra/newview/lltooldraganddrop.cpp b/linden/indra/newview/lltooldraganddrop.cpp index 178bde6..c0fa28c 100644 --- a/linden/indra/newview/lltooldraganddrop.cpp +++ b/linden/indra/newview/lltooldraganddrop.cpp @@ -1946,7 +1946,7 @@ EAcceptance LLToolDragAndDrop::willObjectAcceptInventory(LLViewerObject* obj, LL // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) if (rlv_handler_t::isEnabled()) { - if (!gRlvHandler.isDetachable(obj)) + if (gRlvHandler.isLockedAttachment(obj, RLV_LOCK_REMOVE)) { return ACCEPT_NO_LOCKED; // Disallow inventory drops on a locked attachment } @@ -2014,10 +2014,12 @@ EAcceptance LLToolDragAndDrop::dad3dRezAttachmentFromInv( return ACCEPT_NO; } -// [RLVa:KB] - Checked: 2009-09-08 (RLVa-1.0.2c) | Modified: RLVa-1.0.2c +// [RLVa:KB] - Checked: 2009-10-10 (RLVa-1.0.5) | Modified: RLVa-1.0.5 LLViewerJointAttachment* pAttachPt = NULL; - if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment()) && (!RlvSettings::getEnableWear()) && - ( ((pAttachPt = gRlvHandler.getAttachPoint(item, true)) == NULL) || (!gRlvHandler.isDetachable(pAttachPt)) ) ) + if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment(RLV_LOCK_ANY)) && (!RlvSettings::getEnableWear()) && + ( ((pAttachPt = gRlvHandler.getAttachPoint(item, true)) == NULL) || // Item should specify an attachpt that + (gRlvHandler.isLockedAttachment(pAttachPt->getObject(), RLV_LOCK_REMOVE)) || // doesn't have an undetachable object + (gRlvHandler.isLockedAttachment(pAttachPt, RLV_LOCK_ADD)) ) ) // and that is attachable { return ACCEPT_NO_LOCKED; } diff --git a/linden/indra/newview/llviewerdisplay.cpp b/linden/indra/newview/llviewerdisplay.cpp index 4b352a4..77d2509 100644 --- a/linden/indra/newview/llviewerdisplay.cpp +++ b/linden/indra/newview/llviewerdisplay.cpp @@ -676,8 +676,8 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) } // if(gUseWireframe) -// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) - if ( (gUseWireframe) && ( (!rlv_handler_t::isEnabled()) || (!gRlvHandler.hasLockedAttachment()) ) ) +// [RLVa:KB] - Checked: 2009-10-10 (RLVa-1.0.5a) | Modified: RLVa-1.0.5a + if ( (gUseWireframe) && ( (!rlv_handler_t::isEnabled()) || (!gRlvHandler.hasLockedAttachment(RLV_LOCK_REMOVE)) ) ) // [/RLVa:KB] { glClearColor(0.5f, 0.5f, 0.5f, 0.f); diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp index 4732046..ecf6fcb 100644 --- a/linden/indra/newview/llviewermenu.cpp +++ b/linden/indra/newview/llviewermenu.cpp @@ -2146,8 +2146,9 @@ class LLSelfEnableRemoveAllAttachments : public view_listener_t LLVOAvatar::attachment_map_t::iterator curiter = iter++; LLViewerJointAttachment* attachment = curiter->second; // if (attachment->getObject()) -// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | Modified: RLVa-0.2.0c - if ( (attachment->getObject()) && ( (!rlv_handler_t::isEnabled()) || (gRlvHandler.isDetachable(curiter->first)) ) ) +// [RLVa:KB] - Checked: 2009-10-10 (RLVa-1.0.5a) | Modified: RLVa-1.0.5a + if ( (attachment->getObject()) && + ((!rlv_handler_t::isEnabled()) || (!gRlvHandler.isLockedAttachment(curiter->first, RLV_LOCK_REMOVE))) ) // [/RLVa:KB] { new_value = true; @@ -2387,7 +2388,7 @@ class LLObjectImportUpload : public view_listener_t bool handle_go_to_confirm() { // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) - if ( (rlv_handler_t::isEnabled()) && gAgent.forwardGrabbed() && (gRlvHandler.hasLockedAttachment()) ) + if ( (rlv_handler_t::isEnabled()) && (gAgent.forwardGrabbed()) && (gRlvHandler.hasLockedAttachment(RLV_LOCK_REMOVE)) ) { return true; } @@ -2410,12 +2411,12 @@ bool handle_go_to_confirm() bool handle_go_to() { -// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) - if ( (rlv_handler_t::isEnabled()) && gAgent.forwardGrabbed() && (gRlvHandler.hasLockedAttachment()) ) - { - return true; - } -// [/RLVa:KB] +// [RLVa:KB] - Checked: 2009-10-10 (RLVa-1.0.5a) | Modified: RLVa-1.0.5a + if ( (rlv_handler_t::isEnabled()) && (gAgent.forwardGrabbed()) && (gRlvHandler.hasLockedAttachment(RLV_LOCK_REMOVE)) ) + { + return true; + } + // [/RLVa:KB] handle_go_to_callback( 0, (void*)LLToolPie::getInstance() ); @@ -4737,8 +4738,8 @@ class LLToolsReleaseKeys : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { -// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) - if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment()) ) +// [RLVa:KB] - Checked: 2009-10-10 (RLVa-1.0.5a) | Modified: RLVa-1.0.5a + if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment(RLV_LOCK_REMOVE)) ) { return true; } @@ -4754,9 +4755,9 @@ class LLToolsEnableReleaseKeys : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { -// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) +// [RLVa:KB] - Checked: 2009-10-10 (RLVa-1.0.5a) | Modified: RLVa-1.0.5a gMenuHolder->findControl(userdata["control"].asString())->setValue( - gAgent.anyControlGrabbed() && ( (!rlv_handler_t::isEnabled()) || (!gRlvHandler.hasLockedAttachment() ) ) ); + gAgent.anyControlGrabbed() && ( (!rlv_handler_t::isEnabled()) || (!gRlvHandler.hasLockedAttachment(RLV_LOCK_REMOVE) ) ) ); // [/RLVa:KB] //gMenuHolder->findControl(userdata["control"].asString())->setValue( gAgent.anyControlGrabbed() ); return true; @@ -6070,11 +6071,13 @@ private: if (index > 0) attachment_point = get_if_there(gAgent.getAvatarObject()->mAttachmentPoints, index, (LLViewerJointAttachment*)NULL); -// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) +// [RLVa:KB] - Checked: 2009-10-10 (RLVa-1.0.5a) | Modified: RLVa-1.0.5a if ( (rlv_handler_t::isEnabled()) && - ( ((index == 0) && (gRlvHandler.hasLockedAttachment())) || // Can't wear on default attach point - ((index > 0) && (!gRlvHandler.isDetachable(attachment_point))) || // Can't replace locked attachment - (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) ) ) // Attach on rezzed object == "Take" + ( ((index == 0) && (gRlvHandler.hasLockedAttachment(RLV_LOCK_ANY))) || // Can't wear on default attach point + ((index > 0) && // or replace a locked attachment + ((gRlvHandler.isLockedAttachment(attachment_point->getObject(), RLV_LOCK_REMOVE)) || + (gRlvHandler.isLockedAttachment(attachment_point, RLV_LOCK_ADD)) ) ) || // or wear on a non-attachable attach point + (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) ) ) // Attach on rezzed object == "Take" { setObjectSelection(NULL); // Clear the selection or it'll get stuck return true; @@ -6188,15 +6191,15 @@ class LLAttachmentDrop : public view_listener_t return true; } -// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) +// [RLVa:KB] - Checked: 2009-10-10 (RLVa-1.0.5a) | Modified: RLVa-1.0.5a if (rlv_handler_t::isEnabled()) { - if (gRlvHandler.hasLockedAttachment()) + if (gRlvHandler.hasLockedAttachment(RLV_LOCK_REMOVE)) { // NOTE: copy/paste of the code in enable_detach() - LLObjectSelectionHandle hSelect = LLSelectMgr::getInstance()->getSelection(); - RlvSelectHasLockedAttach functor; - if ( (hSelect->isAttachment()) && (hSelect->getFirstRootNode(&functor, FALSE)) ) + LLObjectSelectionHandle hSelection = LLSelectMgr::getInstance()->getSelection(); + RlvSelectHasLockedAttach functor(RLV_LOCK_REMOVE); + if ( (hSelection->isAttachment()) && (hSelection->getFirstRootNode(&functor, FALSE)) ) return true; } else if (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) @@ -6224,8 +6227,8 @@ void handle_detach_from_avatar(void* user_data) if (attached_object) { -// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | Modified: RLVa-0.2.0d - if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.isDetachable(attached_object)) ) +// [RLVa:KB] - Checked: 2009-10-10 (RLVa-1.0.5a) | Modified: RLVa-1.0.5a + if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.isLockedAttachment(attached_object, RLV_LOCK_REMOVE)) ) { return; } @@ -6313,12 +6316,12 @@ class LLAttachmentDetach : public view_listener_t return true; } -// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) +// [RLVa:KB] - Checked: 2009-10-10 (RLVa-1.0.5) | Modified: RLVa-1.0.5 // NOTE: copy/paste of the code in enable_detach() - if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment()) ) + if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment(RLV_LOCK_REMOVE)) ) { LLObjectSelectionHandle hSelect = LLSelectMgr::getInstance()->getSelection(); - RlvSelectHasLockedAttach functor; + RlvSelectHasLockedAttach functor(RLV_LOCK_REMOVE); if ( (hSelect->isAttachment()) && (hSelect->getFirstRootNode(&functor, FALSE)) ) return FALSE; } @@ -6431,16 +6434,16 @@ BOOL enable_detach(void*) // ...if it's you, good to detach if (avatar->getID() == gAgent.getID()) { -// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) +// [RLVa:KB] - Checked: 2009-10-10 (RLVa-1.0.5) | Modified: RLVa-1.0.5 // NOTE: this code is reused as-is in LLAttachmentDetach::handleEvent() and LLAttachmentDrop::handleEvent() - // so any changes here should be reflected there as well (I think it's in a number of other places as well by now) + // so any changes here should be reflected there as well // RELEASE-RLVa: LLSelectMgr::sendDetach() and LLSelectMgr::sendDropAttachment() call sendListToRegions with // SEND_ONLY_ROOTS so we only need to examine the roots which saves us time - if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment()) ) + if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment(RLV_LOCK_REMOVE)) ) { LLObjectSelectionHandle hSelect = LLSelectMgr::getInstance()->getSelection(); - RlvSelectHasLockedAttach functor; + RlvSelectHasLockedAttach functor(RLV_LOCK_REMOVE); if ( (hSelect->isAttachment()) && (hSelect->getFirstRootNode(&functor, FALSE)) ) return FALSE; } @@ -6467,7 +6470,7 @@ class LLAttachmentEnableDetach : public view_listener_t // Used to tell if the selected object can be attached to your avatar. BOOL object_selected_and_point_valid(void *user_data) { -// [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) +// [RLVa:KB] - Checked: 2009-10-10 (RLVa-1.0.5) | Modified: RLVa-1.0.5 if (rlv_handler_t::isEnabled()) { // RELEASE-RLVa: look at the caller graph for this function on every new release @@ -6477,9 +6480,11 @@ BOOL object_selected_and_point_valid(void *user_data) // - enabler set up in LLVOAvatar::buildCharacter() => Rezzed prim / right-click / "Attach >" [user_data == pAttachPt] // - enabler set up in LLVOAvatar::buildCharacter() => Rezzed prim / Edit menu / "Attach Object" [user_data == pAttachPt] LLViewerJointAttachment* pAttachPt = (LLViewerJointAttachment*)user_data; - if ( ((!pAttachPt) && (gRlvHandler.hasLockedAttachment())) || // Don't allow attach to default attach point - ((pAttachPt) && (!gRlvHandler.isDetachable(pAttachPt))) || // Don't allow replacing of locked attachment - (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) ) // Attaching a rezzed object == "Take" + if ( ( (!pAttachPt) && (gRlvHandler.hasLockedAttachment(RLV_LOCK_ANY)) ) || // Don't allow attach to default attach point + ( (pAttachPt) && // Don't allow replacing of a locked attachment + ( (gRlvHandler.isLockedAttachment(pAttachPt->getObject(), RLV_LOCK_REMOVE)) || + (gRlvHandler.isLockedAttachment(pAttachPt, RLV_LOCK_ADD)) ) ) || // or wear on a non-attachable attach point + (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) ) // Attaching a rezzed object == "Take" { return FALSE; } @@ -6556,7 +6561,7 @@ BOOL object_attached(void *user_data) // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) return ( (attachment->getObject() != NULL) && - ( (!rlv_handler_t::isEnabled()) || (gRlvHandler.isDetachable(attachment->getObject())) ) + ( (!rlv_handler_t::isEnabled()) || (!gRlvHandler.isLockedAttachment(attachment->getObject(), RLV_LOCK_REMOVE)) ) ); // [/RLVa:KB] // return attachment->getObject() != NULL; @@ -6708,12 +6713,13 @@ class LLToolsSelectedScriptAction : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { -// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) - if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment()) ) +// [RLVa:KB] - Checked: 2009-10-10 (RLVa-1.0.5a) | Modified: RLVa-1.0.5a + // We'll allow resetting the scripts of objects on a non-attachable attach point since they wouldn't be able to circumvent anything + if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment(RLV_LOCK_REMOVE)) ) { - LLObjectSelectionHandle selectHandle = LLSelectMgr::getInstance()->getSelection(); - RlvSelectHasLockedAttach functor; - if ( (selectHandle->isAttachment()) && (selectHandle->getFirstNode(&functor)) ) + LLObjectSelectionHandle hSelection = LLSelectMgr::getInstance()->getSelection(); + RlvSelectHasLockedAttach functor(RLV_LOCK_REMOVE); + if ( (hSelection->isAttachment()) && (hSelection->getFirstNode(&functor)) ) return true; } // [/RLVa:KB] @@ -6802,9 +6808,9 @@ void handle_dump_image_list(void*) void handle_test_male(void*) { -// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) +// [RLVa:KB] - Checked: 2009-10-10 (RLVa-1.0.5a) | Modified: RLVa-1.0.5a if ( (rlv_handler_t::isEnabled()) && - ( (gRlvHandler.hasLockedAttachment()) || + ( (gRlvHandler.hasLockedAttachment(RLV_LOCK_ANY)) || (gRlvHandler.hasBehaviour(RLV_BHVR_ADDOUTFIT)) || (gRlvHandler.hasBehaviour(RLV_BHVR_REMOUTFIT)) ) ) { return; @@ -6817,9 +6823,9 @@ void handle_test_male(void*) void handle_test_female(void*) { -// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) +// [RLVa:KB] - Checked: 2009-10-10 (RLVa-1.0.5a) | Modified: RLVa-1.0.5a if ( (rlv_handler_t::isEnabled()) && - ( (gRlvHandler.hasLockedAttachment()) || + ( (gRlvHandler.hasLockedAttachment(RLV_LOCK_ANY)) || (gRlvHandler.hasBehaviour(RLV_BHVR_ADDOUTFIT)) || (gRlvHandler.hasBehaviour(RLV_BHVR_REMOUTFIT)) ) ) { return; @@ -6968,16 +6974,16 @@ BOOL enable_more_than_one_selected(void* ) static bool is_editable_selected() { -// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | Modified: RLVa-1.0.0c +// [RLVa:KB] - Checked: 2009-10-10 (RLVa-1.0.5a) | Modified: RLVa-1.0.5a // RELEASE-RLVa: check that this still isn't called by anything but script actions in the Tools menu - if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment()) ) + if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment(RLV_LOCK_REMOVE)) ) { - LLObjectSelectionHandle selectHandle = LLSelectMgr::getInstance()->getSelection(); + LLObjectSelectionHandle hSelection = LLSelectMgr::getInstance()->getSelection(); // NOTE: this is called for 5 different menu items so we'll trade accuracy for efficiency and only // examine root nodes (LLToolsSelectedScriptAction::handleEvent() will catch what we miss) - RlvSelectHasLockedAttach functor; - if ( (selectHandle->isAttachment()) && (selectHandle->getFirstRootNode(&functor)) ) + RlvSelectHasLockedAttach functor(RLV_LOCK_REMOVE); + if ( (hSelection->isAttachment()) && (hSelection->getFirstRootNode(&functor)) ) { return false; } diff --git a/linden/indra/newview/llviewertexteditor.cpp b/linden/indra/newview/llviewertexteditor.cpp index 8f4a944..c8b8fec 100644 --- a/linden/indra/newview/llviewertexteditor.cpp +++ b/linden/indra/newview/llviewertexteditor.cpp @@ -1364,6 +1364,13 @@ BOOL LLViewerTextEditor::openEmbeddedItem(LLInventoryItem* item) void LLViewerTextEditor::openEmbeddedTexture( LLInventoryItem* item ) { +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-10-13 (RLVa-1.0.5c) | Added: RLVa-1.0.5c + if (gRlvHandler.hasBehaviour(RLV_BHVR_VIEWTEXTURE)) + { + return; + } +// [/RLVa:KB] + // See if we can bring an existing preview to the front // *NOTE: Just for embedded Texture , we should use getAssetUUID(), // not getUUID(), because LLPreviewTexture pass in AssetUUID into diff --git a/linden/indra/newview/llvoavatar.cpp b/linden/indra/newview/llvoavatar.cpp index 4ab14f4..df07701 100644 --- a/linden/indra/newview/llvoavatar.cpp +++ b/linden/indra/newview/llvoavatar.cpp @@ -6451,37 +6451,10 @@ BOOL LLVOAvatar::attachObject(LLViewerObject *viewer_object) { updateAttachmentVisibility(gAgent.getCameraMode()); -// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) +// [RLVa:KB] - Checked: 2009-10-10 (RLVa-1.0.5a) | Modified: RLVa-1.0.5a if (rlv_handler_t::isEnabled()) { - static bool fRlvFullyLoaded = false; - static LLFrameTimer* pRlvFullyLoadedTimer = NULL; - - // There's no way to know when we're done reattaching what was attached at log-off but this ugly evil bad hack tries anyway - if (!fRlvFullyLoaded) - { - if (pRlvFullyLoadedTimer) - { - if (pRlvFullyLoadedTimer->getElapsedTimeF32() > 30.0f) - { - fRlvFullyLoaded = true; - delete pRlvFullyLoadedTimer; - pRlvFullyLoadedTimer = NULL; - } - else - { - pRlvFullyLoadedTimer->reset(); - } - } - else if ( (!pRlvFullyLoadedTimer) && - ( (0 == mPendingAttachment.size()) || - ((1 == mPendingAttachment.size()) && (mPendingAttachment[0] == viewer_object)) ) ) - { - pRlvFullyLoadedTimer = new LLFrameTimer(); - } - } - - gRlvHandler.onAttach(attachment, fRlvFullyLoaded); + gRlvHandler.onAttach(attachment); } // [/RLVa:KB] diff --git a/linden/indra/newview/llvovolume.cpp b/linden/indra/newview/llvovolume.cpp index adf82cd..7b151e8 100644 --- a/linden/indra/newview/llvovolume.cpp +++ b/linden/indra/newview/llvovolume.cpp @@ -1943,9 +1943,9 @@ BOOL LLVOVolume::lineSegmentIntersect(const LLVector3& start, const LLVector3& e { if (!mbCanSelect || // (gHideSelectedObjects && isSelected()) || -// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) +// [RLVa:KB] - Checked: 2009-10-10 (RLVa-1.0.5a) | Modified: RLVa-1.0.5a ( (gHideSelectedObjects && isSelected()) && - ((!rlv_handler_t::isEnabled()) || (!isHUDAttachment()) || (gRlvHandler.isDetachable(this))) ) || + ((!rlv_handler_t::isEnabled()) || (!isHUDAttachment()) || (!gRlvHandler.isLockedAttachment(this, RLV_LOCK_REMOVE))) ) || // [/RLVa:KB] mDrawable->isDead() || !gPipeline.hasRenderType(mDrawable->getRenderType())) @@ -2092,10 +2092,10 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, // { // return; // } -// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) +// [RLVa:KB] - Checked: 2009-10-10 (RLVa-1.0.5a) | Modified: RLVa-1.0.5a LLViewerObject* pObj = facep->getViewerObject(); if ( (pObj->isSelected() && gHideSelectedObjects) && - ((!rlv_handler_t::isEnabled()) || (!pObj->isHUDAttachment()) || (gRlvHandler.isDetachable(pObj))) ) + ((!rlv_handler_t::isEnabled()) || (!pObj->isHUDAttachment()) || (!gRlvHandler.isLockedAttachment(pObj, RLV_LOCK_REMOVE))) ) { return; } diff --git a/linden/indra/newview/pipeline.cpp b/linden/indra/newview/pipeline.cpp index efb5ff6..bf7799c 100644 --- a/linden/indra/newview/pipeline.cpp +++ b/linden/indra/newview/pipeline.cpp @@ -1797,10 +1797,10 @@ void LLPipeline::stateSort(LLDrawable* drawablep, LLCamera& camera) { // if (drawablep->getVObj().notNull() && // drawablep->getVObj()->isSelected()) -// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) +// [RLVa:KB] - Checked: 2009-10-10 (RLVa-1.0.5a) | Modified: RLVa-1.0.5a LLViewerObject* pObj = drawablep->getVObj(); if ( (pObj) && (pObj->isSelected()) && - ((!rlv_handler_t::isEnabled()) || (!pObj->isHUDAttachment()) || (gRlvHandler.isDetachable(pObj))) ) + ((!rlv_handler_t::isEnabled()) || (!pObj->isHUDAttachment()) || (!gRlvHandler.isLockedAttachment(pObj, RLV_LOCK_REMOVE))) ) // [/RVLa:KB] { return; diff --git a/linden/indra/newview/rlvdefines.h b/linden/indra/newview/rlvdefines.h index 118ba31..a35d109 100644 --- a/linden/indra/newview/rlvdefines.h +++ b/linden/indra/newview/rlvdefines.h @@ -41,14 +41,14 @@ // Version of the specifcation we support const S32 RLV_VERSION_MAJOR = 1; -const S32 RLV_VERSION_MINOR = 21; +const S32 RLV_VERSION_MINOR = 22; const S32 RLV_VERSION_PATCH = 0; const S32 RLV_VERSION_BUILD = 0; // Implementation version const S32 RLVa_VERSION_MAJOR = 1; const S32 RLVa_VERSION_MINOR = 0; -const S32 RLVa_VERSION_PATCH = 4; +const S32 RLVa_VERSION_PATCH = 5; const S32 RLVa_VERSION_BUILD = 4; // The official viewer version we're patching against @@ -59,12 +59,15 @@ const S32 RLVa_VERSION_BUILD = 4; #define RLV_WARNS LL_WARNS("RLV") #define RLV_INFOS LL_INFOS("RLV") #define RLV_DEBUGS LL_DEBUGS("RLV") +#define RLV_ENDL LL_ENDL #if LL_RELEASE_WITH_DEBUG_INFO || LL_DEBUG // Turn on extended debugging information #define RLV_DEBUG // Make sure we halt execution on errors - #define RLV_ERRS LL_ERRS("RLV") + #define RLV_ERRS LL_ERRS("RLV") + // Keep our asserts separate from LL's + #define RLV_ASSERT(f) if (!(f)) RLV_ERRS << "ASSERT (" << #f << ")" << RLV_ENDL; // Uncomment to enable the Advanced / RLVa / Unit Tests menu (non-public) //#define RLV_DEBUG_TESTS #else @@ -72,6 +75,8 @@ const S32 RLVa_VERSION_BUILD = 4; //#define RLV_DEBUG // Don't halt execution on errors in release #define RLV_ERRS LL_WARNS("RLV") + // We don't want to check assertions in release builds + #define RLV_ASSERT(f) #endif // LL_RELEASE_WITH_DEBUG_INFO || LL_DEBUG #define RLV_ROOT_FOLDER "#RLV" @@ -111,6 +116,8 @@ enum ERlvBehaviour { RLV_BHVR_ADDOUTFIT, // "addoutfit" RLV_BHVR_REMOUTFIT, // "remoutfit" RLV_BHVR_GETOUTFIT, // "getoutfit" + RLV_BHVR_ADDATTACH, // "addattach" + RLV_BHVR_REMATTACH, // "remattach" RLV_BHVR_GETATTACH, // "getattach" RLV_BHVR_SHOWINV, // "showinv" RLV_BHVR_VIEWNOTE, // "viewnote" @@ -152,6 +159,8 @@ enum ERlvBehaviour { RLV_BHVR_DEFAULTWEAR, // "defaultwear" RLV_BHVR_VERSIONNUM, // "versionnum" RLV_BHVR_PERMISSIVE, // "permissive" + RLV_BHVR_VIEWSCRIPT, // "viewscript" + RLV_BHVR_VIEWTEXTURE, // "viewtexture" RLV_BHVR_COUNT, RLV_BHVR_UNKNOWN @@ -185,6 +194,12 @@ enum ERlvExceptionCheck { RLV_CHECK_DEFAULT // Permissive or strict will be determined by currently enforced restrictions }; +enum ERlvLockMask { + RLV_LOCK_ADD = 0x01, + RLV_LOCK_REMOVE = 0x02, + RLV_LOCK_ANY = RLV_LOCK_ADD | RLV_LOCK_REMOVE +}; + // ============================================================================ // Settings diff --git a/linden/indra/newview/rlvextensions.cpp b/linden/indra/newview/rlvextensions.cpp index f31c62e..769d3cc 100644 --- a/linden/indra/newview/rlvextensions.cpp +++ b/linden/indra/newview/rlvextensions.cpp @@ -97,7 +97,7 @@ BOOL RlvExtGetSet::processCommand(const LLUUID& idObj, const RlvCommand& rlvCmd) F32 nAngle = 0.0f; if (LLStringUtil::convertToF32(rlvCmd.getOption(), nAngle)) { - nAngle += RLV_SETROT_OFFSET; + nAngle = RLV_SETROT_OFFSET - nAngle; gAgent.startCameraAnimation(); diff --git a/linden/indra/newview/rlvhandler.cpp b/linden/indra/newview/rlvhandler.cpp index 69e2e2f..88cd174 100644 --- a/linden/indra/newview/rlvhandler.cpp +++ b/linden/indra/newview/rlvhandler.cpp @@ -31,11 +31,6 @@ #include "rlvextensions.h" #include "rlvhandler.h" -// Only defined in llinventorybridge.cpp -#if RLV_TARGET < RLV_MAKE_TARGET(1, 23, 0) // Version: 1.22.11 - #include "llinventorybridge.h" - void confirm_replace_attachment_rez(S32 option, void* user_data); -#endif // Only defined in llinventorymodel.cpp extern const char* NEW_CATEGORY_NAME; @@ -66,8 +61,8 @@ const std::string RlvHandler::cstrMsgTpLure = const std::string RlvHandler::cstrAnonyms[] = { "A resident", "This resident", "That resident", "An individual", "This individual", "That individual", "A person", - "This person", "That person", "A stranger", "This stranger", "That stranger", "A human being", "This human being", - "That human being", "An agent", "This agent", "That agent", "A soul", "This soul", "That soul", "Somebody", + "This person", "That person", "A stranger", "This stranger", "That stranger", "A being", "This being", + "That being", "An agent", "This agent", "That agent", "A soul", "This soul", "That soul", "Somebody", "Some people", "Someone", "Mysterious one", "An unknown being", "Unidentified one", "An unknown person" }; @@ -131,6 +126,7 @@ RlvHandler::~RlvHandler() //delete m_pGCTimer; // <- deletes itself delete m_pWLSnapshot; // <- delete on NULL is harmless delete m_pBhvrNotify; + delete m_pAttachMgr; } // ============================================================================ @@ -246,7 +242,7 @@ bool RlvHandler::hasLockedHUD() const return false; LLViewerJointAttachment* pAttachPt; - for (rlv_detach_map_t::const_iterator itAttachPt = m_Attachments.begin(); itAttachPt != m_Attachments.end(); ++itAttachPt) + for (rlv_attachlock_map_t::const_iterator itAttachPt = m_AttachRem.begin(); itAttachPt != m_AttachRem.end(); ++itAttachPt) { pAttachPt = get_if_there(pAvatar->mAttachmentPoints, (S32)itAttachPt->first, (LLViewerJointAttachment*)NULL); if ( (pAttachPt) && (pAttachPt->getIsHUDAttachment()) ) @@ -255,61 +251,94 @@ bool RlvHandler::hasLockedHUD() const return false; // None of our locked attachments is a HUD } -bool RlvHandler::isDetachable(const LLInventoryItem* pItem) const +// Checked: 2009-10-10 (RLVa-1.0.5a) | Added: RLVa-1.0.5a +bool RlvHandler::isLockedAttachment(const LLInventoryItem* pItem, ERlvLockMask eLock) const { LLVOAvatar* pAvatar = gAgent.getAvatarObject(); - return ( (pItem) && (pAvatar) ) ? isDetachable(pAvatar->getWornAttachment(pItem->getUUID())) : true; + return (pItem) && (pAvatar) && (isLockedAttachment(pAvatar->getWornAttachment(pItem->getUUID()), eLock)); } -// Checked: 2009-08-11 (RLVa-1.0.1h) | Added: RLVa-1.0.1h -bool RlvHandler::isDetachableExcept(S32 idxAttachPt, LLViewerObject *pObj) const +// Checked: 2009-10-13 (RLVa-1.0.5b) | Added: RLVa-1.0.5b +bool RlvHandler::isLockedAttachmentExcept(S32 idxAttachPt, ERlvLockMask eLock, LLViewerObject *pObj) const { - // Loop over every object that marked the specific attachment point undetachable (but ignore pObj and any of its children) - for (rlv_detach_map_t::const_iterator itAttach = m_Attachments.lower_bound(idxAttachPt), - endAttach = m_Attachments.upper_bound(idxAttachPt); itAttach != endAttach; ++itAttach) + // Loop over every object that marked the specific attachment point eLock type locked (but ignore pObj and any of its children) + LLViewerObject* pTempObj; + if (eLock & RLV_LOCK_REMOVE) { - LLViewerObject* pTempObj = gObjectList.findObject(itAttach->second); - if ( (!pTempObj) || (pTempObj->getRootEdit()->getID() != pObj->getID()) ) - return false; + for (rlv_attachlock_map_t::const_iterator itAttach = m_AttachRem.lower_bound(idxAttachPt), + endAttach = m_AttachRem.upper_bound(idxAttachPt); itAttach != endAttach; ++itAttach) + { + if ( ((pTempObj = gObjectList.findObject(itAttach->second)) == NULL) || (pTempObj->getRootEdit()->getID() != pObj->getID()) ) + return true; + } } - return true; + if (eLock & RLV_LOCK_ADD) + { + for (rlv_attachlock_map_t::const_iterator itAttach = m_AttachAdd.lower_bound(idxAttachPt), + endAttach = m_AttachAdd.upper_bound(idxAttachPt); itAttach != endAttach; ++itAttach) + { + if ( ((pTempObj = gObjectList.findObject(itAttach->second)) == NULL) || (pTempObj->getRootEdit()->getID() != pObj->getID()) ) + return true; + } + } + return false; } -// Checked: 2009-09-06 (RLVa-1.0.2b) | Modified: RLVa-1.0.2b -bool RlvHandler::setDetachable(S32 idxAttachPt, const LLUUID& idRlvObj, bool fDetachable) +// Checked: 2009-10-10 (RLVa-1.0.5a) | Added: RLVa-1.0.5a +void RlvHandler::addAttachmentLock(S32 idxAttachPt, const LLUUID &idRlvObj, ERlvLockMask eLock) { // Sanity check - make sure it's an object we know about - rlv_object_map_t::const_iterator itObj = m_Objects.find(idRlvObj); - if ( (itObj == m_Objects.end()) || (!idxAttachPt) ) - return false; // If (idxAttachPt) == 0 then: (pObj == NULL) || (pObj->isAttachment() == FALSE) + if ( (m_Objects.find(idRlvObj) == m_Objects.end()) || (!idxAttachPt) ) + return; // If (idxAttachPt) == 0 then: (pObj == NULL) || (pObj->isAttachment() == FALSE) - if (!fDetachable) + // NOTE: m_AttachXXX can contain duplicate pairs (ie @detach:spine=n,detach=n from an attachment on spine) + if (eLock & RLV_LOCK_REMOVE) { #ifdef RLV_EXPERIMENTAL_FIRSTUSE //LLFirstUse::useRlvDetach(); #endif // RLV_EXPERIMENTAL_FIRSTUSE - // NOTE: m_Attachments can contain duplicate pairs (ie @detach:spine=n,detach=n from an attachment on spine) - m_Attachments.insert(std::pair(idxAttachPt, itObj->second.m_UUID)); - return true; + m_AttachRem.insert(std::pair(idxAttachPt, idRlvObj)); } - else + if (eLock & RLV_LOCK_ADD) { - for (rlv_detach_map_t::iterator itAttach = m_Attachments.lower_bound(idxAttachPt), - endAttach = m_Attachments.upper_bound(idxAttachPt); itAttach != endAttach; ++itAttach) + m_AttachAdd.insert(std::pair(idxAttachPt, idRlvObj)); + } +} + +// Checked: 2009-10-10 (RLVa-1.0.5a) | Added: RLVa-1.0.5a +void RlvHandler::removeAttachmentLock(S32 idxAttachPt, const LLUUID &idRlvObj, ERlvLockMask eLock) +{ + // Sanity check - make sure it's an object we know about + if ( (m_Objects.find(idRlvObj) == m_Objects.end()) || (!idxAttachPt) ) + return; // If (idxAttachPt) == 0 then: (pObj == NULL) || (pObj->isAttachment() == FALSE) + + if (eLock & RLV_LOCK_REMOVE) + { + for (rlv_attachlock_map_t::iterator itAttach = m_AttachRem.lower_bound(idxAttachPt), + endAttach = m_AttachRem.upper_bound(idxAttachPt); itAttach != endAttach; ++itAttach) { - if (itObj->second.m_UUID == itAttach->second) + if (idRlvObj == itAttach->second) { - m_Attachments.erase(itAttach); - return true; + m_AttachRem.erase(itAttach); + break; + } + } + } + if (eLock & RLV_LOCK_ADD) + { + for (rlv_attachlock_map_t::iterator itAttach = m_AttachAdd.lower_bound(idxAttachPt), + endAttach = m_AttachAdd.upper_bound(idxAttachPt); itAttach != endAttach; ++itAttach) + { + if (idRlvObj == itAttach->second) + { + m_AttachAdd.erase(itAttach); + break; } } } - return false; // Fall-through for (fDetachable == TRUE) - if the object wasn't undetachable then we consider it a failure } - - #ifdef RLV_EXTENSION_FLAG_NOSTRIP // Checked: 2009-05-26 (RLVa-0.2.0d) | Modified: RLVa-0.2.0d bool RlvHandler::isStrippable(const LLUUID& idItem) const @@ -413,10 +442,10 @@ void RlvHandler::notifyBehaviourObservers(const RlvCommand& rlvCmd, bool fIntern } // Checked: -BOOL RlvHandler::processCommand(const LLUUID& uuid, const std::string& strCmd, bool fFromObj) +BOOL RlvHandler::processCommand(const LLUUID& idObj, const std::string& strCmd, bool fFromObj) { #ifdef RLV_DEBUG - RLV_INFOS << "[" << uuid << "]: " << strCmd << LL_ENDL; + RLV_INFOS << "[" << idObj << "]: " << strCmd << LL_ENDL; #endif // RLV_DEBUG RlvCommand rlvCmd(strCmd); @@ -427,7 +456,10 @@ BOOL RlvHandler::processCommand(const LLUUID& uuid, const std::string& strCmd, b #endif // RLV_DEBUG return FALSE; } - m_pCurCommand = &rlvCmd; m_idCurObject = uuid; + + // NOTE: if we pass RlvObject::m_UUID for idObj somewhere and process a @clear then it will point to invalid/cleared memory at the end + // so make sure to *always* pass our private copy to other functions + m_pCurCommand = &rlvCmd; m_idCurObject = idObj; BOOL fRet = FALSE; switch (rlvCmd.getParamType()) @@ -444,7 +476,7 @@ BOOL RlvHandler::processCommand(const LLUUID& uuid, const std::string& strCmd, b break; } - rlv_object_map_t::iterator itObj = m_Objects.find(uuid); + rlv_object_map_t::iterator itObj = m_Objects.find(m_idCurObject); if (itObj != m_Objects.end()) { RlvObject& rlvObj = itObj->second; @@ -452,9 +484,9 @@ BOOL RlvHandler::processCommand(const LLUUID& uuid, const std::string& strCmd, b } else { - RlvObject rlvObj(uuid); + RlvObject rlvObj(m_idCurObject); fRet = rlvObj.addCommand(rlvCmd); - m_Objects.insert(std::pair(uuid, rlvObj)); + m_Objects.insert(std::pair(m_idCurObject, rlvObj)); } #ifdef RLV_DEBUG @@ -464,14 +496,14 @@ BOOL RlvHandler::processCommand(const LLUUID& uuid, const std::string& strCmd, b if (fRet) { // If FALSE then this was a duplicate, there's no need to handle those if (!m_pGCTimer) m_pGCTimer = new RlvGCTimer(); - processAddCommand(uuid, rlvCmd); + processAddCommand(m_idCurObject, rlvCmd); notifyBehaviourObservers(rlvCmd, !fFromObj); } } break; case RLV_TYPE_REMOVE: // Checked: { - rlv_object_map_t::iterator itObj = m_Objects.find(uuid); + rlv_object_map_t::iterator itObj = m_Objects.find(m_idCurObject); if (itObj != m_Objects.end()) fRet = itObj->second.removeCommand(rlvCmd); @@ -481,13 +513,13 @@ BOOL RlvHandler::processCommand(const LLUUID& uuid, const std::string& strCmd, b #endif // RLV_DEBUG if (fRet) { // Don't handle non-sensical removes - processRemoveCommand(uuid, rlvCmd); + processRemoveCommand(m_idCurObject, rlvCmd); notifyBehaviourObservers(rlvCmd, !fFromObj); if (0 == itObj->second.m_Commands.size()) { #ifdef RLV_DEBUG - RLV_INFOS << "\t- command list empty => removing " << uuid << LL_ENDL; + RLV_INFOS << "\t- command list empty => removing " << m_idCurObject << LL_ENDL; #endif // RLV_DEBUG m_Objects.erase(itObj); } @@ -495,14 +527,14 @@ BOOL RlvHandler::processCommand(const LLUUID& uuid, const std::string& strCmd, b } break; case RLV_TYPE_CLEAR: - fRet = processClearCommand(uuid, rlvCmd); + fRet = processClearCommand(m_idCurObject, rlvCmd); notifyBehaviourObservers(rlvCmd, !fFromObj); break; case RLV_TYPE_FORCE: // Checked: - fRet = processForceCommand(uuid, rlvCmd); + fRet = processForceCommand(m_idCurObject, rlvCmd); break; case RLV_TYPE_REPLY: // Checked: - fRet = processReplyCommand(uuid, rlvCmd); + fRet = processReplyCommand(m_idCurObject, rlvCmd); break; case RLV_TYPE_UNKNOWN: // Checked: break; @@ -535,35 +567,15 @@ BOOL RlvHandler::processAddCommand(const LLUUID& uuid, const RlvCommand& rlvCmd) m_Behaviours[eBehaviour]++; } + bool fRefCount = false; // Unused for the moment switch (eBehaviour) { - case RLV_BHVR_DETACH: // @detach[: