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 ++++++++ indra/newview/llappearancemgr.cpp | 63 ++++++++++++++++++++++---------------- indra/newview/llattachmentsmgr.cpp | 7 ++++- 3 files changed, 55 insertions(+), 27 deletions(-) (limited to 'indra/newview') 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()); diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index d7ef5fcba7..ac619631c0 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -3898,37 +3898,48 @@ void dumpAttachmentSet(const std::set& atts, const std::string& msg) void LLAppearanceMgr::registerAttachment(const LLUUID& item_id) { - gInventory.addChangedMask(LLInventoryObserver::LABEL, item_id); - - if (mAttachmentInvLinkEnabled) - { - // we have to pass do_update = true to call LLAppearanceMgr::updateAppearanceFromCOF. - // it will trigger gAgentWariables.notifyLoadingFinished() - // But it is not acceptable solution. See EXT-7777 - if (!isLinkedInCOF(item_id)) - { - LLPointer cb = new LLUpdateAppearanceOnDestroy(); - LLAppearanceMgr::addCOFItemLink(item_id, cb); // Add COF link for item. - } - } - else - { - //LL_INFOS() << "no link changes, inv link not enabled" << LL_ENDL; - } + LLViewerInventoryItem *item = gInventory.getItem(item_id); + LL_DEBUGS("Avatar") << "registering attachment " + << (item ? item->getName() : "UNKNOWN") << " " << item_id << LL_ENDL; + gInventory.addChangedMask(LLInventoryObserver::LABEL, item_id); + + if (mAttachmentInvLinkEnabled) + { + // we have to pass do_update = true to call LLAppearanceMgr::updateAppearanceFromCOF. + // it will trigger gAgentWariables.notifyLoadingFinished() + // But it is not acceptable solution. See EXT-7777 + if (!isLinkedInCOF(item_id)) + { + LL_DEBUGS("Avatar") << "adding COF link for attachment " + << (item ? item->getName() : "UNKNOWN") << " " << item_id << LL_ENDL; + // FIXME replace with just a call to request bake update? + LLPointer cb = new LLUpdateAppearanceOnDestroy(); + LLAppearanceMgr::addCOFItemLink(item_id, cb); // Add COF link for item. + } + } + else + { + //LL_INFOS() << "no link changes, inv link not enabled" << LL_ENDL; + } } void LLAppearanceMgr::unregisterAttachment(const LLUUID& item_id) { - gInventory.addChangedMask(LLInventoryObserver::LABEL, item_id); + LLViewerInventoryItem *item = gInventory.getItem(item_id); + LL_DEBUGS("Avatar") << "unregistering attachment " + << (item ? item->getName() : "UNKNOWN") << " " << item_id << LL_ENDL; + gInventory.addChangedMask(LLInventoryObserver::LABEL, item_id); - if (mAttachmentInvLinkEnabled) - { - LLAppearanceMgr::removeCOFItemLinks(item_id); - } - else - { - //LL_INFOS() << "no link changes, inv link not enabled" << LL_ENDL; - } + if (mAttachmentInvLinkEnabled) + { + LL_DEBUGS("Avatar") << "removing COF link for attachment " + << (item ? item->getName() : "UNKNOWN") << " " << item_id << LL_ENDL; + LLAppearanceMgr::removeCOFItemLinks(item_id); + } + else + { + //LL_INFOS() << "no link changes, inv link not enabled" << LL_ENDL; + } } BOOL LLAppearanceMgr::getIsInCOF(const LLUUID& obj_id) const diff --git a/indra/newview/llattachmentsmgr.cpp b/indra/newview/llattachmentsmgr.cpp index 256980eb04..d7c4a24fb5 100755 --- a/indra/newview/llattachmentsmgr.cpp +++ b/indra/newview/llattachmentsmgr.cpp @@ -60,6 +60,8 @@ void LLAttachmentsMgr::onIdle(void *) LLAttachmentsMgr::instance().onIdle(); } +// FIXME this is basically the same code as LLAgentWearables::userAttachMultipleAttachments(), +// should consolidate. void LLAttachmentsMgr::onIdle() { // Make sure we got a region before trying anything else @@ -73,7 +75,8 @@ void LLAttachmentsMgr::onIdle() { return; } - + 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; const S32 OBJECTS_PER_PACKET = 4; @@ -113,6 +116,8 @@ void LLAttachmentsMgr::onIdle() LL_INFOS() << "Attempted to add non-existant item ID:" << attachment.mItemID << LL_ENDL; continue; } + LL_DEBUGS("Avatar") << "requesting " << item->getName() + << " " << item->getLinkedUUID() << LL_ENDL; S32 attachment_pt = attachment.mAttachmentPt; if (attachment.mAdd) attachment_pt |= ATTACHMENT_ADD; -- 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/app_settings/logcontrol.xml | 1 + indra/newview/llagentwearables.cpp | 8 +++--- indra/newview/llappearancemgr.cpp | 44 ++++++++++++++++++++++--------- indra/newview/llappearancemgr.h | 9 +++++++ indra/newview/llattachmentsmgr.cpp | 10 ++++--- indra/newview/llinventorybridge.cpp | 24 +++-------------- indra/newview/llvoavatar.cpp | 18 +++++++++++++ 7 files changed, 73 insertions(+), 41 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/logcontrol.xml b/indra/newview/app_settings/logcontrol.xml index 15cb5bc0eb..29639bb9c2 100755 --- a/indra/newview/app_settings/logcontrol.xml +++ b/indra/newview/app_settings/logcontrol.xml @@ -42,6 +42,7 @@ tags + Avatar