From c3488d1fc64fb3f2bc5ad3a5a0fd5722eb574a4c Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 25 Jun 2012 13:50:39 -0400 Subject: SH-3172 WIP - useServerTextureBaking() func --- indra/newview/llappearancemgr.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index faadfb4b87..5d2ff1b40f 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -2581,8 +2581,13 @@ void LLAppearanceMgr::updateClothingOrderingInfo(LLUUID cat_id, bool update_base if (inventory_changed) gInventory.notifyObservers(); } - - +// Should be true iff both the appropriate debug setting is enabled +// and the corresponding cap has been found. +bool useServerTextureBaking() +{ + // TODO: add cap check. + return gSavedSettings.getBOOL("UseServerTextureBaking"); +} class LLShowCreatedOutfit: public LLInventoryCallback { -- cgit v1.2.3 From 99c1c64aa494c0b9085f0766b951fedfb60ce412 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 26 Jun 2012 16:05:03 -0400 Subject: SH-3172 WIP - fix --- indra/newview/llappearancemgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 5d2ff1b40f..02a90c60ec 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -2583,7 +2583,7 @@ void LLAppearanceMgr::updateClothingOrderingInfo(LLUUID cat_id, bool update_base // Should be true iff both the appropriate debug setting is enabled // and the corresponding cap has been found. -bool useServerTextureBaking() +bool LLAppearanceMgr::useServerTextureBaking() { // TODO: add cap check. return gSavedSettings.getBOOL("UseServerTextureBaking"); -- cgit v1.2.3 From fe01e64f9756641756d18d7aab7079bfee21c089 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 29 Jun 2012 13:08:00 -0400 Subject: SH-3226 WIP - request appearance update request, connects to UpdateAgentAppearance cap, in updateAppearanceFromCOF() --- indra/newview/llappearancemgr.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 02a90c60ec..d6cb910b4e 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1730,6 +1730,12 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering) // the saved outfit stored as a folder link updateIsDirty(); + // Send server request for appearance update + if (useServerTextureBaking()) + { + requestServerAppearanceUpdate(); + } + //dumpCat(getCOF(),"COF, start"); bool follow_folder_links = true; @@ -2589,6 +2595,30 @@ bool LLAppearanceMgr::useServerTextureBaking() return gSavedSettings.getBOOL("UseServerTextureBaking"); } +class RequestAgentUpdateAppearanceResponder: public LLHTTPClient::Responder +{ +public: + RequestAgentUpdateAppearanceResponder() {} + /*virtual*/ void error(U32 status, const std::string& reason) + { + llwarns << "appearance update request failed, reason: " << reason << llendl; + } +}; + +void LLAppearanceMgr::requestServerAppearanceUpdate() +{ + std::string url = gAgent.getRegion()->getCapability("UpdateAgentAppearance"); + if (!url.empty()) + { + LLSD body; + LLHTTPClient::post(url, body, new RequestAgentUpdateAppearanceResponder); + } + else + { + llwarns << "no cap for UpdateAgentAppearance" << llendl; + } +} + class LLShowCreatedOutfit: public LLInventoryCallback { public: -- cgit v1.2.3 From 4718ffebc1942ea1d94c8e8d2eca071d0d834bc2 Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Mon, 2 Jul 2012 18:17:56 -0400 Subject: FIX: renamed UpdateAgentAppearance to UpdateAvatarAppearance --- indra/newview/llappearancemgr.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index d6cb910b4e..480a8e0d73 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -2607,7 +2607,7 @@ public: void LLAppearanceMgr::requestServerAppearanceUpdate() { - std::string url = gAgent.getRegion()->getCapability("UpdateAgentAppearance"); + std::string url = gAgent.getRegion()->getCapability("UpdateAvatarAppearance"); if (!url.empty()) { LLSD body; @@ -2615,7 +2615,7 @@ void LLAppearanceMgr::requestServerAppearanceUpdate() } else { - llwarns << "no cap for UpdateAgentAppearance" << llendl; + llwarns << "no cap for UpdateAvatarAppearance" << llendl; } } -- cgit v1.2.3 From 6681b47d4f75433ef409ca3eaa0ea1e10161cc80 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 12 Jul 2012 11:09:27 -0400 Subject: SH-3267 WIP --- indra/newview/llappearancemgr.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 480a8e0d73..04c4220afd 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -925,6 +925,18 @@ const LLUUID LLAppearanceMgr::getCOF() const return gInventory.findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT); } +S32 LLAppearanceMgr::getCOFVersion() const +{ + LLViewerInventoryCategory *cof = gInventory.getCategory(getCOF()); + if (cof) + { + return cof->getVersion(); + } + else + { + return LLViewerInventoryCategory::VERSION_UNKNOWN; + } +} const LLViewerInventoryItem* LLAppearanceMgr::getBaseOutfitLink() { @@ -2611,6 +2623,7 @@ void LLAppearanceMgr::requestServerAppearanceUpdate() if (!url.empty()) { LLSD body; + body["cof_version"] = getCOFVersion(); LLHTTPClient::post(url, body, new RequestAgentUpdateAppearanceResponder); } else -- cgit v1.2.3 From 27c7b259b417d5843422e8bd4e8e480a186e44f4 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 12 Jul 2012 18:24:23 -0400 Subject: SH-3267 WIP --- indra/newview/llappearancemgr.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 04c4220afd..eb31358000 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -2623,8 +2623,11 @@ void LLAppearanceMgr::requestServerAppearanceUpdate() if (!url.empty()) { LLSD body; - body["cof_version"] = getCOFVersion(); + S32 cof_version = getCOFVersion(); + body["cof_version"] = cof_version; LLHTTPClient::post(url, body, new RequestAgentUpdateAppearanceResponder); + llassert(cof_version >= mLastUpdateRequestCOFVersion); + mLastUpdateRequestCOFVersion = cof_version; } else { @@ -2842,7 +2845,8 @@ LLAppearanceMgr::LLAppearanceMgr(): mAttachmentInvLinkEnabled(false), mOutfitIsDirty(false), mOutfitLocked(false), - mIsInUpdateAppearanceFromCOF(false) + mIsInUpdateAppearanceFromCOF(false), + mLastUpdateRequestCOFVersion(LLViewerInventoryCategory::VERSION_UNKNOWN) { LLOutfitObserver& outfit_observer = LLOutfitObserver::instance(); -- cgit v1.2.3 From 409be9dcc4e372385f0fb0de274a4b17913bd124 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 13 Jul 2012 16:59:57 -0400 Subject: SH-3267 WIP - extract cof version from avatar appearance message, use to reject stale updates --- indra/newview/llappearancemgr.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index eb31358000..e27a21f7fd 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -2619,20 +2619,22 @@ public: void LLAppearanceMgr::requestServerAppearanceUpdate() { - std::string url = gAgent.getRegion()->getCapability("UpdateAvatarAppearance"); - if (!url.empty()) + if (!gAgent.getRegion()) { - LLSD body; - S32 cof_version = getCOFVersion(); - body["cof_version"] = cof_version; - LLHTTPClient::post(url, body, new RequestAgentUpdateAppearanceResponder); - llassert(cof_version >= mLastUpdateRequestCOFVersion); - mLastUpdateRequestCOFVersion = cof_version; + llwarns << "Region not set, cannot request server appearance update" << llendl; } - else + std::string url = gAgent.getRegion()->getCapability("UpdateAvatarAppearance"); + if (url.empty()) { llwarns << "no cap for UpdateAvatarAppearance" << llendl; } + + LLSD body; + S32 cof_version = getCOFVersion(); + body["cof_version"] = cof_version; + LLHTTPClient::post(url, body, new RequestAgentUpdateAppearanceResponder); + llassert(cof_version >= mLastUpdateRequestCOFVersion); + mLastUpdateRequestCOFVersion = cof_version; } class LLShowCreatedOutfit: public LLInventoryCallback -- cgit v1.2.3 From e7a63cb356d49925131edfadb5a0e8d5368a9096 Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Tue, 14 Aug 2012 17:12:01 -0400 Subject: SH-3310 WIP setting up architecture for switching texture baking on per-region basis Set up an architecture to minimize the use of the baked texture debug setting. Instead concentrating on setting a per-region flag at the region handshake point. This should be processed once the new regions are using the updated handshake. The debug setting is being used in this one location as a placeholder. Builds, but not fully tested/commented yet, passing this work off to Vir. --- indra/newview/llappearancemgr.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index e27a21f7fd..237cc0b9f3 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1743,7 +1743,7 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering) updateIsDirty(); // Send server request for appearance update - if (useServerTextureBaking()) + if (gAgent.getRegion() && gAgent.getRegion()->getCentralBakeVersion()) { requestServerAppearanceUpdate(); } @@ -2599,14 +2599,6 @@ void LLAppearanceMgr::updateClothingOrderingInfo(LLUUID cat_id, bool update_base if (inventory_changed) gInventory.notifyObservers(); } -// Should be true iff both the appropriate debug setting is enabled -// and the corresponding cap has been found. -bool LLAppearanceMgr::useServerTextureBaking() -{ - // TODO: add cap check. - return gSavedSettings.getBOOL("UseServerTextureBaking"); -} - class RequestAgentUpdateAppearanceResponder: public LLHTTPClient::Responder { public: -- cgit v1.2.3 From 73dbcc10c5b35e2b55a454e600e86ddd7d24399d Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 15 Aug 2012 14:28:05 -0400 Subject: requestServerAppearanceUpdate bails out if corresponding cap is null --- indra/newview/llappearancemgr.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 3e02f98933..5f1a880ebd 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -2619,7 +2619,8 @@ void LLAppearanceMgr::requestServerAppearanceUpdate() std::string url = gAgent.getRegion()->getCapability("UpdateAvatarAppearance"); if (url.empty()) { - llwarns << "no cap for UpdateAvatarAppearance" << llendl; + llwarns << "NO CAP for UpdateAvatarAppearance. This is a bug." << llendl; + return; } LLSD body; -- cgit v1.2.3 From 2db20dd01b12be830e8b5ac58172e9963b73eba1 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 20 Aug 2012 18:11:07 -0400 Subject: SH-3625 WIP - removeItem(s)FromAvatar use updateAppearanceFromCOF. Some but not all remove code goes through these. --- indra/newview/llappearancemgr.cpp | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 5f1a880ebd..0b425b656c 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1160,11 +1160,13 @@ void LLAppearanceMgr::takeOffOutfit(const LLUUID& cat_id) LLInventoryModel::item_array_t::const_iterator it = items.begin(); const LLInventoryModel::item_array_t::const_iterator it_end = items.end(); + uuid_vec_t uuids_to_remove; for( ; it_end != it; ++it) { LLViewerInventoryItem* item = *it; - removeItemFromAvatar(item->getUUID()); + uuids_to_remove.push_back(item->getUUID()); } + removeItemsFromAvatar(uuids_to_remove); } // Create a copy of src_id + contents as a subfolder of dst_id. @@ -2706,8 +2708,24 @@ void LLAppearanceMgr::wearBaseOutfit() updateCOF(base_outfit_id); } +void LLAppearanceMgr::removeItemsFromAvatar(const uuid_vec_t& ids_to_remove) +{ + for (uuid_vec_t::const_iterator it = ids_to_remove.begin(); it != ids_to_remove.end(); ++it) + { + const LLUUID& id_to_remove = *it; + const LLUUID& linked_item_id = gInventory.getLinkedItemID(id_to_remove); + removeCOFItemLinks(linked_item_id,false); + } + updateAppearanceFromCOF(); +} + void LLAppearanceMgr::removeItemFromAvatar(const LLUUID& id_to_remove) { +#if 1 + LLUUID linked_item_id = gInventory.getLinkedItemID(id_to_remove); + removeCOFItemLinks(linked_item_id,false); + updateAppearanceFromCOF(); +#else LLViewerInventoryItem * item_to_remove = gInventory.getItem(id_to_remove); if (!item_to_remove) return; @@ -2733,6 +2751,7 @@ void LLAppearanceMgr::removeItemFromAvatar(const LLUUID& id_to_remove) // Also we can't check is link was successfully removed from COF since in case // deleting attachment link removing performs asynchronously in process_kill_object callback. removeCOFItemLinks(id_to_remove,false); +#endif } bool LLAppearanceMgr::moveWearable(LLViewerInventoryItem* item, bool closer_to_body) -- cgit v1.2.3 From b232919c0a6d66582b57c8997fee7a99ab9bbddb Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 21 Aug 2012 17:03:42 -0400 Subject: SH-3625 WIP - consolidating code paths for wearable/attachment removal --- indra/newview/llappearancemgr.cpp | 51 ++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 28 deletions(-) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 0b425b656c..933049fa79 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -2215,6 +2215,29 @@ void LLAppearanceMgr::addEnsembleLink( LLInventoryCategory* cat, bool do_update #endif } +void LLAppearanceMgr::removeAllClothesFromAvatar() +{ + // Fetch worn clothes (i.e. the ones in COF). + LLInventoryModel::item_array_t clothing_items; + LLInventoryModel::cat_array_t dummy; + LLIsType is_clothing(LLAssetType::AT_CLOTHING); + gInventory.collectDescendentsIf(getCOF(), + dummy, + clothing_items, + LLInventoryModel::EXCLUDE_TRASH, + is_clothing, + false); + uuid_vec_t item_ids; + for (LLInventoryModel::item_array_t::iterator it = clothing_items.begin(); + it != clothing_items.end(); ++it) + { + item_ids.push_back((*it).get()->getLinkedUUID()); + } + + // Take them off by removing from COF. + removeItemsFromAvatar(item_ids); +} + void LLAppearanceMgr::removeCOFItemLinks(const LLUUID& item_id, bool do_update) { gInventory.addChangedMask(LLInventoryObserver::LABEL, item_id); @@ -2721,37 +2744,9 @@ void LLAppearanceMgr::removeItemsFromAvatar(const uuid_vec_t& ids_to_remove) void LLAppearanceMgr::removeItemFromAvatar(const LLUUID& id_to_remove) { -#if 1 LLUUID linked_item_id = gInventory.getLinkedItemID(id_to_remove); removeCOFItemLinks(linked_item_id,false); updateAppearanceFromCOF(); -#else - LLViewerInventoryItem * item_to_remove = gInventory.getItem(id_to_remove); - if (!item_to_remove) return; - - switch (item_to_remove->getType()) - { - case LLAssetType::AT_CLOTHING: - if (get_is_item_worn(id_to_remove)) - { - //*TODO move here the exact removing code from LLWearableBridge::removeItemFromAvatar in the future - LLWearableBridge::removeItemFromAvatar(item_to_remove); - } - break; - case LLAssetType::AT_OBJECT: - LLVOAvatarSelf::detachAttachmentIntoInventory(item_to_remove->getLinkedUUID()); - default: - break; - } - - // *HACK: Force to remove garbage from COF. - // Unworn links or objects can't be processed by existed removing functionality - // since it is not designed for such cases. As example attachment object can't be removed - // since sever don't sends message _PREHASH_KillObject in that case. - // Also we can't check is link was successfully removed from COF since in case - // deleting attachment link removing performs asynchronously in process_kill_object callback. - removeCOFItemLinks(id_to_remove,false); -#endif } bool LLAppearanceMgr::moveWearable(LLViewerInventoryItem* item, bool closer_to_body) -- cgit v1.2.3 From 40df1bba9707cdf35eb9583c2024b294da671a2a Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 21 Aug 2012 17:58:26 -0400 Subject: SH-3625 WIP - consolidating code paths for removal, removed dead code --- indra/newview/llappearancemgr.cpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 933049fa79..71b7298f5c 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -2238,6 +2238,38 @@ void LLAppearanceMgr::removeAllClothesFromAvatar() removeItemsFromAvatar(item_ids); } +void LLAppearanceMgr::removeAllAttachmentsFromAvatar() +{ + if (!isAgentAvatarValid()) return; + + LLAgentWearables::llvo_vec_t objects_to_remove; + + for (LLVOAvatar::attachment_map_t::iterator iter = gAgentAvatarp->mAttachmentPoints.begin(); + iter != gAgentAvatarp->mAttachmentPoints.end();) + { + LLVOAvatar::attachment_map_t::iterator curiter = iter++; + LLViewerJointAttachment* attachment = curiter->second; + for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin(); + attachment_iter != attachment->mAttachedObjects.end(); + ++attachment_iter) + { + LLViewerObject *attached_object = (*attachment_iter); + if (attached_object) + { + objects_to_remove.push_back(attached_object); + } + } + } + uuid_vec_t ids_to_remove; + for (LLAgentWearables::llvo_vec_t::iterator it = objects_to_remove.begin(); + it != objects_to_remove.end(); + ++it) + { + ids_to_remove.push_back((*it)->getAttachmentItemID()); + } + removeItemsFromAvatar(ids_to_remove); +} + void LLAppearanceMgr::removeCOFItemLinks(const LLUUID& item_id, bool do_update) { gInventory.addChangedMask(LLInventoryObserver::LABEL, item_id); -- cgit v1.2.3 From 01a229ecdf466bc183ad68b130b0bb2befcc1e6a Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 22 Aug 2012 15:27:34 -0400 Subject: SH-3625 WIP - consolidated a couple of attachment removal paths --- indra/newview/llappearancemgr.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 71b7298f5c..2ad6f50ba9 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -2765,6 +2765,10 @@ void LLAppearanceMgr::wearBaseOutfit() void LLAppearanceMgr::removeItemsFromAvatar(const uuid_vec_t& ids_to_remove) { + if (ids_to_remove.empty()) + { + llwarns << "called with empty list, nothing to do" << llendl; + } for (uuid_vec_t::const_iterator it = ids_to_remove.begin(); it != ids_to_remove.end(); ++it) { const LLUUID& id_to_remove = *it; -- cgit v1.2.3 From 6e2739b76c669275b9ad62aa1b888cfc891012eb Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 22 Aug 2012 16:16:54 -0400 Subject: SH-3625 - some associated cleanup, do_update field is useless in various calls because of possible race conditions --- indra/newview/llappearancemgr.cpp | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 2ad6f50ba9..2864338ef5 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -698,7 +698,7 @@ void LLWearableHoldingPattern::clearCOFLinksForMissingWearables() { // Wearable link that was never resolved; remove links to it from COF LL_INFOS("Avatar") << self_av_string() << "removing link for unresolved item " << data.mItemID.asString() << LL_ENDL; - LLAppearanceMgr::instance().removeCOFItemLinks(data.mItemID,false); + LLAppearanceMgr::instance().removeCOFItemLinks(data.mItemID); } } } @@ -812,7 +812,7 @@ void LLWearableHoldingPattern::handleLateArrivals() if (data.mWearable && data.mIsReplacement && replaced_types.find(data.mWearableType) != replaced_types.end()) { - LLAppearanceMgr::instance().removeCOFItemLinks(data.mItemID,false); + LLAppearanceMgr::instance().removeCOFItemLinks(data.mItemID); std::list::iterator clobber_ator = iter; ++iter; getFoundList().erase(clobber_ator); @@ -1052,7 +1052,7 @@ bool LLAppearanceMgr::wearItemOnAvatar(const LLUUID& item_id_to_wear, bool do_up if ((replace && wearable_count != 0) || (wearable_count >= LLAgentWearables::MAX_CLOTHING_PER_TYPE) ) { - removeCOFItemLinks(gAgentWearables.getWearableItemID(item_to_wear->getWearableType(), wearable_count-1), false); + removeCOFItemLinks(gAgentWearables.getWearableItemID(item_to_wear->getWearableType(), wearable_count-1)); } addCOFItemLink(item_to_wear, do_update, cb); } @@ -1062,7 +1062,7 @@ bool LLAppearanceMgr::wearItemOnAvatar(const LLUUID& item_id_to_wear, bool do_up // 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(), false); + removeCOFLinksOfType(item_to_wear->getWearableType()); addCOFItemLink(item_to_wear, do_update, cb); break; @@ -2270,7 +2270,7 @@ void LLAppearanceMgr::removeAllAttachmentsFromAvatar() removeItemsFromAvatar(ids_to_remove); } -void LLAppearanceMgr::removeCOFItemLinks(const LLUUID& item_id, bool do_update) +void LLAppearanceMgr::removeCOFItemLinks(const LLUUID& item_id) { gInventory.addChangedMask(LLInventoryObserver::LABEL, item_id); @@ -2288,13 +2288,9 @@ void LLAppearanceMgr::removeCOFItemLinks(const LLUUID& item_id, bool do_update) gInventory.purgeObject(item->getUUID()); } } - if (do_update) - { - LLAppearanceMgr::updateAppearanceFromCOF(); - } } -void LLAppearanceMgr::removeCOFLinksOfType(LLWearableType::EType type, bool do_update) +void LLAppearanceMgr::removeCOFLinksOfType(LLWearableType::EType type) { LLFindWearablesOfType filter_wearables_of_type(type); LLInventoryModel::cat_array_t cats; @@ -2310,11 +2306,6 @@ void LLAppearanceMgr::removeCOFLinksOfType(LLWearableType::EType type, bool do_u gInventory.purgeObject(item->getUUID()); } } - - if (do_update) - { - updateAppearanceFromCOF(); - } } bool sort_by_linked_uuid(const LLViewerInventoryItem* item1, const LLViewerInventoryItem* item2) @@ -2773,7 +2764,7 @@ void LLAppearanceMgr::removeItemsFromAvatar(const uuid_vec_t& ids_to_remove) { const LLUUID& id_to_remove = *it; const LLUUID& linked_item_id = gInventory.getLinkedItemID(id_to_remove); - removeCOFItemLinks(linked_item_id,false); + removeCOFItemLinks(linked_item_id); } updateAppearanceFromCOF(); } @@ -2781,7 +2772,7 @@ void LLAppearanceMgr::removeItemsFromAvatar(const uuid_vec_t& ids_to_remove) void LLAppearanceMgr::removeItemFromAvatar(const LLUUID& id_to_remove) { LLUUID linked_item_id = gInventory.getLinkedItemID(id_to_remove); - removeCOFItemLinks(linked_item_id,false); + removeCOFItemLinks(linked_item_id); updateAppearanceFromCOF(); } @@ -2956,7 +2947,7 @@ void LLAppearanceMgr::unregisterAttachment(const LLUUID& item_id) if (mAttachmentInvLinkEnabled) { - LLAppearanceMgr::removeCOFItemLinks(item_id, false); + LLAppearanceMgr::removeCOFItemLinks(item_id); } else { -- cgit v1.2.3 From 825cc7873251ad90720ab40221d689abed7b2ac8 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 30 Aug 2012 17:36:03 -0400 Subject: log appearance update requests and results --- indra/newview/llappearancemgr.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 2864338ef5..f71d9c7704 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -2651,7 +2651,18 @@ void LLAppearanceMgr::updateClothingOrderingInfo(LLUUID cat_id, bool update_base class RequestAgentUpdateAppearanceResponder: public LLHTTPClient::Responder { public: - RequestAgentUpdateAppearanceResponder() {} + RequestAgentUpdateAppearanceResponder() + { + llinfos << "request created" << llendl; + } + + // Successful completion. + /* virtual */ void result(const LLSD& content) + { + llinfos << "request OK" << llendl; + } + + // Error /*virtual*/ void error(U32 status, const std::string& reason) { llwarns << "appearance update request failed, reason: " << reason << llendl; -- cgit v1.2.3 From c355fb98d3f4040196b7b8586dc9328fccb906d2 Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Mon, 3 Sep 2012 06:12:50 +0000 Subject: Extracted texture baking system into llappearance library. --- indra/newview/llappearancemgr.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 3e02f98933..58a0b0fa5b 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -277,7 +277,7 @@ struct LLFoundData std::string mName; LLAssetType::EType mAssetType; LLWearableType::EType mWearableType; - LLWearable* mWearable; + LLViewerWearable* mWearable; bool mIsReplacement; }; @@ -301,7 +301,7 @@ public: void recoverMissingWearable(LLWearableType::EType type); void clearCOFLinksForMissingWearables(); - void onWearableAssetFetch(LLWearable *wearable); + void onWearableAssetFetch(LLViewerWearable *wearable); void onAllComplete(); typedef std::list found_list_t; @@ -327,7 +327,7 @@ private: typedef std::set type_set_hp; static type_set_hp sActiveHoldingPatterns; bool mIsMostRecent; - std::set mLateArrivals; + std::set mLateArrivals; bool mIsAllComplete; }; @@ -561,7 +561,7 @@ bool LLWearableHoldingPattern::pollFetchCompletion() class RecoveredItemLinkCB: public LLInventoryCallback { public: - RecoveredItemLinkCB(LLWearableType::EType type, LLWearable *wearable, LLWearableHoldingPattern* holder): + RecoveredItemLinkCB(LLWearableType::EType type, LLViewerWearable *wearable, LLWearableHoldingPattern* holder): mHolder(holder), mWearable(wearable), mType(type) @@ -609,14 +609,14 @@ public: } private: LLWearableHoldingPattern* mHolder; - LLWearable *mWearable; + LLViewerWearable *mWearable; LLWearableType::EType mType; }; class RecoveredItemCB: public LLInventoryCallback { public: - RecoveredItemCB(LLWearableType::EType type, LLWearable *wearable, LLWearableHoldingPattern* holder): + RecoveredItemCB(LLWearableType::EType type, LLViewerWearable *wearable, LLWearableHoldingPattern* holder): mHolder(holder), mWearable(wearable), mType(type) @@ -649,7 +649,7 @@ public: } private: LLWearableHoldingPattern* mHolder; - LLWearable *mWearable; + LLViewerWearable *mWearable; LLWearableType::EType mType; }; @@ -665,7 +665,7 @@ void LLWearableHoldingPattern::recoverMissingWearable(LLWearableType::EType type LLNotificationsUtil::add("ReplacedMissingWearable"); lldebugs << "Wearable " << LLWearableType::getTypeLabel(type) << " could not be downloaded. Replaced inventory item with default wearable." << llendl; - LLWearable* wearable = LLWearableList::instance().createNewWearable(type); + LLViewerWearable* wearable = LLWearableList::instance().createNewWearable(type); // Add a new one in the lost and found folder. const LLUUID lost_and_found_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND); @@ -772,11 +772,11 @@ void LLWearableHoldingPattern::handleLateArrivals() iter != getFoundList().end(); ++iter) { LLFoundData& data = *iter; - for (std::set::iterator wear_it = mLateArrivals.begin(); + for (std::set::iterator wear_it = mLateArrivals.begin(); wear_it != mLateArrivals.end(); ++wear_it) { - LLWearable *wearable = *wear_it; + LLViewerWearable *wearable = *wear_it; if(wearable->getAssetID() == data.mAssetID) { @@ -836,7 +836,7 @@ void LLWearableHoldingPattern::resetTime(F32 timeout) mWaitTime.setTimerExpirySec(timeout); } -void LLWearableHoldingPattern::onWearableAssetFetch(LLWearable *wearable) +void LLWearableHoldingPattern::onWearableAssetFetch(LLViewerWearable *wearable) { if (!isMostRecent()) { @@ -887,7 +887,7 @@ void LLWearableHoldingPattern::onWearableAssetFetch(LLWearable *wearable) } } -static void onWearableAssetFetch(LLWearable* wearable, void* data) +static void onWearableAssetFetch(LLViewerWearable* wearable, void* data) { LLWearableHoldingPattern* holder = (LLWearableHoldingPattern*)data; holder->onWearableAssetFetch(wearable); @@ -1588,7 +1588,7 @@ void LLAppearanceMgr::updateAgentWearables(LLWearableHoldingPattern* holder, boo { lldebugs << "updateAgentWearables()" << llendl; LLInventoryItem::item_array_t items; - LLDynamicArray< LLWearable* > wearables; + LLDynamicArray< LLViewerWearable* > wearables; // For each wearable type, find the wearables of that type. for( S32 i = 0; i < LLWearableType::WT_COUNT; i++ ) @@ -1597,7 +1597,7 @@ void LLAppearanceMgr::updateAgentWearables(LLWearableHoldingPattern* holder, boo iter != holder->getFoundList().end(); ++iter) { LLFoundData& data = *iter; - LLWearable* wearable = data.mWearable; + LLViewerWearable* wearable = data.mWearable; if( wearable && ((S32)wearable->getType() == i) ) { LLViewerInventoryItem* item = (LLViewerInventoryItem*)gInventory.getItem(data.mItemID); -- cgit v1.2.3 From f1d6052e36ed6d817faedf9b32cb9d889395cd88 Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Tue, 11 Sep 2012 11:59:45 -0400 Subject: SH-3264 Moved over a few more items to llappearance moved over: isWearingWearableType wearable::writeToAvatar wearable::mTEMap (stores LocalTextureObject*) more from wearable::import/export wearable::createVisualParams, etc --- indra/newview/llappearancemgr.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 5717ebaf02..1e4e00d77d 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -665,7 +665,7 @@ void LLWearableHoldingPattern::recoverMissingWearable(LLWearableType::EType type LLNotificationsUtil::add("ReplacedMissingWearable"); lldebugs << "Wearable " << LLWearableType::getTypeLabel(type) << " could not be downloaded. Replaced inventory item with default wearable." << llendl; - LLViewerWearable* wearable = LLWearableList::instance().createNewWearable(type); + LLViewerWearable* wearable = LLWearableList::instance().createNewWearable(type, gAgentAvatarp); // Add a new one in the lost and found folder. const LLUUID lost_and_found_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND); @@ -1841,6 +1841,7 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering) // Fetch the wearables about to be worn. LLWearableList::instance().getAsset(found.mAssetID, found.mName, + gAgentAvatarp, found.mAssetType, onWearableAssetFetch, (void*)holder); -- cgit v1.2.3 From 878eb2b61a26eef3151319cffd1d8d5196b118c2 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 27 Sep 2012 17:46:19 -0400 Subject: audited uses of centralBakeVersion vs. isUsingServerBakes --- indra/newview/llappearancemgr.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 1e4e00d77d..c57269d0b0 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1750,6 +1750,7 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering) { requestServerAppearanceUpdate(); } + gAgentAvatarp->setIsUsingServerBakes(gAgent.getRegion() && gAgent.getRegion()->getCentralBakeVersion()); //dumpCat(getCOF(),"COF, start"); -- cgit v1.2.3 From 3aeff074cfc2f14b661b96bc0664087a95a99eff Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 26 Oct 2012 18:27:08 -0400 Subject: SH-3469 FIX - use callback mechanism to handle possible race between getting caps and setting agent region --- indra/newview/llappearancemgr.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index c57269d0b0..7a8586ebdc 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -2677,6 +2677,10 @@ void LLAppearanceMgr::requestServerAppearanceUpdate() { llwarns << "Region not set, cannot request server appearance update" << llendl; } + if (gAgent.getRegion()->getCentralBakeVersion()==0) + { + llwarns << "Region does not support baking" << llendl; + } std::string url = gAgent.getRegion()->getCapability("UpdateAvatarAppearance"); if (url.empty()) { -- cgit v1.2.3 From d4dc41dbd5b54501fcb3c94e07e4753ed4196eac Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 1 Nov 2012 14:19:00 -0400 Subject: misc error detection, debug coloration for avatar meshes --- indra/newview/llappearancemgr.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 7a8586ebdc..51de2fd17b 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1750,6 +1750,8 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering) { requestServerAppearanceUpdate(); } + // DRANO really should wait for the appearance message to set this. + // verify that deleting this line doesn't break anything. gAgentAvatarp->setIsUsingServerBakes(gAgent.getRegion() && gAgent.getRegion()->getCentralBakeVersion()); //dumpCat(getCOF(),"COF, start"); @@ -2684,7 +2686,7 @@ void LLAppearanceMgr::requestServerAppearanceUpdate() std::string url = gAgent.getRegion()->getCapability("UpdateAvatarAppearance"); if (url.empty()) { - llwarns << "NO CAP for UpdateAvatarAppearance. This is a bug." << llendl; + llwarns << "No cap for UpdateAvatarAppearance." << llendl; return; } -- cgit v1.2.3 From 9dd856e37eb9c80701053f0c1a2c0b268f56f5f2 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 2 Nov 2012 18:07:07 -0400 Subject: SH-3429 WIP - Added adaptive retry mechanism for failed appearance update requests --- indra/newview/llappearancemgr.cpp | 85 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 81 insertions(+), 4 deletions(-) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 51de2fd17b..b2a8a33ecf 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -2652,12 +2652,70 @@ void LLAppearanceMgr::updateClothingOrderingInfo(LLUUID cat_id, bool update_base if (inventory_changed) gInventory.notifyObservers(); } +// This is intended for use with HTTP Clients/Responders, but is not +// specifically coupled with those classes. +class LLHTTPRetryPolicy: public LLThreadSafeRefCount +{ +public: + LLHTTPRetryPolicy() {} + virtual ~LLHTTPRetryPolicy() {} + virtual bool shouldRetry(U32 status, F32& seconds_to_wait) = 0; +}; + +// Example of simplest possible policy, not necessarily recommended. +class LLAlwaysRetryImmediatelyPolicy: public LLHTTPRetryPolicy +{ +public: + LLAlwaysRetryImmediatelyPolicy() {} + bool shouldRetry(U32 status, F32& seconds_to_wait) + { + seconds_to_wait = 0.0; + return true; + } +}; + +// Very general policy with geometric back-off after failures, +// up to a maximum delay, and maximum number of retries. +class LLAdaptiveRetryPolicy: public LLHTTPRetryPolicy +{ +public: + LLAdaptiveRetryPolicy(F32 min_delay, F32 max_delay, F32 backoff_factor, U32 max_retries): + mMinDelay(min_delay), + mMaxDelay(max_delay), + mBackoffFactor(backoff_factor), + mMaxRetries(max_retries), + mDelay(min_delay), + mRetryCount(0) + { + } + + bool shouldRetry(U32 status, F32& seconds_to_wait) + { + seconds_to_wait = mDelay; + mDelay = llclamp(mDelay*mBackoffFactor,mMinDelay,mMaxDelay); + mRetryCount++; + return (mRetryCount<=mMaxRetries); + } + +private: + F32 mMinDelay; // delay never less than this value + F32 mMaxDelay; // delay never exceeds this value + F32 mBackoffFactor; // delay increases by this factor after each retry, up to mMaxDelay. + U32 mMaxRetries; // maximum number of times shouldRetry will return true. + F32 mDelay; // current delay. + U32 mRetryCount; // number of times shouldRetry has been called. +}; + class RequestAgentUpdateAppearanceResponder: public LLHTTPClient::Responder { public: RequestAgentUpdateAppearanceResponder() { - llinfos << "request created" << llendl; + mRetryPolicy = new LLAdaptiveRetryPolicy(1.0, 16.0, 2.0, 5); + } + + virtual ~RequestAgentUpdateAppearanceResponder() + { } // Successful completion. @@ -2669,11 +2727,25 @@ public: // Error /*virtual*/ void error(U32 status, const std::string& reason) { - llwarns << "appearance update request failed, reason: " << reason << llendl; + llwarns << "appearance update request failed, status: " << status << " reason: " << reason << llendl; + F32 seconds_to_wait; + if (mRetryPolicy->shouldRetry(status,seconds_to_wait)) + { + doAfterInterval(boost::bind(&LLAppearanceMgr::requestServerAppearanceUpdate, + LLAppearanceMgr::getInstance(), + LLCurl::ResponderPtr(this)), + seconds_to_wait); + } + else + { + llwarns << "giving up after too many retries" << llendl; + } } + + LLPointer mRetryPolicy; }; -void LLAppearanceMgr::requestServerAppearanceUpdate() +void LLAppearanceMgr::requestServerAppearanceUpdate(LLCurl::ResponderPtr responder_ptr) { if (!gAgent.getRegion()) { @@ -2693,7 +2765,12 @@ void LLAppearanceMgr::requestServerAppearanceUpdate() LLSD body; S32 cof_version = getCOFVersion(); body["cof_version"] = cof_version; - LLHTTPClient::post(url, body, new RequestAgentUpdateAppearanceResponder); + //LLCurl::ResponderPtr responder_ptr; + if (!responder_ptr.get()) + { + responder_ptr = new RequestAgentUpdateAppearanceResponder; + } + LLHTTPClient::post(url, body, responder_ptr); llassert(cof_version >= mLastUpdateRequestCOFVersion); mLastUpdateRequestCOFVersion = cof_version; } -- cgit v1.2.3 From 6d085486bd972406d153beec79449ec30b5a91ff Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 5 Nov 2012 17:36:56 -0500 Subject: small logging tweak --- indra/newview/llappearancemgr.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index b2a8a33ecf..4e103bb75e 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -2731,6 +2731,7 @@ public: F32 seconds_to_wait; if (mRetryPolicy->shouldRetry(status,seconds_to_wait)) { + llinfos << "retrying" << llendl; doAfterInterval(boost::bind(&LLAppearanceMgr::requestServerAppearanceUpdate, LLAppearanceMgr::getInstance(), LLCurl::ResponderPtr(this)), -- cgit v1.2.3 From 81219ad03b59a5fcd80ee450b7606c6bb64f4c7d Mon Sep 17 00:00:00 2001 From: Logan Dethrow Date: Mon, 19 Nov 2012 16:30:14 -0500 Subject: Moved implementation of incrementCofVersion to llappearancemgr.cpp. Changed retry logic to use the more robust mRetryPolicy instead of my own previous implementation. --- indra/newview/llappearancemgr.cpp | 75 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 4e103bb75e..e3ac052961 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -2776,6 +2776,81 @@ void LLAppearanceMgr::requestServerAppearanceUpdate(LLCurl::ResponderPtr respond mLastUpdateRequestCOFVersion = cof_version; } +class LLIncrementCofVersionResponder : public LLHTTPClient::Responder +{ +public: + LLIncrementCofVersionResponder() : LLHTTPClient::Responder() + { + mRetryPolicy = new LLAdaptiveRetryPolicy(1.0, 16.0, 2.0, 5); + } + + virtual ~LLIncrementCofVersionResponder() + { + } + + virtual void result(const LLSD &pContent) + { + llinfos << "Successfully incremented agent's COF." << llendl; + S32 new_version = pContent["category"]["version"].asInteger(); + + LLAppearanceMgr* app_mgr = LLAppearanceMgr::getInstance(); + + // cof_version should have increased + llassert(new_version > app_mgr->mLastUpdateRequestCOFVersion); + + app_mgr->mLastUpdateRequestCOFVersion = new_version; + } + virtual void error(U32 pStatus, const std::string& pReason) + { + llwarns << "While attempting to increment the agent's cof we got an error because '" + << pReason << "' [status:" << pStatus << "]" << llendl; + F32 seconds_to_wait; + if (mRetryPolicy->shouldRetry(pStatus,seconds_to_wait)) + { + llinfos << "retrying" << llendl; + doAfterInterval(boost::bind(&LLAppearanceMgr::incrementCofVersion, + LLAppearanceMgr::getInstance(), + LLHTTPClient::ResponderPtr(this)), + seconds_to_wait); + } + else + { + llwarns << "giving up after too many retries" << llendl; + } + } + + LLPointer mRetryPolicy; +}; + +void LLAppearanceMgr::incrementCofVersion(LLHTTPClient::ResponderPtr responder_ptr) +{ + // If we don't have a region, report it as an error + if (gAgent.getRegion() == NULL) + { + llwarns << "Region not set, cannot request cof_version increment" << llendl; + return; + } + + std::string url = gAgent.getRegion()->getCapability("IncrementCofVersion"); + if (url.empty()) + { + llwarns << "No cap for IncrementCofVersion." << llendl; + return; + } + + llinfos << "Requesting cof_version be incremented via capability to: " + << url << llendl; + LLSD headers; + LLSD body = LLSD::emptyMap(); + + if (!responder_ptr.get()) + { + responder_ptr = LLHTTPClient::ResponderPtr(new LLIncrementCofVersionResponder()); + } + + LLHTTPClient::get(url, body, responder_ptr, headers, 30.0f); +} + class LLShowCreatedOutfit: public LLInventoryCallback { public: -- cgit v1.2.3 From 47a2a2982de98c88fbc6cd17bdb897e5ec408b88 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 29 Nov 2012 11:06:10 -0500 Subject: fix for possible crash on exit in self_av_string() --- indra/newview/llappearancemgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 4e103bb75e..9f6586a69b 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -52,7 +52,7 @@ std::string self_av_string() { - return gAgentAvatarp->avString(); + return gAgentAvatarp ? gAgentAvatarp->avString() : std::string("self_av_string error, gAgentAvatarp null"); } // RAII thingy to guarantee that a variable gets reset when the Setter -- cgit v1.2.3 From 9934cd2e29c8ea11e0859cd881d286fd56fae96e Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 30 Nov 2012 17:41:07 -0500 Subject: SH-3562 WIP - detect possible hangs in item copying --- indra/newview/llappearancemgr.cpp | 137 +++++++++++++++++++++++++++++++++----- 1 file changed, 121 insertions(+), 16 deletions(-) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 9f6586a69b..09b0c132d2 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -154,6 +154,123 @@ LLUUID findDescendentCategoryIDByName(const LLUUID& parent_id, const std::string } } +// Shim between inventory callback and boost function +typedef boost::function inventory_func_type; + +class LLBoostFuncInventoryCallback: public LLInventoryCallback +{ +public: + + LLBoostFuncInventoryCallback(const inventory_func_type& func): + mFunc(func) + { + } + + void fire(const LLUUID& item_id) + { + mFunc(item_id); + } + +private: + inventory_func_type mFunc; +}; + +LLPointer make_inventory_func_callback(const inventory_func_type& func) +{ + return new LLBoostFuncInventoryCallback(func); +} + +void report_fire(const LLUUID& item_id) +{ + llinfos << item_id << llendl; +} + +class LLInventoryCopyMgr: public LLEventTimer +{ +public: + LLInventoryCopyMgr(LLInventoryModel::item_array_t& src_items, const LLUUID& dst_cat_id, + bool append, const std::string& phase): + mDstCatID(dst_cat_id), + mAppend(append), + mTrackingPhase(phase), + LLEventTimer(5.0) + { + for (LLInventoryModel::item_array_t::const_iterator it = src_items.begin(); + it != src_items.end(); + ++it) + { + LLViewerInventoryItem* item = *it; + mSrcTimes[item->getUUID()] = LLTimer(); + requestCopy(item->getUUID()); + } + if (!mTrackingPhase.empty()) + { + selfStartPhase(mTrackingPhase); + } + } + + void requestCopy(const LLUUID& item_id) + { + LLViewerInventoryItem *item = gInventory.getItem(item_id); + if (!item) + { + llwarns << "requestCopy item not found " << item_id << llendl; + return; + } + copy_inventory_item( + gAgent.getID(), + item->getPermissions().getOwner(), + item->getUUID(), + mDstCatID, + std::string(), + make_inventory_func_callback(boost::bind(&LLInventoryCopyMgr::onCopy,this,item->getUUID(),_1)) + ); + } + + void onCopy(const LLUUID& src_id, const LLUUID& dst_id) + { + LL_DEBUGS("Avatar") << "copied, src_id " << src_id << " to dst_id " << dst_id << " after " << mSrcTimes[src_id].getElapsedTimeF32() << " seconds" << llendl; + mSrcTimes.erase(src_id); + if (mSrcTimes.empty()) + { + onCompletion(); + } + } + + void onCompletion() + { + if (!mTrackingPhase.empty()) + { + selfStopPhase(mTrackingPhase); + } + if( LLInventoryCallbackManager::is_instantiated() ) + { + LLAppearanceMgr::instance().wearInventoryCategoryOnAvatar(gInventory.getCategory(mDstCatID), mAppend); + } + } + + // virtual + // Will be deleted after returning true - only safe to do this if all callbacks have fired. + BOOL tick() + { + bool all_done = mSrcTimes.empty(); + + if (!all_done) + { + llwarns << "possible hang in copy, waiting on " << mSrcTimes.size() << " items" << llendl; + // TODO possibly add retry logic here. + + } + return all_done; + } + +private: + std::string mTrackingPhase; + std::map mSrcTimes; + LLUUID mDstCatID; + bool mAppend; +}; + class LLWearInventoryCategoryCallback : public LLInventoryCallback { public: @@ -1979,22 +2096,10 @@ void LLAppearanceMgr::wearCategoryFinal(LLUUID& cat_id, bool copy_items, bool ap pid, LLFolderType::FT_NONE, name); - LLPointer cb = new LLWearInventoryCategoryCallback(new_cat_id, append); - it = items->begin(); - for(; it < end; ++it) - { - item = *it; - if(item) - { - copy_inventory_item( - gAgent.getID(), - item->getPermissions().getOwner(), - item->getUUID(), - new_cat_id, - std::string(), - cb); - } - } + + // Create a CopyMgr that will copy items, manage its own destruction + new LLInventoryCopyMgr(*items, new_cat_id, append, std::string("wear_inventory_category_callback")); + // BAP fixes a lag in display of created dir. gInventory.notifyObservers(); } -- cgit v1.2.3 From 5c245e941ace3f52dfa3539c473e2c02f207d8a3 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 3 Dec 2012 14:34:00 -0500 Subject: SH-3562 WIP --- indra/newview/llappearancemgr.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 09b0c132d2..321bf7edcb 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -239,14 +239,12 @@ public: void onCompletion() { + llinfos << "done" << llendl; if (!mTrackingPhase.empty()) { selfStopPhase(mTrackingPhase); } - if( LLInventoryCallbackManager::is_instantiated() ) - { - LLAppearanceMgr::instance().wearInventoryCategoryOnAvatar(gInventory.getCategory(mDstCatID), mAppend); - } + LLAppearanceMgr::instance().wearInventoryCategoryOnAvatar(gInventory.getCategory(mDstCatID), mAppend); } // virtual @@ -2116,7 +2114,12 @@ void LLAppearanceMgr::wearInventoryCategoryOnAvatar( LLInventoryCategory* catego // Avoid unintentionally overwriting old wearables. We have to do // this up front to avoid having to deal with the case of multiple // wearables being dirty. - if(!category) return; + if (!category) return; + + if ( !LLInventoryCallbackManager::is_instantiated() ) + { + return; + } LL_INFOS("Avatar") << self_av_string() << "wearInventoryCategoryOnAvatar '" << category->getName() << "'" << LL_ENDL; -- cgit v1.2.3 From 6735d40d9a0e03007f6f7aef954022d770c0165d Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 4 Dec 2012 17:45:01 -0500 Subject: SH-3604 WIP --- indra/newview/llappearancemgr.cpp | 108 +++++++++++++++++++++++++++----------- 1 file changed, 78 insertions(+), 30 deletions(-) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 79106318a4..8e5f4b3684 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -186,49 +186,59 @@ void report_fire(const LLUUID& item_id) llinfos << item_id << llendl; } -class LLInventoryCopyMgr: public LLEventTimer +class LLCallAfterInventoryBatchMgr: public LLEventTimer { public: - LLInventoryCopyMgr(LLInventoryModel::item_array_t& src_items, const LLUUID& dst_cat_id, - bool append, const std::string& phase): + LLCallAfterInventoryBatchMgr(const LLUUID& dst_cat_id, + const std::string& phase_name, + nullary_func_t on_completion_func, + F32 check_period = 5.0, + F32 retry_after = 30.0, + S32 max_retries = 2 + ): mDstCatID(dst_cat_id), - mAppend(append), - mTrackingPhase(phase), - LLEventTimer(5.0) + mTrackingPhase(phase_name), + mOnCompletionFunc(on_completion_func), + mRetryAfter(retry_after), + mMaxRetries(max_retries), + LLEventTimer(check_period) + { + if (!mTrackingPhase.empty()) + { + selfStartPhase(mTrackingPhase); + } + } + + void addItems(LLInventoryModel::item_array_t& src_items) { for (LLInventoryModel::item_array_t::const_iterator it = src_items.begin(); it != src_items.end(); ++it) { LLViewerInventoryItem* item = *it; - mSrcTimes[item->getUUID()] = LLTimer(); - requestCopy(item->getUUID()); - } - if (!mTrackingPhase.empty()) - { - selfStartPhase(mTrackingPhase); + llassert(item); + addItem(item); } } - void requestCopy(const LLUUID& item_id) + void addItem(LLViewerInventoryItem *item) { - LLViewerInventoryItem *item = gInventory.getItem(item_id); + const LLUUID& item_id = item->getUUID(); if (!item) { - llwarns << "requestCopy item not found " << item_id << llendl; + llwarns << "item not found for " << item_id << llendl; return; } - copy_inventory_item( - gAgent.getID(), - item->getPermissions().getOwner(), - item->getUUID(), - mDstCatID, - std::string(), - make_inventory_func_callback(boost::bind(&LLInventoryCopyMgr::onCopy,this,item->getUUID(),_1)) - ); + if (mSrcTimes.find(item_id) == mSrcTimes.end()) + { + mSrcTimes[item->getUUID()] = LLTimer(); + } + requestOperation(item); } - - void onCopy(const LLUUID& src_id, const LLUUID& dst_id) + + virtual void requestOperation(LLViewerInventoryItem *item) = 0; + + void onOp(const LLUUID& src_id, const LLUUID& dst_id) { LL_DEBUGS("Avatar") << "copied, src_id " << src_id << " to dst_id " << dst_id << " after " << mSrcTimes[src_id].getElapsedTimeF32() << " seconds" << llendl; mSrcTimes.erase(src_id); @@ -245,7 +255,7 @@ public: { selfStopPhase(mTrackingPhase); } - LLAppearanceMgr::instance().wearInventoryCategoryOnAvatar(gInventory.getCategory(mDstCatID), mAppend); + mOnCompletionFunc(); } // virtual @@ -256,18 +266,51 @@ public: if (!all_done) { - llwarns << "possible hang in copy, waiting on " << mSrcTimes.size() << " items" << llendl; + llwarns << "possible hang in operation, waiting on " << mSrcTimes.size() << " items" << llendl; // TODO possibly add retry logic here. } return all_done; } -private: + virtual ~LLCallAfterInventoryBatchMgr() + { + LL_DEBUGS("Avatar") << "ending" << llendl; + } + +protected: std::string mTrackingPhase; std::map mSrcTimes; LLUUID mDstCatID; - bool mAppend; + nullary_func_t mOnCompletionFunc; + F32 mRetryAfter; + S32 mMaxRetries; +}; + +class LLCallAfterInventoryCopyMgr: public LLCallAfterInventoryBatchMgr +{ +public: + LLCallAfterInventoryCopyMgr(LLInventoryModel::item_array_t& src_items, + const LLUUID& dst_cat_id, + const std::string& phase_name, + nullary_func_t on_completion_func + ): + LLCallAfterInventoryBatchMgr(dst_cat_id, phase_name, on_completion_func) + { + addItems(src_items); + } + + virtual void requestOperation(LLViewerInventoryItem *item) + { + copy_inventory_item( + gAgent.getID(), + item->getPermissions().getOwner(), + item->getUUID(), + mDstCatID, + std::string(), + make_inventory_func_callback(boost::bind(&LLCallAfterInventoryBatchMgr::onOp,this,item->getUUID(),_1)) + ); + } }; class LLWearInventoryCategoryCallback : public LLInventoryCallback @@ -2097,7 +2140,12 @@ void LLAppearanceMgr::wearCategoryFinal(LLUUID& cat_id, bool copy_items, bool ap name); // Create a CopyMgr that will copy items, manage its own destruction - new LLInventoryCopyMgr(*items, new_cat_id, append, std::string("wear_inventory_category_callback")); + new LLCallAfterInventoryCopyMgr( + *items, new_cat_id, std::string("wear_inventory_category_callback"), + boost::bind(&LLAppearanceMgr::wearInventoryCategoryOnAvatar, + LLAppearanceMgr::getInstance(), + gInventory.getCategory(new_cat_id), + append)); // BAP fixes a lag in display of created dir. gInventory.notifyObservers(); -- cgit v1.2.3 From 480569677cb0cd6b03d2a38a613561d6ef6be059 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 5 Dec 2012 16:38:21 -0500 Subject: SH-3604 WIP - retry mechanism for batch inventory ops, handle either completion or failure --- indra/newview/llappearancemgr.cpp | 196 ++++++++++++++++++++++++++------------ 1 file changed, 135 insertions(+), 61 deletions(-) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 8e5f4b3684..c149f38fcd 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -192,15 +192,20 @@ public: LLCallAfterInventoryBatchMgr(const LLUUID& dst_cat_id, const std::string& phase_name, nullary_func_t on_completion_func, + nullary_func_t on_failure_func, F32 check_period = 5.0, - F32 retry_after = 30.0, + F32 retry_after = 10.0, S32 max_retries = 2 ): mDstCatID(dst_cat_id), mTrackingPhase(phase_name), mOnCompletionFunc(on_completion_func), + mOnFailureFunc(on_failure_func), mRetryAfter(retry_after), mMaxRetries(max_retries), + mPendingRequests(0), + mFailCount(0), + mRetryCount(0), LLEventTimer(check_period) { if (!mTrackingPhase.empty()) @@ -221,6 +226,7 @@ public: } } + // Request or re-request operation for specified item. void addItem(LLViewerInventoryItem *item) { const LLUUID& item_id = item->getUUID(); @@ -229,10 +235,24 @@ public: llwarns << "item not found for " << item_id << llendl; return; } - if (mSrcTimes.find(item_id) == mSrcTimes.end()) + mPendingRequests++; + // On a re-request, this will reset the timer. + mWaitTimes[item_id] = LLTimer(); + if (mRetryCounts.find(item_id) == mRetryCounts.end()) { - mSrcTimes[item->getUUID()] = LLTimer(); + mRetryCounts[item_id] = 0; } + else + { + mRetryCounts[item_id]++; + } + + if (ll_frand()::const_iterator it = mWaitTimes.begin(); + it != mWaitTimes.end();) + { + // Use a copy of iterator because it may be erased/invalidated. + std::map::const_iterator curr_it = it; + ++it; + + F32 time_waited = curr_it->second.getElapsedTimeF32(); + S32 retries = mRetryCounts[curr_it->first]; + if (time_waited > mRetryAfter) + { + if (retries < mMaxRetries) + { + LL_DEBUGS("Avatar") << "Waited " << time_waited << + " for " << curr_it->first << ", retrying" << llendl; + mRetryCount++; + addItem(gInventory.getItem(curr_it->first)); + } + else + { + llwarns << "Giving up on " << curr_it->first << " after too many retries" << llendl; + mWaitTimes.erase(curr_it); + mFailCount++; + } + } + if (mWaitTimes.empty()) + { + onCompletionOrFailure(); + } + } } return all_done; } + void reportStats() + { + LL_DEBUGS("Avatar") << "mFailCount: " << mFailCount << llendl; + LL_DEBUGS("Avatar") << "mRetryCount: " << mRetryCount << llendl; + LL_DEBUGS("Avatar") << "Times: n " << mTimeStats.getCount() << " min " << mTimeStats.getMinValue() << " max " << mTimeStats.getMaxValue() << llendl; + LL_DEBUGS("Avatar") << "Mean " << mTimeStats.getMean() << " stddev " << mTimeStats.getStdDev() << llendl; + } + virtual ~LLCallAfterInventoryBatchMgr() { - LL_DEBUGS("Avatar") << "ending" << llendl; + LL_DEBUGS("Avatar") << "deleting" << llendl; } protected: std::string mTrackingPhase; - std::map mSrcTimes; + std::map mWaitTimes; + std::map mRetryCounts; LLUUID mDstCatID; nullary_func_t mOnCompletionFunc; + nullary_func_t mOnFailureFunc; F32 mRetryAfter; S32 mMaxRetries; + S32 mPendingRequests; + S32 mFailCount; + S32 mRetryCount; + LLViewerStats::StatsAccumulator mTimeStats; }; class LLCallAfterInventoryCopyMgr: public LLCallAfterInventoryBatchMgr @@ -293,9 +388,10 @@ public: LLCallAfterInventoryCopyMgr(LLInventoryModel::item_array_t& src_items, const LLUUID& dst_cat_id, const std::string& phase_name, - nullary_func_t on_completion_func + nullary_func_t on_completion_func, + nullary_func_t on_failure_func ): - LLCallAfterInventoryBatchMgr(dst_cat_id, phase_name, on_completion_func) + LLCallAfterInventoryBatchMgr(dst_cat_id, phase_name, on_completion_func, on_failure_func) { addItems(src_items); } @@ -313,56 +409,32 @@ public: } }; -class LLWearInventoryCategoryCallback : public LLInventoryCallback +class LLCallAfterInventoryLinkMgr: public LLCallAfterInventoryBatchMgr { -public: - LLWearInventoryCategoryCallback(const LLUUID& cat_id, bool append) - { - mCatID = cat_id; - mAppend = append; - - LL_INFOS("Avatar") << self_av_string() << "starting" << LL_ENDL; - - selfStartPhase("wear_inventory_category_callback"); - } - void fire(const LLUUID& item_id) + LLCallAfterInventoryLinkMgr(LLInventoryModel::item_array_t& src_items, + const LLUUID& dst_cat_id, + const std::string& phase_name, + nullary_func_t on_completion_func, + nullary_func_t on_failure_func + ): + LLCallAfterInventoryBatchMgr(dst_cat_id, phase_name, on_completion_func, on_failure_func) { - /* - * Do nothing. We only care about the destructor - * - * The reason for this is that this callback is used in a hack where the - * same callback is given to dozens of items, and the destructor is called - * after the last item has fired the event and dereferenced it -- if all - * the events actually fire! - */ - LL_DEBUGS("Avatar") << self_av_string() << " fired on copied item, id " << item_id << LL_ENDL; + addItems(src_items); } - -protected: - ~LLWearInventoryCategoryCallback() + + virtual void requestOperation(LLViewerInventoryItem *item) { - LL_INFOS("Avatar") << self_av_string() << "done all inventory callbacks" << LL_ENDL; - - selfStopPhase("wear_inventory_category_callback"); - - // Is the destructor called by ordinary dereference, or because the app's shutting down? - // If the inventory callback manager goes away, we're shutting down, no longer want the callback. - if( LLInventoryCallbackManager::is_instantiated() ) - { - LLAppearanceMgr::instance().wearInventoryCategoryOnAvatar(gInventory.getCategory(mCatID), mAppend); - } - else - { - llwarns << self_av_string() << "Dropping unhandled LLWearInventoryCategoryCallback" << llendl; - } + link_inventory_item(gAgent.getID(), + item->getLinkedUUID(), + mDstCatID, + item->getName(), + item->LLInventoryItem::getDescription(), + LLAssetType::AT_LINK, + make_inventory_func_callback( + boost::bind(&LLCallAfterInventoryBatchMgr::onOp,this,item->getUUID(),_1))); } - -private: - LLUUID mCatID; - bool mAppend; }; - //Inventory callback updating "dirty" state when destroyed class LLUpdateDirtyState: public LLInventoryCallback { @@ -2145,7 +2217,8 @@ void LLAppearanceMgr::wearCategoryFinal(LLUUID& cat_id, bool copy_items, bool ap boost::bind(&LLAppearanceMgr::wearInventoryCategoryOnAvatar, LLAppearanceMgr::getInstance(), gInventory.getCategory(new_cat_id), - append)); + append), + boost::function()); // BAP fixes a lag in display of created dir. gInventory.notifyObservers(); @@ -2167,6 +2240,7 @@ void LLAppearanceMgr::wearInventoryCategoryOnAvatar( LLInventoryCategory* catego if ( !LLInventoryCallbackManager::is_instantiated() ) { + // shutting down, ignore. return; } -- cgit v1.2.3 From bfa3bc0059eef269ac7a77cd28443898cea1fb19 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 5 Dec 2012 17:58:35 -0500 Subject: Possible fix for TC build failure --- indra/newview/llappearancemgr.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index c149f38fcd..656949a9bb 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -319,11 +319,11 @@ public: if (!mWaitTimes.empty()) { llwarns << "still waiting on " << mWaitTimes.size() << " items" << llendl; - for (std::map::const_iterator it = mWaitTimes.begin(); + for (std::map::iterator it = mWaitTimes.begin(); it != mWaitTimes.end();) { // Use a copy of iterator because it may be erased/invalidated. - std::map::const_iterator curr_it = it; + std::map::iterator curr_it = it; ++it; F32 time_waited = curr_it->second.getElapsedTimeF32(); -- cgit v1.2.3 From 1d5b98929b176f3eeda7274bf8f21b69d551a2cd Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 6 Dec 2012 15:17:00 -0500 Subject: SH-3604 FIX - switched link creation in updateCOF() to use retry path, better stats reporting, fixed failure logic --- indra/newview/llappearancemgr.cpp | 48 ++++++++++++++++++++++++++------------- 1 file changed, 32 insertions(+), 16 deletions(-) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 656949a9bb..98a8097a1e 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -186,13 +186,15 @@ void report_fire(const LLUUID& item_id) llinfos << item_id << llendl; } +void no_op() {} + class LLCallAfterInventoryBatchMgr: public LLEventTimer { public: LLCallAfterInventoryBatchMgr(const LLUUID& dst_cat_id, const std::string& phase_name, nullary_func_t on_completion_func, - nullary_func_t on_failure_func, + nullary_func_t on_failure_func = no_op, F32 check_period = 5.0, F32 retry_after = 10.0, S32 max_retries = 2 @@ -205,6 +207,7 @@ public: mMaxRetries(max_retries), mPendingRequests(0), mFailCount(0), + mCompletionOrFailureCalled(false), mRetryCount(0), LLEventTimer(check_period) { @@ -260,12 +263,16 @@ public: void onOp(const LLUUID& src_id, const LLUUID& dst_id) { - LL_DEBUGS("Avatar") << "copied, src_id " << src_id << " to dst_id " << dst_id << " after " << mWaitTimes[src_id].getElapsedTimeF32() << " seconds" << llendl; + LL_DEBUGS("Avatar") << "op done, src_id " << src_id << " dst_id " << dst_id << " after " << mWaitTimes[src_id].getElapsedTimeF32() << " seconds" << llendl; mPendingRequests--; F32 wait_time = mWaitTimes[src_id].getElapsedTimeF32(); mTimeStats.push(wait_time); mWaitTimes.erase(src_id); - if (mWaitTimes.empty()) + if (mCompletionOrFailureCalled) + { + llinfos << "late-completing operation, src_id " << src_id << "dst_id " << dst_id << llendl; + } + if (mWaitTimes.empty() && !mCompletionOrFailureCalled) { onCompletionOrFailure(); } @@ -273,6 +280,9 @@ public: void onCompletionOrFailure() { + assert (!mCompletionOrFailureCalled); + mCompletionOrFailureCalled = true; + // Will never call onCompletion() if any item has been flagged as // a failure - otherwise could wind up with corrupted // outfit, involuntary nudity, etc. @@ -356,6 +366,7 @@ public: void reportStats() { + LL_DEBUGS("Avatar") << "Phase: " << mTrackingPhase << llendl; LL_DEBUGS("Avatar") << "mFailCount: " << mFailCount << llendl; LL_DEBUGS("Avatar") << "mRetryCount: " << mRetryCount << llendl; LL_DEBUGS("Avatar") << "Times: n " << mTimeStats.getCount() << " min " << mTimeStats.getMinValue() << " max " << mTimeStats.getMaxValue() << llendl; @@ -379,6 +390,7 @@ protected: S32 mPendingRequests; S32 mFailCount; S32 mRetryCount; + bool mCompletionOrFailureCalled; LLViewerStats::StatsAccumulator mTimeStats; }; @@ -389,7 +401,7 @@ public: const LLUUID& dst_cat_id, const std::string& phase_name, nullary_func_t on_completion_func, - nullary_func_t on_failure_func + nullary_func_t on_failure_func = no_op ): LLCallAfterInventoryBatchMgr(dst_cat_id, phase_name, on_completion_func, on_failure_func) { @@ -411,11 +423,12 @@ public: class LLCallAfterInventoryLinkMgr: public LLCallAfterInventoryBatchMgr { +public: LLCallAfterInventoryLinkMgr(LLInventoryModel::item_array_t& src_items, const LLUUID& dst_cat_id, const std::string& phase_name, nullary_func_t on_completion_func, - nullary_func_t on_failure_func + nullary_func_t on_failure_func = no_op ): LLCallAfterInventoryBatchMgr(dst_cat_id, phase_name, on_completion_func, on_failure_func) { @@ -1757,34 +1770,38 @@ void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append) purgeCategory(cof, keep_outfit_links); gInventory.notifyObservers(); - // Create links to new COF contents. - LL_DEBUGS("Avatar") << self_av_string() << "creating LLUpdateAppearanceOnDestroy" << LL_ENDL; - LLPointer link_waiter = new LLUpdateAppearanceOnDestroy(!append); - #ifndef LL_RELEASE_FOR_DOWNLOAD LL_DEBUGS("Avatar") << self_av_string() << "Linking body items" << LL_ENDL; #endif - linkAll(cof, body_items, link_waiter); + + // Create links to new COF contents. + LL_DEBUGS("Avatar") << self_av_string() << "creating LLCallAfterInventoryLinkMgr" << LL_ENDL; + bool update_base_outfit_ordering = !append; + LLCallAfterInventoryLinkMgr *link_waiter = + new LLCallAfterInventoryLinkMgr(body_items,cof,"update_appearance_on_destroy", + boost::bind(&LLAppearanceMgr::updateAppearanceFromCOF, + LLAppearanceMgr::getInstance(), + update_base_outfit_ordering)); #ifndef LL_RELEASE_FOR_DOWNLOAD LL_DEBUGS("Avatar") << self_av_string() << "Linking wear items" << LL_ENDL; #endif - linkAll(cof, wear_items, link_waiter); + link_waiter->addItems(wear_items); #ifndef LL_RELEASE_FOR_DOWNLOAD LL_DEBUGS("Avatar") << self_av_string() << "Linking obj items" << LL_ENDL; #endif - linkAll(cof, obj_items, link_waiter); + link_waiter->addItems(obj_items); #ifndef LL_RELEASE_FOR_DOWNLOAD LL_DEBUGS("Avatar") << self_av_string() << "Linking gesture items" << LL_ENDL; #endif - linkAll(cof, gest_items, link_waiter); + link_waiter->addItems(gest_items); // Add link to outfit if category is an outfit. if (!append) { - createBaseOutfitLink(category, link_waiter); + createBaseOutfitLink(category, NULL); } LL_DEBUGS("Avatar") << self_av_string() << "waiting for LLUpdateAppearanceOnDestroy" << LL_ENDL; } @@ -2217,8 +2234,7 @@ void LLAppearanceMgr::wearCategoryFinal(LLUUID& cat_id, bool copy_items, bool ap boost::bind(&LLAppearanceMgr::wearInventoryCategoryOnAvatar, LLAppearanceMgr::getInstance(), gInventory.getCategory(new_cat_id), - append), - boost::function()); + append)); // BAP fixes a lag in display of created dir. gInventory.notifyObservers(); -- cgit v1.2.3 From b75e632613312c7b994355c692d18b95991545b3 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 7 Dec 2012 13:57:44 -0500 Subject: SH-3606 WIP - moving classes to more reusable location --- indra/newview/llappearancemgr.cpp | 71 +++++++++++++-------------------------- 1 file changed, 23 insertions(+), 48 deletions(-) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 98a8097a1e..af276e55c3 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -155,37 +155,6 @@ LLUUID findDescendentCategoryIDByName(const LLUUID& parent_id, const std::string } } -// Shim between inventory callback and boost function -typedef boost::function inventory_func_type; - -class LLBoostFuncInventoryCallback: public LLInventoryCallback -{ -public: - - LLBoostFuncInventoryCallback(const inventory_func_type& func): - mFunc(func) - { - } - - void fire(const LLUUID& item_id) - { - mFunc(item_id); - } - -private: - inventory_func_type mFunc; -}; - -LLPointer make_inventory_func_callback(const inventory_func_type& func) -{ - return new LLBoostFuncInventoryCallback(func); -} - -void report_fire(const LLUUID& item_id) -{ - llinfos << item_id << llendl; -} - void no_op() {} class LLCallAfterInventoryBatchMgr: public LLEventTimer @@ -195,8 +164,7 @@ public: const std::string& phase_name, nullary_func_t on_completion_func, nullary_func_t on_failure_func = no_op, - F32 check_period = 5.0, - F32 retry_after = 10.0, + F32 retry_after = 15.0, S32 max_retries = 2 ): mDstCatID(dst_cat_id), @@ -209,7 +177,7 @@ public: mFailCount(0), mCompletionOrFailureCalled(false), mRetryCount(0), - LLEventTimer(check_period) + LLEventTimer(retry_after) { if (!mTrackingPhase.empty()) { @@ -261,17 +229,20 @@ public: virtual void requestOperation(LLViewerInventoryItem *item) = 0; - void onOp(const LLUUID& src_id, const LLUUID& dst_id) + void onOp(const LLUUID& src_id, const LLUUID& dst_id, LLTimer timestamp) { - LL_DEBUGS("Avatar") << "op done, src_id " << src_id << " dst_id " << dst_id << " after " << mWaitTimes[src_id].getElapsedTimeF32() << " seconds" << llendl; mPendingRequests--; - F32 wait_time = mWaitTimes[src_id].getElapsedTimeF32(); - mTimeStats.push(wait_time); - mWaitTimes.erase(src_id); - if (mCompletionOrFailureCalled) + F32 elapsed = timestamp.getElapsedTimeF32(); + LL_DEBUGS("Avatar") << "op done, src_id " << src_id << " dst_id " << dst_id << " after " << elapsed << " seconds" << llendl; + if (mWaitTimes.find(src_id) == mWaitTimes.end()) { - llinfos << "late-completing operation, src_id " << src_id << "dst_id " << dst_id << llendl; + // No longer waiting for this item - either serviced + // already or gave up after too many retries. + llwarns << "duplicate or late operation, src_id " << src_id << "dst_id " << dst_id + << " elapsed " << elapsed << " after end " << (S32) mCompletionOrFailureCalled << llendl; } + mTimeStats.push(elapsed); + mWaitTimes.erase(src_id); if (mWaitTimes.empty() && !mCompletionOrFailureCalled) { onCompletionOrFailure(); @@ -401,9 +372,11 @@ public: const LLUUID& dst_cat_id, const std::string& phase_name, nullary_func_t on_completion_func, - nullary_func_t on_failure_func = no_op + nullary_func_t on_failure_func = no_op, + F32 retry_after = 15.0, + S32 max_retries = 2 ): - LLCallAfterInventoryBatchMgr(dst_cat_id, phase_name, on_completion_func, on_failure_func) + LLCallAfterInventoryBatchMgr(dst_cat_id, phase_name, on_completion_func, on_failure_func, retry_after, max_retries) { addItems(src_items); } @@ -416,7 +389,7 @@ public: item->getUUID(), mDstCatID, std::string(), - make_inventory_func_callback(boost::bind(&LLCallAfterInventoryBatchMgr::onOp,this,item->getUUID(),_1)) + new LLBoostFuncInventoryCallback(boost::bind(&LLCallAfterInventoryBatchMgr::onOp,this,item->getUUID(),_1,LLTimer())) ); } }; @@ -428,9 +401,11 @@ public: const LLUUID& dst_cat_id, const std::string& phase_name, nullary_func_t on_completion_func, - nullary_func_t on_failure_func = no_op + nullary_func_t on_failure_func = no_op, + F32 retry_after = 15.0, + S32 max_retries = 2 ): - LLCallAfterInventoryBatchMgr(dst_cat_id, phase_name, on_completion_func, on_failure_func) + LLCallAfterInventoryBatchMgr(dst_cat_id, phase_name, on_completion_func, on_failure_func, retry_after, max_retries) { addItems(src_items); } @@ -443,8 +418,8 @@ public: item->getName(), item->LLInventoryItem::getDescription(), LLAssetType::AT_LINK, - make_inventory_func_callback( - boost::bind(&LLCallAfterInventoryBatchMgr::onOp,this,item->getUUID(),_1))); + new LLBoostFuncInventoryCallback( + boost::bind(&LLCallAfterInventoryBatchMgr::onOp,this,item->getUUID(),_1,LLTimer()))); } }; -- cgit v1.2.3 From 0777f53e2f2d773fa536b3c62e16455ce7bbbcce Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 10 Dec 2012 14:47:17 -0500 Subject: SH-3606 WIP - replaced several LLInventoryCallback subclasses with boost::func equivalents --- indra/newview/llappearancemgr.cpp | 280 +++++++++++++++++--------------------- 1 file changed, 123 insertions(+), 157 deletions(-) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index af276e55c3..d34d54fb3b 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -155,8 +155,6 @@ LLUUID findDescendentCategoryIDByName(const LLUUID& parent_id, const std::string } } -void no_op() {} - class LLCallAfterInventoryBatchMgr: public LLEventTimer { public: @@ -423,22 +421,6 @@ public: } }; -//Inventory callback updating "dirty" state when destroyed -class LLUpdateDirtyState: public LLInventoryCallback -{ -public: - LLUpdateDirtyState() {} - virtual ~LLUpdateDirtyState() - { - if (LLAppearanceMgr::instanceExists()) - { - LLAppearanceMgr::getInstance()->updateIsDirty(); - } - } - virtual void fire(const LLUUID&) {} -}; - - LLUpdateAppearanceOnDestroy::LLUpdateAppearanceOnDestroy(bool update_base_outfit_ordering): mFireCount(0), mUpdateBaseOrder(update_base_outfit_ordering) @@ -777,100 +759,72 @@ bool LLWearableHoldingPattern::pollFetchCompletion() return done; } -class RecoveredItemLinkCB: public LLInventoryCallback +void recovered_item_link_cb(const LLUUID& item_id, LLWearableType::EType type, LLViewerWearable *wearable, LLWearableHoldingPattern* holder) { -public: - RecoveredItemLinkCB(LLWearableType::EType type, LLViewerWearable *wearable, LLWearableHoldingPattern* holder): - mHolder(holder), - mWearable(wearable), - mType(type) + if (!holder->isMostRecent()) { + llwarns << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; + // runway skip here? } - void fire(const LLUUID& item_id) - { - if (!mHolder->isMostRecent()) - { - llwarns << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; - // runway skip here? - } - llinfos << "Recovered item link for type " << mType << llendl; - mHolder->eraseTypeToLink(mType); - // Add wearable to FoundData for actual wearing - LLViewerInventoryItem *item = gInventory.getItem(item_id); - LLViewerInventoryItem *linked_item = item ? item->getLinkedItem() : NULL; + llinfos << "Recovered item link for type " << type << llendl; + holder->eraseTypeToLink(type); + // Add wearable to FoundData for actual wearing + LLViewerInventoryItem *item = gInventory.getItem(item_id); + LLViewerInventoryItem *linked_item = item ? item->getLinkedItem() : NULL; - if (linked_item) - { - gInventory.addChangedMask(LLInventoryObserver::LABEL, linked_item->getUUID()); + if (linked_item) + { + gInventory.addChangedMask(LLInventoryObserver::LABEL, linked_item->getUUID()); - if (item) - { - LLFoundData found(linked_item->getUUID(), - linked_item->getAssetUUID(), - linked_item->getName(), - linked_item->getType(), - linked_item->isWearableType() ? linked_item->getWearableType() : LLWearableType::WT_INVALID, - true // is replacement - ); - found.mWearable = mWearable; - mHolder->getFoundList().push_front(found); - } - else - { - llwarns << self_av_string() << "inventory item not found for recovered wearable" << llendl; - } + if (item) + { + LLFoundData found(linked_item->getUUID(), + linked_item->getAssetUUID(), + linked_item->getName(), + linked_item->getType(), + linked_item->isWearableType() ? linked_item->getWearableType() : LLWearableType::WT_INVALID, + true // is replacement + ); + found.mWearable = wearable; + holder->getFoundList().push_front(found); } else { - llwarns << self_av_string() << "inventory link not found for recovered wearable" << llendl; + llwarns << self_av_string() << "inventory item not found for recovered wearable" << llendl; } } -private: - LLWearableHoldingPattern* mHolder; - LLViewerWearable *mWearable; - LLWearableType::EType mType; -}; + else + { + llwarns << self_av_string() << "inventory link not found for recovered wearable" << llendl; + } +} -class RecoveredItemCB: public LLInventoryCallback +void recovered_item_cb(const LLUUID& item_id, LLWearableType::EType type, LLViewerWearable *wearable, LLWearableHoldingPattern* holder) { -public: - RecoveredItemCB(LLWearableType::EType type, LLViewerWearable *wearable, LLWearableHoldingPattern* holder): - mHolder(holder), - mWearable(wearable), - mType(type) + if (!holder->isMostRecent()) { + // runway skip here? + llwarns << self_av_string() << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; } - void fire(const LLUUID& item_id) - { - if (!mHolder->isMostRecent()) - { - // runway skip here? - llwarns << self_av_string() << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; - } - LL_DEBUGS("Avatar") << self_av_string() << "Recovered item for type " << mType << LL_ENDL; - LLViewerInventoryItem *itemp = gInventory.getItem(item_id); - mWearable->setItemID(item_id); - LLPointer cb = new RecoveredItemLinkCB(mType,mWearable,mHolder); - mHolder->eraseTypeToRecover(mType); - llassert(itemp); - if (itemp) - { - link_inventory_item( gAgent.getID(), - item_id, - LLAppearanceMgr::instance().getCOF(), - itemp->getName(), - itemp->getDescription(), - LLAssetType::AT_LINK, - cb); - } + LL_DEBUGS("Avatar") << self_av_string() << "Recovered item for type " << type << LL_ENDL; + LLViewerInventoryItem *itemp = gInventory.getItem(item_id); + wearable->setItemID(item_id); + LLPointer cb = new LLBoostFuncInventoryCallback(boost::bind(recovered_item_link_cb,_1,type,wearable,holder)); + holder->eraseTypeToRecover(type); + llassert(itemp); + if (itemp) + { + link_inventory_item( gAgent.getID(), + item_id, + LLAppearanceMgr::instance().getCOF(), + itemp->getName(), + itemp->getDescription(), + LLAssetType::AT_LINK, + cb); } -private: - LLWearableHoldingPattern* mHolder; - LLViewerWearable *mWearable; - LLWearableType::EType mType; -}; +} void LLWearableHoldingPattern::recoverMissingWearable(LLWearableType::EType type) { @@ -888,7 +842,7 @@ void LLWearableHoldingPattern::recoverMissingWearable(LLWearableType::EType type // Add a new one in the lost and found folder. const LLUUID lost_and_found_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND); - LLPointer cb = new RecoveredItemCB(type,wearable,this); + LLPointer cb = new LLBoostFuncInventoryCallback(boost::bind(recovered_item_cb,_1,type,wearable,this)); create_inventory_item(gAgent.getID(), gAgent.getSessionID(), @@ -1225,6 +1179,18 @@ const LLUUID LLAppearanceMgr::getBaseOutfitUUID() return outfit_cat->getUUID(); } +void wear_on_avatar_cb(const LLUUID& inv_item, bool do_replace = false) +{ + if (inv_item.isNull()) + return; + + LLViewerInventoryItem *item = gInventory.getItem(inv_item); + if (item) + { + LLAppearanceMgr::instance().wearItemOnAvatar(inv_item, true, do_replace); + } +} + bool LLAppearanceMgr::wearItemOnAvatar(const LLUUID& item_id_to_wear, bool do_update, bool replace, LLPointer cb) { if (item_id_to_wear.isNull()) return false; @@ -1244,8 +1210,8 @@ bool LLAppearanceMgr::wearItemOnAvatar(const LLUUID& item_id_to_wear, bool do_up if (gInventory.isObjectDescendentOf(item_to_wear->getUUID(), gInventory.getLibraryRootFolderID())) { - LLPointer cb = new WearOnAvatarCallback(replace); - copy_inventory_item(gAgent.getID(), item_to_wear->getPermissions().getOwner(), item_to_wear->getUUID(), LLUUID::null, std::string(),cb); + LLPointer cb = new LLBoostFuncInventoryCallback(boost::bind(wear_on_avatar_cb,_1,replace)); + copy_inventory_item(gAgent.getID(), item_to_wear->getPermissions().getOwner(), item_to_wear->getUUID(), LLUUID::null, std::string(), cb); return false; } else if (!gInventory.isObjectDescendentOf(item_to_wear->getUUID(), gInventory.getRootFolderID())) @@ -2348,6 +2314,25 @@ void LLAppearanceMgr::addCOFItemLink(const LLUUID &item_id, bool do_update, LLPo } } +void modified_cof_cb(const LLUUID& inv_item) +{ + LLAppearanceMgr::instance().updateAppearanceFromCOF(); + + // Start editing the item if previously requested. + gAgentWearables.editWearableIfRequested(inv_item); + + // TODO: camera mode may not be changed if a debug setting is tweaked + if( gAgentCamera.cameraCustomizeAvatar() ) + { + // If we're in appearance editing mode, the current tab may need to be refreshed + LLSidepanelAppearance *panel = dynamic_cast(LLFloaterSidePanelContainer::getPanel("appearance")); + if (panel) + { + panel->showDefaultSubpart(); + } + } +} + void LLAppearanceMgr::addCOFItemLink(const LLInventoryItem *item, bool do_update, LLPointer cb) { const LLViewerInventoryItem *vitem = dynamic_cast(item); @@ -2411,7 +2396,7 @@ void LLAppearanceMgr::addCOFItemLink(const LLInventoryItem *item, bool do_update { if(do_update && cb.isNull()) { - cb = new ModifiedCOFCallback; + cb = new LLBoostFuncInventoryCallback(modified_cof_cb); } const std::string description = vitem->getIsLinkType() ? vitem->getDescription() : ""; link_inventory_item( gAgent.getID(), @@ -2425,22 +2410,6 @@ void LLAppearanceMgr::addCOFItemLink(const LLInventoryItem *item, bool do_update return; } -// BAP remove ensemble code for 2.1? -void LLAppearanceMgr::addEnsembleLink( LLInventoryCategory* cat, bool do_update ) -{ -#if SUPPORT_ENSEMBLES - // BAP add check for already in COF. - LLPointer cb = do_update ? new ModifiedCOFCallback : 0; - link_inventory_item( gAgent.getID(), - cat->getLinkedUUID(), - getCOF(), - cat->getName(), - cat->getDescription(), - LLAssetType::AT_LINK_FOLDER, - cb); -#endif -} - void LLAppearanceMgr::removeAllClothesFromAvatar() { // Fetch worn clothes (i.e. the ones in COF). @@ -2668,7 +2637,7 @@ void LLAppearanceMgr::copyLibraryGestures() folder_name == COMMON_GESTURES_FOLDER || folder_name == OTHER_GESTURES_FOLDER) { - cb = new ActivateGestureCallback; + cb = new LLBoostFuncInventoryCallback(activate_gesture_cb); } LLUUID cat_id = findDescendentCategoryIDByName(lib_gesture_cat_id,folder_name); @@ -2722,6 +2691,16 @@ void LLAppearanceMgr::onFirstFullyVisible() } } +// update "dirty" state - defined outside class to allow for calling +// after appearance mgr instance has been destroyed. +void appearance_mgr_update_dirty_state() +{ + if (LLAppearanceMgr::instanceExists()) + { + LLAppearanceMgr::getInstance()->updateIsDirty(); + } +} + bool LLAppearanceMgr::updateBaseOutfit() { if (isOutfitLocked()) @@ -2742,8 +2721,8 @@ bool LLAppearanceMgr::updateBaseOutfit() // in a Base Outfit we do not remove items, only links purgeCategory(base_outfit_id, false); - - LLPointer dirty_state_updater = new LLUpdateDirtyState(); + LLPointer dirty_state_updater = + new LLBoostFuncInventoryCallback(no_op_inventory_func, appearance_mgr_update_dirty_state); //COF contains only links so we copy to the Base Outfit only links shallowCopyCategoryContents(getCOF(), base_outfit_id, dirty_state_updater); @@ -2998,48 +2977,34 @@ void LLAppearanceMgr::requestServerAppearanceUpdate(LLCurl::ResponderPtr respond mLastUpdateRequestCOFVersion = cof_version; } -class LLShowCreatedOutfit: public LLInventoryCallback +void show_created_outfit(LLUUID& folder_id, bool show_panel = true) { -public: - LLShowCreatedOutfit(LLUUID& folder_id, bool show_panel = true): mFolderID(folder_id), mShowPanel(show_panel) - {} - - virtual ~LLShowCreatedOutfit() + if (!LLApp::isRunning()) { - if (!LLApp::isRunning()) - { - llwarns << "called during shutdown, skipping" << llendl; - return; - } - - LLSD key; + llwarns << "called during shutdown, skipping" << llendl; + return; + } + + LLSD key; + + //EXT-7727. For new accounts inventory callback is created during login process + // and may be processed after login process is finished + if (show_panel) + { + LLFloaterSidePanelContainer::showPanel("appearance", "panel_outfits_inventory", key); - //EXT-7727. For new accounts LLShowCreatedOutfit is created during login process - // add may be processed after login process is finished - if (mShowPanel) - { - LLFloaterSidePanelContainer::showPanel("appearance", "panel_outfits_inventory", key); - - } - LLOutfitsList *outfits_list = - dynamic_cast(LLFloaterSidePanelContainer::getPanel("appearance", "outfitslist_tab")); - if (outfits_list) - { - outfits_list->setSelectedOutfitByUUID(mFolderID); - } - - LLAppearanceMgr::getInstance()->updateIsDirty(); - gAgentWearables.notifyLoadingFinished(); // New outfit is saved. - LLAppearanceMgr::getInstance()->updatePanelOutfitName(""); } - - virtual void fire(const LLUUID&) - {} - -private: - LLUUID mFolderID; - bool mShowPanel; -}; + LLOutfitsList *outfits_list = + dynamic_cast(LLFloaterSidePanelContainer::getPanel("appearance", "outfitslist_tab")); + if (outfits_list) + { + outfits_list->setSelectedOutfitByUUID(folder_id); + } + + LLAppearanceMgr::getInstance()->updateIsDirty(); + gAgentWearables.notifyLoadingFinished(); // New outfit is saved. + LLAppearanceMgr::getInstance()->updatePanelOutfitName(""); +} LLUUID LLAppearanceMgr::makeNewOutfitLinks(const std::string& new_folder_name, bool show_panel) { @@ -3056,7 +3021,8 @@ LLUUID LLAppearanceMgr::makeNewOutfitLinks(const std::string& new_folder_name, b updateClothingOrderingInfo(); - LLPointer cb = new LLShowCreatedOutfit(folder_id,show_panel); + LLPointer cb = new LLBoostFuncInventoryCallback(no_op_inventory_func, + boost::bind(show_created_outfit,folder_id,show_panel)); shallowCopyCategoryContents(getCOF(),folder_id, cb); createBaseOutfitLink(folder_id, cb); -- cgit v1.2.3 From 8657da24cd206af87cb32d095b347f7aa07596b5 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 11 Dec 2012 18:21:09 -0500 Subject: SH-3604 WIP - added base outfit link creation to retryable copy/link operations. Resolves race condition with cof version and server texture bakes --- indra/newview/llappearancemgr.cpp | 72 +++++++++++++++++++++++++++------------ 1 file changed, 50 insertions(+), 22 deletions(-) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index d34d54fb3b..e326ca5e15 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -191,19 +191,13 @@ public: { LLViewerInventoryItem* item = *it; llassert(item); - addItem(item); + addItem(item->getUUID()); } } // Request or re-request operation for specified item. - void addItem(LLViewerInventoryItem *item) + void addItem(const LLUUID& item_id) { - const LLUUID& item_id = item->getUUID(); - if (!item) - { - llwarns << "item not found for " << item_id << llendl; - return; - } mPendingRequests++; // On a re-request, this will reset the timer. mWaitTimes[item_id] = LLTimer(); @@ -222,10 +216,10 @@ public: return; } - requestOperation(item); + requestOperation(item_id); } - virtual void requestOperation(LLViewerInventoryItem *item) = 0; + virtual void requestOperation(const LLUUID& item_id) = 0; void onOp(const LLUUID& src_id, const LLUUID& dst_id, LLTimer timestamp) { @@ -314,7 +308,7 @@ public: LL_DEBUGS("Avatar") << "Waited " << time_waited << " for " << curr_it->first << ", retrying" << llendl; mRetryCount++; - addItem(gInventory.getItem(curr_it->first)); + addItem(curr_it->first); } else { @@ -379,8 +373,10 @@ public: addItems(src_items); } - virtual void requestOperation(LLViewerInventoryItem *item) + virtual void requestOperation(const LLUUID& item_id) { + LLViewerInventoryItem *item = gInventory.getItem(item_id); + llassert(item); copy_inventory_item( gAgent.getID(), item->getPermissions().getOwner(), @@ -408,16 +404,46 @@ public: addItems(src_items); } - virtual void requestOperation(LLViewerInventoryItem *item) + virtual void requestOperation(const LLUUID& item_id) { - link_inventory_item(gAgent.getID(), - item->getLinkedUUID(), - mDstCatID, - item->getName(), - item->LLInventoryItem::getDescription(), - LLAssetType::AT_LINK, - new LLBoostFuncInventoryCallback( - boost::bind(&LLCallAfterInventoryBatchMgr::onOp,this,item->getUUID(),_1,LLTimer()))); + LLViewerInventoryItem *item = gInventory.getItem(item_id); + if (item) + { + // create an inventory item link. + link_inventory_item(gAgent.getID(), + item->getLinkedUUID(), + mDstCatID, + item->getName(), + item->LLInventoryItem::getDescription(), + LLAssetType::AT_LINK, + new LLBoostFuncInventoryCallback( + boost::bind(&LLCallAfterInventoryBatchMgr::onOp,this,item->getUUID(),_1,LLTimer()))); + } + else + { + // create a base outfit link if appropriate. + LLViewerInventoryCategory *catp = gInventory.getCategory(item_id); + if (!catp) + { + llwarns << "id not found as inventory item or category " << item_id << llendl; + return; + } + const LLUUID cof = LLAppearanceMgr::instance().getCOF(); + std::string new_outfit_name = ""; + + LLAppearanceMgr::instance().purgeBaseOutfitLink(cof); + + if (catp && catp->getPreferredType() == LLFolderType::FT_OUTFIT) + { + link_inventory_item(gAgent.getID(), item_id, cof, catp->getName(), "", + LLAssetType::AT_LINK_FOLDER, + new LLBoostFuncInventoryCallback( + boost::bind(&LLCallAfterInventoryBatchMgr::onOp,this,item_id,_1,LLTimer()))); + new_outfit_name = catp->getName(); + } + + LLAppearanceMgr::instance().updatePanelOutfitName(new_outfit_name); + } } }; @@ -1742,7 +1768,7 @@ void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append) // Add link to outfit if category is an outfit. if (!append) { - createBaseOutfitLink(category, NULL); + link_waiter->addItem(category); } LL_DEBUGS("Avatar") << self_av_string() << "waiting for LLUpdateAppearanceOnDestroy" << LL_ENDL; } @@ -2967,6 +2993,8 @@ void LLAppearanceMgr::requestServerAppearanceUpdate(LLCurl::ResponderPtr respond LLSD body; S32 cof_version = getCOFVersion(); body["cof_version"] = cof_version; + LL_DEBUGS("Avatar") << "my_cof_version " << cof_version << llendl; + //LLCurl::ResponderPtr responder_ptr; if (!responder_ptr.get()) { -- cgit v1.2.3 From 46cfca5ed6590435d5f1956376479a8876770376 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 12 Dec 2012 12:06:24 -0500 Subject: Fix for problem found with changing to an outfit with missing shape --- indra/newview/llappearancemgr.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index e326ca5e15..b0136a570e 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -191,7 +191,7 @@ public: { LLViewerInventoryItem* item = *it; llassert(item); - addItem(item->getUUID()); + addItem(item->getLinkedUUID()); } } @@ -1732,11 +1732,6 @@ void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append) getDescendentsOfAssetType(category, gest_items, LLAssetType::AT_GESTURE, false); removeDuplicateItems(gest_items); - // Remove current COF contents. - bool keep_outfit_links = append; - purgeCategory(cof, keep_outfit_links); - gInventory.notifyObservers(); - #ifndef LL_RELEASE_FOR_DOWNLOAD LL_DEBUGS("Avatar") << self_av_string() << "Linking body items" << LL_ENDL; #endif @@ -1770,6 +1765,15 @@ void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append) { link_waiter->addItem(category); } + + // Remove current COF contents. Have to do this after creating + // the link_waiter so links can be followed for any items that get + // carried over (e.g. keeping old shape if the new outfit does not + // contain one) + bool keep_outfit_links = append; + purgeCategory(cof, keep_outfit_links); + gInventory.notifyObservers(); + LL_DEBUGS("Avatar") << self_av_string() << "waiting for LLUpdateAppearanceOnDestroy" << LL_ENDL; } -- cgit v1.2.3 From 507080795f1ee21e7ffc2bee842edc5236f8e38f Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 12 Dec 2012 15:32:31 -0500 Subject: SH-3604 WIP - fixed a failure when base outfit link did not need to be created --- indra/newview/llappearancemgr.cpp | 61 +++++++++++++++++++++++++++++---------- 1 file changed, 45 insertions(+), 16 deletions(-) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index b0136a570e..f957aadec5 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -191,35 +191,56 @@ public: { LLViewerInventoryItem* item = *it; llassert(item); - addItem(item->getLinkedUUID()); + addItem(item->getUUID()); } } // Request or re-request operation for specified item. void addItem(const LLUUID& item_id) { - mPendingRequests++; - // On a re-request, this will reset the timer. - mWaitTimes[item_id] = LLTimer(); - if (mRetryCounts.find(item_id) == mRetryCounts.end()) + LLUUID linked_id; + if (gInventory.getItem(item_id)) + { + linked_id = gInventory.getItem(item_id)->getLinkedUUID(); + } + else if (gInventory.getCategory(item_id)) { - mRetryCounts[item_id] = 0; + linked_id = item_id; } else { - mRetryCounts[item_id]++; + llwarns << "no referent found for item_id " << item_id << llendl; + return; } - + LL_DEBUGS("Avatar") << "item_id " << item_id << " -> linked_id " << linked_id << llendl; + if (ll_frand()getPermissions().getOwner(), item->getUUID(), mDstCatID, std::string(), - new LLBoostFuncInventoryCallback(boost::bind(&LLCallAfterInventoryBatchMgr::onOp,this,item->getUUID(),_1,LLTimer())) + new LLBoostFuncInventoryCallback(boost::bind(&LLCallAfterInventoryBatchMgr::onOp,this,item_id,_1,LLTimer())) ); + return true; } }; @@ -404,20 +427,23 @@ public: addItems(src_items); } - virtual void requestOperation(const LLUUID& item_id) + virtual bool requestOperation(const LLUUID& item_id) { + bool request_sent = false; LLViewerInventoryItem *item = gInventory.getItem(item_id); if (item) { + LL_DEBUGS("Avatar") << "linking item " << item_id << " name " << item->getName() << " to " << mDstCatID << llendl; // create an inventory item link. link_inventory_item(gAgent.getID(), - item->getLinkedUUID(), + item_id, mDstCatID, item->getName(), item->LLInventoryItem::getDescription(), LLAssetType::AT_LINK, new LLBoostFuncInventoryCallback( - boost::bind(&LLCallAfterInventoryBatchMgr::onOp,this,item->getUUID(),_1,LLTimer()))); + boost::bind(&LLCallAfterInventoryBatchMgr::onOp,this,item_id,_1,LLTimer()))); + request_sent = true; } else { @@ -426,7 +452,7 @@ public: if (!catp) { llwarns << "id not found as inventory item or category " << item_id << llendl; - return; + return false; } const LLUUID cof = LLAppearanceMgr::instance().getCOF(); std::string new_outfit_name = ""; @@ -435,15 +461,18 @@ public: if (catp && catp->getPreferredType() == LLFolderType::FT_OUTFIT) { + LL_DEBUGS("Avatar") << "linking folder " << item_id << " name " << catp->getName() << " to cof " << cof << llendl; link_inventory_item(gAgent.getID(), item_id, cof, catp->getName(), "", LLAssetType::AT_LINK_FOLDER, new LLBoostFuncInventoryCallback( boost::bind(&LLCallAfterInventoryBatchMgr::onOp,this,item_id,_1,LLTimer()))); new_outfit_name = catp->getName(); + request_sent = true; } LLAppearanceMgr::instance().updatePanelOutfitName(new_outfit_name); } + return request_sent; } }; -- cgit v1.2.3 From b86a3e39cf8d0d17d5cd30743a871e3078331077 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 17 Dec 2012 13:24:57 -0500 Subject: SH-3604 FIX - resolved an issue with simulated failures/retry logic --- indra/newview/llappearancemgr.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index f957aadec5..7fd7b33be4 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -217,12 +217,12 @@ public: if (ll_frand() Date: Mon, 17 Dec 2012 16:51:25 -0500 Subject: SH-3629 WIP - fixed out-of-order outfit items --- indra/newview/llappearancemgr.cpp | 32 +++++++++----------------------- 1 file changed, 9 insertions(+), 23 deletions(-) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 7fd7b33be4..7751da7b41 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -198,44 +198,30 @@ public: // Request or re-request operation for specified item. void addItem(const LLUUID& item_id) { - LLUUID linked_id; - if (gInventory.getItem(item_id)) - { - linked_id = gInventory.getItem(item_id)->getLinkedUUID(); - } - else if (gInventory.getCategory(item_id)) - { - linked_id = item_id; - } - else - { - llwarns << "no referent found for item_id " << item_id << llendl; - return; - } - LL_DEBUGS("Avatar") << "item_id " << item_id << " -> linked_id " << linked_id << llendl; + LL_DEBUGS("Avatar") << "item_id " << item_id << llendl; if (ll_frand()getName() << " to " << mDstCatID << llendl; // create an inventory item link. link_inventory_item(gAgent.getID(), - item_id, + item->getLinkedUUID(), mDstCatID, item->getName(), item->LLInventoryItem::getDescription(), -- cgit v1.2.3 From 42496cd672436cc4d32f5546fd04294931b8f0b6 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 17 Dec 2012 18:34:13 -0500 Subject: SH-3629 WIP - avoid clobbering links to desired items that are already in the COF, as will be the case when wearing an outfit with required body parts missing --- indra/newview/llappearancemgr.cpp | 49 ++++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 24 deletions(-) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 7751da7b41..1044732f4b 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -418,6 +418,11 @@ public: LLViewerInventoryItem *item = gInventory.getItem(item_id); if (item) { + if (item->getParentUUID() == mDstCatID) + { + LL_DEBUGS("Avatar") << "item " << item_id << " name " << item->getName() << " is already a child of " << mDstCatID << llendl; + return false; + } LL_DEBUGS("Avatar") << "linking item " << item_id << " name " << item->getName() << " to " << mDstCatID << llendl; // create an inventory item link. link_inventory_item(gAgent.getID(), @@ -436,7 +441,7 @@ public: LLViewerInventoryCategory *catp = gInventory.getCategory(item_id); if (!catp) { - llwarns << "id not found as inventory item or category " << item_id << llendl; + llwarns << "link request failed, id not found as inventory item or category " << item_id << llendl; return false; } const LLUUID cof = LLAppearanceMgr::instance().getCOF(); @@ -1621,7 +1626,7 @@ void LLAppearanceMgr::purgeBaseOutfitLink(const LLUUID& category) } } -void LLAppearanceMgr::purgeCategory(const LLUUID& category, bool keep_outfit_links) +void LLAppearanceMgr::purgeCategory(const LLUUID& category, bool keep_outfit_links, LLInventoryModel::item_array_t* keep_items) { LLInventoryModel::cat_array_t cats; LLInventoryModel::item_array_t items; @@ -1634,7 +1639,14 @@ void LLAppearanceMgr::purgeCategory(const LLUUID& category, bool keep_outfit_lin continue; if (item->getIsLinkType()) { - gInventory.purgeObject(item->getUUID()); + if (keep_items && keep_items->find(item) != LLInventoryModel::item_array_t::FAIL) + { + llinfos << "preserved item" << llendl; + } + else + { + gInventory.purgeObject(item->getUUID()); + } } } } @@ -1746,34 +1758,23 @@ void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append) getDescendentsOfAssetType(category, gest_items, LLAssetType::AT_GESTURE, false); removeDuplicateItems(gest_items); -#ifndef LL_RELEASE_FOR_DOWNLOAD - LL_DEBUGS("Avatar") << self_av_string() << "Linking body items" << LL_ENDL; -#endif - // Create links to new COF contents. LL_DEBUGS("Avatar") << self_av_string() << "creating LLCallAfterInventoryLinkMgr" << LL_ENDL; + + LLInventoryModel::item_array_t all_items; + all_items += body_items; + all_items += wear_items; + all_items += obj_items; + all_items += gest_items; + + // Will link all the above items. bool update_base_outfit_ordering = !append; LLCallAfterInventoryLinkMgr *link_waiter = - new LLCallAfterInventoryLinkMgr(body_items,cof,"update_appearance_on_destroy", + new LLCallAfterInventoryLinkMgr(all_items,cof,"update_appearance_on_destroy", boost::bind(&LLAppearanceMgr::updateAppearanceFromCOF, LLAppearanceMgr::getInstance(), update_base_outfit_ordering)); -#ifndef LL_RELEASE_FOR_DOWNLOAD - LL_DEBUGS("Avatar") << self_av_string() << "Linking wear items" << LL_ENDL; -#endif - link_waiter->addItems(wear_items); - -#ifndef LL_RELEASE_FOR_DOWNLOAD - LL_DEBUGS("Avatar") << self_av_string() << "Linking obj items" << LL_ENDL; -#endif - link_waiter->addItems(obj_items); - -#ifndef LL_RELEASE_FOR_DOWNLOAD - LL_DEBUGS("Avatar") << self_av_string() << "Linking gesture items" << LL_ENDL; -#endif - link_waiter->addItems(gest_items); - // Add link to outfit if category is an outfit. if (!append) { @@ -1785,7 +1786,7 @@ void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append) // carried over (e.g. keeping old shape if the new outfit does not // contain one) bool keep_outfit_links = append; - purgeCategory(cof, keep_outfit_links); + purgeCategory(cof, keep_outfit_links, &all_items); gInventory.notifyObservers(); LL_DEBUGS("Avatar") << self_av_string() << "waiting for LLUpdateAppearanceOnDestroy" << LL_ENDL; -- cgit v1.2.3 From 67c66a12ab0e169e9e1e86265ff57aa5aa758b2a Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 18 Dec 2012 12:45:10 -0500 Subject: SH-3604 WIP - fixed a case with retry logic --- indra/newview/llappearancemgr.cpp | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 1044732f4b..4a484f3b85 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -199,14 +199,8 @@ public: void addItem(const LLUUID& item_id) { LL_DEBUGS("Avatar") << "item_id " << item_id << llendl; - - if (ll_frand()getPermissions().getOwner(), @@ -425,6 +424,11 @@ public: } LL_DEBUGS("Avatar") << "linking item " << item_id << " name " << item->getName() << " to " << mDstCatID << llendl; // create an inventory item link. + if (ll_frand() < gSavedSettings.getF32("InventoryDebugSimulateOpFailureRate")) + { + LL_DEBUGS("Avatar") << "simulating failure by not sending request for item " << item_id << llendl; + return true; + } link_inventory_item(gAgent.getID(), item->getLinkedUUID(), mDstCatID, @@ -433,7 +437,7 @@ public: LLAssetType::AT_LINK, new LLBoostFuncInventoryCallback( boost::bind(&LLCallAfterInventoryBatchMgr::onOp,this,item_id,_1,LLTimer()))); - request_sent = true; + return true; } else { @@ -451,6 +455,11 @@ public: if (catp && catp->getPreferredType() == LLFolderType::FT_OUTFIT) { + if (ll_frand() < gSavedSettings.getF32("InventoryDebugSimulateOpFailureRate")) + { + LL_DEBUGS("Avatar") << "simulating failure by not sending request for item " << item_id << llendl; + return true; + } LL_DEBUGS("Avatar") << "linking folder " << item_id << " name " << catp->getName() << " to cof " << cof << llendl; link_inventory_item(gAgent.getID(), item_id, cof, catp->getName(), "", LLAssetType::AT_LINK_FOLDER, -- cgit v1.2.3 From cd710087817909a0a83289cd1ee6a39e5e9a1a5c Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 18 Dec 2012 13:07:01 -0500 Subject: SH-3604 WIP - more frequent polling for retries --- indra/newview/llappearancemgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 4a484f3b85..8b4adc8785 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -175,7 +175,7 @@ public: mFailCount(0), mCompletionOrFailureCalled(false), mRetryCount(0), - LLEventTimer(retry_after) + LLEventTimer(5.0) { if (!mTrackingPhase.empty()) { -- cgit v1.2.3 From 5e7f36541b503bb2bd03e121c7ef13025f69065a Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 10 Jan 2013 13:22:48 -0500 Subject: SH-3639 WIP - increased retry interval to allow for intermittent extremely slow responses --- indra/newview/llappearancemgr.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 8b4adc8785..bf35382b7a 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -155,6 +155,11 @@ LLUUID findDescendentCategoryIDByName(const LLUUID& parent_id, const std::string } } +// We want this to be much lower (e.g. 15.0 is usually fine), bumping +// up for now until we can diagnose some cases of very slow response +// to requests. +const F32 DEFAULT_RETRY_AFTER_INTERVAL = 300.0; + class LLCallAfterInventoryBatchMgr: public LLEventTimer { public: @@ -162,7 +167,7 @@ public: const std::string& phase_name, nullary_func_t on_completion_func, nullary_func_t on_failure_func = no_op, - F32 retry_after = 15.0, + F32 retry_after = DEFAULT_RETRY_AFTER_INTERVAL, S32 max_retries = 2 ): mDstCatID(dst_cat_id), @@ -365,7 +370,7 @@ public: const std::string& phase_name, nullary_func_t on_completion_func, nullary_func_t on_failure_func = no_op, - F32 retry_after = 15.0, + F32 retry_after = DEFAULT_RETRY_AFTER_INTERVAL, S32 max_retries = 2 ): LLCallAfterInventoryBatchMgr(dst_cat_id, phase_name, on_completion_func, on_failure_func, retry_after, max_retries) @@ -403,7 +408,7 @@ public: const std::string& phase_name, nullary_func_t on_completion_func, nullary_func_t on_failure_func = no_op, - F32 retry_after = 15.0, + F32 retry_after = DEFAULT_RETRY_AFTER_INTERVAL, S32 max_retries = 2 ): LLCallAfterInventoryBatchMgr(dst_cat_id, phase_name, on_completion_func, on_failure_func, retry_after, max_retries) -- cgit v1.2.3 From 0f753a530b914370c7c89c198ee335833ac3e6a1 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 11 Jan 2013 11:36:11 -0500 Subject: SH-3639 WIP - cleaned up some diagnostics and added fault injection ability. Disabled inventory retries for now. --- indra/newview/llappearancemgr.cpp | 43 +++++++++++++++++++++++++++++++++------ 1 file changed, 37 insertions(+), 6 deletions(-) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index bf35382b7a..7edba842b8 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -49,6 +49,7 @@ #include "llvoavatarself.h" #include "llviewerregion.h" #include "llwearablelist.h" +#include "llsdutil.h" std::string self_av_string() { @@ -160,6 +161,11 @@ LLUUID findDescendentCategoryIDByName(const LLUUID& parent_id, const std::string // to requests. const F32 DEFAULT_RETRY_AFTER_INTERVAL = 300.0; +// Given the current back-end problems, retrying is causing too many +// duplicate items. Bump this back to 2 once they are resolved (or can +// leave at 0 if the operations become actually reliable). +const S32 DEFAULT_MAX_RETRIES = 0; + class LLCallAfterInventoryBatchMgr: public LLEventTimer { public: @@ -168,7 +174,7 @@ public: nullary_func_t on_completion_func, nullary_func_t on_failure_func = no_op, F32 retry_after = DEFAULT_RETRY_AFTER_INTERVAL, - S32 max_retries = 2 + S32 max_retries = DEFAULT_MAX_RETRIES ): mDstCatID(dst_cat_id), mTrackingPhase(phase_name), @@ -228,6 +234,13 @@ public: void onOp(const LLUUID& src_id, const LLUUID& dst_id, LLTimer timestamp) { + if (ll_frand() < gSavedSettings.getF32("InventoryDebugSimulateLateOpRate")) + { + llwarns << "Simulating late operation by punting handling to later" << llendl; + doAfterInterval(boost::bind(&LLCallAfterInventoryBatchMgr::onOp,this,src_id,dst_id,timestamp), + mRetryAfter); + return; + } mPendingRequests--; F32 elapsed = timestamp.getElapsedTimeF32(); LL_DEBUGS("Avatar") << "op done, src_id " << src_id << " dst_id " << dst_id << " after " << elapsed << " seconds" << llendl; @@ -371,7 +384,7 @@ public: nullary_func_t on_completion_func, nullary_func_t on_failure_func = no_op, F32 retry_after = DEFAULT_RETRY_AFTER_INTERVAL, - S32 max_retries = 2 + S32 max_retries = DEFAULT_MAX_RETRIES ): LLCallAfterInventoryBatchMgr(dst_cat_id, phase_name, on_completion_func, on_failure_func, retry_after, max_retries) { @@ -409,7 +422,7 @@ public: nullary_func_t on_completion_func, nullary_func_t on_failure_func = no_op, F32 retry_after = DEFAULT_RETRY_AFTER_INTERVAL, - S32 max_retries = 2 + S32 max_retries = DEFAULT_MAX_RETRIES ): LLCallAfterInventoryBatchMgr(dst_cat_id, phase_name, on_completion_func, on_failure_func, retry_after, max_retries) { @@ -1653,6 +1666,7 @@ void LLAppearanceMgr::purgeCategory(const LLUUID& category, bool keep_outfit_lin continue; if (item->getIsLinkType()) { +#if 0 if (keep_items && keep_items->find(item) != LLInventoryModel::item_array_t::FAIL) { llinfos << "preserved item" << llendl; @@ -1661,7 +1675,10 @@ void LLAppearanceMgr::purgeCategory(const LLUUID& category, bool keep_outfit_lin { gInventory.purgeObject(item->getUUID()); } +#else + gInventory.purgeObject(item->getUUID()); } +#endif } } @@ -2981,13 +2998,27 @@ public: // Successful completion. /* virtual */ void result(const LLSD& content) { - llinfos << "request OK" << llendl; + LL_DEBUGS("Avatar") << "content: " << ll_pretty_print_sd(content) << LL_ENDL; + if (content["success"].asBoolean()) + { + LL_DEBUGS("Avatar") << "OK" << LL_ENDL; + } + else + { + onFailure(200); + } } // Error - /*virtual*/ void error(U32 status, const std::string& reason) + /*virtual*/ void errorWithContent(U32 status, const std::string& reason, const LLSD& content) { llwarns << "appearance update request failed, status: " << status << " reason: " << reason << llendl; + LL_DEBUGS("Avatar") << "content: " << ll_pretty_print_sd(content) << LL_ENDL; + onFailure(status); + } + + void onFailure(U32 status) + { F32 seconds_to_wait; if (mRetryPolicy->shouldRetry(status,seconds_to_wait)) { @@ -3001,7 +3032,7 @@ public: { llwarns << "giving up after too many retries" << llendl; } - } + } LLPointer mRetryPolicy; }; -- cgit v1.2.3 From f48011e4d04f744a93a18267bf7b78ec0b717b7c Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 15 Jan 2013 20:30:20 -0500 Subject: SH-3339 WIP, SH-3645 WIP - added getActualDescription to obviate an obnoxious and widely-used workaround, re-create COF link after wearable edit to force COF version bump --- indra/newview/llappearancemgr.cpp | 49 ++++++++++++++++++++++++++++++--------- 1 file changed, 38 insertions(+), 11 deletions(-) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 7edba842b8..d1ed82cc98 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -451,7 +451,7 @@ public: item->getLinkedUUID(), mDstCatID, item->getName(), - item->LLInventoryItem::getDescription(), + item->getActualDescription(), LLAssetType::AT_LINK, new LLBoostFuncInventoryCallback( boost::bind(&LLCallAfterInventoryBatchMgr::onOp,this,item_id,_1,LLTimer()))); @@ -1467,13 +1467,13 @@ void LLAppearanceMgr::shallowCopyCategoryContents(const LLUUID& src_id, const LL { case LLAssetType::AT_LINK: { - //LLInventoryItem::getDescription() is used for a new description + //getActualDescription() is used for a new description //to propagate ordering information saved in descriptions of links link_inventory_item(gAgent.getID(), item->getLinkedUUID(), dst_id, item->getName(), - item->LLInventoryItem::getDescription(), + item->getActualDescription(), LLAssetType::AT_LINK, cb); break; } @@ -1718,7 +1718,7 @@ void LLAppearanceMgr::linkAll(const LLUUID& cat_uuid, item->getLinkedUUID(), cat_uuid, item->getName(), - item->LLInventoryItem::getDescription(), + item->getActualDescription(), LLAssetType::AT_LINK, cb); @@ -1910,7 +1910,7 @@ bool sort_by_description(const LLInventoryItem* item1, const LLInventoryItem* it return true; } - return item1->LLInventoryItem::getDescription() < item2->LLInventoryItem::getDescription(); + return item1->getActualDescription() < item2->getActualDescription(); } void item_array_diff(LLInventoryModel::item_array_t& full_list, @@ -2486,6 +2486,33 @@ void LLAppearanceMgr::addCOFItemLink(const LLInventoryItem *item, bool do_update return; } +LLInventoryModel::item_array_t LLAppearanceMgr::findCOFItemLinks(const LLUUID& item_id) +{ + + LLInventoryModel::item_array_t result; + const LLViewerInventoryItem *vitem = + dynamic_cast(gInventory.getItem(item_id)); + + if (vitem) + { + LLInventoryModel::cat_array_t cat_array; + LLInventoryModel::item_array_t item_array; + gInventory.collectDescendents(LLAppearanceMgr::getCOF(), + cat_array, + item_array, + LLInventoryModel::EXCLUDE_TRASH); + for (S32 i=0; igetLinkedUUID() == vitem->getLinkedUUID()) + { + result.put(item_array.get(i)); + } + } + } + return result; +} + void LLAppearanceMgr::removeAllClothesFromAvatar() { // Fetch worn clothes (i.e. the ones in COF). @@ -2644,7 +2671,7 @@ void LLAppearanceMgr::updateIsDirty() if (item1->getLinkedUUID() != item2->getLinkedUUID() || item1->getName() != item2->getName() || - item1->LLInventoryItem::getDescription() != item2->LLInventoryItem::getDescription()) + item1->getActualDescription() != item2->getActualDescription()) { mOutfitIsDirty = true; return; @@ -2855,8 +2882,8 @@ struct WearablesOrderComparator return true; } - const std::string& desc1 = item1->LLInventoryItem::getDescription(); - const std::string& desc2 = item2->LLInventoryItem::getDescription(); + const std::string& desc1 = item1->getActualDescription(); + const std::string& desc2 = item2->getActualDescription(); bool item1_valid = (desc1.size() == mControlSize) && (ORDER_NUMBER_SEPARATOR == desc1[0]); bool item2_valid = (desc2.size() == mControlSize) && (ORDER_NUMBER_SEPARATOR == desc2[0]); @@ -2914,7 +2941,7 @@ void LLAppearanceMgr::updateClothingOrderingInfo(LLUUID cat_id, bool update_base if (!item) continue; std::string new_order_str = build_order_string((LLWearableType::EType)type, i); - if (new_order_str == item->LLInventoryItem::getDescription()) continue; + if (new_order_str == item->getActualDescription()) continue; item->setDescription(new_order_str); item->setComplete(TRUE); @@ -3179,8 +3206,8 @@ bool LLAppearanceMgr::moveWearable(LLViewerInventoryItem* item, bool closer_to_b closer_to_body ? --it : ++it; LLViewerInventoryItem* swap_item = *it; if (!swap_item) return false; - std::string tmp = swap_item->LLInventoryItem::getDescription(); - swap_item->setDescription(item->LLInventoryItem::getDescription()); + std::string tmp = swap_item->getActualDescription(); + swap_item->setDescription(item->getActualDescription()); item->setDescription(tmp); -- cgit v1.2.3 From 6a8947679cdb3a3d6ce9d4d175a2bdfed4b7eee3 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 16 Jan 2013 11:34:42 -0500 Subject: SH-3645 WIP - preserve item order after wearable save as --- indra/newview/llappearancemgr.cpp | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index d1ed82cc98..2b1e78c899 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1902,7 +1902,7 @@ static void remove_non_link_items(LLInventoryModel::item_array_t &items) } //a predicate for sorting inventory items by actual descriptions -bool sort_by_description(const LLInventoryItem* item1, const LLInventoryItem* item2) +bool sort_by_actual_description(const LLInventoryItem* item1, const LLInventoryItem* item2) { if (!item1 || !item2) { @@ -2345,10 +2345,11 @@ bool areMatchingWearables(const LLViewerInventoryItem *a, const LLViewerInventor class LLDeferredCOFLinkObserver: public LLInventoryObserver { public: - LLDeferredCOFLinkObserver(const LLUUID& item_id, bool do_update, LLPointer cb = NULL): + LLDeferredCOFLinkObserver(const LLUUID& item_id, bool do_update, LLPointer cb = NULL, std::string description = ""): mItemID(item_id), mDoUpdate(do_update), - mCallback(cb) + mCallback(cb), + mDescription(description) { } @@ -2370,23 +2371,24 @@ public: private: const LLUUID mItemID; bool mDoUpdate; + std::string mDescription; LLPointer mCallback; }; // BAP - note that this runs asynchronously if the item is not already loaded from inventory. // Dangerous if caller assumes link will exist after calling the function. -void LLAppearanceMgr::addCOFItemLink(const LLUUID &item_id, bool do_update, LLPointer cb) +void LLAppearanceMgr::addCOFItemLink(const LLUUID &item_id, bool do_update, LLPointer cb, const std::string description) { const LLInventoryItem *item = gInventory.getItem(item_id); if (!item) { - LLDeferredCOFLinkObserver *observer = new LLDeferredCOFLinkObserver(item_id, do_update, cb); + LLDeferredCOFLinkObserver *observer = new LLDeferredCOFLinkObserver(item_id, do_update, cb, description); gInventory.addObserver(observer); } else { - addCOFItemLink(item, do_update, cb); + addCOFItemLink(item, do_update, cb, description); } } @@ -2409,8 +2411,9 @@ void modified_cof_cb(const LLUUID& inv_item) } } -void LLAppearanceMgr::addCOFItemLink(const LLInventoryItem *item, bool do_update, LLPointer cb) +void LLAppearanceMgr::addCOFItemLink(const LLInventoryItem *item, bool do_update, LLPointer cb, const std::string description) { + std::string link_description = description; const LLViewerInventoryItem *vitem = dynamic_cast(item); if (!vitem) { @@ -2474,12 +2477,15 @@ void LLAppearanceMgr::addCOFItemLink(const LLInventoryItem *item, bool do_update { cb = new LLBoostFuncInventoryCallback(modified_cof_cb); } - const std::string description = vitem->getIsLinkType() ? vitem->getDescription() : ""; + if (vitem->getIsLinkType()) + { + link_description = vitem->getActualDescription(); + } link_inventory_item( gAgent.getID(), vitem->getLinkedUUID(), getCOF(), vitem->getName(), - description, + link_description, LLAssetType::AT_LINK, cb); } @@ -3240,7 +3246,7 @@ void LLAppearanceMgr::sortItemsByActualDescription(LLInventoryModel::item_array_ { if (items.size() < 2) return; - std::sort(items.begin(), items.end(), sort_by_description); + std::sort(items.begin(), items.end(), sort_by_actual_description); } //#define DUMP_CAT_VERBOSE -- cgit v1.2.3 From e378effca36a0a6efd6036586c3259ba5367b012 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 22 Jan 2013 21:47:35 -0500 Subject: Added cof version information to DebugAvatarAppearanceMessage output --- indra/newview/llappearancemgr.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 2b1e78c899..e7fa56466d 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1184,6 +1184,21 @@ S32 LLAppearanceMgr::getCOFVersion() const } } +S32 LLAppearanceMgr::getLastUpdateRequestCOFVersion() const +{ + return mLastUpdateRequestCOFVersion; +} + +S32 LLAppearanceMgr::getLastAppearanceUpdateCOFVersion() const +{ + return mLastAppearanceUpdateCOFVersion; +} + +void LLAppearanceMgr::setLastAppearanceUpdateCOFVersion(S32 new_val) +{ + mLastAppearanceUpdateCOFVersion = new_val; +} + const LLViewerInventoryItem* LLAppearanceMgr::getBaseOutfitLink() { const LLUUID& current_outfit_cat = getCOF(); @@ -3293,7 +3308,8 @@ LLAppearanceMgr::LLAppearanceMgr(): mOutfitIsDirty(false), mOutfitLocked(false), mIsInUpdateAppearanceFromCOF(false), - mLastUpdateRequestCOFVersion(LLViewerInventoryCategory::VERSION_UNKNOWN) + mLastUpdateRequestCOFVersion(LLViewerInventoryCategory::VERSION_UNKNOWN), + mLastAppearanceUpdateCOFVersion(LLViewerInventoryCategory::VERSION_UNKNOWN) { LLOutfitObserver& outfit_observer = LLOutfitObserver::instance(); -- cgit v1.2.3 From cbf7de453869749abd9fead08897d1e154bb0f5e Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 28 Jan 2013 13:47:00 -0500 Subject: SH-3779 WIP, SH-3534 WIP - more bake-status tracking --- indra/newview/llappearancemgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index e7fa56466d..f1ba4ad453 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -2032,7 +2032,7 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering) } // DRANO really should wait for the appearance message to set this. // verify that deleting this line doesn't break anything. - gAgentAvatarp->setIsUsingServerBakes(gAgent.getRegion() && gAgent.getRegion()->getCentralBakeVersion()); + //gAgentAvatarp->setIsUsingServerBakes(gAgent.getRegion() && gAgent.getRegion()->getCentralBakeVersion()); //dumpCat(getCOF(),"COF, start"); -- cgit v1.2.3 From 99d197d021482ab29ca518d2f2a40462f75fe5a3 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 7 Feb 2013 19:14:00 -0500 Subject: SH-3852 WIP - track per-timer stats --- indra/newview/llappearancemgr.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index f1ba4ad453..1a6d49c7a2 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -2006,8 +2006,6 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering) llwarns << "Called updateAppearanceFromCOF inside updateAppearanceFromCOF, skipping" << llendl; return; } - - LLVOAvatar::ScopedPhaseSetter(gAgentAvatarp,"update_appearance_from_cof"); BoolSetter setIsInUpdateAppearanceFromCOF(mIsInUpdateAppearanceFromCOF); -- cgit v1.2.3 From e11fd0a7eb9e5aa39aa719f6d349506348a06d18 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 12 Feb 2013 10:58:04 -0500 Subject: SH-3852 WIP - added more specific logging of completenesss of texture loading --- indra/newview/llappearancemgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 1a6d49c7a2..caeaf0970b 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -2006,7 +2006,7 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering) llwarns << "Called updateAppearanceFromCOF inside updateAppearanceFromCOF, skipping" << llendl; return; } - + BoolSetter setIsInUpdateAppearanceFromCOF(mIsInUpdateAppearanceFromCOF); LL_INFOS("Avatar") << self_av_string() << "starting" << LL_ENDL; -- cgit v1.2.3 From fe9fb67aea52b0c8ef900915ad41bb9728f23010 Mon Sep 17 00:00:00 2001 From: Nyx Linden Date: Tue, 12 Feb 2013 18:37:01 -0500 Subject: SH-3859 FIX adding or removing clothing in appearance edit mode are visible Added check to cancel any appearance update requests that occur while in appearance edit mode. Closing appearance edit mode does trigger an update, so should be safe to cancel intermediate requests without further changes. --- indra/newview/llappearancemgr.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index caeaf0970b..ecbb922adc 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -3085,6 +3085,12 @@ public: void LLAppearanceMgr::requestServerAppearanceUpdate(LLCurl::ResponderPtr responder_ptr) { + if (gAgentAvatarp->isEditingAppearance()) + { + // don't send out appearance updates if in appearance editing mode + return; + } + if (!gAgent.getRegion()) { llwarns << "Region not set, cannot request server appearance update" << llendl; -- cgit v1.2.3 From 9ef4c33772b3d358fd90125ea82a05ae70c01643 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 13 Feb 2013 07:47:24 -0500 Subject: SH-3852 WIP - modified metrics for update_appearance_from_cof and wear_inventory_category, end when bakes are fully loaded --- indra/newview/llappearancemgr.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index caeaf0970b..e4686ffeed 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -2008,6 +2008,7 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering) } BoolSetter setIsInUpdateAppearanceFromCOF(mIsInUpdateAppearanceFromCOF); + selfStartPhase("update_appearance_from_cof"); LL_INFOS("Avatar") << self_av_string() << "starting" << LL_ENDL; -- cgit v1.2.3 From 9233f08ddb8ecfffb56638533a4089f13ad7fb12 Mon Sep 17 00:00:00 2001 From: Nyx Linden Date: Mon, 25 Feb 2013 18:19:08 -0500 Subject: SH-3892 SH-3896 SUN-28 FIX add to outfit behaves like replace outfit Conversion away from retry mechanism missed one case which was not supporting the 'add' operation properly. Changed code to use linkAll instead, as it did previously. --- indra/newview/llappearancemgr.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 10523ca998..23a908c0ff 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1814,17 +1814,13 @@ void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append) all_items += gest_items; // Will link all the above items. - bool update_base_outfit_ordering = !append; - LLCallAfterInventoryLinkMgr *link_waiter = - new LLCallAfterInventoryLinkMgr(all_items,cof,"update_appearance_on_destroy", - boost::bind(&LLAppearanceMgr::updateAppearanceFromCOF, - LLAppearanceMgr::getInstance(), - update_base_outfit_ordering)); + LLPointer link_waiter = new LLUpdateAppearanceOnDestroy; + linkAll(cof,all_items,link_waiter); // Add link to outfit if category is an outfit. if (!append) { - link_waiter->addItem(category); + createBaseOutfitLink(category, NULL); } // Remove current COF contents. Have to do this after creating -- cgit v1.2.3 From b16dcda6a387774a446c04f63e1a55bd35ec7afe Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 25 Feb 2013 19:12:36 -0500 Subject: SH-3860 WIP, SH-3899 WIP - make folder version management more debuggable, log appearance request results --- indra/newview/llappearancemgr.cpp | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 10523ca998..d0f28b8c10 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -50,6 +50,7 @@ #include "llviewerregion.h" #include "llwearablelist.h" #include "llsdutil.h" +#include "llsdserialize.h" std::string self_av_string() { @@ -3049,6 +3050,10 @@ public: if (content["success"].asBoolean()) { LL_DEBUGS("Avatar") << "OK" << LL_ENDL; + if (gSavedSettings.getBOOL("DebugAvatarAppearanceMessage")) + { + dumpContents("appearance_request_ok", content); + } } else { @@ -3056,11 +3061,23 @@ public: } } + void dumpContents(const std::string outprefix, const LLSD& content) + { + std::string outfilename = get_sequential_numbered_file_name(outprefix,".xml"); + std::string fullpath = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,outfilename); + std::ofstream ofs(fullpath); + ofs << LLSDOStreamer(content, LLSDFormatter::OPTIONS_PRETTY); + LL_DEBUGS("Avatar") << "results saved to: " << fullpath << LL_ENDL; + } + // Error /*virtual*/ void errorWithContent(U32 status, const std::string& reason, const LLSD& content) { - llwarns << "appearance update request failed, status: " << status << " reason: " << reason << llendl; - LL_DEBUGS("Avatar") << "content: " << ll_pretty_print_sd(content) << LL_ENDL; + llwarns << "appearance update request failed, status: " << status << " reason: " << reason << " code: " << content["code"].asInteger() << " error: \"" << content["error"].asString() << "\"" << llendl; + if (gSavedSettings.getBOOL("DebugAvatarAppearanceMessage")) + { + dumpContents("appearance_request_error", content); + } onFailure(status); } @@ -3095,6 +3112,7 @@ void LLAppearanceMgr::requestServerAppearanceUpdate(LLCurl::ResponderPtr respond if (!gAgent.getRegion()) { llwarns << "Region not set, cannot request server appearance update" << llendl; + return; } if (gAgent.getRegion()->getCentralBakeVersion()==0) { @@ -3110,7 +3128,7 @@ void LLAppearanceMgr::requestServerAppearanceUpdate(LLCurl::ResponderPtr respond LLSD body; S32 cof_version = getCOFVersion(); body["cof_version"] = cof_version; - LL_DEBUGS("Avatar") << "my_cof_version " << cof_version << llendl; + LL_DEBUGS("Avatar") << "request url " << url << " my_cof_version " << cof_version << llendl; //LLCurl::ResponderPtr responder_ptr; if (!responder_ptr.get()) -- cgit v1.2.3 From d679ad47d524f73bdde0204b91607f9221dc41ab Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 26 Feb 2013 07:45:50 -0500 Subject: cleaned up old message --- indra/newview/llappearancemgr.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 131bef6958..bd4e8ddf72 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1806,8 +1806,6 @@ void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append) removeDuplicateItems(gest_items); // Create links to new COF contents. - LL_DEBUGS("Avatar") << self_av_string() << "creating LLCallAfterInventoryLinkMgr" << LL_ENDL; - LLInventoryModel::item_array_t all_items; all_items += body_items; all_items += wear_items; -- cgit v1.2.3 From 26ac1097729ce801e61523e3e42d7a868ddcde13 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 26 Feb 2013 22:00:50 -0500 Subject: SH-3899 WIP - more logging of appearance message info --- indra/newview/llappearancemgr.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index bd4e8ddf72..8d41edf6af 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -3063,6 +3063,13 @@ public: ofs << LLSDOStreamer(content, LLSDFormatter::OPTIONS_PRETTY); LL_DEBUGS("Avatar") << "results saved to: " << fullpath << LL_ENDL; } + + void debugCOF(const LLSD& content) + { + //S32 cof_version = content["cof_version"]; + //S32 cof_expected = content["expected"]; + //S32 cof_observed = content["observed"]; + } // Error /*virtual*/ void errorWithContent(U32 status, const std::string& reason, const LLSD& content) @@ -3071,6 +3078,8 @@ public: if (gSavedSettings.getBOOL("DebugAvatarAppearanceMessage")) { dumpContents("appearance_request_error", content); + debugCOF(content); + } onFailure(status); } -- cgit v1.2.3 From d9d5c7e0ccec47d57743304c800c5137dd50aa22 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 27 Feb 2013 11:38:12 -0500 Subject: SH-3899 WIP - more verbose logging of appearance request status, debug option to force failures for testing --- indra/newview/llappearancemgr.cpp | 41 ++++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 18 deletions(-) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 8d41edf6af..30e7f32ef7 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -3046,7 +3046,7 @@ public: LL_DEBUGS("Avatar") << "OK" << LL_ENDL; if (gSavedSettings.getBOOL("DebugAvatarAppearanceMessage")) { - dumpContents("appearance_request_ok", content); + dumpContents(gAgentAvatarp->getFullname() + "_appearance_request_ok", content); } } else @@ -3055,29 +3055,13 @@ public: } } - void dumpContents(const std::string outprefix, const LLSD& content) - { - std::string outfilename = get_sequential_numbered_file_name(outprefix,".xml"); - std::string fullpath = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,outfilename); - std::ofstream ofs(fullpath); - ofs << LLSDOStreamer(content, LLSDFormatter::OPTIONS_PRETTY); - LL_DEBUGS("Avatar") << "results saved to: " << fullpath << LL_ENDL; - } - - void debugCOF(const LLSD& content) - { - //S32 cof_version = content["cof_version"]; - //S32 cof_expected = content["expected"]; - //S32 cof_observed = content["observed"]; - } - // Error /*virtual*/ void errorWithContent(U32 status, const std::string& reason, const LLSD& content) { llwarns << "appearance update request failed, status: " << status << " reason: " << reason << " code: " << content["code"].asInteger() << " error: \"" << content["error"].asString() << "\"" << llendl; if (gSavedSettings.getBOOL("DebugAvatarAppearanceMessage")) { - dumpContents("appearance_request_error", content); + dumpContents(gAgentAvatarp->getFullname() + "_appearance_request_error", content); debugCOF(content); } @@ -3101,6 +3085,23 @@ public: } } + void dumpContents(const std::string outprefix, const LLSD& content) + { + std::string outfilename = get_sequential_numbered_file_name(outprefix,".xml"); + std::string fullpath = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,outfilename); + std::ofstream ofs(fullpath); + ofs << LLSDOStreamer(content, LLSDFormatter::OPTIONS_PRETTY); + LL_DEBUGS("Avatar") << "results saved to: " << fullpath << LL_ENDL; + } + + void debugCOF(const LLSD& content) + { + //S32 cof_version = content["cof_version"]; + //S32 cof_expected = content["expected"]; + //S32 cof_observed = content["observed"]; + } + + LLPointer mRetryPolicy; }; @@ -3131,6 +3132,10 @@ void LLAppearanceMgr::requestServerAppearanceUpdate(LLCurl::ResponderPtr respond LLSD body; S32 cof_version = getCOFVersion(); body["cof_version"] = cof_version; + if (gSavedSettings.getBOOL("DebugForceAppearanceRequestFailure")) + { + body["cof_version"] = cof_version+1; + } LL_DEBUGS("Avatar") << "request url " << url << " my_cof_version " << cof_version << llendl; //LLCurl::ResponderPtr responder_ptr; -- cgit v1.2.3 From 72412e1b42325c35c02aef43a87b8907ca591d1f Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 27 Feb 2013 11:55:08 -0500 Subject: Fix for mac build failure --- indra/newview/llappearancemgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 30e7f32ef7..a87be17505 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -3089,7 +3089,7 @@ public: { std::string outfilename = get_sequential_numbered_file_name(outprefix,".xml"); std::string fullpath = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,outfilename); - std::ofstream ofs(fullpath); + std::ofstream ofs(fullpath, std::ios_base::out); ofs << LLSDOStreamer(content, LLSDFormatter::OPTIONS_PRETTY); LL_DEBUGS("Avatar") << "results saved to: " << fullpath << LL_ENDL; } -- cgit v1.2.3 From df3f6f6cacd3803748af569ad76ae1131ad1b1b9 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 27 Feb 2013 11:59:44 -0500 Subject: Fix for mac build failure this time for sure --- indra/newview/llappearancemgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index a87be17505..2e71f15a78 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -3089,7 +3089,7 @@ public: { std::string outfilename = get_sequential_numbered_file_name(outprefix,".xml"); std::string fullpath = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,outfilename); - std::ofstream ofs(fullpath, std::ios_base::out); + std::ofstream ofs(fullpath.c_str(), std::ios_base::out); ofs << LLSDOStreamer(content, LLSDFormatter::OPTIONS_PRETTY); LL_DEBUGS("Avatar") << "results saved to: " << fullpath << LL_ENDL; } -- cgit v1.2.3 From 41d3b428e1cfbaf8e21a335e1a9ee9a12ad46c33 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 27 Feb 2013 15:17:31 -0500 Subject: Increase number of retries for requestServerAppearanceUpdate() --- indra/newview/llappearancemgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index a87be17505..adfdb7d93d 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -3030,7 +3030,7 @@ class RequestAgentUpdateAppearanceResponder: public LLHTTPClient::Responder public: RequestAgentUpdateAppearanceResponder() { - mRetryPolicy = new LLAdaptiveRetryPolicy(1.0, 16.0, 2.0, 5); + mRetryPolicy = new LLAdaptiveRetryPolicy(1.0, 32.0, 2.0, 10); } virtual ~RequestAgentUpdateAppearanceResponder() -- cgit v1.2.3 From 2b6d7e50053a7efd2a20032c801d4b7db3b49dc1 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 27 Feb 2013 17:58:43 -0500 Subject: SH-3860 WIP - fixes for initial COF loading and config --- indra/newview/llappearancemgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index adfdb7d93d..0177f6d83c 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1819,7 +1819,7 @@ void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append) // Add link to outfit if category is an outfit. if (!append) { - createBaseOutfitLink(category, NULL); + createBaseOutfitLink(category, link_waiter); } // Remove current COF contents. Have to do this after creating -- cgit v1.2.3 From c14b43b5bf21365573608a4bac98b99cddd61d4d Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 28 Feb 2013 11:47:14 -0500 Subject: SH-3899 WIP - detailed logging of cof mismatch errors --- indra/newview/llappearancemgr.cpp | 70 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 65 insertions(+), 5 deletions(-) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 6df4822135..e12ecea760 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -3096,11 +3096,71 @@ public: void debugCOF(const LLSD& content) { - //S32 cof_version = content["cof_version"]; - //S32 cof_expected = content["expected"]; - //S32 cof_observed = content["observed"]; + LL_DEBUGS("Avatar") << "AIS COF, version found: " << content["expected"].asInteger() << llendl; + std::set ais_items, local_items; + const LLSD& cof_raw = content["cof_raw"]; + for (LLSD::array_const_iterator it = cof_raw.beginArray(); + it != cof_raw.endArray(); ++it) + { + const LLSD& item = *it; + if (item["parent_id"].asUUID() == LLAppearanceMgr::instance().getCOF()) + { + ais_items.insert(item["item_id"].asUUID()); + if (item["type"].asInteger() == 24) // link + { + LL_DEBUGS("Avatar") << "Link: item_id: " << item["item_id"].asUUID() + << " linked_item_id: " << item["asset_id"].asUUID() + << " name: " << item["name"].asString() + << llendl; + } + else if (item["type"].asInteger() == 25) // folder link + { + LL_DEBUGS("Avatar") << "Folder link: item_id: " << item["item_id"].asUUID() + << " linked_item_id: " << item["asset_id"].asUUID() + << " name: " << item["name"].asString() + << llendl; + + } + else + { + LL_DEBUGS("Avatar") << "Other: item_id: " << item["item_id"].asUUID() + << " linked_item_id: " << item["asset_id"].asUUID() + << " name: " << item["name"].asString() + << llendl; + } + } + } + LL_DEBUGS("Avatar") << llendl; + LL_DEBUGS("Avatar") << "Local COF, version req: " << content["observed"] << llendl; + LLInventoryModel::cat_array_t cat_array; + LLInventoryModel::item_array_t item_array; + gInventory.collectDescendents(LLAppearanceMgr::instance().getCOF(), + cat_array,item_array,LLInventoryModel::EXCLUDE_TRASH); + for (S32 i=0; igetUUID()); + LL_DEBUGS("Avatar") << "item_id: " << inv_item->getUUID() + << " linked_item_id: " << inv_item->getLinkedUUID() + << " name: " << inv_item->getName() + << llendl; + } + LL_DEBUGS("Avatar") << llendl; + for (std::set::iterator it = local_items.begin(); it != local_items.end(); ++it) + { + if (ais_items.find(*it) == ais_items.end()) + { + LL_DEBUGS("Avatar") << "LOCAL ONLY: " << *it << llendl; + } + } + for (std::set::iterator it = ais_items.begin(); it != ais_items.end(); ++it) + { + if (local_items.find(*it) == local_items.end()) + { + LL_DEBUGS("Avatar") << "AIS ONLY: " << *it << llendl; + } + } } - LLPointer mRetryPolicy; }; @@ -3134,7 +3194,7 @@ void LLAppearanceMgr::requestServerAppearanceUpdate(LLCurl::ResponderPtr respond body["cof_version"] = cof_version; if (gSavedSettings.getBOOL("DebugForceAppearanceRequestFailure")) { - body["cof_version"] = cof_version+1; + body["cof_version"] = cof_version+999; } LL_DEBUGS("Avatar") << "request url " << url << " my_cof_version " << cof_version << llendl; -- cgit v1.2.3 From 22f05155990176ece57390e69de71deae9f34ed4 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 28 Feb 2013 14:53:53 -0500 Subject: SH-3899 WIP --- indra/newview/llappearancemgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index e12ecea760..48a2ab0eb2 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -3131,7 +3131,7 @@ public: } } LL_DEBUGS("Avatar") << llendl; - LL_DEBUGS("Avatar") << "Local COF, version req: " << content["observed"] << llendl; + LL_DEBUGS("Avatar") << "Local COF, version requested: " << content["observed"].asInteger() << llendl; LLInventoryModel::cat_array_t cat_array; LLInventoryModel::item_array_t item_array; gInventory.collectDescendents(LLAppearanceMgr::instance().getCOF(), -- cgit v1.2.3 From ecb3d1d64d035f22c6d85864131cae6a1108fc68 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 28 Feb 2013 15:58:56 -0500 Subject: SH-3932 FIX - added LLSD blob for viewer-side cof contents, optionally included with request appearance update --- indra/newview/llappearancemgr.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 48a2ab0eb2..6c3858b947 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -3165,6 +3165,27 @@ public: LLPointer mRetryPolicy; }; +LLSD LLAppearanceMgr::dumpCOF() const +{ + LLSD result = LLSD::emptyArray(); + + LLInventoryModel::cat_array_t cat_array; + LLInventoryModel::item_array_t item_array; + gInventory.collectDescendents(getCOF(),cat_array,item_array,LLInventoryModel::EXCLUDE_TRASH); + for (S32 i=0; igetUUID(); + item["linked_item_id"] = inv_item->getLinkedUUID(); + item["name"] = inv_item->getName(); + item["description"] = inv_item->getActualDescription(); + item["type"] = inv_item->getActualType(); + result.append(item); + } + return result; +} + void LLAppearanceMgr::requestServerAppearanceUpdate(LLCurl::ResponderPtr responder_ptr) { if (gAgentAvatarp->isEditingAppearance()) @@ -3196,6 +3217,10 @@ void LLAppearanceMgr::requestServerAppearanceUpdate(LLCurl::ResponderPtr respond { body["cof_version"] = cof_version+999; } + if (gSavedSettings.getBOOL("DebugAvatarAppearanceMessage")) + { + body["debug_cof"] = dumpCOF(); + } LL_DEBUGS("Avatar") << "request url " << url << " my_cof_version " << cof_version << llendl; //LLCurl::ResponderPtr responder_ptr; -- cgit v1.2.3 From 70e22de2bb9bf8515d7e3cd68c7328beb75409d6 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 1 Mar 2013 09:06:40 -0500 Subject: SH-3860 WIP - fixes the cloud on initial login, still have a COF version rae condition due to creation of the base outfit link --- indra/newview/llappearancemgr.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 6c3858b947..d8ba4239b7 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -3658,9 +3658,9 @@ public: } virtual void done() { - // What we do here is get the complete information on the items in - // the library, and set up an observer that will wait for that to - // happen. + // What we do here is get the complete information on the + // items in the requested category, and set up an observer + // that will wait for that to happen. LLInventoryModel::cat_array_t cat_array; LLInventoryModel::item_array_t item_array; gInventory.collectDescendents(mComplete.front(), @@ -3674,9 +3674,8 @@ public: << llendl; //dec_busy_count(); gInventory.removeObserver(this); + doOnIdleOneTime(mCallable); - // lets notify observers that loading is finished. - gAgentWearables.notifyLoadingFinished(); delete this; return; } -- cgit v1.2.3 From 8410887e2e8327f3a24e74f6bc89a4feddcbff62 Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Sun, 3 Mar 2013 23:32:48 -0800 Subject: Adding DebugAvatarExperimentalServerAppearanceUpdate setting to test sending full cof contents --- indra/newview/llappearancemgr.cpp | 48 +++++++++++++++++++++++++++++++++------ 1 file changed, 41 insertions(+), 7 deletions(-) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index d8ba4239b7..cc78d5a2fc 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -3177,10 +3177,41 @@ LLSD LLAppearanceMgr::dumpCOF() const const LLViewerInventoryItem* inv_item = item_array.get(i).get(); LLSD item; item["item_id"] = inv_item->getUUID(); - item["linked_item_id"] = inv_item->getLinkedUUID(); item["name"] = inv_item->getName(); item["description"] = inv_item->getActualDescription(); - item["type"] = inv_item->getActualType(); + item["asset_type"] = inv_item->getActualType(); + item["inv_type"] = inv_item->getInventoryType(); + item["linked_id"] = inv_item->getLinkedUUID(); + + if (LLAssetType::AT_LINK == inv_item->getActualType()) + { + const LLViewerInventoryItem* linked_item = inv_item->getLinkedItem(); + if (NULL == linked_item) + { + llwarns << "Broken link for item '" << inv_item->getName() + << "' (" << inv_item->getUUID() + << ") during requestServerAppearanceUpdate" << llendl; + continue; + } + if (linked_item->getAssetUUID().isNull()) + { + llwarns << "Broken link (null asset) for item '" << inv_item->getName() + << "' (" << inv_item->getUUID() + << ") during requestServerAppearanceUpdate" << llendl; + continue; + } + item["linked_asset_id"] = linked_item->getAssetUUID(); + item["linked_asset_type"] = linked_item->getType(); + item["linked_flags"] = LLSD::Integer(linked_item->getFlags()); + } + else if (LLAssetType::AT_LINK_FOLDER != inv_item->getActualType()) + { + llwarns << "Non-link item '" << inv_item->getName() + << "' (" << inv_item->getUUID() + << ") type " << (S32) inv_item->getActualType() + << " during requestServerAppearanceUpdate" << llendl; + continue; + } result.append(item); } return result; @@ -3212,14 +3243,17 @@ void LLAppearanceMgr::requestServerAppearanceUpdate(LLCurl::ResponderPtr respond LLSD body; S32 cof_version = getCOFVersion(); - body["cof_version"] = cof_version; - if (gSavedSettings.getBOOL("DebugForceAppearanceRequestFailure")) + if (gSavedSettings.getBOOL("DebugAvatarExperimentalServerAppearanceUpdate")) { - body["cof_version"] = cof_version+999; + body["cof_contents"] = dumpCOF(); } - if (gSavedSettings.getBOOL("DebugAvatarAppearanceMessage")) + else { - body["debug_cof"] = dumpCOF(); + body["cof_version"] = cof_version; + if (gSavedSettings.getBOOL("DebugForceAppearanceRequestFailure")) + { + body["cof_version"] = cof_version+999; + } } LL_DEBUGS("Avatar") << "request url " << url << " my_cof_version " << cof_version << llendl; -- cgit v1.2.3 From ec1bc19d01715299209d9f00230e4681917bde12 Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Mon, 4 Mar 2013 01:09:45 -0800 Subject: Adding md5sum calculation to experimental server appearance update message --- indra/newview/llappearancemgr.cpp | 36 +++++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index cc78d5a2fc..2cebf6863e 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -26,6 +26,7 @@ #include "llviewerprecompiledheaders.h" +#include #include "llaccordionctrltab.h" #include "llagent.h" #include "llagentcamera.h" @@ -52,6 +53,11 @@ #include "llsdutil.h" #include "llsdserialize.h" +#if LL_MSVC +// disable boost::lexical_cast warning +#pragma warning (disable:4702) +#endif + std::string self_av_string() { // On logout gAgentAvatarp can already be invalid @@ -3167,7 +3173,8 @@ public: LLSD LLAppearanceMgr::dumpCOF() const { - LLSD result = LLSD::emptyArray(); + LLSD links = LLSD::emptyArray(); + LLMD5 md5; LLInventoryModel::cat_array_t cat_array; LLInventoryModel::item_array_t item_array; @@ -3176,12 +3183,17 @@ LLSD LLAppearanceMgr::dumpCOF() const { const LLViewerInventoryItem* inv_item = item_array.get(i).get(); LLSD item; - item["item_id"] = inv_item->getUUID(); + LLUUID item_id(inv_item->getUUID()); + item["item_id"] = item_id; + md5.update((unsigned char*)item_id.mData, 16); item["name"] = inv_item->getName(); item["description"] = inv_item->getActualDescription(); + md5.update(inv_item->getActualDescription()); item["asset_type"] = inv_item->getActualType(); item["inv_type"] = inv_item->getInventoryType(); - item["linked_id"] = inv_item->getLinkedUUID(); + LLUUID linked_id(inv_item->getLinkedUUID()); + item["linked_id"] = linked_id; + md5.update((unsigned char*)linked_id.mData, 16); if (LLAssetType::AT_LINK == inv_item->getActualType()) { @@ -3200,9 +3212,13 @@ LLSD LLAppearanceMgr::dumpCOF() const << ") during requestServerAppearanceUpdate" << llendl; continue; } - item["linked_asset_id"] = linked_item->getAssetUUID(); + LLUUID linked_asset_id(linked_item->getAssetUUID()); + item["linked_asset_id"] = linked_asset_id; + md5.update((unsigned char*)linked_asset_id.mData, 16); item["linked_asset_type"] = linked_item->getType(); - item["linked_flags"] = LLSD::Integer(linked_item->getFlags()); + U32 flags = linked_item->getFlags(); + item["linked_flags"] = LLSD::Integer(flags); + md5.update(boost::lexical_cast(flags)); } else if (LLAssetType::AT_LINK_FOLDER != inv_item->getActualType()) { @@ -3212,8 +3228,14 @@ LLSD LLAppearanceMgr::dumpCOF() const << " during requestServerAppearanceUpdate" << llendl; continue; } - result.append(item); + links.append(item); } + LLSD result = LLSD::emptyMap(); + result["cof_contents"] = links; + char cof_md5sum[MD5HEX_STR_SIZE]; + md5.finalize(); + md5.hex_digest(cof_md5sum); + result["cof_md5sum"] = std::string(cof_md5sum); return result; } @@ -3245,7 +3267,7 @@ void LLAppearanceMgr::requestServerAppearanceUpdate(LLCurl::ResponderPtr respond S32 cof_version = getCOFVersion(); if (gSavedSettings.getBOOL("DebugAvatarExperimentalServerAppearanceUpdate")) { - body["cof_contents"] = dumpCOF(); + body = dumpCOF(); } else { -- cgit v1.2.3 From 2efe411a4fd8d76e9a153ed4aad9235819738328 Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Mon, 4 Mar 2013 12:02:02 -0800 Subject: Reducing amount of cof link data sent to appearance update service. Allowing links to items with 'null' asset ids to be passed --- indra/newview/llappearancemgr.cpp | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 2cebf6863e..fa239e2c8a 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -3184,13 +3184,10 @@ LLSD LLAppearanceMgr::dumpCOF() const const LLViewerInventoryItem* inv_item = item_array.get(i).get(); LLSD item; LLUUID item_id(inv_item->getUUID()); - item["item_id"] = item_id; md5.update((unsigned char*)item_id.mData, 16); - item["name"] = inv_item->getName(); item["description"] = inv_item->getActualDescription(); md5.update(inv_item->getActualDescription()); item["asset_type"] = inv_item->getActualType(); - item["inv_type"] = inv_item->getInventoryType(); LLUUID linked_id(inv_item->getLinkedUUID()); item["linked_id"] = linked_id; md5.update((unsigned char*)linked_id.mData, 16); @@ -3205,19 +3202,17 @@ LLSD LLAppearanceMgr::dumpCOF() const << ") during requestServerAppearanceUpdate" << llendl; continue; } - if (linked_item->getAssetUUID().isNull()) - { - llwarns << "Broken link (null asset) for item '" << inv_item->getName() - << "' (" << inv_item->getUUID() - << ") during requestServerAppearanceUpdate" << llendl; - continue; - } + // Some assets may be 'hidden' and show up as null in the viewer. + //if (linked_item->getAssetUUID().isNull()) + //{ + // llwarns << "Broken link (null asset) for item '" << inv_item->getName() + // << "' (" << inv_item->getUUID() + // << ") during requestServerAppearanceUpdate" << llendl; + // continue; + //} LLUUID linked_asset_id(linked_item->getAssetUUID()); - item["linked_asset_id"] = linked_asset_id; md5.update((unsigned char*)linked_asset_id.mData, 16); - item["linked_asset_type"] = linked_item->getType(); U32 flags = linked_item->getFlags(); - item["linked_flags"] = LLSD::Integer(flags); md5.update(boost::lexical_cast(flags)); } else if (LLAssetType::AT_LINK_FOLDER != inv_item->getActualType()) -- cgit v1.2.3 From 9a0c52a247ecbd79f5f872ceb97a6be3e0499bea Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Tue, 5 Mar 2013 11:28:06 -0800 Subject: Adding debug setting to allow overriding appearance service url --- indra/newview/llappearancemgr.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index fa239e2c8a..1561f8d74c 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -3359,6 +3359,15 @@ void LLAppearanceMgr::incrementCofVersion(LLHTTPClient::ResponderPtr responder_p LLHTTPClient::get(url, body, responder_ptr, headers, 30.0f); } +std::string LLAppearanceMgr::getAppearanceServiceURL() const +{ + if (gSavedSettings.getString("DebugAvatarAppearanceServiceURLOverride").empty()) + { + return mAppearanceServiceURL; + } + return gSavedSettings.getString("DebugAvatarAppearanceServiceURLOverride"); +} + void show_created_outfit(LLUUID& folder_id, bool show_panel = true) { if (!LLApp::isRunning()) -- cgit v1.2.3 From 54cdc322b8f2bd35b289cacf3493622e7cc51194 Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Tue, 5 Mar 2013 22:05:22 -0800 Subject: Fixing issues with not detecting when LLSD XML parsing fails. Changing most http error handlers to understand LLSD error responses. Fleshing out most http error handler message spam. --- indra/newview/llappearancemgr.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 1561f8d74c..2c76efc7fb 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -3308,10 +3308,10 @@ public: app_mgr->mLastUpdateRequestCOFVersion = new_version; } - virtual void error(U32 pStatus, const std::string& pReason) + virtual void errorWithContent(U32 pStatus, const std::string& pReason, const LLSD& content) { - llwarns << "While attempting to increment the agent's cof we got an error because '" - << pReason << "' [status:" << pStatus << "]" << llendl; + llwarns << "While attempting to increment the agent's cof we got an error with [status:" + << pStatus << "]: " << content << llendl; F32 seconds_to_wait; if (mRetryPolicy->shouldRetry(pStatus,seconds_to_wait)) { -- cgit v1.2.3 From 6f193d54da0b0eae2758b99e706cd127966aafa1 Mon Sep 17 00:00:00 2001 From: Nyx Linden Date: Wed, 13 Mar 2013 17:52:40 -0400 Subject: SH-3806 FIX test case for local bakes being wrong Local bakes were following folder links in some cases, causing unworn items to be rendered. Fixed the cof fetcher, now they should no longer show up. --- indra/newview/llappearancemgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index a944659e96..c04d6bad94 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -2034,7 +2034,7 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering) //dumpCat(getCOF(),"COF, start"); - bool follow_folder_links = true; + bool follow_folder_links = false; LLUUID current_outfit_id = getCOF(); // Find all the wearables that are in the COF's subtree. -- cgit v1.2.3 From de2c88ca4334886ab48b3c3d474c6585036edb21 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 22 Mar 2013 12:17:06 -0400 Subject: Moved LastUpdateCOF stuff to avatar, so we can track last received for non-self avs --- indra/newview/llappearancemgr.cpp | 29 +++++------------------------ 1 file changed, 5 insertions(+), 24 deletions(-) mode change 100644 => 100755 indra/newview/llappearancemgr.cpp (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp old mode 100644 new mode 100755 index c04d6bad94..59e07cd843 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1191,21 +1191,6 @@ S32 LLAppearanceMgr::getCOFVersion() const } } -S32 LLAppearanceMgr::getLastUpdateRequestCOFVersion() const -{ - return mLastUpdateRequestCOFVersion; -} - -S32 LLAppearanceMgr::getLastAppearanceUpdateCOFVersion() const -{ - return mLastAppearanceUpdateCOFVersion; -} - -void LLAppearanceMgr::setLastAppearanceUpdateCOFVersion(S32 new_val) -{ - mLastAppearanceUpdateCOFVersion = new_val; -} - const LLViewerInventoryItem* LLAppearanceMgr::getBaseOutfitLink() { const LLUUID& current_outfit_cat = getCOF(); @@ -3275,8 +3260,8 @@ void LLAppearanceMgr::requestServerAppearanceUpdate(LLCurl::ResponderPtr respond responder_ptr = new RequestAgentUpdateAppearanceResponder; } LLHTTPClient::post(url, body, responder_ptr); - llassert(cof_version >= mLastUpdateRequestCOFVersion); - mLastUpdateRequestCOFVersion = cof_version; + llassert(cof_version >= gAgentAvatarp->mLastUpdateRequestCOFVersion); + gAgentAvatarp->mLastUpdateRequestCOFVersion = cof_version; } class LLIncrementCofVersionResponder : public LLHTTPClient::Responder @@ -3296,12 +3281,10 @@ public: llinfos << "Successfully incremented agent's COF." << llendl; S32 new_version = pContent["category"]["version"].asInteger(); - LLAppearanceMgr* app_mgr = LLAppearanceMgr::getInstance(); - // cof_version should have increased - llassert(new_version > app_mgr->mLastUpdateRequestCOFVersion); + llassert(new_version > gAgentAvatarp->mLastUpdateRequestCOFVersion); - app_mgr->mLastUpdateRequestCOFVersion = new_version; + gAgentAvatarp->mLastUpdateRequestCOFVersion = new_version; } virtual void errorWithContent(U32 pStatus, const std::string& pReason, const LLSD& content) { @@ -3553,9 +3536,7 @@ LLAppearanceMgr::LLAppearanceMgr(): mAttachmentInvLinkEnabled(false), mOutfitIsDirty(false), mOutfitLocked(false), - mIsInUpdateAppearanceFromCOF(false), - mLastUpdateRequestCOFVersion(LLViewerInventoryCategory::VERSION_UNKNOWN), - mLastAppearanceUpdateCOFVersion(LLViewerInventoryCategory::VERSION_UNKNOWN) + mIsInUpdateAppearanceFromCOF(false) { LLOutfitObserver& outfit_observer = LLOutfitObserver::instance(); -- cgit v1.2.3 From d1d0a2cf67e3ddd7bd187c63b9ce79e0c19988d6 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 3 Apr 2013 14:58:33 -0400 Subject: SH-4058 - log spam reduction initiative. --- indra/newview/llappearancemgr.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 59e07cd843..652f199e28 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1994,7 +1994,7 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering) BoolSetter setIsInUpdateAppearanceFromCOF(mIsInUpdateAppearanceFromCOF); selfStartPhase("update_appearance_from_cof"); - LL_INFOS("Avatar") << self_av_string() << "starting" << LL_ENDL; + LL_DEBUGS("Avatar") << self_av_string() << "starting" << LL_ENDL; //checking integrity of the COF in terms of ordering of wearables, //checking and updating links' descriptions of wearables in the COF (before analyzed for "dirty" state) @@ -3556,7 +3556,7 @@ LLAppearanceMgr::~LLAppearanceMgr() void LLAppearanceMgr::setAttachmentInvLinkEnable(bool val) { - llinfos << "setAttachmentInvLinkEnable => " << (int) val << llendl; + LL_DEBUGS("Avatar") << "setAttachmentInvLinkEnable => " << (int) val << llendl; mAttachmentInvLinkEnabled = val; } -- cgit v1.2.3