diff options
Diffstat (limited to 'indra/newview')
| -rwxr-xr-x | indra/newview/llappearancemgr.cpp | 31 | ||||
| -rwxr-xr-x | indra/newview/llappearancemgr.h | 3 | ||||
| -rwxr-xr-x | indra/newview/llvoavatar.cpp | 22 | 
3 files changed, 49 insertions, 7 deletions
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 480a8e0d73..e27a21f7fd 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -925,6 +925,18 @@ const LLUUID LLAppearanceMgr::getCOF() const  	return gInventory.findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT);  } +S32 LLAppearanceMgr::getCOFVersion() const +{ +	LLViewerInventoryCategory *cof = gInventory.getCategory(getCOF()); +	if (cof) +	{ +		return cof->getVersion(); +	} +	else +	{ +		return LLViewerInventoryCategory::VERSION_UNKNOWN; +	} +}  const LLViewerInventoryItem* LLAppearanceMgr::getBaseOutfitLink()  { @@ -2607,16 +2619,22 @@ public:  void LLAppearanceMgr::requestServerAppearanceUpdate()  { -	std::string url = gAgent.getRegion()->getCapability("UpdateAvatarAppearance");	 -	if (!url.empty()) +	if (!gAgent.getRegion())  	{ -		LLSD body; -		LLHTTPClient::post(url, body, new RequestAgentUpdateAppearanceResponder); +		llwarns << "Region not set, cannot request server appearance update" << llendl;  	} -	else +	std::string url = gAgent.getRegion()->getCapability("UpdateAvatarAppearance");	 +	if (url.empty())  	{  		llwarns << "no cap for UpdateAvatarAppearance" << llendl;  	} +	 +	LLSD body; +	S32 cof_version = getCOFVersion(); +	body["cof_version"] = cof_version; +	LLHTTPClient::post(url, body, new RequestAgentUpdateAppearanceResponder); +	llassert(cof_version >= mLastUpdateRequestCOFVersion); +	mLastUpdateRequestCOFVersion = cof_version;  }  class LLShowCreatedOutfit: public LLInventoryCallback @@ -2829,7 +2847,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 46457f1dce..45291419c7 100755 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -93,6 +93,9 @@ public:  	// Find the Current Outfit folder.  	const LLUUID getCOF() const; +	S32 getCOFVersion() const; + +	S32 mLastUpdateRequestCOFVersion;  	// Finds the folder link to the currently worn outfit  	const LLViewerInventoryItem *getBaseOutfitLink(); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 9c5998b976..236cc1b089 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -7318,9 +7318,29 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys )  //	llinfos << "LLVOAvatar::processAvatarAppearance()" << llendl;  //	dumpAvatarTEs( "PRE  processAvatarAppearance()" ); -	unpackTEMessage(mesgsys, _PREHASH_ObjectData, FALSE); +	LLTEContents tec; +	parseTEMessage(mesgsys, _PREHASH_ObjectData, -1, 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 > 0) &&  +			(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; +		} +		((LLUUID*)tec.image_data)[0].setNull(); +	} +	applyParsedTEMessage(tec); +  	// prevent the overwriting of valid baked textures with invalid baked textures  	for (U8 baked_index = 0; baked_index < mBakedTextureDatas.size(); baked_index++)  	{  | 
