From c71cf9cf23ff7a9928695367e9b62db3bed38ed7 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Mon, 1 Dec 2014 13:45:48 -0500 Subject: Improve display of avatar rendering info, remove last use of RenderAutoMuteFunctions --- indra/newview/llavatarrenderinfoaccountant.cpp | 29 -------------------------- 1 file changed, 29 deletions(-) (limited to 'indra/newview/llavatarrenderinfoaccountant.cpp') diff --git a/indra/newview/llavatarrenderinfoaccountant.cpp b/indra/newview/llavatarrenderinfoaccountant.cpp index 38e153137c..ca2674bf94 100644 --- a/indra/newview/llavatarrenderinfoaccountant.cpp +++ b/indra/newview/llavatarrenderinfoaccountant.cpp @@ -335,35 +335,6 @@ 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", 0); - 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); - } - } - } } -- cgit v1.2.3 From 9785a88ba447087fb547794430f24d7513909cbe Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Wed, 3 Dec 2014 10:13:50 -0500 Subject: further improvements to avatar render info display and logging of associated server messages --- indra/newview/llavatarrenderinfoaccountant.cpp | 119 +++++++++++-------------- 1 file changed, 54 insertions(+), 65 deletions(-) (limited to 'indra/newview/llavatarrenderinfoaccountant.cpp') diff --git a/indra/newview/llavatarrenderinfoaccountant.cpp b/indra/newview/llavatarrenderinfoaccountant.cpp index ca2674bf94..83ae0438d9 100644 --- a/indra/newview/llavatarrenderinfoaccountant.cpp +++ b/indra/newview/llavatarrenderinfoaccountant.cpp @@ -70,14 +70,14 @@ public: LLViewerRegion * regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); if (regionp) { - LL_WARNS() << "HTTP error result for avatar weight GET: " << statusNum + LL_WARNS("AvatarRenderInfo") << "HTTP error result for avatar weight GET: " << statusNum << ", " << reason << " returned by region " << regionp->getName() << LL_ENDL; } else { - LL_WARNS() << "Avatar render weight GET error recieved but region not found for " + LL_WARNS("AvatarRenderInfo") << "Avatar render weight GET error recieved but region not found for " << mRegionHandle << ", error " << statusNum << ", " << reason @@ -91,10 +91,7 @@ public: LLViewerRegion * regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); if (regionp) { - if (LLAvatarRenderInfoAccountant::logRenderInfo()) - { - LL_INFOS() << "LRI: Result for avatar weights request for region " << regionp->getName() << ":" << LL_ENDL; - } + LL_DEBUGS("AvatarRenderInfo") << "LRI: Result for avatar weights request for region '" << regionp->getName() << "':" << LL_ENDL; if (content.isMap()) { @@ -109,40 +106,57 @@ public: 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()) + if ( avatarp + && avatarp->isAvatar() + && agent_info_map.isMap()) { // Extract the data for this avatar - if (LLAvatarRenderInfoAccountant::logRenderInfo()) - { - LL_INFOS() << "LRI: Agent " << target_agent_id - << ": " << agent_info_map << LL_ENDL; - } + LL_DEBUGS("AvatarRenderInfo") << "LRI: Agent " << target_agent_id + << ": " << agent_info_map << LL_ENDL; if (agent_info_map.has(KEY_WEIGHT)) { ((LLVOAvatar *) avatarp)->setReportedVisualComplexity(agent_info_map[KEY_WEIGHT].asInteger()); } } + else + { + LL_WARNS("AvatarRenderInfo") << "LRI: agent entry invalid" + << " agent " << target_agent_id + << " map " << agent_info_map + << LL_ENDL; + } report_iter++; } } + else + { + LL_WARNS("AvatarRenderInfo") << "LRI: malformed get response agents content is not map" << LL_ENDL; + } + } // has "agents" else if (content.has(KEY_ERROR)) { const LLSD & error = content[KEY_ERROR]; - LL_WARNS() << "Avatar render info GET error: " + LL_WARNS("AvatarRenderInfo") << "Avatar render info GET error: " << error[KEY_IDENTIFIER] << ": " << error[KEY_MESSAGE] << " from region " << regionp->getName() << LL_ENDL; } + else + { + LL_WARNS("AvatarRenderInfo") << "LRI: no agent key in get response" << LL_ENDL; + } + } + else + { + LL_WARNS("AvatarRenderInfo") << "LRI: malformed get response is not map" << LL_ENDL; } } else { - LL_INFOS() << "Avatar render weight info recieved but region not found for " + LL_WARNS("AvatarRenderInfo") << "Avatar render weight info recieved but region not found for " << mRegionHandle << LL_ENDL; } } @@ -165,14 +179,14 @@ public: LLViewerRegion * regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); if (regionp) { - LL_WARNS() << "HTTP error result for avatar weight POST: " << statusNum + LL_WARNS("AvatarRenderInfo") << "HTTP error result for avatar weight POST: " << statusNum << ", " << reason << " returned by region " << regionp->getName() << LL_ENDL; } else { - LL_WARNS() << "Avatar render weight POST error recieved but region not found for " + LL_WARNS("AvatarRenderInfo") << "Avatar render weight POST error recieved but region not found for " << mRegionHandle << ", error " << statusNum << ", " << reason @@ -185,18 +199,15 @@ public: LLViewerRegion * regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); if (regionp) { - if (LLAvatarRenderInfoAccountant::logRenderInfo()) - { - LL_INFOS() << "LRI: Result for avatar weights POST for region " << regionp->getName() - << ": " << content << LL_ENDL; - } + LL_DEBUGS("AvatarRenderInfo") << "LRI: Result for avatar weights POST for region " << regionp->getName() + << ": " << content << LL_ENDL; if (content.isMap()) { if (content.has(KEY_ERROR)) { const LLSD & error = content[KEY_ERROR]; - LL_WARNS() << "Avatar render info POST error: " + LL_WARNS("AvatarRenderInfo") << "Avatar render info POST error: " << error[KEY_IDENTIFIER] << ": " << error[KEY_MESSAGE] << " from region " << regionp->getName() @@ -206,7 +217,7 @@ public: } else { - LL_INFOS() << "Avatar render weight POST result recieved but region not found for " + LL_INFOS("AvatarRenderInfo") << "Avatar render weight POST result recieved but region not found for " << mRegionHandle << LL_ENDL; } } @@ -223,13 +234,10 @@ void LLAvatarRenderInfoAccountant::sendRenderInfoToRegion(LLViewerRegion * regio std::string url = regionp->getCapability("AvatarRenderInfo"); if (!url.empty()) { - if (logRenderInfo()) - { - LL_INFOS() << "LRI: Sending avatar render info to region " - << regionp->getName() - << " from " << url - << LL_ENDL; - } + LL_DEBUGS("AvatarRenderInfo") << "LRI: Checking for avatar render info to send to region " + << regionp->getName() + << " from " << url + << LL_ENDL; // Build the render info to POST to the region LLSD report = LLSD::emptyMap(); @@ -252,14 +260,8 @@ void LLAvatarRenderInfoAccountant::sendRenderInfoToRegion(LLViewerRegion * regio info[KEY_WEIGHT] = avatar->getVisualComplexity(); agents[avatar->getID().asString()] = info; - if (logRenderInfo()) - { - LL_INFOS() << "LRI: Sending avatar render info for " << avatar->getID() - << ": " << info << LL_ENDL; - LL_INFOS() << "LRI: other info geometry " << avatar->getAttachmentGeometryBytes() - << ", area " << avatar->getAttachmentSurfaceArea() - << LL_ENDL; - } + LL_DEBUGS("AvatarRenderInfo") << "LRI: Sending avatar render info for " << avatar->getID() + << ": " << info << LL_ENDL; } } iter++; @@ -268,6 +270,9 @@ void LLAvatarRenderInfoAccountant::sendRenderInfoToRegion(LLViewerRegion * regio report[KEY_AGENTS] = agents; if (agents.size() > 0) { + LL_INFOS("AvatarRenderInfo") << "LRI: Sending info for " << agents.size() + << " avatars to region " << regionp->getName() + << LL_ENDL; LLHTTPClient::post(url, report, new LLAvatarRenderInfoPostResponder(regionp->getHandle())); } } @@ -283,13 +288,10 @@ void LLAvatarRenderInfoAccountant::getRenderInfoFromRegion(LLViewerRegion * regi std::string url = regionp->getCapability("AvatarRenderInfo"); if (!url.empty()) { - if (logRenderInfo()) - { - LL_INFOS() << "LRI: Requesting avatar render info for region " - << regionp->getName() - << " from " << url - << LL_ENDL; - } + LL_DEBUGS("AvatarRenderInfo") << "LRI: Requesting avatar render info for region " + << regionp->getName() + << " from " << url + << LL_ENDL; // First send a request to get the latest data LLHTTPClient::get(url, new LLAvatarRenderInfoGetResponder(regionp->getHandle())); @@ -308,11 +310,8 @@ void LLAvatarRenderInfoAccountant::idle() S32 num_avs = LLCharacter::sInstances.size(); - if (logRenderInfo()) - { - LL_INFOS() << "LRI: Scanning all regions and checking for render info updates" - << LL_ENDL; - } + LL_DEBUGS("AvatarRenderInfo") << "LRI: Scanning all regions and checking for render info updates" + << LL_ENDL; // 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(); @@ -344,12 +343,9 @@ void LLAvatarRenderInfoAccountant::idle() // are returned for a new LLViewerRegion, and is the earliest time to get render info void LLAvatarRenderInfoAccountant::expireRenderInfoReportTimer(const LLUUID& region_id) { - if (logRenderInfo()) - { - LL_INFOS() << "LRI: Viewer has new region capabilities, clearing global render info timer" - << " and timer for region " << region_id - << LL_ENDL; - } + LL_INFOS("AvatarRenderInfo") << "LRI: Viewer has new region capabilities, clearing global render info timer" + << " and timer for region " << region_id + << LL_ENDL; // Reset the global timer so it will scan regions immediately sRenderInfoReportTimer.reset(); @@ -360,10 +356,3 @@ void LLAvatarRenderInfoAccountant::expireRenderInfoReportTimer(const LLUUID& reg regionp->getRenderInfoRequestTimer().reset(); } } - -// static -bool LLAvatarRenderInfoAccountant::logRenderInfo() -{ - static LLCachedControl render_mute_logging_enabled(gSavedSettings, "RenderAutoMuteLogging", false); - return render_mute_logging_enabled; -} -- cgit v1.2.3 From fe627f64742cbec698df0a907cb8aaea297df599 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Mon, 15 Dec 2014 15:59:49 -0500 Subject: MAINT-4716: correct reading of and debug display for avatar render cost info --- indra/newview/llavatarrenderinfoaccountant.cpp | 470 ++++++++++++++----------- 1 file changed, 266 insertions(+), 204 deletions(-) (limited to 'indra/newview/llavatarrenderinfoaccountant.cpp') diff --git a/indra/newview/llavatarrenderinfoaccountant.cpp b/indra/newview/llavatarrenderinfoaccountant.cpp index 83ae0438d9..8631f245a9 100644 --- a/indra/newview/llavatarrenderinfoaccountant.cpp +++ b/indra/newview/llavatarrenderinfoaccountant.cpp @@ -28,14 +28,16 @@ // 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 "httprequest.h" +#include "httphandler.h" +#include "httpresponse.h" +#include "llcorehttputil.h" +#include "llappcorehttp.h" #include "lltimer.h" #include "llviewercontrol.h" #include "llviewermenu.h" @@ -43,6 +45,8 @@ #include "llviewerregion.h" #include "llvoavatar.h" #include "llworld.h" +// associated header +#include "llavatarrenderinfoaccountant.h" static const std::string KEY_AGENTS = "agents"; // map @@ -53,228 +57,259 @@ 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; +static const F32 SECS_BETWEEN_REGION_SCANS = 5.f; // Scan the region list every 5 seconds +static const F32 SECS_BETWEEN_REGION_REQUEST = 15.0; // Look for new avs every 15 seconds +static const F32 SECS_BETWEEN_REGION_REPORTS = 60.0; // Update each region every 60 seconds + + +// The policy class for HTTP traffic; this is the right value for all capability requests. +static LLCore::HttpRequest::policy_t http_policy(LLAppCoreHttp::AP_REPORTING); + +// Priority for HTTP requests. Use 0U. +static LLCore::HttpRequest::priority_t http_priority(0U); +LLAvatarRenderInfoAccountant::LLAvatarRenderInfoAccountant() + : mHttpRequest(new LLCore::HttpRequest) + , mHttpHeaders(new LLCore::HttpHeaders) + , mHttpOptions(new LLCore::HttpOptions) +{ + mHttpOptions->setTransferTimeout(SECS_BETWEEN_REGION_SCANS); + + mHttpHeaders->append(HTTP_OUT_HEADER_CONTENT_TYPE, HTTP_CONTENT_LLSD_XML); + mHttpHeaders->append(HTTP_OUT_HEADER_ACCEPT, HTTP_CONTENT_LLSD_XML); +} + +LLAvatarRenderInfoAccountant::~LLAvatarRenderInfoAccountant() +{ + mHttpOptions->release(); + mHttpHeaders->release(); + // delete mHttpRequest; ??? +} // HTTP responder class for GET request for avatar render weight information -class LLAvatarRenderInfoGetResponder : public LLHTTPClient::Responder +class LLAvatarRenderInfoGetHandler : public LLCore::HttpHandler { +private: + LOG_CLASS(LLAvatarRenderInfoGetHandler); + public: - LLAvatarRenderInfoGetResponder(U64 region_handle) : mRegionHandle(region_handle) + LLAvatarRenderInfoGetHandler() : LLCore::HttpHandler() { } - virtual void error(U32 statusNum, const std::string& reason) - { - LLViewerRegion * regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); - if (regionp) + void onCompleted(LLCore::HttpHandle handle, + LLCore::HttpResponse* response) { - LL_WARNS("AvatarRenderInfo") << "HTTP error result for avatar weight GET: " << statusNum - << ", " << reason - << " returned by region " << regionp->getName() - << LL_ENDL; - } - else - { - LL_WARNS("AvatarRenderInfo") << "Avatar render weight GET error recieved but region not found for " - << mRegionHandle - << ", error " << statusNum - << ", " << reason - << LL_ENDL; - } - - } - - virtual void result(const LLSD& content) - { - LLViewerRegion * regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); - if (regionp) - { - LL_DEBUGS("AvatarRenderInfo") << "LRI: Result for avatar weights request for region '" << regionp->getName() << "':" << LL_ENDL; - - if (content.isMap()) - { - if (content.has(KEY_AGENTS)) + LLCore::HttpStatus status = response->getStatus(); + if (status) + { + LLSD avatar_render_info; + if (LLCoreHttpUtil::responseToLLSD(response, false /* quiet logging */, + avatar_render_info)) { - const LLSD & agents = content[KEY_AGENTS]; - if (agents.isMap()) + if (avatar_render_info.isMap()) { - LLSD::map_const_iterator report_iter = agents.beginMap(); - while (report_iter != agents.endMap()) + if (avatar_render_info.has(KEY_AGENTS)) { - 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 - - LL_DEBUGS("AvatarRenderInfo") << "LRI: Agent " << target_agent_id - << ": " << agent_info_map << LL_ENDL; - - if (agent_info_map.has(KEY_WEIGHT)) + const LLSD & agents = avatar_render_info[KEY_AGENTS]; + if (agents.isMap()) + { + for (LLSD::map_const_iterator agent_iter = agents.beginMap(); + agent_iter != agents.endMap(); + agent_iter++ + ) { - ((LLVOAvatar *) avatarp)->setReportedVisualComplexity(agent_info_map[KEY_WEIGHT].asInteger()); - } + LLUUID target_agent_id = LLUUID(agent_iter->first); + LLViewerObject* avatarp = gObjectList.findObject(target_agent_id); + if (avatarp && avatarp->isAvatar()) + { + const LLSD & agent_info_map = agent_iter->second; + if (agent_info_map.isMap()) + { + LL_DEBUGS("AvatarRenderInfo") << " Agent " << target_agent_id + << ": " << agent_info_map << LL_ENDL; + + if (agent_info_map.has(KEY_WEIGHT)) + { + ((LLVOAvatar *) avatarp)->setReportedVisualComplexity(agent_info_map[KEY_WEIGHT].asInteger()); + } + } + else + { + LL_WARNS("AvatarRenderInfo") << "agent entry invalid" + << " agent " << target_agent_id + << " map " << agent_info_map + << LL_ENDL; + } + } + else + { + LL_DEBUGS("AvatarRenderInfo") << "Unknown agent " << target_agent_id << LL_ENDL; + } + } // for agent_iter } else { - LL_WARNS("AvatarRenderInfo") << "LRI: agent entry invalid" - << " agent " << target_agent_id - << " map " << agent_info_map - << LL_ENDL; + LL_WARNS("AvatarRenderInfo") << "malformed get response agents avatar_render_info is not map" << LL_ENDL; } - report_iter++; + } // has "agents" + else if (avatar_render_info.has(KEY_ERROR)) + { + const LLSD & error = avatar_render_info[KEY_ERROR]; + LL_WARNS("AvatarRenderInfo") << "Avatar render info GET error: " + << error[KEY_IDENTIFIER] + << ": " << error[KEY_MESSAGE] + << LL_ENDL; + } + else + { + LL_WARNS("AvatarRenderInfo") << "no agent key in get response" << LL_ENDL; } } else { - LL_WARNS("AvatarRenderInfo") << "LRI: malformed get response agents content is not map" << LL_ENDL; + LL_WARNS("AvatarRenderInfo") << "malformed get response is not map" << LL_ENDL; } - - } // has "agents" - else if (content.has(KEY_ERROR)) - { - const LLSD & error = content[KEY_ERROR]; - LL_WARNS("AvatarRenderInfo") << "Avatar render info GET error: " - << error[KEY_IDENTIFIER] - << ": " << error[KEY_MESSAGE] - << " from region " << regionp->getName() - << LL_ENDL; - } + } else { - LL_WARNS("AvatarRenderInfo") << "LRI: no agent key in get response" << LL_ENDL; + LL_WARNS("AvatarRenderInfo") << "malformed get response parse failure" << LL_ENDL; } - } - else - { - LL_WARNS("AvatarRenderInfo") << "LRI: malformed get response is not map" << LL_ENDL; - } - } - else - { - LL_WARNS("AvatarRenderInfo") << "Avatar render weight info recieved but region not found for " - << mRegionHandle << LL_ENDL; + } + else + { + // Something went wrong. Translate the status to + // a meaningful message. + LL_WARNS("AvatarRenderInfo") << "GET failed Status: " + << status.toTerseString() + << ", Reason: " << status.toString() + << LL_ENDL; + } + + delete this; // release the handler object } - } - -private: - U64 mRegionHandle; }; // HTTP responder class for POST request for avatar render weight information -class LLAvatarRenderInfoPostResponder : public LLHTTPClient::Responder +class LLAvatarRenderInfoPostHandler : public LLCore::HttpHandler { -public: - LLAvatarRenderInfoPostResponder(U64 region_handle) : mRegionHandle(region_handle) - { - } + private: + LOG_CLASS(LLAvatarRenderInfoPostHandler); - virtual void error(U32 statusNum, const std::string& reason) + public: + LLAvatarRenderInfoPostHandler() : LLCore::HttpHandler() { - LLViewerRegion * regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); - if (regionp) - { - LL_WARNS("AvatarRenderInfo") << "HTTP error result for avatar weight POST: " << statusNum - << ", " << reason - << " returned by region " << regionp->getName() - << LL_ENDL; - } - else - { - LL_WARNS("AvatarRenderInfo") << "Avatar render weight POST error recieved but region not found for " - << mRegionHandle - << ", error " << statusNum - << ", " << reason - << LL_ENDL; - } } - virtual void result(const LLSD& content) - { - LLViewerRegion * regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); - if (regionp) + void onCompleted(LLCore::HttpHandle handle, + LLCore::HttpResponse* response) { - LL_DEBUGS("AvatarRenderInfo") << "LRI: Result for avatar weights POST for region " << regionp->getName() - << ": " << content << LL_ENDL; - - if (content.isMap()) + LLCore::HttpStatus status = response->getStatus(); + if (status) { - if (content.has(KEY_ERROR)) - { - const LLSD & error = content[KEY_ERROR]; - LL_WARNS("AvatarRenderInfo") << "Avatar render info POST error: " - << error[KEY_IDENTIFIER] - << ": " << error[KEY_MESSAGE] - << " from region " << regionp->getName() - << LL_ENDL; - } + LL_DEBUGS("AvatarRenderInfo") << "post succeeded" << LL_ENDL; } + else + { + // Something went wrong. Translate the status to + // a meaningful message. + LL_WARNS("AvatarRenderInfo") << "POST failed Status: " + << status.toTerseString() + << ", Reason: " << status.toString() + << LL_ENDL; + } + + delete this; // release the handler object } - else - { - LL_INFOS("AvatarRenderInfo") << "Avatar render weight POST result recieved but region not found for " - << mRegionHandle << LL_ENDL; - } - } - -private: - U64 mRegionHandle; }; -// static // Send request for one region, no timer checks +// called when the void LLAvatarRenderInfoAccountant::sendRenderInfoToRegion(LLViewerRegion * regionp) { - std::string url = regionp->getCapability("AvatarRenderInfo"); - if (!url.empty()) + if ( regionp->getRenderInfoReportTimer().hasExpired() ) // Time to make request { - LL_DEBUGS("AvatarRenderInfo") << "LRI: Checking for avatar render info to send to region " - << regionp->getName() - << " from " << url - << LL_ENDL; - - // 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() ) + U32 num_avs = 0; + + std::string url = regionp->getCapability("AvatarRenderInfo"); + if (!url.empty()) { - LLVOAvatar* avatar = dynamic_cast(*iter); - if (avatar && - 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 + // Build the render info to POST to the region + LLSD agents = LLSD::emptyMap(); + + std::vector::iterator iter = LLCharacter::sInstances.begin(); + while( iter != LLCharacter::sInstances.end() ) { - avatar->calculateUpdateRenderCost(); // Make sure the numbers are up-to-date - - LLSD info = LLSD::emptyMap(); - if (avatar->getVisualComplexity() > 0) + LLVOAvatar* avatar = dynamic_cast(*iter); + if (avatar && + 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 { - info[KEY_WEIGHT] = avatar->getVisualComplexity(); - agents[avatar->getID().asString()] = info; + avatar->calculateUpdateRenderCost(); // Make sure the numbers are up-to-date - LL_DEBUGS("AvatarRenderInfo") << "LRI: Sending avatar render info for " << avatar->getID() - << ": " << info << LL_ENDL; + LLSD info = LLSD::emptyMap(); + if (avatar->getVisualComplexity() > 0) + { + info[KEY_WEIGHT] = avatar->getVisualComplexity(); + agents[avatar->getID().asString()] = info; + + LL_DEBUGS("AvatarRenderInfo") << "Sending avatar render info for " << avatar->getID() + << ": " << info << LL_ENDL; + num_avs++; + } } + iter++; } - iter++; - } - report[KEY_AGENTS] = agents; - if (agents.size() > 0) + if (num_avs > 0) + { + LLSD report = LLSD::emptyMap(); + report[KEY_AGENTS] = agents; + + LLCore::HttpHandle handle(LLCORE_HTTP_HANDLE_INVALID); + LLAvatarRenderInfoPostHandler* handler = new LLAvatarRenderInfoPostHandler; + + handle = LLCoreHttpUtil::requestPostWithLLSD(mHttpRequest, + http_policy, + http_priority, + url, + report, + mHttpOptions, + mHttpHeaders, + handler); + if (LLCORE_HTTP_HANDLE_INVALID == handle) + { + LLCore::HttpStatus status(mHttpRequest->getStatus()); + LL_WARNS("AvatarRenderInfo") << "HTTP POST request failed" + << " Status: " << status.toTerseString() + << " Reason: '" << status.toString() << "'" + << LL_ENDL; + delete handler; + } + else + { + LL_INFOS("AvatarRenderInfo") << "Sent render costs for " << num_avs + << " avatars to region " << regionp->getName() + << LL_ENDL; + + + } + } + else + { + LL_DEBUGS("AvatarRenderInfo") << "no agent info to send" << LL_ENDL; + } + } + else { - LL_INFOS("AvatarRenderInfo") << "LRI: Sending info for " << agents.size() - << " avatars to region " << regionp->getName() - << LL_ENDL; - LLHTTPClient::post(url, report, new LLAvatarRenderInfoPostResponder(regionp->getHandle())); + LL_WARNS("AvatarRenderInfo") << "AvatarRenderInfo cap is empty" << LL_ENDL; } + + // Reset this regions timer, moving to longer intervals if there are lots of avatars around + regionp->getRenderInfoReportTimer().resetWithExpiry(SECS_BETWEEN_REGION_REPORTS + (2.f * num_avs)); } } @@ -285,16 +320,39 @@ void LLAvatarRenderInfoAccountant::sendRenderInfoToRegion(LLViewerRegion * regio // Send request for one region, no timer checks void LLAvatarRenderInfoAccountant::getRenderInfoFromRegion(LLViewerRegion * regionp) { - std::string url = regionp->getCapability("AvatarRenderInfo"); - if (!url.empty()) + if (regionp->getRenderInfoRequestTimer().hasExpired()) { - LL_DEBUGS("AvatarRenderInfo") << "LRI: Requesting avatar render info for region " - << regionp->getName() - << " from " << url - << LL_ENDL; + std::string url = regionp->getCapability("AvatarRenderInfo"); + if (!url.empty()) + { + + LLAvatarRenderInfoGetHandler* handler = new LLAvatarRenderInfoGetHandler; + // First send a request to get the latest data + LLCore::HttpHandle handle = mHttpRequest->requestGet(http_policy, + http_priority, + url, + NULL, + NULL, + handler); + if (LLCORE_HTTP_HANDLE_INVALID != handle) + { + LL_INFOS("AvatarRenderInfo") << "Requested avatar render info for region " + << regionp->getName() + << LL_ENDL; + } + else + { + LL_WARNS("AvatarRenderInfo") << "Failed to launch HTTP GET request. Try again." + << LL_ENDL; + delete handler; + } + } + else + { + LL_WARNS("AvatarRenderInfo") << "no AvatarRenderInfo cap for " << regionp->getName() << LL_ENDL; + } - // First send a request to get the latest data - LLHTTPClient::get(url, new LLAvatarRenderInfoGetResponder(regionp->getHandle())); + regionp->getRenderInfoRequestTimer().resetWithExpiry(SECS_BETWEEN_REGION_REQUEST); } } @@ -303,56 +361,60 @@ void LLAvatarRenderInfoAccountant::getRenderInfoFromRegion(LLViewerRegion * regi // 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 + mHttpRequest->update(0); // give any pending http operations a chance to call completion methods - S32 num_avs = LLCharacter::sInstances.size(); - - LL_DEBUGS("AvatarRenderInfo") << "LRI: Scanning all regions and checking for render info updates" + if (mRenderInfoScanTimer.hasExpired()) + { + LL_DEBUGS("AvatarRenderInfo") << "Scanning regions for render info updates" << LL_ENDL; - // Check all regions and see if it's time to fetch/send data + // Check all regions for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); - iter != LLWorld::getInstance()->getRegionList().end(); ++iter) + 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 + if ( regionp + && regionp->isAlive() + && regionp->capabilitiesReceived()) { + // each of these is further governed by and resets its own timer 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); + mRenderInfoScanTimer.resetWithExpiry(SECS_BETWEEN_REGION_SCANS); } } +void LLAvatarRenderInfoAccountant::resetRenderInfoScanTimer() +{ + // this will force the next frame to rescan + mRenderInfoScanTimer.reset(); +} // 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 +// 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(const LLUUID& region_id) +void LLAvatarRenderInfoAccountant::scanNewRegion(const LLUUID& region_id) { - LL_INFOS("AvatarRenderInfo") << "LRI: Viewer has new region capabilities, clearing global render info timer" - << " and timer for region " << region_id - << LL_ENDL; + LL_INFOS("AvatarRenderInfo") << region_id << LL_ENDL; - // Reset the global timer so it will scan regions immediately - sRenderInfoReportTimer.reset(); + // Reset the global timer so it will scan regions on the next call to ::idle + LLAvatarRenderInfoAccountant::getInstance()->resetRenderInfoScanTimer(); LLViewerRegion* regionp = LLWorld::instance().getRegionFromID(region_id); if (regionp) - { // Reset the region's timer so it will request data immediately + { // Reset the region's timers so we will: + // * request render info from it immediately + // * report on the following scan regionp->getRenderInfoRequestTimer().reset(); + regionp->getRenderInfoReportTimer().resetWithExpiry(SECS_BETWEEN_REGION_SCANS); + } + else + { + LL_WARNS("AvatarRenderInfo") << "unable to resolve region "< Date: Sun, 22 Feb 2015 08:30:13 -0500 Subject: add visual mute status to rendering info reported to the simulator --- indra/newview/llavatarrenderinfoaccountant.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llavatarrenderinfoaccountant.cpp') diff --git a/indra/newview/llavatarrenderinfoaccountant.cpp b/indra/newview/llavatarrenderinfoaccountant.cpp index cdaf97ff62..44e19b1449 100644 --- a/indra/newview/llavatarrenderinfoaccountant.cpp +++ b/indra/newview/llavatarrenderinfoaccountant.cpp @@ -51,6 +51,7 @@ static const std::string KEY_AGENTS = "agents"; // map static const std::string KEY_WEIGHT = "weight"; // integer +static const std::string KEY_MUTED = "muted"; // bool static const std::string KEY_IDENTIFIER = "identifier"; static const std::string KEY_MESSAGE = "message"; @@ -254,6 +255,7 @@ void LLAvatarRenderInfoAccountant::sendRenderInfoToRegion(LLViewerRegion * regio if (avatar->getVisualComplexity() > 0) { info[KEY_WEIGHT] = avatar->getVisualComplexity(); + info[KEY_MUTED] = avatar->isVisuallyMuted(); agents[avatar->getID().asString()] = info; LL_DEBUGS("AvatarRenderInfo") << "Sending avatar render info for " << avatar->getID() -- cgit v1.2.3 From 1da60c1d92e7af7d9f3de141574179717cf1e9cd Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Fri, 17 Apr 2015 13:37:46 -0400 Subject: reorganize visual muting, impostors, and complexity criteria [does not render correctly yet] --- 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 44e19b1449..5746a43306 100644 --- a/indra/newview/llavatarrenderinfoaccountant.cpp +++ b/indra/newview/llavatarrenderinfoaccountant.cpp @@ -51,7 +51,7 @@ static const std::string KEY_AGENTS = "agents"; // map static const std::string KEY_WEIGHT = "weight"; // integer -static const std::string KEY_MUTED = "muted"; // bool +static const std::string KEY_TOO_COMPLEX = "tooComplex"; // bool static const std::string KEY_IDENTIFIER = "identifier"; static const std::string KEY_MESSAGE = "message"; @@ -255,7 +255,7 @@ void LLAvatarRenderInfoAccountant::sendRenderInfoToRegion(LLViewerRegion * regio if (avatar->getVisualComplexity() > 0) { info[KEY_WEIGHT] = avatar->getVisualComplexity(); - info[KEY_MUTED] = avatar->isVisuallyMuted(); + info[KEY_TOO_COMPLEX] = avatar->isTooComplex(); agents[avatar->getID().asString()] = info; LL_DEBUGS("AvatarRenderInfo") << "Sending avatar render info for " << avatar->getID() -- cgit v1.2.3 From 3537b6a70e618390696dcf71bd0db9e2a2136ca0 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Fri, 15 May 2015 15:30:04 -0400 Subject: add reception of how many avatars report that you are over their limit --- indra/newview/llavatarrenderinfoaccountant.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'indra/newview/llavatarrenderinfoaccountant.cpp') diff --git a/indra/newview/llavatarrenderinfoaccountant.cpp b/indra/newview/llavatarrenderinfoaccountant.cpp index 5746a43306..76d8d98186 100644 --- a/indra/newview/llavatarrenderinfoaccountant.cpp +++ b/indra/newview/llavatarrenderinfoaccountant.cpp @@ -52,6 +52,8 @@ static const std::string KEY_AGENTS = "agents"; // map static const std::string KEY_WEIGHT = "weight"; // integer static const std::string KEY_TOO_COMPLEX = "tooComplex"; // bool +static const std::string KEY_OVER_COMPLEXITY_LIMIT = "overlimit"; // integer +static const std::string KEY_REPORTING_COMPLEXITY_LIMIT = "reportinglimit"; // integer static const std::string KEY_IDENTIFIER = "identifier"; static const std::string KEY_MESSAGE = "message"; @@ -104,12 +106,23 @@ public: LLCore::HttpStatus status = response->getStatus(); if (status) { + LL_DEBUGS("AvatarRenderInfo") << "response"<getRenderInfoReportTimer().hasExpired() ) // Time to make request @@ -255,7 +268,7 @@ void LLAvatarRenderInfoAccountant::sendRenderInfoToRegion(LLViewerRegion * regio if (avatar->getVisualComplexity() > 0) { info[KEY_WEIGHT] = avatar->getVisualComplexity(); - info[KEY_TOO_COMPLEX] = avatar->isTooComplex(); + info[KEY_TOO_COMPLEX] = LLSD::Boolean(avatar->isTooComplex()); agents[avatar->getID().asString()] = info; LL_DEBUGS("AvatarRenderInfo") << "Sending avatar render info for " << avatar->getID() -- cgit v1.2.3 From 90590a06040d95bf0853d0c1b340b3a2aae46e51 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Wed, 8 Jul 2015 12:09:00 -0400 Subject: add markers for where the UI notice hooks go --- indra/newview/llavatarrenderinfoaccountant.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview/llavatarrenderinfoaccountant.cpp') diff --git a/indra/newview/llavatarrenderinfoaccountant.cpp b/indra/newview/llavatarrenderinfoaccountant.cpp index 76d8d98186..b8ec1e150b 100644 --- a/indra/newview/llavatarrenderinfoaccountant.cpp +++ b/indra/newview/llavatarrenderinfoaccountant.cpp @@ -120,7 +120,8 @@ public: U32 overlimit = avatar_render_info[KEY_OVER_COMPLEXITY_LIMIT].asInteger(); LL_DEBUGS("AvatarRenderInfo") << "complexity limit: "< Date: Wed, 19 Aug 2015 15:43:06 -0400 Subject: MAINT-5378 Add notices for avatar complexity changes --- indra/newview/llavatarrenderinfoaccountant.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'indra/newview/llavatarrenderinfoaccountant.cpp') diff --git a/indra/newview/llavatarrenderinfoaccountant.cpp b/indra/newview/llavatarrenderinfoaccountant.cpp index b8ec1e150b..595a5f0224 100644 --- a/indra/newview/llavatarrenderinfoaccountant.cpp +++ b/indra/newview/llavatarrenderinfoaccountant.cpp @@ -38,6 +38,7 @@ #include "httpresponse.h" #include "llcorehttputil.h" #include "llappcorehttp.h" +#include "llavatarrendernotifier.h" #include "lltimer.h" #include "llviewercontrol.h" #include "llviewermenu.h" @@ -102,7 +103,7 @@ public: void onCompleted(LLCore::HttpHandle handle, LLCore::HttpResponse* response) - { + { LLCore::HttpStatus status = response->getStatus(); if (status) { @@ -120,8 +121,8 @@ public: U32 overlimit = avatar_render_info[KEY_OVER_COMPLEXITY_LIMIT].asInteger(); LL_DEBUGS("AvatarRenderInfo") << "complexity limit: "<updateNotificationRegion(reporting, overlimit); } if (avatar_render_info.has(KEY_AGENTS)) -- cgit v1.2.3 From 206ef7a1562db19a4d8a41e55b7272c917f4b62c Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Tue, 25 Aug 2015 17:51:35 -0400 Subject: MAINT-5560: Correct imposter rendering flaws for avatars that have not had any attachments --- indra/newview/llavatarrenderinfoaccountant.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'indra/newview/llavatarrenderinfoaccountant.cpp') diff --git a/indra/newview/llavatarrenderinfoaccountant.cpp b/indra/newview/llavatarrenderinfoaccountant.cpp index 595a5f0224..03204ea48f 100644 --- a/indra/newview/llavatarrenderinfoaccountant.cpp +++ b/indra/newview/llavatarrenderinfoaccountant.cpp @@ -267,9 +267,10 @@ void LLAvatarRenderInfoAccountant::sendRenderInfoToRegion(LLViewerRegion * regio avatar->calculateUpdateRenderComplexity(); // Make sure the numbers are up-to-date LLSD info = LLSD::emptyMap(); - if (avatar->getVisualComplexity() > 0) + U32 avatar_complexity = avatar->getVisualComplexity(); + if (avatar_complexity > 0) { - info[KEY_WEIGHT] = avatar->getVisualComplexity(); + info[KEY_WEIGHT] = (S32)(avatar_complexity < S32_MAX ? avatar_complexity : S32_MAX); info[KEY_TOO_COMPLEX] = LLSD::Boolean(avatar->isTooComplex()); agents[avatar->getID().asString()] = info; -- cgit v1.2.3 From 712a4e70c81c1908e4e7668ff1695a9415ec4b71 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Wed, 26 Aug 2015 12:07:16 -0400 Subject: refine fix for MAINT-5560 based on review feedback and to fix VS objection --- indra/newview/llavatarrenderinfoaccountant.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview/llavatarrenderinfoaccountant.cpp') diff --git a/indra/newview/llavatarrenderinfoaccountant.cpp b/indra/newview/llavatarrenderinfoaccountant.cpp index 03204ea48f..d351b38653 100644 --- a/indra/newview/llavatarrenderinfoaccountant.cpp +++ b/indra/newview/llavatarrenderinfoaccountant.cpp @@ -268,8 +268,10 @@ void LLAvatarRenderInfoAccountant::sendRenderInfoToRegion(LLViewerRegion * regio LLSD info = LLSD::emptyMap(); U32 avatar_complexity = avatar->getVisualComplexity(); - if (avatar_complexity > 0) + if (avatar_complexity > 0) { + // the weight/complexity is unsigned, but LLSD only stores signed integers, + // so if it's over that (which would be ridiculously high), just store the maximum signed int value info[KEY_WEIGHT] = (S32)(avatar_complexity < S32_MAX ? avatar_complexity : S32_MAX); info[KEY_TOO_COMPLEX] = LLSD::Boolean(avatar->isTooComplex()); agents[avatar->getID().asString()] = info; -- cgit v1.2.3 From 2dcfa3b6bd3ebeeab62174d86f9dc85558bcb7c8 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Fri, 12 Feb 2016 16:58:41 -0500 Subject: Suppress some overly verbose logging --- 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 d351b38653..2760a97bda 100644 --- a/indra/newview/llavatarrenderinfoaccountant.cpp +++ b/indra/newview/llavatarrenderinfoaccountant.cpp @@ -311,7 +311,7 @@ void LLAvatarRenderInfoAccountant::sendRenderInfoToRegion(LLViewerRegion * regio } else { - LL_INFOS("AvatarRenderInfo") << "Sent render costs for " << num_avs + LL_DEBUGS("AvatarRenderInfo") << "Sent render costs for " << num_avs << " avatars to region " << regionp->getName() << LL_ENDL; @@ -356,7 +356,7 @@ void LLAvatarRenderInfoAccountant::getRenderInfoFromRegion(LLViewerRegion * regi handler); if (LLCORE_HTTP_HANDLE_INVALID != handle) { - LL_INFOS("AvatarRenderInfo") << "Requested avatar render info for region " + LL_DEBUGS("AvatarRenderInfo") << "Requested avatar render info for region " << regionp->getName() << LL_ENDL; } -- cgit v1.2.3 From f0107eb8aae46a928b0b3e6564cc4ed3031e1271 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Tue, 5 Apr 2016 17:01:15 -0400 Subject: fix merge error that broke reading avatar complexity reports from simulator --- indra/newview/llavatarrenderinfoaccountant.cpp | 113 ++++++++++--------------- 1 file changed, 46 insertions(+), 67 deletions(-) (limited to 'indra/newview/llavatarrenderinfoaccountant.cpp') diff --git a/indra/newview/llavatarrenderinfoaccountant.cpp b/indra/newview/llavatarrenderinfoaccountant.cpp index 2be3e8546f..5431daca32 100644 --- a/indra/newview/llavatarrenderinfoaccountant.cpp +++ b/indra/newview/llavatarrenderinfoaccountant.cpp @@ -103,89 +103,68 @@ void LLAvatarRenderInfoAccountant::avatarRenderInfoGetCoro(std::string url, U64 if (result.has(KEY_AGENTS)) { - const LLSD & avatar_render_info = result[KEY_AGENTS]; - if (avatar_render_info.isMap()) + const LLSD & agents = result[KEY_AGENTS]; + if (agents.isMap()) { - if ( avatar_render_info.has(KEY_REPORTING_COMPLEXITY_LIMIT) - && avatar_render_info.has(KEY_OVER_COMPLEXITY_LIMIT)) + for (LLSD::map_const_iterator agent_iter = agents.beginMap(); + agent_iter != agents.endMap(); + agent_iter++ + ) { - U32 reporting = avatar_render_info[KEY_REPORTING_COMPLEXITY_LIMIT].asInteger(); - U32 overlimit = avatar_render_info[KEY_OVER_COMPLEXITY_LIMIT].asInteger(); - - LL_DEBUGS("AvatarRenderInfo") << "complexity limit: "<updateNotificationRegion(reporting, overlimit); - } - - if (avatar_render_info.has(KEY_AGENTS)) - { - const LLSD & agents = avatar_render_info[KEY_AGENTS]; - if (agents.isMap()) + LLUUID target_agent_id = LLUUID(agent_iter->first); + LLViewerObject* avatarp = gObjectList.findObject(target_agent_id); + if (avatarp && avatarp->isAvatar()) { - for (LLSD::map_const_iterator agent_iter = agents.beginMap(); - agent_iter != agents.endMap(); - agent_iter++ - ) + const LLSD & agent_info_map = agent_iter->second; + if (agent_info_map.isMap()) { - LLUUID target_agent_id = LLUUID(agent_iter->first); - LLViewerObject* avatarp = gObjectList.findObject(target_agent_id); - if (avatarp && avatarp->isAvatar()) - { - const LLSD & agent_info_map = agent_iter->second; - if (agent_info_map.isMap()) - { - LL_DEBUGS("AvatarRenderInfo") << " Agent " << target_agent_id - << ": " << agent_info_map << LL_ENDL; - - if (agent_info_map.has(KEY_WEIGHT)) - { - ((LLVOAvatar *) avatarp)->setReportedVisualComplexity(agent_info_map[KEY_WEIGHT].asInteger()); - } - } - else - { - LL_WARNS("AvatarRenderInfo") << "agent entry invalid" - << " agent " << target_agent_id - << " map " << agent_info_map - << LL_ENDL; - } - } - else + LL_DEBUGS("AvatarRenderInfo") << " Agent " << target_agent_id + << ": " << agent_info_map << LL_ENDL; + + if (agent_info_map.has(KEY_WEIGHT)) { - LL_DEBUGS("AvatarRenderInfo") << "Unknown agent " << target_agent_id << LL_ENDL; + ((LLVOAvatar *) avatarp)->setReportedVisualComplexity(agent_info_map[KEY_WEIGHT].asInteger()); } - } // for agent_iter + } + else + { + LL_WARNS("AvatarRenderInfo") << "agent entry invalid" + << " agent " << target_agent_id + << " map " << agent_info_map + << LL_ENDL; + } } else { - LL_WARNS("AvatarRenderInfo") << "malformed get response agents avatar_render_info is not map" << LL_ENDL; + LL_DEBUGS("AvatarRenderInfo") << "Unknown agent " << target_agent_id << LL_ENDL; } - } // has "agents" - else if (avatar_render_info.has(KEY_ERROR)) - { - const LLSD & error = avatar_render_info[KEY_ERROR]; - LL_WARNS("AvatarRenderInfo") << "Avatar render info GET error: " - << error[KEY_IDENTIFIER] - << ": " << error[KEY_MESSAGE] - << LL_ENDL; - } - else - { - LL_WARNS("AvatarRenderInfo") << "no agent key in get response" << LL_ENDL; - } + } // for agent_iter } else { - LL_WARNS("AvatarRenderInfo") << "malformed get response is not map" << LL_ENDL; + LL_WARNS("AvatarRenderInfo") << "malformed get response '" << KEY_AGENTS << "' is not map" << LL_ENDL; } } // has "agents" - else if (result.has(KEY_ERROR)) + else + { + LL_INFOS("AvatarRenderInfo") << "no '"<< KEY_AGENTS << "' key in get response" << LL_ENDL; + } + + if ( result.has(KEY_REPORTING_COMPLEXITY_LIMIT) + && result.has(KEY_OVER_COMPLEXITY_LIMIT)) + { + U32 reporting = result[KEY_REPORTING_COMPLEXITY_LIMIT].asInteger(); + U32 overlimit = result[KEY_OVER_COMPLEXITY_LIMIT].asInteger(); + + LL_DEBUGS("AvatarRenderInfo") << "complexity limit: "<updateNotificationRegion(reporting, overlimit); + } + else { - const LLSD & error = result[KEY_ERROR]; - LL_WARNS() << "Avatar render info GET error: " - << error[KEY_IDENTIFIER] - << ": " << error[KEY_MESSAGE] - << " from region " << regionp->getName() + LL_WARNS("AvatarRenderInfo") + << "response is missing either '" << KEY_REPORTING_COMPLEXITY_LIMIT + << "' or '" << KEY_OVER_COMPLEXITY_LIMIT << "'" << LL_ENDL; } -- cgit v1.2.3