From 213bcf6bb30f9e2d4eb8bb6cbd200c94bae29b6f Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Thu, 19 May 2016 11:47:23 -0700 Subject: MAIN-6403: If a version mismatch occurs when requesting the COF, request a new appearance update from the simhost to update the viewer COF version. --- indra/newview/llappearancemgr.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index cc676550ab..6c510f13c8 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -60,6 +60,8 @@ #include "llcoros.h" #include "lleventcoro.h" +#include "llavatarpropertiesprocessor.h" + #if LL_MSVC // disable boost::lexical_cast warning #pragma warning (disable:4702) @@ -68,7 +70,7 @@ namespace { const S32 BAKE_RETRY_MAX_COUNT = 5; - const F32 BAKE_RETRY_TIMEOUT = 2.0F; + const F32 BAKE_RETRY_TIMEOUT = 4.0F; } // *TODO$: LLInventoryCallback should be deprecated to conform to the new boost::bind/coroutine model. @@ -3493,10 +3495,15 @@ void LLAppearanceMgr::serverAppearanceUpdateCoro() // on multiple machines. if (result.has("expected")) { - S32 expectedCofVersion = result["expected"].asInteger(); LL_WARNS("Avatar") << "Server expected " << expectedCofVersion << " as COF version" << LL_ENDL; + // Force an update texture request for ourself. The message will return + // through the UDP and be handled in LLVOAvatar::processAvatarAppearance + // this should ensure that we receive a new canonical COF from the sim + // host. Hopefully it will return before the timeout. + LLAvatarPropertiesProcessor::getInstance()->sendAvatarTexturesRequest(gAgent.getID()); + bRetry = true; // Wait for a 1/2 second before trying again. Just to keep from asking too quickly. if (++retryCount > BAKE_RETRY_MAX_COUNT) -- cgit v1.2.3 From c7413e51b6286a003d6629108d2757b5ff973c2b Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Mon, 23 May 2016 14:40:43 -0700 Subject: MAINT-6403: in the case of a version mismatch between the viewer's local accounting and the AIS reported. Override with the AIS version. simplify the appearance update code to account for new versioning. Fix spelling of descendant --- indra/newview/llaisapi.cpp | 18 ++++++++---- indra/newview/llappearancemgr.h | 2 ++ indra/newview/llavatarrendernotifier.cpp | 7 +++-- indra/newview/llvoavatar.cpp | 47 +++++++++++++++++++++++++++----- 4 files changed, 58 insertions(+), 16 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp index 3e3d5c7456..98a2bb436c 100644 --- a/indra/newview/llaisapi.cpp +++ b/indra/newview/llaisapi.cpp @@ -838,11 +838,11 @@ void AISUpdate::parseEmbeddedCategories(const LLSD& categories) void AISUpdate::doUpdate() { - // Do version/descendent accounting. + // Do version/descendant accounting. for (std::map::const_iterator catit = mCatDescendentDeltas.begin(); catit != mCatDescendentDeltas.end(); ++catit) { - LL_DEBUGS("Inventory") << "descendent accounting for " << catit->first << LL_ENDL; + LL_DEBUGS("Inventory") << "descendant accounting for " << catit->first << LL_ENDL; const LLUUID cat_id(catit->first); // Don't account for update if we just created this category. @@ -859,13 +859,13 @@ void AISUpdate::doUpdate() continue; } - // If we have a known descendent count, set that now. + // If we have a known descendant count, set that now. LLViewerInventoryCategory* cat = gInventory.getCategory(cat_id); if (cat) { S32 descendent_delta = catit->second; S32 old_count = cat->getDescendentCount(); - LL_DEBUGS("Inventory") << "Updating descendent count for " + LL_DEBUGS("Inventory") << "Updating descendant count for " << cat->getName() << " " << cat_id << " with delta " << descendent_delta << " from " << old_count << " to " << (old_count+descendent_delta) << LL_ENDL; @@ -896,7 +896,7 @@ void AISUpdate::doUpdate() LLUUID category_id(update_it->first); LLPointer new_category = update_it->second; // Since this is a copy of the category *before* the accounting update, above, - // we need to transfer back the updated version/descendent count. + // we need to transfer back the updated version/descendant count. LLViewerInventoryCategory* curr_cat = gInventory.getCategory(new_category->getUUID()); if (!curr_cat) { @@ -961,7 +961,13 @@ void AISUpdate::doUpdate() { LL_WARNS() << "Possible version mismatch for category " << cat->getName() << ", viewer version " << cat->getVersion() - << " server version " << version << LL_ENDL; + << " AIS version " << version << " !!!Adjusting local version!!!" << LL_ENDL; + + // the AIS version should be considered the true version. Adjust + // our local category model to reflect this version number. Otherwise + // it becomes possible to get stuck with the viewer being out of + // sync with the inventory system. + cat->setVersion(version); } } diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index bf181cb4ad..f401df0949 100644 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -36,6 +36,8 @@ #include "llviewerinventory.h" #include "llcorehttputil.h" +#define APPEARANCEBAKE_AS_IN_AIS_QUEUE 1 + class LLWearableHoldingPattern; class LLInventoryCallback; class LLOutfitUnLockTimer; diff --git a/indra/newview/llavatarrendernotifier.cpp b/indra/newview/llavatarrendernotifier.cpp index a13e142e16..e2ffdec874 100644 --- a/indra/newview/llavatarrendernotifier.cpp +++ b/indra/newview/llavatarrendernotifier.cpp @@ -63,7 +63,7 @@ mLatestAgentComplexity(0), mLatestOverLimitPct(0.0f), mShowOverLimitAgents(false), mNotifyOutfitLoading(false), -mLastCofVersion(-1), +mLastCofVersion(LLViewerInventoryCategory::VERSION_UNKNOWN), mLastOutfitRezStatus(-1), mLastSkeletonSerialNum(-1) { @@ -207,8 +207,9 @@ void LLAvatarRenderNotifier::updateNotificationState() mLastSkeletonSerialNum = gAgentAvatarp->mLastSkeletonSerialNum; } else if (mLastCofVersion >= 0 - && (mLastCofVersion != gAgentAvatarp->mLastUpdateRequestCOFVersion - || mLastSkeletonSerialNum != gAgentAvatarp->mLastSkeletonSerialNum)) +// && (mLastCofVersion != gAgentAvatarp->mLastUpdateRequestCOFVersion // RIDER: Check this! + && (mLastCofVersion != LLAppearanceMgr::instance().getCOFVersion() + || mLastSkeletonSerialNum != gAgentAvatarp->mLastSkeletonSerialNum)) { // version mismatch in comparison to previous outfit - outfit changed mNotifyOutfitLoading = true; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index b9dd43f061..2a91d47868 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -7313,7 +7313,6 @@ bool resolve_appearance_version(const LLAppearanceMessageContents& contents, S32 //----------------------------------------------------------------------------- void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) { - static S32 largestSelfCOFSeen(LLViewerInventoryCategory::VERSION_UNKNOWN); LL_DEBUGS("Avatar") << "starts" << LL_ENDL; bool enable_verbose_dumps = gSavedSettings.getBOOL("DebugAvatarAppearanceMessage"); @@ -7348,6 +7347,36 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) return; } + S32 thisAppearanceVersion(contents.mCOFVersion); + if (isSelf()) + { // In the past this was considered to be the canonical COF version, + // that is no longer the case. The canonical version is maintained + // by the AIS code and should match the COF version there. Even so, + // we must prevent rolling this one backwards backwards or processing + // stale versions. + + S32 aisCOFVersion(LLAppearanceMgr::instance().getCOFVersion()); + + LL_INFOS("Avatar") << "handling self appearance message #" << thisAppearanceVersion << + " (highest seen #" << mLastUpdateReceivedCOFVersion << + ") (AISCOF=#" << aisCOFVersion << ")" << LL_ENDL; + + if (mLastUpdateReceivedCOFVersion >= thisAppearanceVersion) + { + LL_WARNS("Avatar") << "Stale appearance received #" << thisAppearanceVersion << + " attempt to roll back from #" << mLastUpdateReceivedCOFVersion << + "... dropping." << LL_ENDL; + return; + } + if (isEditingAppearance()) + { + LL_DEBUGS("Avatar") << "Editing appearance. Dropping appearance update." << LL_ENDL; + return; + } + + } + +#if 0 S32 this_update_cof_version = contents.mCOFVersion; S32 last_update_request_cof_version = mLastUpdateRequestCOFVersion; @@ -7385,6 +7414,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) LL_DEBUGS("Avatar") << "ignoring appearance message while in appearance edit" << LL_ENDL; return; } +#endif // SUNSHINE CLEANUP - is this case OK now? S32 num_params = contents.mParamWeights.size(); @@ -7399,13 +7429,16 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) } // No backsies zone - if we get here, the message should be valid and usable, will be processed. - LL_INFOS("Avatar") << "Processing appearance message version " << this_update_cof_version << LL_ENDL; + LL_INFOS("Avatar") << "Processing appearance message version " << thisAppearanceVersion << LL_ENDL; - // Note: - // RequestAgentUpdateAppearanceResponder::onRequestRequested() - // assumes that cof version is only updated with server-bake - // appearance messages. - mLastUpdateReceivedCOFVersion = this_update_cof_version; + if (isSelf()) + { + // Note: + // RequestAgentUpdateAppearanceResponder::onRequestRequested() + // assumes that cof version is only updated with server-bake + // appearance messages. + mLastUpdateReceivedCOFVersion = thisAppearanceVersion; + } if (applyParsedTEMessage(contents.mTEContents) > 0 && isChanged(TEXTURE)) { -- cgit v1.2.3 From 26b1c020c8a8d240144dadae1285c14213cb1232 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Tue, 24 May 2016 13:03:36 -0700 Subject: MAINT-6403: Updated a couple comments and dropped a couple warning levels back down to DEBUG. --- indra/newview/llaisapi.cpp | 5 +++- indra/newview/llappearancemgr.cpp | 17 +---------- indra/newview/llappearancemgr.h | 6 ---- indra/newview/llavatarrendernotifier.cpp | 1 - indra/newview/llvoavatar.cpp | 51 ++++---------------------------- 5 files changed, 11 insertions(+), 69 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp index 98a2bb436c..648212177b 100644 --- a/indra/newview/llaisapi.cpp +++ b/indra/newview/llaisapi.cpp @@ -966,7 +966,10 @@ void AISUpdate::doUpdate() // the AIS version should be considered the true version. Adjust // our local category model to reflect this version number. Otherwise // it becomes possible to get stuck with the viewer being out of - // sync with the inventory system. + // sync with the inventory system. Under normal circumstances + // inventory COF is maintained on the viewer through calls to + // LLInventoryModel::accountForUpdate when a changing operation + // is performed. This occasionally gets out of sync however. cat->setVersion(version); } } diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 6c510f13c8..a1d9786321 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -70,7 +70,7 @@ namespace { const S32 BAKE_RETRY_MAX_COUNT = 5; - const F32 BAKE_RETRY_TIMEOUT = 4.0F; + const F32 BAKE_RETRY_TIMEOUT = 2.0F; } // *TODO$: LLInventoryCallback should be deprecated to conform to the new boost::bind/coroutine model. @@ -3361,15 +3361,9 @@ void LLAppearanceMgr::requestServerAppearanceUpdate() { if (!mOutstandingAppearanceBakeRequest) { -#ifdef APPEARANCEBAKE_AS_IN_AIS_QUEUE mRerequestAppearanceBake = false; LLCoprocedureManager::CoProcedure_t proc = boost::bind(&LLAppearanceMgr::serverAppearanceUpdateCoro, this, _1); LLCoprocedureManager::instance().enqueueCoprocedure("AIS", "LLAppearanceMgr::serverAppearanceUpdateCoro", proc); -#else - LLCoros::instance().launch("serverAppearanceUpdateCoro", - boost::bind(&LLAppearanceMgr::serverAppearanceUpdateCoro, this)); - -#endif } else { @@ -3377,17 +3371,8 @@ void LLAppearanceMgr::requestServerAppearanceUpdate() } } -#ifdef APPEARANCEBAKE_AS_IN_AIS_QUEUE void LLAppearanceMgr::serverAppearanceUpdateCoro(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t &httpAdapter) -#else -void LLAppearanceMgr::serverAppearanceUpdateCoro() -#endif { -#ifndef APPEARANCEBAKE_AS_IN_AIS_QUEUE - LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter( - new LLCoreHttpUtil::HttpCoroutineAdapter("serverAppearanceUpdateCoro", LLCore::HttpRequest::DEFAULT_POLICY_ID)); -#endif - mRerequestAppearanceBake = false; if (!gAgent.getRegion()) { diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index f401df0949..7069da7352 100644 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -36,8 +36,6 @@ #include "llviewerinventory.h" #include "llcorehttputil.h" -#define APPEARANCEBAKE_AS_IN_AIS_QUEUE 1 - class LLWearableHoldingPattern; class LLInventoryCallback; class LLOutfitUnLockTimer; @@ -230,11 +228,7 @@ public: private: -#ifdef APPEARANCEBAKE_AS_IN_AIS_QUEUE void serverAppearanceUpdateCoro(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t &httpAdapter); -#else - void serverAppearanceUpdateCoro(); -#endif static void debugAppearanceUpdateCOF(const LLSD& content); diff --git a/indra/newview/llavatarrendernotifier.cpp b/indra/newview/llavatarrendernotifier.cpp index e2ffdec874..24934fdb73 100644 --- a/indra/newview/llavatarrendernotifier.cpp +++ b/indra/newview/llavatarrendernotifier.cpp @@ -207,7 +207,6 @@ void LLAvatarRenderNotifier::updateNotificationState() mLastSkeletonSerialNum = gAgentAvatarp->mLastSkeletonSerialNum; } else if (mLastCofVersion >= 0 -// && (mLastCofVersion != gAgentAvatarp->mLastUpdateRequestCOFVersion // RIDER: Check this! && (mLastCofVersion != LLAppearanceMgr::instance().getCOFVersion() || mLastSkeletonSerialNum != gAgentAvatarp->mLastSkeletonSerialNum)) { diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 2a91d47868..672d153e51 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -7357,7 +7357,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) S32 aisCOFVersion(LLAppearanceMgr::instance().getCOFVersion()); - LL_INFOS("Avatar") << "handling self appearance message #" << thisAppearanceVersion << + LL_DEBUGS("Avatar") << "handling self appearance message #" << thisAppearanceVersion << " (highest seen #" << mLastUpdateReceivedCOFVersion << ") (AISCOF=#" << aisCOFVersion << ")" << LL_ENDL; @@ -7376,46 +7376,6 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) } -#if 0 - S32 this_update_cof_version = contents.mCOFVersion; - S32 last_update_request_cof_version = mLastUpdateRequestCOFVersion; - - if( isSelf() ) - { - LL_DEBUGS("Avatar") << "this_update_cof_version " << this_update_cof_version - << " last_update_request_cof_version " << last_update_request_cof_version - << " my_cof_version " << LLAppearanceMgr::instance().getCOFVersion() << LL_ENDL; - - if (largestSelfCOFSeen > this_update_cof_version) - { - LL_WARNS("Avatar") << "Already processed appearance for COF version " << - largestSelfCOFSeen << ", discarding appearance with COF " << this_update_cof_version << LL_ENDL; - return; - } - largestSelfCOFSeen = this_update_cof_version; - - } - else - { - LL_DEBUGS("Avatar") << "appearance message received" << LL_ENDL; - } - - // Check for stale update. - if (isSelf() - && (this_update_cof_version < last_update_request_cof_version)) - { - LL_WARNS() << "Stale appearance update, wanted version " << last_update_request_cof_version - << ", got " << this_update_cof_version << LL_ENDL; - return; - } - - if (isSelf() && isEditingAppearance()) - { - LL_DEBUGS("Avatar") << "ignoring appearance message while in appearance edit" << LL_ENDL; - return; - } -#endif - // SUNSHINE CLEANUP - is this case OK now? S32 num_params = contents.mParamWeights.size(); if (num_params <= 1) @@ -7434,9 +7394,10 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) if (isSelf()) { // Note: - // RequestAgentUpdateAppearanceResponder::onRequestRequested() - // assumes that cof version is only updated with server-bake - // appearance messages. + // locally the COF is maintained via LLInventoryModel::accountForUpdate + // which is called from various places. This should match the simhost's + // idea of what the COF version is. AIS however maintains its own version + // of the COF that should be considered canonical. mLastUpdateReceivedCOFVersion = thisAppearanceVersion; } @@ -7561,7 +7522,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) // Got an update for some other avatar // Ignore updates for self, because we have a more authoritative value in the preferences. setHoverOffset(contents.mHoverOffset); - LL_INFOS("Avatar") << avString() << "setting hover to " << contents.mHoverOffset[2] << LL_ENDL; + LL_DEBUGS("Avatar") << avString() << "setting hover to " << contents.mHoverOffset[2] << LL_ENDL; } if (!contents.mHoverOffsetWasSet && !isSelf()) -- cgit v1.2.3