summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorDon Kjer <don@lindenlab.com>2012-08-02 22:54:01 +0000
committerDon Kjer <don@lindenlab.com>2012-08-02 22:54:01 +0000
commitdfce4c451c0b12f5836db1af0c26bffc316837fa (patch)
tree5a4ca1381913b91dc6b3fdf2f658092e8afb3ffb /indra
parent6ae4802e6d3ed7aa67c4946c434850de3be5ffe3 (diff)
Added AppearanceData block to AvatarAppearance message
Diffstat (limited to 'indra')
-rw-r--r--indra/llmessage/message_prehash.cpp3
-rw-r--r--indra/llmessage/message_prehash.h3
-rwxr-xr-xindra/newview/llvoavatar.cpp38
3 files changed, 26 insertions, 18 deletions
diff --git a/indra/llmessage/message_prehash.cpp b/indra/llmessage/message_prehash.cpp
index d7658862da..c3fa7ff048 100644
--- a/indra/llmessage/message_prehash.cpp
+++ b/indra/llmessage/message_prehash.cpp
@@ -1376,3 +1376,6 @@ char const* const _PREHASH_ProductSKU = LLMessageStringTable::getInstance()->get
char const* const _PREHASH_SeeAVs = LLMessageStringTable::getInstance()->getString("SeeAVs");
char const* const _PREHASH_AnyAVSounds = LLMessageStringTable::getInstance()->getString("AnyAVSounds");
char const* const _PREHASH_GroupAVSounds = LLMessageStringTable::getInstance()->getString("GroupAVSounds");
+char const* const _PREHASH_AppearanceData = LLMessageStringTable::getInstance()->getString("AppearanceData");
+char const* const _PREHASH_AppearanceVersion = LLMessageStringTable::getInstance()->getString("AppearanceVersion");
+char const* const _PREHASH_CofVersion = LLMessageStringTable::getInstance()->getString("CofVersion");
diff --git a/indra/llmessage/message_prehash.h b/indra/llmessage/message_prehash.h
index da2b613f53..9214682003 100644
--- a/indra/llmessage/message_prehash.h
+++ b/indra/llmessage/message_prehash.h
@@ -1376,4 +1376,7 @@ extern char const* const _PREHASH_ProductSKU;
extern char const* const _PREHASH_SeeAVs;
extern char const* const _PREHASH_AnyAVSounds;
extern char const* const _PREHASH_GroupAVSounds;
+extern char const* const _PREHASH_AppearanceData;
+extern char const* const _PREHASH_AppearanceVersion;
+extern char const* const _PREHASH_CofVersion;
#endif
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index b7bb4e6b47..0d85666d88 100755
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -192,8 +192,6 @@ const S32 MAX_BUBBLE_CHAT_UTTERANCES = 12;
const F32 CHAT_FADE_TIME = 8.0;
const F32 BUBBLE_CHAT_TIME = CHAT_FADE_TIME * 3.f;
-const S32 SERVER_GENERATED_APPEARANCE = 359949045;
-
const LLColor4 DUMMY_COLOR = LLColor4(0.5,0.5,0.5,1.0);
enum ERenderName
@@ -7355,12 +7353,21 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys )
parseTEMessage(mesgsys, _PREHASH_ObjectData, -1, tec);
// dumpAvatarTEs( "POST processAvatarAppearance()" );
- // Extract COF Version field hacked into local texture id.
- LLUUID flags_id = ((LLUUID*)tec.image_data)[0];
- S32 this_update_cof_version = (flags_id.mData[0] << 24) + (flags_id.mData[1] << 16) +(flags_id.mData[2] << 8) +flags_id.mData[3];
- S32 message_type = (flags_id.mData[4] << 24) + (flags_id.mData[5] << 16) +(flags_id.mData[6] << 8) +flags_id.mData[7];
+ U8 appearance_version = 0;
+ S32 this_update_cof_version = LLViewerInventoryCategory::VERSION_UNKNOWN;
+ S32 last_update_request_cof_version = LLAppearanceMgr::instance().mLastUpdateRequestCOFVersion;
+ // For future use:
+ //U32 appearance_flags = 0;
+
+ if (mesgsys->has(_PREHASH_AppearanceData))
+ {
+ mesgsys->getU8Fast(_PREHASH_AppearanceData, _PREHASH_AppearanceVersion, appearance_version, 0);
+ mesgsys->getS32Fast(_PREHASH_AppearanceData, _PREHASH_CofVersion, this_update_cof_version, 0);
+ // For future use:
+ //mesgsys->getU32Fast(_PREHASH_AppearanceData, _PREHASH_Flags, appearance_flags, 0);
+ }
- if (message_type == SERVER_GENERATED_APPEARANCE)
+ if (appearance_version > 0)
{
mUseServerBakes = true;
}
@@ -7369,19 +7376,14 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys )
mUseServerBakes = false;
}
- S32 last_update_request_cof_version = LLAppearanceMgr::instance().mLastUpdateRequestCOFVersion;
-
// Check for stale update.
- if (isSelf() && mUseServerBakes)
+ if (mUseServerBakes && isSelf()
+ && this_update_cof_version >= LLViewerInventoryCategory::VERSION_INITIAL
+ && this_update_cof_version < last_update_request_cof_version)
{
- 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();
+ llwarns << "Stale appearance update, wanted version " << last_update_request_cof_version
+ << ", got " << this_update_cof_version << llendl;
+ return;
}
applyParsedTEMessage(tec);