diff options
author | prep <prep@lindenlab.com> | 2013-02-28 11:13:38 -0500 |
---|---|---|
committer | prep <prep@lindenlab.com> | 2013-02-28 11:13:38 -0500 |
commit | 852ccab7a3fd322044a3918b8df4dfc0f6784576 (patch) | |
tree | 61a2e625c0c28282875994597152bef67e6faa4f /indra | |
parent | 03b51b779fd545e63b6f2fa2ef5ba28f21f1ae62 (diff) | |
parent | 83eda3f1524a08fa6fc4fbd836c92ae95e8100bc (diff) |
merge
Diffstat (limited to 'indra')
-rwxr-xr-x | indra/llprimitive/llprimitive.cpp | 2 | ||||
-rwxr-xr-x | indra/newview/app_settings/settings.xml | 11 | ||||
-rwxr-xr-x | indra/newview/llagent.cpp | 4 | ||||
-rwxr-xr-x | indra/newview/llappearancemgr.cpp | 129 | ||||
-rwxr-xr-x | indra/newview/llappearancemgr.h | 7 | ||||
-rwxr-xr-x | indra/newview/llfloatersidepanelcontainer.cpp | 24 | ||||
-rwxr-xr-x | indra/newview/llinventorymodel.cpp | 11 | ||||
-rwxr-xr-x | indra/newview/llpaneleditwearable.cpp | 28 | ||||
-rw-r--r-- | indra/newview/llpaneleditwearable.h | 12 | ||||
-rwxr-xr-x | indra/newview/llviewerinventory.cpp | 19 | ||||
-rwxr-xr-x | indra/newview/llviewerinventory.h | 8 | ||||
-rwxr-xr-x | indra/newview/llviewerregion.cpp | 5 | ||||
-rwxr-xr-x | indra/newview/llvoavatar.cpp | 57 | ||||
-rwxr-xr-x | indra/newview/llvoavatar.h | 7 | ||||
-rwxr-xr-x | indra/newview/llvoavatarself.cpp | 2 |
15 files changed, 241 insertions, 85 deletions
diff --git a/indra/llprimitive/llprimitive.cpp b/indra/llprimitive/llprimitive.cpp index cf6a3f97d2..c340fc2d35 100755 --- a/indra/llprimitive/llprimitive.cpp +++ b/indra/llprimitive/llprimitive.cpp @@ -1259,7 +1259,7 @@ S32 LLPrimitive::parseTEMessage(LLMessageSystem* mesgsys, char const* block_name mesgsys->getBinaryDataFast(block_name, _PREHASH_TextureEntry, tec.packed_buffer, 0, block_num, LLTEContents::MAX_TE_BUFFER); } - tec.face_count = llmin((U32)getNumTEs(),LLTEContents::MAX_TES); + tec.face_count = llmin((U32)getNumTEs(),(U32)LLTEContents::MAX_TES); U8 *cur_ptr = tec.packed_buffer; cur_ptr += unpackTEField(cur_ptr, tec.packed_buffer+tec.size, (U8 *)tec.image_data, 16, tec.face_count, MVT_LLUUID); diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 5db8d4e6a1..826a79b455 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -1982,6 +1982,17 @@ <key>Value</key> <integer>1</integer> </map> + <key>DebugForceAppearanceRequestFailure</key> + <map> + <key>Comment</key> + <string>Request wrong cof version to test the failure path for server appearance update requests.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> <key>DebugHideEmptySystemFolders</key> <map> <key>Comment</key> diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index e15c1a5104..6c082a7e9c 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -4292,10 +4292,6 @@ void LLAgent::requestLeaveGodMode() sendReliableMessage(); } -extern void dump_visual_param(apr_file_t* file, LLVisualParam* viewer_param, F32 value); -extern std::string get_sequential_numbered_file_name(const std::string& prefix, - const std::string& suffix); - // For debugging, trace agent state at times appearance message are sent out. void LLAgent::dumpSentAppearance(const std::string& dump_prefix) { diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 10523ca998..f56ae7caf1 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -50,6 +50,7 @@ #include "llviewerregion.h" #include "llwearablelist.h" #include "llsdutil.h" +#include "llsdserialize.h" std::string self_av_string() { @@ -210,7 +211,7 @@ public: void addItem(const LLUUID& item_id) { LL_DEBUGS("Avatar") << "item_id " << item_id << llendl; - + if (!requestOperation(item_id)) { LL_DEBUGS("Avatar") << "item_id " << item_id << " requestOperation false, skipping" << llendl; @@ -1691,7 +1692,7 @@ void LLAppearanceMgr::purgeCategory(const LLUUID& category, bool keep_outfit_lin gInventory.purgeObject(item->getUUID()); } #else - gInventory.purgeObject(item->getUUID()); + gInventory.purgeObject(item->getUUID()); } #endif } @@ -1805,8 +1806,6 @@ void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append) removeDuplicateItems(gest_items); // Create links to new COF contents. - LL_DEBUGS("Avatar") << self_av_string() << "creating LLCallAfterInventoryLinkMgr" << LL_ENDL; - LLInventoryModel::item_array_t all_items; all_items += body_items; all_items += wear_items; @@ -1814,17 +1813,13 @@ void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append) all_items += gest_items; // Will link all the above items. - bool update_base_outfit_ordering = !append; - LLCallAfterInventoryLinkMgr *link_waiter = - new LLCallAfterInventoryLinkMgr(all_items,cof,"update_appearance_on_destroy", - boost::bind(&LLAppearanceMgr::updateAppearanceFromCOF, - LLAppearanceMgr::getInstance(), - update_base_outfit_ordering)); + LLPointer<LLInventoryCallback> link_waiter = new LLUpdateAppearanceOnDestroy; + linkAll(cof,all_items,link_waiter); // Add link to outfit if category is an outfit. if (!append) { - link_waiter->addItem(category); + createBaseOutfitLink(category, NULL); } // Remove current COF contents. Have to do this after creating @@ -3049,6 +3044,10 @@ public: if (content["success"].asBoolean()) { LL_DEBUGS("Avatar") << "OK" << LL_ENDL; + if (gSavedSettings.getBOOL("DebugAvatarAppearanceMessage")) + { + dumpContents(gAgentAvatarp->getFullname() + "_appearance_request_ok", content); + } } else { @@ -3059,8 +3058,13 @@ public: // Error /*virtual*/ void errorWithContent(U32 status, const std::string& reason, const LLSD& content) { - llwarns << "appearance update request failed, status: " << status << " reason: " << reason << llendl; - LL_DEBUGS("Avatar") << "content: " << ll_pretty_print_sd(content) << LL_ENDL; + llwarns << "appearance update request failed, status: " << status << " reason: " << reason << " code: " << content["code"].asInteger() << " error: \"" << content["error"].asString() << "\"" << llendl; + if (gSavedSettings.getBOOL("DebugAvatarAppearanceMessage")) + { + dumpContents(gAgentAvatarp->getFullname() + "_appearance_request_error", content); + debugCOF(content); + + } onFailure(status); } @@ -3079,8 +3083,25 @@ public: { llwarns << "giving up after too many retries" << llendl; } + } + + void dumpContents(const std::string outprefix, const LLSD& content) + { + std::string outfilename = get_sequential_numbered_file_name(outprefix,".xml"); + std::string fullpath = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,outfilename); + std::ofstream ofs(fullpath.c_str(), std::ios_base::out); + ofs << LLSDOStreamer<LLSDXMLFormatter>(content, LLSDFormatter::OPTIONS_PRETTY); + LL_DEBUGS("Avatar") << "results saved to: " << fullpath << LL_ENDL; } + void debugCOF(const LLSD& content) + { + //S32 cof_version = content["cof_version"]; + //S32 cof_expected = content["expected"]; + //S32 cof_observed = content["observed"]; + } + + LLPointer<LLHTTPRetryPolicy> mRetryPolicy; }; @@ -3095,6 +3116,7 @@ void LLAppearanceMgr::requestServerAppearanceUpdate(LLCurl::ResponderPtr respond if (!gAgent.getRegion()) { llwarns << "Region not set, cannot request server appearance update" << llendl; + return; } if (gAgent.getRegion()->getCentralBakeVersion()==0) { @@ -3110,7 +3132,11 @@ void LLAppearanceMgr::requestServerAppearanceUpdate(LLCurl::ResponderPtr respond LLSD body; S32 cof_version = getCOFVersion(); body["cof_version"] = cof_version; - LL_DEBUGS("Avatar") << "my_cof_version " << cof_version << llendl; + if (gSavedSettings.getBOOL("DebugForceAppearanceRequestFailure")) + { + body["cof_version"] = cof_version+1; + } + LL_DEBUGS("Avatar") << "request url " << url << " my_cof_version " << cof_version << llendl; //LLCurl::ResponderPtr responder_ptr; if (!responder_ptr.get()) @@ -3122,6 +3148,81 @@ void LLAppearanceMgr::requestServerAppearanceUpdate(LLCurl::ResponderPtr respond mLastUpdateRequestCOFVersion = cof_version; } +class LLIncrementCofVersionResponder : public LLHTTPClient::Responder +{ +public: + LLIncrementCofVersionResponder() : LLHTTPClient::Responder() + { + mRetryPolicy = new LLAdaptiveRetryPolicy(1.0, 16.0, 2.0, 5); + } + + virtual ~LLIncrementCofVersionResponder() + { + } + + virtual void result(const LLSD &pContent) + { + llinfos << "Successfully incremented agent's COF." << llendl; + S32 new_version = pContent["category"]["version"].asInteger(); + + LLAppearanceMgr* app_mgr = LLAppearanceMgr::getInstance(); + + // cof_version should have increased + llassert(new_version > app_mgr->mLastUpdateRequestCOFVersion); + + app_mgr->mLastUpdateRequestCOFVersion = new_version; + } + virtual void error(U32 pStatus, const std::string& pReason) + { + llwarns << "While attempting to increment the agent's cof we got an error because '" + << pReason << "' [status:" << pStatus << "]" << llendl; + F32 seconds_to_wait; + if (mRetryPolicy->shouldRetry(pStatus,seconds_to_wait)) + { + llinfos << "retrying" << llendl; + doAfterInterval(boost::bind(&LLAppearanceMgr::incrementCofVersion, + LLAppearanceMgr::getInstance(), + LLHTTPClient::ResponderPtr(this)), + seconds_to_wait); + } + else + { + llwarns << "giving up after too many retries" << llendl; + } + } + + LLPointer<LLHTTPRetryPolicy> mRetryPolicy; +}; + +void LLAppearanceMgr::incrementCofVersion(LLHTTPClient::ResponderPtr responder_ptr) +{ + // If we don't have a region, report it as an error + if (gAgent.getRegion() == NULL) + { + llwarns << "Region not set, cannot request cof_version increment" << llendl; + return; + } + + std::string url = gAgent.getRegion()->getCapability("IncrementCofVersion"); + if (url.empty()) + { + llwarns << "No cap for IncrementCofVersion." << llendl; + return; + } + + llinfos << "Requesting cof_version be incremented via capability to: " + << url << llendl; + LLSD headers; + LLSD body = LLSD::emptyMap(); + + if (!responder_ptr.get()) + { + responder_ptr = LLHTTPClient::ResponderPtr(new LLIncrementCofVersionResponder()); + } + + LLHTTPClient::get(url, body, responder_ptr, headers, 30.0f); +} + void show_created_outfit(LLUUID& folder_id, bool show_panel = true) { if (!LLApp::isRunning()) diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index 1a1ca1ca7d..b35504eb1f 100755 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -141,7 +141,7 @@ public: // Find COF entries referencing the given item. LLInventoryModel::item_array_t findCOFItemLinks(const LLUUID& item_id); - + // Remove COF entries void removeCOFItemLinks(const LLUUID& item_id); void removeCOFLinksOfType(LLWearableType::EType type); @@ -197,6 +197,11 @@ public: void requestServerAppearanceUpdate(LLCurl::ResponderPtr responder_ptr = NULL); + void incrementCofVersion(LLHTTPClient::ResponderPtr responder_ptr = NULL); + + // *HACK Remove this after server side texture baking is deployed on all sims. + void incrementCofVersionLegacy(); + protected: LLAppearanceMgr(); ~LLAppearanceMgr(); diff --git a/indra/newview/llfloatersidepanelcontainer.cpp b/indra/newview/llfloatersidepanelcontainer.cpp index 02150819a0..ce5ea66471 100755 --- a/indra/newview/llfloatersidepanelcontainer.cpp +++ b/indra/newview/llfloatersidepanelcontainer.cpp @@ -59,30 +59,22 @@ void LLFloaterSidePanelContainer::onOpen(const LLSD& key) void LLFloaterSidePanelContainer::onClickCloseBtn() { - llinfos << "close clicked" << llendl; - LLPanelOutfitEdit* panel_outfit_edit = dynamic_cast<LLPanelOutfitEdit*>(LLFloaterSidePanelContainer::getPanel("appearance", "panel_outfit_edit")); - if (panel_outfit_edit && panel_outfit_edit->getVisible()) + if (panel_outfit_edit) { LLFloater *parent = gFloaterView->getParentFloater(panel_outfit_edit); - if (parent == this) + if (parent == this ) { - LLSidepanelAppearance* panel_appearance = - dynamic_cast<LLSidepanelAppearance*>(getPanel("appearance")); - panel_appearance->showOutfitsInventoryPanel(); + LLSidepanelAppearance* panel_appearance = dynamic_cast<LLSidepanelAppearance*>(getPanel("appearance")); + if ( panel_appearance ) + { + panel_appearance->getWearable()->onClose(); + panel_appearance->showOutfitsInventoryPanel(); + } } } - if ( panel_outfit_edit ) - { - LLSidepanelAppearance* panel_appearance = dynamic_cast<LLSidepanelAppearance*>(getPanel("appearance")); - if ( panel_appearance ) - { - panel_appearance->getWearable()->onClose(); - panel_appearance->showOutfitsInventoryPanel(); - } - } LLFloater::onClickCloseBtn(); } diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index ac1f40b486..171a2cd043 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1922,7 +1922,18 @@ bool LLInventoryModel::loadSkeleton( for(cat_set_t::iterator it = temp_cats.begin(); it != temp_cats.end(); ++it) { LLViewerInventoryCategory *llvic = (*it); +#if 1 llvic->setVersion(NO_VERSION); +#else + if (llvic->getPreferredType()==LLFolderType::FT_CURRENT_OUTFIT && llvic->getVersion()==1) + { + llinfos << "preserving empty COF for first-time login" << llendl; + } + else + { + llvic->setVersion(NO_VERSION); + } +#endif addCategory(*it); } } diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp index 52b5481976..a49bbcd924 100755 --- a/indra/newview/llpaneleditwearable.cpp +++ b/indra/newview/llpaneleditwearable.cpp @@ -52,6 +52,7 @@ #include "lltexturectrl.h" #include "lltextureentry.h" #include "llviewercontrol.h" // gSavedSettings +#include "llviewerregion.h" #include "llviewertexturelist.h" #include "llagentcamera.h" #include "llmorphview.h" @@ -882,8 +883,8 @@ void LLPanelEditWearable::setWearable(LLViewerWearable *wearable, BOOL disable_c //static void LLPanelEditWearable::onBackButtonClicked(void* userdata) -{ - LLPanelEditWearable *panel = (LLPanelEditWearable*) userdata; +{ + LLPanelEditWearable *panel = (LLPanelEditWearable*) userdata; if ( panel->isDirty() ) { LLAppearanceMgr::instance().setOutfitDirty( true ); @@ -1045,6 +1046,11 @@ void LLPanelEditWearable::updatePanelPickerControls(LLWearableType::EType type) } } +void LLPanelEditWearable::incrementCofVersionLegacy() +{ + +} + void LLPanelEditWearable::saveChanges(bool force_save_as) { if (!mWearablePtr || !isDirty()) @@ -1073,10 +1079,10 @@ void LLPanelEditWearable::saveChanges(bool force_save_as) if (force_save_as) { - // the name of the wearable has changed, re-save wearable with new name - LLAppearanceMgr::instance().removeCOFItemLinks(mWearablePtr->getItemID()); + // the name of the wearable has changed, re-save wearable with new name + LLAppearanceMgr::instance().removeCOFItemLinks(mWearablePtr->getItemID()); gAgentWearables.saveWearableAs(mWearablePtr->getType(), index, new_name, description, FALSE); - mNameEditor->setText(mWearableItem->getName()); + mNameEditor->setText(mWearableItem->getName()); } else { @@ -1096,8 +1102,18 @@ void LLPanelEditWearable::saveChanges(bool force_save_as) // Remove old link gInventory.purgeObject(link_item->getUUID()); } - gAgentWearables.saveWearable(mWearablePtr->getType(), index, TRUE, new_name); + gAgentWearables.saveWearable(mWearablePtr->getType(), index, TRUE, new_name); } + + if (gAgent.getRegion() && gAgent.getRegion()->getCentralBakeVersion() > 0) + { + LLAppearanceMgr::getInstance()->incrementCofVersion(); + } + else + { + // *HACK This should be removed when all regions support the IncrementCOFVersion capability. + incrementCofVersionLegacy(); + } } void LLPanelEditWearable::revertChanges() diff --git a/indra/newview/llpaneleditwearable.h b/indra/newview/llpaneleditwearable.h index ac4344de2e..6533d55f2f 100644 --- a/indra/newview/llpaneleditwearable.h +++ b/indra/newview/llpaneleditwearable.h @@ -78,7 +78,6 @@ public: virtual void setVisible(BOOL visible); - private: typedef std::map<F32, LLViewerVisualParam*> value_map_t; @@ -96,7 +95,7 @@ private: void toggleTypeSpecificControls(LLWearableType::EType type); void updateTypeSpecificControls(LLWearableType::EType type); - //alpha mask checkboxes + // alpha mask checkboxes void configureAlphaCheckbox(LLAvatarAppearanceDefines::ETextureIndex te, const std::string& name); void onInvisibilityCommit(LLCheckBoxCtrl* checkbox_ctrl, LLAvatarAppearanceDefines::ETextureIndex te); void updateAlphaCheckboxes(); @@ -106,7 +105,7 @@ private: // callback for HeightUnits parameter. bool changeHeightUnits(const LLSD& new_value); - // updates current metric and replacemet metric label text + // updates current metric and replacement metric label text void updateMetricLayout(BOOL new_value); // updates avatar height label @@ -116,6 +115,9 @@ private: void setWearablePanelVisibilityChangeCallback(LLPanel* bodypart_panel); + // *HACK Remove this when serverside texture baking is available on all regions. + void incrementCofVersionLegacy(); + // the pointer to the wearable we're editing. NULL means we're not editing a wearable. LLViewerWearable *mWearablePtr; LLViewerInventoryItem* mWearableItem; @@ -130,7 +132,7 @@ private: LLTextBox *mTxtAvatarHeight; - // localized and parametrized strings that used to build avatar_height_label + // localized and parameterized strings that used to build avatar_height_label std::string mMeters; std::string mFeet; std::string mHeigth; @@ -153,7 +155,7 @@ private: LLPanel *mPanelEyes; LLPanel *mPanelHair; - //clothes + // clothes LLPanel *mPanelShirt; LLPanel *mPanelPants; LLPanel *mPanelShoes; diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index d6f0874a58..59efcfa7fa 100755 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -592,7 +592,7 @@ void LLViewerInventoryCategory::copyViewerCategory(const LLViewerInventoryCatego { copyCategory(other); mOwnerID = other->mOwnerID; - mVersion = other->mVersion; + setVersion(other->getVersion()); mDescendentCount = other->mDescendentCount; mDescendentsRequested = other->mDescendentsRequested; } @@ -660,9 +660,19 @@ void LLViewerInventoryCategory::removeFromServer( void ) gAgent.sendReliableMessage(); } +S32 LLViewerInventoryCategory::getVersion() const +{ + return mVersion; +} + +void LLViewerInventoryCategory::setVersion(S32 version) +{ + mVersion = version; +} + bool LLViewerInventoryCategory::fetch() { - if((VERSION_UNKNOWN == mVersion) + if((VERSION_UNKNOWN == getVersion()) && mDescendentsRequested.hasExpired()) //Expired check prevents multiple downloads. { LL_DEBUGS("InventoryFetch") << "Fetching category children: " << mName << ", UUID: " << mUUID << LL_ENDL; @@ -1127,6 +1137,11 @@ void link_inventory_item( } } +#if 1 // debugging stuff + LLViewerInventoryCategory* cat = gInventory.getCategory(parent_id); + lldebugs << "cat: " << cat << llendl; + +#endif LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_LinkInventoryItem); msg->nextBlock(_PREHASH_AgentData); diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h index 13e95c57cb..6fb0fd0153 100755 --- a/indra/newview/llviewerinventory.h +++ b/indra/newview/llviewerinventory.h @@ -205,13 +205,13 @@ public: // Version handling enum { VERSION_UNKNOWN = -1, VERSION_INITIAL = 1 }; - S32 getVersion() const { return mVersion; } - void setVersion(S32 version) { mVersion = version; } + S32 getVersion() const; + void setVersion(S32 version); // Returns true if a fetch was issued. bool fetch(); - // used to help make cacheing more robust - for example, if + // used to help make caching more robust - for example, if // someone is getting 4 packets but logs out after 3. the viewer // may never know the cache is wrong. enum { DESCENDENT_COUNT_UNKNOWN = -1 }; @@ -219,7 +219,7 @@ public: void setDescendentCount(S32 descendents) { mDescendentCount = descendents; } // file handling on the viewer. These are not meant for anything - // other than cacheing. + // other than caching. bool exportFileLocal(LLFILE* fp) const; bool importFileLocal(LLFILE* fp); void determineFolderType(); diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index db5bba89e2..a7595a56d3 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -1583,6 +1583,7 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames) capabilityNames.append("FetchLibDescendents2"); capabilityNames.append("FetchInventory2"); capabilityNames.append("FetchInventoryDescendents2"); + capabilityNames.append("IncrementCOFVersion"); } capabilityNames.append("GetDisplayNames"); @@ -1596,7 +1597,7 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames) capabilityNames.append("LandResources"); capabilityNames.append("MapLayer"); capabilityNames.append("MapLayerGod"); - capabilityNames.append("MeshUploadFlag"); + capabilityNames.append("MeshUploadFlag"); capabilityNames.append("NavMeshGenerationStatus"); capabilityNames.append("NewFileAgentInventory"); capabilityNames.append("ObjectMedia"); @@ -1636,7 +1637,7 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames) capabilityNames.append("ViewerMetrics"); capabilityNames.append("ViewerStartAuction"); capabilityNames.append("ViewerStats"); - + // Please add new capabilities alphabetically to reduce // merge conflicts. } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 266b9fecd5..afe8a037b7 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -190,11 +190,6 @@ enum ERenderName RENDER_NAME_FADE }; - -// Utility func - FIXME move out of avatar. -std::string get_sequential_numbered_file_name(const std::string& prefix, - const std::string& suffix); - //----------------------------------------------------------------------------- // Callback data //----------------------------------------------------------------------------- @@ -215,6 +210,24 @@ struct LLTextureMaskData ** **/ +struct LLAppearanceMessageContents +{ + LLAppearanceMessageContents(): + mAppearanceVersion(-1), + mParamAppearanceVersion(-1), + mCOFVersion(LLViewerInventoryCategory::VERSION_UNKNOWN) + { + } + LLTEContents mTEContents; + S32 mAppearanceVersion; + S32 mParamAppearanceVersion; + S32 mCOFVersion; + // For future use: + //U32 appearance_flags = 0; + std::vector<F32> mParamWeights; + std::vector<LLVisualParam*> mParams; +}; + //----------------------------------------------------------------------------- // class LLBodyNoiseMotion //----------------------------------------------------------------------------- @@ -6730,10 +6743,11 @@ void dump_visual_param(apr_file_t* file, LLVisualParam* viewer_param, F32 value) void LLVOAvatar::dumpAppearanceMsgParams( const std::string& dump_prefix, - const std::vector<F32>& params_for_dump, - const LLTEContents& tec) + const LLAppearanceMessageContents& contents) { std::string outfilename = get_sequential_numbered_file_name(dump_prefix,".xml"); + const std::vector<F32>& params_for_dump = contents.mParamWeights; + const LLTEContents& tec = contents.mTEContents; LLAPRFile outfile; std::string fullpath = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,outfilename); @@ -6748,7 +6762,12 @@ void LLVOAvatar::dumpAppearanceMsgParams( const std::string& dump_prefix, LL_DEBUGS("Avatar") << "dumping appearance message to " << fullpath << llendl; } + apr_file_printf(file, "<header>\n"); + apr_file_printf(file, "\t\t<cof_version %i />\n", contents.mCOFVersion); + apr_file_printf(file, "\t\t<appearance_version %i />\n", contents.mAppearanceVersion); + apr_file_printf(file, "</header>\n"); + apr_file_printf(file, "\n<params>\n"); LLVisualParam* param = getFirstVisualParam(); for (S32 i = 0; i < params_for_dump.size(); i++) { @@ -6761,32 +6780,18 @@ void LLVOAvatar::dumpAppearanceMsgParams( const std::string& dump_prefix, dump_visual_param(file, viewer_param, value); param = getNextVisualParam(); } + apr_file_printf(file, "</params>\n"); + + apr_file_printf(file, "\n<textures>\n"); for (U32 i = 0; i < tec.face_count; i++) { std::string uuid_str; ((LLUUID*)tec.image_data)[i].toString(uuid_str); apr_file_printf( file, "\t\t<texture te=\"%i\" uuid=\"%s\"/>\n", i, uuid_str.c_str()); } + apr_file_printf(file, "</textures>\n"); } -struct LLAppearanceMessageContents -{ - LLAppearanceMessageContents(): - mAppearanceVersion(-1), - mParamAppearanceVersion(-1), - mCOFVersion(LLViewerInventoryCategory::VERSION_UNKNOWN) - { - } - LLTEContents mTEContents; - S32 mAppearanceVersion; - S32 mParamAppearanceVersion; - S32 mCOFVersion; - // For future use: - //U32 appearance_flags = 0; - std::vector<F32> mParamWeights; - std::vector<LLVisualParam*> mParams; -}; - void LLVOAvatar::parseAppearanceMessage(LLMessageSystem* mesgsys, LLAppearanceMessageContents& contents) { parseTEMessage(mesgsys, _PREHASH_ObjectData, -1, contents.mTEContents); @@ -6925,7 +6930,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) parseAppearanceMessage(mesgsys, contents); if (enable_verbose_dumps) { - dumpAppearanceMsgParams(dump_prefix + "appearance_msg", contents.mParamWeights, contents.mTEContents); + dumpAppearanceMsgParams(dump_prefix + "appearance_msg", contents); } S32 appearance_version; diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index c989673cdf..5ebd8d0399 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -928,8 +928,7 @@ private: public: void dumpArchetypeXML(const std::string& prefix, bool group_by_wearables = false); void dumpAppearanceMsgParams( const std::string& dump_prefix, - const std::vector<F32>& paramsForDump, - const LLTEContents& tec); + const LLAppearanceMessageContents& contents); static void dumpBakedStatus(); const std::string getBakedStatusForPrintout() const; void dumpAvatarTEs(const std::string& context) const; @@ -980,5 +979,9 @@ protected: // Shared with LLVOAvatarSelf extern const F32 SELF_ADDITIONAL_PRI; extern const S32 MAX_TEXTURE_VIRTURE_SIZE_RESET_INTERVAL; +std::string get_sequential_numbered_file_name(const std::string& prefix, + const std::string& suffix); +void dump_visual_param(apr_file_t* file, LLVisualParam* viewer_param, F32 value); + #endif // LL_VOAVATAR_H diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 0e8e48099e..c069488a37 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -3049,8 +3049,6 @@ void LLVOAvatarSelf::dumpScratchTextureByteCount() llinfos << "Scratch Texture GL: " << (sScratchTexBytes/1024) << "KB" << llendl; } -void dump_visual_param(apr_file_t* file, LLVisualParam* viewer_param, F32 value); - void LLVOAvatarSelf::dumpWearableInfo(LLAPRFile& outfile) { apr_file_t* file = outfile.getFileHandle(); |