summaryrefslogtreecommitdiff
path: root/indra/newview/llselectmgr.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2015-04-09 13:29:39 -0400
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2015-04-09 13:29:39 -0400
commit6ac9852d54d1ee4f826a08ca73f08bccf403d8c3 (patch)
tree97a2d8e1a52ff68cdc686f8ad88c2f952c4869e5 /indra/newview/llselectmgr.cpp
parentf1684cdea5e1086b1127993eac9a5a7b4e47321a (diff)
MAINT-5069 WIP, MAINT-5071 WIP - handle dropping objects and attaching from ground. WIP on better tracking of attachment requests via various message in LLSelectMgr.
Diffstat (limited to 'indra/newview/llselectmgr.cpp')
-rwxr-xr-xindra/newview/llselectmgr.cpp68
1 files changed, 54 insertions, 14 deletions
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index eb3a4c37d9..408d983bbd 100755
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -52,6 +52,7 @@
// viewer includes
#include "llagent.h"
#include "llagentcamera.h"
+#include "llattachmentsmgr.h"
#include "llviewerwindow.h"
#include "lldrawable.h"
#include "llfloaterinspect.h"
@@ -2312,6 +2313,7 @@ void LLSelectMgr::selectionSetIncludeInSearch(bool include_in_search)
"ObjectIncludeInSearch",
packAgentAndSessionID,
packObjectIncludeInSearch,
+ logNoOp,
&include_in_search,
SEND_ONLY_ROOTS);
}
@@ -2361,6 +2363,7 @@ void LLSelectMgr::selectionSetClickAction(U8 action)
sendListToRegions("ObjectClickAction",
packAgentAndSessionID,
packObjectClickAction,
+ logNoOp,
&action,
SEND_INDIVIDUALS);
}
@@ -2396,7 +2399,7 @@ void LLSelectMgr::sendGodlikeRequest(const std::string& request, const std::stri
}
else
{
- sendListToRegions(message_type, packGodlikeHead, packObjectIDAsParam, &data, SEND_ONLY_ROOTS);
+ sendListToRegions(message_type, packGodlikeHead, packObjectIDAsParam, logNoOp, &data, SEND_ONLY_ROOTS);
}
}
@@ -2425,6 +2428,23 @@ void LLSelectMgr::packGodlikeHead(void* user_data)
}
// static
+void LLSelectMgr::logNoOp(LLSelectNode* node, void *)
+{
+}
+
+// static
+void LLSelectMgr::logAttachmentRequest(LLSelectNode* node, void *)
+{
+ LLAttachmentsMgr::instance().onAttachmentRequested(node->mItemID);
+}
+
+// static
+void LLSelectMgr::logDetachRequest(LLSelectNode* node, void *)
+{
+ LLAttachmentsMgr::instance().onDetachRequested(node->mItemID);
+}
+
+// static
void LLSelectMgr::packObjectIDAsParam(LLSelectNode* node, void *)
{
std::string buf = llformat("%u", node->getObject()->getLocalID());
@@ -3530,10 +3550,11 @@ bool LLSelectMgr::confirmDelete(const LLSD& notification, const LLSD& response,
// attempt to derez into the trash.
LLDeRezInfo info(DRD_TRASH, trash_id);
LLSelectMgr::getInstance()->sendListToRegions("DeRezObject",
- packDeRezHeader,
- packObjectLocalID,
- (void*) &info,
- SEND_ONLY_ROOTS);
+ packDeRezHeader,
+ packObjectLocalID,
+ logNoOp,
+ (void*) &info,
+ SEND_ONLY_ROOTS);
// VEFFECT: Delete Object - one effect for all deletes
if (LLSelectMgr::getInstance()->mSelectedObjects->mSelectType != SELECT_TYPE_HUD)
{
@@ -3565,6 +3586,7 @@ void LLSelectMgr::selectForceDelete()
"ObjectDelete",
packDeleteHeader,
packObjectLocalID,
+ logNoOp,
(void*)TRUE,
SEND_ONLY_ROOTS);
}
@@ -3735,7 +3757,7 @@ void LLSelectMgr::selectDuplicate(const LLVector3& offset, BOOL select_copy)
data.offset = offset;
data.flags = (select_copy ? FLAGS_CREATE_SELECTED : 0x0);
- sendListToRegions("ObjectDuplicate", packDuplicateHeader, packDuplicate, &data, SEND_ONLY_ROOTS);
+ sendListToRegions("ObjectDuplicate", packDuplicateHeader, packDuplicate, logNoOp, &data, SEND_ONLY_ROOTS);
if (select_copy)
{
@@ -3790,7 +3812,7 @@ void LLSelectMgr::repeatDuplicate()
data.offset = LLVector3::zero;
data.flags = 0x0;
- sendListToRegions("ObjectDuplicate", packDuplicateHeader, packDuplicate, &data, SEND_ONLY_ROOTS);
+ sendListToRegions("ObjectDuplicate", packDuplicateHeader, packDuplicate, logNoOp, &data, SEND_ONLY_ROOTS);
// move current selection based on delta from duplication position and update duplication position
for (LLObjectSelection::root_iterator iter = getSelection()->root_begin();
@@ -3869,7 +3891,7 @@ void LLSelectMgr::selectDuplicateOnRay(const LLVector3 &ray_start_region,
data.mFlags = (select_copy ? FLAGS_CREATE_SELECTED : 0x0);
sendListToRegions("ObjectDuplicateOnRay",
- packDuplicateOnRayHead, packObjectLocalID, &data, SEND_ONLY_ROOTS);
+ packDuplicateOnRayHead, packObjectLocalID, logNoOp, &data, SEND_ONLY_ROOTS);
if (select_copy)
{
@@ -3919,6 +3941,7 @@ void LLSelectMgr::sendMultipleUpdate(U32 type)
"MultipleObjectUpdate",
packAgentAndSessionID,
packMultipleUpdate,
+ logNoOp,
&type,
send_type);
}
@@ -3982,7 +4005,7 @@ void LLSelectMgr::sendOwner(const LLUUID& owner_id,
data.group_id = group_id;
data.override = override;
- sendListToRegions("ObjectOwner", packOwnerHead, packObjectLocalID, &data, SEND_ONLY_ROOTS);
+ sendListToRegions("ObjectOwner", packOwnerHead, packObjectLocalID, logNoOp, &data, SEND_ONLY_ROOTS);
}
// static
@@ -4006,7 +4029,7 @@ void LLSelectMgr::packOwnerHead(void *user_data)
void LLSelectMgr::sendGroup(const LLUUID& group_id)
{
LLUUID local_group_id(group_id);
- sendListToRegions("ObjectGroup", packAgentAndSessionAndGroupID, packObjectLocalID, &local_group_id, SEND_ONLY_ROOTS);
+ sendListToRegions("ObjectGroup", packAgentAndSessionAndGroupID, packObjectLocalID, logNoOp, &local_group_id, SEND_ONLY_ROOTS);
}
@@ -4030,7 +4053,7 @@ void LLSelectMgr::sendBuy(const LLUUID& buyer_id, const LLUUID& category_id, con
LLBuyData buy;
buy.mCategoryID = category_id;
buy.mSaleInfo = sale_info;
- sendListToRegions("ObjectBuy", packAgentGroupAndCatID, packBuyObjectIDs, &buy, SEND_ONLY_ROOTS);
+ sendListToRegions("ObjectBuy", packAgentGroupAndCatID, packBuyObjectIDs, logNoOp, &buy, SEND_ONLY_ROOTS);
}
// static
@@ -4074,7 +4097,7 @@ void LLSelectMgr::selectionSetObjectPermissions(U8 field,
data.mMask = mask;
data.mOverride = override;
- sendListToRegions("ObjectPermissions", packPermissionsHead, packPermissions, &data, SEND_ONLY_ROOTS);
+ sendListToRegions("ObjectPermissions", packPermissionsHead, packPermissions, logNoOp, &data, SEND_ONLY_ROOTS);
}
void LLSelectMgr::packPermissionsHead(void* user_data)
@@ -4117,6 +4140,7 @@ void LLSelectMgr::deselectAll()
"ObjectDeselect",
packAgentAndSessionID,
packObjectLocalID,
+ logNoOp,
NULL,
SEND_INDIVIDUALS);
@@ -4147,6 +4171,7 @@ void LLSelectMgr::deselectAllForStandingUp()
"ObjectDeselect",
packAgentAndSessionID,
packObjectLocalID,
+ logNoOp,
NULL,
SEND_INDIVIDUALS);
@@ -4228,6 +4253,7 @@ void LLSelectMgr::selectionSetObjectName(const std::string& name)
sendListToRegions("ObjectName",
packAgentAndSessionID,
packObjectName,
+ logNoOp,
(void*)(&name_copy),
SEND_ONLY_ROOTS);
}
@@ -4236,6 +4262,7 @@ void LLSelectMgr::selectionSetObjectName(const std::string& name)
sendListToRegions("ObjectName",
packAgentAndSessionID,
packObjectName,
+ logNoOp,
(void*)(&name_copy),
SEND_INDIVIDUALS);
}
@@ -4251,6 +4278,7 @@ void LLSelectMgr::selectionSetObjectDescription(const std::string& desc)
sendListToRegions("ObjectDescription",
packAgentAndSessionID,
packObjectDescription,
+ logNoOp,
(void*)(&desc_copy),
SEND_ONLY_ROOTS);
}
@@ -4259,6 +4287,7 @@ void LLSelectMgr::selectionSetObjectDescription(const std::string& desc)
sendListToRegions("ObjectDescription",
packAgentAndSessionID,
packObjectDescription,
+ logNoOp,
(void*)(&desc_copy),
SEND_INDIVIDUALS);
}
@@ -4272,6 +4301,7 @@ void LLSelectMgr::selectionSetObjectCategory(const LLCategory& category)
sendListToRegions("ObjectCategory",
packAgentAndSessionID,
packObjectCategory,
+ logNoOp,
(void*)(&category),
SEND_ONLY_ROOTS);
}
@@ -4281,6 +4311,7 @@ void LLSelectMgr::selectionSetObjectSaleInfo(const LLSaleInfo& sale_info)
sendListToRegions("ObjectSaleInfo",
packAgentAndSessionID,
packObjectSaleInfo,
+ logNoOp,
(void*)(&sale_info),
SEND_ONLY_ROOTS);
}
@@ -4314,6 +4345,7 @@ void LLSelectMgr::sendAttach(U8 attachment_point, bool replace)
"ObjectAttach",
packAgentIDAndSessionAndAttachment,
packObjectIDAndRotation,
+ logAttachmentRequest,
&attachment_point,
SEND_ONLY_ROOTS );
if (!build_mode)
@@ -4334,6 +4366,7 @@ void LLSelectMgr::sendDetach()
"ObjectDetach",
packAgentAndSessionID,
packObjectLocalID,
+ logDetachRequest,
NULL,
SEND_ONLY_ROOTS );
}
@@ -4350,6 +4383,7 @@ void LLSelectMgr::sendDropAttachment()
"ObjectDrop",
packAgentAndSessionID,
packObjectLocalID,
+ logDetachRequest,
NULL,
SEND_ONLY_ROOTS);
}
@@ -4369,6 +4403,7 @@ void LLSelectMgr::sendLink()
"ObjectLink",
packAgentAndSessionID,
packObjectLocalID,
+ logNoOp,
NULL,
SEND_ONLY_ROOTS);
}
@@ -4406,6 +4441,7 @@ void LLSelectMgr::sendDelink()
"ObjectDelink",
packAgentAndSessionID,
packObjectLocalID,
+ logNoOp,
NULL,
SEND_INDIVIDUALS);
}
@@ -4458,6 +4494,7 @@ void LLSelectMgr::sendSelect()
"ObjectSelect",
packAgentAndSessionID,
packObjectLocalID,
+ logNoOp,
NULL,
SEND_INDIVIDUALS);
}
@@ -4834,6 +4871,7 @@ void LLSelectMgr::packPermissions(LLSelectNode* node, void *user_data)
void LLSelectMgr::sendListToRegions(const std::string& message_name,
void (*pack_header)(void *user_data),
void (*pack_body)(LLSelectNode* node, void *user_data),
+ void (*log_func)(LLSelectNode* node, void *user_data),
void *user_data,
ESendType send_type)
{
@@ -4955,6 +4993,8 @@ void LLSelectMgr::sendListToRegions(const std::string& message_name,
{
// add another instance of the body of the data
(*pack_body)(node, user_data);
+ // do any related logging
+ (*log_func)(node, user_data);
++objects_sent;
++objects_in_this_packet;
@@ -6579,7 +6619,7 @@ void LLSelectMgr::undo()
{
BOOL select_linked_set = !gSavedSettings.getBOOL("EditLinkedParts");
LLUUID group_id(gAgent.getGroupID());
- sendListToRegions("Undo", packAgentAndSessionAndGroupID, packObjectID, &group_id, select_linked_set ? SEND_ONLY_ROOTS : SEND_CHILDREN_FIRST);
+ sendListToRegions("Undo", packAgentAndSessionAndGroupID, packObjectID, logNoOp, &group_id, select_linked_set ? SEND_ONLY_ROOTS : SEND_CHILDREN_FIRST);
}
//-----------------------------------------------------------------------------
@@ -6597,7 +6637,7 @@ void LLSelectMgr::redo()
{
BOOL select_linked_set = !gSavedSettings.getBOOL("EditLinkedParts");
LLUUID group_id(gAgent.getGroupID());
- sendListToRegions("Redo", packAgentAndSessionAndGroupID, packObjectID, &group_id, select_linked_set ? SEND_ONLY_ROOTS : SEND_CHILDREN_FIRST);
+ sendListToRegions("Redo", packAgentAndSessionAndGroupID, packObjectID, logNoOp, &group_id, select_linked_set ? SEND_ONLY_ROOTS : SEND_CHILDREN_FIRST);
}
//-----------------------------------------------------------------------------