summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2015-02-20 15:54:27 -0500
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2015-02-20 15:54:27 -0500
commit7b99314d846483167c665fabf8092e604554321c (patch)
treeb7969f6399692f16f041295a5447e8425db85095 /indra/newview
parent1f2404aa29249f94ec987a0fe9e9cc5fa1cd634b (diff)
MAINT-4653, DRTVWR-397 WIP - more code for tracking attachment operations, smarter handling of multiple requests.
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/app_settings/logcontrol.xml1
-rwxr-xr-xindra/newview/llagentwearables.cpp8
-rwxr-xr-xindra/newview/llappearancemgr.cpp44
-rwxr-xr-xindra/newview/llappearancemgr.h9
-rwxr-xr-xindra/newview/llattachmentsmgr.cpp10
-rwxr-xr-xindra/newview/llinventorybridge.cpp24
-rwxr-xr-xindra/newview/llvoavatar.cpp18
7 files changed, 73 insertions, 41 deletions
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 @@
</array>
<key>tags</key>
<array>
+ <string>Avatar</string>
<!-- sample entry for debugging specific items
<string>Inventory</string>
<string>SceneLoadTiming</string>
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());
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp
index ac619631c0..ff645e2c9f 100755
--- a/indra/newview/llappearancemgr.cpp
+++ b/indra/newview/llappearancemgr.cpp
@@ -525,6 +525,12 @@ LLUpdateAppearanceAndEditWearableOnDestroy::LLUpdateAppearanceAndEditWearableOnD
{
}
+LLRequestAppearanceUpdateOnDestroy::~LLRequestAppearanceUpdateOnDestroy()
+{
+ LL_DEBUGS("Avatar") << "ATT requesting server appearance update" << LL_ENDL;
+ LLAppearanceMgr::instance().requestServerAppearanceUpdate();
+}
+
void edit_wearable_and_customize_avatar(LLUUID item_id)
{
// Start editing the item if previously requested.
@@ -828,6 +834,12 @@ void LLWearableHoldingPattern::onAllComplete()
// pre-attachment states.
gAgentAvatarp->clearAttachmentPosOverrides();
+ if (objects_to_remove.size() || items_to_add.size())
+ {
+ LL_DEBUGS("Avatar") << "ATT will remove " << objects_to_remove.size()
+ << " and add " << items_to_add.size() << " items" << LL_ENDL;
+ }
+
// Take off the attachments that will no longer be in the outfit.
LLAgentWearables::userRemoveMultipleAttachments(objects_to_remove);
@@ -1402,20 +1414,26 @@ bool LLAppearanceMgr::wearItemOnAvatar(const LLUUID& item_id_to_wear,
break;
case LLAssetType::AT_BODYPART:
- // TODO: investigate wearables may not be loaded at this point EXT-8231
-
- // Remove the existing wearables of the same type.
- // Remove existing body parts anyway because we must not be able to wear e.g. two skins.
- removeCOFLinksOfType(item_to_wear->getWearableType());
- if (!cb && do_update)
{
- cb = new LLUpdateAppearanceAndEditWearableOnDestroy(item_id_to_wear);
+ // TODO: investigate wearables may not be loaded at this point EXT-8231
+
+ // Remove the existing wearables of the same type.
+ // Remove existing body parts anyway because we must not be able to wear e.g. two skins.
+ removeCOFLinksOfType(item_to_wear->getWearableType());
+ if (!cb && do_update)
+ {
+ cb = new LLUpdateAppearanceAndEditWearableOnDestroy(item_id_to_wear);
+ }
+ addCOFItemLink(item_to_wear, cb);
}
- addCOFItemLink(item_to_wear, cb);
break;
case LLAssetType::AT_OBJECT:
- rez_attachment(item_to_wear, NULL, replace);
+ {
+ LL_DEBUGS("Avatar") << "ATT wearing object. calling rez_attachment, item " << item_to_wear->getName()
+ << " id " << item_to_wear->getLinkedUUID() << LL_ENDL;
+ rez_attachment(item_to_wear, NULL, replace);
+ }
break;
default: return false;;
@@ -3230,7 +3248,7 @@ void RequestAgentUpdateAppearanceResponder::onRequestRequested()
}
// Actually send the request.
- LL_DEBUGS("Avatar") << "Will send request for cof_version " << cof_version << LL_ENDL;
+ LL_DEBUGS("Avatar") << "ATT sending bake request for cof_version " << cof_version << LL_ENDL;
mRetryPolicy->reset();
sendRequest();
}
@@ -3899,7 +3917,7 @@ void dumpAttachmentSet(const std::set<LLUUID>& atts, const std::string& msg)
void LLAppearanceMgr::registerAttachment(const LLUUID& item_id)
{
LLViewerInventoryItem *item = gInventory.getItem(item_id);
- LL_DEBUGS("Avatar") << "registering attachment "
+ LL_DEBUGS("Avatar") << "ATT registering attachment "
<< (item ? item->getName() : "UNKNOWN") << " " << item_id << LL_ENDL;
gInventory.addChangedMask(LLInventoryObserver::LABEL, item_id);
@@ -3910,10 +3928,10 @@ void LLAppearanceMgr::registerAttachment(const LLUUID& item_id)
// But it is not acceptable solution. See EXT-7777
if (!isLinkedInCOF(item_id))
{
- LL_DEBUGS("Avatar") << "adding COF link for attachment "
+ LL_DEBUGS("Avatar") << "ATT adding COF link for attachment "
<< (item ? item->getName() : "UNKNOWN") << " " << item_id << LL_ENDL;
// FIXME replace with just a call to request bake update?
- LLPointer<LLInventoryCallback> cb = new LLUpdateAppearanceOnDestroy();
+ LLPointer<LLInventoryCallback> cb = new LLRequestAppearanceUpdateOnDestroy();
LLAppearanceMgr::addCOFItemLink(item_id, cb); // Add COF link for item.
}
}
diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h
index 7742a19c07..3799c89757 100755
--- a/indra/newview/llappearancemgr.h
+++ b/indra/newview/llappearancemgr.h
@@ -311,6 +311,15 @@ private:
LLUUID mItemID;
};
+class LLRequestAppearanceUpdateOnDestroy: public LLInventoryCallback
+{
+public:
+ LLRequestAppearanceUpdateOnDestroy() {}
+ ~LLRequestAppearanceUpdateOnDestroy();
+
+ /* virtual */ void fire(const LLUUID& item_id) {}
+};
+
LLUUID findDescendentCategoryIDByName(const LLUUID& parent_id,const std::string& name);
// Invoke a given callable after category contents are fully fetched.
diff --git a/indra/newview/llattachmentsmgr.cpp b/indra/newview/llattachmentsmgr.cpp
index d7c4a24fb5..8103d89955 100755
--- a/indra/newview/llattachmentsmgr.cpp
+++ b/indra/newview/llattachmentsmgr.cpp
@@ -47,6 +47,10 @@ void LLAttachmentsMgr::addAttachment(const LLUUID& item_id,
const U8 attachment_pt,
const BOOL add)
{
+ LLViewerInventoryItem *item = gInventory.getItem(item_id);
+ LL_DEBUGS("Avatar") << "ATT adding attachment to mPendingAttachments "
+ << (item ? item->getName() : "UNKNOWN") << " id " << item_id << LL_ENDL;
+
AttachmentsInfo attachment;
attachment.mItemID = item_id;
attachment.mAttachmentPt = attachment_pt;
@@ -75,7 +79,7 @@ void LLAttachmentsMgr::onIdle()
{
return;
}
- LL_DEBUGS("Avatar") << "attaching multiple, total obj_count " << obj_count << LL_ENDL;
+ LL_DEBUGS("Avatar") << "ATT [RezMultipleAttachmentsFromInv] attaching multiple from mPendingAttachments, total obj_count " << obj_count << LL_ENDL;
// Limit number of packets to send
const S32 MAX_PACKETS_TO_SEND = 10;
@@ -113,10 +117,10 @@ void LLAttachmentsMgr::onIdle()
LLViewerInventoryItem* item = gInventory.getItem(attachment.mItemID);
if (!item)
{
- LL_INFOS() << "Attempted to add non-existant item ID:" << attachment.mItemID << LL_ENDL;
+ LL_INFOS() << "Attempted to add non-existent item ID:" << attachment.mItemID << LL_ENDL;
continue;
}
- LL_DEBUGS("Avatar") << "requesting " << item->getName()
+ LL_DEBUGS("Avatar") << "ATT requesting from mPendingAttachments " << item->getName()
<< " " << item->getLinkedUUID() << LL_ENDL;
S32 attachment_pt = attachment.mAttachmentPt;
if (attachment.mAdd)
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 1910656066..0af60c0953 100755
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -5374,6 +5374,8 @@ void rez_attachment(LLViewerInventoryItem* item, LLViewerJointAttachment* attach
LL_WARNS() << "duplicate attachment request, ignoring" << LL_ENDL;
return;
}
+
+ LL_DEBUGS("Avatar") << "ATT add rez request for " << item->getName() << " id " << item_id << LL_ENDL;
gAgentAvatarp->addAttachmentRequest(item_id);
S32 attach_pt = 0;
@@ -5424,33 +5426,13 @@ bool confirm_attachment_rez(const LLSD& notification, const LLSD& response)
if (itemp)
{
- /*
- {
- U8 attachment_pt = notification["payload"]["attachment_point"].asInteger();
-
- LLMessageSystem* msg = gMessageSystem;
- msg->newMessageFast(_PREHASH_RezSingleAttachmentFromInv);
- msg->nextBlockFast(_PREHASH_AgentData);
- msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
- msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
- msg->nextBlockFast(_PREHASH_ObjectData);
- msg->addUUIDFast(_PREHASH_ItemID, itemp->getUUID());
- msg->addUUIDFast(_PREHASH_OwnerID, itemp->getPermissions().getOwner());
- msg->addU8Fast(_PREHASH_AttachmentPt, attachment_pt);
- pack_permissions_slam(msg, itemp->getFlags(), itemp->getPermissions());
- msg->addStringFast(_PREHASH_Name, itemp->getName());
- msg->addStringFast(_PREHASH_Description, itemp->getDescription());
- msg->sendReliable(gAgent.getRegion()->getHost());
- return false;
- }
- */
-
// Queue up attachments to be sent in next idle tick, this way the
// attachments are batched up all into one message versus each attachment
// being sent in its own separate attachments message.
U8 attachment_pt = notification["payload"]["attachment_point"].asInteger();
BOOL is_add = notification["payload"]["is_add"].asBoolean();
+ LL_DEBUGS("Avatar") << "ATT calling addAttachment " << (itemp ? itemp->getName() : "UNKNOWN") << " id " << item_id << LL_ENDL;
LLAttachmentsMgr::instance().addAttachment(item_id,
attachment_pt,
is_add);
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index b54f341c31..f9a22690c2 100755
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -5730,10 +5730,21 @@ LLViewerJointAttachment* LLVOAvatar::getTargetAttachmentPoint(LLViewerObject* vi
//-----------------------------------------------------------------------------
const LLViewerJointAttachment *LLVOAvatar::attachObject(LLViewerObject *viewer_object)
{
+ if (isSelf())
+ {
+ const LLUUID& item_id = viewer_object->getAttachmentItemID();
+ LLViewerInventoryItem *item = gInventory.getItem(item_id);
+ LL_DEBUGS("Avatar") << "ATT attaching object "
+ << (item ? item->getName() : "UNKNOWN") << " id " << item_id << LL_ENDL;
+ }
LLViewerJointAttachment* attachment = getTargetAttachmentPoint(viewer_object);
if (!attachment || !attachment->addObject(viewer_object))
{
+ const LLUUID& item_id = viewer_object->getAttachmentItemID();
+ LLViewerInventoryItem *item = gInventory.getItem(item_id);
+ LL_DEBUGS("Avatar") << "ATT attach failed "
+ << (item ? item->getName() : "UNKNOWN") << " id " << item_id << LL_ENDL;
return 0;
}
@@ -5793,6 +5804,13 @@ void LLVOAvatar::lazyAttach()
LLPointer<LLViewerObject> cur_attachment = mPendingAttachment[i];
if (cur_attachment->mDrawable)
{
+ if (isSelf())
+ {
+ const LLUUID& item_id = cur_attachment->getAttachmentItemID();
+ LLViewerInventoryItem *item = gInventory.getItem(item_id);
+ LL_DEBUGS("Avatar") << "ATT attaching object "
+ << (item ? item->getName() : "UNKNOWN") << " id " << item_id << LL_ENDL;
+ }
if (!attachObject(cur_attachment))
{ // Drop it
LL_WARNS() << "attachObject() failed for "