From 2f638300cd7e2c3ae675125ade037205403b5c54 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 30 Jan 2013 10:14:16 -0500 Subject: SH-3780 WIP - more checking on appearance param values --- indra/newview/llvoavatar.cpp | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 90887b5861..8f5d2a6aad 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -6703,26 +6703,36 @@ void LLVOAvatar::parseAppearanceMessage(LLMessageSystem* mesgsys, LLAppearanceMe } } - if (contents.mAppearanceVersion < 0) // not set explicitly, try to get from visual param. + LLVisualParam* appearance_version_param = getVisualParam(11000); + S32 param_appearance_version = -1; + if (appearance_version_param) { - LLVisualParam* appearance_version_param = getVisualParam(11000); - if (appearance_version_param) + std::vector::iterator it = std::find(contents.mParams.begin(), contents.mParams.end(),appearance_version_param); + if (it != contents.mParams.end()) { - std::vector::iterator it = std::find(contents.mParams.begin(), contents.mParams.end(),appearance_version_param); - if (it != contents.mParams.end()) - { - S32 index = it - contents.mParams.begin(); - llinfos << "index: " << index << llendl; - S32 appearance_version = llround(contents.mParamWeights[index]); - contents.mAppearanceVersion = appearance_version; - llinfos << "appversion set by appearance_version param: " << contents.mAppearanceVersion << llendl; - } + S32 index = it - contents.mParams.begin(); + llinfos << "index: " << index << llendl; + param_appearance_version = llround(contents.mParamWeights[index]); + LL_DEBUGS("Avatar") << "appversion req by appearance_version param: " << contents.mAppearanceVersion << llendl; } } + if ((contents.mAppearanceVersion) >= 0 && + (param_appearance_version >= 0) && + (contents.mAppearanceVersion != param_appearance_version)) + { + llwarns << "inconsistent appearance_version settings - field: " << + contents.mAppearanceVersion << ", param: " << param_appearance_version << llendl; + } + if (contents.mAppearanceVersion < 0 && + param_appearance_version >= 0) // not set explicitly, try to get from visual param. + { + contents.mAppearanceVersion = param_appearance_version; + LL_DEBUGS("Avatar") << "appversion set by appearance_version param: " << contents.mAppearanceVersion << llendl; + } if (contents.mAppearanceVersion < 0) // still not set, go with 0. { contents.mAppearanceVersion = 0; - llinfos << "appversion set by default: " << contents.mAppearanceVersion << llendl; + LL_DEBUGS("Avatar") << "appversion set by default: " << contents.mAppearanceVersion << llendl; } } -- cgit v1.2.3 From 3a7e3eacb86989c936cd6960cfa7434f3b8232fc Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 30 Jan 2013 13:56:05 -0500 Subject: SH-3800 WIP - flag mismatched expectations for baked texture origins --- indra/newview/llviewertexturelist.cpp | 34 ++++++++++++++++++++++++++++++++-- indra/newview/llvoavatar.cpp | 4 ++-- 2 files changed, 34 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index a65a90b9ab..4d79af5acc 100755 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -374,7 +374,21 @@ LLViewerFetchedTexture* LLViewerTextureList::getImageFromUrl(const std::string& } LLPointer imagep = findImage(new_id); - + + if (!imagep.isNull()) + { + LLViewerFetchedTexture *texture = imagep.get(); + if (texture->getUrl().empty()) + { + llwarns << "Requested texture " << new_id << " already exists but does not have a URL" << llendl; + } + else if (texture->getUrl() != url) + { + llwarns << "Requested texture " << new_id << " already exists with a different url, requested: " + << url << " current: " << texture->getUrl() << llendl; + } + + } if (imagep.isNull()) { switch(texture_type) @@ -436,7 +450,23 @@ LLViewerFetchedTexture* LLViewerTextureList::getImage(const LLUUID &image_id, } LLPointer imagep = findImage(image_id); - + if (!imagep.isNull()) + { + LLViewerFetchedTexture *texture = imagep.get(); + if (request_from_host.isOk() && + !texture->getTargetHost().isOk()) + { + llwarns << "Requested texture " << image_id << " already exists but does not have a host" << llendl; + } + else if (request_from_host.isOk() && + texture->getTargetHost().isOk() && + request_from_host != texture->getTargetHost()) + { + llwarns << "Requested texture " << image_id << " already exists with a different target host, requested: " + << request_from_host << " current: " << texture->getTargetHost() << llendl; + } + + } if (imagep.isNull()) { imagep = createImage(image_id, usemipmaps, boost_priority, texture_type, internal_format, primary_format, request_from_host) ; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 8f5d2a6aad..c512837632 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1796,8 +1796,8 @@ S32 LLVOAvatar::setTETexture(const U8 te, const LLUUID& uuid) } else { - llinfos << "get texture from other " << uuid << llendl; - return setTETextureCore(te, uuid, LLHost::invalid); + llinfos << "ignoring texture in non-baked slot " << uuid << " - will use null " << LLUUID::null << llendl; + return setTETextureCore(te, LLUUID::null, LLHost::invalid); } } -- cgit v1.2.3 From c24c974cc6a7df3a1df7f7a24ad52275430b18dd Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 30 Jan 2013 18:23:31 -0500 Subject: SH-3800 WIP - logic to detect baked textures being sought in the wrong place, avoid querying textures for which we have no authoritative data where they live --- indra/newview/llviewerobject.cpp | 27 ++++-------------- indra/newview/llviewerobject.h | 3 +- indra/newview/llvoavatar.cpp | 59 +++++++++++++++++++++++++--------------- indra/newview/llvoavatar.h | 1 + indra/newview/llvoavatarself.cpp | 10 +++++++ 5 files changed, 55 insertions(+), 45 deletions(-) mode change 100644 => 100755 indra/newview/llviewerobject.cpp mode change 100644 => 100755 indra/newview/llviewerobject.h mode change 100644 => 100755 indra/newview/llvoavatarself.cpp (limited to 'indra/newview') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp old mode 100644 new mode 100755 index 15560be9ba..c4b370a4b4 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -4034,32 +4034,15 @@ void LLViewerObject::setTEImage(const U8 te, LLViewerTexture *imagep) } } - -S32 LLViewerObject::setTETextureCore(const U8 te, const LLUUID& uuid, const std::string &url ) -{ - S32 retval = 0; - if (uuid != getTE(te)->getID() || - uuid == LLUUID::null) - { - retval = LLPrimitive::setTETexture(te, uuid); - mTEImages[te] = LLViewerTextureManager::getFetchedTextureFromUrl (url, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE, 0, 0, uuid); - setChanged(TEXTURE); - if (mDrawable.notNull()) - { - gPipeline.markTextured(mDrawable); - } - } - return retval; -} - -S32 LLViewerObject::setTETextureCore(const U8 te, const LLUUID& uuid, LLHost host) +S32 LLViewerObject::setTETextureCore(const U8 te, LLViewerTexture *image) { + const LLUUID& uuid = image->getID(); S32 retval = 0; if (uuid != getTE(te)->getID() || uuid == LLUUID::null) { retval = LLPrimitive::setTETexture(te, uuid); - mTEImages[te] = LLViewerTextureManager::getFetchedTexture(uuid, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE, 0, 0, host); + mTEImages[te] = image; setChanged(TEXTURE); if (mDrawable.notNull()) { @@ -4082,7 +4065,9 @@ void LLViewerObject::changeTEImage(S32 index, LLViewerTexture* new_image) S32 LLViewerObject::setTETexture(const U8 te, const LLUUID& uuid) { // Invalid host == get from the agent's sim - return setTETextureCore(te, uuid, LLHost::invalid); + LLViewerFetchedTexture *image = LLViewerTextureManager::getFetchedTexture( + uuid, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE, 0, 0, LLHost::invalid); + return setTETextureCore(te,image); } diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h old mode 100644 new mode 100755 index 889025962c..728d279c39 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -301,8 +301,7 @@ public: /*virtual*/ void setNumTEs(const U8 num_tes); /*virtual*/ void setTE(const U8 te, const LLTextureEntry &texture_entry); /*virtual*/ S32 setTETexture(const U8 te, const LLUUID &uuid); - S32 setTETextureCore(const U8 te, const LLUUID& uuid, LLHost host); - S32 setTETextureCore(const U8 te, const LLUUID& uuid, const std::string &url ); + S32 setTETextureCore(const U8 te, LLViewerTexture *image); /*virtual*/ S32 setTEColor(const U8 te, const LLColor3 &color); /*virtual*/ S32 setTEColor(const U8 te, const LLColor4 &color); /*virtual*/ S32 setTEScale(const U8 te, const F32 s, const F32 t); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index c512837632..f0986ac223 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1776,29 +1776,42 @@ U32 LLVOAvatar::processUpdateMessage(LLMessageSystem *mesgsys, return retval; } +LLViewerFetchedTexture *LLVOAvatar::getBakedTextureImage(const U8 te, const LLUUID& uuid) +{ + LLViewerFetchedTexture *result; + + const std::string url = getImageURL(te,uuid); + if (!url.empty()) + { + llinfos << "texture URL " << url << llendl; + result = LLViewerTextureManager::getFetchedTextureFromUrl( + url, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE, 0, 0, uuid); + } + else + { + llinfos << "get texture from host " << uuid << llendl; + LLHost host = getObjectHost(); + result = LLViewerTextureManager::getFetchedTexture( + uuid, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE, 0, 0, host); + } + return result; +} + // virtual S32 LLVOAvatar::setTETexture(const U8 te, const LLUUID& uuid) { - // The core setTETexture() method requests images, so we need - // to redirect certain avatar texture requests to different sims. - if (isIndexBakedTexture((ETextureIndex)te)) + if (!isIndexBakedTexture((ETextureIndex)te)) { - const std::string url = getImageURL(te,uuid); - if (!url.empty()) + if (!uuid.isNull()) { - llinfos << "texture URL " << url << llendl; - return setTETextureCore(te, uuid, url); + llinfos << "ignoring texture " << uuid << " in non-baked slot " << (S32)te << " - will use null " << llendl; } - - llinfos << "get texture from host " << uuid << llendl; - LLHost target_host = getObjectHost(); - return setTETextureCore(te, uuid, target_host); - } - else - { - llinfos << "ignoring texture in non-baked slot " << uuid << " - will use null " << LLUUID::null << llendl; - return setTETextureCore(te, LLUUID::null, LLHost::invalid); + return LLViewerObject::setTETexture(te, LLUUID::null); } + + LLViewerFetchedTexture *image = getBakedTextureImage(te,uuid); + llassert(image); + return setTETextureCore(te, image); } static LLFastTimer::DeclareTimer FTM_AVATAR_UPDATE("Avatar Update"); @@ -6070,6 +6083,8 @@ void LLVOAvatar::updateMeshTextures() last_id_string = "A"; else if (mBakedTextureDatas[i].mLastTextureID == IMG_DEFAULT) last_id_string = "D"; + else if (mBakedTextureDatas[i].mLastTextureID == IMG_INVISIBLE) + last_id_string = "I"; else last_id_string = "*"; bool is_ltda = layerset @@ -6750,12 +6765,6 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) return; } - BOOL is_first_appearance_message = !mFirstAppearanceMessageReceived; - mFirstAppearanceMessageReceived = TRUE; - - LL_INFOS("Avatar") << avString() << "processAvatarAppearance start " << mID - << " first? " << is_first_appearance_message << " self? " << isSelf() << LL_ENDL; - ESex old_sex = getSex(); @@ -6831,6 +6840,12 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) // runway - was // if (!is_first_appearance_message ) // which means it would be called on second appearance message - probably wrong. + BOOL is_first_appearance_message = !mFirstAppearanceMessageReceived; + mFirstAppearanceMessageReceived = TRUE; + + LL_INFOS("Avatar") << avString() << "processAvatarAppearance start " << mID + << " first? " << is_first_appearance_message << " self? " << isSelf() << LL_ENDL; + if (is_first_appearance_message ) { onFirstTEMessageReceived(); diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index bdb477590f..c14f18d00e 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -147,6 +147,7 @@ public: void collectTextureUUIDs(std::set& ids); void releaseOldTextures(); /*virtual*/ void updateTextures(); + LLViewerFetchedTexture* getBakedTextureImage(const U8 te, const LLUUID& uuid); /*virtual*/ S32 setTETexture(const U8 te, const LLUUID& uuid); // If setting a baked texture, need to request it from a non-local sim. /*virtual*/ void onShift(const LLVector4a& shift_vector); /*virtual*/ U32 getPartitionType() const; diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp old mode 100644 new mode 100755 index 757d029513..aeac478d4e --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -759,6 +759,15 @@ U32 LLVOAvatarSelf::processUpdateMessage(LLMessageSystem *mesgsys, { U32 retval = LLVOAvatar::processUpdateMessage(mesgsys,user_data,block_num,update_type,dp); +#if 0 + // DRANO - it's not clear this does anything useful. If we wait + // until an appearance message has been received, we already have + // the texture ids. If we don't wait, we don't yet know where to + // look for baked textures, because we haven't received the + // appearance version data from the appearance message. This looks + // like an old optimization that's incompatible with server-side + // texture baking. + // FIXME DRANO - skipping in the case of !mFirstAppearanceMessageReceived prevents us from trying to // load textures before we know where they come from (ie, from baking service or not); // unknown impact on performance. @@ -783,6 +792,7 @@ U32 LLVOAvatarSelf::processUpdateMessage(LLMessageSystem *mesgsys, mInitialBakesLoaded = true; } +#endif return retval; } -- cgit v1.2.3 From 1518bc9f9add7812f0fa1f60d58c6b8f0ee462ca Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 30 Jan 2013 18:43:30 -0500 Subject: SH-3800 WIP - avoid complaints about source of various standard textures - IMG_DEFAULT_AVATAR etc --- indra/newview/llvoavatar.cpp | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index f0986ac223..5b4f31f91a 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1778,21 +1778,32 @@ U32 LLVOAvatar::processUpdateMessage(LLMessageSystem *mesgsys, LLViewerFetchedTexture *LLVOAvatar::getBakedTextureImage(const U8 te, const LLUUID& uuid) { - LLViewerFetchedTexture *result; - - const std::string url = getImageURL(te,uuid); - if (!url.empty()) + LLViewerFetchedTexture *result = NULL; + + if (uuid == IMG_DEFAULT_AVATAR || + uuid == IMG_DEFAULT || + uuid == IMG_INVISIBLE) { - llinfos << "texture URL " << url << llendl; - result = LLViewerTextureManager::getFetchedTextureFromUrl( - url, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE, 0, 0, uuid); + // Should already exist, don't need to find it on sim or baked-texture host. + result = gTextureList.findImage(uuid); } - else + + if (!result) { - llinfos << "get texture from host " << uuid << llendl; - LLHost host = getObjectHost(); - result = LLViewerTextureManager::getFetchedTexture( - uuid, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE, 0, 0, host); + const std::string url = getImageURL(te,uuid); + if (!url.empty()) + { + llinfos << "texture URL " << url << llendl; + result = LLViewerTextureManager::getFetchedTextureFromUrl( + url, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE, 0, 0, uuid); + } + else + { + llinfos << "get texture from host " << uuid << llendl; + LLHost host = getObjectHost(); + result = LLViewerTextureManager::getFetchedTexture( + uuid, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE, 0, 0, host); + } } return result; } -- cgit v1.2.3 From 235f77b8c6194d7e6ab55a73dda4a31d19948323 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 1 Feb 2013 09:13:31 -0500 Subject: SH-3800 WIP - reject appearance messages with contradictory appearance version info --- indra/newview/llagent.cpp | 1 + indra/newview/llviewertexturelist.cpp | 7 +++-- indra/newview/llvoavatar.cpp | 54 +++++++++++++++++++++-------------- 3 files changed, 39 insertions(+), 23 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 1760d4769a..06a7a2f5c3 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -816,6 +816,7 @@ void LLAgent::handleServerBakeRegionTransition(const LLUUID& region_id) !gAgentAvatarp->isUsingServerBakes() && (mRegionp->getCentralBakeVersion()>0)) { + llinfos << "update requested due to region transition" << llendl; LLAppearanceMgr::instance().requestServerAppearanceUpdate(); } } diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index 4d79af5acc..6e7f6c9b32 100755 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -384,8 +384,11 @@ LLViewerFetchedTexture* LLViewerTextureList::getImageFromUrl(const std::string& } else if (texture->getUrl() != url) { - llwarns << "Requested texture " << new_id << " already exists with a different url, requested: " - << url << " current: " << texture->getUrl() << llendl; + // This is not an error as long as the images really match - + // e.g. could be two avatars wearing the same outfit. + LL_DEBUGS("Avatar") << "Requested texture " << new_id + << " already exists with a different url, requested: " << url + << " current: " << texture->getUrl() << llendl; } } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 5b4f31f91a..537bb70579 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -6645,11 +6645,13 @@ struct LLAppearanceMessageContents { LLAppearanceMessageContents(): mAppearanceVersion(-1), + mParamAppearanceVersion(-1), mCOFVersion(LLViewerInventoryCategory::VERSION_UNKNOWN) { } LLTEContents mTEContents; S32 mAppearanceVersion; + S32 mParamAppearanceVersion; S32 mCOFVersion; // For future use: //U32 appearance_flags = 0; @@ -6730,7 +6732,6 @@ void LLVOAvatar::parseAppearanceMessage(LLMessageSystem* mesgsys, LLAppearanceMe } LLVisualParam* appearance_version_param = getVisualParam(11000); - S32 param_appearance_version = -1; if (appearance_version_param) { std::vector::iterator it = std::find(contents.mParams.begin(), contents.mParams.end(),appearance_version_param); @@ -6738,28 +6739,38 @@ void LLVOAvatar::parseAppearanceMessage(LLMessageSystem* mesgsys, LLAppearanceMe { S32 index = it - contents.mParams.begin(); llinfos << "index: " << index << llendl; - param_appearance_version = llround(contents.mParamWeights[index]); - LL_DEBUGS("Avatar") << "appversion req by appearance_version param: " << contents.mAppearanceVersion << llendl; + contents.mParamAppearanceVersion = llround(contents.mParamWeights[index]); + LL_DEBUGS("Avatar") << "appversion req by appearance_version param: " << contents.mParamAppearanceVersion << llendl; } } +} + +bool resolve_appearance_version(const LLAppearanceMessageContents& contents, S32& appearance_version) +{ if ((contents.mAppearanceVersion) >= 0 && - (param_appearance_version >= 0) && - (contents.mAppearanceVersion != param_appearance_version)) + (contents.mParamAppearanceVersion >= 0) && + (contents.mAppearanceVersion != contents.mParamAppearanceVersion)) { llwarns << "inconsistent appearance_version settings - field: " << - contents.mAppearanceVersion << ", param: " << param_appearance_version << llendl; + contents.mAppearanceVersion << ", param: " << contents.mParamAppearanceVersion << llendl; + return false; + } + if (contents.mParamAppearanceVersion >= 0) // use visual param if available. + { + appearance_version = contents.mParamAppearanceVersion; + LL_DEBUGS("Avatar") << "appversion set by appearance_version param: " << appearance_version << llendl; } - if (contents.mAppearanceVersion < 0 && - param_appearance_version >= 0) // not set explicitly, try to get from visual param. + if (contents.mAppearanceVersion >= 0) { - contents.mAppearanceVersion = param_appearance_version; - LL_DEBUGS("Avatar") << "appversion set by appearance_version param: " << contents.mAppearanceVersion << llendl; + appearance_version = contents.mAppearanceVersion; + LL_DEBUGS("Avatar") << "appversion set by appearance_version field: " << appearance_version << llendl; } if (contents.mAppearanceVersion < 0) // still not set, go with 0. { - contents.mAppearanceVersion = 0; - LL_DEBUGS("Avatar") << "appversion set by default: " << contents.mAppearanceVersion << llendl; + appearance_version = 0; + LL_DEBUGS("Avatar") << "appversion set by default: " << appearance_version << llendl; } + return true; } //----------------------------------------------------------------------------- @@ -6776,13 +6787,21 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) return; } - ESex old_sex = getSex(); LLAppearanceMessageContents contents; parseAppearanceMessage(mesgsys, contents); + if (enable_verbose_dumps) + { + dumpAppearanceMsgParams(dump_prefix + "appearance_msg", contents.mParamWeights, contents.mTEContents); + } - U8 appearance_version = contents.mAppearanceVersion; + S32 appearance_version; + if (!resolve_appearance_version(contents, appearance_version)) + { + llwarns << "bad appearance version info, discarding" << llendl; + return; + } S32 this_update_cof_version = contents.mCOFVersion; S32 last_update_request_cof_version = LLAppearanceMgr::instance().mLastUpdateRequestCOFVersion; @@ -6891,13 +6910,6 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) } } } - if (enable_verbose_dumps) - { - dumpAppearanceMsgParams(dump_prefix + "appearance_msg", contents.mParamWeights, contents.mTEContents); - } - - //if (enable_verbose_dumps) { dumpArchetypeXML(dump_prefix + "process_post_set_weights"); } - const S32 expected_tweakable_count = getVisualParamCountInGroup(VISUAL_PARAM_GROUP_TWEAKABLE); // don't worry about VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT if (num_params != expected_tweakable_count) { -- cgit v1.2.3 From 3f45d5472c603e9f034161b382ce42baa3a5b3c0 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 1 Feb 2013 10:53:02 -0500 Subject: SH-3800 WIP - log some of sent appearance msg info as well as received --- indra/newview/llagent.cpp | 49 ++++++++++++++++++++++++++++++++++++++++++++ indra/newview/llagent.h | 1 + indra/newview/llvoavatar.cpp | 8 ++++---- 3 files changed, 54 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 06a7a2f5c3..60873cf41f 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -4282,6 +4282,49 @@ void LLAgent::requestLeaveGodMode() sendReliableMessage(); } +extern void dump_visual_param(apr_file_t* file, LLVisualParam* viewer_param, F32 value); +extern std::string get_sequential_numbered_file_name(const std::string& prefix, + const std::string& suffix); + +// For debugging, trace agent state at times appearance message are sent out. +void LLAgent::dumpSentAppearance(const std::string& dump_prefix) +{ + std::string outfilename = get_sequential_numbered_file_name(dump_prefix,".xml"); + + LLAPRFile outfile; + std::string fullpath = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,outfilename); + outfile.open(fullpath, LL_APR_WB ); + apr_file_t* file = outfile.getFileHandle(); + if (!file) + { + return; + } + else + { + LL_DEBUGS("Avatar") << "dumping sent appearance message to " << fullpath << llendl; + } + + LLVisualParam* appearance_version_param = gAgentAvatarp->getVisualParam(11000); + if (appearance_version_param) + { + F32 value = appearance_version_param->getWeight(); + dump_visual_param(file, appearance_version_param, value); + } + for (LLAvatarAppearanceDictionary::Textures::const_iterator iter = LLAvatarAppearanceDictionary::getInstance()->getTextures().begin(); + iter != LLAvatarAppearanceDictionary::getInstance()->getTextures().end(); + ++iter) + { + const ETextureIndex index = iter->first; + const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = iter->second; + if (texture_dict->mIsBakedTexture) + { + LLTextureEntry* entry = gAgentAvatarp->getTE((U8) index); + const LLUUID& uuid = entry->getID(); + apr_file_printf( file, "\t\t\n", index, uuid.asString().c_str()); + } + } +} + //----------------------------------------------------------------------------- // sendAgentSetAppearance() //----------------------------------------------------------------------------- @@ -4378,6 +4421,12 @@ void LLAgent::sendAgentSetAppearance() // composites to false, and update mesh textures. if (textures_current) { + bool enable_verbose_dumps = gSavedSettings.getBOOL("DebugAvatarAppearanceMessage"); + std::string dump_prefix = gAgentAvatarp->getFullname() + "_sent_appearance"; + if (enable_verbose_dumps) + { + dumpSentAppearance(dump_prefix); + } LL_INFOS("Avatar") << gAgentAvatarp->avString() << "TAT: Sending cached texture data" << LL_ENDL; for (U8 baked_index = 0; baked_index < BAKED_NUM_INDICES; baked_index++) { diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index 693c123851..306dc2d99c 100755 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -845,6 +845,7 @@ private: public: void sendMessage(); // Send message to this agent's region void sendReliableMessage(); + void dumpSentAppearance(const std::string& dump_prefix); void sendAgentSetAppearance(); void sendAgentDataUpdateRequest(); void sendAgentUserInfoRequest(); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 537bb70579..1ea1b027f0 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -6617,7 +6617,7 @@ void LLVOAvatar::dumpAppearanceMsgParams( const std::string& dump_prefix, } else { - llinfos << "xmlfile write handle obtained : " << fullpath << llendl; + LL_DEBUGS("Avatar") << "dumping appearance message to " << fullpath << llendl; } @@ -6758,18 +6758,18 @@ bool resolve_appearance_version(const LLAppearanceMessageContents& contents, S32 if (contents.mParamAppearanceVersion >= 0) // use visual param if available. { appearance_version = contents.mParamAppearanceVersion; - LL_DEBUGS("Avatar") << "appversion set by appearance_version param: " << appearance_version << llendl; } if (contents.mAppearanceVersion >= 0) { appearance_version = contents.mAppearanceVersion; - LL_DEBUGS("Avatar") << "appversion set by appearance_version field: " << appearance_version << llendl; } if (contents.mAppearanceVersion < 0) // still not set, go with 0. { appearance_version = 0; - LL_DEBUGS("Avatar") << "appversion set by default: " << appearance_version << llendl; } + LL_DEBUGS("Avatar") << "appearance version info - field " << contents.mAppearanceVersion + << " param: " << contents.mParamAppearanceVersion + << " final: " << appearance_version << llendl; return true; } -- cgit v1.2.3 From 44308c110f0ed4323767493c409de5d0cf4f4c4f Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 1 Feb 2013 16:14:37 -0500 Subject: SH-3800 WIP - fixed bad case in appearance version computation --- indra/newview/llvoavatar.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 1ea1b027f0..cc1993fe40 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -6747,6 +6747,8 @@ void LLVOAvatar::parseAppearanceMessage(LLMessageSystem* mesgsys, LLAppearanceMe bool resolve_appearance_version(const LLAppearanceMessageContents& contents, S32& appearance_version) { + appearance_version = -1; + if ((contents.mAppearanceVersion) >= 0 && (contents.mParamAppearanceVersion >= 0) && (contents.mAppearanceVersion != contents.mParamAppearanceVersion)) @@ -6763,7 +6765,7 @@ bool resolve_appearance_version(const LLAppearanceMessageContents& contents, S32 { appearance_version = contents.mAppearanceVersion; } - if (contents.mAppearanceVersion < 0) // still not set, go with 0. + if (appearance_version < 0) // still not set, go with 0. { appearance_version = 0; } @@ -6823,6 +6825,10 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) return; } } + else + { + LL_DEBUGS("Avatar") << "appearance message received" << llendl; + } // Check for stale update. if (isSelf() -- cgit v1.2.3 From 8095292585088d277805e04d24d0d1450c5a3289 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 1 Feb 2013 17:21:59 -0500 Subject: SH-3800 WIP - additional log line --- indra/newview/llvoavatar.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index cc1993fe40..24dd0623ef 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -6780,6 +6780,8 @@ bool resolve_appearance_version(const LLAppearanceMessageContents& contents, S32 //----------------------------------------------------------------------------- void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) { + LL_DEBUGS("Avatar") << starts << llendl; + bool enable_verbose_dumps = gSavedSettings.getBOOL("DebugAvatarAppearanceMessage"); std::string dump_prefix = getFullname() + "_" + (isSelf()?"s":"o") + "_"; //if (enable_verbose_dumps) { dumpArchetypeXML(dump_prefix + "process_start"); } -- cgit v1.2.3 From 197b12d93b01efaa545d80b6cb36989b825e029c Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 1 Feb 2013 17:22:50 -0500 Subject: SH-3800 WIP - additional log line --- indra/newview/llvoavatar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 24dd0623ef..483bc25b33 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -6780,7 +6780,7 @@ bool resolve_appearance_version(const LLAppearanceMessageContents& contents, S32 //----------------------------------------------------------------------------- void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) { - LL_DEBUGS("Avatar") << starts << llendl; + LL_DEBUGS("Avatar") << "starts" << llendl; bool enable_verbose_dumps = gSavedSettings.getBOOL("DebugAvatarAppearanceMessage"); std::string dump_prefix = getFullname() + "_" + (isSelf()?"s":"o") + "_"; -- cgit v1.2.3