summaryrefslogtreecommitdiff
path: root/indra/newview/llvoavatar.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <andreylproductengine@lindenlab.com>2016-05-25 02:41:33 +0300
committerAndrey Lihatskiy <andreylproductengine@lindenlab.com>2016-05-25 02:41:33 +0300
commit238c1216c3feb83f91561a3e5a41f070b281097e (patch)
tree9de0969ba29d4d3a500c1296cd131a95436a3e9f /indra/newview/llvoavatar.cpp
parent00eda9e525cbecebc0b1df9bd68958fdbba145ad (diff)
parent9ea13d49b7d0f9df72d23fbaf909b8bfa53b309e (diff)
Merged in rider_linden/viewer-lynx (pull request #18)
MAINT-6403: Correct the local COF version from AIS when it loses sync.
Diffstat (limited to 'indra/newview/llvoavatar.cpp')
-rw-r--r--indra/newview/llvoavatar.cpp72
1 files changed, 33 insertions, 39 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index b9dd43f061..672d153e51 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,43 +7347,34 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys )
return;
}
- S32 this_update_cof_version = contents.mCOFVersion;
- S32 last_update_request_cof_version = mLastUpdateRequestCOFVersion;
+ 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.
- 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;
+ S32 aisCOFVersion(LLAppearanceMgr::instance().getCOFVersion());
+
+ LL_DEBUGS("Avatar") << "handling self appearance message #" << thisAppearanceVersion <<
+ " (highest seen #" << mLastUpdateReceivedCOFVersion <<
+ ") (AISCOF=#" << aisCOFVersion << ")" << LL_ENDL;
- if (largestSelfCOFSeen > this_update_cof_version)
+ if (mLastUpdateReceivedCOFVersion >= thisAppearanceVersion)
{
- LL_WARNS("Avatar") << "Already processed appearance for COF version " <<
- largestSelfCOFSeen << ", discarding appearance with COF " << this_update_cof_version << LL_ENDL;
+ 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;
}
- 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;
- }
+ }
// SUNSHINE CLEANUP - is this case OK now?
S32 num_params = contents.mParamWeights.size();
@@ -7399,13 +7389,17 @@ 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:
+ // 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;
+ }
if (applyParsedTEMessage(contents.mTEContents) > 0 && isChanged(TEXTURE))
{
@@ -7528,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())