Reviewed Appearance-SyncAttach for Catznip-R11

-> none of the work on AIS fixes the original problem from 6 years ago (see VWR-18512 and previous changesets in Appearance-Misc patch branch)
  -> Repro:
       * folder with 1 attachment and 2 wearables
       * double-click (in rapid succession) wearable 1, then attachment A and finally wearable 2
       => after double-clicking wearable 2 the attachment will end up detached

--HG--
branch : Appearance-Misc
master
Kitty Barnett 2016-11-14 20:12:11 +01:00
parent 7b6add8ae9
commit bac1de6c68
5 changed files with 27 additions and 21 deletions

View File

@ -734,7 +734,7 @@ void LLWearableHoldingPattern::eraseTypeToRecover(LLWearableType::EType type)
mTypesToRecover.erase(type);
}
// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-06-19 (Catznip-2.1)
// [SL:KB] - Patch: Appearance-SyncAttach | Checked: Catznip-2.1
//void LLWearableHoldingPattern::setObjItems(const LLInventoryModel::item_array_t& items)
//{
// mObjItems = items;
@ -872,7 +872,7 @@ void LLWearableHoldingPattern::onAllComplete()
//
// // Take off the attachments that will no longer be in the outfit.
// LLAgentWearables::userRemoveMultipleAttachments(objects_to_remove);
// Update wearables.
LL_INFOS("Avatar") << self_av_string() << "HP " << index() << " updating agent wearables with "
<< mResolved << " wearable items " << LL_ENDL;
@ -887,7 +887,7 @@ void LLWearableHoldingPattern::onAllComplete()
// LLViewerObject *objectp = *it;
// gAgentAvatarp->addAttachmentPosOverridesForObject(objectp);
// }
//
// // Add new attachments to match those requested.
// LL_DEBUGS("Avatar") << self_av_string() << "Adding " << items_to_add.size() << " attachments" << LL_ENDL;
// LLAgentWearables::userAttachMultipleAttachments(items_to_add);
@ -2415,7 +2415,7 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool enforce_item_restrictions,
<< " viewer desc count " << cof->getViewerDescendentCount() << LL_ENDL;
}
// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-09-22 (Catznip-2.2)
// [SL:KB] - Patch: Appearance-SyncAttach | Checked: Catznip-2.2
// Update attachments to match those requested.
if (isAgentAvatarValid())
{
@ -2439,6 +2439,7 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool enforce_item_restrictions,
}
}
// (Start of LL code from LLWearableHoldingPattern::onAllComplete())
LL_DEBUGS("Avatar") << self_av_string() << "Updating " << obj_items.size() << " attachments" << LL_ENDL;
LLAgentWearables::llvo_vec_t objects_to_remove;
@ -2451,6 +2452,7 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool enforce_item_restrictions,
// needed to get joint positions all slammed down to their
// pre-attachment states.
gAgentAvatarp->clearAttachmentPosOverrides();
// (End of LL code)
// Take off the attachments that will no longer be in the outfit.
// (but don't remove attachments until avatar is fully loaded - should reduce random attaching/detaching/reattaching at log-on)
@ -2459,17 +2461,19 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool enforce_item_restrictions,
LL_DEBUGS("Avatar") << self_av_string() << "Removing " << objects_to_remove.size() << " attachments" << LL_ENDL;
LLAgentWearables::userRemoveMultipleAttachments(objects_to_remove);
}
// (Start of LL code from LLWearableHoldingPattern::onAllComplete())
// Restore attachment pos overrides for the attachments that are remaining in the outfit.
for (LLAgentWearables::llvo_vec_t::iterator it = objects_to_retain.begin(); it != objects_to_retain.end(); ++it)
{
LLViewerObject *objectp = *it;
gAgentAvatarp->addAttachmentPosOverridesForObject(objectp);
}
// Add new attachments to match those requested.
LL_DEBUGS("Avatar") << self_av_string() << "Adding " << items_to_add.size() << " attachments" << LL_ENDL;
LLAgentWearables::userAttachMultipleAttachments(items_to_add);
// (End of LL code)
}
// [/SL:KB]
@ -3920,7 +3924,7 @@ void LLAppearanceMgr::removeItemsFromAvatar(const uuid_vec_t& ids_to_remove, LLP
removeCOFItemLinks(linked_item_id, cb, immediate_delete);
// [/SL:KB]
// removeCOFItemLinks(linked_item_id, cb);
// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2015-03-01 (Catznip-3.7)
// [SL:KB] - Patch: Appearance-SyncAttach | Checked: Catznip-3.7
LLAttachmentsMgr::instance().clearPendingAttachmentLink(linked_item_id);
// [/SL:KB]
addDoomedTempAttachment(linked_item_id);

View File

@ -146,7 +146,7 @@ public:
// Attachment link management
void unregisterAttachment(const LLUUID& item_id);
void registerAttachment(const LLUUID& item_id);
// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2015-06-24 (Catznip-3.7)
// [SL:KB] - Patch: Appearance-SyncAttach | Checked: Catznip-3.7
bool getAttachmentInvLinkEnable() { return mAttachmentInvLinkEnabled; }
// [/SL:KB]
void setAttachmentInvLinkEnable(bool val);

View File

@ -41,7 +41,7 @@ const F32 MAX_ATTACHMENT_REQUEST_LIFETIME = 30.0F;
const F32 MIN_RETRY_REQUEST_TIME = 5.0F;
const F32 MAX_BAD_COF_TIME = 30.0F;
// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2015-06-24 (Catznip-3.7)
// [SL:KB] - Patch: Appearance-SyncAttach | Checked: Catznip-3.7
class LLRegisterAttachmentCallback : public LLRequestServerAppearanceUpdateOnDestroy
{
public:
@ -50,13 +50,14 @@ public:
{
}
/*virtual*/ ~LLRegisterAttachmentCallback()
~LLRegisterAttachmentCallback() override
{
}
/*virtual*/ void fire(const LLUUID& idItem)
void fire(const LLUUID& idItem) override
{
LLAttachmentsMgr::instance().onRegisterAttachmentComplete(idItem);
LLRequestServerAppearanceUpdateOnDestroy::fire(idItem);
}
};
// [/SL:KB]
@ -99,7 +100,7 @@ void LLAttachmentsMgr::addAttachmentRequest(const LLUUID& item_id,
void LLAttachmentsMgr::onAttachmentRequested(const LLUUID& item_id)
{
// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2015-06-24 (Catznip-3.7)
// [SL:KB] - Patch: Appearance-SyncAttach | Checked: Catznip-3.7
if (item_id.isNull())
return;
// [/SL:KB]
@ -246,7 +247,7 @@ void LLAttachmentsMgr::linkRecentlyArrivedAttachments()
{
if (mRecentlyArrivedAttachments.size())
{
// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2015-06-24 (Catznip-3.7)
// [SL:KB] - Patch: Appearance-SyncAttach | Checked: Catznip-3.7
if (!LLAppearanceMgr::instance().getAttachmentInvLinkEnable())
{
return;
@ -291,7 +292,7 @@ void LLAttachmentsMgr::linkRecentlyArrivedAttachments()
}
if (ids_to_link.size())
{
// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2015-06-24 (Catznip-3.7)
// [SL:KB] - Patch: Appearance-SyncAttach | Checked: Catznip-3.7
LLPointer<LLInventoryCallback> cb = new LLRegisterAttachmentCallback();
for (const LLUUID& idAttach : ids_to_link)
{
@ -313,7 +314,7 @@ void LLAttachmentsMgr::linkRecentlyArrivedAttachments()
}
}
// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-09-18 (Catznip-2.2)
// [SL:KB] - Patch: Appearance-SyncAttach | Checked: Catznip-2.2
bool LLAttachmentsMgr::getPendingAttachments(std::set<LLUUID>& ids) const
{
ids.clear();
@ -476,7 +477,7 @@ void LLAttachmentsMgr::onDetachRequested(const LLUUID& inv_item_id)
void LLAttachmentsMgr::onDetachCompleted(const LLUUID& inv_item_id)
{
// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-10-05 (Catznip-2.2)
// [SL:KB] - Patch: Appearance-SyncAttach | Checked: Catznip-2.2
// (mRecentlyArrivedAttachments doesn't need pruning since it'll check the attachment is actually worn before linking)
clearPendingAttachmentLink(inv_item_id);
// [/SL:KB]
@ -506,11 +507,12 @@ void LLAttachmentsMgr::onDetachCompleted(const LLUUID& inv_item_id)
bool LLAttachmentsMgr::isAttachmentStateComplete() const
{
// [SL:KB] - Patch: Appearance-Misc | Checked: Catznip-4.
// [SL:KB] - Patch: Appearance-Misc | Checked: Catznip-4.3
return mPendingAttachments.empty()
&& mAttachmentRequests.empty()
&& mDetachRequests.empty()
&& mRecentlyArrivedAttachments.empty();
&& mRecentlyArrivedAttachments.empty()
&& mPendingAttachLinks.empty();
// [/SL:KB]
// return mPendingAttachments.empty()
// && mAttachmentRequests.empty()

View File

@ -89,7 +89,7 @@ public:
bool isAttachmentStateComplete() const;
// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-09-18 (Catznip-2.1)
// [SL:KB] - Patch: Appearance-SyncAttach | Checked: Catznip-2.1
public:
void clearPendingAttachmentLink(const LLUUID& idItem);
bool getPendingAttachments(std::set<LLUUID>& ids) const;
@ -136,7 +136,7 @@ private:
std::set<LLUUID> mRecentlyArrivedAttachments;
LLTimer mCOFLinkBatchTimer;
// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-09-18 (Catznip-2.1)
// [SL:KB] - Patch: Appearance-SyncAttach | Checked: Catznip-2.1
// Attachments that have pending link creation
std::set<LLUUID> mPendingAttachLinks;
// [/SL:KB]

View File

@ -6506,7 +6506,7 @@ BOOL LLVOAvatar::processFullyLoadedChange(bool loading)
BOOL LLVOAvatar::isFullyLoaded() const
{
// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-09-22 (Catznip-2.2)
// [SL:KB] - Patch: Appearance-SyncAttach | Checked: Catznip-2.2
// Changes to LLAppearanceMgr::updateAppearanceFromCOF() expect this function to actually return mFullyLoaded for gAgentAvatarp
return (mRenderUnloadedAvatar && !isSelf()) ||(mFullyLoaded);
// [/SL:KB]