summaryrefslogtreecommitdiff
path: root/indra/newview/llappearancemgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llappearancemgr.cpp')
-rwxr-xr-xindra/newview/llappearancemgr.cpp88
1 files changed, 74 insertions, 14 deletions
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp
index d8ba4239b7..2c76efc7fb 100755
--- a/indra/newview/llappearancemgr.cpp
+++ b/indra/newview/llappearancemgr.cpp
@@ -26,6 +26,7 @@
#include "llviewerprecompiledheaders.h"
+#include <boost/lexical_cast.hpp>
#include "llaccordionctrltab.h"
#include "llagent.h"
#include "llagentcamera.h"
@@ -52,6 +53,11 @@
#include "llsdutil.h"
#include "llsdserialize.h"
+#if LL_MSVC
+// disable boost::lexical_cast warning
+#pragma warning (disable:4702)
+#endif
+
std::string self_av_string()
{
// On logout gAgentAvatarp can already be invalid
@@ -3167,7 +3173,8 @@ public:
LLSD LLAppearanceMgr::dumpCOF() const
{
- LLSD result = LLSD::emptyArray();
+ LLSD links = LLSD::emptyArray();
+ LLMD5 md5;
LLInventoryModel::cat_array_t cat_array;
LLInventoryModel::item_array_t item_array;
@@ -3176,13 +3183,54 @@ LLSD LLAppearanceMgr::dumpCOF() const
{
const LLViewerInventoryItem* inv_item = item_array.get(i).get();
LLSD item;
- item["item_id"] = inv_item->getUUID();
- item["linked_item_id"] = inv_item->getLinkedUUID();
- item["name"] = inv_item->getName();
+ LLUUID item_id(inv_item->getUUID());
+ md5.update((unsigned char*)item_id.mData, 16);
item["description"] = inv_item->getActualDescription();
- item["type"] = inv_item->getActualType();
- result.append(item);
+ md5.update(inv_item->getActualDescription());
+ item["asset_type"] = inv_item->getActualType();
+ LLUUID linked_id(inv_item->getLinkedUUID());
+ item["linked_id"] = linked_id;
+ md5.update((unsigned char*)linked_id.mData, 16);
+
+ if (LLAssetType::AT_LINK == inv_item->getActualType())
+ {
+ const LLViewerInventoryItem* linked_item = inv_item->getLinkedItem();
+ if (NULL == linked_item)
+ {
+ llwarns << "Broken link for item '" << inv_item->getName()
+ << "' (" << inv_item->getUUID()
+ << ") during requestServerAppearanceUpdate" << llendl;
+ continue;
+ }
+ // Some assets may be 'hidden' and show up as null in the viewer.
+ //if (linked_item->getAssetUUID().isNull())
+ //{
+ // llwarns << "Broken link (null asset) for item '" << inv_item->getName()
+ // << "' (" << inv_item->getUUID()
+ // << ") during requestServerAppearanceUpdate" << llendl;
+ // continue;
+ //}
+ LLUUID linked_asset_id(linked_item->getAssetUUID());
+ md5.update((unsigned char*)linked_asset_id.mData, 16);
+ U32 flags = linked_item->getFlags();
+ md5.update(boost::lexical_cast<std::string>(flags));
+ }
+ else if (LLAssetType::AT_LINK_FOLDER != inv_item->getActualType())
+ {
+ llwarns << "Non-link item '" << inv_item->getName()
+ << "' (" << inv_item->getUUID()
+ << ") type " << (S32) inv_item->getActualType()
+ << " during requestServerAppearanceUpdate" << llendl;
+ continue;
+ }
+ links.append(item);
}
+ LLSD result = LLSD::emptyMap();
+ result["cof_contents"] = links;
+ char cof_md5sum[MD5HEX_STR_SIZE];
+ md5.finalize();
+ md5.hex_digest(cof_md5sum);
+ result["cof_md5sum"] = std::string(cof_md5sum);
return result;
}
@@ -3212,14 +3260,17 @@ void LLAppearanceMgr::requestServerAppearanceUpdate(LLCurl::ResponderPtr respond
LLSD body;
S32 cof_version = getCOFVersion();
- body["cof_version"] = cof_version;
- if (gSavedSettings.getBOOL("DebugForceAppearanceRequestFailure"))
+ if (gSavedSettings.getBOOL("DebugAvatarExperimentalServerAppearanceUpdate"))
{
- body["cof_version"] = cof_version+999;
+ body = dumpCOF();
}
- if (gSavedSettings.getBOOL("DebugAvatarAppearanceMessage"))
+ else
{
- body["debug_cof"] = dumpCOF();
+ body["cof_version"] = cof_version;
+ if (gSavedSettings.getBOOL("DebugForceAppearanceRequestFailure"))
+ {
+ body["cof_version"] = cof_version+999;
+ }
}
LL_DEBUGS("Avatar") << "request url " << url << " my_cof_version " << cof_version << llendl;
@@ -3257,10 +3308,10 @@ public:
app_mgr->mLastUpdateRequestCOFVersion = new_version;
}
- virtual void error(U32 pStatus, const std::string& pReason)
+ virtual void errorWithContent(U32 pStatus, const std::string& pReason, const LLSD& content)
{
- llwarns << "While attempting to increment the agent's cof we got an error because '"
- << pReason << "' [status:" << pStatus << "]" << llendl;
+ llwarns << "While attempting to increment the agent's cof we got an error with [status:"
+ << pStatus << "]: " << content << llendl;
F32 seconds_to_wait;
if (mRetryPolicy->shouldRetry(pStatus,seconds_to_wait))
{
@@ -3308,6 +3359,15 @@ void LLAppearanceMgr::incrementCofVersion(LLHTTPClient::ResponderPtr responder_p
LLHTTPClient::get(url, body, responder_ptr, headers, 30.0f);
}
+std::string LLAppearanceMgr::getAppearanceServiceURL() const
+{
+ if (gSavedSettings.getString("DebugAvatarAppearanceServiceURLOverride").empty())
+ {
+ return mAppearanceServiceURL;
+ }
+ return gSavedSettings.getString("DebugAvatarAppearanceServiceURLOverride");
+}
+
void show_created_outfit(LLUUID& folder_id, bool show_panel = true)
{
if (!LLApp::isRunning())