From f945415210f0e18c2c6d941fda6b7d45cb0f06f1 Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Wed, 13 Mar 2013 06:26:25 +0000 Subject: Large changes to the LLCurl::Responder API, as well as pulling in some changes to common libraries from the server codebase: * Additional error checking in http handlers. * Uniform log spam for http errors. * Switch to using constants for http heads and status codes. * Fixed bugs in incorrectly checking if parsing LLSD xml resulted in an error. * Reduced spam regarding LLSD parsing errors in the default completedRaw http handler. It should not longer be necessary to short-circuit completedRaw to avoid spam. * Ported over a few bug fixes from the server code. * Switch mode http status codes to use S32 instead of U32. * Ported LLSD::asStringRef from server code; avoids copying strings all over the place. * Ported server change to LLSD::asBinary; this always returns a reference now instead of copying the entire binary blob. * Ported server pretty notation format (and pretty binary format) to llsd serialization. * The new LLCurl::Responder API no longer has two error handlers to choose from. Overriding the following methods have been deprecated: ** error - use httpFailure ** errorWithContent - use httpFailure ** result - use httpSuccess ** completed - use httpCompleted ** completedHeader - no longer necessary; call getResponseHeaders() from a completion method to obtain these headers. * In order to 'catch' a completed http request, override one of these methods: ** httpSuccess - Called for any 2xx status code. ** httpFailure - Called for any non-2xx status code. ** httpComplete - Called for all status codes. Default implementation is to call either httpSuccess or httpFailure. * It is recommended to keep these methods protected/private in order to avoid triggering of these methods without using a 'push' method (see below). * Uniform error handling should followed whenever possible by calling a variant of this during httpFailure: ** llwarns << dumpResponse() << llendl; * Be sure to include LOG_CLASS(your_class_name) in your class in order for the log entry to give more context. * In order to 'push' a result into the responder, you should no longer call error, errorWithContent, result, or completed. * Nor should you directly call httpSuccess/Failure/Completed (unless passing a message up to a parent class). * Instead, you can set the internal content of a responder and trigger a corresponding method using the following methods: ** successResult - Sets results and calls httpSuccess ** failureResult - Sets results and calls httpFailure ** completedResult - Sets results and calls httpCompleted * To obtain information about a the response from a reponder method, use the following getters: ** getStatus - HTTP status code ** getReason - Reason string ** getContent - Content (Parsed body LLSD) ** getResponseHeaders - Response Headers (LLSD map) ** getHTTPMethod - HTTP method of the request ** getURL - URL of the request * It is still possible to override completeRaw if you want to manipulate data directly out of LLPumpIO. * See indra/llmessage/llcurl.h for more information. --- indra/newview/llagent.cpp | 46 +++++++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 21 deletions(-) (limited to 'indra/newview/llagent.cpp') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 20954e4bae..4b0f451036 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -2546,17 +2546,19 @@ int LLAgent::convertTextToMaturity(char text) class LLMaturityPreferencesResponder : public LLHTTPClient::Responder { + LOG_CLASS(LLMaturityPreferencesResponder); public: LLMaturityPreferencesResponder(LLAgent *pAgent, U8 pPreferredMaturity, U8 pPreviousMaturity); virtual ~LLMaturityPreferencesResponder(); - virtual void result(const LLSD &pContent); - virtual void errorWithContent(U32 pStatus, const std::string& pReason, const LLSD& pContent); +protected: + virtual void httpSuccess(); + virtual void httpFailure(); protected: private: - U8 parseMaturityFromServerResponse(const LLSD &pContent); + U8 parseMaturityFromServerResponse(const LLSD &pContent) const; LLAgent *mAgent; U8 mPreferredMaturity; @@ -2575,29 +2577,33 @@ LLMaturityPreferencesResponder::~LLMaturityPreferencesResponder() { } -void LLMaturityPreferencesResponder::result(const LLSD &pContent) +void LLMaturityPreferencesResponder::httpSuccess() { - U8 actualMaturity = parseMaturityFromServerResponse(pContent); + U8 actualMaturity = parseMaturityFromServerResponse(getContent()); if (actualMaturity != mPreferredMaturity) { - llwarns << "while attempting to change maturity preference from '" << LLViewerRegion::accessToString(mPreviousMaturity) - << "' to '" << LLViewerRegion::accessToString(mPreferredMaturity) << "', the server responded with '" - << LLViewerRegion::accessToString(actualMaturity) << "' [value:" << static_cast(actualMaturity) << ", llsd:" - << pContent << "]" << llendl; + llwarns << "while attempting to change maturity preference from '" + << LLViewerRegion::accessToString(mPreviousMaturity) + << "' to '" << LLViewerRegion::accessToString(mPreferredMaturity) + << "', the server responded with '" + << LLViewerRegion::accessToString(actualMaturity) + << "' [value:" << static_cast(actualMaturity) + << "], " << dumpResponse() << llendl; } mAgent->handlePreferredMaturityResult(actualMaturity); } -void LLMaturityPreferencesResponder::errorWithContent(U32 pStatus, const std::string& pReason, const LLSD& pContent) +void LLMaturityPreferencesResponder::httpFailure() { - llwarns << "while attempting to change maturity preference from '" << LLViewerRegion::accessToString(mPreviousMaturity) - << "' to '" << LLViewerRegion::accessToString(mPreferredMaturity) << "', we got an error with [status:" - << pStatus << "]: " << (pContent.isDefined() ? pContent : LLSD(pReason)) << llendl; + llwarns << "while attempting to change maturity preference from '" + << LLViewerRegion::accessToString(mPreviousMaturity) + << "' to '" << LLViewerRegion::accessToString(mPreferredMaturity) + << "', " << dumpResponse() << llendl; mAgent->handlePreferredMaturityError(); } -U8 LLMaturityPreferencesResponder::parseMaturityFromServerResponse(const LLSD &pContent) +U8 LLMaturityPreferencesResponder::parseMaturityFromServerResponse(const LLSD &pContent) const { // stinson 05/24/2012 Pathfinding regions have re-defined the response behavior. In the old server code, // if you attempted to change the preferred maturity to the same value, the response content would be an @@ -2605,7 +2611,7 @@ U8 LLMaturityPreferencesResponder::parseMaturityFromServerResponse(const LLSD &p // defined. Thus, the check for isUndefined() can be replaced with an assert after pathfinding is merged // into server trunk and fully deployed. U8 maturity = SIM_ACCESS_MIN; - if (pContent.isUndefined()) + if (pContent.isUndefined() || !pContent.isMap()) { maturity = mPreferredMaturity; } @@ -2783,7 +2789,7 @@ void LLAgent::sendMaturityPreferenceToServer(U8 pPreferredMaturity) // If we don't have a region, report it as an error if (getRegion() == NULL) { - responderPtr->errorWithContent(0U, "region is not defined", LLSD()); + responderPtr->failureResult(0U, "region is not defined", LLSD()); } else { @@ -2793,7 +2799,7 @@ void LLAgent::sendMaturityPreferenceToServer(U8 pPreferredMaturity) // If the capability is not defined, report it as an error if (url.empty()) { - responderPtr->errorWithContent(0U, + responderPtr->failureResult(0U, "capability 'UpdateAgentInformation' is not defined for region", LLSD()); } else @@ -3292,8 +3298,7 @@ class LLAgentDropGroupViewerNode : public LLHTTPNode !input.has("body") ) { //what to do with badly formed message? - response->statusUnknownError(400); - response->result(LLSD("Invalid message parameters")); + response->extendedResult(HTTP_BAD_REQUEST, LLSD("Invalid message parameters")); } LLSD body = input["body"]; @@ -3362,8 +3367,7 @@ class LLAgentDropGroupViewerNode : public LLHTTPNode else { //what to do with badly formed message? - response->statusUnknownError(400); - response->result(LLSD("Invalid message parameters")); + response->extendedResult(HTTP_BAD_REQUEST, LLSD("Invalid message parameters")); } } }; -- cgit v1.2.3 From 23c6016481ebc6de5433b9e9b9d07ebc4d5ae3cd Mon Sep 17 00:00:00 2001 From: Nyx Linden Date: Wed, 8 May 2013 16:34:12 -0400 Subject: SH-4048 SH-4171 SH-4046 FIX avatar sinks into ground, updates sent to observers Avatar preview code was triggering avatar size updates, which were causing the avatar's height above the ground to change when the previews were rendered. Also added code to suppress appearance updates being sent out while in appearance editing mode. --- indra/newview/llagent.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llagent.cpp') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 939d9398b2..883200c0f5 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -4296,7 +4296,7 @@ void LLAgent::sendAgentSetAppearance() return; } - if (!isAgentAvatarValid() || (getRegion() && getRegion()->getCentralBakeVersion())) return; + if (!isAgentAvatarValid() || gAgentAvatarp->isEditingAppearance() || (getRegion() && getRegion()->getCentralBakeVersion())) return; // At this point we have a complete appearance to send and are in a non-baking region. // DRANO FIXME -- cgit v1.2.3 From 5c219f694a97d010332618eff9de7bdbeb5b6ed6 Mon Sep 17 00:00:00 2001 From: Nyx Linden Date: Fri, 10 May 2013 12:58:41 -0400 Subject: DEBUG adding additional logging for avatar height usually disabled, enable avatar in logcontrol.xml to get output. --- indra/newview/llagent.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview/llagent.cpp') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 883200c0f5..d7ab68ccd1 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -4337,7 +4337,9 @@ void LLAgent::sendAgentSetAppearance() // to compensate for the COLLISION_TOLERANCE ugliness we will have // to tweak this number again const LLVector3 body_size = gAgentAvatarp->mBodySize + gAgentAvatarp->mAvatarOffset; - msg->addVector3Fast(_PREHASH_Size, body_size); + msg->addVector3Fast(_PREHASH_Size, body_size); + + LL_DEBUGS("Avatar") << gAgentAvatarp->avString() << "Sent AgentSetAppearance with height: " << body_size.mv[VZ] << " base: " << gAgentAvatarp->mBodySize.mV[VZ] << " hover: " << gAgentAvatarp->mAvatarOffset.mV[VZ] << LL_ENDL; // To guard against out of order packets // Note: always start by sending 1. This resets the server's count. 0 on the server means "uninitialized" -- cgit v1.2.3 From cd9acddf09ba80a3a2249194256217882c71bf7c Mon Sep 17 00:00:00 2001 From: Nyx Linden Date: Fri, 10 May 2013 13:04:18 -0400 Subject: BUILDFIX capitalization error --- indra/newview/llagent.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llagent.cpp') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index d7ab68ccd1..21625815b9 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -4339,7 +4339,7 @@ void LLAgent::sendAgentSetAppearance() const LLVector3 body_size = gAgentAvatarp->mBodySize + gAgentAvatarp->mAvatarOffset; msg->addVector3Fast(_PREHASH_Size, body_size); - LL_DEBUGS("Avatar") << gAgentAvatarp->avString() << "Sent AgentSetAppearance with height: " << body_size.mv[VZ] << " base: " << gAgentAvatarp->mBodySize.mV[VZ] << " hover: " << gAgentAvatarp->mAvatarOffset.mV[VZ] << LL_ENDL; + LL_DEBUGS("Avatar") << gAgentAvatarp->avString() << "Sent AgentSetAppearance with height: " << body_size.mV[VZ] << " base: " << gAgentAvatarp->mBodySize.mV[VZ] << " hover: " << gAgentAvatarp->mAvatarOffset.mV[VZ] << LL_ENDL; // To guard against out of order packets // Note: always start by sending 1. This resets the server's count. 0 on the server means "uninitialized" -- cgit v1.2.3 From a1ece43905db86cb6953ce9848228122637e5708 Mon Sep 17 00:00:00 2001 From: Nyx Linden Date: Thu, 18 Jul 2013 16:31:50 -0400 Subject: SH-3875 FIX Failure to bake face wrinkles Wrinkles have been a deprecated/non-functional feature for a few years now. Removing the user-facing sliders to prevent confusion. --- indra/newview/llagent.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview/llagent.cpp') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 21625815b9..1c27811351 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -4419,7 +4419,8 @@ void LLAgent::sendAgentSetAppearance() param; param = (LLViewerVisualParam*)gAgentAvatarp->getNextVisualParam()) { - if (param->getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE) // do not transmit params of group VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT + if (param->getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE || + param->getGroup() == VISUAL_PARAM_GROUP_TRANSMIT_NOT_TWEAKABLE) // do not transmit params of group VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT { msg->nextBlockFast(_PREHASH_VisualParam ); -- cgit v1.2.3 From 36bb33b12ab090e2acbc7e00039cdff682882fa4 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 18 Sep 2013 17:03:34 -0400 Subject: sunshine cleanup annotations --- indra/newview/llagent.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llagent.cpp') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 5f87d73c40..c13082efdc 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -3612,6 +3612,7 @@ void LLAgent::processControlRelease(LLMessageSystem *msg, void **) } */ +// SUNSHINE CLEANUP dead code? //static void LLAgent::processAgentCachedTextureResponse(LLMessageSystem *mesgsys, void **user_data) { @@ -4300,6 +4301,7 @@ void LLAgent::dumpSentAppearance(const std::string& dump_prefix) //----------------------------------------------------------------------------- // sendAgentSetAppearance() //----------------------------------------------------------------------------- +// SUNSHINE CLEANUP dead void LLAgent::sendAgentSetAppearance() { if (gAgentQueryManager.mNumPendingQueries > 0) -- cgit v1.2.3 From 497d3f4bfc2b6b45574ef871c11c6fb8e6145d63 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 18 Sep 2013 17:04:34 -0400 Subject: sunshine cleanup annotations --- indra/newview/llagent.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llagent.cpp') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index c13082efdc..2bcd7d300e 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -811,6 +811,7 @@ void LLAgent::standUp() } +// SUNSHINE CLEANUP - are there any cases we still want to handle here? void LLAgent::handleServerBakeRegionTransition(const LLUUID& region_id) { llinfos << "called" << llendl; -- cgit v1.2.3 From 82f147367fb5e4ee4bbe53db01856ea375058825 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 19 Sep 2013 11:10:59 -0400 Subject: SH-3455 WIP - removing bake upload code --- indra/newview/llagent.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llagent.cpp') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 2bcd7d300e..fe608d657b 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -3671,7 +3671,7 @@ void LLAgent::processAgentCachedTextureResponse(LLMessageSystem *mesgsys, void * else { // no cache of this bake. request upload. - gAgentAvatarp->invalidateComposite(gAgentAvatarp->getLayerSet(baked_index),TRUE); + gAgentAvatarp->invalidateComposite(gAgentAvatarp->getLayerSet(baked_index)); } } } -- cgit v1.2.3 From d58e7cfbfcec163345e87c0c5e5f74d01075246b Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 19 Sep 2013 13:59:20 -0400 Subject: SH-3455 WIP - removing bake upload code --- indra/newview/llagent.cpp | 268 +--------------------------------------------- 1 file changed, 1 insertion(+), 267 deletions(-) (limited to 'indra/newview/llagent.cpp') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index fe608d657b..845ef6e9a5 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -3613,83 +3613,6 @@ void LLAgent::processControlRelease(LLMessageSystem *msg, void **) } */ -// SUNSHINE CLEANUP dead code? -//static -void LLAgent::processAgentCachedTextureResponse(LLMessageSystem *mesgsys, void **user_data) -{ - gAgentQueryManager.mNumPendingQueries--; - if (gAgentQueryManager.mNumPendingQueries == 0) - { - selfStopPhase("fetch_texture_cache_entries"); - } - - if (!isAgentAvatarValid() || gAgentAvatarp->isDead()) - { - llwarns << "No avatar for user in cached texture update!" << llendl; - return; - } - - if (isAgentAvatarValid() && gAgentAvatarp->isEditingAppearance()) - { - // ignore baked textures when in customize mode - return; - } - - S32 query_id; - mesgsys->getS32Fast(_PREHASH_AgentData, _PREHASH_SerialNum, query_id); - - S32 num_texture_blocks = mesgsys->getNumberOfBlocksFast(_PREHASH_WearableData); - - - S32 num_results = 0; - for (S32 texture_block = 0; texture_block < num_texture_blocks; texture_block++) - { - LLUUID texture_id; - U8 texture_index; - - mesgsys->getUUIDFast(_PREHASH_WearableData, _PREHASH_TextureID, texture_id, texture_block); - mesgsys->getU8Fast(_PREHASH_WearableData, _PREHASH_TextureIndex, texture_index, texture_block); - - - if ((S32)texture_index < TEX_NUM_INDICES ) - { - const LLAvatarAppearanceDictionary::TextureEntry *texture_entry = LLAvatarAppearanceDictionary::instance().getTexture((ETextureIndex)texture_index); - if (texture_entry) - { - EBakedTextureIndex baked_index = texture_entry->mBakedTextureIndex; - - if (gAgentQueryManager.mActiveCacheQueries[baked_index] == query_id) - { - if (texture_id.notNull()) - { - //llinfos << "Received cached texture " << (U32)texture_index << ": " << texture_id << llendl; - gAgentAvatarp->setCachedBakedTexture((ETextureIndex)texture_index, texture_id); - //gAgentAvatarp->setTETexture( LLVOAvatar::sBakedTextureIndices[texture_index], texture_id ); - gAgentQueryManager.mActiveCacheQueries[baked_index] = 0; - num_results++; - } - else - { - // no cache of this bake. request upload. - gAgentAvatarp->invalidateComposite(gAgentAvatarp->getLayerSet(baked_index)); - } - } - } - } - } - llinfos << "Received cached texture response for " << num_results << " textures." << llendl; - gAgentAvatarp->outputRezTiming("Fetched agent wearables textures from cache. Will now load them"); - - gAgentAvatarp->updateMeshTextures(); - - if (gAgentQueryManager.mNumPendingQueries == 0) - { - // RN: not sure why composites are disabled at this point - gAgentAvatarp->setCompositeUpdatesEnabled(TRUE); - gAgent.sendAgentSetAppearance(); - } -} - BOOL LLAgent::anyControlGrabbed() const { for (U32 i = 0; i < TOTAL_CONTROLS; i++) @@ -4260,196 +4183,6 @@ 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\n", index, uuid.asString().c_str()); - } - } -} - -//----------------------------------------------------------------------------- -// sendAgentSetAppearance() -//----------------------------------------------------------------------------- -// SUNSHINE CLEANUP dead -void LLAgent::sendAgentSetAppearance() -{ - if (gAgentQueryManager.mNumPendingQueries > 0) - { - return; - } - - if (!isAgentAvatarValid() || gAgentAvatarp->isEditingAppearance() || (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) - { - 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; - } - - - LL_DEBUGS("Avatar") << gAgentAvatarp->avString() << "TAT: Sent AgentSetAppearance: " << gAgentAvatarp->getBakedStatusForPrintout() << LL_ENDL; - //dumpAvatarTEs( "sendAgentSetAppearance()" ); - - LLMessageSystem* msg = gMessageSystem; - msg->newMessageFast(_PREHASH_AgentSetAppearance); - msg->nextBlockFast(_PREHASH_AgentData); - msg->addUUIDFast(_PREHASH_AgentID, getID()); - msg->addUUIDFast(_PREHASH_SessionID, getSessionID()); - - // correct for the collision tolerance (to make it look like the - // agent is actually walking on the ground/object) - // NOTE -- when we start correcting all of the other Havok geometry - // to compensate for the COLLISION_TOLERANCE ugliness we will have - // to tweak this number again - const LLVector3 body_size = gAgentAvatarp->mBodySize + gAgentAvatarp->mAvatarOffset; - msg->addVector3Fast(_PREHASH_Size, body_size); - - LL_DEBUGS("Avatar") << gAgentAvatarp->avString() << "Sent AgentSetAppearance with height: " << body_size.mV[VZ] << " base: " << gAgentAvatarp->mBodySize.mV[VZ] << " hover: " << gAgentAvatarp->mAvatarOffset.mV[VZ] << LL_ENDL; - - // To guard against out of order packets - // Note: always start by sending 1. This resets the server's count. 0 on the server means "uninitialized" - mAppearanceSerialNum++; - msg->addU32Fast(_PREHASH_SerialNum, mAppearanceSerialNum ); - - // is texture data current relative to wearables? - // KLW - TAT this will probably need to check the local queue. - BOOL textures_current = gAgentAvatarp->areTexturesCurrent(); - - for(U8 baked_index = 0; baked_index < BAKED_NUM_INDICES; baked_index++ ) - { - const ETextureIndex texture_index = LLAvatarAppearanceDictionary::bakedToLocalTextureIndex((EBakedTextureIndex)baked_index); - - // if we're not wearing a skirt, we don't need the texture to be baked - if (texture_index == TEX_SKIRT_BAKED && !gAgentAvatarp->isWearingWearableType(LLWearableType::WT_SKIRT)) - { - continue; - } - - // 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; - } - } - - // only update cache entries if we have all our baked textures - - // FIXME DRANO need additional check for not in appearance editing - // mode, if still using local composites need to set using local - // 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_DEBUGS("Avatar") << gAgentAvatarp->avString() << "TAT: Sending cached texture data" << LL_ENDL; - for (U8 baked_index = 0; baked_index < BAKED_NUM_INDICES; baked_index++) - { - BOOL generate_valid_hash = TRUE; - if (isAgentAvatarValid() && !gAgentAvatarp->isBakedTextureFinal((LLAvatarAppearanceDefines::EBakedTextureIndex)baked_index)) - { - generate_valid_hash = FALSE; - LL_DEBUGS("Avatar") << gAgentAvatarp->avString() << "Not caching baked texture upload for " << (U32)baked_index << " due to being uploaded at low resolution." << LL_ENDL; - } - - const LLUUID hash = gAgentWearables.computeBakedTextureHash((EBakedTextureIndex) baked_index, generate_valid_hash); - if (hash.notNull()) - { - ETextureIndex texture_index = LLAvatarAppearanceDictionary::bakedToLocalTextureIndex((EBakedTextureIndex) baked_index); - msg->nextBlockFast(_PREHASH_WearableData); - msg->addUUIDFast(_PREHASH_CacheID, hash); - msg->addU8Fast(_PREHASH_TextureIndex, (U8)texture_index); - } - } - msg->nextBlockFast(_PREHASH_ObjectData); - gAgentAvatarp->sendAppearanceMessage( gMessageSystem ); - } - else - { - // If the textures aren't baked, send NULL for texture IDs - // This means the baked texture IDs on the server will be untouched. - // Once all textures are baked, another AvatarAppearance message will be sent to update the TEs - msg->nextBlockFast(_PREHASH_ObjectData); - gMessageSystem->addBinaryDataFast(_PREHASH_TextureEntry, NULL, 0); - } - - - S32 transmitted_params = 0; - for (LLViewerVisualParam* param = (LLViewerVisualParam*)gAgentAvatarp->getFirstVisualParam(); - param; - param = (LLViewerVisualParam*)gAgentAvatarp->getNextVisualParam()) - { - if (param->getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE || - param->getGroup() == VISUAL_PARAM_GROUP_TRANSMIT_NOT_TWEAKABLE) // do not transmit params of group VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT - { - msg->nextBlockFast(_PREHASH_VisualParam ); - - // We don't send the param ids. Instead, we assume that the receiver has the same params in the same sequence. - const F32 param_value = param->getWeight(); - const U8 new_weight = F32_to_U8(param_value, param->getMinWeight(), param->getMaxWeight()); - msg->addU8Fast(_PREHASH_ParamValue, new_weight ); - transmitted_params++; - } - } - -// llinfos << "Avatar XML num VisualParams transmitted = " << transmitted_params << llendl; - sendReliableMessage(); -} - void LLAgent::sendAgentDataUpdateRequest() { gMessageSystem->newMessageFast(_PREHASH_AgentDataUpdateRequest); @@ -4601,6 +4334,7 @@ LLAgentQueryManager::LLAgentQueryManager() : { for (U32 i = 0; i < BAKED_NUM_INDICES; i++) { + // SUNSHINE CLEANUP mActiveCacheQueries[i] = 0; } } -- cgit v1.2.3 From 48bc05e93ffbd29b3e49c288577bda1712a88392 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 19 Sep 2013 16:14:59 -0400 Subject: SH-3455 WIP - removing bake upload code --- indra/newview/llagent.cpp | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'indra/newview/llagent.cpp') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 845ef6e9a5..18ff2d7c02 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -4325,24 +4325,6 @@ void LLAgent::renderAutoPilotTarget() /********************************************************************************/ -LLAgentQueryManager gAgentQueryManager; - -LLAgentQueryManager::LLAgentQueryManager() : - mWearablesCacheQueryID(0), - mNumPendingQueries(0), - mUpdateSerialNum(0) -{ - for (U32 i = 0; i < BAKED_NUM_INDICES; i++) - { - // SUNSHINE CLEANUP - mActiveCacheQueries[i] = 0; - } -} - -LLAgentQueryManager::~LLAgentQueryManager() -{ -} - //----------------------------------------------------------------------------- // LLTeleportRequest //----------------------------------------------------------------------------- -- cgit v1.2.3 From 029642b2bc3a0bc0bec45af5df5d1e0b1b928b91 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 23 Sep 2013 16:48:49 -0400 Subject: SH-3455 WIP - post-SSA cleanup, including removal of mUseServerBakes and related methods --- indra/newview/llagent.cpp | 37 ------------------------------------- 1 file changed, 37 deletions(-) (limited to 'indra/newview/llagent.cpp') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 18ff2d7c02..29cf231d45 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -811,30 +811,6 @@ void LLAgent::standUp() } -// SUNSHINE CLEANUP - are there any cases we still want to handle here? -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(); - } -} - //----------------------------------------------------------------------------- // setRegion() //----------------------------------------------------------------------------- @@ -930,19 +906,6 @@ void LLAgent::setRegion(LLViewerRegion *regionp) { LLEnvManagerNew::instance().onRegionCrossing(); } - - // If the newly entered region is using server bakes, and our - // current appearance is non-baked, request appearance update from - // server. - if (mRegionp->capabilitiesReceived()) - { - handleServerBakeRegionTransition(mRegionp->getRegionID()); - } - else - { - // Need to handle via callback after caps arrive. - mRegionp->setCapabilitiesReceivedCallback(boost::bind(&LLAgent::handleServerBakeRegionTransition,this,_1)); - } } -- cgit v1.2.3 From 20af6640d4077725034bd7e9d0e8982778cea09a Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 15 Oct 2013 11:17:20 -0400 Subject: SH-3455 WIP - llstartup cleanup --- indra/newview/llagent.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llagent.cpp') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 29cf231d45..072e5a82b4 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -407,7 +407,7 @@ LLAgent::LLAgent() : mNextFidgetTime(0.f), mCurrentFidget(0), mFirstLogin(FALSE), - mGenderChosen(FALSE), + mOutfitChosen(FALSE), mVoiceConnected(false), @@ -1853,7 +1853,7 @@ BOOL LLAgent::needsRenderAvatar() return FALSE; } - return mShowAvatar && mGenderChosen; + return mShowAvatar && mOutfitChosen; } // TRUE if we need to render your own avatar's head. -- cgit v1.2.3