summaryrefslogtreecommitdiff
path: root/indra/newview/llselectmgr.cpp
diff options
context:
space:
mode:
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 fdc95c7784..69c577f445 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"
@@ -2343,6 +2344,7 @@ void LLSelectMgr::selectionSetIncludeInSearch(bool include_in_search)
"ObjectIncludeInSearch",
packAgentAndSessionID,
packObjectIncludeInSearch,
+ logNoOp,
&include_in_search,
SEND_ONLY_ROOTS);
}
@@ -2392,6 +2394,7 @@ void LLSelectMgr::selectionSetClickAction(U8 action)
sendListToRegions("ObjectClickAction",
packAgentAndSessionID,
packObjectClickAction,
+ logNoOp,
&action,
SEND_INDIVIDUALS);
}
@@ -2427,7 +2430,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);
}
}
@@ -2456,6 +2459,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());
@@ -3561,10 +3581,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)
{
@@ -3596,6 +3617,7 @@ void LLSelectMgr::selectForceDelete()
"ObjectDelete",
packDeleteHeader,
packObjectLocalID,
+ logNoOp,
(void*)TRUE,
SEND_ONLY_ROOTS);
}
@@ -3766,7 +3788,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)
{
@@ -3821,7 +3843,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();
@@ -3900,7 +3922,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)
{
@@ -3950,6 +3972,7 @@ void LLSelectMgr::sendMultipleUpdate(U32 type)
"MultipleObjectUpdate",
packAgentAndSessionID,
packMultipleUpdate,
+ logNoOp,
&type,
send_type);
}
@@ -4013,7 +4036,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
@@ -4037,7 +4060,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);
}
@@ -4061,7 +4084,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
@@ -4105,7 +4128,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)
@@ -4148,6 +4171,7 @@ void LLSelectMgr::deselectAll()
"ObjectDeselect",
packAgentAndSessionID,
packObjectLocalID,
+ logNoOp,
NULL,
SEND_INDIVIDUALS);
@@ -4178,6 +4202,7 @@ void LLSelectMgr::deselectAllForStandingUp()
"ObjectDeselect",
packAgentAndSessionID,
packObjectLocalID,
+ logNoOp,
NULL,
SEND_INDIVIDUALS);
@@ -4259,6 +4284,7 @@ void LLSelectMgr::selectionSetObjectName(const std::string& name)
sendListToRegions("ObjectName",
packAgentAndSessionID,
packObjectName,
+ logNoOp,
(void*)(&name_copy),
SEND_ONLY_ROOTS);
}
@@ -4267,6 +4293,7 @@ void LLSelectMgr::selectionSetObjectName(const std::string& name)
sendListToRegions("ObjectName",
packAgentAndSessionID,
packObjectName,
+ logNoOp,
(void*)(&name_copy),
SEND_INDIVIDUALS);
}
@@ -4282,6 +4309,7 @@ void LLSelectMgr::selectionSetObjectDescription(const std::string& desc)
sendListToRegions("ObjectDescription",
packAgentAndSessionID,
packObjectDescription,
+ logNoOp,
(void*)(&desc_copy),
SEND_ONLY_ROOTS);
}
@@ -4290,6 +4318,7 @@ void LLSelectMgr::selectionSetObjectDescription(const std::string& desc)
sendListToRegions("ObjectDescription",
packAgentAndSessionID,
packObjectDescription,
+ logNoOp,
(void*)(&desc_copy),
SEND_INDIVIDUALS);
}
@@ -4303,6 +4332,7 @@ void LLSelectMgr::selectionSetObjectCategory(const LLCategory& category)
sendListToRegions("ObjectCategory",
packAgentAndSessionID,
packObjectCategory,
+ logNoOp,
(void*)(&category),
SEND_ONLY_ROOTS);
}
@@ -4312,6 +4342,7 @@ void LLSelectMgr::selectionSetObjectSaleInfo(const LLSaleInfo& sale_info)
sendListToRegions("ObjectSaleInfo",
packAgentAndSessionID,
packObjectSaleInfo,
+ logNoOp,
(void*)(&sale_info),
SEND_ONLY_ROOTS);
}
@@ -4345,6 +4376,7 @@ void LLSelectMgr::sendAttach(U8 attachment_point, bool replace)
"ObjectAttach",
packAgentIDAndSessionAndAttachment,
packObjectIDAndRotation,
+ logAttachmentRequest,
&attachment_point,
SEND_ONLY_ROOTS );
if (!build_mode)
@@ -4365,6 +4397,7 @@ void LLSelectMgr::sendDetach()
"ObjectDetach",
packAgentAndSessionID,
packObjectLocalID,
+ logDetachRequest,
NULL,
SEND_ONLY_ROOTS );
}
@@ -4381,6 +4414,7 @@ void LLSelectMgr::sendDropAttachment()
"ObjectDrop",
packAgentAndSessionID,
packObjectLocalID,
+ logDetachRequest,
NULL,
SEND_ONLY_ROOTS);
}
@@ -4400,6 +4434,7 @@ void LLSelectMgr::sendLink()
"ObjectLink",
packAgentAndSessionID,
packObjectLocalID,
+ logNoOp,
NULL,
SEND_ONLY_ROOTS);
}
@@ -4437,6 +4472,7 @@ void LLSelectMgr::sendDelink()
"ObjectDelink",
packAgentAndSessionID,
packObjectLocalID,
+ logNoOp,
NULL,
SEND_INDIVIDUALS);
}
@@ -4489,6 +4525,7 @@ void LLSelectMgr::sendSelect()
"ObjectSelect",
packAgentAndSessionID,
packObjectLocalID,
+ logNoOp,
NULL,
SEND_INDIVIDUALS);
}
@@ -4885,6 +4922,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)
{
@@ -5006,6 +5044,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;
@@ -6656,7 +6696,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);
}
//-----------------------------------------------------------------------------
@@ -6674,7 +6714,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);
}
//-----------------------------------------------------------------------------