From 0440fe4dccc44c9474c1ee05c506370350b94320 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Wed, 1 Sep 2010 12:02:48 -0400 Subject: VWR-22695 FIXED Adding attachments messaging is inefficient Single attachment request are now batched up and sent all at once as a single message. --- indra/newview/llinventorybridge.cpp | 43 ++++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 15 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index aff0bc4099..d7a5d4356d 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -34,6 +34,7 @@ #include "llagentcamera.h" #include "llagentwearables.h" #include "llappearancemgr.h" +#include "llattachmentsmgr.h" #include "llavataractions.h" #include "llfloateropenobject.h" #include "llfloaterreg.h" @@ -4062,22 +4063,34 @@ bool confirm_replace_attachment_rez(const LLSD& notification, const LLSD& respon if (itemp) { - U8 attachment_pt = notification["payload"]["attachment_point"].asInteger(); - + /* + { + 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; + } + */ - 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()); + // 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(); + LLAttachmentsMgr::instance().addAttachment(item_id, + attachment_pt, + FALSE); } } return false; -- cgit v1.2.3 From 592ebc9ec63b3c1e636fdd96c68353f97e298506 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Thu, 2 Sep 2010 15:34:54 -0400 Subject: VWR-22695 FIXED Adding attachments messaging is inefficient Superficial code cleanup of RezAttachment messaging. --- indra/newview/llinventorybridge.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index d7a5d4356d..78b5c10748 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -101,7 +101,7 @@ void dec_busy_count() void remove_inventory_category_from_avatar(LLInventoryCategory* category); void remove_inventory_category_from_avatar_step2( BOOL proceed, LLUUID category_id); bool move_task_inventory_callback(const LLSD& notification, const LLSD& response, LLMoveInv*); -bool confirm_replace_attachment_rez(const LLSD& notification, const LLSD& response); +bool confirm_attachment_rez(const LLSD& notification, const LLSD& response); void teleport_via_landmark(const LLUUID& asset_id); // +=================================================+ @@ -4025,19 +4025,15 @@ void rez_attachment(LLViewerInventoryItem* item, LLViewerJointAttachment* attach } } - if (!replace) - { - attach_pt |= ATTACHMENT_ADD; - } - LLSD payload; payload["item_id"] = item_id; // Wear the base object in case this is a link. payload["attachment_point"] = attach_pt; + payload["is_add"] = !replace; if (replace && (attachment && attachment->getNumObjects() > 0)) { - LLNotificationsUtil::add("ReplaceAttachment", LLSD(), payload, confirm_replace_attachment_rez); + LLNotificationsUtil::add("ReplaceAttachment", LLSD(), payload, confirm_attachment_rez); } else { @@ -4045,7 +4041,7 @@ void rez_attachment(LLViewerInventoryItem* item, LLViewerJointAttachment* attach } } -bool confirm_replace_attachment_rez(const LLSD& notification, const LLSD& response) +bool confirm_attachment_rez(const LLSD& notification, const LLSD& response) { if (!gAgentAvatarp->canAttachMoreObjects()) { @@ -4088,14 +4084,16 @@ bool confirm_replace_attachment_rez(const LLSD& notification, const LLSD& respon // 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(); + LLAttachmentsMgr::instance().addAttachment(item_id, attachment_pt, - FALSE); + is_add); } } return false; } -static LLNotificationFunctorRegistration confirm_replace_attachment_rez_reg("ReplaceAttachment", confirm_replace_attachment_rez); +static LLNotificationFunctorRegistration confirm_replace_attachment_rez_reg("ReplaceAttachment", confirm_attachment_rez); void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { -- cgit v1.2.3 From 074f4c8c59eebbf109c2846c35cdab05f3997db8 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Wed, 8 Sep 2010 13:36:42 -0400 Subject: VWR-22901 FIXED Backwards compatibility for multiattachments Better handling of invalid attachment points. You can now detach points that are incompatible with your viewer, versus having those permanently in the COF> --- indra/newview/llinventorybridge.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 78b5c10748..ab75b9ef8d 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3979,22 +3979,22 @@ std::string LLObjectBridge::getLabelSuffix() const { if (get_is_item_worn(mUUID)) { - if (!isAgentAvatarValid()) + if (!isAgentAvatarValid()) // Error condition, can't figure out attach point { return LLItemBridge::getLabelSuffix() + LLTrans::getString("worn"); } - std::string attachment_point_name = gAgentAvatarp->getAttachedPointName(mUUID); - + if (attachment_point_name == LLStringUtil::null) // Error condition, invalid attach point + { + attachment_point_name = "Invalid Attachment"; + } // e.g. "(worn on ...)" / "(attached to ...)" LLStringUtil::format_map_t args; args["[ATTACHMENT_POINT]"] = LLTrans::getString(attachment_point_name); + return LLItemBridge::getLabelSuffix() + LLTrans::getString("WornOnAttachmentPoint", args); } - else - { - return LLItemBridge::getLabelSuffix(); - } + return LLItemBridge::getLabelSuffix(); } void rez_attachment(LLViewerInventoryItem* item, LLViewerJointAttachment* attachment, bool replace) -- cgit v1.2.3 From 4a8d59367a695fedff21a71d35bcad3f729f6060 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Wed, 8 Sep 2010 16:27:42 -0400 Subject: dummy commit test --- indra/newview/llinventorybridge.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index ab75b9ef8d..f6b7b41314 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -35,7 +35,7 @@ #include "llagentwearables.h" #include "llappearancemgr.h" #include "llattachmentsmgr.h" -#include "llavataractions.h" +#include "llavataractions.h" #include "llfloateropenobject.h" #include "llfloaterreg.h" #include "llfloaterworldmap.h" -- cgit v1.2.3 From f981e5af3fb3d3f575bb40ed67eca83e20acbd2f Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Wed, 8 Sep 2010 17:15:58 -0400 Subject: dummy commit test --- indra/newview/llinventorybridge.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index f6b7b41314..3640dc708b 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -41,7 +41,7 @@ #include "llfloaterworldmap.h" #include "llfriendcard.h" #include "llgesturemgr.h" -#include "llgiveinventory.h" +#include "llgiveinventory.h" #include "llimfloater.h" #include "llimview.h" #include "llinventoryclipboard.h" -- cgit v1.2.3 From bf7201cf8b3a77a2a4b77287ceb0c4821802bae0 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Thu, 9 Sep 2010 17:06:37 -0400 Subject: dummy commit test --- indra/newview/llinventorybridge.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 3640dc708b..02e7f0b9e2 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -28,7 +28,7 @@ #include "llinventorybridge.h" // external projects -#include "lltransfersourceasset.h" +#include "lltransfersourceasset.h" #include "llagent.h" #include "llagentcamera.h" -- cgit v1.2.3