From 0517495bf6caedc08fc7ae45cefc6a1a2cb8fe62 Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Tue, 10 May 2011 13:39:41 -0700 Subject: Now that the cache persists, start background fetching on login. We begin with the Animations folder uuid sent in the skeleton to hopefully make the AO work as soon as possible --- linden/indra/newview/llinventorymodel.cpp | 28 ++++++++++++++++++---------- linden/indra/newview/llinventorymodel.h | 5 +++++ linden/indra/newview/llstartup.cpp | 12 ++++++++++++ 3 files changed, 35 insertions(+), 10 deletions(-) diff --git a/linden/indra/newview/llinventorymodel.cpp b/linden/indra/newview/llinventorymodel.cpp index 9794dfa..75c5162 100644 --- a/linden/indra/newview/llinventorymodel.cpp +++ b/linden/indra/newview/llinventorymodel.cpp @@ -192,6 +192,7 @@ LLInventoryModel::LLInventoryModel() : mCategoryLock(), mItemLock(), mLastItem(NULL), + mAnimationsFolderUUID(LLUUID::null), mParentChildCategoryTree(), mParentChildItemTree(), mObservers(), @@ -1945,16 +1946,6 @@ bool LLInventoryModel::loadSkeleton(const LLInventoryModel::options_t& options, clean_cat = false; - skel = (*it).find("name"); - if (skel == no_response) - { - clean_cat = true; - } - else - { - cat->rename(std::string((*skel).second)); - } - skel = (*it).find("folder_id"); if (skel == no_response) { @@ -1986,6 +1977,16 @@ bool LLInventoryModel::loadSkeleton(const LLInventoryModel::options_t& options, cat->setParent(id); } + skel = (*it).find("name"); + if (skel == no_response) + { + clean_cat = true; + } + else + { + cat->rename(std::string((*skel).second)); + } + skel = (*it).find("type_default"); if (skel == no_response) { @@ -1995,6 +1996,13 @@ bool LLInventoryModel::loadSkeleton(const LLInventoryModel::options_t& options, { S32 t = atoi((*skel).second.c_str()); preferred_type = (LLAssetType::EType)t; + + // This UUID is different for each avatar and "Animations" is hardcoded into the skeleton -- MC + if (LLAssetType::AT_ANIMATION == preferred_type && cat->getName() == "Animations") + { + //llinfos << "Animations folder uuid from skeleton: " << cat->getUUID() << llendl; + mAnimationsFolderUUID = id; + } } cat->setPreferredType(preferred_type); diff --git a/linden/indra/newview/llinventorymodel.h b/linden/indra/newview/llinventorymodel.h index fee509b..7222c60 100644 --- a/linden/indra/newview/llinventorymodel.h +++ b/linden/indra/newview/llinventorymodel.h @@ -452,6 +452,9 @@ protected: // cache recent lookups mutable LLPointer mLastItem; + // UUID of the 'Animations' folder in 'My Inventory' + LLUUID mAnimationsFolderUUID; + // This last set of indices is used to map parents to children. typedef std::map parent_cat_map_t; typedef std::map parent_item_map_t; @@ -474,6 +477,8 @@ protected: bool mIsAgentInvUsable; public: + // Returns the UUID of the 'Animations' folder in 'My Inventory' sent from the server at startup + LLUUID getAnimationsFolderUUID() const { return mAnimationsFolderUUID; } // *NOTE: DEBUG functionality void dumpInventory(); static bool isBulkFetchProcessingComplete(); diff --git a/linden/indra/newview/llstartup.cpp b/linden/indra/newview/llstartup.cpp index 083a082..a2ed9fc 100644 --- a/linden/indra/newview/llstartup.cpp +++ b/linden/indra/newview/llstartup.cpp @@ -2450,6 +2450,18 @@ bool idle_startup() } } + // start background fetching for animations here in case the cache is empty. + // We do this to improve AO support (that's Animatoni Overrider, not LL's + // silly "AO" acronym -- MC + if (gInventory.getAnimationsFolderUUID() != LLUUID::null) + { + gInventory.startBackgroundFetch(gInventory.getAnimationsFolderUUID()); + } + else + { + gInventory.startBackgroundFetch(); + } + options.clear(); if(LLUserAuth::getInstance()->getOptions("buddy-list", options)) { -- cgit v1.1