From 1f2404aa29249f94ec987a0fe9e9cc5fa1cd634b Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 18 Feb 2015 16:44:36 -0500 Subject: Logging for attachments and their COF links --- indra/newview/llagentwearables.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'indra/newview/llagentwearables.cpp') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index f06ffb4fb3..6f54e23e38 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -1344,6 +1344,7 @@ void LLAgentWearables::userRemoveMultipleAttachments(llvo_vec_t& objects_to_remo if (objects_to_remove.empty()) return; + LL_DEBUGS("Avatar") << "removing " << objects_to_remove.size() << " objects" << LL_ENDL; gMessageSystem->newMessage("ObjectDetach"); gMessageSystem->nextBlockFast(_PREHASH_AgentData); gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); @@ -1357,14 +1358,23 @@ void LLAgentWearables::userRemoveMultipleAttachments(llvo_vec_t& objects_to_remo //gAgentAvatarp->resetJointPositionsOnDetach(objectp); gMessageSystem->nextBlockFast(_PREHASH_ObjectData); gMessageSystem->addU32Fast(_PREHASH_ObjectLocalID, objectp->getLocalID()); + const LLUUID& item_id = objectp->getAttachmentItemID(); + LLViewerInventoryItem *item = gInventory.getItem(item_id); + LL_DEBUGS("Avatar") << "removing object, item is " << (item ? item->getName() : "UNKNOWN") << item_id << LL_ENDL; } gMessageSystem->sendReliable(gAgent.getRegionHost()); } +// FIXME this is basically the same code as LLAttachmentsMgr::onIdle() +// should consolidate. void LLAgentWearables::userAttachMultipleAttachments(LLInventoryModel::item_array_t& obj_item_array) { // Build a compound message to send all the objects that need to be rezzed. S32 obj_count = obj_item_array.size(); + if (obj_count > 0) + { + LL_DEBUGS("Avatar") << "attaching multiple, total obj_count " << obj_count << LL_ENDL; + } // Limit number of packets to send const S32 MAX_PACKETS_TO_SEND = 10; @@ -1396,6 +1406,8 @@ void LLAgentWearables::userAttachMultipleAttachments(LLInventoryModel::item_arra } const LLInventoryItem* item = obj_item_array.at(i).get(); + LL_DEBUGS("Avatar") << "requesting " << item->getName() + << " " << item->getLinkedUUID() << LL_ENDL; msg->nextBlockFast(_PREHASH_ObjectData ); msg->addUUIDFast(_PREHASH_ItemID, item->getLinkedUUID()); msg->addUUIDFast(_PREHASH_OwnerID, item->getPermissions().getOwner()); -- cgit v1.2.3 From 7b99314d846483167c665fabf8092e604554321c Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 20 Feb 2015 15:54:27 -0500 Subject: MAINT-4653, DRTVWR-397 WIP - more code for tracking attachment operations, smarter handling of multiple requests. --- indra/newview/llagentwearables.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/newview/llagentwearables.cpp') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 6f54e23e38..69eb478cd8 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -1344,7 +1344,7 @@ void LLAgentWearables::userRemoveMultipleAttachments(llvo_vec_t& objects_to_remo if (objects_to_remove.empty()) return; - LL_DEBUGS("Avatar") << "removing " << objects_to_remove.size() << " objects" << LL_ENDL; + LL_DEBUGS("Avatar") << "ATT [ObjectDetach] removing " << objects_to_remove.size() << " objects" << LL_ENDL; gMessageSystem->newMessage("ObjectDetach"); gMessageSystem->nextBlockFast(_PREHASH_AgentData); gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); @@ -1360,7 +1360,7 @@ void LLAgentWearables::userRemoveMultipleAttachments(llvo_vec_t& objects_to_remo gMessageSystem->addU32Fast(_PREHASH_ObjectLocalID, objectp->getLocalID()); const LLUUID& item_id = objectp->getAttachmentItemID(); LLViewerInventoryItem *item = gInventory.getItem(item_id); - LL_DEBUGS("Avatar") << "removing object, item is " << (item ? item->getName() : "UNKNOWN") << item_id << LL_ENDL; + LL_DEBUGS("Avatar") << "ATT removing object, item is " << (item ? item->getName() : "UNKNOWN") << " " << item_id << LL_ENDL; } gMessageSystem->sendReliable(gAgent.getRegionHost()); } @@ -1373,7 +1373,7 @@ void LLAgentWearables::userAttachMultipleAttachments(LLInventoryModel::item_arra S32 obj_count = obj_item_array.size(); if (obj_count > 0) { - LL_DEBUGS("Avatar") << "attaching multiple, total obj_count " << obj_count << LL_ENDL; + LL_DEBUGS("Avatar") << "ATT [RezMultipleAttachmentsFromInv] attaching multiple, total obj_count " << obj_count << LL_ENDL; } // Limit number of packets to send @@ -1406,7 +1406,7 @@ void LLAgentWearables::userAttachMultipleAttachments(LLInventoryModel::item_arra } const LLInventoryItem* item = obj_item_array.at(i).get(); - LL_DEBUGS("Avatar") << "requesting " << item->getName() + LL_DEBUGS("Avatar") << "ATT requesting " << item->getName() << " " << item->getLinkedUUID() << LL_ENDL; msg->nextBlockFast(_PREHASH_ObjectData ); msg->addUUIDFast(_PREHASH_ItemID, item->getLinkedUUID()); -- cgit v1.2.3 From 090d3097d569922b7c3b681cb77ff14a29a60b07 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 18 Mar 2015 21:41:47 -0400 Subject: MAINT-4917 WIP - Attachment deferred bulk COF linking WIP --- indra/newview/llagentwearables.cpp | 56 ++++++-------------------------------- 1 file changed, 9 insertions(+), 47 deletions(-) (limited to 'indra/newview/llagentwearables.cpp') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 69eb478cd8..4a395f547a 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -27,6 +27,7 @@ #include "llviewerprecompiledheaders.h" #include "llagentwearables.h" +#include "llattachmentsmgr.h" #include "llaccordionctrltab.h" #include "llagent.h" #include "llagentcamera.h" @@ -1373,55 +1374,16 @@ void LLAgentWearables::userAttachMultipleAttachments(LLInventoryModel::item_arra S32 obj_count = obj_item_array.size(); if (obj_count > 0) { - LL_DEBUGS("Avatar") << "ATT [RezMultipleAttachmentsFromInv] attaching multiple, total obj_count " << obj_count << LL_ENDL; + LL_DEBUGS("Avatar") << "ATT attaching multiple, total obj_count " << obj_count << LL_ENDL; } - // Limit number of packets to send - const S32 MAX_PACKETS_TO_SEND = 10; - const S32 OBJECTS_PER_PACKET = 4; - const S32 MAX_OBJECTS_TO_SEND = MAX_PACKETS_TO_SEND * OBJECTS_PER_PACKET; - if( obj_count > MAX_OBJECTS_TO_SEND ) - { - obj_count = MAX_OBJECTS_TO_SEND; - } - - // Create an id to keep the parts of the compound message together - LLUUID compound_msg_id; - compound_msg_id.generate(); - LLMessageSystem* msg = gMessageSystem; - - for(S32 i = 0; i < obj_count; ++i) - { - if( 0 == (i % OBJECTS_PER_PACKET) ) - { - // Start a new message chunk - msg->newMessageFast(_PREHASH_RezMultipleAttachmentsFromInv); - msg->nextBlockFast(_PREHASH_AgentData); - msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - msg->nextBlockFast(_PREHASH_HeaderData); - msg->addUUIDFast(_PREHASH_CompoundMsgID, compound_msg_id ); - msg->addU8Fast(_PREHASH_TotalObjects, obj_count ); - msg->addBOOLFast(_PREHASH_FirstDetachAll, false ); - } - - const LLInventoryItem* item = obj_item_array.at(i).get(); - LL_DEBUGS("Avatar") << "ATT requesting " << item->getName() - << " " << item->getLinkedUUID() << LL_ENDL; - msg->nextBlockFast(_PREHASH_ObjectData ); - msg->addUUIDFast(_PREHASH_ItemID, item->getLinkedUUID()); - msg->addUUIDFast(_PREHASH_OwnerID, item->getPermissions().getOwner()); - msg->addU8Fast(_PREHASH_AttachmentPt, 0 | ATTACHMENT_ADD); // Wear at the previous or default attachment point - pack_permissions_slam(msg, item->getFlags(), item->getPermissions()); - msg->addStringFast(_PREHASH_Name, item->getName()); - msg->addStringFast(_PREHASH_Description, item->getDescription()); - - if( (i+1 == obj_count) || ((OBJECTS_PER_PACKET-1) == (i % OBJECTS_PER_PACKET)) ) - { - // End of message chunk - msg->sendReliable( gAgent.getRegion()->getHost() ); - } - } + for(LLInventoryModel::item_array_t::const_iterator it = obj_item_array.begin(); + it != obj_item_array.end(); + ++it) + { + const LLInventoryItem* item = *it; + LLAttachmentsMgr::instance().addAttachmentRequest(item->getLinkedUUID(), 0, TRUE); + } } // Returns false if the given wearable is already topmost/bottommost -- cgit v1.2.3 From 8963185f5bea5af8ede04f41423ae1f822d80899 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 19 Mar 2015 17:05:55 -0400 Subject: MAINT-4917 WIP - comments and bug fixes for batching up COF link requests after attachments added. --- indra/newview/llagentwearables.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'indra/newview/llagentwearables.cpp') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 4a395f547a..4d46a331c8 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -1366,8 +1366,6 @@ void LLAgentWearables::userRemoveMultipleAttachments(llvo_vec_t& objects_to_remo gMessageSystem->sendReliable(gAgent.getRegionHost()); } -// FIXME this is basically the same code as LLAttachmentsMgr::onIdle() -// should consolidate. void LLAgentWearables::userAttachMultipleAttachments(LLInventoryModel::item_array_t& obj_item_array) { // Build a compound message to send all the objects that need to be rezzed. -- cgit v1.2.3 From 6fc663d62ad847a6b91029ce9576058cd01a3d68 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 20 Mar 2015 11:03:47 -0400 Subject: DRTVWR-397 WIP - logging for detach requests and unexpected detaches (presumably server-initiated) --- indra/newview/llagentwearables.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llagentwearables.cpp') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 4d46a331c8..d772e1c7f8 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -1362,6 +1362,7 @@ void LLAgentWearables::userRemoveMultipleAttachments(llvo_vec_t& objects_to_remo const LLUUID& item_id = objectp->getAttachmentItemID(); LLViewerInventoryItem *item = gInventory.getItem(item_id); LL_DEBUGS("Avatar") << "ATT removing object, item is " << (item ? item->getName() : "UNKNOWN") << " " << item_id << LL_ENDL; + LLAttachmentsMgr::instance().onDetachRequested(item_id); } gMessageSystem->sendReliable(gAgent.getRegionHost()); } -- cgit v1.2.3