From fbb4e5fb0f7bba935ec9d0d466be12a346a6b149 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Fri, 8 Jun 2012 13:49:02 -0400 Subject: STORM-68 As a Builder, I want that ability to set default permissions on creation of objects, clothing, scripts, notecards, etc. First pass at implementation, debuggins lines still need to be removed and there is one known bug to be resolved. --- indra/newview/llagentwearables.cpp | 62 +++++++++++++++++++++++++++++++++++--- 1 file changed, 57 insertions(+), 5 deletions(-) (limited to 'indra/newview/llagentwearables.cpp') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index dd02a74a38..7017357346 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -49,6 +49,7 @@ #include "llvoavatarself.h" #include "llwearable.h" #include "llwearablelist.h" +#include "llfloaterperms.h" #include @@ -65,8 +66,24 @@ class LLWearAndEditCallback : public LLInventoryCallback { void fire(const LLUUID& inv_item) { +llwarns << "DBG 1" << llendl; if (inv_item.isNull()) return; +llwarns << "DBG 2" << llendl; + LLViewerInventoryItem* item = gInventory.getItem(inv_item); + if (!item) return; + +llwarns << "DBG 3" << llendl; + LLPermissions perm = item->getPermissions(); + perm.setMaskNext(LLFloaterPerms::getNextOwnerPerms("Wearables")); + perm.setMaskEveryone(LLFloaterPerms::getEveryonePerms("Wearables")); + perm.setMaskGroup(LLFloaterPerms::getGroupPerms("Wearables")); + item->setPermissions(perm); + +llwarns << "DBG 4" << llendl; + gInventory.updateItem(item); + gInventory.notifyObservers(); + // Request editing the item after it gets worn. gAgentWearables.requestEditingWearable(inv_item); @@ -75,6 +92,27 @@ class LLWearAndEditCallback : public LLInventoryCallback } }; +class LLCreateWearableCallback : public LLInventoryCallback +{ + void fire(const LLUUID& inv_item) + { + if (inv_item.isNull()) + return; + + LLViewerInventoryItem* item = gInventory.getItem(inv_item); + if (!item) return; + + LLPermissions perm = item->getPermissions(); + perm.setMaskNext(LLFloaterPerms::getNextOwnerPerms("Wearables")); + perm.setMaskEveryone(LLFloaterPerms::getEveryonePerms("Wearables")); + perm.setMaskGroup(LLFloaterPerms::getGroupPerms("Wearables")); + item->setPermissions(perm); + + gInventory.updateItem(item); + gInventory.notifyObservers(); + } +}; + /////////////////////////////////////////////////////////////////////////////// // HACK: For EXT-3923: Pants item shows in inventory with skin icon and messes with "current look" @@ -1982,7 +2020,16 @@ void LLAgentWearables::createWearable(LLWearableType::EType type, bool wear, con LLWearable* wearable = LLWearableList::instance().createNewWearable(type); LLAssetType::EType asset_type = wearable->getAssetType(); LLInventoryType::EType inv_type = LLInventoryType::IT_WEARABLE; - LLPointer cb = wear ? new LLWearAndEditCallback : NULL; + LLPointer cb; + if (wear) + { + cb = new LLWearAndEditCallback; + } + else + { + cb = new LLCreateWearableCallback; + } + LLUUID folder_id; if (parent_id.notNull()) @@ -1995,10 +2042,15 @@ void LLAgentWearables::createWearable(LLWearableType::EType type, bool wear, con folder_id = gInventory.findCategoryUUIDForType(folder_type); } - create_inventory_item(gAgent.getID(), gAgent.getSessionID(), - folder_id, wearable->getTransactionID(), wearable->getName(), - wearable->getDescription(), asset_type, inv_type, wearable->getType(), - wearable->getPermissions().getMaskNextOwner(), + create_inventory_item(gAgent.getID(), + gAgent.getSessionID(), + folder_id, + wearable->getTransactionID(), + wearable->getName(), + wearable->getDescription(), + asset_type, inv_type, + wearable->getType(), + LLFloaterPerms::getNextOwnerPerms("Wearables"), cb); } -- cgit v1.2.3 From 052dc3982056d822a523394954c277d9eb7c7ab9 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Tue, 12 Jun 2012 14:26:53 -0400 Subject: STORM-68 Fix for group perms not being defined correctly and fix for group and everyone perms failing to copy and paste --- indra/newview/llagentwearables.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'indra/newview/llagentwearables.cpp') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 7017357346..654a785a1a 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -66,21 +66,18 @@ class LLWearAndEditCallback : public LLInventoryCallback { void fire(const LLUUID& inv_item) { -llwarns << "DBG 1" << llendl; if (inv_item.isNull()) return; -llwarns << "DBG 2" << llendl; LLViewerInventoryItem* item = gInventory.getItem(inv_item); if (!item) return; -llwarns << "DBG 3" << llendl; LLPermissions perm = item->getPermissions(); perm.setMaskNext(LLFloaterPerms::getNextOwnerPerms("Wearables")); perm.setMaskEveryone(LLFloaterPerms::getEveryonePerms("Wearables")); perm.setMaskGroup(LLFloaterPerms::getGroupPerms("Wearables")); item->setPermissions(perm); -llwarns << "DBG 4" << llendl; + item->updateServer(FALSE); gInventory.updateItem(item); gInventory.notifyObservers(); @@ -108,6 +105,7 @@ class LLCreateWearableCallback : public LLInventoryCallback perm.setMaskGroup(LLFloaterPerms::getGroupPerms("Wearables")); item->setPermissions(perm); + item->updateServer(FALSE); gInventory.updateItem(item); gInventory.notifyObservers(); } @@ -521,6 +519,7 @@ void LLAgentWearables::saveWearableAs(const LLWearableType::EType type, LLWearable* new_wearable = LLWearableList::instance().createCopy( old_wearable, trunc_name); + LLPointer cb = new addWearableToAgentInventoryCallback( LLPointer(NULL), -- cgit v1.2.3 From 1bf66885617564c8df9baac3b45ed5e9d96ef153 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 23 Apr 2013 15:52:12 -0400 Subject: SH-4128 WIP - rewiring various link-deleting operations to support callbacks --- indra/newview/llagentwearables.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'indra/newview/llagentwearables.cpp') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index c88694ef76..b4c3e33e0e 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -69,7 +69,7 @@ void wear_and_edit_cb(const LLUUID& inv_item) gAgentWearables.requestEditingWearable(inv_item); // Wear it. - LLAppearanceMgr::instance().wearItemOnAvatar(inv_item); + LLAppearanceMgr::instance().wearItemOnAvatar(inv_item,true); } /////////////////////////////////////////////////////////////////////////////// @@ -239,7 +239,7 @@ void LLAgentWearables::addWearableToAgentInventoryCallback::fire(const LLUUID& i } if (mTodo & CALL_RECOVERDONE) { - LLAppearanceMgr::instance().addCOFItemLink(inv_item,false); + LLAppearanceMgr::instance().addCOFItemLink(inv_item); gAgentWearables.recoverMissingWearableDone(); } /* @@ -247,7 +247,7 @@ void LLAgentWearables::addWearableToAgentInventoryCallback::fire(const LLUUID& i */ if (mTodo & CALL_CREATESTANDARDDONE) { - LLAppearanceMgr::instance().addCOFItemLink(inv_item,false); + LLAppearanceMgr::instance().addCOFItemLink(inv_item); gAgentWearables.createStandardWearablesDone(mType, mIndex); } if (mTodo & CALL_MAKENEWOUTFITDONE) @@ -256,7 +256,8 @@ void LLAgentWearables::addWearableToAgentInventoryCallback::fire(const LLUUID& i } if (mTodo & CALL_WEARITEM) { - LLAppearanceMgr::instance().addCOFItemLink(inv_item, true, NULL, mDescription); + LLAppearanceMgr::instance().addCOFItemLink(inv_item, + new LLUpdateAppearanceAndEditWearableOnDestroy(inv_item), mDescription); } } -- cgit v1.2.3 From faaf8ba5c75c925d9922dda8ce43293222cadb3b Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 29 May 2013 14:54:59 -0400 Subject: SH-4222 FIX, SH-3635 WIP - start of stuck-appearance checker, always increment folder version when a contained item is updated. --- indra/newview/llagentwearables.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llagentwearables.cpp') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index b4c3e33e0e..80c8364223 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -1897,6 +1897,7 @@ bool LLAgentWearables::changeInProgress() const void LLAgentWearables::notifyLoadingStarted() { mCOFChangeInProgress = true; + mCOFChangeTimer.reset(); mLoadingStartedSignal(); } -- cgit v1.2.3 From 8090388a27dc7dfe9b9bb712db91227ecfea2116 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 27 Jun 2013 14:41:06 -0400 Subject: SH-4300 WIP - removed outfit autopopulate --- indra/newview/llagentwearables.cpp | 18 ------------------ 1 file changed, 18 deletions(-) mode change 100644 => 100755 indra/newview/llagentwearables.cpp (limited to 'indra/newview/llagentwearables.cpp') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp old mode 100644 new mode 100755 index 80c8364223..8e60bf1c6d --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -1861,24 +1861,6 @@ void LLAgentWearables::updateServer() gAgent.sendAgentSetAppearance(); } -void LLAgentWearables::populateMyOutfitsFolder(void) -{ - llinfos << "starting outfit population" << llendl; - - const LLUUID& my_outfits_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MY_OUTFITS); - LLLibraryOutfitsFetch* outfits = new LLLibraryOutfitsFetch(my_outfits_id); - outfits->mMyOutfitsID = my_outfits_id; - - // Get the complete information on the items in the inventory and - // setup an observer that will wait for that to happen. - gInventory.addObserver(outfits); - outfits->startFetch(); - if (outfits->isFinished()) - { - outfits->done(); - } -} - boost::signals2::connection LLAgentWearables::addLoadingStartedCallback(loading_started_callback_t cb) { return mLoadingStartedSignal.connect(cb); -- cgit v1.2.3 From d079f0dcdc0d317813cda282496a1edae3feed64 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 10 Jul 2013 13:02:09 -0700 Subject: SH-4319 WIP - set using server bakes on receiving a cached texture response in a non-bake region --- indra/newview/llagentwearables.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llagentwearables.cpp') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 8e60bf1c6d..93ccec7d49 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -1443,6 +1443,7 @@ void LLAgentWearables::queryWearableCache() { return; } + gAgentAvatarp->setIsUsingServerBakes(false); // Look up affected baked textures. // If they exist: -- cgit v1.2.3 From 3d8d4227f1930f986c3b70227de98c12830c874a Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 19 Jul 2013 17:22:53 -0400 Subject: SH-3889 WIP - added callbacks to control ordering of operations after wearable save. --- indra/newview/llagentwearables.cpp | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) (limited to 'indra/newview/llagentwearables.cpp') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 93ccec7d49..8c33a778e3 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -209,7 +209,7 @@ LLAgentWearables::sendAgentWearablesUpdateCallback::~sendAgentWearablesUpdateCal * @param wearable The wearable data. * @param todo Bitmask of actions to take on completion. */ -LLAgentWearables::addWearableToAgentInventoryCallback::addWearableToAgentInventoryCallback( +LLAgentWearables::AddWearableToAgentInventoryCallback::AddWearableToAgentInventoryCallback( LLPointer cb, LLWearableType::EType type, U32 index, LLViewerWearable* wearable, U32 todo, const std::string description) : mType(type), mIndex(index), @@ -221,7 +221,7 @@ LLAgentWearables::addWearableToAgentInventoryCallback::addWearableToAgentInvento llinfos << "constructor" << llendl; } -void LLAgentWearables::addWearableToAgentInventoryCallback::fire(const LLUUID& inv_item) +void LLAgentWearables::AddWearableToAgentInventoryCallback::fire(const LLUUID& inv_item) { if (mTodo & CALL_CREATESTANDARDDONE) { @@ -317,12 +317,12 @@ void LLAgentWearables::sendAgentWearablesUpdate() if (wearable->getItemID().isNull()) { LLPointer cb = - new addWearableToAgentInventoryCallback( + new AddWearableToAgentInventoryCallback( LLPointer(NULL), (LLWearableType::EType)type, index, wearable, - addWearableToAgentInventoryCallback::CALL_NONE); + AddWearableToAgentInventoryCallback::CALL_NONE); addWearableToAgentInventory(cb, wearable); } else @@ -419,23 +419,18 @@ void LLAgentWearables::saveWearable(const LLWearableType::EType type, const U32 item->getFlags(), item->getCreationDate()); template_item->setTransactionID(new_wearable->getTransactionID()); - template_item->updateServer(FALSE); - gInventory.updateItem(template_item); - if (name_changed) - { - gInventory.notifyObservers(); - } + update_inventory_item(template_item, gAgentAvatarp->mEndCustomizeCallback); } else { // Add a new inventory item (shouldn't ever happen here) - U32 todo = addWearableToAgentInventoryCallback::CALL_NONE; + U32 todo = AddWearableToAgentInventoryCallback::CALL_NONE; if (send_update) { - todo |= addWearableToAgentInventoryCallback::CALL_UPDATE; + todo |= AddWearableToAgentInventoryCallback::CALL_UPDATE; } LLPointer cb = - new addWearableToAgentInventoryCallback( + new AddWearableToAgentInventoryCallback( LLPointer(NULL), type, index, @@ -484,12 +479,12 @@ void LLAgentWearables::saveWearableAs(const LLWearableType::EType type, old_wearable, trunc_name); LLPointer cb = - new addWearableToAgentInventoryCallback( + new AddWearableToAgentInventoryCallback( LLPointer(NULL), type, index, new_wearable, - addWearableToAgentInventoryCallback::CALL_WEARITEM, + AddWearableToAgentInventoryCallback::CALL_WEARITEM, description ); LLUUID category_id; @@ -909,12 +904,12 @@ void LLAgentWearables::recoverMissingWearable(const LLWearableType::EType type, // destory content.) JC const LLUUID lost_and_found_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND); LLPointer cb = - new addWearableToAgentInventoryCallback( + new AddWearableToAgentInventoryCallback( LLPointer(NULL), type, index, new_wearable, - addWearableToAgentInventoryCallback::CALL_RECOVERDONE); + AddWearableToAgentInventoryCallback::CALL_RECOVERDONE); addWearableToAgentInventory(cb, new_wearable, lost_and_found_id, TRUE); } -- cgit v1.2.3 From 3ed3b88892adb4234c375d2d6bd5f0d2da5566c7 Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Fri, 9 Aug 2013 13:36:36 -0700 Subject: Refactoring link creation calls in preparation for adding AIS v3 hook. --- indra/newview/llagentwearables.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/newview/llagentwearables.cpp') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 8c33a778e3..f3c9998a7d 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -952,15 +952,15 @@ public: /* virtual */ void fire(const LLUUID& inv_item) { llinfos << "One item created " << inv_item.asString() << llendl; - LLViewerInventoryItem *item = gInventory.getItem(inv_item); - mItemsToLink.put(item); + LLConstPointer item = gInventory.getItem(inv_item); + mItemsToLink.push_back(item); updatePendingWearable(inv_item); } ~OnWearableItemCreatedCB() { llinfos << "All items created" << llendl; LLPointer link_waiter = new LLUpdateAppearanceOnDestroy; - LLAppearanceMgr::instance().linkAll(LLAppearanceMgr::instance().getCOF(), + link_inventory_array(LLAppearanceMgr::instance().getCOF(), mItemsToLink, link_waiter); } @@ -1011,7 +1011,7 @@ public: } private: - LLInventoryModel::item_array_t mItemsToLink; + LLInventoryObject::const_object_list_t mItemsToLink; std::vector mWearablesAwaitingItems; }; -- cgit v1.2.3 From 3a0cd466f1182f5868dc21b951d78796542abd7d Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 29 Aug 2013 14:59:40 -0400 Subject: SH-4455 WIP - restrict use of LLWearableHoldingPattern metrics. When changing wearables, bail out if current wearables already match those requested. --- indra/newview/llagentwearables.cpp | 68 +++++++++++++++++++++++++++++--------- 1 file changed, 53 insertions(+), 15 deletions(-) (limited to 'indra/newview/llagentwearables.cpp') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index f3c9998a7d..326c584c32 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -1230,29 +1230,67 @@ void LLAgentWearables::removeWearableFinal(const LLWearableType::EType type, boo // Assumes existing wearables are not dirty. void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& items, - const LLDynamicArray< LLViewerWearable* >& wearables, - BOOL remove) + const LLDynamicArray< LLViewerWearable* >& wearables) { llinfos << "setWearableOutfit() start" << llendl; + S32 count = wearables.count(); + llassert(items.count() == count); + + // Check for whether outfit already matches the one requested (!) + S32 i; + + S32 matched = 0, mismatched = 0; + std::vector type_counts(LLWearableType::WT_COUNT,0); + for (i = 0; i < count; i++) + { + LLViewerWearable* new_wearable = wearables[i]; + LLPointer new_item = items[i]; + const LLWearableType::EType type = new_wearable->getType(); + S32 index = type_counts[type]; + LLViewerWearable *curr_wearable = dynamic_cast(getWearable(type,index)); + if (new_wearable && curr_wearable && + new_wearable->getAssetID() == curr_wearable->getAssetID()) + { + matched++; + } + else + { + LL_DEBUGS("Avatar") << "mismatch, type " << type << " index " << index + << " names " << (curr_wearable ? curr_wearable->getName() : "NONE") << "," + << " names " << (new_wearable ? new_wearable->getName() : "NONE") << llendl; + mismatched++; + } + type_counts[type]++; + } + LL_DEBUGS("Avatar") << "matched " << matched << " mismatched " << mismatched << llendl; + for (S32 j=0; jdumpAvatarTEs("setWearableOutfit"); - lldebugs << "setWearableOutfit() end" << llendl; + LL_DEBUGS("Avatar") << "setWearableOutfit() end" << llendl; } -- cgit v1.2.3 From f426f8a694429209ca0eeea9156173e8a12ddc46 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 29 Aug 2013 17:08:30 -0400 Subject: SH-4455 WIP - versioned some metrics whose usage has changed, added name and item id checks in setWearableOutfit() --- indra/newview/llagentwearables.cpp | 52 +++++++++++++++++++++++++------------- 1 file changed, 35 insertions(+), 17 deletions(-) (limited to 'indra/newview/llagentwearables.cpp') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 326c584c32..8501436b5b 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -1237,31 +1237,49 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it S32 count = wearables.count(); llassert(items.count() == count); - // Check for whether outfit already matches the one requested (!) - S32 i; - + // Check for whether outfit already matches the one requested S32 matched = 0, mismatched = 0; - std::vector type_counts(LLWearableType::WT_COUNT,0); - for (i = 0; i < count; i++) + const S32 arr_size = LLWearableType::WT_COUNT; + S32 type_counts[arr_size]; + std::fill(type_counts,type_counts+arr_size,0); + for (S32 i = 0; i < count; i++) { LLViewerWearable* new_wearable = wearables[i]; LLPointer new_item = items[i]; + const LLWearableType::EType type = new_wearable->getType(); - S32 index = type_counts[type]; - LLViewerWearable *curr_wearable = dynamic_cast(getWearable(type,index)); - if (new_wearable && curr_wearable && - new_wearable->getAssetID() == curr_wearable->getAssetID()) + if (type < 0 || type>=LLWearableType::WT_COUNT) { - matched++; + llwarns << "invalid type " << type << llendl; + mismatched++; + continue; } - else + S32 index = type_counts[type]; + type_counts[type]++; + + LLViewerWearable *curr_wearable = dynamic_cast(getWearable(type,index)); + if (!new_wearable || !curr_wearable || + new_wearable->getAssetID() != curr_wearable->getAssetID()) { LL_DEBUGS("Avatar") << "mismatch, type " << type << " index " << index << " names " << (curr_wearable ? curr_wearable->getName() : "NONE") << "," << " names " << (new_wearable ? new_wearable->getName() : "NONE") << llendl; mismatched++; + continue; } - type_counts[type]++; + + if (curr_wearable->getName() != new_item->getName() || + curr_wearable->getItemID() != new_item->getUUID()) + { + LL_DEBUGS("Avatar") << "mismatch on name or inventory id, names " + << curr_wearable->getName() << " vs " << new_item->getName() + << " item ids " << curr_wearable->getItemID() << " vs " << new_item->getUUID() + << llendl; + mismatched++; + continue; + } + // If we got here, everything matches. + matched++; } LL_DEBUGS("Avatar") << "matched " << matched << " mismatched " << mismatched << llendl; for (S32 j=0; j new_item = items[i]; -- cgit v1.2.3 From 36bb33b12ab090e2acbc7e00039cdff682882fa4 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 18 Sep 2013 17:03:34 -0400 Subject: sunshine cleanup annotations --- indra/newview/llagentwearables.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llagentwearables.cpp') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 8501436b5b..0bb126ffd1 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -1488,6 +1488,7 @@ void LLAgentWearables::setWearableFinal(LLInventoryItem* new_item, LLViewerWeara updateServer(); } +// SUNSHINE CLEANUP dead? void LLAgentWearables::queryWearableCache() { if (!areWearablesLoaded() || (gAgent.getRegion() && gAgent.getRegion()->getCentralBakeVersion())) -- cgit v1.2.3 From 67193b259a5f4cae029b3e08aecf71c1a7041046 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 18 Sep 2013 17:27:40 -0400 Subject: sunshine cleanup annotations --- indra/newview/llagentwearables.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llagentwearables.cpp') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 0bb126ffd1..5cc2435761 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -304,6 +304,7 @@ void LLAgentWearables::addWearabletoAgentInventoryDone(const LLWearableType::ETy gInventory.notifyObservers(); } +// SUNSHINE CLEANUP dead? void LLAgentWearables::sendAgentWearablesUpdate() { // First make sure that we have inventory items for each wearable @@ -1908,6 +1909,7 @@ void LLAgentWearables::editWearableIfRequested(const LLUUID& item_id) } } +// SUNSHINE CLEANUP - both of these funcs seem to be dead code, so this one should go too. void LLAgentWearables::updateServer() { sendAgentWearablesUpdate(); -- cgit v1.2.3 From 82f147367fb5e4ee4bbe53db01856ea375058825 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 19 Sep 2013 11:10:59 -0400 Subject: SH-3455 WIP - removing bake upload code --- indra/newview/llagentwearables.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'indra/newview/llagentwearables.cpp') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 5cc2435761..d59138c624 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -849,7 +849,7 @@ void LLAgentWearables::processAgentInitialWearablesUpdate(LLMessageSystem* mesgs gMessageSystem->getUUIDFast(_PREHASH_WearableData, _PREHASH_AssetID, asset_id, i); if (asset_id.isNull()) { - LLViewerWearable::removeFromAvatar(type, FALSE); + LLViewerWearable::removeFromAvatar(type); } else { @@ -1205,7 +1205,7 @@ void LLAgentWearables::removeWearableFinal(const LLWearableType::EType type, boo if (old_wearable) { popWearable(old_wearable); - old_wearable->removeFromAvatar(TRUE); + old_wearable->removeFromAvatar(); } } clearWearableType(type); @@ -1218,7 +1218,7 @@ void LLAgentWearables::removeWearableFinal(const LLWearableType::EType type, boo if (old_wearable) { popWearable(old_wearable); - old_wearable->removeFromAvatar(TRUE); + old_wearable->removeFromAvatar(); } } @@ -1776,7 +1776,7 @@ bool LLAgentWearables::canWearableBeRemoved(const LLViewerWearable* wearable) co return !(((type == LLWearableType::WT_SHAPE) || (type == LLWearableType::WT_SKIN) || (type == LLWearableType::WT_HAIR) || (type == LLWearableType::WT_EYES)) && (getWearableCount(type) <= 1) ); } -void LLAgentWearables::animateAllWearableParams(F32 delta, BOOL upload_bake) +void LLAgentWearables::animateAllWearableParams(F32 delta) { for( S32 type = 0; type < LLWearableType::WT_COUNT; ++type ) { @@ -1786,7 +1786,7 @@ void LLAgentWearables::animateAllWearableParams(F32 delta, BOOL upload_bake) llassert(wearable); if (wearable) { - wearable->animateParams(delta, upload_bake); + wearable->animateParams(delta); } } } -- cgit v1.2.3 From d58e7cfbfcec163345e87c0c5e5f74d01075246b Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 19 Sep 2013 13:59:20 -0400 Subject: SH-3455 WIP - removing bake upload code --- indra/newview/llagentwearables.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'indra/newview/llagentwearables.cpp') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index d59138c624..96bfc43fb8 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -522,8 +522,6 @@ void LLAgentWearables::revertWearable(const LLWearableType::EType type, const U3 { wearable->revertValues(); } - - gAgent.sendAgentSetAppearance(); } void LLAgentWearables::saveAllWearables() @@ -921,7 +919,7 @@ void LLAgentWearables::recoverMissingWearableDone() if (areWearablesLoaded()) { // Make sure that the server's idea of the avatar's wearables actually match the wearables. - gAgent.sendAgentSetAppearance(); + //gAgent.sendAgentSetAppearance(); } else { @@ -1913,7 +1911,6 @@ void LLAgentWearables::editWearableIfRequested(const LLUUID& item_id) void LLAgentWearables::updateServer() { sendAgentWearablesUpdate(); - gAgent.sendAgentSetAppearance(); } boost::signals2::connection LLAgentWearables::addLoadingStartedCallback(loading_started_callback_t cb) -- cgit v1.2.3 From 48bc05e93ffbd29b3e49c288577bda1712a88392 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 19 Sep 2013 16:14:59 -0400 Subject: SH-3455 WIP - removing bake upload code --- indra/newview/llagentwearables.cpp | 68 ++------------------------------------ 1 file changed, 2 insertions(+), 66 deletions(-) (limited to 'indra/newview/llagentwearables.cpp') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 96bfc43fb8..bffdb0a49b 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -807,7 +807,8 @@ void LLAgentWearables::processAgentInitialWearablesUpdate(LLMessageSystem* mesgs if (isAgentAvatarValid() && (agent_id == gAgentAvatarp->getID())) { - gMessageSystem->getU32Fast(_PREHASH_AgentData, _PREHASH_SerialNum, gAgentQueryManager.mUpdateSerialNum); + U32 unused_update_serial_num; + gMessageSystem->getU32Fast(_PREHASH_AgentData, _PREHASH_SerialNum, unused_update_serial_num); const S32 NUM_BODY_PARTS = 4; S32 num_wearables = gMessageSystem->getNumberOfBlocksFast(_PREHASH_WearableData); @@ -1199,7 +1200,6 @@ void LLAgentWearables::removeWearableFinal(const LLWearableType::EType type, boo for (S32 i=max_entry; i>=0; i--) { LLViewerWearable* old_wearable = getViewerWearable(type,i); - //queryWearableCache(); // moved below if (old_wearable) { popWearable(old_wearable); @@ -1211,7 +1211,6 @@ void LLAgentWearables::removeWearableFinal(const LLWearableType::EType type, boo else { LLViewerWearable* old_wearable = getViewerWearable(type, index); - //queryWearableCache(); // moved below if (old_wearable) { @@ -1220,8 +1219,6 @@ void LLAgentWearables::removeWearableFinal(const LLWearableType::EType type, boo } } - queryWearableCache(); - // Update the server updateServer(); gInventory.notifyObservers(); @@ -1357,7 +1354,6 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it mWearablesLoaded = TRUE; checkWearablesLoaded(); notifyLoadingFinished(); - queryWearableCache(); updateServer(); gAgentAvatarp->dumpAvatarTEs("setWearableOutfit"); @@ -1481,71 +1477,11 @@ void LLAgentWearables::setWearableFinal(LLInventoryItem* new_item, LLViewerWeara } //llinfos << "LLVOAvatar::setWearableItem()" << llendl; - queryWearableCache(); //new_wearable->writeToAvatar(TRUE); updateServer(); } -// SUNSHINE CLEANUP dead? -void LLAgentWearables::queryWearableCache() -{ - if (!areWearablesLoaded() || (gAgent.getRegion() && gAgent.getRegion()->getCentralBakeVersion())) - { - return; - } - gAgentAvatarp->setIsUsingServerBakes(false); - - // Look up affected baked textures. - // If they exist: - // disallow updates for affected layersets (until dataserver responds with cache request.) - // If cache miss, turn updates back on and invalidate composite. - // If cache hit, modify baked texture entries. - // - // Cache requests contain list of hashes for each baked texture entry. - // Response is list of valid baked texture assets. (same message) - - gMessageSystem->newMessageFast(_PREHASH_AgentCachedTexture); - gMessageSystem->nextBlockFast(_PREHASH_AgentData); - gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - gMessageSystem->addS32Fast(_PREHASH_SerialNum, gAgentQueryManager.mWearablesCacheQueryID); - - S32 num_queries = 0; - for (U8 baked_index = 0; baked_index < BAKED_NUM_INDICES; baked_index++) - { - LLUUID hash_id = computeBakedTextureHash((EBakedTextureIndex) baked_index); - if (hash_id.notNull()) - { - num_queries++; - // *NOTE: make sure at least one request gets packed - - ETextureIndex te_index = LLAvatarAppearanceDictionary::bakedToLocalTextureIndex((EBakedTextureIndex)baked_index); - - //llinfos << "Requesting texture for hash " << hash << " in baked texture slot " << baked_index << llendl; - gMessageSystem->nextBlockFast(_PREHASH_WearableData); - gMessageSystem->addUUIDFast(_PREHASH_ID, hash_id); - gMessageSystem->addU8Fast(_PREHASH_TextureIndex, (U8)te_index); - } - - gAgentQueryManager.mActiveCacheQueries[baked_index] = gAgentQueryManager.mWearablesCacheQueryID; - } - //VWR-22113: gAgent.getRegion() can return null if invalid, seen here on logout - if(gAgent.getRegion()) - { - if (isAgentAvatarValid()) - { - selfStartPhase("fetch_texture_cache_entries"); - gAgentAvatarp->outputRezTiming("Fetching textures from cache"); - } - - LL_DEBUGS("Avatar") << gAgentAvatarp->avString() << "Requesting texture cache entry for " << num_queries << " baked textures" << LL_ENDL; - gMessageSystem->sendReliable(gAgent.getRegion()->getHost()); - gAgentQueryManager.mNumPendingQueries++; - gAgentQueryManager.mWearablesCacheQueryID++; - } -} - // virtual void LLAgentWearables::invalidateBakedTextureHash(LLMD5& hash) const { -- cgit v1.2.3 From 9a8afee83f40e7239d98e6cc8cf3297408f51920 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 19 Sep 2013 17:52:58 -0400 Subject: SH-3455 WIP - removing bake upload code --- indra/newview/llagentwearables.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'indra/newview/llagentwearables.cpp') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index bffdb0a49b..2d3823a6e2 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -441,7 +441,7 @@ void LLAgentWearables::saveWearable(const LLWearableType::EType type, const U32 return; } - gAgentAvatarp->wearableUpdated( type, TRUE ); + gAgentAvatarp->wearableUpdated(type); if (send_update) { @@ -716,8 +716,7 @@ void LLAgentWearables::wearableUpdated(LLWearable *wearable, BOOL removed) { if (isAgentAvatarValid()) { - const BOOL upload_result = removed; - gAgentAvatarp->wearableUpdated(wearable->getType(), upload_result); + gAgentAvatarp->wearableUpdated(wearable->getType()); } LLWearableData::wearableUpdated(wearable, removed); -- cgit v1.2.3 From a91b7353b67d3076c87b41097335848364906f7b Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 23 Sep 2013 14:54:44 -0400 Subject: SH-3455 WIP - post-SSA cleanup --- indra/newview/llagentwearables.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'indra/newview/llagentwearables.cpp') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 2d3823a6e2..e8d5f9bee5 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -194,11 +194,6 @@ LLAgentWearables::createStandardWearablesAllDoneCallback::~createStandardWearabl gAgentWearables.createStandardWearablesAllDone(); } -LLAgentWearables::sendAgentWearablesUpdateCallback::~sendAgentWearablesUpdateCallback() -{ - gAgentWearables.sendAgentWearablesUpdate(); -} - /** * @brief Construct a callback for dealing with the wearables. * @@ -776,6 +771,8 @@ BOOL LLAgentWearables::isWearingItem(const LLUUID& item_id) const return getWearableFromItemID(item_id) != NULL; } +// SUNSHINE CLEANUP ? + // MULTI-WEARABLE: DEPRECATED (see backwards compatibility) // static // ! BACKWARDS COMPATIBILITY ! When we stop supporting viewer1.23, we can assume -- cgit v1.2.3 From 029642b2bc3a0bc0bec45af5df5d1e0b1b928b91 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 23 Sep 2013 16:48:49 -0400 Subject: SH-3455 WIP - post-SSA cleanup, including removal of mUseServerBakes and related methods --- indra/newview/llagentwearables.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'indra/newview/llagentwearables.cpp') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index e8d5f9bee5..0ec0fa632d 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -771,13 +771,12 @@ BOOL LLAgentWearables::isWearingItem(const LLUUID& item_id) const return getWearableFromItemID(item_id) != NULL; } -// SUNSHINE CLEANUP ? - // MULTI-WEARABLE: DEPRECATED (see backwards compatibility) -// static // ! BACKWARDS COMPATIBILITY ! When we stop supporting viewer1.23, we can assume // that viewers have a Current Outfit Folder and won't need this message, and thus // we can remove/ignore this whole function. EXCEPT gAgentWearables.notifyLoadingStarted + +// static void LLAgentWearables::processAgentInitialWearablesUpdate(LLMessageSystem* mesgsys, void** user_data) { // We should only receive this message a single time. Ignore subsequent AgentWearablesUpdates -- cgit v1.2.3 From d50be6a8a959b8d7b0f5c8a68b99d3929c17dced Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 23 Sep 2013 17:17:29 -0400 Subject: SH-3455 WIP - post-SSA cleanup --- indra/newview/llagentwearables.cpp | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'indra/newview/llagentwearables.cpp') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 0ec0fa632d..77fd66e4ba 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -1477,16 +1477,6 @@ void LLAgentWearables::setWearableFinal(LLInventoryItem* new_item, LLViewerWeara updateServer(); } -// virtual -void LLAgentWearables::invalidateBakedTextureHash(LLMD5& hash) const -{ - // Add some garbage into the hash so that it becomes invalid. - if (isAgentAvatarValid()) - { - hash.update((const unsigned char*)gAgentAvatarp->getID().mData, UUID_BYTES); - } -} - // User has picked "remove from avatar" from a menu. // static void LLAgentWearables::userRemoveWearable(const LLWearableType::EType &type, const U32 &index) -- cgit v1.2.3 From ac6797c71ad2f75f9f34b3d6b8da4948825e6d57 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 25 Sep 2013 13:01:55 -0400 Subject: SH-3455 WIP - moved setAvatarObject() to run after the self av constructor. Disabled sendAgentWearablesUpdate. --- indra/newview/llagentwearables.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'indra/newview/llagentwearables.cpp') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 77fd66e4ba..5a059008c4 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -182,9 +182,11 @@ void LLAgentWearables::initClass() void LLAgentWearables::setAvatarObject(LLVOAvatarSelf *avatar) { llassert(avatar); - avatar->outputRezTiming("Sending wearables request"); - sendAgentWearablesRequest(); setAvatarAppearance(avatar); + gAgentWearables.notifyLoadingStarted(); + callAfterCategoryFetch(LLAppearanceMgr::instance().getCOF(), + boost::bind(&LLAppearanceMgr::updateAppearanceFromCOF, + LLAppearanceMgr::getInstance(), true, true, no_op)); } // wearables @@ -302,6 +304,8 @@ void LLAgentWearables::addWearabletoAgentInventoryDone(const LLWearableType::ETy // SUNSHINE CLEANUP dead? void LLAgentWearables::sendAgentWearablesUpdate() { + return; // try as NO_OP // SUNSHINE CLEANUP +#if 0 // First make sure that we have inventory items for each wearable for (S32 type=0; type < LLWearableType::WT_COUNT; ++type) { @@ -372,6 +376,7 @@ void LLAgentWearables::sendAgentWearablesUpdate() lldebugs << " " << LLWearableType::getTypeLabel((LLWearableType::EType)type) << ": " << (wearable ? wearable->getAssetID() : LLUUID::null) << llendl; } gAgent.sendReliableMessage(); +#endif } void LLAgentWearables::saveWearable(const LLWearableType::EType type, const U32 index, BOOL send_update, -- cgit v1.2.3 From 39900843c99dbfc01f8a28fb071edc9a77c471be Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 26 Sep 2013 16:24:25 -0400 Subject: SH-3455 WIP --- indra/newview/llagentwearables.cpp | 203 +++++-------------------------------- 1 file changed, 28 insertions(+), 175 deletions(-) (limited to 'indra/newview/llagentwearables.cpp') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 5a059008c4..a97396ae1c 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -126,13 +126,6 @@ void LLAgentWearables::dump() } } - llinfos << "Total items awaiting wearable update " << mItemsAwaitingWearableUpdate.size() << llendl; - for (std::set::iterator it = mItemsAwaitingWearableUpdate.begin(); - it != mItemsAwaitingWearableUpdate.end(); - ++it) - { - llinfos << (*it).asString() << llendl; - } } struct LLAgentDumper @@ -189,12 +182,6 @@ void LLAgentWearables::setAvatarObject(LLVOAvatarSelf *avatar) LLAppearanceMgr::getInstance(), true, true, no_op)); } -// wearables -LLAgentWearables::createStandardWearablesAllDoneCallback::~createStandardWearablesAllDoneCallback() -{ - llinfos << "destructor - all done?" << llendl; - gAgentWearables.createStandardWearablesAllDone(); -} /** * @brief Construct a callback for dealing with the wearables. @@ -222,6 +209,8 @@ void LLAgentWearables::AddWearableToAgentInventoryCallback::fire(const LLUUID& i { if (mTodo & CALL_CREATESTANDARDDONE) { + // SUNSHINE CLEANUP + llassert(false); // does not appear to ever be used. llinfos << "callback fired, inv_item " << inv_item.asString() << llendl; } @@ -230,10 +219,6 @@ void LLAgentWearables::AddWearableToAgentInventoryCallback::fire(const LLUUID& i gAgentWearables.addWearabletoAgentInventoryDone(mType, mIndex, inv_item, mWearable); - if (mTodo & CALL_UPDATE) - { - gAgentWearables.sendAgentWearablesUpdate(); - } if (mTodo & CALL_RECOVERDONE) { LLAppearanceMgr::instance().addCOFItemLink(inv_item); @@ -244,8 +229,10 @@ void LLAgentWearables::AddWearableToAgentInventoryCallback::fire(const LLUUID& i */ if (mTodo & CALL_CREATESTANDARDDONE) { - LLAppearanceMgr::instance().addCOFItemLink(inv_item); - gAgentWearables.createStandardWearablesDone(mType, mIndex); + // SUNSHINE CLEANUP + llassert(false); // does not appear to ever be used. + //LLAppearanceMgr::instance().addCOFItemLink(inv_item); + //gAgentWearables.createStandardWearablesDone(mType, mIndex); } if (mTodo & CALL_MAKENEWOUTFITDONE) { @@ -379,7 +366,7 @@ void LLAgentWearables::sendAgentWearablesUpdate() #endif } -void LLAgentWearables::saveWearable(const LLWearableType::EType type, const U32 index, BOOL send_update, +void LLAgentWearables::saveWearable(const LLWearableType::EType type, const U32 index, const std::string new_name) { LLViewerWearable* old_wearable = getViewerWearable(type, index); @@ -426,10 +413,6 @@ void LLAgentWearables::saveWearable(const LLWearableType::EType type, const U32 { // Add a new inventory item (shouldn't ever happen here) U32 todo = AddWearableToAgentInventoryCallback::CALL_NONE; - if (send_update) - { - todo |= AddWearableToAgentInventoryCallback::CALL_UPDATE; - } LLPointer cb = new AddWearableToAgentInventoryCallback( LLPointer(NULL), @@ -442,11 +425,6 @@ void LLAgentWearables::saveWearable(const LLWearableType::EType type, const U32 } gAgentAvatarp->wearableUpdated(type); - - if (send_update) - { - sendAgentWearablesUpdate(); - } } } @@ -534,9 +512,10 @@ void LLAgentWearables::saveAllWearables() for (S32 i=0; i < LLWearableType::WT_COUNT; i++) { for (U32 j=0; j < getWearableCount((LLWearableType::EType)i); j++) - saveWearable((LLWearableType::EType)i, j, FALSE); + saveWearable((LLWearableType::EType)i, j); } - sendAgentWearablesUpdate(); + // SUNSHINE CLEANUP - check ok + //sendAgentWearablesUpdate(); } // Called when the user changes the name of a wearable inventory item that is currently being worn. @@ -565,7 +544,8 @@ void LLAgentWearables::setWearableName(const LLUUID& item_id, const std::string& old_wearable->setName(old_name); setWearable((LLWearableType::EType)i,j,new_wearable); - sendAgentWearablesUpdate(); + // SUNSHINE CLEANUP - verify ok + //sendAgentWearablesUpdate(); break; } } @@ -736,23 +716,13 @@ void LLAgentWearables::wearableUpdated(LLWearable *wearable, BOOL removed) wearable->setDefinitionVersion(22); U32 index = getWearableIndex(wearable); llinfos << "forcing wearable type " << wearable->getType() << " to version 22 from 24" << llendl; - saveWearable(wearable->getType(),index,TRUE); + saveWearable(wearable->getType(),index); } checkWearableAgainstInventory(viewer_wearable); } } -BOOL LLAgentWearables::itemUpdatePending(const LLUUID& item_id) const -{ - return mItemsAwaitingWearableUpdate.find(item_id) != mItemsAwaitingWearableUpdate.end(); -} - -U32 LLAgentWearables::itemUpdatePendingCount() const -{ - return mItemsAwaitingWearableUpdate.size(); -} - const LLUUID LLAgentWearables::getWearableItemID(LLWearableType::EType type, U32 index) const { const LLViewerWearable *wearable = getViewerWearable(type,index); @@ -776,116 +746,6 @@ BOOL LLAgentWearables::isWearingItem(const LLUUID& item_id) const return getWearableFromItemID(item_id) != NULL; } -// MULTI-WEARABLE: DEPRECATED (see backwards compatibility) -// ! BACKWARDS COMPATIBILITY ! When we stop supporting viewer1.23, we can assume -// that viewers have a Current Outfit Folder and won't need this message, and thus -// we can remove/ignore this whole function. EXCEPT gAgentWearables.notifyLoadingStarted - -// static -void LLAgentWearables::processAgentInitialWearablesUpdate(LLMessageSystem* mesgsys, void** user_data) -{ - // We should only receive this message a single time. Ignore subsequent AgentWearablesUpdates - // that may result from AgentWearablesRequest having been sent more than once. - if (mInitialWearablesUpdateReceived) - return; - - if (isAgentAvatarValid()) - { - gAgentAvatarp->startPhase("process_initial_wearables_update"); - gAgentAvatarp->outputRezTiming("Received initial wearables update"); - } - - // notify subscribers that wearables started loading. See EXT-7777 - // *TODO: find more proper place to not be called from deprecated method. - // Seems such place is found: LLInitialWearablesFetch::processContents() - gAgentWearables.notifyLoadingStarted(); - - mInitialWearablesUpdateReceived = true; - - LLUUID agent_id; - gMessageSystem->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id); - - if (isAgentAvatarValid() && (agent_id == gAgentAvatarp->getID())) - { - U32 unused_update_serial_num; - gMessageSystem->getU32Fast(_PREHASH_AgentData, _PREHASH_SerialNum, unused_update_serial_num); - - const S32 NUM_BODY_PARTS = 4; - S32 num_wearables = gMessageSystem->getNumberOfBlocksFast(_PREHASH_WearableData); - if (num_wearables < NUM_BODY_PARTS) - { - // Transitional state. Avatars should always have at least their body parts (hair, eyes, shape and skin). - // The fact that they don't have any here (only a dummy is sent) implies that either: - // 1. This account existed before we had wearables - // 2. The database has gotten messed up - // 3. This is the account's first login (i.e. the wearables haven't been generated yet). - return; - } - - // Get the UUID of the current outfit folder (will be created if it doesn't exist) - const LLUUID current_outfit_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT); - LLInitialWearablesFetch* outfit = new LLInitialWearablesFetch(current_outfit_id); - - //lldebugs << "processAgentInitialWearablesUpdate()" << llendl; - // Add wearables - // MULTI-WEARABLE: DEPRECATED: Message only supports one wearable per type, will be ignored in future. - gAgentWearables.mItemsAwaitingWearableUpdate.clear(); - for (S32 i=0; i < num_wearables; i++) - { - // Parse initial wearables data from message system - U8 type_u8 = 0; - gMessageSystem->getU8Fast(_PREHASH_WearableData, _PREHASH_WearableType, type_u8, i); - if (type_u8 >= LLWearableType::WT_COUNT) - { - continue; - } - const LLWearableType::EType type = (LLWearableType::EType) type_u8; - - LLUUID item_id; - gMessageSystem->getUUIDFast(_PREHASH_WearableData, _PREHASH_ItemID, item_id, i); - - LLUUID asset_id; - gMessageSystem->getUUIDFast(_PREHASH_WearableData, _PREHASH_AssetID, asset_id, i); - if (asset_id.isNull()) - { - LLViewerWearable::removeFromAvatar(type); - } - else - { - LLAssetType::EType asset_type = LLWearableType::getAssetType(type); - if (asset_type == LLAssetType::AT_NONE) - { - continue; - } - - // MULTI-WEARABLE: DEPRECATED: this message only supports one wearable per type. Should be ignored in future versions - - // Store initial wearables data until we know whether we have the current outfit folder or need to use the data. - LLInitialWearablesFetch::InitialWearableData wearable_data(type, item_id, asset_id); - outfit->add(wearable_data); - } - - lldebugs << " " << LLWearableType::getTypeLabel(type) << llendl; - } - - // Get the complete information on the items in the inventory and set up an observer - // that will trigger when the complete information is fetched. - outfit->startFetch(); - if(outfit->isFinished()) - { - // everything is already here - call done. - outfit->done(); - } - else - { - // it's all on it's way - add an observer, and the inventory - // will call done for us when everything is here. - gInventory.addObserver(outfit); - } - - } -} - // Normally, all wearables referred to "AgentWearablesUpdate" will correspond to actual assets in the // database. If for some reason, we can't load one of those assets, we can try to reconstruct it so that // the user isn't left without a shape, for example. (We can do that only after the inventory has loaded.) @@ -1063,6 +923,8 @@ void LLAgentWearables::createStandardWearables() } } +// SUNSHINE CLEANUP apparently unused. +#if 0 void LLAgentWearables::createStandardWearablesDone(S32 type, U32 index) { llinfos << "type " << type << " index " << index << llendl; @@ -1070,22 +932,7 @@ void LLAgentWearables::createStandardWearablesDone(S32 type, U32 index) if (!isAgentAvatarValid()) return; gAgentAvatarp->updateVisualParams(); } - -void LLAgentWearables::createStandardWearablesAllDone() -{ - // ... because sendAgentWearablesUpdate will notify inventory - // observers. - llinfos << "all done?" << llendl; - - mWearablesLoaded = TRUE; - checkWearablesLoaded(); - notifyLoadingFinished(); - - updateServer(); - - // Treat this as the first texture entry message, if none received yet - gAgentAvatarp->onFirstTEMessageReceived(); -} +#endif void LLAgentWearables::makeNewOutfitDone(S32 type, U32 index) { @@ -1220,7 +1067,8 @@ void LLAgentWearables::removeWearableFinal(const LLWearableType::EType type, boo } // Update the server - updateServer(); + // SUNSHINE CLEANUP + // updateServer(); gInventory.notifyObservers(); } @@ -1354,7 +1202,8 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it mWearablesLoaded = TRUE; checkWearablesLoaded(); notifyLoadingFinished(); - updateServer(); + // SUNSHINE CLEANUP + //updateServer(); gAgentAvatarp->dumpAvatarTEs("setWearableOutfit"); @@ -1479,7 +1328,8 @@ void LLAgentWearables::setWearableFinal(LLInventoryItem* new_item, LLViewerWeara //llinfos << "LLVOAvatar::setWearableItem()" << llendl; //new_wearable->writeToAvatar(TRUE); - updateServer(); + // SUNSHINE CLEANUP + //updateServer(); } // User has picked "remove from avatar" from a menu. @@ -1650,10 +1500,11 @@ void LLAgentWearables::userAttachMultipleAttachments(LLInventoryModel::item_arra } } +// SUNSHINE CLEANUP - itemUpdatePendingCount() was always 0, so this should be removed as useless. void LLAgentWearables::checkWearablesLoaded() const { #ifdef SHOW_ASSERT - U32 item_pend_count = itemUpdatePendingCount(); + U32 item_pend_count = 0; //itemUpdatePendingCount(); if (mWearablesLoaded) { llassert(item_pend_count==0); @@ -1677,14 +1528,14 @@ bool LLAgentWearables::canMoveWearable(const LLUUID& item_id, bool closer_to_bod BOOL LLAgentWearables::areWearablesLoaded() const { - checkWearablesLoaded(); return mWearablesLoaded; } // MULTI-WEARABLE: DEPRECATED: item pending count relies on old messages that don't support multi-wearables. do not trust to be accurate +// SUNSHINE CLEANUP - itemUpdatePendingCount was always 0 due to longstanding bug, might as well remove (or fix) this. void LLAgentWearables::updateWearablesLoaded() { - mWearablesLoaded = (itemUpdatePendingCount()==0); + mWearablesLoaded = true; //(itemUpdatePendingCount()==0); if (mWearablesLoaded) { notifyLoadingFinished(); @@ -1834,10 +1685,12 @@ void LLAgentWearables::editWearableIfRequested(const LLUUID& item_id) } // SUNSHINE CLEANUP - both of these funcs seem to be dead code, so this one should go too. +#if 0 void LLAgentWearables::updateServer() { sendAgentWearablesUpdate(); } +#endif boost::signals2::connection LLAgentWearables::addLoadingStartedCallback(loading_started_callback_t cb) { -- cgit v1.2.3 From 2248cbf2b873d3bf264ddbec22ea731bee9a9b96 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 26 Sep 2013 17:27:01 -0400 Subject: SH-3455 WIP - removed llagentwearablesfetch files, among other changes --- indra/newview/llagentwearables.cpp | 177 ++----------------------------------- 1 file changed, 5 insertions(+), 172 deletions(-) (limited to 'indra/newview/llagentwearables.cpp') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index a97396ae1c..5b18a45431 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -30,7 +30,6 @@ #include "llaccordionctrltab.h" #include "llagent.h" #include "llagentcamera.h" -#include "llagentwearablesfetch.h" #include "llappearancemgr.h" #include "llcallbacklist.h" #include "llfloatersidepanelcontainer.h" @@ -207,13 +206,6 @@ LLAgentWearables::AddWearableToAgentInventoryCallback::AddWearableToAgentInvento void LLAgentWearables::AddWearableToAgentInventoryCallback::fire(const LLUUID& inv_item) { - if (mTodo & CALL_CREATESTANDARDDONE) - { - // SUNSHINE CLEANUP - llassert(false); // does not appear to ever be used. - llinfos << "callback fired, inv_item " << inv_item.asString() << llendl; - } - if (inv_item.isNull()) return; @@ -227,13 +219,6 @@ void LLAgentWearables::AddWearableToAgentInventoryCallback::fire(const LLUUID& i /* * Do this for every one in the loop */ - if (mTodo & CALL_CREATESTANDARDDONE) - { - // SUNSHINE CLEANUP - llassert(false); // does not appear to ever be used. - //LLAppearanceMgr::instance().addCOFItemLink(inv_item); - //gAgentWearables.createStandardWearablesDone(mType, mIndex); - } if (mTodo & CALL_MAKENEWOUTFITDONE) { gAgentWearables.makeNewOutfitDone(mType, mIndex); @@ -288,84 +273,6 @@ void LLAgentWearables::addWearabletoAgentInventoryDone(const LLWearableType::ETy gInventory.notifyObservers(); } -// SUNSHINE CLEANUP dead? -void LLAgentWearables::sendAgentWearablesUpdate() -{ - return; // try as NO_OP // SUNSHINE CLEANUP -#if 0 - // First make sure that we have inventory items for each wearable - for (S32 type=0; type < LLWearableType::WT_COUNT; ++type) - { - for (U32 index=0; index < getWearableCount((LLWearableType::EType)type); ++index) - { - LLViewerWearable* wearable = getViewerWearable((LLWearableType::EType)type,index); - if (wearable) - { - if (wearable->getItemID().isNull()) - { - LLPointer cb = - new AddWearableToAgentInventoryCallback( - LLPointer(NULL), - (LLWearableType::EType)type, - index, - wearable, - AddWearableToAgentInventoryCallback::CALL_NONE); - addWearableToAgentInventory(cb, wearable); - } - else - { - gInventory.addChangedMask(LLInventoryObserver::LABEL, - wearable->getItemID()); - } - } - } - } - - // Then make sure the inventory is in sync with the avatar. - gInventory.notifyObservers(); - - // Send the AgentIsNowWearing - gMessageSystem->newMessageFast(_PREHASH_AgentIsNowWearing); - - gMessageSystem->nextBlockFast(_PREHASH_AgentData); - gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - - lldebugs << "sendAgentWearablesUpdate()" << llendl; - // MULTI-WEARABLE: DEPRECATED: HACK: index to 0- server database tables don't support concept of multiwearables. - for (S32 type=0; type < LLWearableType::WT_COUNT; ++type) - { - gMessageSystem->nextBlockFast(_PREHASH_WearableData); - - U8 type_u8 = (U8)type; - gMessageSystem->addU8Fast(_PREHASH_WearableType, type_u8); - - LLViewerWearable* wearable = getViewerWearable((LLWearableType::EType)type, 0); - if (wearable) - { - //llinfos << "Sending wearable " << wearable->getName() << llendl; - LLUUID item_id = wearable->getItemID(); - const LLViewerInventoryItem *item = gInventory.getItem(item_id); - if (item && item->getIsLinkType()) - { - // Get the itemID that this item points to. i.e. make sure - // we are storing baseitems, not their links, in the database. - item_id = item->getLinkedUUID(); - } - gMessageSystem->addUUIDFast(_PREHASH_ItemID, item_id); - } - else - { - //llinfos << "Not wearing wearable type " << LLWearableType::getTypeName((LLWearableType::EType)i) << llendl; - gMessageSystem->addUUIDFast(_PREHASH_ItemID, LLUUID::null); - } - - lldebugs << " " << LLWearableType::getTypeLabel((LLWearableType::EType)type) << ": " << (wearable ? wearable->getAssetID() : LLUUID::null) << llendl; - } - gAgent.sendReliableMessage(); -#endif -} - void LLAgentWearables::saveWearable(const LLWearableType::EType type, const U32 index, const std::string new_name) { @@ -514,8 +421,6 @@ void LLAgentWearables::saveAllWearables() for (U32 j=0; j < getWearableCount((LLWearableType::EType)i); j++) saveWearable((LLWearableType::EType)i, j); } - // SUNSHINE CLEANUP - check ok - //sendAgentWearablesUpdate(); } // Called when the user changes the name of a wearable inventory item that is currently being worn. @@ -544,8 +449,6 @@ void LLAgentWearables::setWearableName(const LLUUID& item_id, const std::string& old_wearable->setName(old_name); setWearable((LLWearableType::EType)i,j,new_wearable); - // SUNSHINE CLEANUP - verify ok - //sendAgentWearablesUpdate(); break; } } @@ -666,15 +569,6 @@ LLViewerWearable* LLAgentWearables::getWearableFromAssetID(const LLUUID& asset_i return NULL; } -void LLAgentWearables::sendAgentWearablesRequest() -{ - gMessageSystem->newMessageFast(_PREHASH_AgentWearablesRequest); - gMessageSystem->nextBlockFast(_PREHASH_AgentData); - gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - gAgent.sendReliableMessage(); -} - LLViewerWearable* LLAgentWearables::getViewerWearable(const LLWearableType::EType type, U32 index /*= 0*/) { return dynamic_cast (getWearable(type, index)); @@ -775,18 +669,8 @@ void LLAgentWearables::recoverMissingWearable(const LLWearableType::EType type, void LLAgentWearables::recoverMissingWearableDone() { - // Have all the wearables that the avatar was wearing at log-in arrived or been fabricated? - updateWearablesLoaded(); - if (areWearablesLoaded()) - { - // Make sure that the server's idea of the avatar's wearables actually match the wearables. - //gAgent.sendAgentSetAppearance(); - } - else - { - gInventory.addChangedMask(LLInventoryObserver::LABEL, LLUUID::null); - gInventory.notifyObservers(); - } + gInventory.addChangedMask(LLInventoryObserver::LABEL, LLUUID::null); + gInventory.notifyObservers(); } void LLAgentWearables::addLocalTextureObject(const LLWearableType::EType wearable_type, const LLAvatarAppearanceDefines::ETextureIndex texture_type, U32 wearable_index) @@ -923,17 +807,6 @@ void LLAgentWearables::createStandardWearables() } } -// SUNSHINE CLEANUP apparently unused. -#if 0 -void LLAgentWearables::createStandardWearablesDone(S32 type, U32 index) -{ - llinfos << "type " << type << " index " << index << llendl; - - if (!isAgentAvatarValid()) return; - gAgentAvatarp->updateVisualParams(); -} -#endif - void LLAgentWearables::makeNewOutfitDone(S32 type, U32 index) { LLUUID first_item_id = getWearableItemID((LLWearableType::EType)type, index); @@ -1066,9 +939,6 @@ void LLAgentWearables::removeWearableFinal(const LLWearableType::EType type, boo } } - // Update the server - // SUNSHINE CLEANUP - // updateServer(); gInventory.notifyObservers(); } @@ -1200,10 +1070,10 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it // Start rendering & update the server mWearablesLoaded = TRUE; - checkWearablesLoaded(); + + // SUNSHINE CLEANUP - these checks for done never worked. Should they be modified? + //checkWearablesLoaded(); notifyLoadingFinished(); - // SUNSHINE CLEANUP - //updateServer(); gAgentAvatarp->dumpAvatarTEs("setWearableOutfit"); @@ -1324,12 +1194,6 @@ void LLAgentWearables::setWearableFinal(LLInventoryItem* new_item, LLViewerWeara llinfos << "Replaced current element 0 for type " << type << " size is now " << getWearableCount(type) << llendl; } - - //llinfos << "LLVOAvatar::setWearableItem()" << llendl; - //new_wearable->writeToAvatar(TRUE); - - // SUNSHINE CLEANUP - //updateServer(); } // User has picked "remove from avatar" from a menu. @@ -1500,18 +1364,6 @@ void LLAgentWearables::userAttachMultipleAttachments(LLInventoryModel::item_arra } } -// SUNSHINE CLEANUP - itemUpdatePendingCount() was always 0, so this should be removed as useless. -void LLAgentWearables::checkWearablesLoaded() const -{ -#ifdef SHOW_ASSERT - U32 item_pend_count = 0; //itemUpdatePendingCount(); - if (mWearablesLoaded) - { - llassert(item_pend_count==0); - } -#endif -} - // Returns false if the given wearable is already topmost/bottommost // (depending on closer_to_body parameter). bool LLAgentWearables::canMoveWearable(const LLUUID& item_id, bool closer_to_body) const @@ -1531,17 +1383,6 @@ BOOL LLAgentWearables::areWearablesLoaded() const return mWearablesLoaded; } -// MULTI-WEARABLE: DEPRECATED: item pending count relies on old messages that don't support multi-wearables. do not trust to be accurate -// SUNSHINE CLEANUP - itemUpdatePendingCount was always 0 due to longstanding bug, might as well remove (or fix) this. -void LLAgentWearables::updateWearablesLoaded() -{ - mWearablesLoaded = true; //(itemUpdatePendingCount()==0); - if (mWearablesLoaded) - { - notifyLoadingFinished(); - } -} - bool LLAgentWearables::canWearableBeRemoved(const LLViewerWearable* wearable) const { if (!wearable) return false; @@ -1684,14 +1525,6 @@ void LLAgentWearables::editWearableIfRequested(const LLUUID& item_id) } } -// SUNSHINE CLEANUP - both of these funcs seem to be dead code, so this one should go too. -#if 0 -void LLAgentWearables::updateServer() -{ - sendAgentWearablesUpdate(); -} -#endif - boost::signals2::connection LLAgentWearables::addLoadingStartedCallback(loading_started_callback_t cb) { return mLoadingStartedSignal.connect(cb); -- cgit v1.2.3 From 2d7dd7db24fefe9dcd8bde83a92304936a5f77ed Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 1 Oct 2013 07:54:30 -0400 Subject: SH-3455 WIP - dead code removal --- indra/newview/llagentwearables.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llagentwearables.cpp') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 5b18a45431..eda0ff71ba 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -655,7 +655,7 @@ void LLAgentWearables::recoverMissingWearable(const LLWearableType::EType type, // Add a new one in the lost and found folder. // (We used to overwrite the "not found" one, but that could potentially - // destory content.) JC + // destroy content.) JC const LLUUID lost_and_found_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND); LLPointer cb = new AddWearableToAgentInventoryCallback( -- cgit v1.2.3 From 230db3e83b4c018d381ad5f4fe77e7f7f384f397 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 4 Oct 2013 12:08:15 -0400 Subject: SH-3455 WIP --- indra/newview/llagentwearables.cpp | 40 -------------------------------------- 1 file changed, 40 deletions(-) (limited to 'indra/newview/llagentwearables.cpp') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index eda0ff71ba..798b733efb 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -211,11 +211,6 @@ void LLAgentWearables::AddWearableToAgentInventoryCallback::fire(const LLUUID& i gAgentWearables.addWearabletoAgentInventoryDone(mType, mIndex, inv_item, mWearable); - if (mTodo & CALL_RECOVERDONE) - { - LLAppearanceMgr::instance().addCOFItemLink(inv_item); - gAgentWearables.recoverMissingWearableDone(); - } /* * Do this for every one in the loop */ @@ -640,39 +635,6 @@ BOOL LLAgentWearables::isWearingItem(const LLUUID& item_id) const return getWearableFromItemID(item_id) != NULL; } -// Normally, all wearables referred to "AgentWearablesUpdate" will correspond to actual assets in the -// database. If for some reason, we can't load one of those assets, we can try to reconstruct it so that -// the user isn't left without a shape, for example. (We can do that only after the inventory has loaded.) -void LLAgentWearables::recoverMissingWearable(const LLWearableType::EType type, U32 index) -{ - // Try to recover by replacing missing wearable with a new one. - LLNotificationsUtil::add("ReplacedMissingWearable"); - lldebugs << "Wearable " << LLWearableType::getTypeLabel(type) << " could not be downloaded. Replaced inventory item with default wearable." << llendl; - LLViewerWearable* new_wearable = LLWearableList::instance().createNewWearable(type, gAgentAvatarp); - - setWearable(type,index,new_wearable); - //new_wearable->writeToAvatar(TRUE); - - // Add a new one in the lost and found folder. - // (We used to overwrite the "not found" one, but that could potentially - // destroy content.) JC - const LLUUID lost_and_found_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND); - LLPointer cb = - new AddWearableToAgentInventoryCallback( - LLPointer(NULL), - type, - index, - new_wearable, - AddWearableToAgentInventoryCallback::CALL_RECOVERDONE); - addWearableToAgentInventory(cb, new_wearable, lost_and_found_id, TRUE); -} - -void LLAgentWearables::recoverMissingWearableDone() -{ - gInventory.addChangedMask(LLInventoryObserver::LABEL, LLUUID::null); - gInventory.notifyObservers(); -} - void LLAgentWearables::addLocalTextureObject(const LLWearableType::EType wearable_type, const LLAvatarAppearanceDefines::ETextureIndex texture_type, U32 wearable_index) { LLViewerWearable* wearable = getViewerWearable((LLWearableType::EType)wearable_type, wearable_index); @@ -1071,8 +1033,6 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it // Start rendering & update the server mWearablesLoaded = TRUE; - // SUNSHINE CLEANUP - these checks for done never worked. Should they be modified? - //checkWearablesLoaded(); notifyLoadingFinished(); gAgentAvatarp->dumpAvatarTEs("setWearableOutfit"); -- cgit v1.2.3 From 20af6640d4077725034bd7e9d0e8982778cea09a Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 15 Oct 2013 11:17:20 -0400 Subject: SH-3455 WIP - llstartup cleanup --- indra/newview/llagentwearables.cpp | 4 ---- 1 file changed, 4 deletions(-) (limited to 'indra/newview/llagentwearables.cpp') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 798b733efb..96ce8d1f6d 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -175,10 +175,6 @@ void LLAgentWearables::setAvatarObject(LLVOAvatarSelf *avatar) { llassert(avatar); setAvatarAppearance(avatar); - gAgentWearables.notifyLoadingStarted(); - callAfterCategoryFetch(LLAppearanceMgr::instance().getCOF(), - boost::bind(&LLAppearanceMgr::updateAppearanceFromCOF, - LLAppearanceMgr::getInstance(), true, true, no_op)); } -- cgit v1.2.3 From d560427a773625297ba351ca248aa73a9adb18ca Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 25 Oct 2013 14:47:04 -0400 Subject: SH-4571 WIP - send dummy wearables data on login, to help earlier release viewers that still rely on the presence of the message --- indra/newview/llagentwearables.cpp | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'indra/newview/llagentwearables.cpp') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 96ce8d1f6d..e4004f108c 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -765,6 +765,40 @@ void LLAgentWearables::createStandardWearables() } } +// We no longer need this message in the current viewer, but send +// it for now to maintain compatibility with release viewers. Can +// remove this function once the SH-3455 changesets are universally deployed. +void LLAgentWearables::sendDummyAgentWearablesUpdate() +{ + LL_DEBUGS("Avatar") << "sendAgentWearablesUpdate()" << llendl; + + // Send the AgentIsNowWearing + gMessageSystem->newMessageFast(_PREHASH_AgentIsNowWearing); + + gMessageSystem->nextBlockFast(_PREHASH_AgentData); + gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + + // Send 4 standardized nonsense item ids (same as returned by the modified sim, not that it especially matters). + gMessageSystem->nextBlockFast(_PREHASH_WearableData); + gMessageSystem->addU8Fast(_PREHASH_WearableType, U8(1)); + gMessageSystem->addUUIDFast(_PREHASH_ItemID, LLUUID("db5a4e5f-9da3-44c8-992d-1181c5795498")); + + gMessageSystem->nextBlockFast(_PREHASH_WearableData); + gMessageSystem->addU8Fast(_PREHASH_WearableType, U8(2)); + gMessageSystem->addUUIDFast(_PREHASH_ItemID, LLUUID("6969c7cc-f72f-4a76-a19b-c293cce8ce4f")); + + gMessageSystem->nextBlockFast(_PREHASH_WearableData); + gMessageSystem->addU8Fast(_PREHASH_WearableType, U8(3)); + gMessageSystem->addUUIDFast(_PREHASH_ItemID, LLUUID("7999702b-b291-48f9-8903-c91dfb828408")); + + gMessageSystem->nextBlockFast(_PREHASH_WearableData); + gMessageSystem->addU8Fast(_PREHASH_WearableType, U8(4)); + gMessageSystem->addUUIDFast(_PREHASH_ItemID, LLUUID("566cb59e-ef60-41d7-bfa6-e0f293fbea40")); + + gAgent.sendReliableMessage(); +} + void LLAgentWearables::makeNewOutfitDone(S32 type, U32 index) { LLUUID first_item_id = getWearableItemID((LLWearableType::EType)type, index); -- cgit v1.2.3 From 35daa8031979fc708640e2f2f9ab849e6cb156dd Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Wed, 11 Dec 2013 12:09:39 -0500 Subject: STORM-68 Re-add wearables callback that did not carry through in the merge. --- indra/newview/llagentwearables.cpp | 42 +++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 17 deletions(-) (limited to 'indra/newview/llagentwearables.cpp') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index c741f6403d..f71b49010d 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -86,27 +86,26 @@ void wear_and_edit_cb(const LLUUID& inv_item) LLAppearanceMgr::instance().wearItemOnAvatar(inv_item); } -class LLCreateWearableCallback : public LLInventoryCallback +void wear_cb(const LLUUID& inv_item) { - void fire(const LLUUID& inv_item) + if (inv_item.isNull()) { - if (inv_item.isNull()) - return; + return; + } - LLViewerInventoryItem* item = gInventory.getItem(inv_item); - if (!item) return; + LLViewerInventoryItem* item = gInventory.getItem(inv_item); + if (!item) return; - LLPermissions perm = item->getPermissions(); - perm.setMaskNext(LLFloaterPerms::getNextOwnerPerms("Wearables")); - perm.setMaskEveryone(LLFloaterPerms::getEveryonePerms("Wearables")); - perm.setMaskGroup(LLFloaterPerms::getGroupPerms("Wearables")); - item->setPermissions(perm); + LLPermissions perm = item->getPermissions(); + perm.setMaskNext(LLFloaterPerms::getNextOwnerPerms("Wearables")); + perm.setMaskEveryone(LLFloaterPerms::getEveryonePerms("Wearables")); + perm.setMaskGroup(LLFloaterPerms::getGroupPerms("Wearables")); + item->setPermissions(perm); - item->updateServer(FALSE); - gInventory.updateItem(item); - gInventory.notifyObservers(); - } -}; + item->updateServer(FALSE); + gInventory.updateItem(item); + gInventory.notifyObservers(); +} /////////////////////////////////////////////////////////////////////////////// @@ -1841,7 +1840,16 @@ void LLAgentWearables::createWearable(LLWearableType::EType type, bool wear, con LLViewerWearable* wearable = LLWearableList::instance().createNewWearable(type, gAgentAvatarp); LLAssetType::EType asset_type = wearable->getAssetType(); LLInventoryType::EType inv_type = LLInventoryType::IT_WEARABLE; - LLPointer cb = wear ? new LLBoostFuncInventoryCallback(wear_and_edit_cb) : NULL; + LLPointer cb; + if(wear) + { + cb = new LLBoostFuncInventoryCallback(wear_and_edit_cb); + } + else + { + cb = new LLBoostFuncInventoryCallback(wear_cb); + } + LLUUID folder_id; if (parent_id.notNull()) -- cgit v1.2.3 From a4173dc81a21dfac6a8b57e8e1c354b9a37fe5ba Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Wed, 8 Jan 2014 09:30:30 -0500 Subject: STORM-68 Remove obsolete note. Refactor a few blocks of code to not have early returns --- indra/newview/llagentwearables.cpp | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) (limited to 'indra/newview/llagentwearables.cpp') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index f71b49010d..aa97bddec8 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -88,23 +88,22 @@ void wear_and_edit_cb(const LLUUID& inv_item) void wear_cb(const LLUUID& inv_item) { - if (inv_item.isNull()) + if (!inv_item.isNull()) { - return; + LLViewerInventoryItem* item = gInventory.getItem(inv_item); + if (item) + { + LLPermissions perm = item->getPermissions(); + perm.setMaskNext(LLFloaterPerms::getNextOwnerPerms("Wearables")); + perm.setMaskEveryone(LLFloaterPerms::getEveryonePerms("Wearables")); + perm.setMaskGroup(LLFloaterPerms::getGroupPerms("Wearables")); + item->setPermissions(perm); + + item->updateServer(FALSE); + gInventory.updateItem(item); + gInventory.notifyObservers(); + } } - - LLViewerInventoryItem* item = gInventory.getItem(inv_item); - if (!item) return; - - LLPermissions perm = item->getPermissions(); - perm.setMaskNext(LLFloaterPerms::getNextOwnerPerms("Wearables")); - perm.setMaskEveryone(LLFloaterPerms::getEveryonePerms("Wearables")); - perm.setMaskGroup(LLFloaterPerms::getGroupPerms("Wearables")); - item->setPermissions(perm); - - item->updateServer(FALSE); - gInventory.updateItem(item); - gInventory.notifyObservers(); } /////////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3 From 99e97bf6aebab653e6faefb4af8c2083af29aca8 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Fri, 14 Mar 2014 14:51:58 -0400 Subject: conform to new policy forbidding trigraphs --- indra/newview/llagentwearables.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llagentwearables.cpp') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index aa97bddec8..9c36e54928 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -238,7 +238,7 @@ LLAgentWearables::sendAgentWearablesUpdateCallback::~sendAgentWearablesUpdateCal * * Would like to pass the agent in here, but we can't safely * count on it being around later. Just use gAgent directly. - * @param cb callback to execute on completion (??? unused ???) + * @param cb callback to execute on completion (? unused ?) * @param type Type for the wearable in the agent * @param wearable The wearable data. * @param todo Bitmask of actions to take on completion. -- cgit v1.2.3 From 487ca1bad37883be0325b564ab557a8f77575388 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 14 May 2014 17:50:59 -0400 Subject: v-r -> s-e merge WIP --- indra/newview/llagentwearables.cpp | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'indra/newview/llagentwearables.cpp') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 6ce6b33790..11666f6c8f 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -770,7 +770,7 @@ void LLAgentWearables::createStandardWearables() // remove this function once the SH-3455 changesets are universally deployed. void LLAgentWearables::sendDummyAgentWearablesUpdate() { - LL_DEBUGS("Avatar") << "sendAgentWearablesUpdate()" << llendl; + LL_DEBUGS("Avatar") << "sendAgentWearablesUpdate()" << LL_ENDL; // Send the AgentIsNowWearing gMessageSystem->newMessageFast(_PREHASH_AgentIsNowWearing); @@ -936,13 +936,12 @@ void LLAgentWearables::removeWearableFinal(const LLWearableType::EType type, boo // Assumes existing wearables are not dirty. void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& items, - const std::vector< LLViewerWearable* >& wearables, - BOOL remove) + const std::vector< LLViewerWearable* >& wearables) { LL_INFOS() << "setWearableOutfit() start" << LL_ENDL; - S32 count = wearables.count(); - llassert(items.count() == count); + S32 count = wearables.size(); + llassert(items.size() == count); // Check for whether outfit already matches the one requested S32 matched = 0, mismatched = 0; @@ -957,7 +956,7 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it const LLWearableType::EType type = new_wearable->getType(); if (type < 0 || type>=LLWearableType::WT_COUNT) { - llwarns << "invalid type " << type << llendl; + LL_WARNS() << "invalid type " << type << LL_ENDL; mismatched++; continue; } @@ -970,7 +969,7 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it { LL_DEBUGS("Avatar") << "mismatch, type " << type << " index " << index << " names " << (curr_wearable ? curr_wearable->getName() : "NONE") << "," - << " names " << (new_wearable ? new_wearable->getName() : "NONE") << llendl; + << " names " << (new_wearable ? new_wearable->getName() : "NONE") << LL_ENDL; mismatched++; continue; } @@ -981,26 +980,26 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it LL_DEBUGS("Avatar") << "mismatch on name or inventory id, names " << curr_wearable->getName() << " vs " << new_item->getName() << " item ids " << curr_wearable->getItemID() << " vs " << new_item->getUUID() - << llendl; + << LL_ENDL; mismatched++; continue; } // If we got here, everything matches. matched++; } - LL_DEBUGS("Avatar") << "matched " << matched << " mismatched " << mismatched << llendl; + LL_DEBUGS("Avatar") << "matched " << matched << " mismatched " << mismatched << LL_ENDL; for (S32 j=0; j Date: Fri, 16 May 2014 10:18:53 -0400 Subject: merge fixes --- indra/newview/llagentwearables.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llagentwearables.cpp') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 11666f6c8f..26626ad894 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -654,7 +654,7 @@ public: /* virtual */ void fire(const LLUUID& inv_item) { LL_INFOS() << "One item created " << inv_item.asString() << LL_ENDL; - LLViewerInventoryItem *item = gInventory.getItem(inv_item); + LLConstPointer item = gInventory.getItem(inv_item); mItemsToLink.push_back(item); updatePendingWearable(inv_item); } -- cgit v1.2.3