summaryrefslogtreecommitdiff
path: root/indra/newview/llagent.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llagent.cpp')
-rwxr-xr-xindra/newview/llagent.cpp94
1 files changed, 80 insertions, 14 deletions
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index e15b4d071f..6c082a7e9c 100755
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -812,12 +812,23 @@ void LLAgent::handleServerBakeRegionTransition(const LLUUID& region_id)
{
llinfos << "called" << llendl;
+
+ // Old-style appearance entering a server-bake region.
if (isAgentAvatarValid() &&
!gAgentAvatarp->isUsingServerBakes() &&
(mRegionp->getCentralBakeVersion()>0))
{
+ llinfos << "update requested due to region transition" << llendl;
LLAppearanceMgr::instance().requestServerAppearanceUpdate();
}
+ // new-style appearance entering a non-bake region,
+ // need to check for existence of the baking service.
+ else if (isAgentAvatarValid() &&
+ gAgentAvatarp->isUsingServerBakes() &&
+ mRegionp->getCentralBakeVersion()==0)
+ {
+ gAgentAvatarp->checkForUnsupportedServerBakeAppearance();
+ }
}
//-----------------------------------------------------------------------------
@@ -4281,32 +4292,80 @@ void LLAgent::requestLeaveGodMode()
sendReliableMessage();
}
+// 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<texture te=\"%i\" uuid=\"%s\"/>\n", index, uuid.asString().c_str());
+ }
+ }
+}
+
//-----------------------------------------------------------------------------
// sendAgentSetAppearance()
//-----------------------------------------------------------------------------
void LLAgent::sendAgentSetAppearance()
{
- // FIXME DRANO - problems around new-style appearance in an old-style region.
- // - does this get called?
- // - need to change mUseServerBakes->FALSE in that case
- // - need to call processAvatarAppearance as if server had returned this result?
- // gAgentAvatarp->mUseServerBakes = FALSE;
-
if (gAgentQueryManager.mNumPendingQueries > 0)
{
return;
}
- if (!gAgentWearables.changeInProgress())
+ if (!isAgentAvatarValid() || (getRegion() && getRegion()->getCentralBakeVersion())) return;
+
+ // At this point we have a complete appearance to send and are in a non-baking region.
+ // DRANO FIXME
+ //gAgentAvatarp->setIsUsingServerBakes(FALSE);
+ S32 sb_count, host_count, both_count, neither_count;
+ gAgentAvatarp->bakedTextureOriginCounts(sb_count, host_count, both_count, neither_count);
+ if (both_count != 0 || neither_count != 0)
+ {
+ llwarns << "bad bake texture state " << sb_count << "," << host_count << "," << both_count << "," << neither_count << llendl;
+ }
+ if (sb_count != 0 && host_count == 0)
{
- // Change is fully resolved, can close some open phases.
- gAgentAvatarp->getPhases().stopPhase("process_initial_wearables_update");
- gAgentAvatarp->getPhases().stopPhase("wear_inventory_category");
+ gAgentAvatarp->setIsUsingServerBakes(true);
+ }
+ else if (sb_count == 0 && host_count != 0)
+ {
+ gAgentAvatarp->setIsUsingServerBakes(false);
+ }
+ else if (sb_count + host_count > 0)
+ {
+ llwarns << "unclear baked texture state, not sending appearance" << llendl;
+ return;
}
- gAgentAvatarp->sendAppearanceChangeMetrics();
-
- if (!isAgentAvatarValid() || (getRegion() && getRegion()->getCentralBakeVersion())) return;
LL_INFOS("Avatar") << gAgentAvatarp->avString() << "TAT: Sent AgentSetAppearance: " << gAgentAvatarp->getBakedStatusForPrintout() << LL_ENDL;
//dumpAvatarTEs( "sendAgentSetAppearance()" );
@@ -4347,6 +4406,7 @@ void LLAgent::sendAgentSetAppearance()
// IMG_DEFAULT_AVATAR means not baked. 0 index should be ignored for baked textures
if (!gAgentAvatarp->isTextureDefined(texture_index, 0))
{
+ LL_DEBUGS("Avatar") << "texture not current for baked " << (S32)baked_index << " local " << (S32)texture_index << llendl;
textures_current = FALSE;
break;
}
@@ -4359,6 +4419,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++)
{
@@ -4408,7 +4474,7 @@ void LLAgent::sendAgentSetAppearance()
}
}
-// llinfos << "Avatar XML num VisualParams transmitted = " << transmitted_params << llendl;
+ //llinfos << "Avatar XML num VisualParams transmitted = " << transmitted_params << llendl;
sendReliableMessage();
}