SH-3800 WIP - log some of sent appearance msg info as well as received

meow-7.2.2
Brad Payne (Vir Linden) 2013-02-01 10:53:02 -05:00
parent 235f77b8c6
commit 3f45d5472c
3 changed files with 54 additions and 4 deletions

View File

@ -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<texture te=\"%i\" uuid=\"%s\"/>\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++)
{

View File

@ -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();

View File

@ -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;
}