Logging for attachments and their COF links

meow-7.2.2
Brad Payne (Vir Linden) 2015-02-18 16:44:36 -05:00
parent fad02b30ce
commit 1f2404aa29
3 changed files with 54 additions and 26 deletions

View File

@ -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());

View File

@ -3898,37 +3898,48 @@ void dumpAttachmentSet(const std::set<LLUUID>& atts, const std::string& msg)
void LLAppearanceMgr::registerAttachment(const LLUUID& item_id)
{
gInventory.addChangedMask(LLInventoryObserver::LABEL, item_id);
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))
{
LLPointer<LLInventoryCallback> 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;
}
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<LLInventoryCallback> 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

View File

@ -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;