summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/llappearancemgr.cpp8
-rwxr-xr-xindra/newview/llappearancemgr.h2
-rwxr-xr-xindra/newview/llvoavatar.cpp20
3 files changed, 27 insertions, 3 deletions
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp
index 04c4220afd..eb31358000 100755
--- a/indra/newview/llappearancemgr.cpp
+++ b/indra/newview/llappearancemgr.cpp
@@ -2623,8 +2623,11 @@ void LLAppearanceMgr::requestServerAppearanceUpdate()
if (!url.empty())
{
LLSD body;
- body["cof_version"] = getCOFVersion();
+ S32 cof_version = getCOFVersion();
+ body["cof_version"] = cof_version;
LLHTTPClient::post(url, body, new RequestAgentUpdateAppearanceResponder);
+ llassert(cof_version >= mLastUpdateRequestCOFVersion);
+ mLastUpdateRequestCOFVersion = cof_version;
}
else
{
@@ -2842,7 +2845,8 @@ LLAppearanceMgr::LLAppearanceMgr():
mAttachmentInvLinkEnabled(false),
mOutfitIsDirty(false),
mOutfitLocked(false),
- mIsInUpdateAppearanceFromCOF(false)
+ mIsInUpdateAppearanceFromCOF(false),
+ mLastUpdateRequestCOFVersion(LLViewerInventoryCategory::VERSION_UNKNOWN)
{
LLOutfitObserver& outfit_observer = LLOutfitObserver::instance();
diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h
index 954820c154..45291419c7 100755
--- a/indra/newview/llappearancemgr.h
+++ b/indra/newview/llappearancemgr.h
@@ -95,6 +95,8 @@ public:
const LLUUID getCOF() const;
S32 getCOFVersion() const;
+ S32 mLastUpdateRequestCOFVersion;
+
// Finds the folder link to the currently worn outfit
const LLViewerInventoryItem *getBaseOutfitLink();
bool getBaseOutfitName(std::string &name);
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 6bcb0c6882..f85b59b8c6 100755
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -7309,9 +7309,27 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys )
// llinfos << "LLVOAvatar::processAvatarAppearance()" << llendl;
// dumpAvatarTEs( "PRE processAvatarAppearance()" );
- unpackTEMessage(mesgsys, _PREHASH_ObjectData, FALSE);
+ LLTEContents tec;
+ parseTEMessage(mesgsys, _PREHASH_ObjectData, -1, FALSE, tec);
// dumpAvatarTEs( "POST processAvatarAppearance()" );
+ // Check for stale update.
+ if (isSelf() && LLAppearanceMgr::instance().useServerTextureBaking())
+ {
+ // Extract COF Version field hacked into local texture id.
+ LLUUID texture_id = ((LLUUID*)tec.image_data)[0];
+ S32 last_update_request_cof_version = LLAppearanceMgr::instance().mLastUpdateRequestCOFVersion;
+ S32 *s_words = (S32*) texture_id.mData;
+ S32 this_update_cof_version = s_words[0];
+ if (this_update_cof_version < last_update_request_cof_version)
+ {
+ llwarns << "Stale appearance update, wanted version " << last_update_request_cof_version
+ << ", got " << this_update_cof_version << llendl;
+ return;
+ }
+ }
+ unpackParsedTEMessage(tec);
+
// prevent the overwriting of valid baked textures with invalid baked textures
for (U8 baked_index = 0; baked_index < mBakedTextureDatas.size(); baked_index++)
{