From d8dc74b83349752768d99b77c92a284955ee04e4 Mon Sep 17 00:00:00 2001 From: simon Date: Thu, 28 Mar 2013 16:06:07 -0700 Subject: MAINT-2426 : Viewer support for new simulator AvatarRenderInfo capability. Reviewed by Kelly --- indra/newview/llavatarrenderinfoaccountant.cpp | 360 +++++++++++++++++++++++++ 1 file changed, 360 insertions(+) create mode 100644 indra/newview/llavatarrenderinfoaccountant.cpp (limited to 'indra/newview/llavatarrenderinfoaccountant.cpp') diff --git a/indra/newview/llavatarrenderinfoaccountant.cpp b/indra/newview/llavatarrenderinfoaccountant.cpp new file mode 100644 index 0000000000..04a79f7d4c --- /dev/null +++ b/indra/newview/llavatarrenderinfoaccountant.cpp @@ -0,0 +1,360 @@ +/** + * @file llavatarrenderinfoaccountant.cpp + * @author Dave Simmons + * @date 2013-02-28 + * @brief + * + * $LicenseInfo:firstyear=2013&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2013, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +// Precompiled header +#include "llviewerprecompiledheaders.h" +// associated header +#include "llavatarrenderinfoaccountant.h" +// STL headers +// std headers +// external library headers +// other Linden headers +#include "llcharacter.h" +#include "llhttpclient.h" +#include "lltimer.h" +#include "llviewerobjectlist.h" +#include "llviewerregion.h" +#include "llvoavatar.h" +#include "llworld.h" + + +// Use this for debugging +//#define LL_AVATAR_RENDER_INFO_LOG_SPAM + +static const std::string KEY_AGENTS = "agents"; // map +static const std::string KEY_WEIGHT = "weight"; // integer +static const std::string KEY_GEOMETRY = "geometry"; // integer +static const std::string KEY_SURFACE = "surface"; // float + +static const std::string KEY_IDENTIFIER = "identifier"; +static const std::string KEY_MESSAGE = "message"; +static const std::string KEY_ERROR = "error"; + + +// Send data updates about once per minute, only need per-frame resolution +LLFrameTimer LLAvatarRenderInfoAccountant::sRenderInfoReportTimer; + + +// HTTP responder class for GET request for avatar render weight information +class LLAvatarRenderInfoGetResponder : public LLHTTPClient::Responder +{ +public: + LLAvatarRenderInfoGetResponder(U64 region_handle) : mRegionHandle(region_handle) + { + } + + virtual void error(U32 statusNum, const std::string& reason) + { + LLViewerRegion * regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); + if (regionp) + { + llwarns << "HTTP error result for avatar weight GET: " << statusNum + << ", " << reason + << " returned by region " << regionp->getName() + << llendl; + } + else + { + llwarns << "Avatar render weight GET error recieved but region not found for " + << mRegionHandle + << ", error " << statusNum + << ", " << reason + << llendl; + } + + } + + virtual void result(const LLSD& content) + { + LLViewerRegion * regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); + if (regionp) + { + #ifdef LL_AVATAR_RENDER_INFO_LOG_SPAM + llinfos << "Result for avatar weights request for region " << regionp->getName() << ":" << llendl; + #endif // LL_AVATAR_RENDER_INFO_LOG_SPAM + + if (content.isMap()) + { + if (content.has(KEY_AGENTS)) + { + const LLSD & agents = content[KEY_AGENTS]; + if (agents.isMap()) + { + LLSD::map_const_iterator report_iter = agents.beginMap(); + while (report_iter != agents.endMap()) + { + LLUUID target_agent_id = LLUUID(report_iter->first); + const LLSD & agent_info_map = report_iter->second; + LLViewerObject* avatarp = gObjectList.findObject(target_agent_id); + if (avatarp && + avatarp->isAvatar() && + agent_info_map.isMap()) + { // Extract the data for this avatar + + #ifdef LL_AVATAR_RENDER_INFO_LOG_SPAM + llinfos << " Agent " << target_agent_id + << ": " << agent_info_map << llendl; + #endif // LL_AVATAR_RENDER_INFO_LOG_SPAM + + if (agent_info_map.has(KEY_WEIGHT)) + { + ((LLVOAvatar *) avatarp)->setReportedVisualComplexity(agent_info_map[KEY_WEIGHT].asInteger()); + } + if (agent_info_map.has(KEY_GEOMETRY)) + { + ((LLVOAvatar *) avatarp)->setReportedAttachmentGeometryBytes(agent_info_map[KEY_GEOMETRY].asInteger()); + } + if (agent_info_map.has(KEY_SURFACE)) + { + ((LLVOAvatar *) avatarp)->setReportedAttachmentSurfaceArea((F32) agent_info_map[KEY_SURFACE].asReal()); + } + } + report_iter++; + } + } + } // has "agents" + else if (content.has(KEY_ERROR)) + { + const LLSD & error = content[KEY_ERROR]; + llwarns << "Avatar render info GET error: " + << error[KEY_IDENTIFIER] + << ": " << error[KEY_MESSAGE] + << " from region " << regionp->getName() + << llendl; + } + } + } + else + { + llinfos << "Avatar render weight info recieved but region not found for " + << mRegionHandle << llendl; + } + } + +private: + U64 mRegionHandle; +}; + + +// HTTP responder class for POST request for avatar render weight information +class LLAvatarRenderInfoPostResponder : public LLHTTPClient::Responder +{ +public: + LLAvatarRenderInfoPostResponder(U64 region_handle) : mRegionHandle(region_handle) + { + } + + virtual void error(U32 statusNum, const std::string& reason) + { + LLViewerRegion * regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); + if (regionp) + { + llwarns << "HTTP error result for avatar weight POST: " << statusNum + << ", " << reason + << " returned by region " << regionp->getName() + << llendl; + } + else + { + llwarns << "Avatar render weight POST error recieved but region not found for " + << mRegionHandle + << ", error " << statusNum + << ", " << reason + << llendl; + } + } + + virtual void result(const LLSD& content) + { + LLViewerRegion * regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); + if (regionp) + { + #ifdef LL_AVATAR_RENDER_INFO_LOG_SPAM + llinfos << "Result for avatar weights POST for region " << regionp->getName() + << ": " << content << llendl; + #endif // LL_AVATAR_RENDER_INFO_LOG_SPAM + + if (content.isMap()) + { + if (content.has(KEY_ERROR)) + { + const LLSD & error = content[KEY_ERROR]; + llwarns << "Avatar render info POST error: " + << error[KEY_IDENTIFIER] + << ": " << error[KEY_MESSAGE] + << " from region " << regionp->getName() + << llendl; + } + } + } + else + { + llinfos << "Avatar render weight POST result recieved but region not found for " + << mRegionHandle << llendl; + } + } + +private: + U64 mRegionHandle; +}; + + +// static +// Send request for one region, no timer checks +void LLAvatarRenderInfoAccountant::sendRenderInfoToRegion(LLViewerRegion * regionp) +{ + std::string url = regionp->getCapability("AvatarRenderInfo"); + if (!url.empty()) + { + #ifdef LL_AVATAR_RENDER_INFO_LOG_SPAM + llinfos << "Sending avatar render info to region " + << regionp->getName() + << " from " << url + << llendl; + #endif // LL_AVATAR_RENDER_INFO_LOG_SPAM + + // Build the render info to POST to the region + LLSD report = LLSD::emptyMap(); + LLSD agents = LLSD::emptyMap(); + + std::vector::iterator iter = LLCharacter::sInstances.begin(); + while( iter != LLCharacter::sInstances.end() ) + { + LLVOAvatar* avatar = dynamic_cast(*iter); + if (avatar && + avatar->getRezzedStatus() == 2 && // Fully rezzed + !avatar->isDead() && // Not dead yet + avatar->getObjectHost() == regionp->getHost()) // Ensure it's on the same region + { + avatar->calculateUpdateRenderCost(); // Make sure the numbers are up-to-date + + LLSD info = LLSD::emptyMap(); + if (avatar->getVisualComplexity() > 0) + { + info[KEY_WEIGHT] = avatar->getVisualComplexity(); + } + if (avatar->getAttachmentGeometryBytes() > 0) + { + info[KEY_GEOMETRY] = (S32) avatar->getAttachmentGeometryBytes(); + } + if (avatar->getAttachmentSurfaceArea() > 0.f) + { + info[KEY_SURFACE] = avatar->getAttachmentSurfaceArea(); + } + if (info.size() > 0) + { + agents[avatar->getID().asString()] = info; + } + + #ifdef LL_AVATAR_RENDER_INFO_LOG_SPAM + llinfos << "Sending avatar render info for " << avatar->getID() + << ": " << info << llendl; + #endif // LL_AVATAR_RENDER_INFO_LOG_SPAM + } + iter++; + } + + report[KEY_AGENTS] = agents; + if (agents.size() > 0) + { + LLHTTPClient::post(url, report, new LLAvatarRenderInfoPostResponder(regionp->getHandle())); + } + } +} + + + + +// static +// Send request for one region, no timer checks +void LLAvatarRenderInfoAccountant::getRenderInfoFromRegion(LLViewerRegion * regionp) +{ + std::string url = regionp->getCapability("AvatarRenderInfo"); + if (!url.empty()) + { + #ifdef LL_AVATAR_RENDER_INFO_LOG_SPAM + llinfos << "Requesting avatar render info for region " + << regionp->getName() + << " from " << url + << llendl; + #endif // LL_AVATAR_RENDER_INFO_LOG_SPAM + + // First send a request to get the latest data + LLHTTPClient::get(url, new LLAvatarRenderInfoGetResponder(regionp->getHandle())); + } +} + + +// static +// Called every frame - send render weight requests to every region +void LLAvatarRenderInfoAccountant::idle() +{ + if (sRenderInfoReportTimer.hasExpired()) + { + const F32 SECS_BETWEEN_REGION_SCANS = 5.f; // Scan the region list every 5 seconds + const F32 SECS_BETWEEN_REGION_REQUEST = 60.0; // Update each region every 60 seconds + + S32 num_avs = LLCharacter::sInstances.size(); + + // Check all regions and see if it's time to fetch/send data + for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); + iter != LLWorld::getInstance()->getRegionList().end(); ++iter) + { + LLViewerRegion* regionp = *iter; + if (regionp && + regionp->isAlive() && + regionp->capabilitiesReceived() && // Region has capability URLs available + regionp->getRenderInfoRequestTimer().hasExpired()) // Time to make request + { + sendRenderInfoToRegion(regionp); + getRenderInfoFromRegion(regionp); + + // Reset this regions timer, moving to longer intervals if there are lots of avatars around + regionp->getRenderInfoRequestTimer().resetWithExpiry(SECS_BETWEEN_REGION_REQUEST + (2.f * num_avs)); + } + } + + // We scanned all the regions, reset the request timer. + sRenderInfoReportTimer.resetWithExpiry(SECS_BETWEEN_REGION_SCANS); + } +} + + +// static +// Make sRenderInfoReportTimer expire so the next call to idle() will scan and query a new region +// called via LLViewerRegion::setCapabilitiesReceived() boost signals when the capabilities +// are returned for a new LLViewerRegion, and is the earliest time to get render info +void LLAvatarRenderInfoAccountant::expireRenderInfoReportTimer() +{ + #ifdef LL_AVATAR_RENDER_INFO_LOG_SPAM + llinfos << "Viewer has new region capabilities" << llendl; + #endif // LL_AVATAR_RENDER_INFO_LOG_SPAM + + sRenderInfoReportTimer.resetWithExpiry(0.f); +} + -- cgit v1.2.3 From 15e2f76615581341a861ed0e37da96170e2aee61 Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 3 Apr 2013 16:26:11 -0700 Subject: MAINT-2558 - Add viewer debug setting for more logging on avatar render info. Reviewed by Kelly --- indra/newview/llavatarrenderinfoaccountant.cpp | 77 +++++++++++++++----------- 1 file changed, 44 insertions(+), 33 deletions(-) (limited to 'indra/newview/llavatarrenderinfoaccountant.cpp') diff --git a/indra/newview/llavatarrenderinfoaccountant.cpp b/indra/newview/llavatarrenderinfoaccountant.cpp index 04a79f7d4c..54144677f4 100644 --- a/indra/newview/llavatarrenderinfoaccountant.cpp +++ b/indra/newview/llavatarrenderinfoaccountant.cpp @@ -37,15 +37,13 @@ #include "llcharacter.h" #include "llhttpclient.h" #include "lltimer.h" +#include "llviewercontrol.h" #include "llviewerobjectlist.h" #include "llviewerregion.h" #include "llvoavatar.h" #include "llworld.h" -// Use this for debugging -//#define LL_AVATAR_RENDER_INFO_LOG_SPAM - static const std::string KEY_AGENTS = "agents"; // map static const std::string KEY_WEIGHT = "weight"; // integer static const std::string KEY_GEOMETRY = "geometry"; // integer @@ -94,9 +92,10 @@ public: LLViewerRegion * regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); if (regionp) { - #ifdef LL_AVATAR_RENDER_INFO_LOG_SPAM - llinfos << "Result for avatar weights request for region " << regionp->getName() << ":" << llendl; - #endif // LL_AVATAR_RENDER_INFO_LOG_SPAM + if (LLAvatarRenderInfoAccountant::logRenderInfo()) + { + llinfos << "Result for avatar weights request for region " << regionp->getName() << ":" << llendl; + } if (content.isMap()) { @@ -116,10 +115,11 @@ public: agent_info_map.isMap()) { // Extract the data for this avatar - #ifdef LL_AVATAR_RENDER_INFO_LOG_SPAM - llinfos << " Agent " << target_agent_id - << ": " << agent_info_map << llendl; - #endif // LL_AVATAR_RENDER_INFO_LOG_SPAM + if (LLAvatarRenderInfoAccountant::logRenderInfo()) + { + llinfos << " Agent " << target_agent_id + << ": " << agent_info_map << llendl; + } if (agent_info_map.has(KEY_WEIGHT)) { @@ -194,10 +194,11 @@ public: LLViewerRegion * regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); if (regionp) { - #ifdef LL_AVATAR_RENDER_INFO_LOG_SPAM - llinfos << "Result for avatar weights POST for region " << regionp->getName() - << ": " << content << llendl; - #endif // LL_AVATAR_RENDER_INFO_LOG_SPAM + if (LLAvatarRenderInfoAccountant::logRenderInfo()) + { + llinfos << "Result for avatar weights POST for region " << regionp->getName() + << ": " << content << llendl; + } if (content.isMap()) { @@ -231,12 +232,13 @@ void LLAvatarRenderInfoAccountant::sendRenderInfoToRegion(LLViewerRegion * regio std::string url = regionp->getCapability("AvatarRenderInfo"); if (!url.empty()) { - #ifdef LL_AVATAR_RENDER_INFO_LOG_SPAM - llinfos << "Sending avatar render info to region " - << regionp->getName() - << " from " << url - << llendl; - #endif // LL_AVATAR_RENDER_INFO_LOG_SPAM + if (logRenderInfo()) + { + llinfos << "Sending avatar render info to region " + << regionp->getName() + << " from " << url + << llendl; + } // Build the render info to POST to the region LLSD report = LLSD::emptyMap(); @@ -271,10 +273,11 @@ void LLAvatarRenderInfoAccountant::sendRenderInfoToRegion(LLViewerRegion * regio agents[avatar->getID().asString()] = info; } - #ifdef LL_AVATAR_RENDER_INFO_LOG_SPAM - llinfos << "Sending avatar render info for " << avatar->getID() - << ": " << info << llendl; - #endif // LL_AVATAR_RENDER_INFO_LOG_SPAM + if (logRenderInfo()) + { + llinfos << "Sending avatar render info for " << avatar->getID() + << ": " << info << llendl; + } } iter++; } @@ -297,12 +300,13 @@ void LLAvatarRenderInfoAccountant::getRenderInfoFromRegion(LLViewerRegion * regi std::string url = regionp->getCapability("AvatarRenderInfo"); if (!url.empty()) { - #ifdef LL_AVATAR_RENDER_INFO_LOG_SPAM - llinfos << "Requesting avatar render info for region " - << regionp->getName() - << " from " << url - << llendl; - #endif // LL_AVATAR_RENDER_INFO_LOG_SPAM + if (logRenderInfo()) + { + llinfos << "Requesting avatar render info for region " + << regionp->getName() + << " from " << url + << llendl; + } // First send a request to get the latest data LLHTTPClient::get(url, new LLAvatarRenderInfoGetResponder(regionp->getHandle())); @@ -351,10 +355,17 @@ void LLAvatarRenderInfoAccountant::idle() // are returned for a new LLViewerRegion, and is the earliest time to get render info void LLAvatarRenderInfoAccountant::expireRenderInfoReportTimer() { - #ifdef LL_AVATAR_RENDER_INFO_LOG_SPAM - llinfos << "Viewer has new region capabilities" << llendl; - #endif // LL_AVATAR_RENDER_INFO_LOG_SPAM + if (logRenderInfo()) + { + llinfos << "Viewer has new region capabilities" << llendl; + } sRenderInfoReportTimer.resetWithExpiry(0.f); } +// static +bool LLAvatarRenderInfoAccountant::logRenderInfo() +{ + static LLCachedControl render_mute_logging_enabled(gSavedSettings, "RenderAutoMuteLogging"); + return render_mute_logging_enabled; +} -- cgit v1.2.3 From cd8e0b92e1c8f9f8544b1011e61c21c7789b93b7 Mon Sep 17 00:00:00 2001 From: simon Date: Thu, 9 May 2013 11:10:13 -0700 Subject: Tweak to ensure more avatar rendering info is sent to the simulator --- indra/newview/llavatarrenderinfoaccountant.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llavatarrenderinfoaccountant.cpp') diff --git a/indra/newview/llavatarrenderinfoaccountant.cpp b/indra/newview/llavatarrenderinfoaccountant.cpp index 54144677f4..da4b6cf806 100644 --- a/indra/newview/llavatarrenderinfoaccountant.cpp +++ b/indra/newview/llavatarrenderinfoaccountant.cpp @@ -249,7 +249,7 @@ void LLAvatarRenderInfoAccountant::sendRenderInfoToRegion(LLViewerRegion * regio { LLVOAvatar* avatar = dynamic_cast(*iter); if (avatar && - avatar->getRezzedStatus() == 2 && // Fully rezzed + avatar->getRezzedStatus() >= 2 && // Mostly rezzed (maybe without baked textures downloaded) !avatar->isDead() && // Not dead yet avatar->getObjectHost() == regionp->getHost()) // Ensure it's on the same region { -- cgit v1.2.3 From f41c8f53412b3ca8500e72d9cde8e70ca0bc266e Mon Sep 17 00:00:00 2001 From: simon Date: Tue, 2 Jul 2013 16:04:31 -0700 Subject: MAINT-2808 Viewer side : Stats for OBJECT_ATTACHMENT_GEOMETRY_BYTES and OBJECT_ATTACHMENT_SURFACE_AREA do not return to the 'no attachments' values after avatar removes last attachment --- indra/newview/llavatarrenderinfoaccountant.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llavatarrenderinfoaccountant.cpp') diff --git a/indra/newview/llavatarrenderinfoaccountant.cpp b/indra/newview/llavatarrenderinfoaccountant.cpp index da4b6cf806..2a4ec6d320 100644 --- a/indra/newview/llavatarrenderinfoaccountant.cpp +++ b/indra/newview/llavatarrenderinfoaccountant.cpp @@ -260,11 +260,11 @@ void LLAvatarRenderInfoAccountant::sendRenderInfoToRegion(LLViewerRegion * regio { info[KEY_WEIGHT] = avatar->getVisualComplexity(); } - if (avatar->getAttachmentGeometryBytes() > 0) + if (avatar->getAttachmentGeometryBytes() >= 0) { info[KEY_GEOMETRY] = (S32) avatar->getAttachmentGeometryBytes(); } - if (avatar->getAttachmentSurfaceArea() > 0.f) + if (avatar->getAttachmentSurfaceArea() >= 0.f) { info[KEY_SURFACE] = avatar->getAttachmentSurfaceArea(); } -- cgit v1.2.3 From dc54af030e8f60b2b871be901664ffae1fc934e9 Mon Sep 17 00:00:00 2001 From: simon Date: Tue, 27 Aug 2013 14:57:43 -0700 Subject: MAINT-3065 : Avatar render info's 'geometry' stat is unpredictable for linked objects Removed "geometry" and "surface" Reviewed by Kelly --- indra/newview/llavatarrenderinfoaccountant.cpp | 31 +++++--------------------- 1 file changed, 5 insertions(+), 26 deletions(-) (limited to 'indra/newview/llavatarrenderinfoaccountant.cpp') diff --git a/indra/newview/llavatarrenderinfoaccountant.cpp b/indra/newview/llavatarrenderinfoaccountant.cpp index 2a4ec6d320..89c1b2a186 100644 --- a/indra/newview/llavatarrenderinfoaccountant.cpp +++ b/indra/newview/llavatarrenderinfoaccountant.cpp @@ -46,8 +46,6 @@ static const std::string KEY_AGENTS = "agents"; // map static const std::string KEY_WEIGHT = "weight"; // integer -static const std::string KEY_GEOMETRY = "geometry"; // integer -static const std::string KEY_SURFACE = "surface"; // float static const std::string KEY_IDENTIFIER = "identifier"; static const std::string KEY_MESSAGE = "message"; @@ -125,14 +123,6 @@ public: { ((LLVOAvatar *) avatarp)->setReportedVisualComplexity(agent_info_map[KEY_WEIGHT].asInteger()); } - if (agent_info_map.has(KEY_GEOMETRY)) - { - ((LLVOAvatar *) avatarp)->setReportedAttachmentGeometryBytes(agent_info_map[KEY_GEOMETRY].asInteger()); - } - if (agent_info_map.has(KEY_SURFACE)) - { - ((LLVOAvatar *) avatarp)->setReportedAttachmentSurfaceArea((F32) agent_info_map[KEY_SURFACE].asReal()); - } } report_iter++; } @@ -259,24 +249,13 @@ void LLAvatarRenderInfoAccountant::sendRenderInfoToRegion(LLViewerRegion * regio if (avatar->getVisualComplexity() > 0) { info[KEY_WEIGHT] = avatar->getVisualComplexity(); - } - if (avatar->getAttachmentGeometryBytes() >= 0) - { - info[KEY_GEOMETRY] = (S32) avatar->getAttachmentGeometryBytes(); - } - if (avatar->getAttachmentSurfaceArea() >= 0.f) - { - info[KEY_SURFACE] = avatar->getAttachmentSurfaceArea(); - } - if (info.size() > 0) - { agents[avatar->getID().asString()] = info; - } - if (logRenderInfo()) - { - llinfos << "Sending avatar render info for " << avatar->getID() - << ": " << info << llendl; + if (logRenderInfo()) + { + llinfos << "Sending avatar render info for " << avatar->getID() + << ": " << info << llendl; + } } } iter++; -- cgit v1.2.3 From 33e70236f0226b2e4ebabccfa28cca04ff01211e Mon Sep 17 00:00:00 2001 From: simon Date: Tue, 17 Sep 2013 17:01:52 -0700 Subject: MAINT-3161 : Clean up avatar muting code and prototype feature --- indra/newview/llavatarrenderinfoaccountant.cpp | 63 ++++++++++++++++++++++---- 1 file changed, 54 insertions(+), 9 deletions(-) (limited to 'indra/newview/llavatarrenderinfoaccountant.cpp') diff --git a/indra/newview/llavatarrenderinfoaccountant.cpp b/indra/newview/llavatarrenderinfoaccountant.cpp index 89c1b2a186..e778e0c032 100644 --- a/indra/newview/llavatarrenderinfoaccountant.cpp +++ b/indra/newview/llavatarrenderinfoaccountant.cpp @@ -38,6 +38,7 @@ #include "llhttpclient.h" #include "lltimer.h" #include "llviewercontrol.h" +#include "llviewermenu.h" #include "llviewerobjectlist.h" #include "llviewerregion.h" #include "llvoavatar.h" @@ -92,7 +93,7 @@ public: { if (LLAvatarRenderInfoAccountant::logRenderInfo()) { - llinfos << "Result for avatar weights request for region " << regionp->getName() << ":" << llendl; + llinfos << "LRI: Result for avatar weights request for region " << regionp->getName() << ":" << llendl; } if (content.isMap()) @@ -115,7 +116,7 @@ public: if (LLAvatarRenderInfoAccountant::logRenderInfo()) { - llinfos << " Agent " << target_agent_id + llinfos << "LRI: Agent " << target_agent_id << ": " << agent_info_map << llendl; } @@ -186,7 +187,7 @@ public: { if (LLAvatarRenderInfoAccountant::logRenderInfo()) { - llinfos << "Result for avatar weights POST for region " << regionp->getName() + llinfos << "LRI: Result for avatar weights POST for region " << regionp->getName() << ": " << content << llendl; } @@ -224,7 +225,7 @@ void LLAvatarRenderInfoAccountant::sendRenderInfoToRegion(LLViewerRegion * regio { if (logRenderInfo()) { - llinfos << "Sending avatar render info to region " + llinfos << "LRI: Sending avatar render info to region " << regionp->getName() << " from " << url << llendl; @@ -253,7 +254,7 @@ void LLAvatarRenderInfoAccountant::sendRenderInfoToRegion(LLViewerRegion * regio if (logRenderInfo()) { - llinfos << "Sending avatar render info for " << avatar->getID() + llinfos << "LRI: Sending avatar render info for " << avatar->getID() << ": " << info << llendl; } } @@ -281,7 +282,7 @@ void LLAvatarRenderInfoAccountant::getRenderInfoFromRegion(LLViewerRegion * regi { if (logRenderInfo()) { - llinfos << "Requesting avatar render info for region " + llinfos << "LRI: Requesting avatar render info for region " << regionp->getName() << " from " << url << llendl; @@ -304,6 +305,12 @@ void LLAvatarRenderInfoAccountant::idle() S32 num_avs = LLCharacter::sInstances.size(); + if (logRenderInfo()) + { + llinfos << "LRI: Scanning all regions and checking for render info updates" + << llendl; + } + // Check all regions and see if it's time to fetch/send data for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); iter != LLWorld::getInstance()->getRegionList().end(); ++iter) @@ -325,6 +332,35 @@ void LLAvatarRenderInfoAccountant::idle() // We scanned all the regions, reset the request timer. sRenderInfoReportTimer.resetWithExpiry(SECS_BETWEEN_REGION_SCANS); } + + static LLCachedControl render_auto_mute_functions(gSavedSettings, "RenderAutoMuteFunctions"); + static U32 prev_render_auto_mute_functions = (U32) -1; + if (prev_render_auto_mute_functions != render_auto_mute_functions) + { + prev_render_auto_mute_functions = render_auto_mute_functions; + + // Adjust menus + BOOL show_items = (BOOL)(render_auto_mute_functions & 0x04); + gMenuAvatarOther->setItemVisible( std::string("Normal"), show_items); + gMenuAvatarOther->setItemVisible( std::string("Always use impostor"), show_items); + gMenuAvatarOther->setItemVisible( std::string("Never use impostor"), show_items); + gMenuAvatarOther->setItemVisible( std::string("Impostor seperator"), show_items); + + gMenuAttachmentOther->setItemVisible( std::string("Normal"), show_items); + gMenuAttachmentOther->setItemVisible( std::string("Always use impostor"), show_items); + gMenuAttachmentOther->setItemVisible( std::string("Never use impostor"), show_items); + gMenuAttachmentOther->setItemVisible( std::string("Impostor seperator"), show_items); + + if (!show_items) + { // Turning off visual muting + for (std::vector::iterator iter = LLCharacter::sInstances.begin(); + iter != LLCharacter::sInstances.end(); ++iter) + { // Make sure all AVs have the setting cleared + LLVOAvatar* inst = (LLVOAvatar*) *iter; + inst->setCachedVisualMute(false); + } + } + } } @@ -332,14 +368,23 @@ void LLAvatarRenderInfoAccountant::idle() // Make sRenderInfoReportTimer expire so the next call to idle() will scan and query a new region // called via LLViewerRegion::setCapabilitiesReceived() boost signals when the capabilities // are returned for a new LLViewerRegion, and is the earliest time to get render info -void LLAvatarRenderInfoAccountant::expireRenderInfoReportTimer() +void LLAvatarRenderInfoAccountant::expireRenderInfoReportTimer(const LLUUID& region_id) { if (logRenderInfo()) { - llinfos << "Viewer has new region capabilities" << llendl; + llinfos << "LRI: Viewer has new region capabilities, clearing global render info timer" + << " and timer for region " << region_id + << llendl; } - sRenderInfoReportTimer.resetWithExpiry(0.f); + // Reset the global timer so it will scan regions immediately + sRenderInfoReportTimer.reset(); + + LLViewerRegion* regionp = LLWorld::instance().getRegionFromID(region_id); + if (regionp) + { // Reset the region's timer so it will request data immediately + regionp->getRenderInfoRequestTimer().reset(); + } } // static -- cgit v1.2.3 From 6d1c45f86321de7979b484dcc588e2dfa921c076 Mon Sep 17 00:00:00 2001 From: simon Date: Fri, 20 Sep 2013 15:26:44 -0700 Subject: Fix AvatarRenderInfo cap broken in merge, add a new diagnostic log message --- indra/newview/llavatarrenderinfoaccountant.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/newview/llavatarrenderinfoaccountant.cpp') diff --git a/indra/newview/llavatarrenderinfoaccountant.cpp b/indra/newview/llavatarrenderinfoaccountant.cpp index e778e0c032..5780268acb 100644 --- a/indra/newview/llavatarrenderinfoaccountant.cpp +++ b/indra/newview/llavatarrenderinfoaccountant.cpp @@ -256,6 +256,9 @@ void LLAvatarRenderInfoAccountant::sendRenderInfoToRegion(LLViewerRegion * regio { llinfos << "LRI: Sending avatar render info for " << avatar->getID() << ": " << info << llendl; + llinfos << "LRI: geometry " << avatar->getAttachmentGeometryBytes() + << ", area " << avatar->getAttachmentSurfaceArea() + << llendl; } } } -- cgit v1.2.3 From f806073646b4fe9c1bfcfa9d4793d371f3c42342 Mon Sep 17 00:00:00 2001 From: MaximB ProductEngine Date: Mon, 30 Sep 2013 11:40:01 +0300 Subject: MAINT-3193 FIXED crash with LLControlCache::LLControlCache: Control named RenderAutoMuteLoggingnot found. --- indra/newview/llavatarrenderinfoaccountant.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llavatarrenderinfoaccountant.cpp') diff --git a/indra/newview/llavatarrenderinfoaccountant.cpp b/indra/newview/llavatarrenderinfoaccountant.cpp index 5780268acb..9e3225a264 100644 --- a/indra/newview/llavatarrenderinfoaccountant.cpp +++ b/indra/newview/llavatarrenderinfoaccountant.cpp @@ -393,6 +393,6 @@ void LLAvatarRenderInfoAccountant::expireRenderInfoReportTimer(const LLUUID& reg // static bool LLAvatarRenderInfoAccountant::logRenderInfo() { - static LLCachedControl render_mute_logging_enabled(gSavedSettings, "RenderAutoMuteLogging"); + static LLCachedControl render_mute_logging_enabled(gSavedSettings, "RenderAutoMuteLogging", false); return render_mute_logging_enabled; } -- cgit v1.2.3