summaryrefslogtreecommitdiff
path: root/indra/newview/llappearancemgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llappearancemgr.cpp')
-rwxr-xr-xindra/newview/llappearancemgr.cpp31
1 files changed, 25 insertions, 6 deletions
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp
index 480a8e0d73..e27a21f7fd 100755
--- a/indra/newview/llappearancemgr.cpp
+++ b/indra/newview/llappearancemgr.cpp
@@ -925,6 +925,18 @@ const LLUUID LLAppearanceMgr::getCOF() const
return gInventory.findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT);
}
+S32 LLAppearanceMgr::getCOFVersion() const
+{
+ LLViewerInventoryCategory *cof = gInventory.getCategory(getCOF());
+ if (cof)
+ {
+ return cof->getVersion();
+ }
+ else
+ {
+ return LLViewerInventoryCategory::VERSION_UNKNOWN;
+ }
+}
const LLViewerInventoryItem* LLAppearanceMgr::getBaseOutfitLink()
{
@@ -2607,16 +2619,22 @@ public:
void LLAppearanceMgr::requestServerAppearanceUpdate()
{
- std::string url = gAgent.getRegion()->getCapability("UpdateAvatarAppearance");
- if (!url.empty())
+ if (!gAgent.getRegion())
{
- LLSD body;
- LLHTTPClient::post(url, body, new RequestAgentUpdateAppearanceResponder);
+ llwarns << "Region not set, cannot request server appearance update" << llendl;
}
- else
+ std::string url = gAgent.getRegion()->getCapability("UpdateAvatarAppearance");
+ if (url.empty())
{
llwarns << "no cap for UpdateAvatarAppearance" << llendl;
}
+
+ LLSD body;
+ S32 cof_version = getCOFVersion();
+ body["cof_version"] = cof_version;
+ LLHTTPClient::post(url, body, new RequestAgentUpdateAppearanceResponder);
+ llassert(cof_version >= mLastUpdateRequestCOFVersion);
+ mLastUpdateRequestCOFVersion = cof_version;
}
class LLShowCreatedOutfit: public LLInventoryCallback
@@ -2829,7 +2847,8 @@ LLAppearanceMgr::LLAppearanceMgr():
mAttachmentInvLinkEnabled(false),
mOutfitIsDirty(false),
mOutfitLocked(false),
- mIsInUpdateAppearanceFromCOF(false)
+ mIsInUpdateAppearanceFromCOF(false),
+ mLastUpdateRequestCOFVersion(LLViewerInventoryCategory::VERSION_UNKNOWN)
{
LLOutfitObserver& outfit_observer = LLOutfitObserver::instance();