From 34fe6ad59161e0dcd57dfdc1feb6cfd1fcaa4794 Mon Sep 17 00:00:00 2001 From: Nyx Linden <nyx@lindenlab.com> Date: Tue, 12 Mar 2013 22:34:15 +0000 Subject: SH-3944 WIP CHUI merge fixing re-introduced don's refactor of low-level openGL calls pulling out of llui and putting them into llrender. Took the new code from their updated versions from the CHUI merge, but put them in a place accessible to appearance utility. --- indra/newview/llappviewer.cpp | 2 +- indra/newview/llglsandbox.cpp | 8 ++++---- indra/newview/llmediactrl.cpp | 18 +++++++++--------- indra/newview/llviewerdisplay.cpp | 10 +++++----- indra/newview/llviewerwindow.cpp | 12 ++++++------ indra/newview/llworldmapview.cpp | 4 ++-- 6 files changed, 27 insertions(+), 27 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 0f77c68ec8..dac268ec92 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -803,7 +803,7 @@ bool LLAppViewer::init() LLUIImageList::getInstance(), ui_audio_callback, deferred_ui_audio_callback, - &LLUI::sGLScaleFactor); + &LLUI::getScaleFactor()); LL_INFOS("InitInfo") << "UI initialized." << LL_ENDL ; // NOW LLUI::getLanguage() should work. gDirUtilp must know the language diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp index 1208c9378e..60fa53f491 100644 --- a/indra/newview/llglsandbox.cpp +++ b/indra/newview/llglsandbox.cpp @@ -79,10 +79,10 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask) S32 top = llmax(y, mDragStartY); S32 bottom =llmin(y, mDragStartY); - left = llround((F32) left * LLUI::sGLScaleFactor.mV[VX]); - right = llround((F32) right * LLUI::sGLScaleFactor.mV[VX]); - top = llround((F32) top * LLUI::sGLScaleFactor.mV[VY]); - bottom = llround((F32) bottom * LLUI::sGLScaleFactor.mV[VY]); + left = llround((F32) left * LLUI::getScaleFactor().mV[VX]); + right = llround((F32) right * LLUI::getScaleFactor().mV[VX]); + top = llround((F32) top * LLUI::getScaleFactor().mV[VY]); + bottom = llround((F32) bottom * LLUI::getScaleFactor().mV[VY]); F32 old_far_plane = LLViewerCamera::getInstance()->getFar(); F32 old_near_plane = LLViewerCamera::getInstance()->getNear(); diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index 99b4707158..2075aeed63 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -119,8 +119,8 @@ LLMediaCtrl::LLMediaCtrl( const Params& p) : if(!getDecoupleTextureSize()) { - S32 screen_width = llround((F32)getRect().getWidth() * LLUI::sGLScaleFactor.mV[VX]); - S32 screen_height = llround((F32)getRect().getHeight() * LLUI::sGLScaleFactor.mV[VY]); + S32 screen_width = llround((F32)getRect().getWidth() * LLUI::getScaleFactor().mV[VX]); + S32 screen_height = llround((F32)getRect().getHeight() * LLUI::getScaleFactor().mV[VY]); setTextureSize(screen_width, screen_height); } @@ -469,8 +469,8 @@ void LLMediaCtrl::reshape( S32 width, S32 height, BOOL called_from_parent ) { if(!getDecoupleTextureSize()) { - S32 screen_width = llround((F32)width * LLUI::sGLScaleFactor.mV[VX]); - S32 screen_height = llround((F32)height * LLUI::sGLScaleFactor.mV[VY]); + S32 screen_width = llround((F32)width * LLUI::getScaleFactor().mV[VX]); + S32 screen_height = llround((F32)height * LLUI::getScaleFactor().mV[VY]); // when floater is minimized, these sizes are negative if ( screen_height > 0 && screen_width > 0 ) @@ -667,7 +667,7 @@ bool LLMediaCtrl::ensureMediaSourceExists() mMediaSource->addObserver( this ); mMediaSource->setBackgroundColor( getBackgroundColor() ); mMediaSource->setTrustedBrowser(mTrusted); - mMediaSource->setPageZoomFactor( LLUI::sGLScaleFactor.mV[ VX ] ); + mMediaSource->setPageZoomFactor( LLUI::getScaleFactor().mV[ VX ] ); if(mClearCache) { @@ -750,7 +750,7 @@ void LLMediaCtrl::draw() { gGL.pushUIMatrix(); { - mMediaSource->setPageZoomFactor( LLUI::sGLScaleFactor.mV[ VX ] ); + mMediaSource->setPageZoomFactor( LLUI::getScaleFactor().mV[ VX ] ); // scale texture to fit the space using texture coords gGL.getTexUnit(0)->bind(media_texture); @@ -864,14 +864,14 @@ void LLMediaCtrl::convertInputCoords(S32& x, S32& y) coords_opengl = mMediaSource->getMediaPlugin()->getTextureCoordsOpenGL(); } - x = llround((F32)x * LLUI::sGLScaleFactor.mV[VX]); + x = llround((F32)x * LLUI::getScaleFactor().mV[VX]); if ( ! coords_opengl ) { - y = llround((F32)(y) * LLUI::sGLScaleFactor.mV[VY]); + y = llround((F32)(y) * LLUI::getScaleFactor().mV[VY]); } else { - y = llround((F32)(getRect().getHeight() - y) * LLUI::sGLScaleFactor.mV[VY]); + y = llround((F32)(getRect().getHeight() - y) * LLUI::getScaleFactor().mV[VY]); }; } diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index ffeea2f4df..02f82aba63 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -1425,7 +1425,7 @@ void render_ui_2d() gGL.pushMatrix(); S32 half_width = (gViewerWindow->getWorldViewWidthScaled() / 2); S32 half_height = (gViewerWindow->getWorldViewHeightScaled() / 2); - gGL.scalef(LLUI::sGLScaleFactor.mV[0], LLUI::sGLScaleFactor.mV[1], 1.f); + gGL.scalef(LLUI::getScaleFactor().mV[0], LLUI::getScaleFactor().mV[1], 1.f); gGL.translatef((F32)half_width, (F32)half_height, 0.f); F32 zoom = gAgentCamera.mHUDCurZoom; gGL.scalef(zoom,zoom,1.f); @@ -1463,10 +1463,10 @@ void render_ui_2d() LLUI::sDirtyRect = last_rect; last_rect = t_rect; - last_rect.mLeft = LLRect::tCoordType(last_rect.mLeft / LLUI::sGLScaleFactor.mV[0]); - last_rect.mRight = LLRect::tCoordType(last_rect.mRight / LLUI::sGLScaleFactor.mV[0]); - last_rect.mTop = LLRect::tCoordType(last_rect.mTop / LLUI::sGLScaleFactor.mV[1]); - last_rect.mBottom = LLRect::tCoordType(last_rect.mBottom / LLUI::sGLScaleFactor.mV[1]); + last_rect.mLeft = LLRect::tCoordType(last_rect.mLeft / LLUI::getScaleFactor().mV[0]); + last_rect.mRight = LLRect::tCoordType(last_rect.mRight / LLUI::getScaleFactor().mV[0]); + last_rect.mTop = LLRect::tCoordType(last_rect.mTop / LLUI::getScaleFactor().mV[1]); + last_rect.mBottom = LLRect::tCoordType(last_rect.mBottom / LLUI::getScaleFactor().mV[1]); LLRect clip_rect(last_rect); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 383eb3c9e4..db3476850b 100755 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -2157,7 +2157,7 @@ void LLViewerWindow::reshape(S32 width, S32 height) calcDisplayScale(); - BOOL display_scale_changed = mDisplayScale != LLUI::sGLScaleFactor; + BOOL display_scale_changed = mDisplayScale != LLUI::getScaleFactor(); LLUI::setScaleFactor(mDisplayScale); // update our window rectangle @@ -2363,7 +2363,7 @@ void LLViewerWindow::draw() // scale view by UI global scale factor and aspect ratio correction factor gGL.scaleUI(mDisplayScale.mV[VX], mDisplayScale.mV[VY], 1.f); - LLVector2 old_scale_factor = LLUI::sGLScaleFactor; + LLVector2 old_scale_factor = LLUI::getScaleFactor(); // apply camera zoom transform (for high res screenshots) F32 zoom_factor = LLViewerCamera::getInstance()->getZoomFactor(); S16 sub_region = LLViewerCamera::getInstance()->getZoomSubRegion(); @@ -2377,7 +2377,7 @@ void LLViewerWindow::draw() (F32)getWindowHeightScaled() * -(F32)pos_y, 0.f); gGL.scalef(zoom_factor, zoom_factor, 1.f); - LLUI::sGLScaleFactor *= zoom_factor; + LLUI::getScaleFactor() *= zoom_factor; } // Draw tool specific overlay on world @@ -2425,7 +2425,7 @@ void LLViewerWindow::draw() LLFontGL::HCENTER, LLFontGL::TOP); } - LLUI::sGLScaleFactor = old_scale_factor; + LLUI::setScaleFactor(old_scale_factor); } LLUI::popMatrix(); gGL.popMatrix(); @@ -3230,8 +3230,8 @@ void LLViewerWindow::updateLayout() void LLViewerWindow::updateMouseDelta() { - S32 dx = lltrunc((F32) (mCurrentMousePoint.mX - mLastMousePoint.mX) * LLUI::sGLScaleFactor.mV[VX]); - S32 dy = lltrunc((F32) (mCurrentMousePoint.mY - mLastMousePoint.mY) * LLUI::sGLScaleFactor.mV[VY]); + S32 dx = lltrunc((F32) (mCurrentMousePoint.mX - mLastMousePoint.mX) * LLUI::getScaleFactor().mV[VX]); + S32 dy = lltrunc((F32) (mCurrentMousePoint.mY - mLastMousePoint.mY) * LLUI::getScaleFactor().mV[VY]); //RN: fix for asynchronous notification of mouse leaving window not working LLCoordWindow mouse_pos; diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp index ccc513b80d..ffb0964499 100644 --- a/indra/newview/llworldmapview.cpp +++ b/indra/newview/llworldmapview.cpp @@ -421,7 +421,7 @@ void LLWorldMapView::draw() { // Inform the fetch mechanism of the size we need S32 draw_size = llround(sMapScale); - overlayimage->setKnownDrawSize(llround(draw_size * LLUI::sGLScaleFactor.mV[VX]), llround(draw_size * LLUI::sGLScaleFactor.mV[VY])); + overlayimage->setKnownDrawSize(llround(draw_size * LLUI::getScaleFactor().mV[VX]), llround(draw_size * LLUI::getScaleFactor().mV[VY])); // Draw something whenever we have enough info if (overlayimage->hasGLTexture()) { @@ -1320,7 +1320,7 @@ void LLWorldMapView::drawTrackingCircle( const LLRect& rect, S32 x, S32 y, const gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.pushMatrix(); - gGL.translatef((F32)x * LLUI::sGLScaleFactor.mV[VX], (F32)y * LLUI::sGLScaleFactor.mV[VY], 0.f); + gGL.translatef((F32)x * LLUI::getScaleFactor().mV[VX], (F32)y * LLUI::getScaleFactor().mV[VY], 0.f); gl_washer_segment_2d(inner_radius, outer_radius, start_theta, end_theta, 40, color, color); gGL.popMatrix(); -- cgit v1.2.3 From 0ebcdce82bffae18459ed541f05906f625ef47e2 Mon Sep 17 00:00:00 2001 From: prep <prep@lindenlab.com> Date: Tue, 12 Mar 2013 18:53:27 -0400 Subject: WIP: merge fixes --- indra/newview/lloutputmonitorctrl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/lloutputmonitorctrl.h b/indra/newview/lloutputmonitorctrl.h index a346909027..0682af1278 100644 --- a/indra/newview/lloutputmonitorctrl.h +++ b/indra/newview/lloutputmonitorctrl.h @@ -31,7 +31,7 @@ #include "../llui/llview.h" #include "llmutelist.h" #include "llspeakingindicatormanager.h" -#include "../llui/lluiimage.h" +//#include "../llui/lluiimage.h" class LLTextBox; class LLUICtrlFactory; -- cgit v1.2.3 From f945415210f0e18c2c6d941fda6b7d45cb0f06f1 Mon Sep 17 00:00:00 2001 From: Don Kjer <don@lindenlab.com> 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/CMakeLists.txt | 13 +- indra/newview/llaccountingcostmanager.cpp | 14 +- indra/newview/llaccountingcostmanager.h | 2 +- indra/newview/llagent.cpp | 46 +++--- indra/newview/llappearancemgr.cpp | 83 +++++++--- indra/newview/llassetuploadqueue.cpp | 83 +++++----- indra/newview/llassetuploadresponders.cpp | 81 +++++----- indra/newview/llassetuploadresponders.h | 28 ++-- indra/newview/llclassifiedstatsresponder.cpp | 13 +- indra/newview/llclassifiedstatsresponder.h | 8 +- indra/newview/llestateinfomodel.cpp | 10 +- indra/newview/lleventpoll.cpp | 45 +++--- indra/newview/llfeaturemanager.cpp | 20 ++- indra/newview/llfilepicker.cpp | 13 +- indra/newview/llfloaterabout.cpp | 40 ++--- indra/newview/llfloateravatarpicker.cpp | 11 +- indra/newview/llfloaterbuycurrencyhtml.cpp | 3 +- indra/newview/llfloaterhelpbrowser.cpp | 6 +- indra/newview/llfloatermodelpreview.cpp | 4 +- indra/newview/llfloatermodelpreview.h | 4 +- indra/newview/llfloatermodeluploadbase.cpp | 2 +- indra/newview/llfloatermodeluploadbase.h | 4 +- indra/newview/llfloaterobjectweights.cpp | 2 +- indra/newview/llfloaterobjectweights.h | 2 +- indra/newview/llfloaterregiondebugconsole.cpp | 16 +- indra/newview/llfloaterregioninfo.cpp | 25 +-- indra/newview/llfloaterreporter.cpp | 14 +- indra/newview/llfloaterscriptlimits.cpp | 63 +++++--- indra/newview/llfloaterscriptlimits.h | 62 ++++---- indra/newview/llfloatersearch.cpp | 3 +- indra/newview/llfloatertos.cpp | 68 ++++---- indra/newview/llfloaterurlentry.cpp | 48 +++--- indra/newview/llfloaterurlentry.h | 2 +- indra/newview/llfloaterwebcontent.cpp | 7 +- indra/newview/llgroupmgr.cpp | 26 +-- indra/newview/llhomelocationresponder.cpp | 35 ++-- indra/newview/llhomelocationresponder.h | 6 +- indra/newview/llimfloater.cpp | 7 +- indra/newview/llimpanel.cpp | 7 +- indra/newview/llimview.cpp | 30 ++-- indra/newview/llinspectavatar.cpp | 8 +- indra/newview/llinventorymodel.cpp | 30 ++-- indra/newview/llinventorymodel.h | 5 +- indra/newview/llinventorymodelbackgroundfetch.cpp | 43 +++-- indra/newview/llmarketplacefunctions.cpp | 63 ++++---- indra/newview/llmediactrl.cpp | 5 +- indra/newview/llmediadataclient.cpp | 52 +++--- indra/newview/llmediadataclient.h | 29 ++-- indra/newview/llmeshrepository.cpp | 140 ++++++++-------- indra/newview/llpanelclassified.cpp | 10 +- indra/newview/llpanellandmarks.cpp | 2 +- indra/newview/llpanellandmarks.h | 2 +- indra/newview/llpanellogin.cpp | 4 +- indra/newview/llpanelpick.h | 2 +- indra/newview/llpanelplaceinfo.cpp | 6 +- indra/newview/llpanelplaceinfo.h | 2 +- indra/newview/llpanelplaces.cpp | 2 +- indra/newview/llpathfindingmanager.cpp | 176 +++++++++------------ indra/newview/llpathfindingnavmesh.cpp | 4 +- indra/newview/llpathfindingnavmesh.h | 2 +- indra/newview/llproductinforequest.cpp | 18 ++- indra/newview/llremoteparcelrequest.cpp | 17 +- indra/newview/llremoteparcelrequest.h | 9 +- indra/newview/llspeakers.cpp | 8 +- indra/newview/lltexturefetch.cpp | 10 +- indra/newview/lltranslate.cpp | 18 +-- indra/newview/lltranslate.h | 7 - indra/newview/lluploadfloaterobservers.cpp | 20 ++- indra/newview/lluploadfloaterobservers.h | 19 ++- indra/newview/llviewerdisplayname.cpp | 14 +- indra/newview/llviewermedia.cpp | 122 +++++++------- indra/newview/llviewerobjectlist.cpp | 24 +-- indra/newview/llviewerparcelmedia.cpp | 2 +- indra/newview/llviewerregion.cpp | 104 +++++++----- indra/newview/llviewerstats.cpp | 19 +-- indra/newview/llviewerwindow.cpp | 4 +- indra/newview/llvoavatarself.cpp | 45 +++--- indra/newview/llvoicechannel.cpp | 21 ++- indra/newview/llvoicevivox.cpp | 46 +++--- indra/newview/llwebprofile.cpp | 53 ++++--- indra/newview/llwebsharing.cpp | 176 +++++++++------------ indra/newview/llwlhandlers.cpp | 27 ++-- indra/newview/llwlhandlers.h | 14 +- indra/newview/llxmlrpctransaction.cpp | 2 +- indra/newview/tests/llmediadataclient_test.cpp | 8 +- indra/newview/tests/llremoteparcelrequest_test.cpp | 16 +- indra/newview/tests/lltranslate_test.cpp | 12 +- 87 files changed, 1292 insertions(+), 1086 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index baedac1f2d..eb41c0aa3a 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -2068,10 +2068,21 @@ if (LL_TESTS) #llviewertexturelist.cpp ) + set(test_libs + ${JSONCPP_LIBRARIES} + ${CURL_LIBRARIES} + ) + set_source_files_properties( lltranslate.cpp PROPERTIES - LL_TEST_ADDITIONAL_LIBRARIES "${JSONCPP_LIBRARIES}" + LL_TEST_ADDITIONAL_LIBRARIES "${test_libs}" + ) + + set_source_files_properties( + llmediadataclient.cpp + PROPERTIES + LL_TEST_ADDITIONAL_LIBRARIES "${CURL_LIBRARIES}" ) set_source_files_properties( diff --git a/indra/newview/llaccountingcostmanager.cpp b/indra/newview/llaccountingcostmanager.cpp index 7662a9689d..55d453cdcc 100644 --- a/indra/newview/llaccountingcostmanager.cpp +++ b/indra/newview/llaccountingcostmanager.cpp @@ -36,6 +36,7 @@ LLAccountingCostManager::LLAccountingCostManager() //=============================================================================== class LLAccountingCostResponder : public LLCurl::Responder { + LOG_CLASS(LLAccountingCostResponder); public: LLAccountingCostResponder( const LLSD& objectIDs, const LLHandle<LLAccountingCostObserver>& observer_handle ) : mObjectIDs( objectIDs ), @@ -56,24 +57,27 @@ public: } } - void errorWithContent( U32 statusNum, const std::string& reason, const LLSD& content ) +protected: + void httpFailure() { - llwarns << "Transport error [status:" << statusNum << "]: " << content <<llendl; + llwarns << dumpResponse() << llendl; clearPendingRequests(); LLAccountingCostObserver* observer = mObserverHandle.get(); if (observer && observer->getTransactionID() == mTransactionID) { - observer->setErrorStatus(statusNum, reason); + observer->setErrorStatus(getStatus(), getReason()); } } - void result( const LLSD& content ) + void httpSuccess() { + const LLSD& content = getContent(); //Check for error if ( !content.isMap() || content.has("error") ) { - llwarns << "Error on fetched data"<< llendl; + failureResult(HTTP_INTERNAL_ERROR, "Error on fetched data", content); + return; } else if (content.has("selected")) { diff --git a/indra/newview/llaccountingcostmanager.h b/indra/newview/llaccountingcostmanager.h index 0bca1f54ef..3ade34c81d 100644 --- a/indra/newview/llaccountingcostmanager.h +++ b/indra/newview/llaccountingcostmanager.h @@ -38,7 +38,7 @@ public: LLAccountingCostObserver() { mObserverHandle.bind(this); } virtual ~LLAccountingCostObserver() {} virtual void onWeightsUpdate(const SelectionCost& selection_cost) = 0; - virtual void setErrorStatus(U32 status, const std::string& reason) = 0; + virtual void setErrorStatus(S32 status, const std::string& reason) = 0; const LLHandle<LLAccountingCostObserver>& getObserverHandle() const { return mObserverHandle; } const LLUUID& getTransactionID() { return mTransactionID; } 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<U32>(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<U32>(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")); } } }; diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 2c76efc7fb..92a896a3c2 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -2984,20 +2984,23 @@ class LLHTTPRetryPolicy: public LLThreadSafeRefCount public: LLHTTPRetryPolicy() {} virtual ~LLHTTPRetryPolicy() {} - virtual bool shouldRetry(U32 status, F32& seconds_to_wait) = 0; + virtual bool shouldRetry(S32 status, const LLSD& headers, F32& seconds_to_wait) = 0; }; // Example of simplest possible policy, not necessarily recommended. +// This would be a potentially dangerous policy to enable. Removing for now: +#if 0 class LLAlwaysRetryImmediatelyPolicy: public LLHTTPRetryPolicy { public: LLAlwaysRetryImmediatelyPolicy() {} - bool shouldRetry(U32 status, F32& seconds_to_wait) + bool shouldRetry(S32 status, const LLSD& headers, F32& seconds_to_wait) { seconds_to_wait = 0.0; return true; } }; +#endif // Very general policy with geometric back-off after failures, // up to a maximum delay, and maximum number of retries. @@ -3014,10 +3017,25 @@ public: { } - bool shouldRetry(U32 status, F32& seconds_to_wait) + bool shouldRetry(S32 status, const LLSD& headers, F32& seconds_to_wait) { - seconds_to_wait = mDelay; - mDelay = llclamp(mDelay*mBackoffFactor,mMinDelay,mMaxDelay); +#if 0 + // *TODO: Test using status codes to only retry server errors. + // Only server errors would potentially return a different result on retry. + if (!isHttpServerErrorStatus(status)) return false; +#endif + +#if 0 + // *TODO: Honor server Retry-After header. + // Status 503 may ask us to wait for a certain amount of time before retrying. + if (!headers.has(HTTP_HEADER_RETRY_AFTER) + || !getSecondsUntilRetryAfter(headers[HTTP_HEADER_RETRY_AFTER].asStringRef(), seconds_to_wait)) +#endif + { + seconds_to_wait = mDelay; + mDelay = llclamp(mDelay*mBackoffFactor,mMinDelay,mMaxDelay); + } + mRetryCount++; return (mRetryCount<=mMaxRetries); } @@ -3033,6 +3051,7 @@ private: class RequestAgentUpdateAppearanceResponder: public LLHTTPClient::Responder { + LOG_CLASS(RequestAgentUpdateAppearanceResponder); public: RequestAgentUpdateAppearanceResponder() { @@ -3043,13 +3062,19 @@ public: { } +protected: // Successful completion. - /* virtual */ void result(const LLSD& content) + /* virtual */ void httpSuccess() { - LL_DEBUGS("Avatar") << "content: " << ll_pretty_print_sd(content) << LL_ENDL; + const LLSD& content = getContent(); + if (!content.isMap()) + { + failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content); + return; + } if (content["success"].asBoolean()) { - LL_DEBUGS("Avatar") << "OK" << LL_ENDL; + LL_DEBUGS("Avatar") << dumpResponse() << LL_ENDL; if (gSavedSettings.getBOOL("DebugAvatarAppearanceMessage")) { dumpContents(gAgentAvatarp->getFullname() + "_appearance_request_ok", content); @@ -3057,33 +3082,35 @@ public: } else { - onFailure(200); + failureResult(HTTP_INTERNAL_ERROR, "Non-success response", content); } } // Error - /*virtual*/ void errorWithContent(U32 status, const std::string& reason, const LLSD& content) + /*virtual*/ void httpFailure() { - llwarns << "appearance update request failed, status: " << status << " reason: " << reason << " code: " << content["code"].asInteger() << " error: \"" << content["error"].asString() << "\"" << llendl; + const LLSD& content = getContent(); + LL_WARNS("Avatar") << "appearance update request failed " + << dumpResponse() << LL_ENDL; if (gSavedSettings.getBOOL("DebugAvatarAppearanceMessage")) { dumpContents(gAgentAvatarp->getFullname() + "_appearance_request_error", content); debugCOF(content); } - onFailure(status); - } + onFailure(); + } - void onFailure(U32 status) + void onFailure() { F32 seconds_to_wait; - if (mRetryPolicy->shouldRetry(status,seconds_to_wait)) + if (mRetryPolicy->shouldRetry(getStatus(), getResponseHeaders(), seconds_to_wait)) { llinfos << "retrying" << llendl; doAfterInterval(boost::bind(&LLAppearanceMgr::requestServerAppearanceUpdate, LLAppearanceMgr::getInstance(), - LLCurl::ResponderPtr(this)), - seconds_to_wait); + LLHTTPClient::ResponderPtr(this)), + seconds_to_wait); } else { @@ -3286,6 +3313,7 @@ void LLAppearanceMgr::requestServerAppearanceUpdate(LLCurl::ResponderPtr respond class LLIncrementCofVersionResponder : public LLHTTPClient::Responder { + LOG_CLASS(LLIncrementCofVersionResponder); public: LLIncrementCofVersionResponder() : LLHTTPClient::Responder() { @@ -3296,10 +3324,17 @@ public: { } - virtual void result(const LLSD &pContent) +protected: + virtual void httpSuccess() { llinfos << "Successfully incremented agent's COF." << llendl; - S32 new_version = pContent["category"]["version"].asInteger(); + const LLSD& content = getContent(); + if (!content.isMap()) + { + failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content); + return; + } + S32 new_version = content["category"]["version"].asInteger(); LLAppearanceMgr* app_mgr = LLAppearanceMgr::getInstance(); @@ -3308,12 +3343,13 @@ public: app_mgr->mLastUpdateRequestCOFVersion = new_version; } - virtual void errorWithContent(U32 pStatus, const std::string& pReason, const LLSD& content) + + virtual void httpFailure() { - llwarns << "While attempting to increment the agent's cof we got an error with [status:" - << pStatus << "]: " << content << llendl; + LL_WARNS("Avatar") << "While attempting to increment the agent's cof we got an error " + << dumpResponse() << LL_ENDL; F32 seconds_to_wait; - if (mRetryPolicy->shouldRetry(pStatus,seconds_to_wait)) + if (mRetryPolicy->shouldRetry(getStatus(), getResponseHeaders(), seconds_to_wait)) { llinfos << "retrying" << llendl; doAfterInterval(boost::bind(&LLAppearanceMgr::incrementCofVersion, @@ -3327,6 +3363,7 @@ public: } } +private: LLPointer<LLHTTPRetryPolicy> mRetryPolicy; }; diff --git a/indra/newview/llassetuploadqueue.cpp b/indra/newview/llassetuploadqueue.cpp index 4bdb690225..cde9bc9dc0 100644 --- a/indra/newview/llassetuploadqueue.cpp +++ b/indra/newview/llassetuploadqueue.cpp @@ -36,6 +36,7 @@ class LLAssetUploadChainResponder : public LLUpdateTaskInventoryResponder { + LOG_CLASS(LLAssetUploadChainResponder); public: LLAssetUploadChainResponder(const LLSD& post_data, @@ -51,52 +52,54 @@ public: mDataSize(data_size), mScriptName(script_name) { - } + } virtual ~LLAssetUploadChainResponder() - { - if(mSupplier) - { - LLAssetUploadQueue *queue = mSupplier->get(); - if (queue) - { - // Give ownership of supplier back to queue. - queue->mSupplier = mSupplier; - mSupplier = NULL; - } - } - delete mSupplier; + { + if(mSupplier) + { + LLAssetUploadQueue *queue = mSupplier->get(); + if (queue) + { + // Give ownership of supplier back to queue. + queue->mSupplier = mSupplier; + mSupplier = NULL; + } + } + delete mSupplier; delete mData; - } + } - virtual void errorWithContent(U32 statusNum, const std::string& reason, const LLSD& content) - { - llwarns << "LLAssetUploadChainResponder Error [status:" - << statusNum << "]: " << content << llendl; - LLUpdateTaskInventoryResponder::errorWithContent(statusNum, reason, content); - LLAssetUploadQueue *queue = mSupplier->get(); - if (queue) +protected: + virtual void httpFailure() + { + // Parent class will spam the failure. + //llwarns << dumpResponse() << llendl; + LLUpdateTaskInventoryResponder::httpFailure(); + LLAssetUploadQueue *queue = mSupplier->get(); + if (queue) + { + queue->request(&mSupplier); + } + } + + virtual void httpSuccess() + { + LLUpdateTaskInventoryResponder::httpSuccess(); + LLAssetUploadQueue *queue = mSupplier->get(); + if (queue) { - queue->request(&mSupplier); - } - } - - virtual void result(const LLSD& content) - { - LLUpdateTaskInventoryResponder::result(content); - LLAssetUploadQueue *queue = mSupplier->get(); - if (queue) - { - // Responder is reused across 2 phase upload, - // so only start next upload after 2nd phase complete. - std::string state = content["state"]; - if(state == "complete") - { - queue->request(&mSupplier); - } - } - } + // Responder is reused across 2 phase upload, + // so only start next upload after 2nd phase complete. + const std::string& state = getContent()["state"].asStringRef(); + if(state == "complete") + { + queue->request(&mSupplier); + } + } + } +public: virtual void uploadUpload(const LLSD& content) { std::string uploader = content["uploader"]; diff --git a/indra/newview/llassetuploadresponders.cpp b/indra/newview/llassetuploadresponders.cpp index 2564802387..ea511b18e2 100644 --- a/indra/newview/llassetuploadresponders.cpp +++ b/indra/newview/llassetuploadresponders.cpp @@ -225,37 +225,41 @@ LLAssetUploadResponder::~LLAssetUploadResponder() } // virtual -void LLAssetUploadResponder::errorWithContent(U32 statusNum, const std::string& reason, const LLSD& content) +void LLAssetUploadResponder::httpFailure() { - llinfos << "LLAssetUploadResponder::error [status:" - << statusNum << "]: " << content << llendl; + // *TODO: Add adaptive retry policy? + llwarns << dumpResponse() << llendl; LLSD args; - switch(statusNum) + if (isHttpClientErrorStatus(getStatus())) { - case 400: - args["FILE"] = (mFileName.empty() ? mVFileID.asString() : mFileName); - args["REASON"] = "Error in upload request. Please visit " - "http://secondlife.com/support for help fixing this problem."; - LLNotificationsUtil::add("CannotUploadReason", args); - break; - case 500: - default: - args["FILE"] = (mFileName.empty() ? mVFileID.asString() : mFileName); - args["REASON"] = "The server is experiencing unexpected " - "difficulties."; - LLNotificationsUtil::add("CannotUploadReason", args); - break; + args["FILE"] = (mFileName.empty() ? mVFileID.asString() : mFileName); + args["REASON"] = "Error in upload request. Please visit " + "http://secondlife.com/support for help fixing this problem."; + LLNotificationsUtil::add("CannotUploadReason", args); + } + else + { + args["FILE"] = (mFileName.empty() ? mVFileID.asString() : mFileName); + args["REASON"] = "The server is experiencing unexpected " + "difficulties."; + LLNotificationsUtil::add("CannotUploadReason", args); } LLUploadDialog::modalUploadFinished(); LLFilePicker::instance().reset(); // unlock file picker when bulk upload fails } //virtual -void LLAssetUploadResponder::result(const LLSD& content) +void LLAssetUploadResponder::httpSuccess() { + const LLSD& content = getContent(); + if (!content.isMap()) + { + failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content); + return; + } lldebugs << "LLAssetUploadResponder::result from capabilities" << llendl; - std::string state = content["state"]; + const std::string& state = content["state"].asStringRef(); if (state == "upload") { @@ -280,7 +284,7 @@ void LLAssetUploadResponder::result(const LLSD& content) void LLAssetUploadResponder::uploadUpload(const LLSD& content) { - std::string uploader = content["uploader"]; + const std::string& uploader = content["uploader"].asStringRef(); if (mFileName.empty()) { LLHTTPClient::postFile(uploader, mVFileID, mAssetType, this); @@ -293,6 +297,7 @@ void LLAssetUploadResponder::uploadUpload(const LLSD& content) void LLAssetUploadResponder::uploadFailure(const LLSD& content) { + llwarns << dumpResponse() << llendl; // remove the "Uploading..." message LLUploadDialog::modalUploadFinished(); LLFloater* floater_snapshot = LLFloaterReg::findInstance("snapshot"); @@ -301,7 +306,7 @@ void LLAssetUploadResponder::uploadFailure(const LLSD& content) floater_snapshot->notify(LLSD().with("set-finished", LLSD().with("ok", false).with("msg", "inventory"))); } - std::string reason = content["state"]; + const std::string& reason = content["state"].asStringRef(); // deal with L$ errors if (reason == "insufficient funds") { @@ -340,9 +345,9 @@ LLNewAgentInventoryResponder::LLNewAgentInventoryResponder( } // virtual -void LLNewAgentInventoryResponder::errorWithContent(U32 statusNum, const std::string& reason, const LLSD& content) +void LLNewAgentInventoryResponder::httpFailure() { - LLAssetUploadResponder::errorWithContent(statusNum, reason, content); + LLAssetUploadResponder::httpFailure(); //LLImportColladaAssetCache::getInstance()->assetUploaded(mVFileID, LLUUID(), FALSE); } @@ -487,10 +492,9 @@ void LLSendTexLayerResponder::uploadComplete(const LLSD& content) } } -void LLSendTexLayerResponder::errorWithContent(U32 statusNum, const std::string& reason, const LLSD& content) +void LLSendTexLayerResponder::httpFailure() { - llinfos << "LLSendTexLayerResponder error [status:" - << statusNum << "]: " << content << llendl; + llwarns << dumpResponse() << llendl; // Invoke the original callback with an error result LLViewerTexLayerSetBuffer::onTextureUploadComplete(LLUUID(), (void*) mBakedUploadData, -1, LL_EXSTAT_NONE); @@ -1009,19 +1013,14 @@ LLNewAgentInventoryVariablePriceResponder::~LLNewAgentInventoryVariablePriceResp delete mImpl; } -void LLNewAgentInventoryVariablePriceResponder::errorWithContent( - U32 statusNum, - const std::string& reason, - const LLSD& content) +void LLNewAgentInventoryVariablePriceResponder::httpFailure() { - lldebugs - << "LLNewAgentInventoryVariablePrice::error " << statusNum - << " reason: " << reason << llendl; + const LLSD& content = getContent(); + LL_WARNS("Upload") << dumpResponse() << LL_ENDL; - if ( content.has("error") ) + static const std::string _ERROR = "error"; + if ( content.has(_ERROR) ) { - static const std::string _ERROR = "error"; - mImpl->onTransportError(content[_ERROR]); } else @@ -1030,8 +1029,14 @@ void LLNewAgentInventoryVariablePriceResponder::errorWithContent( } } -void LLNewAgentInventoryVariablePriceResponder::result(const LLSD& content) +void LLNewAgentInventoryVariablePriceResponder::httpSuccess() { + const LLSD& content = getContent(); + if (!content.isMap()) + { + failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content); + return; + } // Parse out application level errors and the appropriate // responses for them static const std::string _ERROR = "error"; @@ -1047,6 +1052,7 @@ void LLNewAgentInventoryVariablePriceResponder::result(const LLSD& content) // Check for application level errors if ( content.has(_ERROR) ) { + LL_WARNS("Upload") << dumpResponse() << LL_ENDL; onApplicationLevelError(content[_ERROR]); return; } @@ -1090,6 +1096,7 @@ void LLNewAgentInventoryVariablePriceResponder::result(const LLSD& content) } else { + LL_WARNS("Upload") << dumpResponse() << LL_ENDL; onApplicationLevelError(""); } } diff --git a/indra/newview/llassetuploadresponders.h b/indra/newview/llassetuploadresponders.h index a6d1016136..abfdc4ca77 100644 --- a/indra/newview/llassetuploadresponders.h +++ b/indra/newview/llassetuploadresponders.h @@ -33,6 +33,8 @@ // via capabilities class LLAssetUploadResponder : public LLHTTPClient::Responder { +protected: + LOG_CLASS(LLAssetUploadResponder); public: LLAssetUploadResponder(const LLSD& post_data, const LLUUID& vfile_id, @@ -42,8 +44,11 @@ public: LLAssetType::EType asset_type); ~LLAssetUploadResponder(); - virtual void errorWithContent(U32 statusNum, const std::string& reason, const LLSD& content); - virtual void result(const LLSD& content); +protected: + virtual void httpFailure(); + virtual void httpSuccess(); + +public: virtual void uploadUpload(const LLSD& content); virtual void uploadComplete(const LLSD& content); virtual void uploadFailure(const LLSD& content); @@ -58,6 +63,7 @@ protected: // TODO*: Remove this once deprecated class LLNewAgentInventoryResponder : public LLAssetUploadResponder { + LOG_CLASS(LLNewAgentInventoryResponder); public: LLNewAgentInventoryResponder( const LLSD& post_data, @@ -67,9 +73,10 @@ public: const LLSD& post_data, const std::string& file_name, LLAssetType::EType asset_type); - virtual void errorWithContent(U32 statusNum, const std::string& reason, const LLSD& content); virtual void uploadComplete(const LLSD& content); virtual void uploadFailure(const LLSD& content); +protected: + virtual void httpFailure(); }; // A base class which goes through and performs some default @@ -79,6 +86,7 @@ public: class LLNewAgentInventoryVariablePriceResponder : public LLHTTPClient::Responder { + LOG_CLASS(LLNewAgentInventoryVariablePriceResponder); public: LLNewAgentInventoryVariablePriceResponder( const LLUUID& vfile_id, @@ -91,12 +99,11 @@ public: const LLSD& inventory_info); virtual ~LLNewAgentInventoryVariablePriceResponder(); - void errorWithContent( - U32 statusNum, - const std::string& reason, - const LLSD& content); - void result(const LLSD& content); +private: + /* virtual */ void httpFailure(); + /* virtual */ void httpSuccess(); +public: virtual void onApplicationLevelError( const LLSD& error); virtual void showConfirmationDialog( @@ -122,8 +129,11 @@ public: ~LLSendTexLayerResponder(); virtual void uploadComplete(const LLSD& content); - virtual void errorWithContent(U32 statusNum, const std::string& reason, const LLSD& content); +protected: + virtual void httpFailure(); + +private: LLBakedUploadData * mBakedUploadData; }; diff --git a/indra/newview/llclassifiedstatsresponder.cpp b/indra/newview/llclassifiedstatsresponder.cpp index e3cd83e174..923662e887 100644 --- a/indra/newview/llclassifiedstatsresponder.cpp +++ b/indra/newview/llclassifiedstatsresponder.cpp @@ -44,8 +44,14 @@ mClassifiedID(classified_id) } /*virtual*/ -void LLClassifiedStatsResponder::result(const LLSD& content) +void LLClassifiedStatsResponder::httpSuccess() { + const LLSD& content = getContent(); + if (!content.isMap()) + { + failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content); + return; + } S32 teleport = content["teleport_clicks"].asInteger(); S32 map = content["map_clicks"].asInteger(); S32 profile = content["profile_clicks"].asInteger(); @@ -62,7 +68,8 @@ void LLClassifiedStatsResponder::result(const LLSD& content) } /*virtual*/ -void LLClassifiedStatsResponder::errorWithContent(U32 status, const std::string& reason, const LLSD& content) +void LLClassifiedStatsResponder::httpFailure() { - llinfos << "LLClassifiedStatsResponder::error [status:" << status << "]: " << content << llendl; + llwarns << dumpResponse() << llendl; } + diff --git a/indra/newview/llclassifiedstatsresponder.h b/indra/newview/llclassifiedstatsresponder.h index 06dcb62fd0..efa4d82411 100644 --- a/indra/newview/llclassifiedstatsresponder.h +++ b/indra/newview/llclassifiedstatsresponder.h @@ -33,13 +33,15 @@ class LLClassifiedStatsResponder : public LLHTTPClient::Responder { + LOG_CLASS(LLClassifiedStatsResponder); public: LLClassifiedStatsResponder(LLUUID classified_id); + +protected: //If we get back a normal response, handle it here - virtual void result(const LLSD& content); + virtual void httpSuccess(); //If we get back an error (not found, etc...), handle it here - - virtual void errorWithContent(U32 status, const std::string& reason, const LLSD& content); + virtual void httpFailure(); protected: LLUUID mClassifiedID; diff --git a/indra/newview/llestateinfomodel.cpp b/indra/newview/llestateinfomodel.cpp index 2669b0340f..db2c15a444 100644 --- a/indra/newview/llestateinfomodel.cpp +++ b/indra/newview/llestateinfomodel.cpp @@ -112,19 +112,19 @@ void LLEstateInfoModel::notifyCommit() class LLEstateChangeInfoResponder : public LLHTTPClient::Responder { -public: - + LOG_CLASS(LLEstateChangeInfoResponder); +protected: // if we get a normal response, handle it here - virtual void result(const LLSD& content) + virtual void httpSuccesss() { llinfos << "Committed estate info" << llendl; LLEstateInfoModel::instance().notifyCommit(); } // if we get an error response - virtual void errorWithContent(U32 status, const std::string& reason, const LLSD& content) + virtual void httpFailure() { - llwarns << "Failed to commit estate info [status:" << status << "]: " << content << llendl; + llwarns << "Failed to commit estate info " << dumpResponse() << llendl; } }; diff --git a/indra/newview/lleventpoll.cpp b/indra/newview/lleventpoll.cpp index e0f7223a8c..c3b53d5e4a 100644 --- a/indra/newview/lleventpoll.cpp +++ b/indra/newview/lleventpoll.cpp @@ -31,7 +31,7 @@ #include "llagent.h" #include "llhttpclient.h" -#include "llhttpstatuscodes.h" +#include "llhttpconstants.h" #include "llsdserialize.h" #include "lleventtimer.h" #include "llviewerregion.h" @@ -49,6 +49,7 @@ namespace class LLEventPollResponder : public LLHTTPClient::Responder { + LOG_CLASS(LLEventPollResponder); public: static LLHTTPClient::ResponderPtr start(const std::string& pollURL, const LLHost& sender); @@ -56,19 +57,19 @@ namespace void makeRequest(); + /* virtual */ void completedRaw(const LLChannelDescriptors& channels, + const LLIOPipe::buffer_ptr_t& buffer); + private: LLEventPollResponder(const std::string& pollURL, const LLHost& sender); ~LLEventPollResponder(); void handleMessage(const LLSD& content); - virtual void errorWithContent(U32 status, const std::string& reason, const LLSD& content); - virtual void result(const LLSD& content); - virtual void completedRaw(U32 status, - const std::string& reason, - const LLChannelDescriptors& channels, - const LLIOPipe::buffer_ptr_t& buffer); + /* virtual */ void httpFailure(); + /* virtual */ void httpSuccess(); + private: bool mDone; @@ -149,20 +150,18 @@ namespace } // virtual - void LLEventPollResponder::completedRaw(U32 status, - const std::string& reason, - const LLChannelDescriptors& channels, - const LLIOPipe::buffer_ptr_t& buffer) + void LLEventPollResponder::completedRaw(const LLChannelDescriptors& channels, + const LLIOPipe::buffer_ptr_t& buffer) { - if (status == HTTP_BAD_GATEWAY) + if (getStatus() == HTTP_BAD_GATEWAY) { // These errors are not parsable as LLSD, // which LLHTTPClient::Responder::completedRaw will try to do. - completed(status, reason, LLSD()); + httpCompleted(); } else { - LLHTTPClient::Responder::completedRaw(status,reason,channels,buffer); + LLHTTPClient::Responder::completedRaw(channels,buffer); } } @@ -187,13 +186,13 @@ namespace } //virtual - void LLEventPollResponder::errorWithContent(U32 status, const std::string& reason, const LLSD& content) + void LLEventPollResponder::httpFailure() { if (mDone) return; // A HTTP_BAD_GATEWAY (502) error is our standard timeout response // we get this when there are no events. - if ( status == HTTP_BAD_GATEWAY ) + if ( getStatus() == HTTP_BAD_GATEWAY ) { mErrorCount = 0; makeRequest(); @@ -207,12 +206,12 @@ namespace + mErrorCount * EVENT_POLL_ERROR_RETRY_SECONDS_INC , this); - llwarns << "LLEventPollResponder error [status:" << status << "]: " << content << llendl; + llwarns << dumpResponse() << llendl; } else { - llwarns << "LLEventPollResponder error <" << mCount - << "> [status:" << status << "]: " << content + llwarns << dumpResponse() + << " [count:" << mCount << "] " << (mDone ? " -- done" : "") << llendl; stop(); @@ -234,7 +233,7 @@ namespace } //virtual - void LLEventPollResponder::result(const LLSD& content) + void LLEventPollResponder::httpSuccess() { lldebugs << "LLEventPollResponder::result <" << mCount << ">" << (mDone ? " -- done" : "") << llendl; @@ -243,10 +242,12 @@ namespace mErrorCount = 0; - if (!content.get("events") || + const LLSD& content = getContent(); + if (!content.isMap() || + !content.get("events") || !content.get("id")) { - llwarns << "received event poll with no events or id key" << llendl; + llwarns << "received event poll with no events or id key: " << dumpResponse() << llendl; makeRequest(); return; } diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp index a4cadcd5dc..c4ae718082 100644 --- a/indra/newview/llfeaturemanager.cpp +++ b/indra/newview/llfeaturemanager.cpp @@ -39,6 +39,7 @@ #include "llsecondlifeurls.h" #include "llappviewer.h" +#include "llbufferstream.h" #include "llhttpclient.h" #include "llnotificationsutil.h" #include "llviewercontrol.h" @@ -509,6 +510,7 @@ void LLFeatureManager::parseGPUTable(std::string filename) // responder saves table into file class LLHTTPFeatureTableResponder : public LLHTTPClient::Responder { + LOG_CLASS(LLHTTPFeatureTableResponder); public: LLHTTPFeatureTableResponder(std::string filename) : @@ -517,11 +519,10 @@ public: } - virtual void completedRaw(U32 status, const std::string& reason, - const LLChannelDescriptors& channels, + virtual void completedRaw(const LLChannelDescriptors& channels, const LLIOPipe::buffer_ptr_t& buffer) { - if (isGoodStatus(status)) + if (isGoodStatus()) { // write to file @@ -540,7 +541,18 @@ public: out.close(); } } - + else + { + char body[1025]; + body[1024] = '\0'; + LLBufferStream istr(channels, buffer.get()); + istr.get(body,1024); + if (strlen(body) > 0) + { + mContent["body"] = body; + } + llwarns << dumpResponse() << llendl; + } } private: diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp index d13f85baa2..89d74666f7 100644 --- a/indra/newview/llfilepicker.cpp +++ b/indra/newview/llfilepicker.cpp @@ -1240,9 +1240,9 @@ static std::string add_imageload_filter_to_gtkchooser(GtkWindow *picker) { GtkFileFilter *gfilter = gtk_file_filter_new(); gtk_file_filter_add_pattern(gfilter, "*.tga"); - gtk_file_filter_add_mime_type(gfilter, "image/jpeg"); - gtk_file_filter_add_mime_type(gfilter, "image/png"); - gtk_file_filter_add_mime_type(gfilter, "image/bmp"); + gtk_file_filter_add_mime_type(gfilter, HTTP_CONTENT_IMAGE_JPEG.c_str()); + gtk_file_filter_add_mime_type(gfilter, HTTP_CONTENT_IMAGE_PNG.c_str()); + gtk_file_filter_add_mime_type(gfilter, HTTP_CONTENT_IMAGE_BMP.c_str()); std::string filtername = LLTrans::getString("image_files") + " (*.tga; *.bmp; *.jpg; *.png)"; add_common_filters_to_gtkchooser(gfilter, picker, filtername); return filtername; @@ -1250,13 +1250,13 @@ static std::string add_imageload_filter_to_gtkchooser(GtkWindow *picker) static std::string add_script_filter_to_gtkchooser(GtkWindow *picker) { - return add_simple_mime_filter_to_gtkchooser(picker, "text/plain", + return add_simple_mime_filter_to_gtkchooser(picker, HTTP_CONTENT_TEXT_PLAIN, LLTrans::getString("script_files") + " (*.lsl)"); } static std::string add_dictionary_filter_to_gtkchooser(GtkWindow *picker) { - return add_simple_mime_filter_to_gtkchooser(picker, "text/plain", + return add_simple_mime_filter_to_gtkchooser(picker, HTTP_CONTENT_TEXT_PLAIN, LLTrans::getString("dictionary_files") + " (*.dic; *.xcu)"); } @@ -1294,7 +1294,7 @@ BOOL LLFilePicker::getSaveFile( ESaveFilter filter, const std::string& filename break; case FFSAVE_BMP: caption += add_simple_mime_filter_to_gtkchooser - (picker, "image/bmp", LLTrans::getString("bitmap_image_files") + " (*.bmp)"); + (picker, HTTP_CONTENT_IMAGE_BMP, LLTrans::getString("bitmap_image_files") + " (*.bmp)"); suggest_ext = ".bmp"; break; case FFSAVE_AVI: @@ -1319,6 +1319,7 @@ BOOL LLFilePicker::getSaveFile( ESaveFilter filter, const std::string& filename suggest_ext = ".raw"; break; case FFSAVE_J2C: + // *TODO: Should this be 'image/j2c' ? caption += add_simple_mime_filter_to_gtkchooser (picker, "images/jp2", LLTrans::getString("compressed_image_files") + " (*.j2c)"); diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp index 83fb887d81..63888ace11 100644 --- a/indra/newview/llfloaterabout.cpp +++ b/indra/newview/llfloaterabout.cpp @@ -77,14 +77,9 @@ class LLServerReleaseNotesURLFetcher : public LLHTTPClient::Responder { LOG_CLASS(LLServerReleaseNotesURLFetcher); public: - static void startFetch(); - /*virtual*/ void completedHeader(U32 status, const std::string& reason, const LLSD& content); - /*virtual*/ void completedRaw( - U32 status, - const std::string& reason, - const LLChannelDescriptors& channels, - const LLIOPipe::buffer_ptr_t& buffer); +private: + /* virtual */ void httpCompleted(); }; ///---------------------------------------------------------------------------- @@ -471,32 +466,27 @@ void LLServerReleaseNotesURLFetcher::startFetch() } // virtual -void LLServerReleaseNotesURLFetcher::completedHeader(U32 status, const std::string& reason, const LLSD& content) +void LLServerReleaseNotesURLFetcher::httpCompleted() { - lldebugs << "Status: " << status << llendl; - lldebugs << "Reason: " << reason << llendl; - lldebugs << "Headers: " << content << llendl; + LL_DEBUGS("ServerReleaseNotes") << dumpResponse() + << " [headers:" << getResponseHeaders() << "]" << LL_ENDL; LLFloaterAbout* floater_about = LLFloaterReg::getTypedInstance<LLFloaterAbout>("sl_about"); if (floater_about) { - std::string location = content["location"].asString(); + const bool check_lower = true; + const std::string& location = getResponseHeader(HTTP_HEADER_LOCATION, check_lower); if (location.empty()) { - location = floater_about->getString("ErrorFetchingServerReleaseNotesURL"); + LL_WARNS("ServerReleaseNotes") << "Missing Location header " + << dumpResponse() << " [headers:" << getResponseHeaders() << "]" << LL_ENDL; + floater_about->updateServerReleaseNotesURL( + floater_about->getString("ErrorFetchingServerReleaseNotesURL")); + } + else + { + floater_about->updateServerReleaseNotesURL(location); } - floater_about->updateServerReleaseNotesURL(location); } } -// virtual -void LLServerReleaseNotesURLFetcher::completedRaw( - U32 status, - const std::string& reason, - const LLChannelDescriptors& channels, - const LLIOPipe::buffer_ptr_t& buffer) -{ - // Do nothing. - // We're overriding just because the base implementation tries to - // deserialize LLSD which triggers warnings. -} diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index 752aba5e16..eaf4d062fe 100644 --- a/indra/newview/llfloateravatarpicker.cpp +++ b/indra/newview/llfloateravatarpicker.cpp @@ -380,12 +380,14 @@ BOOL LLFloaterAvatarPicker::visibleItemsSelected() const class LLAvatarPickerResponder : public LLHTTPClient::Responder { + LOG_CLASS(LLAvatarPickerResponder); public: LLUUID mQueryID; LLAvatarPickerResponder(const LLUUID& id) : mQueryID(id) { } - /*virtual*/ void completed(U32 status, const std::string& reason, const LLSD& content) +protected: + /*virtual*/ void httpCompleted() { //std::ostringstream ss; //LLSDSerialize::toPrettyXML(content, ss); @@ -393,19 +395,18 @@ public: // in case of invalid characters, the avatar picker returns a 400 // just set it to process so it displays 'not found' - if (isGoodStatus(status) || status == 400) + if (isGoodStatus() || getStatus() == HTTP_BAD_REQUEST) { LLFloaterAvatarPicker* floater = LLFloaterReg::findTypedInstance<LLFloaterAvatarPicker>("avatar_picker"); if (floater) { - floater->processResponse(mQueryID, content); + floater->processResponse(mQueryID, getContent()); } } else { - llwarns << "avatar picker failed [status:" << status << "]: " << content << llendl; - + llwarns << "avatar picker failed " << dumpResponse() << llendl; } } }; diff --git a/indra/newview/llfloaterbuycurrencyhtml.cpp b/indra/newview/llfloaterbuycurrencyhtml.cpp index 013cf74c7b..6e641e7d40 100644 --- a/indra/newview/llfloaterbuycurrencyhtml.cpp +++ b/indra/newview/llfloaterbuycurrencyhtml.cpp @@ -27,6 +27,7 @@ #include "llviewerprecompiledheaders.h" #include "llfloaterbuycurrencyhtml.h" +#include "llhttpconstants.h" #include "llstatusbar.h" //////////////////////////////////////////////////////////////////////////////// @@ -85,7 +86,7 @@ void LLFloaterBuyCurrencyHTML::navigateToFinalURL() llinfos << "Buy currency HTML parsed URL is " << buy_currency_url << llendl; // kick off the navigation - mBrowser->navigateTo( buy_currency_url, "text/html" ); + mBrowser->navigateTo( buy_currency_url, HTTP_CONTENT_TEXT_HTML ); } //////////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llfloaterhelpbrowser.cpp b/indra/newview/llfloaterhelpbrowser.cpp index 4cb632bd6a..c0bb213540 100644 --- a/indra/newview/llfloaterhelpbrowser.cpp +++ b/indra/newview/llfloaterhelpbrowser.cpp @@ -29,6 +29,7 @@ #include "llfloaterhelpbrowser.h" #include "llfloaterreg.h" +#include "llhttpconstants.h" #include "llpluginclassmedia.h" #include "llmediactrl.h" #include "llviewerwindow.h" @@ -37,7 +38,6 @@ #include "llui.h" #include "llurlhistory.h" -#include "llmediactrl.h" #include "llviewermedia.h" #include "llviewerhelp.h" @@ -148,7 +148,7 @@ void LLFloaterHelpBrowser::openMedia(const std::string& media_url) { // explicitly make the media mime type for this floater since it will // only ever display one type of content (Web). - mBrowser->setHomePageUrl(media_url, "text/html"); - mBrowser->navigateTo(media_url, "text/html"); + mBrowser->setHomePageUrl(media_url, HTTP_CONTENT_TEXT_HTML); + mBrowser->navigateTo(media_url, HTTP_CONTENT_TEXT_HTML); setCurrentURL(media_url); } diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index c9f5b42b20..c365666f00 100755 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -5839,7 +5839,7 @@ void LLFloaterModelPreview::handleModelPhysicsFeeReceived() mUploadBtn->setEnabled(mHasUploadPerm && !mUploadModelUrl.empty()); } -void LLFloaterModelPreview::setModelPhysicsFeeErrorStatus(U32 status, const std::string& reason) +void LLFloaterModelPreview::setModelPhysicsFeeErrorStatus(S32 status, const std::string& reason) { llwarns << "LLFloaterModelPreview::setModelPhysicsFeeErrorStatus(" << status << " : " << reason << ")" << llendl; doOnIdleOneTime(boost::bind(&LLFloaterModelPreview::toggleCalculateButton, this, true)); @@ -5915,7 +5915,7 @@ void LLFloaterModelPreview::onPermissionsReceived(const LLSD& result) getChild<LLTextBox>("warning_message")->setVisible(!mHasUploadPerm); } -void LLFloaterModelPreview::setPermissonsErrorStatus(U32 status, const std::string& reason) +void LLFloaterModelPreview::setPermissonsErrorStatus(S32 status, const std::string& reason) { llwarns << "LLFloaterModelPreview::setPermissonsErrorStatus(" << status << " : " << reason << ")" << llendl; diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index e588418f7b..6c0c60b87f 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -200,11 +200,11 @@ public: /*virtual*/ void onPermissionsReceived(const LLSD& result); // called when error occurs during permissions request - /*virtual*/ void setPermissonsErrorStatus(U32 status, const std::string& reason); + /*virtual*/ void setPermissonsErrorStatus(S32 status, const std::string& reason); /*virtual*/ void onModelPhysicsFeeReceived(const LLSD& result, std::string upload_url); void handleModelPhysicsFeeReceived(); - /*virtual*/ void setModelPhysicsFeeErrorStatus(U32 status, const std::string& reason); + /*virtual*/ void setModelPhysicsFeeErrorStatus(S32 status, const std::string& reason); /*virtual*/ void onModelUploadSuccess(); diff --git a/indra/newview/llfloatermodeluploadbase.cpp b/indra/newview/llfloatermodeluploadbase.cpp index 6d3800bfa4..9f1fc06e14 100644 --- a/indra/newview/llfloatermodeluploadbase.cpp +++ b/indra/newview/llfloatermodeluploadbase.cpp @@ -45,7 +45,7 @@ void LLFloaterModelUploadBase::requestAgentUploadPermissions() if (!url.empty()) { llinfos<< typeid(*this).name() <<"::requestAgentUploadPermissions() requesting for upload model permissions from: "<< url <<llendl; - LLHTTPClient::get(url, new LLUploadModelPremissionsResponder(getPermObserverHandle())); + LLHTTPClient::get(url, new LLUploadModelPermissionsResponder(getPermObserverHandle())); } else { diff --git a/indra/newview/llfloatermodeluploadbase.h b/indra/newview/llfloatermodeluploadbase.h index a52bc28687..d9a8879687 100644 --- a/indra/newview/llfloatermodeluploadbase.h +++ b/indra/newview/llfloatermodeluploadbase.h @@ -37,13 +37,13 @@ public: virtual ~LLFloaterModelUploadBase(){}; - virtual void setPermissonsErrorStatus(U32 status, const std::string& reason) = 0; + virtual void setPermissonsErrorStatus(S32 status, const std::string& reason) = 0; virtual void onPermissionsReceived(const LLSD& result) = 0; virtual void onModelPhysicsFeeReceived(const LLSD& result, std::string upload_url) = 0; - virtual void setModelPhysicsFeeErrorStatus(U32 status, const std::string& reason) = 0; + virtual void setModelPhysicsFeeErrorStatus(S32 status, const std::string& reason) = 0; virtual void onModelUploadSuccess() {}; diff --git a/indra/newview/llfloaterobjectweights.cpp b/indra/newview/llfloaterobjectweights.cpp index 0862cd2897..c11a0568a6 100644 --- a/indra/newview/llfloaterobjectweights.cpp +++ b/indra/newview/llfloaterobjectweights.cpp @@ -123,7 +123,7 @@ void LLFloaterObjectWeights::onWeightsUpdate(const SelectionCost& selection_cost } //virtual -void LLFloaterObjectWeights::setErrorStatus(U32 status, const std::string& reason) +void LLFloaterObjectWeights::setErrorStatus(S32 status, const std::string& reason) { const std::string text = getString("nothing_selected"); diff --git a/indra/newview/llfloaterobjectweights.h b/indra/newview/llfloaterobjectweights.h index 9a244573be..1a2c317bad 100644 --- a/indra/newview/llfloaterobjectweights.h +++ b/indra/newview/llfloaterobjectweights.h @@ -63,7 +63,7 @@ public: /*virtual*/ void onOpen(const LLSD& key); /*virtual*/ void onWeightsUpdate(const SelectionCost& selection_cost); - /*virtual*/ void setErrorStatus(U32 status, const std::string& reason); + /*virtual*/ void setErrorStatus(S32 status, const std::string& reason); void updateLandImpacts(const LLParcel* parcel); void refresh(); diff --git a/indra/newview/llfloaterregiondebugconsole.cpp b/indra/newview/llfloaterregiondebugconsole.cpp index 0cde878055..efc04ac358 100644 --- a/indra/newview/llfloaterregiondebugconsole.cpp +++ b/indra/newview/llfloaterregiondebugconsole.cpp @@ -73,24 +73,29 @@ namespace // called if this request times out. class AsyncConsoleResponder : public LLHTTPClient::Responder { - public: + LOG_CLASS(AsyncConsoleResponder); + protected: /* virtual */ - void errorWithContent(U32 status, const std::string& reason) + void httpFailure() { + LL_WARNS("Console") << dumpResponse() << LL_ENDL; sConsoleReplySignal(UNABLE_TO_SEND_COMMAND); } }; class ConsoleResponder : public LLHTTPClient::Responder { + LOG_CLASS(ConsoleResponder); public: ConsoleResponder(LLTextEditor *output) : mOutput(output) { } + protected: /*virtual*/ - void error(U32 status, const std::string& reason) + void httpFailure() { + LL_WARNS("Console") << dumpResponse() << LL_ENDL; if (mOutput) { mOutput->appendText( @@ -100,8 +105,10 @@ namespace } /*virtual*/ - void result(const LLSD& content) + void httpSuccess() { + const LLSD& content = getContent(); + LL_DEBUGS("Console") << content << LL_ENDL; if (mOutput) { mOutput->appendText( @@ -109,6 +116,7 @@ namespace } } + public: LLTextEditor * mOutput; }; diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 4a9ea5acf0..6c0e91dd2c 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -754,12 +754,12 @@ bool LLPanelRegionGeneralInfo::onMessageCommit(const LLSD& notification, const L class ConsoleRequestResponder : public LLHTTPClient::Responder { -public: + LOG_CLASS(ConsoleRequestResponder); +protected: /*virtual*/ - void errorWithContent(U32 status, const std::string& reason, const LLSD& content) + void httpFailure() { - llwarns << "ConsoleRequestResponder error requesting mesh_rez_enabled [status:" - << status << "]: " << content << llendl; + llwarns << "error requesting mesh_rez_enabled " << dumpResponse() << llendl; } }; @@ -767,12 +767,12 @@ public: // called if this request times out. class ConsoleUpdateResponder : public LLHTTPClient::Responder { -public: + LOG_CLASS(ConsoleUpdateResponder); +protected: /* virtual */ - void errorWithContent(U32 status, const std::string& reason, const LLSD& content) + void httpFailure() { - llwarns << "ConsoleRequestResponder error updating mesh enabled region setting [status:" - << status << "]: " << content << llendl; + llwarns << "error updating mesh enabled region setting " << dumpResponse() << llendl; } }; @@ -2191,14 +2191,16 @@ void LLPanelEstateInfo::getEstateOwner() class LLEstateChangeInfoResponder : public LLHTTPClient::Responder { + LOG_CLASS(LLEstateChangeInfoResponder); public: LLEstateChangeInfoResponder(LLPanelEstateInfo* panel) { mpPanel = panel->getHandle(); } +protected: // if we get a normal response, handle it here - virtual void result(const LLSD& content) + virtual void httpSuccess() { LL_INFOS("Windlight") << "Successfully committed estate info" << llendl; @@ -2209,10 +2211,9 @@ public: } // if we get an error response - virtual void errorWithContent(U32 status, const std::string& reason, const LLSD& content) + virtual void httpFailure() { - llinfos << "LLEstateChangeInfoResponder::error [status:" - << status << "]: " << content << llendl; + LL_WARNS("Windlight") << dumpResponse() << LL_ENDL; } private: LLHandle<LLPanel> mpPanel; diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp index 685b566fa8..f7fca90ebd 100644 --- a/indra/newview/llfloaterreporter.cpp +++ b/indra/newview/llfloaterreporter.cpp @@ -692,16 +692,18 @@ public: class LLUserReportResponder : public LLHTTPClient::Responder { + LOG_CLASS(LLUserReportResponder); public: LLUserReportResponder(): LLHTTPClient::Responder() {} - void errorWithContent(U32 status, const std::string& reason, const LLSD& content) - { - // *TODO do some user messaging here - LLUploadDialog::modalUploadFinished(); - } - void result(const LLSD& content) +private: + void httpCompleted() { + if (!isGoodStatus()) + { + // *TODO do some user messaging here + LL_WARNS("UserReport") << dumpResponse() << LL_ENDL; + } // we don't care about what the server returns LLUploadDialog::modalUploadFinished(); } diff --git a/indra/newview/llfloaterscriptlimits.cpp b/indra/newview/llfloaterscriptlimits.cpp index 17c34f1da0..7e94784751 100644 --- a/indra/newview/llfloaterscriptlimits.cpp +++ b/indra/newview/llfloaterscriptlimits.cpp @@ -183,8 +183,14 @@ void LLPanelScriptLimitsInfo::updateChild(LLUICtrl* child_ctr) // Responders ///---------------------------------------------------------------------------- -void fetchScriptLimitsRegionInfoResponder::result(const LLSD& content) +void fetchScriptLimitsRegionInfoResponder::httpSuccess() { + const LLSD& content = getContent(); + if (!content.isMap()) + { + failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content); + return; + } //we don't need to test with a fake respose here (shouldn't anyway) #ifdef DUMP_REPLIES_TO_LLINFOS @@ -221,13 +227,14 @@ void fetchScriptLimitsRegionInfoResponder::result(const LLSD& content) } } -void fetchScriptLimitsRegionInfoResponder::errorWithContent(U32 status, const std::string& reason, const LLSD& content) +void fetchScriptLimitsRegionInfoResponder::httpFailure() { - llwarns << "fetchScriptLimitsRegionInfoResponder error [status:" << status << "]: " << content << llendl; + llwarns << dumpResponse() << llendl; } -void fetchScriptLimitsRegionSummaryResponder::result(const LLSD& content_ref) +void fetchScriptLimitsRegionSummaryResponder::httpSuccess() { + const LLSD& content_ref = getContent(); #ifdef USE_FAKE_RESPONSES LLSD fake_content; @@ -268,6 +275,12 @@ void fetchScriptLimitsRegionSummaryResponder::result(const LLSD& content_ref) #endif + if (!content.isMap()) + { + failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content); + return; + } + #ifdef DUMP_REPLIES_TO_LLINFOS @@ -291,7 +304,7 @@ void fetchScriptLimitsRegionSummaryResponder::result(const LLSD& content_ref) LLTabContainer* tab = instance->getChild<LLTabContainer>("scriptlimits_panels"); if(tab) { - LLPanelScriptLimitsRegionMemory* panel_memory = (LLPanelScriptLimitsRegionMemory*)tab->getChild<LLPanel>("script_limits_region_memory_panel"); + LLPanelScriptLimitsRegionMemory* panel_memory = (LLPanelScriptLimitsRegionMemory*)tab->getChild<LLPanel>("script_limits_region_memory_panel"); if(panel_memory) { panel_memory->getChild<LLUICtrl>("loading_text")->setValue(LLSD(std::string(""))); @@ -301,20 +314,21 @@ void fetchScriptLimitsRegionSummaryResponder::result(const LLSD& content_ref) { btn->setEnabled(true); } - - panel_memory->setRegionSummary(content); - } -} + + panel_memory->setRegionSummary(content); + } + } } } -void fetchScriptLimitsRegionSummaryResponder::errorWithContent(U32 status, const std::string& reason, const LLSD& content) +void fetchScriptLimitsRegionSummaryResponder::httpFailure() { - llwarns << "fetchScriptLimitsRegionSummaryResponder error [status:" << status << "]: " << content << llendl; + llwarns << dumpResponse() << llendl; } -void fetchScriptLimitsRegionDetailsResponder::result(const LLSD& content_ref) +void fetchScriptLimitsRegionDetailsResponder::httpSuccess() { + const LLSD& content_ref = getContent(); #ifdef USE_FAKE_RESPONSES /* Updated detail service, ** denotes field added: @@ -377,6 +391,12 @@ result (map) #endif + if (!content.isMap()) + { + failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content); + return; + } + #ifdef DUMP_REPLIES_TO_LLINFOS LLSDNotationStreamer notation_streamer(content); @@ -417,13 +437,14 @@ result (map) } } -void fetchScriptLimitsRegionDetailsResponder::errorWithContent(U32 status, const std::string& reason, const LLSD& content) +void fetchScriptLimitsRegionDetailsResponder::httpFailure() { - llwarns << "fetchScriptLimitsRegionDetailsResponder error [status:" << status << "]: " << content << llendl; + llwarns << dumpResponse() << llendl; } -void fetchScriptLimitsAttachmentInfoResponder::result(const LLSD& content_ref) +void fetchScriptLimitsAttachmentInfoResponder::httpSuccess() { + const LLSD& content_ref = getContent(); #ifdef USE_FAKE_RESPONSES @@ -465,6 +486,12 @@ void fetchScriptLimitsAttachmentInfoResponder::result(const LLSD& content_ref) #endif + if (!content.isMap()) + { + failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content); + return; + } + #ifdef DUMP_REPLIES_TO_LLINFOS LLSDNotationStreamer notation_streamer(content); @@ -513,9 +540,9 @@ void fetchScriptLimitsAttachmentInfoResponder::result(const LLSD& content_ref) } } -void fetchScriptLimitsAttachmentInfoResponder::errorWithContent(U32 status, const std::string& reason, const LLSD& content) +void fetchScriptLimitsAttachmentInfoResponder::httpFailure() { - llwarns << "fetchScriptLimitsAttachmentInfoResponder error [status:" << status << "]: " << content << llendl; + llwarns << dumpResponse() << llendl; } ///---------------------------------------------------------------------------- @@ -586,7 +613,7 @@ void LLPanelScriptLimitsRegionMemory::setParcelID(const LLUUID& parcel_id) } // virtual -void LLPanelScriptLimitsRegionMemory::setErrorStatus(U32 status, const std::string& reason) +void LLPanelScriptLimitsRegionMemory::setErrorStatus(S32 status, const std::string& reason) { llwarns << "Can't handle remote parcel request."<< " Http Status: "<< status << ". Reason : "<< reason<<llendl; } diff --git a/indra/newview/llfloaterscriptlimits.h b/indra/newview/llfloaterscriptlimits.h index f8732ef94b..a5cb1b6184 100644 --- a/indra/newview/llfloaterscriptlimits.h +++ b/indra/newview/llfloaterscriptlimits.h @@ -85,49 +85,49 @@ protected: class fetchScriptLimitsRegionInfoResponder: public LLHTTPClient::Responder { - public: - fetchScriptLimitsRegionInfoResponder(const LLSD& info) : mInfo(info) {}; - - void result(const LLSD& content); - void errorWithContent(U32 status, const std::string& reason, const LLSD& content); - public: - protected: - LLSD mInfo; + LOG_CLASS(fetchScriptLimitsRegionInfoResponder); +public: + fetchScriptLimitsRegionInfoResponder(const LLSD& info) : mInfo(info) {}; + +private: + /* virtual */ void httpSuccess(); + /* virtual */ void httpFailure(); + LLSD mInfo; }; class fetchScriptLimitsRegionSummaryResponder: public LLHTTPClient::Responder { - public: - fetchScriptLimitsRegionSummaryResponder(const LLSD& info) : mInfo(info) {}; - - void result(const LLSD& content); - void errorWithContent(U32 status, const std::string& reason, const LLSD& content); - public: - protected: - LLSD mInfo; + LOG_CLASS(fetchScriptLimitsRegionSummaryResponder); +public: + fetchScriptLimitsRegionSummaryResponder(const LLSD& info) : mInfo(info) {}; + +private: + /* virtual */ void httpSuccess(); + /* virtual */ void httpFailure(); + LLSD mInfo; }; class fetchScriptLimitsRegionDetailsResponder: public LLHTTPClient::Responder { - public: - fetchScriptLimitsRegionDetailsResponder(const LLSD& info) : mInfo(info) {}; - - void result(const LLSD& content); - void errorWithContent(U32 status, const std::string& reason, const LLSD& content); - public: - protected: - LLSD mInfo; + LOG_CLASS(fetchScriptLimitsRegionDetailsResponder); +public: + fetchScriptLimitsRegionDetailsResponder(const LLSD& info) : mInfo(info) {}; + +private: + /* virtual */ void httpSuccess(); + /* virtual */ void httpFailure(); + LLSD mInfo; }; class fetchScriptLimitsAttachmentInfoResponder: public LLHTTPClient::Responder { - public: - fetchScriptLimitsAttachmentInfoResponder() {}; + LOG_CLASS(fetchScriptLimitsAttachmentInfoResponder); +public: + fetchScriptLimitsAttachmentInfoResponder() {}; - void result(const LLSD& content); - void errorWithContent(U32 status, const std::string& reason, const LLSD& content); - public: - protected: +private: + /* virtual */ void httpSuccess(); + /* virtual */ void httpFailure(); }; ///////////////////////////////////////////////////////////////////////////// @@ -190,7 +190,7 @@ protected: // LLRemoteParcelInfoObserver interface: /*virtual*/ void processParcelInfo(const LLParcelData& parcel_data); /*virtual*/ void setParcelID(const LLUUID& parcel_id); -/*virtual*/ void setErrorStatus(U32 status, const std::string& reason); +/*virtual*/ void setErrorStatus(S32 status, const std::string& reason); static void onClickRefresh(void* userdata); static void onClickHighlight(void* userdata); diff --git a/indra/newview/llfloatersearch.cpp b/indra/newview/llfloatersearch.cpp index 2a946b1edf..a446b767ac 100644 --- a/indra/newview/llfloatersearch.cpp +++ b/indra/newview/llfloatersearch.cpp @@ -30,6 +30,7 @@ #include "llcommandhandler.h" #include "llfloaterreg.h" #include "llfloatersearch.h" +#include "llhttpconstants.h" #include "llmediactrl.h" #include "llnotificationsutil.h" #include "lllogininstance.h" @@ -200,5 +201,5 @@ void LLFloaterSearch::search(const SearchQuery &p) url = LLWeb::expandURLSubstitutions(url, subs); // and load the URL in the web view - mWebBrowser->navigateTo(url, "text/html"); + mWebBrowser->navigateTo(url, HTTP_CONTENT_TEXT_HTML); } diff --git a/indra/newview/llfloatertos.cpp b/indra/newview/llfloatertos.cpp index a242b224cd..0613ffc94d 100644 --- a/indra/newview/llfloatertos.cpp +++ b/indra/newview/llfloatertos.cpp @@ -36,7 +36,7 @@ #include "llbutton.h" #include "llevents.h" #include "llhttpclient.h" -#include "llhttpstatuscodes.h" // for HTTP_FOUND +#include "llhttpconstants.h" #include "llnotificationsutil.h" #include "llradiogroup.h" #include "lltextbox.h" @@ -62,42 +62,46 @@ LLFloaterTOS::LLFloaterTOS(const LLSD& data) // on parent class indicating if the web server is working or not class LLIamHere : public LLHTTPClient::Responder { - private: - LLIamHere( LLFloaterTOS* parent ) : - mParent( parent ) - {} + LOG_CLASS(LLIamHere); +private: + LLIamHere( LLFloaterTOS* parent ) : + mParent( parent ) + {} - LLFloaterTOS* mParent; + LLFloaterTOS* mParent; - public: - - static LLIamHere* build( LLFloaterTOS* parent ) - { - return new LLIamHere( parent ); - }; - - virtual void setParent( LLFloaterTOS* parentIn ) - { - mParent = parentIn; - }; - - virtual void result( const LLSD& content ) +public: + static LLIamHere* build( LLFloaterTOS* parent ) + { + return new LLIamHere( parent ); + } + + virtual void setParent( LLFloaterTOS* parentIn ) + { + mParent = parentIn; + } + +protected: + virtual void httpSuccess() + { + if ( mParent ) { - if ( mParent ) - mParent->setSiteIsAlive( true ); - }; + mParent->setSiteIsAlive( true ); + } + } - virtual void error( U32 status, const std::string& reason ) + virtual void httpFailure() + { + LL_DEBUGS("LLIamHere") << dumpResponse() << LL_ENDL; + if ( mParent ) { - if ( mParent ) - { - // *HACK: For purposes of this alive check, 302 Found - // (aka Moved Temporarily) is considered alive. The web site - // redirects this link to a "cache busting" temporary URL. JC - bool alive = (status == HTTP_FOUND); - mParent->setSiteIsAlive( alive ); - } - }; + // *HACK: For purposes of this alive check, 302 Found + // (aka Moved Temporarily) is considered alive. The web site + // redirects this link to a "cache busting" temporary URL. JC + bool alive = (getStatus() == HTTP_FOUND); + mParent->setSiteIsAlive( alive ); + } + } }; // this is global and not a class member to keep crud out of the header file diff --git a/indra/newview/llfloaterurlentry.cpp b/indra/newview/llfloaterurlentry.cpp index e85d849c9a..0751c830d5 100644 --- a/indra/newview/llfloaterurlentry.cpp +++ b/indra/newview/llfloaterurlentry.cpp @@ -48,31 +48,31 @@ static LLFloaterURLEntry* sInstance = NULL; // on the Panel Land Media and to discover the MIME type class LLMediaTypeResponder : public LLHTTPClient::Responder { + LOG_CLASS(LLMediaTypeResponder); public: LLMediaTypeResponder( const LLHandle<LLFloater> parent ) : - mParent( parent ) - {} - - LLHandle<LLFloater> mParent; - - - virtual void completedHeader(U32 status, const std::string& reason, const LLSD& content) - { - std::string media_type = content["content-type"].asString(); - std::string::size_type idx1 = media_type.find_first_of(";"); - std::string mime_type = media_type.substr(0, idx1); - completeAny(status, mime_type); - } - - void completeAny(U32 status, const std::string& mime_type) - { - // Set empty type to none/none. Empty string is reserved for legacy parcels - // which have no mime type set. - std::string resolved_mime_type = ! mime_type.empty() ? mime_type : LLMIMETypes::getDefaultMimeType(); - LLFloaterURLEntry* floater_url_entry = (LLFloaterURLEntry*)mParent.get(); - if ( floater_url_entry ) - floater_url_entry->headerFetchComplete( status, resolved_mime_type ); - } + mParent( parent ) + {} + + LLHandle<LLFloater> mParent; + +private: + /* virtual */ void httpCompleted() + { + const bool check_lower = true; + const std::string& media_type = getResponseHeader(HTTP_HEADER_CONTENT_TYPE, check_lower); + std::string::size_type idx1 = media_type.find_first_of(";"); + std::string mime_type = media_type.substr(0, idx1); + + // Set empty type to none/none. Empty string is reserved for legacy parcels + // which have no mime type set. + std::string resolved_mime_type = ! mime_type.empty() ? mime_type : LLMIMETypes::getDefaultMimeType(); + LLFloaterURLEntry* floater_url_entry = (LLFloaterURLEntry*)mParent.get(); + if ( floater_url_entry ) + { + floater_url_entry->headerFetchComplete( getStatus(), resolved_mime_type ); + } + } }; //----------------------------------------------------------------------------- @@ -136,7 +136,7 @@ void LLFloaterURLEntry::buildURLHistory() } } -void LLFloaterURLEntry::headerFetchComplete(U32 status, const std::string& mime_type) +void LLFloaterURLEntry::headerFetchComplete(S32 status, const std::string& mime_type) { LLPanelLandMedia* panel_media = dynamic_cast<LLPanelLandMedia*>(mPanelLandMediaHandle.get()); if (panel_media) diff --git a/indra/newview/llfloaterurlentry.h b/indra/newview/llfloaterurlentry.h index dfb49fe5ac..bdd1ebe592 100644 --- a/indra/newview/llfloaterurlentry.h +++ b/indra/newview/llfloaterurlentry.h @@ -40,7 +40,7 @@ public: // that panel via the handle. static LLHandle<LLFloater> show(LLHandle<LLPanel> panel_land_media_handle, const std::string media_url); /*virtual*/ BOOL postBuild(); - void headerFetchComplete(U32 status, const std::string& mime_type); + void headerFetchComplete(S32 status, const std::string& mime_type); bool addURLToCombobox(const std::string& media_url); diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp index 3fe2518de6..21b171446f 100644 --- a/indra/newview/llfloaterwebcontent.cpp +++ b/indra/newview/llfloaterwebcontent.cpp @@ -29,6 +29,7 @@ #include "llcombobox.h" #include "lliconctrl.h" #include "llfloaterreg.h" +#include "llhttpconstants.h" #include "lllayoutstack.h" #include "llpluginclassmedia.h" #include "llprogressbar.h" @@ -234,9 +235,9 @@ void LLFloaterWebContent::open_media(const Params& p) { // Specifying a mime type of text/html here causes the plugin system to skip the MIME type probe and just open a browser plugin. LLViewerMedia::proxyWindowOpened(p.target(), p.id()); - mWebBrowser->setHomePageUrl(p.url, "text/html"); + mWebBrowser->setHomePageUrl(p.url, HTTP_CONTENT_TEXT_HTML); mWebBrowser->setTarget(p.target); - mWebBrowser->navigateTo(p.url, "text/html"); + mWebBrowser->navigateTo(p.url, HTTP_CONTENT_TEXT_HTML); set_current_url(p.url); @@ -451,7 +452,7 @@ void LLFloaterWebContent::onEnterAddress() std::string url = mAddressCombo->getValue().asString(); if ( url.length() > 0 ) { - mWebBrowser->navigateTo( url, "text/html"); + mWebBrowser->navigateTo(url, HTTP_CONTENT_TEXT_HTML); }; } diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp index cbd844cdac..472e3862ea 100644 --- a/indra/newview/llgroupmgr.cpp +++ b/indra/newview/llgroupmgr.cpp @@ -1843,23 +1843,31 @@ void LLGroupMgr::sendGroupMemberEjects(const LLUUID& group_id, // Responder class for capability group management class GroupMemberDataResponder : public LLHTTPClient::Responder { + LOG_CLASS(GroupMemberDataResponder); public: - GroupMemberDataResponder() {} - virtual ~GroupMemberDataResponder() {} - virtual void result(const LLSD& pContent); - virtual void errorWithContent(U32 pStatus, const std::string& pReason, const LLSD& pContent); + GroupMemberDataResponder() {} + virtual ~GroupMemberDataResponder() {} + private: - LLSD mMemberData; + /* virtual */ void httpSuccess(); + /* virtual */ void httpFailure(); + LLSD mMemberData; }; -void GroupMemberDataResponder::errorWithContent(U32 pStatus, const std::string& pReason, const LLSD& pContent) +void GroupMemberDataResponder::httpFailure() { - LL_WARNS("GrpMgr") << "Error receiving group member data [status:" - << pStatus << "]: " << pContent << LL_ENDL; + LL_WARNS("GrpMgr") << "Error receiving group member data " + << dumpResponse() << LL_ENDL; } -void GroupMemberDataResponder::result(const LLSD& content) +void GroupMemberDataResponder::httpSuccess() { + const LLSD& content = getContent(); + if (!content.isMap()) + { + failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content); + return; + } LLGroupMgr::processCapGroupMembersRequest(content); } diff --git a/indra/newview/llhomelocationresponder.cpp b/indra/newview/llhomelocationresponder.cpp index 37428c4a44..b1286cccf2 100644 --- a/indra/newview/llhomelocationresponder.cpp +++ b/indra/newview/llhomelocationresponder.cpp @@ -33,71 +33,76 @@ #include "llagent.h" #include "llviewerregion.h" -void LLHomeLocationResponder::result( const LLSD& content ) +void LLHomeLocationResponder::httpSuccess() { + const LLSD& content = getContent(); LLVector3 agent_pos; bool error = true; - + do { - + // was the call to /agent/<agent-id>/home-location successful? // If not, we keep error set to true if( ! content.has("success") ) { break; } - + if( 0 != strncmp("true", content["success"].asString().c_str(), 4 ) ) { break; } - + // did the simulator return a "justified" home location? // If no, we keep error set to true if( ! content.has( "HomeLocation" ) ) { break; } - + if( ! content["HomeLocation"].has("LocationPos") ) { break; } - + if( ! content["HomeLocation"]["LocationPos"].has("X") ) { break; } agent_pos.mV[VX] = content["HomeLocation"]["LocationPos"]["X"].asInteger(); - + if( ! content["HomeLocation"]["LocationPos"].has("Y") ) { break; } agent_pos.mV[VY] = content["HomeLocation"]["LocationPos"]["Y"].asInteger(); - + if( ! content["HomeLocation"]["LocationPos"].has("Z") ) { break; } agent_pos.mV[VZ] = content["HomeLocation"]["LocationPos"]["Z"].asInteger(); - + error = false; } while( 0 ); - - if( ! error ) + + if( error ) + { + failureResult(HTTP_INTERNAL_ERROR, "Invalid server response content", content); + } + else { llinfos << "setting home position" << llendl; - + LLViewerRegion *viewer_region = gAgent.getRegion(); gAgent.setHomePosRegion( viewer_region->getHandle(), agent_pos ); } } -void LLHomeLocationResponder::errorWithContent( U32 status, const std::string& reason, const LLSD& content ) +void LLHomeLocationResponder::httpFailure() { - llwarns << "LLHomeLocationResponder error [status:" << status << "]: " << content << llendl; + llwarns << dumpResponse() << llendl; } diff --git a/indra/newview/llhomelocationresponder.h b/indra/newview/llhomelocationresponder.h index 9bf4b12c4e..adc6c8cb58 100644 --- a/indra/newview/llhomelocationresponder.h +++ b/indra/newview/llhomelocationresponder.h @@ -35,8 +35,10 @@ /* Typedef, Enum, Class, Struct, etc. */ class LLHomeLocationResponder : public LLHTTPClient::Responder { - virtual void result( const LLSD& content ); - virtual void errorWithContent( U32 status, const std::string& reason, const LLSD& content ); + LOG_CLASS(LLHomeLocationResponder); +private: + /* virtual */ void httpSuccess(); + /* virtual */ void httpFailure(); }; #endif diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index fff178f8fe..c933d5428d 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -979,16 +979,17 @@ BOOL LLIMFloater::isInviteAllowed() const class LLSessionInviteResponder : public LLHTTPClient::Responder { + LOG_CLASS(LLSessionInviteResponder); public: LLSessionInviteResponder(const LLUUID& session_id) { mSessionID = session_id; } - void errorWithContent(U32 statusNum, const std::string& reason, const LLSD& content) +protected: + void httpFailure() { - llwarns << "Error inviting all agents to session [status:" - << statusNum << "]: " << content << llendl; + llwarns << "Error inviting all agents to session " << dumpResponse() << llendl; //throw something back to the viewer here? } diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp index 1dab0e67bf..95ede326e6 100644 --- a/indra/newview/llimpanel.cpp +++ b/indra/newview/llimpanel.cpp @@ -388,16 +388,17 @@ void LLFloaterIMPanel::draw() class LLSessionInviteResponder : public LLHTTPClient::Responder { + LOG_CLASS(LLSessionInviteResponder); public: LLSessionInviteResponder(const LLUUID& session_id) { mSessionID = session_id; } - void errorWithContent(U32 statusNum, const std::string& reason, const LLSD& content) +protected: + void httpFailure() { - llwarns << "Error inviting all agents to session [status:" - << statusNum << "]: " << content << llendl; + llwarns << "Error inviting all agents to session " << dumpResponse() << llendl; //throw something back to the viewer here? } diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 20b33c5d08..a00de8eb26 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -1214,6 +1214,7 @@ void start_deprecated_conference_chat( class LLStartConferenceChatResponder : public LLHTTPClient::Responder { + LOG_CLASS(LLStartConferenceChatResponder); public: LLStartConferenceChatResponder( const LLUUID& temp_session_id, @@ -1227,10 +1228,12 @@ public: mAgents = agents_to_invite; } - virtual void errorWithContent(U32 statusNum, const std::string& reason, const LLSD& content) +protected: + virtual void httpFailure() { //try an "old school" way. - if ( statusNum == 400 ) + // *TODO: What about other error status codes? 4xx 5xx? + if ( getStatus() == HTTP_BAD_REQUEST ) { start_deprecated_conference_chat( mTempSessionID, @@ -1239,8 +1242,7 @@ public: mAgents); } - llwarns << "LLStartConferenceChatResponder error [status:" - << statusNum << "]: " << content << llendl; + llwarns << dumpResponse() << llendl; //else throw an error back to the client? //in theory we should have just have these error strings @@ -1332,6 +1334,7 @@ bool LLIMModel::sendStartSession( class LLViewerChatterBoxInvitationAcceptResponder : public LLHTTPClient::Responder { + LOG_CLASS(LLViewerChatterBoxInvitationAcceptResponder); public: LLViewerChatterBoxInvitationAcceptResponder( const LLUUID& session_id, @@ -1341,8 +1344,15 @@ public: mInvitiationType = invitation_type; } - void result(const LLSD& content) +private: + void httpSuccess() { + const LLSD& content = getContent(); + if (!content.isMap()) + { + failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content); + return; + } if ( gIMMgr) { LLIMSpeakerMgr* speaker_mgr = LLIMModel::getInstance()->getSpeakerManager(mSessionID); @@ -1387,19 +1397,17 @@ public: } } - void errorWithContent(U32 statusNum, const std::string& reason, const LLSD& content) + void httpFailure() { - llwarns << "LLViewerChatterBoxInvitationAcceptResponder error [status:" - << statusNum << "]: " << content << llendl; + llwarns << dumpResponse() << llendl; //throw something back to the viewer here? if ( gIMMgr ) { gIMMgr->clearPendingAgentListUpdates(mSessionID); gIMMgr->clearPendingInvitation(mSessionID); - if ( 404 == statusNum ) + if ( HTTP_NOT_FOUND == getStatus() ) { - std::string error_string; - error_string = "session_does_not_exist_error"; + static const std::string error_string("session_does_not_exist_error"); gIMMgr->showSessionStartError(error_string, mSessionID); } } diff --git a/indra/newview/llinspectavatar.cpp b/indra/newview/llinspectavatar.cpp index aafc43b02d..1f719a22ef 100644 --- a/indra/newview/llinspectavatar.cpp +++ b/indra/newview/llinspectavatar.cpp @@ -495,21 +495,23 @@ void LLInspectAvatar::toggleSelectedVoice(bool enabled) class MuteVoiceResponder : public LLHTTPClient::Responder { + LOG_CLASS(MuteVoiceResponder); public: MuteVoiceResponder(const LLUUID& session_id) { mSessionID = session_id; } - virtual void errorWithContent(U32 status, const std::string& reason, const LLSD& content) + protected: + virtual void httpFailure() { - llwarns << "MuteVoiceResponder error [status:" << status << "]: " << content << llendl; + llwarns << dumpResponse() << llendl; if ( gIMMgr ) { //403 == you're not a mod //should be disabled if you're not a moderator - if ( 403 == status ) + if ( HTTP_FORBIDDEN == getStatus() ) { gIMMgr->showSessionEventError( "mute", diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 99e72cdb22..0b2f80403d 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -414,6 +414,7 @@ const LLUUID LLInventoryModel::findCategoryUUIDForType(LLFolderType::EType prefe class LLCreateInventoryCategoryResponder : public LLHTTPClient::Responder { + LOG_CLASS(LLCreateInventoryCategoryResponder); public: LLCreateInventoryCategoryResponder(LLInventoryModel* model, void (*callback)(const LLSD&, void*), @@ -424,16 +425,21 @@ public: { } - virtual void errorWithContent(U32 status, const std::string& reason, const LLSD& content) +protected: + virtual void httpFailure() { - LL_WARNS("InvAPI") << "CreateInventoryCategory failed [status:" - << status << "]: " << content << LL_ENDL; + LL_WARNS("InvAPI") << dumpResponse() << LL_ENDL; } - virtual void result(const LLSD& content) + virtual void httpSuccess() { //Server has created folder. - + const LLSD& content = getContent(); + if (!content.isMap() || !content.has("folder_id")) + { + failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content); + return; + } LLUUID category_id = content["folder_id"].asUUID(); @@ -1340,8 +1346,14 @@ void LLInventoryModel::addChangedMask(U32 mask, const LLUUID& referent) } // If we get back a normal response, handle it here -void LLInventoryModel::fetchInventoryResponder::result(const LLSD& content) -{ +void LLInventoryModel::fetchInventoryResponder::httpSuccess() +{ + const LLSD& content = getContent(); + if (!content.isMap()) + { + failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content); + return; + } start_new_inventory_observer(); /*LLUUID agent_id; @@ -1400,9 +1412,9 @@ void LLInventoryModel::fetchInventoryResponder::result(const LLSD& content) } //If we get back an error (not found, etc...), handle it here -void LLInventoryModel::fetchInventoryResponder::errorWithContent(U32 status, const std::string& reason, const LLSD& content) +void LLInventoryModel::fetchInventoryResponder::httpFailure() { - llwarns << "fetchInventory error [status:" << status << "]: " << content << llendl; + llwarns << dumpResponse() << llendl; gInventory.notifyObservers(); } diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index dfdd237c95..9c2ca8cae9 100644 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -81,11 +81,12 @@ public: class fetchInventoryResponder : public LLHTTPClient::Responder { + LOG_CLASS(fetchInventoryResponder); public: fetchInventoryResponder(const LLSD& request_sd) : mRequestSD(request_sd) {}; - void result(const LLSD& content); - void errorWithContent(U32 status, const std::string& reason, const LLSD& content); protected: + virtual void httpSuccess(); + virtual void httpFailure(); LLSD mRequestSD; }; diff --git a/indra/newview/llinventorymodelbackgroundfetch.cpp b/indra/newview/llinventorymodelbackgroundfetch.cpp index f2b39e7186..e1537033f9 100644 --- a/indra/newview/llinventorymodelbackgroundfetch.cpp +++ b/indra/newview/llinventorymodelbackgroundfetch.cpp @@ -363,35 +363,39 @@ void LLInventoryModelBackgroundFetch::incrFetchCount(S16 fetching) class LLInventoryModelFetchItemResponder : public LLInventoryModel::fetchInventoryResponder { + LOG_CLASS(LLInventoryModelFetchItemResponder); public: LLInventoryModelFetchItemResponder(const LLSD& request_sd) : LLInventoryModel::fetchInventoryResponder(request_sd) {}; - void result(const LLSD& content); - void errorWithContent(U32 status, const std::string& reason, const LLSD& content); +private: + /* virtual */ void httpSuccess(); + /* virtual */ void httpFailure(); }; -void LLInventoryModelFetchItemResponder::result( const LLSD& content ) +void LLInventoryModelFetchItemResponder::httpSuccess() { - LLInventoryModel::fetchInventoryResponder::result(content); + LLInventoryModel::fetchInventoryResponder::httpSuccess(); LLInventoryModelBackgroundFetch::instance().incrFetchCount(-1); } -void LLInventoryModelFetchItemResponder::errorWithContent( U32 status, const std::string& reason, const LLSD& content ) +void LLInventoryModelFetchItemResponder::httpFailure() { - LLInventoryModel::fetchInventoryResponder::errorWithContent(status, reason, content); + LLInventoryModel::fetchInventoryResponder::httpFailure(); LLInventoryModelBackgroundFetch::instance().incrFetchCount(-1); } class LLInventoryModelFetchDescendentsResponder: public LLHTTPClient::Responder { + LOG_CLASS(LLInventoryModelFetchDescendentsResponder); public: LLInventoryModelFetchDescendentsResponder(const LLSD& request_sd, uuid_vec_t recursive_cats) : mRequestSD(request_sd), mRecursiveCatUUIDs(recursive_cats) {}; //LLInventoryModelFetchDescendentsResponder() {}; - void result(const LLSD& content); - void errorWithContent(U32 status, const std::string& reason, const LLSD& content); +private: + /* virtual */ void httpSuccess(); + /* virtual */ void httpFailure(); protected: BOOL getIsRecursive(const LLUUID& cat_id) const; private: @@ -400,8 +404,14 @@ private: }; // If we get back a normal response, handle it here. -void LLInventoryModelFetchDescendentsResponder::result(const LLSD& content) +void LLInventoryModelFetchDescendentsResponder::httpSuccess() { + const LLSD& content = getContent(); + if (!content.isMap()) + { + failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content); + return; + } LLInventoryModelBackgroundFetch *fetcher = LLInventoryModelBackgroundFetch::getInstance(); if (content.has("folders")) { @@ -508,11 +518,12 @@ void LLInventoryModelFetchDescendentsResponder::result(const LLSD& content) for(LLSD::array_const_iterator folder_it = content["bad_folders"].beginArray(); folder_it != content["bad_folders"].endArray(); ++folder_it) - { + { + // *TODO: Stop copying data LLSD folder_sd = *folder_it; // These folders failed on the dataserver. We probably don't want to retry them. - llinfos << "Folder " << folder_sd["folder_id"].asString() + llwarns << "Folder " << folder_sd["folder_id"].asString() << "Error: " << folder_sd["error"].asString() << llendl; } } @@ -529,21 +540,19 @@ void LLInventoryModelFetchDescendentsResponder::result(const LLSD& content) } // If we get back an error (not found, etc...), handle it here. -void LLInventoryModelFetchDescendentsResponder::errorWithContent(U32 status, const std::string& reason, const LLSD& content) +void LLInventoryModelFetchDescendentsResponder::httpFailure() { + llwarns << dumpResponse() << llendl; LLInventoryModelBackgroundFetch *fetcher = LLInventoryModelBackgroundFetch::getInstance(); - llinfos << "LLInventoryModelFetchDescendentsResponder::error [status:" - << status << "]: " << content << llendl; - fetcher->incrFetchCount(-1); - if (status==499) // timed out + if (getStatus()==HTTP_INTERNAL_ERROR) // timed out or curl failure { for(LLSD::array_const_iterator folder_it = mRequestSD["folders"].beginArray(); folder_it != mRequestSD["folders"].endArray(); ++folder_it) - { + { LLSD folder_sd = *folder_it; LLUUID folder_id = folder_sd["folder_id"]; const BOOL recursive = getIsRecursive(folder_id); diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp index 0b009b68f7..bea1d62b93 100644 --- a/indra/newview/llmarketplacefunctions.cpp +++ b/indra/newview/llmarketplacefunctions.cpp @@ -99,7 +99,7 @@ namespace LLMarketplaceImport bool hasSessionCookie(); bool inProgress(); bool resultPending(); - U32 getResultStatus(); + S32 getResultStatus(); const LLSD& getResults(); bool establishMarketplaceSessionCookie(); @@ -113,7 +113,7 @@ namespace LLMarketplaceImport static bool sImportInProgress = false; static bool sImportPostPending = false; static bool sImportGetPending = false; - static U32 sImportResultStatus = 0; + static S32 sImportResultStatus = 0; static LLSD sImportResults = LLSD::emptyMap(); static LLTimer slmGetTimer; @@ -123,22 +123,22 @@ namespace LLMarketplaceImport class LLImportPostResponder : public LLHTTPClient::Responder { + LOG_CLASS(LLImportPostResponder); public: LLImportPostResponder() : LLCurl::Responder() {} - - void completed(U32 status, const std::string& reason, const LLSD& content) + + protected: + /* virtual */ void httpCompleted() { slmPostTimer.stop(); if (gSavedSettings.getBOOL("InventoryOutboxLogging")) { - llinfos << " SLM POST status: " << status << llendl; - llinfos << " SLM POST reason: " << reason << llendl; - llinfos << " SLM POST content: " << content.asString() << llendl; - - llinfos << " SLM POST timer: " << slmPostTimer.getElapsedTimeF32() << llendl; + llinfos << " SLM [timer:" << slmPostTimer.getElapsedTimeF32() << "] " + << dumpResponse() << llendl; } + S32 status = getStatus(); if ((status == MarketplaceErrorCodes::IMPORT_REDIRECT) || (status == MarketplaceErrorCodes::IMPORT_AUTHENTICATION_ERROR) || (status == MarketplaceErrorCodes::IMPORT_JOB_TIMEOUT)) @@ -154,38 +154,36 @@ namespace LLMarketplaceImport sImportInProgress = (status == MarketplaceErrorCodes::IMPORT_DONE); sImportPostPending = false; sImportResultStatus = status; - sImportId = content; + sImportId = getContent(); } }; class LLImportGetResponder : public LLHTTPClient::Responder { + LOG_CLASS(LLImportGetResponder); public: LLImportGetResponder() : LLCurl::Responder() {} - void completedHeader(U32 status, const std::string& reason, const LLSD& content) + protected: + /* virtual */ void httpCompleted() { - const std::string& set_cookie_string = content["set-cookie"].asString(); + const bool check_lower = true; + const std::string& set_cookie_string = getResponseHeader(HTTP_HEADER_SET_COOKIE, check_lower); if (!set_cookie_string.empty()) { sMarketplaceCookie = set_cookie_string; } - } - - void completed(U32 status, const std::string& reason, const LLSD& content) - { + slmGetTimer.stop(); if (gSavedSettings.getBOOL("InventoryOutboxLogging")) { - llinfos << " SLM GET status: " << status << llendl; - llinfos << " SLM GET reason: " << reason << llendl; - llinfos << " SLM GET content: " << content.asString() << llendl; - - llinfos << " SLM GET timer: " << slmGetTimer.getElapsedTimeF32() << llendl; + llinfos << " SLM [timer:" << slmGetTimer.getElapsedTimeF32() << "] " + << dumpResponse() << llendl; } + S32 status = getStatus(); if ((status == MarketplaceErrorCodes::IMPORT_AUTHENTICATION_ERROR) || (status == MarketplaceErrorCodes::IMPORT_JOB_TIMEOUT)) { @@ -200,7 +198,7 @@ namespace LLMarketplaceImport sImportInProgress = (status == MarketplaceErrorCodes::IMPORT_PROCESSING); sImportGetPending = false; sImportResultStatus = status; - sImportResults = content; + sImportResults = getContent(); } }; @@ -221,7 +219,7 @@ namespace LLMarketplaceImport return (sImportPostPending || sImportGetPending); } - U32 getResultStatus() + S32 getResultStatus() { return sImportResultStatus; } @@ -280,10 +278,10 @@ namespace LLMarketplaceImport // Make the headers for the post LLSD headers = LLSD::emptyMap(); - headers["Accept"] = "*/*"; - headers["Cookie"] = sMarketplaceCookie; - headers["Content-Type"] = "application/llsd+xml"; - headers["User-Agent"] = LLViewerMedia::getCurrentUserAgent(); + headers[HTTP_HEADER_ACCEPT] = "*/*"; + headers[HTTP_HEADER_COOKIE] = sMarketplaceCookie; + headers[HTTP_HEADER_CONTENT_TYPE] = HTTP_CONTENT_LLSD_XML; + headers[HTTP_HEADER_USER_AGENT] = LLViewerMedia::getCurrentUserAgent(); if (gSavedSettings.getBOOL("InventoryOutboxLogging")) { @@ -313,11 +311,12 @@ namespace LLMarketplaceImport // Make the headers for the post LLSD headers = LLSD::emptyMap(); - headers["Accept"] = "*/*"; - headers["Connection"] = "Keep-Alive"; - headers["Cookie"] = sMarketplaceCookie; - headers["Content-Type"] = "application/xml"; - headers["User-Agent"] = LLViewerMedia::getCurrentUserAgent(); + headers[HTTP_HEADER_ACCEPT] = "*/*"; + headers[HTTP_HEADER_CONNECTION] = "Keep-Alive"; + headers[HTTP_HEADER_COOKIE] = sMarketplaceCookie; + // *TODO: Should this be 'application/llsd+xml'? + headers[HTTP_HEADER_CONTENT_TYPE] = HTTP_CONTENT_XML; + headers[HTTP_HEADER_USER_AGENT] = LLViewerMedia::getCurrentUserAgent(); if (gSavedSettings.getBOOL("InventoryOutboxLogging")) { diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index 2075aeed63..cb5640b4da 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -52,6 +52,7 @@ #include "llsdutil.h" #include "lllayoutstack.h" #include "lliconctrl.h" +#include "llhttpconstants.h" #include "lltextbox.h" #include "llbutton.h" #include "llcheckboxctrl.h" @@ -576,7 +577,7 @@ void LLMediaCtrl::navigateToLocalPage( const std::string& subdir, const std::str { mCurrentNavUrl = expanded_filename; mMediaSource->setSize(mTextureWidth, mTextureHeight); - mMediaSource->navigateTo(expanded_filename, "text/html", false); + mMediaSource->navigateTo(expanded_filename, HTTP_CONTENT_TEXT_HTML, false); } } @@ -948,7 +949,7 @@ void LLMediaCtrl::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_NAVIGATE_ERROR_PAGE" << LL_ENDL; if ( mErrorPageURL.length() > 0 ) { - navigateTo(mErrorPageURL, "text/html"); + navigateTo(mErrorPageURL, HTTP_CONTENT_TEXT_HTML); }; }; break; diff --git a/indra/newview/llmediadataclient.cpp b/indra/newview/llmediadataclient.cpp index e3b46d5d2f..bc1aa087e5 100644 --- a/indra/newview/llmediadataclient.cpp +++ b/indra/newview/llmediadataclient.cpp @@ -35,7 +35,7 @@ #include <boost/lexical_cast.hpp> -#include "llhttpstatuscodes.h" +#include "llhttpconstants.h" #include "llsdutil.h" #include "llmediaentry.h" #include "lltextureentry.h" @@ -564,7 +564,7 @@ LLMediaDataClient::Responder::Responder(const request_ptr_t &request) } /*virtual*/ -void LLMediaDataClient::Responder::errorWithContent(U32 status, const std::string& reason, const LLSD& content) +void LLMediaDataClient::Responder::httpFailure() { mRequest->stopTracking(); @@ -574,9 +574,17 @@ void LLMediaDataClient::Responder::errorWithContent(U32 status, const std::strin return; } - if (status == HTTP_SERVICE_UNAVAILABLE) + if (getStatus() == HTTP_SERVICE_UNAVAILABLE) { - F32 retry_timeout = mRequest->getRetryTimerDelay(); + F32 retry_timeout; +#if 0 + // *TODO: Honor server Retry-After header. + if (!hasResponseHeader(HTTP_HEADER_RETRY_AFTER) + || !getSecondsUntilRetryAfter(getResponseHeader(HTTP_HEADER_RETRY_AFTER), retry_timeout)) +#endif + { + retry_timeout = mRequest->getRetryTimerDelay(); + } mRequest->incRetryCount(); @@ -594,15 +602,16 @@ void LLMediaDataClient::Responder::errorWithContent(U32 status, const std::strin << mRequest->getRetryCount() << " exceeds " << mRequest->getMaxNumRetries() << ", not retrying" << LL_ENDL; } } + // *TODO: Redirect on 3xx status codes. else { - LL_WARNS("LLMediaDataClient") << *mRequest << " http error [status:" - << status << "]:" << content << ")" << LL_ENDL; + LL_WARNS("LLMediaDataClient") << *mRequest << " http failure " + << dumpResponse() << LL_ENDL; } } /*virtual*/ -void LLMediaDataClient::Responder::result(const LLSD& content) +void LLMediaDataClient::Responder::httpSuccess() { mRequest->stopTracking(); @@ -612,7 +621,7 @@ void LLMediaDataClient::Responder::result(const LLSD& content) return; } - LL_DEBUGS("LLMediaDataClientResponse") << *mRequest << " result : " << ll_print_sd(content) << LL_ENDL; + LL_DEBUGS("LLMediaDataClientResponse") << *mRequest << " " << dumpResponse() << LL_ENDL; } ////////////////////////////////////////////////////////////////////////////////////// @@ -876,7 +885,7 @@ LLMediaDataClient::Responder *LLObjectMediaDataClient::RequestUpdate::createResp /*virtual*/ -void LLObjectMediaDataClient::Responder::result(const LLSD& content) +void LLObjectMediaDataClient::Responder::httpSuccess() { getRequest()->stopTracking(); @@ -886,10 +895,16 @@ void LLObjectMediaDataClient::Responder::result(const LLSD& content) return; } + const LLSD& content = getContent(); + if (!content.isMap()) + { + failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content); + return; + } + // This responder is only used for GET requests, not UPDATE. + LL_DEBUGS("LLMediaDataClientResponse") << *(getRequest()) << " " << dumpResponse() << LL_ENDL; - LL_DEBUGS("LLMediaDataClientResponse") << *(getRequest()) << " GET returned: " << ll_print_sd(content) << LL_ENDL; - // Look for an error if (content.has("error")) { @@ -1003,7 +1018,7 @@ LLMediaDataClient::Responder *LLObjectMediaNavigateClient::RequestNavigate::crea } /*virtual*/ -void LLObjectMediaNavigateClient::Responder::errorWithContent(U32 status, const std::string& reason, const LLSD& content) +void LLObjectMediaNavigateClient::Responder::httpFailure() { getRequest()->stopTracking(); @@ -1015,14 +1030,14 @@ void LLObjectMediaNavigateClient::Responder::errorWithContent(U32 status, const // Bounce back (unless HTTP_SERVICE_UNAVAILABLE, in which case call base // class - if (status == HTTP_SERVICE_UNAVAILABLE) + if (getStatus() == HTTP_SERVICE_UNAVAILABLE) { - LLMediaDataClient::Responder::errorWithContent(status, reason, content); + LLMediaDataClient::Responder::httpFailure(); } else { // bounce the face back - LL_WARNS("LLMediaDataClient") << *(getRequest()) << " Error navigating: http code=" << status << LL_ENDL; + LL_WARNS("LLMediaDataClient") << *(getRequest()) << " Error navigating: " << dumpResponse() << LL_ENDL; const LLSD &payload = getRequest()->getPayload(); // bounce the face back getRequest()->getObject()->mediaNavigateBounceBack((LLSD::Integer)payload[LLTextureEntry::TEXTURE_INDEX_KEY]); @@ -1030,7 +1045,7 @@ void LLObjectMediaNavigateClient::Responder::errorWithContent(U32 status, const } /*virtual*/ -void LLObjectMediaNavigateClient::Responder::result(const LLSD& content) +void LLObjectMediaNavigateClient::Responder::httpSuccess() { getRequest()->stopTracking(); @@ -1040,8 +1055,9 @@ void LLObjectMediaNavigateClient::Responder::result(const LLSD& content) return; } - LL_INFOS("LLMediaDataClient") << *(getRequest()) << " NAVIGATE returned " << ll_print_sd(content) << LL_ENDL; + LL_INFOS("LLMediaDataClient") << *(getRequest()) << " NAVIGATE returned " << dumpResponse() << LL_ENDL; + const LLSD& content = getContent(); if (content.has("error")) { const LLSD &error = content["error"]; @@ -1065,6 +1081,6 @@ void LLObjectMediaNavigateClient::Responder::result(const LLSD& content) else { // No action required. - LL_DEBUGS("LLMediaDataClientResponse") << *(getRequest()) << " result : " << ll_print_sd(content) << LL_ENDL; + LL_DEBUGS("LLMediaDataClientResponse") << *(getRequest()) << " " << dumpResponse() << LL_ENDL; } } diff --git a/indra/newview/llmediadataclient.h b/indra/newview/llmediadataclient.h index 89e20a28d0..231b883c32 100644 --- a/indra/newview/llmediadataclient.h +++ b/indra/newview/llmediadataclient.h @@ -74,8 +74,9 @@ public: // Abstracts the Cap URL, the request, and the responder class LLMediaDataClient : public LLRefCount { -public: +protected: LOG_CLASS(LLMediaDataClient); +public: const static F32 QUEUE_TIMER_DELAY;// = 1.0; // seconds(s) const static F32 UNAVAILABLE_RETRY_TIMER_DELAY;// = 5.0; // secs @@ -192,14 +193,16 @@ protected: // Responder class Responder : public LLHTTPClient::Responder { + LOG_CLASS(Responder); public: Responder(const request_ptr_t &request); + request_ptr_t &getRequest() { return mRequest; } + + protected: //If we get back an error (not found, etc...), handle it here - virtual void errorWithContent(U32 status, const std::string& reason, const LLSD& content); + virtual void httpFailure(); //If we get back a normal response, handle it here. Default just logs it. - virtual void result(const LLSD& content); - - request_ptr_t &getRequest() { return mRequest; } + virtual void httpSuccess(); private: request_ptr_t mRequest; @@ -287,8 +290,9 @@ private: // MediaDataClient specific for the ObjectMedia cap class LLObjectMediaDataClient : public LLMediaDataClient { -public: +protected: LOG_CLASS(LLObjectMediaDataClient); +public: LLObjectMediaDataClient(F32 queue_timer_delay = QUEUE_TIMER_DELAY, F32 retry_timer_delay = UNAVAILABLE_RETRY_TIMER_DELAY, U32 max_retries = MAX_RETRIES, @@ -341,10 +345,12 @@ protected: class Responder : public LLMediaDataClient::Responder { + LOG_CLASS(Responder); public: Responder(const request_ptr_t &request) : LLMediaDataClient::Responder(request) {} - virtual void result(const LLSD &content); + protected: + virtual void httpSuccess(); }; private: // The Get/Update data client needs a second queue to avoid object updates starving load-ins. @@ -362,8 +368,9 @@ private: // MediaDataClient specific for the ObjectMediaNavigate cap class LLObjectMediaNavigateClient : public LLMediaDataClient { -public: +protected: LOG_CLASS(LLObjectMediaNavigateClient); +public: // NOTE: from llmediaservice.h static const int ERROR_PERMISSION_DENIED_CODE = 8002; @@ -397,11 +404,13 @@ protected: class Responder : public LLMediaDataClient::Responder { + LOG_CLASS(Responder); public: Responder(const request_ptr_t &request) : LLMediaDataClient::Responder(request) {} - virtual void errorWithContent(U32 status, const std::string& reason, const LLSD& content); - virtual void result(const LLSD &content); + protected: + virtual void httpFailure(); + virtual void httpSuccess(); private: void mediaNavigateBounceBack(); }; diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 17311dd75e..1469dbc346 100755 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -28,7 +28,7 @@ #include "apr_pools.h" #include "apr_dso.h" -#include "llhttpstatuscodes.h" +#include "llhttpconstants.h" #include "llmeshrepository.h" #include "llagent.h" @@ -202,6 +202,7 @@ U32 LLMeshRepoThread::sMaxConcurrentRequests = 1; class LLMeshHeaderResponder : public LLCurl::Responder { + LOG_CLASS(LLMeshHeaderResponder); public: LLVolumeParams mMeshParams; bool mProcessed; @@ -230,14 +231,14 @@ public: } } - virtual void completedRaw(U32 status, const std::string& reason, - const LLChannelDescriptors& channels, + virtual void completedRaw(const LLChannelDescriptors& channels, const LLIOPipe::buffer_ptr_t& buffer); }; class LLMeshLODResponder : public LLCurl::Responder { + LOG_CLASS(LLMeshLODResponder); public: LLVolumeParams mMeshParams; S32 mLOD; @@ -266,14 +267,14 @@ public: } } - virtual void completedRaw(U32 status, const std::string& reason, - const LLChannelDescriptors& channels, + virtual void completedRaw(const LLChannelDescriptors& channels, const LLIOPipe::buffer_ptr_t& buffer); }; class LLMeshSkinInfoResponder : public LLCurl::Responder { + LOG_CLASS(LLMeshSkinInfoResponder); public: LLUUID mMeshID; U32 mRequestedBytes; @@ -291,14 +292,14 @@ public: llassert(mProcessed); } - virtual void completedRaw(U32 status, const std::string& reason, - const LLChannelDescriptors& channels, + virtual void completedRaw(const LLChannelDescriptors& channels, const LLIOPipe::buffer_ptr_t& buffer); }; class LLMeshDecompositionResponder : public LLCurl::Responder { + LOG_CLASS(LLMeshDecompositionResponder); public: LLUUID mMeshID; U32 mRequestedBytes; @@ -316,14 +317,14 @@ public: llassert(mProcessed); } - virtual void completedRaw(U32 status, const std::string& reason, - const LLChannelDescriptors& channels, + virtual void completedRaw(const LLChannelDescriptors& channels, const LLIOPipe::buffer_ptr_t& buffer); }; class LLMeshPhysicsShapeResponder : public LLCurl::Responder { + LOG_CLASS(LLMeshPhysicsShapeResponder); public: LLUUID mMeshID; U32 mRequestedBytes; @@ -341,8 +342,7 @@ public: llassert(mProcessed); } - virtual void completedRaw(U32 status, const std::string& reason, - const LLChannelDescriptors& channels, + virtual void completedRaw(const LLChannelDescriptors& channels, const LLIOPipe::buffer_ptr_t& buffer); }; @@ -398,6 +398,7 @@ void log_upload_error(S32 status, const LLSD& content, std::string stage, std::s class LLWholeModelFeeResponder: public LLCurl::Responder { + LOG_CLASS(LLWholeModelFeeResponder); LLMeshUploadThread* mThread; LLSD mModelData; LLHandle<LLWholeModelFeeObserver> mObserverHandle; @@ -421,21 +422,20 @@ public: } } - virtual void completed(U32 status, - const std::string& reason, - const LLSD& content) +protected: + virtual void httpCompleted() { - LLSD cc = content; + LLSD cc = getContent(); if (gSavedSettings.getS32("MeshUploadFakeErrors")&1) { cc = llsd_from_file("fake_upload_error.xml"); } - + dump_llsd_to_file(cc,make_dump_name("whole_model_fee_response_",dump_num)); LLWholeModelFeeObserver* observer = mObserverHandle.get(); - if (isGoodStatus(status) && + if (isGoodStatus() && cc["state"].asString() == "upload") { mThread->mWholeModelUploadURL = cc["uploader"].asString(); @@ -448,13 +448,14 @@ public: } else { - llwarns << "fee request failed" << llendl; + llwarns << "fee request failed " << dumpResponse() << llendl; + S32 status = getStatus(); log_upload_error(status,cc,"fee",mModelData["name"]); mThread->mWholeModelUploadURL = ""; if (observer) { - observer->setModelPhysicsFeeErrorStatus(status, reason); + observer->setModelPhysicsFeeErrorStatus(status, getReason()); } } } @@ -463,6 +464,7 @@ public: class LLWholeModelUploadResponder: public LLCurl::Responder { + LOG_CLASS(LLWholeModelUploadResponder); LLMeshUploadThread* mThread; LLSD mModelData; LLHandle<LLWholeModelUploadObserver> mObserverHandle; @@ -487,11 +489,10 @@ public: } } - virtual void completed(U32 status, - const std::string& reason, - const LLSD& content) +protected: + virtual void httpCompleted() { - LLSD cc = content; + LLSD cc = getContent(); if (gSavedSettings.getS32("MeshUploadFakeErrors")&2) { cc = llsd_from_file("fake_upload_error.xml"); @@ -503,7 +504,7 @@ public: // requested "mesh" asset type isn't actually the type // of the resultant object, fix it up here. - if (isGoodStatus(status) && + if (isGoodStatus() && cc["state"].asString() == "complete") { mModelData["asset_type"] = "object"; @@ -516,9 +517,9 @@ public: } else { - llwarns << "upload failed" << llendl; + llwarns << "upload failed " << dumpResponse() << llendl; std::string model_name = mModelData["name"].asString(); - log_upload_error(status,cc,"upload",model_name); + log_upload_error(getStatus(),cc,"upload",model_name); if (observer) { @@ -807,7 +808,7 @@ bool LLMeshRepoThread::fetchMeshSkinInfo(const LLUUID& mesh_id) //reading from VFS failed for whatever reason, fetch from sim std::vector<std::string> headers; - headers.push_back("Accept: application/octet-stream"); + headers.push_back(HTTP_HEADER_ACCEPT + ": " + HTTP_CONTENT_OCTET_STREAM); std::string http_url = constructUrl(mesh_id); if (!http_url.empty()) @@ -889,7 +890,7 @@ bool LLMeshRepoThread::fetchMeshDecomposition(const LLUUID& mesh_id) //reading from VFS failed for whatever reason, fetch from sim std::vector<std::string> headers; - headers.push_back("Accept: application/octet-stream"); + headers.push_back(HTTP_HEADER_ACCEPT + ": " + HTTP_CONTENT_OCTET_STREAM); std::string http_url = constructUrl(mesh_id); if (!http_url.empty()) @@ -970,7 +971,7 @@ bool LLMeshRepoThread::fetchMeshPhysicsShape(const LLUUID& mesh_id) //reading from VFS failed for whatever reason, fetch from sim std::vector<std::string> headers; - headers.push_back("Accept: application/octet-stream"); + headers.push_back(HTTP_HEADER_ACCEPT + ": " + HTTP_CONTENT_OCTET_STREAM); std::string http_url = constructUrl(mesh_id); if (!http_url.empty()) @@ -1051,7 +1052,7 @@ bool LLMeshRepoThread::fetchMeshHeader(const LLVolumeParams& mesh_params, U32& c //either cache entry doesn't exist or is corrupt, request header from simulator bool retval = true ; std::vector<std::string> headers; - headers.push_back("Accept: application/octet-stream"); + headers.push_back(HTTP_HEADER_ACCEPT + ": " + HTTP_CONTENT_OCTET_STREAM); std::string http_url = constructUrl(mesh_params.getSculptID()); if (!http_url.empty()) @@ -1126,7 +1127,7 @@ bool LLMeshRepoThread::fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod, //reading from VFS failed for whatever reason, fetch from sim std::vector<std::string> headers; - headers.push_back("Accept: application/octet-stream"); + headers.push_back(HTTP_HEADER_ACCEPT + ": " + HTTP_CONTENT_OCTET_STREAM); std::string http_url = constructUrl(mesh_id); if (!http_url.empty()) @@ -1898,10 +1899,10 @@ void LLMeshRepository::cacheOutgoingMesh(LLMeshUploadData& data, LLSD& header) } -void LLMeshLODResponder::completedRaw(U32 status, const std::string& reason, - const LLChannelDescriptors& channels, - const LLIOPipe::buffer_ptr_t& buffer) +void LLMeshLODResponder::completedRaw(const LLChannelDescriptors& channels, + const LLIOPipe::buffer_ptr_t& buffer) { + S32 status = getStatus(); mProcessed = true; // thread could have already be destroyed during logout @@ -1912,14 +1913,15 @@ void LLMeshLODResponder::completedRaw(U32 status, const std::string& reason, S32 data_size = buffer->countAfter(channels.in(), NULL); + // *TODO: What about 3xx redirect codes? What about status 400 (Bad Request)? if (status < 200 || status > 400) { - llwarns << status << ": " << reason << llendl; + llwarns << dumpResponse() << llendl; } if (data_size < mRequestedBytes) { - if (status == 499 || status == 503) + if (status == HTTP_INTERNAL_ERROR || status == HTTP_SERVICE_UNAVAILABLE) { //timeout or service unavailable, try again llwarns << "Timeout or service unavailable, retrying." << llendl; LLMeshRepository::sHTTPRetryCount++; @@ -1927,8 +1929,8 @@ void LLMeshLODResponder::completedRaw(U32 status, const std::string& reason, } else { - llassert(status == 499 || status == 503); //intentionally trigger a breakpoint - llwarns << "Unhandled status " << status << llendl; + llassert(status == HTTP_INTERNAL_ERROR || status == HTTP_SERVICE_UNAVAILABLE); //intentionally trigger a breakpoint + llwarns << "Unhandled status " << dumpResponse() << llendl; } return; } @@ -1962,10 +1964,10 @@ void LLMeshLODResponder::completedRaw(U32 status, const std::string& reason, delete [] data; } -void LLMeshSkinInfoResponder::completedRaw(U32 status, const std::string& reason, - const LLChannelDescriptors& channels, - const LLIOPipe::buffer_ptr_t& buffer) +void LLMeshSkinInfoResponder::completedRaw(const LLChannelDescriptors& channels, + const LLIOPipe::buffer_ptr_t& buffer) { + S32 status = getStatus(); mProcessed = true; // thread could have already be destroyed during logout @@ -1976,14 +1978,15 @@ void LLMeshSkinInfoResponder::completedRaw(U32 status, const std::string& reason S32 data_size = buffer->countAfter(channels.in(), NULL); + // *TODO: What about 3xx redirect codes? What about status 400 (Bad Request)? if (status < 200 || status > 400) { - llwarns << status << ": " << reason << llendl; + llwarns << dumpResponse() << llendl; } if (data_size < mRequestedBytes) { - if (status == 499 || status == 503) + if (status == HTTP_INTERNAL_ERROR || status == HTTP_SERVICE_UNAVAILABLE) { //timeout or service unavailable, try again llwarns << "Timeout or service unavailable, retrying." << llendl; LLMeshRepository::sHTTPRetryCount++; @@ -1991,8 +1994,8 @@ void LLMeshSkinInfoResponder::completedRaw(U32 status, const std::string& reason } else { - llassert(status == 499 || status == 503); //intentionally trigger a breakpoint - llwarns << "Unhandled status " << status << llendl; + llassert(status == HTTP_INTERNAL_ERROR || status == HTTP_SERVICE_UNAVAILABLE); //intentionally trigger a breakpoint + llwarns << "Unhandled status " << dumpResponse() << llendl; } return; } @@ -2026,10 +2029,10 @@ void LLMeshSkinInfoResponder::completedRaw(U32 status, const std::string& reason delete [] data; } -void LLMeshDecompositionResponder::completedRaw(U32 status, const std::string& reason, - const LLChannelDescriptors& channels, - const LLIOPipe::buffer_ptr_t& buffer) +void LLMeshDecompositionResponder::completedRaw(const LLChannelDescriptors& channels, + const LLIOPipe::buffer_ptr_t& buffer) { + S32 status = getStatus(); mProcessed = true; if( !gMeshRepo.mThread ) @@ -2039,14 +2042,15 @@ void LLMeshDecompositionResponder::completedRaw(U32 status, const std::string& r S32 data_size = buffer->countAfter(channels.in(), NULL); + // *TODO: What about 3xx redirect codes? What about status 400 (Bad Request)? if (status < 200 || status > 400) { - llwarns << status << ": " << reason << llendl; + llwarns << dumpResponse() << llendl; } if (data_size < mRequestedBytes) { - if (status == 499 || status == 503) + if (status == HTTP_INTERNAL_ERROR || status == HTTP_SERVICE_UNAVAILABLE) { //timeout or service unavailable, try again llwarns << "Timeout or service unavailable, retrying." << llendl; LLMeshRepository::sHTTPRetryCount++; @@ -2054,8 +2058,8 @@ void LLMeshDecompositionResponder::completedRaw(U32 status, const std::string& r } else { - llassert(status == 499 || status == 503); //intentionally trigger a breakpoint - llwarns << "Unhandled status " << status << llendl; + llassert(status == HTTP_INTERNAL_ERROR || status == HTTP_SERVICE_UNAVAILABLE); //intentionally trigger a breakpoint + llwarns << "Unhandled status " << dumpResponse() << llendl; } return; } @@ -2089,10 +2093,10 @@ void LLMeshDecompositionResponder::completedRaw(U32 status, const std::string& r delete [] data; } -void LLMeshPhysicsShapeResponder::completedRaw(U32 status, const std::string& reason, - const LLChannelDescriptors& channels, - const LLIOPipe::buffer_ptr_t& buffer) +void LLMeshPhysicsShapeResponder::completedRaw(const LLChannelDescriptors& channels, + const LLIOPipe::buffer_ptr_t& buffer) { + S32 status = getStatus(); mProcessed = true; // thread could have already be destroyed during logout @@ -2103,14 +2107,15 @@ void LLMeshPhysicsShapeResponder::completedRaw(U32 status, const std::string& re S32 data_size = buffer->countAfter(channels.in(), NULL); + // *TODO: What about 3xx redirect codes? What about status 400 (Bad Request)? if (status < 200 || status > 400) { - llwarns << status << ": " << reason << llendl; + llwarns << dumpResponse() << llendl; } if (data_size < mRequestedBytes) { - if (status == 499 || status == 503) + if (status == HTTP_INTERNAL_ERROR || status == HTTP_SERVICE_UNAVAILABLE) { //timeout or service unavailable, try again llwarns << "Timeout or service unavailable, retrying." << llendl; LLMeshRepository::sHTTPRetryCount++; @@ -2118,8 +2123,8 @@ void LLMeshPhysicsShapeResponder::completedRaw(U32 status, const std::string& re } else { - llassert(status == 499 || status == 503); //intentionally trigger a breakpoint - llwarns << "Unhandled status " << status << llendl; + llassert(status == HTTP_INTERNAL_ERROR || status == HTTP_SERVICE_UNAVAILABLE); //intentionally trigger a breakpoint + llwarns << "Unhandled status " << dumpResponse() << llendl; } return; } @@ -2153,10 +2158,10 @@ void LLMeshPhysicsShapeResponder::completedRaw(U32 status, const std::string& re delete [] data; } -void LLMeshHeaderResponder::completedRaw(U32 status, const std::string& reason, - const LLChannelDescriptors& channels, - const LLIOPipe::buffer_ptr_t& buffer) +void LLMeshHeaderResponder::completedRaw(const LLChannelDescriptors& channels, + const LLIOPipe::buffer_ptr_t& buffer) { + S32 status = getStatus(); mProcessed = true; // thread could have already be destroyed during logout @@ -2165,6 +2170,7 @@ void LLMeshHeaderResponder::completedRaw(U32 status, const std::string& reason, return; } + // *TODO: What about 3xx redirect codes? What about status 400 (Bad Request)? if (status < 200 || status > 400) { //llwarns @@ -2178,9 +2184,9 @@ void LLMeshHeaderResponder::completedRaw(U32 status, const std::string& reason, // and (somewhat more optional than the others) retries // again after some set period of time - llassert(status == 503 || status == 499); + llassert(status == HTTP_SERVICE_UNAVAILABLE || status == HTTP_INTERNAL_ERROR); - if (status == 503 || status == 499) + if (status == HTTP_SERVICE_UNAVAILABLE || status == HTTP_INTERNAL_ERROR) { //retry llwarns << "Timeout or service unavailable, retrying." << llendl; LLMeshRepository::sHTTPRetryCount++; @@ -2192,7 +2198,7 @@ void LLMeshHeaderResponder::completedRaw(U32 status, const std::string& reason, } else { - llwarns << "Unhandled status." << llendl; + llwarns << "Unhandled status " << dumpResponse() << llendl; } } @@ -2214,9 +2220,7 @@ void LLMeshHeaderResponder::completedRaw(U32 status, const std::string& reason, if (!success) { - llwarns - << "Unable to parse mesh header: " - << status << ": " << reason << llendl; + llwarns << "Unable to parse mesh header: " << dumpResponse() << llendl; } else if (data && data_size > 0) { diff --git a/indra/newview/llpanelclassified.cpp b/indra/newview/llpanelclassified.cpp index 862e4be203..4f5e07c566 100644 --- a/indra/newview/llpanelclassified.cpp +++ b/indra/newview/llpanelclassified.cpp @@ -95,15 +95,11 @@ class LLClassifiedClickMessageResponder : public LLHTTPClient::Responder { LOG_CLASS(LLClassifiedClickMessageResponder); -public: +protected: // If we get back an error (not found, etc...), handle it here - virtual void errorWithContent( - U32 status, - const std::string& reason, - const LLSD& content) + virtual void httpFailure() { - llwarns << "Sending click message failed (" << status << "): [" << reason << "]" << llendl; - llwarns << "Content: [" << content << "]" << llendl; + llwarns << "Sending click message failed " << dumpResponse() << llendl; } }; diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index d6fccb9705..21b58dfbbf 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -529,7 +529,7 @@ void LLLandmarksPanel::setParcelID(const LLUUID& parcel_id) } // virtual -void LLLandmarksPanel::setErrorStatus(U32 status, const std::string& reason) +void LLLandmarksPanel::setErrorStatus(S32 status, const std::string& reason) { llwarns << "Can't handle remote parcel request."<< " Http Status: "<< status << ". Reason : "<< reason<<llendl; } diff --git a/indra/newview/llpanellandmarks.h b/indra/newview/llpanellandmarks.h index 4e787317ba..14709b267e 100644 --- a/indra/newview/llpanellandmarks.h +++ b/indra/newview/llpanellandmarks.h @@ -104,7 +104,7 @@ protected: //LLRemoteParcelInfoObserver interface /*virtual*/ void processParcelInfo(const LLParcelData& parcel_data); /*virtual*/ void setParcelID(const LLUUID& parcel_id); - /*virtual*/ void setErrorStatus(U32 status, const std::string& reason); + /*virtual*/ void setErrorStatus(S32 status, const std::string& reason); private: void initFavoritesInventoryPanel(); diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index bcb90bcb56..c4ba097914 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -437,7 +437,7 @@ void LLPanelLogin::showLoginWidgets() sInstance->reshapeBrowser(); // *TODO: Append all the usual login parameters, like first_login=Y etc. std::string splash_screen_url = LLGridManager::getInstance()->getLoginPage(); - web_browser->navigateTo( splash_screen_url, "text/html" ); + web_browser->navigateTo( splash_screen_url, HTTP_CONTENT_TEXT_HTML ); LLUICtrl* username_combo = sInstance->getChild<LLUICtrl>("username_combo"); username_combo->setFocus(TRUE); } @@ -791,7 +791,7 @@ void LLPanelLogin::loadLoginPage() if (web_browser->getCurrentNavUrl() != login_uri.asString()) { LL_DEBUGS("AppInit") << "loading: " << login_uri << LL_ENDL; - web_browser->navigateTo( login_uri.asString(), "text/html" ); + web_browser->navigateTo( login_uri.asString(), HTTP_CONTENT_TEXT_HTML ); } } diff --git a/indra/newview/llpanelpick.h b/indra/newview/llpanelpick.h index 3c1f14759c..7a8bd66fcf 100644 --- a/indra/newview/llpanelpick.h +++ b/indra/newview/llpanelpick.h @@ -86,7 +86,7 @@ public: //This stuff we got from LLRemoteParcelObserver, in the last one we intentionally do nothing /*virtual*/ void processParcelInfo(const LLParcelData& parcel_data); /*virtual*/ void setParcelID(const LLUUID& parcel_id) { mParcelId = parcel_id; } - /*virtual*/ void setErrorStatus(U32 status, const std::string& reason) {}; + /*virtual*/ void setErrorStatus(S32 status, const std::string& reason) {}; protected: diff --git a/indra/newview/llpanelplaceinfo.cpp b/indra/newview/llpanelplaceinfo.cpp index 4ae0c0eb12..4e7c5f6ed2 100644 --- a/indra/newview/llpanelplaceinfo.cpp +++ b/indra/newview/llpanelplaceinfo.cpp @@ -169,15 +169,15 @@ void LLPanelPlaceInfo::displayParcelInfo(const LLUUID& region_id, } // virtual -void LLPanelPlaceInfo::setErrorStatus(U32 status, const std::string& reason) +void LLPanelPlaceInfo::setErrorStatus(S32 status, const std::string& reason) { // We only really handle 404 and 499 errors std::string error_text; - if(status == 404) + if(status == HTTP_NOT_FOUND) { error_text = getString("server_error_text"); } - else if(status == 499) + else if(status == HTTP_INTERNAL_ERROR) { error_text = getString("server_forbidden_text"); } diff --git a/indra/newview/llpanelplaceinfo.h b/indra/newview/llpanelplaceinfo.h index 64f0b6b550..30327378ef 100644 --- a/indra/newview/llpanelplaceinfo.h +++ b/indra/newview/llpanelplaceinfo.h @@ -86,7 +86,7 @@ public: void displayParcelInfo(const LLUUID& region_id, const LLVector3d& pos_global); - /*virtual*/ void setErrorStatus(U32 status, const std::string& reason); + /*virtual*/ void setErrorStatus(S32 status, const std::string& reason); /*virtual*/ void processParcelInfo(const LLParcelData& parcel_data); diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index 6c2a01fc82..730df2ea23 100644 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -217,7 +217,7 @@ public: LLRemoteParcelInfoProcessor::getInstance()->sendParcelInfoRequest(parcel_id); } } - /*virtual*/ void setErrorStatus(U32 status, const std::string& reason) + /*virtual*/ void setErrorStatus(S32 status, const std::string& reason) { llerrs << "Can't complete remote parcel request. Http Status: " << status << ". Reason : " << reason << llendl; diff --git a/indra/newview/llpathfindingmanager.cpp b/indra/newview/llpathfindingmanager.cpp index c277359133..a9c755de35 100644 --- a/indra/newview/llpathfindingmanager.cpp +++ b/indra/newview/llpathfindingmanager.cpp @@ -103,17 +103,16 @@ LLHTTPRegistration<LLAgentStateChangeNode> gHTTPRegistrationAgentStateChangeNode class NavMeshStatusResponder : public LLHTTPClient::Responder { + LOG_CLASS(NavMeshStatusResponder); public: - NavMeshStatusResponder(const std::string &pCapabilityURL, LLViewerRegion *pRegion, bool pIsGetStatusOnly); + NavMeshStatusResponder(LLViewerRegion *pRegion, bool pIsGetStatusOnly); virtual ~NavMeshStatusResponder(); - 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(); private: - std::string mCapabilityURL; LLViewerRegion *mRegion; LLUUID mRegionUUID; bool mIsGetStatusOnly; @@ -125,17 +124,16 @@ private: class NavMeshResponder : public LLHTTPClient::Responder { + LOG_CLASS(NavMeshResponder); public: - NavMeshResponder(const std::string &pCapabilityURL, U32 pNavMeshVersion, LLPathfindingNavMeshPtr pNavMeshPtr); + NavMeshResponder(U32 pNavMeshVersion, LLPathfindingNavMeshPtr pNavMeshPtr); virtual ~NavMeshResponder(); - 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(); private: - std::string mCapabilityURL; U32 mNavMeshVersion; LLPathfindingNavMeshPtr mNavMeshPtr; }; @@ -146,17 +144,14 @@ private: class AgentStateResponder : public LLHTTPClient::Responder { + LOG_CLASS(AgentStateResponder); public: - AgentStateResponder(const std::string &pCapabilityURL); + AgentStateResponder(); virtual ~AgentStateResponder(); - virtual void result(const LLSD &pContent); - virtual void errorWithContent(U32 pStatus, const std::string& pReason, const LLSD& pContent); - protected: - -private: - std::string mCapabilityURL; + virtual void httpSuccess(); + virtual void httpFailure(); }; @@ -165,17 +160,16 @@ private: //--------------------------------------------------------------------------- class NavMeshRebakeResponder : public LLHTTPClient::Responder { + LOG_CLASS(NavMeshRebakeResponder); public: - NavMeshRebakeResponder(const std::string &pCapabilityURL, LLPathfindingManager::rebake_navmesh_callback_t pRebakeNavMeshCallback); + NavMeshRebakeResponder(LLPathfindingManager::rebake_navmesh_callback_t pRebakeNavMeshCallback); virtual ~NavMeshRebakeResponder(); - 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(); private: - std::string mCapabilityURL; LLPathfindingManager::rebake_navmesh_callback_t mRebakeNavMeshCallback; }; @@ -190,11 +184,9 @@ public: virtual ~LinksetsResponder(); void handleObjectLinksetsResult(const LLSD &pContent); - void handleObjectLinksetsError(U32 pStatus, const std::string &pReason, - const LLSD& pContent, const std::string &pURL); + void handleObjectLinksetsError(); void handleTerrainLinksetsResult(const LLSD &pContent); - void handleTerrainLinksetsError(U32 pStatus, const std::string &pReason, - const LLSD& pContent, const std::string &pURL); + void handleTerrainLinksetsError(); protected: @@ -227,17 +219,16 @@ typedef boost::shared_ptr<LinksetsResponder> LinksetsResponderPtr; class ObjectLinksetsResponder : public LLHTTPClient::Responder { + LOG_CLASS(ObjectLinksetsResponder); public: - ObjectLinksetsResponder(const std::string &pCapabilityURL, LinksetsResponderPtr pLinksetsResponsderPtr); + ObjectLinksetsResponder(LinksetsResponderPtr pLinksetsResponsderPtr); virtual ~ObjectLinksetsResponder(); - 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(); private: - std::string mCapabilityURL; LinksetsResponderPtr mLinksetsResponsderPtr; }; @@ -247,17 +238,16 @@ private: class TerrainLinksetsResponder : public LLHTTPClient::Responder { + LOG_CLASS(TerrainLinksetsResponder); public: - TerrainLinksetsResponder(const std::string &pCapabilityURL, LinksetsResponderPtr pLinksetsResponsderPtr); + TerrainLinksetsResponder(LinksetsResponderPtr pLinksetsResponsderPtr); virtual ~TerrainLinksetsResponder(); - 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(); private: - std::string mCapabilityURL; LinksetsResponderPtr mLinksetsResponsderPtr; }; @@ -267,17 +257,16 @@ private: class CharactersResponder : public LLHTTPClient::Responder { + LOG_CLASS(TerrainLinksetsResponder); public: - CharactersResponder(const std::string &pCapabilityURL, LLPathfindingManager::request_id_t pRequestId, LLPathfindingManager::object_request_callback_t pCharactersCallback); + CharactersResponder(LLPathfindingManager::request_id_t pRequestId, LLPathfindingManager::object_request_callback_t pCharactersCallback); virtual ~CharactersResponder(); - 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(); private: - std::string mCapabilityURL; LLPathfindingManager::request_id_t mRequestId; LLPathfindingManager::object_request_callback_t mCharactersCallback; }; @@ -364,7 +353,7 @@ void LLPathfindingManager::requestGetNavMeshForRegion(LLViewerRegion *pRegion, b std::string navMeshStatusURL = getNavMeshStatusURLForRegion(pRegion); llassert(!navMeshStatusURL.empty()); navMeshPtr->handleNavMeshCheckVersion(); - LLHTTPClient::ResponderPtr navMeshStatusResponder = new NavMeshStatusResponder(navMeshStatusURL, pRegion, pIsGetStatusOnly); + LLHTTPClient::ResponderPtr navMeshStatusResponder = new NavMeshStatusResponder(pRegion, pIsGetStatusOnly); LLHTTPClient::get(navMeshStatusURL, navMeshStatusResponder); } } @@ -398,12 +387,12 @@ void LLPathfindingManager::requestGetLinksets(request_id_t pRequestId, object_re bool doRequestTerrain = isAllowViewTerrainProperties(); LinksetsResponderPtr linksetsResponderPtr(new LinksetsResponder(pRequestId, pLinksetsCallback, true, doRequestTerrain)); - LLHTTPClient::ResponderPtr objectLinksetsResponder = new ObjectLinksetsResponder(objectLinksetsURL, linksetsResponderPtr); + LLHTTPClient::ResponderPtr objectLinksetsResponder = new ObjectLinksetsResponder(linksetsResponderPtr); LLHTTPClient::get(objectLinksetsURL, objectLinksetsResponder); if (doRequestTerrain) { - LLHTTPClient::ResponderPtr terrainLinksetsResponder = new TerrainLinksetsResponder(terrainLinksetsURL, linksetsResponderPtr); + LLHTTPClient::ResponderPtr terrainLinksetsResponder = new TerrainLinksetsResponder(linksetsResponderPtr); LLHTTPClient::get(terrainLinksetsURL, terrainLinksetsResponder); } } @@ -447,13 +436,13 @@ void LLPathfindingManager::requestSetLinksets(request_id_t pRequestId, const LLP if (!objectPostData.isUndefined()) { - LLHTTPClient::ResponderPtr objectLinksetsResponder = new ObjectLinksetsResponder(objectLinksetsURL, linksetsResponderPtr); + LLHTTPClient::ResponderPtr objectLinksetsResponder = new ObjectLinksetsResponder(linksetsResponderPtr); LLHTTPClient::put(objectLinksetsURL, objectPostData, objectLinksetsResponder); } if (!terrainPostData.isUndefined()) { - LLHTTPClient::ResponderPtr terrainLinksetsResponder = new TerrainLinksetsResponder(terrainLinksetsURL, linksetsResponderPtr); + LLHTTPClient::ResponderPtr terrainLinksetsResponder = new TerrainLinksetsResponder(linksetsResponderPtr); LLHTTPClient::put(terrainLinksetsURL, terrainPostData, terrainLinksetsResponder); } } @@ -486,7 +475,7 @@ void LLPathfindingManager::requestGetCharacters(request_id_t pRequestId, object_ { pCharactersCallback(pRequestId, kRequestStarted, emptyCharacterListPtr); - LLHTTPClient::ResponderPtr charactersResponder = new CharactersResponder(charactersURL, pRequestId, pCharactersCallback); + LLHTTPClient::ResponderPtr charactersResponder = new CharactersResponder(pRequestId, pCharactersCallback); LLHTTPClient::get(charactersURL, charactersResponder); } } @@ -519,7 +508,7 @@ void LLPathfindingManager::requestGetAgentState() { std::string agentStateURL = getAgentStateURLForRegion(currentRegion); llassert(!agentStateURL.empty()); - LLHTTPClient::ResponderPtr responder = new AgentStateResponder(agentStateURL); + LLHTTPClient::ResponderPtr responder = new AgentStateResponder(); LLHTTPClient::get(agentStateURL, responder); } } @@ -543,7 +532,7 @@ void LLPathfindingManager::requestRebakeNavMesh(rebake_navmesh_callback_t pRebak llassert(!navMeshStatusURL.empty()); LLSD postData; postData["command"] = "rebuild"; - LLHTTPClient::ResponderPtr responder = new NavMeshRebakeResponder(navMeshStatusURL, pRebakeNavMeshCallback); + LLHTTPClient::ResponderPtr responder = new NavMeshRebakeResponder(pRebakeNavMeshCallback); LLHTTPClient::post(navMeshStatusURL, postData, responder); } } @@ -565,7 +554,7 @@ void LLPathfindingManager::sendRequestGetNavMeshForRegion(LLPathfindingNavMeshPt else { navMeshPtr->handleNavMeshStart(pNavMeshStatus); - LLHTTPClient::ResponderPtr responder = new NavMeshResponder(navMeshURL, pNavMeshStatus.getVersion(), navMeshPtr); + LLHTTPClient::ResponderPtr responder = new NavMeshResponder(pNavMeshStatus.getVersion(), navMeshPtr); LLSD postData; LLHTTPClient::post(navMeshURL, postData, responder); @@ -779,9 +768,8 @@ void LLAgentStateChangeNode::post(ResponsePtr pResponse, const LLSD &pContext, c // NavMeshStatusResponder //--------------------------------------------------------------------------- -NavMeshStatusResponder::NavMeshStatusResponder(const std::string &pCapabilityURL, LLViewerRegion *pRegion, bool pIsGetStatusOnly) +NavMeshStatusResponder::NavMeshStatusResponder(LLViewerRegion *pRegion, bool pIsGetStatusOnly) : LLHTTPClient::Responder(), - mCapabilityURL(pCapabilityURL), mRegion(pRegion), mRegionUUID(), mIsGetStatusOnly(pIsGetStatusOnly) @@ -796,15 +784,15 @@ NavMeshStatusResponder::~NavMeshStatusResponder() { } -void NavMeshStatusResponder::result(const LLSD &pContent) +void NavMeshStatusResponder::httpSuccess() { - LLPathfindingNavMeshStatus navMeshStatus(mRegionUUID, pContent); + LLPathfindingNavMeshStatus navMeshStatus(mRegionUUID, getContent()); LLPathfindingManager::getInstance()->handleNavMeshStatusRequest(navMeshStatus, mRegion, mIsGetStatusOnly); } -void NavMeshStatusResponder::errorWithContent(U32 pStatus, const std::string& pReason, const LLSD& pContent) +void NavMeshStatusResponder::httpFailure() { - llwarns << "NavMeshStatusResponder error [status:" << pStatus << "]: " << pContent << llendl; + llwarns << dumpResponse() << llendl; LLPathfindingNavMeshStatus navMeshStatus(mRegionUUID); LLPathfindingManager::getInstance()->handleNavMeshStatusRequest(navMeshStatus, mRegion, mIsGetStatusOnly); } @@ -813,9 +801,8 @@ void NavMeshStatusResponder::errorWithContent(U32 pStatus, const std::string& pR // NavMeshResponder //--------------------------------------------------------------------------- -NavMeshResponder::NavMeshResponder(const std::string &pCapabilityURL, U32 pNavMeshVersion, LLPathfindingNavMeshPtr pNavMeshPtr) +NavMeshResponder::NavMeshResponder(U32 pNavMeshVersion, LLPathfindingNavMeshPtr pNavMeshPtr) : LLHTTPClient::Responder(), - mCapabilityURL(pCapabilityURL), mNavMeshVersion(pNavMeshVersion), mNavMeshPtr(pNavMeshPtr) { @@ -825,23 +812,23 @@ NavMeshResponder::~NavMeshResponder() { } -void NavMeshResponder::result(const LLSD &pContent) +void NavMeshResponder::httpSuccess() { - mNavMeshPtr->handleNavMeshResult(pContent, mNavMeshVersion); + mNavMeshPtr->handleNavMeshResult(getContent(), mNavMeshVersion); } -void NavMeshResponder::errorWithContent(U32 pStatus, const std::string& pReason, const LLSD& pContent) +void NavMeshResponder::httpFailure() { - mNavMeshPtr->handleNavMeshError(pStatus, pReason, pContent, mCapabilityURL, mNavMeshVersion); + llwarns << dumpResponse() << llendl; + mNavMeshPtr->handleNavMeshError(mNavMeshVersion); } //--------------------------------------------------------------------------- // AgentStateResponder //--------------------------------------------------------------------------- -AgentStateResponder::AgentStateResponder(const std::string &pCapabilityURL) +AgentStateResponder::AgentStateResponder() : LLHTTPClient::Responder() -, mCapabilityURL(pCapabilityURL) { } @@ -849,17 +836,18 @@ AgentStateResponder::~AgentStateResponder() { } -void AgentStateResponder::result(const LLSD &pContent) +void AgentStateResponder::httpSuccess() { + const LLSD& pContent = getContent(); llassert(pContent.has(AGENT_STATE_CAN_REBAKE_REGION_FIELD)); llassert(pContent.get(AGENT_STATE_CAN_REBAKE_REGION_FIELD).isBoolean()); BOOL canRebakeRegion = pContent.get(AGENT_STATE_CAN_REBAKE_REGION_FIELD).asBoolean(); LLPathfindingManager::getInstance()->handleAgentState(canRebakeRegion); } -void AgentStateResponder::errorWithContent(U32 pStatus, const std::string &pReason, const LLSD& pContent) +void AgentStateResponder::httpFailure() { - llwarns << "AgentStateResponder error [status:" << pStatus << "]: " << pContent << llendl; + llwarns << dumpResponse() << llendl; LLPathfindingManager::getInstance()->handleAgentState(FALSE); } @@ -867,9 +855,8 @@ void AgentStateResponder::errorWithContent(U32 pStatus, const std::string &pReas //--------------------------------------------------------------------------- // navmesh rebake responder //--------------------------------------------------------------------------- -NavMeshRebakeResponder::NavMeshRebakeResponder(const std::string &pCapabilityURL, LLPathfindingManager::rebake_navmesh_callback_t pRebakeNavMeshCallback) +NavMeshRebakeResponder::NavMeshRebakeResponder(LLPathfindingManager::rebake_navmesh_callback_t pRebakeNavMeshCallback) : LLHTTPClient::Responder(), - mCapabilityURL(pCapabilityURL), mRebakeNavMeshCallback(pRebakeNavMeshCallback) { } @@ -878,14 +865,14 @@ NavMeshRebakeResponder::~NavMeshRebakeResponder() { } -void NavMeshRebakeResponder::result(const LLSD &pContent) +void NavMeshRebakeResponder::httpSuccess() { mRebakeNavMeshCallback(true); } -void NavMeshRebakeResponder::errorWithContent(U32 pStatus, const std::string &pReason, const LLSD& pContent) +void NavMeshRebakeResponder::httpFailure() { - llwarns << "NavMeshRebakeResponder error [status:" << pStatus << "]: " << pContent << llendl; + llwarns << dumpResponse() << llendl; mRebakeNavMeshCallback(false); } @@ -918,11 +905,8 @@ void LinksetsResponder::handleObjectLinksetsResult(const LLSD &pContent) } } -void LinksetsResponder::handleObjectLinksetsError(U32 pStatus, const std::string &pReason, - const LLSD& pContent, const std::string &pURL) +void LinksetsResponder::handleObjectLinksetsError() { - llwarns << "LinksetsResponder object linksets error with request to URL '" << pURL << "' [status:" - << pStatus << "]: " << pContent << llendl; mObjectMessagingState = kReceivedError; if (mTerrainMessagingState != kWaiting) { @@ -941,11 +925,8 @@ void LinksetsResponder::handleTerrainLinksetsResult(const LLSD &pContent) } } -void LinksetsResponder::handleTerrainLinksetsError(U32 pStatus, const std::string &pReason, - const LLSD& pContent, const std::string &pURL) +void LinksetsResponder::handleTerrainLinksetsError() { - llwarns << "LinksetsResponder terrain linksets error with request to URL '" << pURL << "' [status:" - << pStatus << "]: " << pContent << llendl; mTerrainMessagingState = kReceivedError; if (mObjectMessagingState != kWaiting) { @@ -979,9 +960,8 @@ void LinksetsResponder::sendCallback() // ObjectLinksetsResponder //--------------------------------------------------------------------------- -ObjectLinksetsResponder::ObjectLinksetsResponder(const std::string &pCapabilityURL, LinksetsResponderPtr pLinksetsResponsderPtr) +ObjectLinksetsResponder::ObjectLinksetsResponder(LinksetsResponderPtr pLinksetsResponsderPtr) : LLHTTPClient::Responder(), - mCapabilityURL(pCapabilityURL), mLinksetsResponsderPtr(pLinksetsResponsderPtr) { } @@ -990,23 +970,23 @@ ObjectLinksetsResponder::~ObjectLinksetsResponder() { } -void ObjectLinksetsResponder::result(const LLSD &pContent) +void ObjectLinksetsResponder::httpSuccess() { - mLinksetsResponsderPtr->handleObjectLinksetsResult(pContent); + mLinksetsResponsderPtr->handleObjectLinksetsResult(getContent()); } -void ObjectLinksetsResponder::errorWithContent(U32 pStatus, const std::string &pReason, const LLSD& pContent) +void ObjectLinksetsResponder::httpFailure() { - mLinksetsResponsderPtr->handleObjectLinksetsError(pStatus, pReason, pContent, mCapabilityURL); + llwarns << dumpResponse() << llendl; + mLinksetsResponsderPtr->handleObjectLinksetsError(); } //--------------------------------------------------------------------------- // TerrainLinksetsResponder //--------------------------------------------------------------------------- -TerrainLinksetsResponder::TerrainLinksetsResponder(const std::string &pCapabilityURL, LinksetsResponderPtr pLinksetsResponsderPtr) +TerrainLinksetsResponder::TerrainLinksetsResponder(LinksetsResponderPtr pLinksetsResponsderPtr) : LLHTTPClient::Responder(), - mCapabilityURL(pCapabilityURL), mLinksetsResponsderPtr(pLinksetsResponsderPtr) { } @@ -1015,23 +995,23 @@ TerrainLinksetsResponder::~TerrainLinksetsResponder() { } -void TerrainLinksetsResponder::result(const LLSD &pContent) +void TerrainLinksetsResponder::httpSuccess() { - mLinksetsResponsderPtr->handleTerrainLinksetsResult(pContent); + mLinksetsResponsderPtr->handleTerrainLinksetsResult(getContent()); } -void TerrainLinksetsResponder::errorWithContent(U32 pStatus, const std::string &pReason, const LLSD& pContent) +void TerrainLinksetsResponder::httpFailure() { - mLinksetsResponsderPtr->handleTerrainLinksetsError(pStatus, pReason, pContent, mCapabilityURL); + llwarns << dumpResponse() << llendl; + mLinksetsResponsderPtr->handleTerrainLinksetsError(); } //--------------------------------------------------------------------------- // CharactersResponder //--------------------------------------------------------------------------- -CharactersResponder::CharactersResponder(const std::string &pCapabilityURL, LLPathfindingManager::request_id_t pRequestId, LLPathfindingManager::object_request_callback_t pCharactersCallback) +CharactersResponder::CharactersResponder(LLPathfindingManager::request_id_t pRequestId, LLPathfindingManager::object_request_callback_t pCharactersCallback) : LLHTTPClient::Responder(), - mCapabilityURL(pCapabilityURL), mRequestId(pRequestId), mCharactersCallback(pCharactersCallback) { @@ -1041,15 +1021,15 @@ CharactersResponder::~CharactersResponder() { } -void CharactersResponder::result(const LLSD &pContent) +void CharactersResponder::httpSuccess() { - LLPathfindingObjectListPtr characterListPtr = LLPathfindingObjectListPtr(new LLPathfindingCharacterList(pContent)); + LLPathfindingObjectListPtr characterListPtr = LLPathfindingObjectListPtr(new LLPathfindingCharacterList(getContent())); mCharactersCallback(mRequestId, LLPathfindingManager::kRequestCompleted, characterListPtr); } -void CharactersResponder::errorWithContent(U32 pStatus, const std::string &pReason, const LLSD& pContent) +void CharactersResponder::httpFailure() { - llwarns << "CharactersResponder error [status:" << pStatus << "]: " << pContent << llendl; + llwarns << dumpResponse() << llendl; LLPathfindingObjectListPtr characterListPtr = LLPathfindingObjectListPtr(new LLPathfindingCharacterList()); mCharactersCallback(mRequestId, LLPathfindingManager::kRequestError, characterListPtr); diff --git a/indra/newview/llpathfindingnavmesh.cpp b/indra/newview/llpathfindingnavmesh.cpp index 0c23e5ac92..555105cf40 100644 --- a/indra/newview/llpathfindingnavmesh.cpp +++ b/indra/newview/llpathfindingnavmesh.cpp @@ -184,10 +184,8 @@ void LLPathfindingNavMesh::handleNavMeshError() setRequestStatus(kNavMeshRequestError); } -void LLPathfindingNavMesh::handleNavMeshError(U32 pStatus, const std::string &pReason, const LLSD& pContent, const std::string &pURL, U32 pNavMeshVersion) +void LLPathfindingNavMesh::handleNavMeshError(U32 pNavMeshVersion) { - llwarns << "LLPathfindingNavMesh error with request to URL '" << pURL << "' [status:" - << pStatus << "]: " << pContent << llendl; if (mNavMeshStatus.getVersion() == pNavMeshVersion) { handleNavMeshError(); diff --git a/indra/newview/llpathfindingnavmesh.h b/indra/newview/llpathfindingnavmesh.h index b872ccad7c..87f32b8d56 100644 --- a/indra/newview/llpathfindingnavmesh.h +++ b/indra/newview/llpathfindingnavmesh.h @@ -74,7 +74,7 @@ public: void handleNavMeshResult(const LLSD &pContent, U32 pNavMeshVersion); void handleNavMeshNotEnabled(); void handleNavMeshError(); - void handleNavMeshError(U32 pStatus, const std::string &pReason, const LLSD& pContent, const std::string &pURL, U32 pNavMeshVersion); + void handleNavMeshError(U32 pNavMeshVersion); protected: diff --git a/indra/newview/llproductinforequest.cpp b/indra/newview/llproductinforequest.cpp index 1390000fc5..94a6389f8a 100644 --- a/indra/newview/llproductinforequest.cpp +++ b/indra/newview/llproductinforequest.cpp @@ -35,18 +35,24 @@ class LLProductInfoRequestResponder : public LLHTTPClient::Responder { -public: + LOG_CLASS(LLProductInfoRequestResponder); +private: //If we get back a normal response, handle it here - virtual void result(const LLSD& content) + /* virtual */ void httpSuccess() { - LLProductInfoRequestManager::instance().setSkuDescriptions(content); + const LLSD& content = getContent(); + if (!content.isArray()) + { + failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content); + return; + } + LLProductInfoRequestManager::instance().setSkuDescriptions(getContent()); } //If we get back an error (not found, etc...), handle it here - virtual void errorWithContent(U32 status, const std::string& reason, const LLSD& content) + /* virtual */ void httpFailure() { - llwarns << "LLProductInfoRequest error [status:" - << status << ":] " << content << llendl; + llwarns << dumpResponse() << llendl; } }; diff --git a/indra/newview/llremoteparcelrequest.cpp b/indra/newview/llremoteparcelrequest.cpp index 500dec7ee5..7418bbf615 100644 --- a/indra/newview/llremoteparcelrequest.cpp +++ b/indra/newview/llremoteparcelrequest.cpp @@ -47,9 +47,15 @@ LLRemoteParcelRequestResponder::LLRemoteParcelRequestResponder(LLHandle<LLRemote //If we get back a normal response, handle it here //virtual -void LLRemoteParcelRequestResponder::result(const LLSD& content) +void LLRemoteParcelRequestResponder::httpSuccess() { - LLUUID parcel_id = content["parcel_id"]; + const LLSD& content = getContent(); + if (!content.isMap() || !content.has("parcel_id")) + { + failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content); + return; + } + LLUUID parcel_id = getContent()["parcel_id"]; // Panel inspecting the information may be closed and destroyed // before this response is received. @@ -62,17 +68,16 @@ void LLRemoteParcelRequestResponder::result(const LLSD& content) //If we get back an error (not found, etc...), handle it here //virtual -void LLRemoteParcelRequestResponder::errorWithContent(U32 status, const std::string& reason, const LLSD& content) +void LLRemoteParcelRequestResponder::httpFailure() { - llwarns << "LLRemoteParcelRequest error [status:" - << status << "]: " << content << llendl; + llwarns << dumpResponse() << llendl; // Panel inspecting the information may be closed and destroyed // before this response is received. LLRemoteParcelInfoObserver* observer = mObserverHandle.get(); if (observer) { - observer->setErrorStatus(status, reason); + observer->setErrorStatus(getStatus(), getReason()); } } diff --git a/indra/newview/llremoteparcelrequest.h b/indra/newview/llremoteparcelrequest.h index b87056573b..0f8ae41d76 100644 --- a/indra/newview/llremoteparcelrequest.h +++ b/indra/newview/llremoteparcelrequest.h @@ -37,16 +37,17 @@ class LLRemoteParcelInfoObserver; class LLRemoteParcelRequestResponder : public LLHTTPClient::Responder { + LOG_CLASS(LLRemoteParcelRequestResponder); public: LLRemoteParcelRequestResponder(LLHandle<LLRemoteParcelInfoObserver> observer_handle); +private: //If we get back a normal response, handle it here - /*virtual*/ void result(const LLSD& content); + /*virtual*/ void httpSuccess(); //If we get back an error (not found, etc...), handle it here - /*virtual*/ void errorWithContent(U32 status, const std::string& reason, const LLSD& content); + /*virtual*/ void httpFailure(); -protected: LLHandle<LLRemoteParcelInfoObserver> mObserverHandle; }; @@ -78,7 +79,7 @@ public: virtual ~LLRemoteParcelInfoObserver() {} virtual void processParcelInfo(const LLParcelData& parcel_data) = 0; virtual void setParcelID(const LLUUID& parcel_id) = 0; - virtual void setErrorStatus(U32 status, const std::string& reason) = 0; + virtual void setErrorStatus(S32 status, const std::string& reason) = 0; LLHandle<LLRemoteParcelInfoObserver> getObserverHandle() const { return mObserverHandle; } protected: diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp index 890bc0f42d..1065b744b9 100644 --- a/indra/newview/llspeakers.cpp +++ b/indra/newview/llspeakers.cpp @@ -720,21 +720,23 @@ void LLIMSpeakerMgr::updateSpeakers(const LLSD& update) class ModerationResponder : public LLHTTPClient::Responder { + LOG_CLASS(ModerationResponder); public: ModerationResponder(const LLUUID& session_id) { mSessionID = session_id; } - virtual void errorWithContent(U32 status, const std::string& reason, const LLSD& content) +protected: + virtual void httpFailure() { - llwarns << "ModerationResponder error [status:" << status << "]: " << content << llendl; + llwarns << dumpResponse() << llendl; if ( gIMMgr ) { //403 == you're not a mod //should be disabled if you're not a moderator - if ( 403 == status ) + if ( HTTP_FORBIDDEN == getStatus() ) { gIMMgr->showSessionEventError( "mute", diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 81bc70906d..d61a87c031 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -36,7 +36,7 @@ #include "lldir.h" #include "llhttpclient.h" -#include "llhttpstatuscodes.h" +#include "llhttpconstants.h" #include "llimage.h" #include "llimagej2c.h" #include "llimageworker.h" @@ -2350,9 +2350,10 @@ LLTextureFetch::LLTextureFetch(LLTextureCache* cache, LLImageDecodeThread* image mHttpRequest = new LLCore::HttpRequest; mHttpOptions = new LLCore::HttpOptions; mHttpHeaders = new LLCore::HttpHeaders; - mHttpHeaders->mHeaders.push_back("Accept: image/x-j2c"); + // *TODO: Should this be 'image/j2c' instead of 'image/x-j2c' ? + mHttpHeaders->mHeaders.push_back(HTTP_HEADER_ACCEPT + ": " + HTTP_CONTENT_IMAGE_X_J2C); mHttpMetricsHeaders = new LLCore::HttpHeaders; - mHttpMetricsHeaders->mHeaders.push_back("Content-Type: application/llsd+xml"); + mHttpMetricsHeaders->mHeaders.push_back(HTTP_HEADER_CONTENT_TYPE + ": " + HTTP_CONTENT_LLSD_XML); mHttpPolicyClass = LLAppViewer::instance()->getAppCoreHttp().getPolicyDefault(); } @@ -3950,7 +3951,8 @@ void LLTextureFetchDebugger::init() if (! mHttpHeaders) { mHttpHeaders = new LLCore::HttpHeaders; - mHttpHeaders->mHeaders.push_back("Accept: image/x-j2c"); + // *TODO: Should this be 'image/j2c' instead of 'image/x-j2c' ? + mHttpHeaders->mHeaders.push_back(HTTP_HEADER_ACCEPT + ": " + HTTP_CONTENT_IMAGE_X_J2C); } } diff --git a/indra/newview/lltranslate.cpp b/indra/newview/lltranslate.cpp index f3d8de1904..b9840fa3e4 100755 --- a/indra/newview/lltranslate.cpp +++ b/indra/newview/lltranslate.cpp @@ -84,7 +84,7 @@ bool LLGoogleTranslationHandler::parseResponse( return false; } - if (status != STATUS_OK) + if (status != HTTP_OK) { // Request failed. Extract error message from the response. parseErrorResponse(root, status, err_msg); @@ -186,7 +186,7 @@ bool LLBingTranslationHandler::parseResponse( std::string& detected_lang, std::string& err_msg) const { - if (status != STATUS_OK) + if (status != HTTP_OK) { static const std::string MSG_BEGIN_MARKER = "Message: "; size_t begin = body.find(MSG_BEGIN_MARKER); @@ -251,8 +251,6 @@ LLTranslate::TranslationReceiver::TranslationReceiver(const std::string& from_la // virtual void LLTranslate::TranslationReceiver::completedRaw( - U32 http_status, - const std::string& reason, const LLChannelDescriptors& channels, const LLIOPipe::buffer_ptr_t& buffer) { @@ -262,8 +260,8 @@ void LLTranslate::TranslationReceiver::completedRaw( const std::string body = strstrm.str(); std::string translation, detected_lang, err_msg; - int status = http_status; - LL_DEBUGS("Translate") << "HTTP status: " << status << " " << reason << LL_ENDL; + int status = getStatus(); + LL_DEBUGS("Translate") << "HTTP status: " << status << " " << getReason() << LL_ENDL; LL_DEBUGS("Translate") << "Response body: " << body << LL_ENDL; if (mHandler.parseResponse(status, body, translation, detected_lang, err_msg)) { @@ -301,12 +299,10 @@ LLTranslate::EService LLTranslate::KeyVerificationReceiver::getService() const // virtual void LLTranslate::KeyVerificationReceiver::completedRaw( - U32 http_status, - const std::string& reason, const LLChannelDescriptors& channels, const LLIOPipe::buffer_ptr_t& buffer) { - bool ok = (http_status == 200); + bool ok = (getStatus() == HTTP_OK); setVerificationStatus(ok); } @@ -398,8 +394,8 @@ void LLTranslate::sendRequest(const std::string& url, LLHTTPClient::ResponderPtr LLVersionInfo::getPatch(), LLVersionInfo::getBuild()); - sHeader.insert("Accept", "text/plain"); - sHeader.insert("User-Agent", user_agent); + sHeader.insert(HTTP_HEADER_ACCEPT, HTTP_CONTENT_TEXT_PLAIN); + sHeader.insert(HTTP_HEADER_USER_AGENT, user_agent); } LLHTTPClient::get(url, responder, sHeader, REQUEST_TIMEOUT); diff --git a/indra/newview/lltranslate.h b/indra/newview/lltranslate.h index db5ad9479c..972274714a 100755 --- a/indra/newview/lltranslate.h +++ b/indra/newview/lltranslate.h @@ -95,9 +95,6 @@ public: virtual bool isConfigured() const = 0; virtual ~LLTranslationAPIHandler() {} - -protected: - static const int STATUS_OK = 200; }; /// Google Translate v2 API handler. @@ -201,8 +198,6 @@ public : * @see mHandler */ /*virtual*/ void completedRaw( - U32 http_status, - const std::string& reason, const LLChannelDescriptors& channels, const LLIOPipe::buffer_ptr_t& buffer); @@ -250,8 +245,6 @@ public : * @see setVerificationStatus() */ /*virtual*/ void completedRaw( - U32 http_status, - const std::string& reason, const LLChannelDescriptors& channels, const LLIOPipe::buffer_ptr_t& buffer); diff --git a/indra/newview/lluploadfloaterobservers.cpp b/indra/newview/lluploadfloaterobservers.cpp index 1d777b3f7f..88c48ba0a3 100644 --- a/indra/newview/lluploadfloaterobservers.cpp +++ b/indra/newview/lluploadfloaterobservers.cpp @@ -1,6 +1,6 @@ /** * @file lluploadfloaterobservers.cpp - * @brief LLUploadModelPremissionsResponder definition + * @brief LLUploadModelPermissionsResponder definition * * $LicenseInfo:firstyear=2011&license=viewerlgpl$ * Second Life Viewer Source Code @@ -28,26 +28,31 @@ #include "lluploadfloaterobservers.h" -LLUploadModelPremissionsResponder::LLUploadModelPremissionsResponder(const LLHandle<LLUploadPermissionsObserver>& observer) +LLUploadModelPermissionsResponder::LLUploadModelPermissionsResponder(const LLHandle<LLUploadPermissionsObserver>& observer) :mObserverHandle(observer) { } -void LLUploadModelPremissionsResponder::errorWithContent(U32 status, const std::string& reason, const LLSD& content) +void LLUploadModelPermissionsResponder::httpFailure() { - llwarns << "LLUploadModelPremissionsResponder error [status:" - << status << "]: " << content << llendl; + llwarns << dumpResponse() << llendl; LLUploadPermissionsObserver* observer = mObserverHandle.get(); if (observer) { - observer->setPermissonsErrorStatus(status, reason); + observer->setPermissonsErrorStatus(getStatus(), getReason()); } } -void LLUploadModelPremissionsResponder::result(const LLSD& content) +void LLUploadModelPermissionsResponder::httpSuccess() { + const LLSD& content = getContent(); + if (!content.isMap()) + { + failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content); + return; + } LLUploadPermissionsObserver* observer = mObserverHandle.get(); if (observer) @@ -55,3 +60,4 @@ void LLUploadModelPremissionsResponder::result(const LLSD& content) observer->onPermissionsReceived(content); } } + diff --git a/indra/newview/lluploadfloaterobservers.h b/indra/newview/lluploadfloaterobservers.h index b43ddb44d9..4ff4a827a5 100644 --- a/indra/newview/lluploadfloaterobservers.h +++ b/indra/newview/lluploadfloaterobservers.h @@ -1,6 +1,6 @@ /** * @file lluploadfloaterobservers.h - * @brief LLUploadModelPremissionsResponder declaration + * @brief LLUploadModelPermissionsResponder declaration * * $LicenseInfo:firstyear=2011&license=viewerlgpl$ * Second Life Viewer Source Code @@ -39,7 +39,7 @@ public: virtual ~LLUploadPermissionsObserver() {} virtual void onPermissionsReceived(const LLSD& result) = 0; - virtual void setPermissonsErrorStatus(U32 status, const std::string& reason) = 0; + virtual void setPermissonsErrorStatus(S32 status, const std::string& reason) = 0; LLHandle<LLUploadPermissionsObserver> getPermObserverHandle() const {return mUploadPermObserverHandle;} @@ -54,7 +54,7 @@ public: virtual ~LLWholeModelFeeObserver() {} virtual void onModelPhysicsFeeReceived(const LLSD& result, std::string upload_url) = 0; - virtual void setModelPhysicsFeeErrorStatus(U32 status, const std::string& reason) = 0; + virtual void setModelPhysicsFeeErrorStatus(S32 status, const std::string& reason) = 0; LLHandle<LLWholeModelFeeObserver> getWholeModelFeeObserverHandle() const { return mWholeModelFeeObserverHandle; } @@ -80,17 +80,16 @@ protected: }; -class LLUploadModelPremissionsResponder : public LLHTTPClient::Responder +class LLUploadModelPermissionsResponder : public LLHTTPClient::Responder { + LOG_CLASS(LLUploadModelPermissionsResponder); public: - - LLUploadModelPremissionsResponder(const LLHandle<LLUploadPermissionsObserver>& observer); - - void errorWithContent(U32 status, const std::string& reason, const LLSD& content); - - void result(const LLSD& content); + LLUploadModelPermissionsResponder(const LLHandle<LLUploadPermissionsObserver>& observer); private: + /* virtual */ void httpSuccess(); + /* virtual */ void httpFailure(); + LLHandle<LLUploadPermissionsObserver> mObserverHandle; }; diff --git a/indra/newview/llviewerdisplayname.cpp b/indra/newview/llviewerdisplayname.cpp index 1ac6a90894..07fceefde0 100644 --- a/indra/newview/llviewerdisplayname.cpp +++ b/indra/newview/llviewerdisplayname.cpp @@ -57,12 +57,12 @@ namespace LLViewerDisplayName class LLSetDisplayNameResponder : public LLHTTPClient::Responder { -public: + LOG_CLASS(LLSetDisplayNameResponder); +private: // only care about errors - /*virtual*/ void errorWithContent(U32 status, const std::string& reason, const LLSD& content) + /*virtual*/ void httpFailure() { - llwarns << "LLSetDisplayNameResponder error [status:" - << status << "]: " << content << llendl; + llwarns << dumpResponse() << llendl; LLViewerDisplayName::sSetDisplayNameSignal(false, "", LLSD()); LLViewerDisplayName::sSetDisplayNameSignal.disconnect_all_slots(); } @@ -85,7 +85,7 @@ void LLViewerDisplayName::set(const std::string& display_name, const set_name_sl // People API can return localized error messages. Indicate our // language preference via header. LLSD headers; - headers["Accept-Language"] = LLUI::getLanguage(); + headers[HTTP_HEADER_ACCEPT_LANGUAGE] = LLUI::getLanguage(); // People API requires both the old and new value to change a variable. // Our display name will be in cache before the viewer's UI is available @@ -127,7 +127,7 @@ public: LLSD body = input["body"]; S32 status = body["status"].asInteger(); - bool success = (status == 200); + bool success = (status == HTTP_OK); std::string reason = body["reason"].asString(); LLSD content = body["content"]; @@ -136,7 +136,7 @@ public: // If viewer's concept of display name is out-of-date, the set request // will fail with 409 Conflict. If that happens, fetch up-to-date // name information. - if (status == 409) + if (status == HTTP_CONFLICT) { LLUUID agent_id = gAgent.getID(); // Flush stale data diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 2df028de69..8c29a03176 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -158,7 +158,7 @@ LLViewerMediaObserver::~LLViewerMediaObserver() // on the Panel Land Media and to discover the MIME type class LLMimeDiscoveryResponder : public LLHTTPClient::Responder { -LOG_CLASS(LLMimeDiscoveryResponder); + LOG_CLASS(LLMimeDiscoveryResponder); public: LLMimeDiscoveryResponder( viewer_media_t media_impl) : mMediaImpl(media_impl), @@ -177,13 +177,20 @@ public: disconnectOwner(); } - virtual void completedHeader(U32 status, const std::string& reason, const LLSD& content) +private: + /* virtual */ void httpCompleted() { - std::string media_type = content["content-type"].asString(); + if (!isGoodStatus()) + { + llwarns << dumpResponse() + << " [headers:" << getResponseHeaders() << "]" << llendl; + } + const bool check_lower = true; + const std::string& media_type = getResponseHeader(HTTP_HEADER_CONTENT_TYPE, check_lower); std::string::size_type idx1 = media_type.find_first_of(";"); std::string mime_type = media_type.substr(0, idx1); - lldebugs << "status is " << status << ", media type \"" << media_type << "\"" << llendl; + lldebugs << "status is " << getStatus() << ", media type \"" << media_type << "\"" << llendl; // 2xx status codes indicate success. // Most 4xx status codes are successful enough for our purposes. @@ -200,32 +207,27 @@ public: // ) // We now no longer check the error code returned from the probe. // If we have a mime type, use it. If not, default to the web plugin and let it handle error reporting. - if(1) + //if(1) { // The probe was successful. if(mime_type.empty()) { // Some sites don't return any content-type header at all. // Treat an empty mime type as text/html. - mime_type = "text/html"; + mime_type = HTTP_CONTENT_TEXT_HTML; } - - completeAny(status, mime_type); } - else - { - llwarns << "responder failed with status " << status << ", reason " << reason << llendl; - - if(mMediaImpl) - { - mMediaImpl->mMediaSourceFailed = true; - } - } - - } + //else + //{ + // llwarns << "responder failed with status " << dumpResponse() << llendl; + // + // if(mMediaImpl) + // { + // mMediaImpl->mMediaSourceFailed = true; + // } + // return; + //} - void completeAny(U32 status, const std::string& mime_type) - { // the call to initializeMedia may disconnect the responder, which will clear mMediaImpl. // Make a local copy so we can call loadURI() afterwards. LLViewerMediaImpl *impl = mMediaImpl; @@ -241,6 +243,7 @@ public: } } +public: void cancelRequest() { disconnectOwner(); @@ -269,7 +272,7 @@ public: class LLViewerMediaOpenIDResponder : public LLHTTPClient::Responder { -LOG_CLASS(LLViewerMediaOpenIDResponder); + LOG_CLASS(LLViewerMediaOpenIDResponder); public: LLViewerMediaOpenIDResponder( ) { @@ -279,23 +282,18 @@ public: { } - /* virtual */ void completedHeader(U32 status, const std::string& reason, const LLSD& content) - { - LL_DEBUGS("MediaAuth") << "status = " << status << ", reason = " << reason << LL_ENDL; - LL_DEBUGS("MediaAuth") << content << LL_ENDL; - std::string cookie = content["set-cookie"].asString(); - - LLViewerMedia::openIDCookieResponse(cookie); - } - /* virtual */ void completedRaw( - U32 status, - const std::string& reason, const LLChannelDescriptors& channels, const LLIOPipe::buffer_ptr_t& buffer) { - // This is just here to disable the default behavior (attempting to parse the response as llsd). - // We don't care about the content of the response, only the set-cookie header. + // We don't care about the content of the response, only the Set-Cookie header. + LL_DEBUGS("MediaAuth") << dumpResponse() + << " [headers:" << getResponseHeaders() << "]" << LL_ENDL; + const bool check_lower = true; + const std::string& cookie = getResponseHeader(HTTP_HEADER_SET_COOKIE, check_lower); + + // *TODO: What about bad status codes? Does this destroy previous cookies? + LLViewerMedia::openIDCookieResponse(cookie); } }; @@ -313,17 +311,25 @@ public: { } - /* virtual */ void completedHeader(U32 status, const std::string& reason, const LLSD& content) + void completedRaw( + const LLChannelDescriptors& channels, + const LLIOPipe::buffer_ptr_t& buffer) { - LL_WARNS("MediaAuth") << "status = " << status << ", reason = " << reason << LL_ENDL; + // We don't care about the content of the response, only the set-cookie header. + LL_WARNS("MediaAuth") << dumpResponse() + << " [headers:" << getResponseHeaders() << "]" << LL_ENDL; - LLSD stripped_content = content; + LLSD stripped_content = getResponseHeaders(); + // *TODO: Check that this works. + stripped_content.erase(HTTP_HEADER_SET_COOKIE); stripped_content.erase("set-cookie"); LL_WARNS("MediaAuth") << stripped_content << LL_ENDL; - std::string cookie = content["set-cookie"].asString(); + const bool check_lower = true; + const std::string& cookie = getResponseHeader(HTTP_HEADER_SET_COOKIE, check_lower); LL_DEBUGS("MediaAuth") << "cookie = " << cookie << LL_ENDL; + // *TODO: What about bad status codes? Does this destroy previous cookies? LLViewerMedia::getCookieStore()->setCookiesFromHost(cookie, mHost); // Set cookie for snapshot publishing. @@ -331,16 +337,6 @@ public: LLWebProfile::setAuthCookie(auth_cookie); } - void completedRaw( - U32 status, - const std::string& reason, - const LLChannelDescriptors& channels, - const LLIOPipe::buffer_ptr_t& buffer) - { - // This is just here to disable the default behavior (attempting to parse the response as llsd). - // We don't care about the content of the response, only the set-cookie header. - } - std::string mHost; }; @@ -1387,10 +1383,12 @@ void LLViewerMedia::removeCookie(const std::string &name, const std::string &dom LLSD LLViewerMedia::getHeaders() { LLSD headers = LLSD::emptyMap(); - headers["Accept"] = "*/*"; - headers["Content-Type"] = "application/xml"; - headers["Cookie"] = sOpenIDCookie; - headers["User-Agent"] = getCurrentUserAgent(); + headers[HTTP_HEADER_ACCEPT] = "*/*"; + // *TODO: Should this be 'application/llsd+xml' ? + // *TODO: Should this even be set at all? This header is only not overridden in 'GET' methods. + headers[HTTP_HEADER_CONTENT_TYPE] = HTTP_CONTENT_XML; + headers[HTTP_HEADER_COOKIE] = sOpenIDCookie; + headers[HTTP_HEADER_USER_AGENT] = getCurrentUserAgent(); return headers; } @@ -1431,9 +1429,9 @@ void LLViewerMedia::setOpenIDCookie() // Do a web profile get so we can store the cookie LLSD headers = LLSD::emptyMap(); - headers["Accept"] = "*/*"; - headers["Cookie"] = sOpenIDCookie; - headers["User-Agent"] = getCurrentUserAgent(); + headers[HTTP_HEADER_ACCEPT] = "*/*"; + headers[HTTP_HEADER_COOKIE] = sOpenIDCookie; + headers[HTTP_HEADER_USER_AGENT] = getCurrentUserAgent(); std::string profile_url = getProfileURL(""); LLURL raw_profile_url( profile_url.c_str() ); @@ -1463,9 +1461,9 @@ void LLViewerMedia::openIDSetup(const std::string &openid_url, const std::string LLSD headers = LLSD::emptyMap(); // Keep LLHTTPClient from adding an "Accept: application/llsd+xml" header - headers["Accept"] = "*/*"; + headers[HTTP_HEADER_ACCEPT] = "*/*"; // and use the expected content-type for a post, instead of the LLHTTPClient::postRaw() default of "application/octet-stream" - headers["Content-Type"] = "application/x-www-form-urlencoded"; + headers[HTTP_HEADER_CONTENT_TYPE] = "application/x-www-form-urlencoded"; // postRaw() takes ownership of the buffer and releases it later, so we need to allocate a new buffer here. size_t size = openid_token.size(); @@ -1537,7 +1535,7 @@ void LLViewerMedia::createSpareBrowserMediaSource() // The null owner will keep the browser plugin from fully initializing // (specifically, it keeps LLPluginClassMedia from negotiating a size change, // which keeps MediaPluginWebkit::initBrowserWindow from doing anything until we have some necessary data, like the background color) - sSpareBrowserMediaSource = LLViewerMediaImpl::newSourceFromMediaType("text/html", NULL, 0, 0); + sSpareBrowserMediaSource = LLViewerMediaImpl::newSourceFromMediaType(HTTP_CONTENT_TEXT_HTML, NULL, 0, 0); } } @@ -2633,16 +2631,16 @@ void LLViewerMediaImpl::navigateInternal() // Accept: application/llsd+xml // which is really not what we want. LLSD headers = LLSD::emptyMap(); - headers["Accept"] = "*/*"; + headers[HTTP_HEADER_ACCEPT] = "*/*"; // Allow cookies in the response, to prevent a redirect loop when accessing join.secondlife.com - headers["Cookie"] = ""; + headers[HTTP_HEADER_COOKIE] = ""; LLHTTPClient::getHeaderOnly( mMediaURL, new LLMimeDiscoveryResponder(this), headers, 10.0f); } else if("data" == scheme || "file" == scheme || "about" == scheme) { // FIXME: figure out how to really discover the type for these schemes // We use "data" internally for a text/html url for loading the login screen - if(initializeMedia("text/html")) + if(initializeMedia(HTTP_CONTENT_TEXT_HTML)) { loadURI(); } diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index 0561e731e7..576b801d5b 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -671,6 +671,7 @@ void LLViewerObjectList::updateApparentAngles(LLAgent &agent) class LLObjectCostResponder : public LLCurl::Responder { + LOG_CLASS(LLObjectCostResponder); public: LLObjectCostResponder(const LLSD& object_ids) : mObjectIDs(object_ids) @@ -691,20 +692,19 @@ public: } } - void errorWithContent(U32 statusNum, const std::string& reason, const LLSD& content) +private: + /* virtual */ void httpFailure() { - llwarns - << "Transport error requesting object cost " - << "[status: " << statusNum << "]: " - << content << llendl; + llwarns << dumpResponse() << llendl; // TODO*: Error message to user // For now just clear the request from the pending list clear_object_list_pending_requests(); } - void result(const LLSD& content) + /* virtual */ void httpSuccess() { + const LLSD& content = getContent(); if ( !content.isMap() || content.has("error") ) { // Improper response or the request had an error, @@ -760,6 +760,7 @@ private: class LLPhysicsFlagsResponder : public LLCurl::Responder { + LOG_CLASS(LLPhysicsFlagsResponder); public: LLPhysicsFlagsResponder(const LLSD& object_ids) : mObjectIDs(object_ids) @@ -780,20 +781,19 @@ public: } } - void errorWithContent(U32 statusNum, const std::string& reason, const LLSD& content) +private: + /* virtual */ void httpFailure() { - llwarns - << "Transport error requesting object physics flags " - << "[status: " << statusNum << "]: " - << content << llendl; + llwarns << dumpResponse() << llendl; // TODO*: Error message to user // For now just clear the request from the pending list clear_object_list_pending_requests(); } - void result(const LLSD& content) + /* virtual void */ void httpSuccess() { + const LLSD& content = getContent(); if ( !content.isMap() || content.has("error") ) { // Improper response or the request had an error, diff --git a/indra/newview/llviewerparcelmedia.cpp b/indra/newview/llviewerparcelmedia.cpp index 386b2fd400..d7e14ac6f5 100644 --- a/indra/newview/llviewerparcelmedia.cpp +++ b/indra/newview/llviewerparcelmedia.cpp @@ -99,7 +99,7 @@ void LLViewerParcelMedia::update(LLParcel* parcel) std::string mediaCurrentUrl = std::string( parcel->getMediaCurrentURL()); // if we have a current (link sharing) url, use it instead - if (mediaCurrentUrl != "" && parcel->getMediaType() == "text/html") + if (mediaCurrentUrl != "" && parcel->getMediaType() == HTTP_CONTENT_TEXT_HTML) { mediaUrl = mediaCurrentUrl; } diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index b8b53aa6e4..2286bb09e1 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -204,24 +204,30 @@ class BaseCapabilitiesComplete : public LLHTTPClient::Responder { LOG_CLASS(BaseCapabilitiesComplete); public: - BaseCapabilitiesComplete(U64 region_handle, S32 id) + BaseCapabilitiesComplete(U64 region_handle, S32 id) : mRegionHandle(region_handle), mID(id) - { } + { } virtual ~BaseCapabilitiesComplete() { } - void errorWithContent(U32 statusNum, const std::string& reason, const LLSD& content) - { - LL_WARNS2("AppInit", "Capabilities") << "[status:" << statusNum << ":] " << content << LL_ENDL; + static BaseCapabilitiesComplete* build( U64 region_handle, S32 id ) + { + return new BaseCapabilitiesComplete(region_handle, id); + } + +private: + /* virtual */void httpFailure() + { + LL_WARNS2("AppInit", "Capabilities") << dumpResponse() << LL_ENDL; LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); if (regionp) { regionp->failedSeedCapability(); } - } + } - void result(const LLSD& content) - { + /* virtual */ void httpSuccess() + { LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); if(!regionp) //region was removed { @@ -234,11 +240,17 @@ public: return ; } + const LLSD& content = getContent(); + if (!content.isMap()) + { + failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content); + return; + } LLSD::map_const_iterator iter; for(iter = content.beginMap(); iter != content.endMap(); ++iter) { regionp->setCapability(iter->first, iter->second); - + LL_DEBUGS2("AppInit", "Capabilities") << "got capability for " << iter->first << LL_ENDL; @@ -257,11 +269,6 @@ public: } } - static BaseCapabilitiesComplete* build( U64 region_handle, S32 id ) - { - return new BaseCapabilitiesComplete(region_handle, id); - } - private: U64 mRegionHandle; S32 mID; @@ -278,19 +285,32 @@ public: virtual ~BaseCapabilitiesCompleteTracker() { } - void errorWithContent(U32 statusNum, const std::string& reason, const LLSD& content) + static BaseCapabilitiesCompleteTracker* build( U64 region_handle ) + { + return new BaseCapabilitiesCompleteTracker( region_handle ); + } + +private: + /* virtual */ void httpFailure() { - llwarns << "BaseCapabilitiesCompleteTracker error [status:" - << statusNum << "]: " << content << llendl; + llwarns << dumpResponse() << llendl; } - void result(const LLSD& content) + /* virtual */ void httpSuccess() { LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); if( !regionp ) { + LL_WARNS2("AppInit", "Capabilities") << "Received results for region that no longer exists!" << LL_ENDL; return ; - } + } + + const LLSD& content = getContent(); + if (!content.isMap()) + { + failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content); + return; + } LLSD::map_const_iterator iter; for(iter = content.beginMap(); iter != content.endMap(); ++iter) { @@ -300,7 +320,8 @@ public: if ( regionp->getRegionImpl()->mCapabilities.size() != regionp->getRegionImpl()->mSecondCapabilitiesTracker.size() ) { - llinfos<<"BaseCapabilitiesCompleteTracker "<<"Sim sent duplicate seed caps that differs in size - most likely content."<<llendl; + LL_WARNS2("AppInit", "Capabilities") + << "Sim sent duplicate seed caps that differs in size - most likely content." << LL_ENDL; //todo#add cap debug versus original check? /*CapabilityMap::const_iterator iter = regionp->getRegionImpl()->mCapabilities.begin(); while (iter!=regionp->getRegionImpl()->mCapabilities.end() ) @@ -311,16 +332,11 @@ public: */ regionp->getRegionImplNC()->mSecondCapabilitiesTracker.clear(); } - } - static BaseCapabilitiesCompleteTracker* build( U64 region_handle ) - { - return new BaseCapabilitiesCompleteTracker( region_handle ); - } private: - U64 mRegionHandle; + U64 mRegionHandle; }; @@ -1728,31 +1744,37 @@ class SimulatorFeaturesReceived : public LLHTTPClient::Responder { LOG_CLASS(SimulatorFeaturesReceived); public: - SimulatorFeaturesReceived(const std::string& retry_url, U64 region_handle, + SimulatorFeaturesReceived(const std::string& retry_url, U64 region_handle, S32 attempt = 0, S32 max_attempts = MAX_CAP_REQUEST_ATTEMPTS) - : mRetryURL(retry_url), mRegionHandle(region_handle), mAttempt(attempt), mMaxAttempts(max_attempts) - { } - - - void errorWithContent(U32 statusNum, const std::string& reason, const LLSD& content) - { - LL_WARNS2("AppInit", "SimulatorFeatures") << "[status:" << statusNum << "]: " << content << LL_ENDL; + : mRetryURL(retry_url), mRegionHandle(region_handle), mAttempt(attempt), mMaxAttempts(max_attempts) + { } + +private: + /* virtual */ void httpFailure() + { + LL_WARNS2("AppInit", "SimulatorFeatures") << dumpResponse() << LL_ENDL; retry(); - } + } - void result(const LLSD& content) - { + /* virtual */ void httpSuccess() + { LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); if(!regionp) //region is removed or responder is not created. { - LL_WARNS2("AppInit", "SimulatorFeatures") << "Received results for region that no longer exists!" << LL_ENDL; + LL_WARNS2("AppInit", "SimulatorFeatures") + << "Received results for region that no longer exists!" << LL_ENDL; return ; } - + + const LLSD& content = getContent(); + if (!content.isMap()) + { + failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content); + return; + } regionp->setSimulatorFeatures(content); } -private: void retry() { if (mAttempt < mMaxAttempts) @@ -1762,7 +1784,7 @@ private: LLHTTPClient::get(mRetryURL, new SimulatorFeaturesReceived(*this), LLSD(), CAP_REQUEST_TIMEOUT); } } - + std::string mRetryURL; U64 mRegionHandle; S32 mAttempt; diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index 4ed01f36ab..a9256ed5ea 100755 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -527,18 +527,19 @@ void update_statistics() class ViewerStatsResponder : public LLHTTPClient::Responder { + LOG_CLASS(ViewerStatsResponder); public: - ViewerStatsResponder() { } + ViewerStatsResponder() { } - void errorWithContent(U32 statusNum, const std::string& reason, const LLSD& content) - { - llwarns << "ViewerStatsResponder error [status:" << statusNum << "]: " - << content << llendl; - } +private: + /* virtual */ void httpFailure() + { + llwarns << dumpResponse() << llendl; + } - void result(const LLSD& content) - { - llinfos << "ViewerStatsResponder::result" << llendl; + /* virtual */ void httpSuccess() + { + llinfos << "OK" << llendl; } }; diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index a98e9ce511..7e95263f4b 100755 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1914,7 +1914,7 @@ void LLViewerWindow::initWorldUI() destinations->setErrorPageURL(gSavedSettings.getString("GenericErrorPageURL")); std::string url = gSavedSettings.getString("DestinationGuideURL"); url = LLWeb::expandURLSubstitutions(url, LLSD()); - destinations->navigateTo(url, "text/html"); + destinations->navigateTo(url, HTTP_CONTENT_TEXT_HTML); } LLMediaCtrl* avatar_picker = LLFloaterReg::getInstance("avatar")->findChild<LLMediaCtrl>("avatar_picker_contents"); if (avatar_picker) @@ -1922,7 +1922,7 @@ void LLViewerWindow::initWorldUI() avatar_picker->setErrorPageURL(gSavedSettings.getString("GenericErrorPageURL")); std::string url = gSavedSettings.getString("AvatarPickerURL"); url = LLWeb::expandURLSubstitutions(url, LLSD()); - avatar_picker->navigateTo(url, "text/html"); + avatar_picker->navigateTo(url, HTTP_CONTENT_TEXT_HTML); } } diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 9be1de4f0e..81454f5da4 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2241,6 +2241,7 @@ LLSD LLVOAvatarSelf::metricsData() class ViewerAppearanceChangeMetricsResponder: public LLCurl::Responder { + LOG_CLASS(ViewerAppearanceChangeMetricsResponder); public: ViewerAppearanceChangeMetricsResponder( S32 expected_sequence, volatile const S32 & live_sequence, @@ -2251,32 +2252,25 @@ public: { } - virtual void completed(U32 status, - const std::string& reason, - const LLSD& content) +private: + /* virtual */ void httpSuccess() { - gPendingMetricsUploads--; // if we add retry, this should be moved to the isGoodStatus case. - if (isGoodStatus(status)) - { - LL_DEBUGS("Avatar") << "OK" << LL_ENDL; - result(content); - } - else - { - LL_WARNS("Avatar") << "Failed " << status << " reason " << reason << LL_ENDL; - errorWithContent(status,reason,content); - } - } + LL_DEBUGS("Avatar") << "OK" << LL_ENDL; - // virtual - void result(const LLSD & content) - { + gPendingMetricsUploads--; if (mLiveSequence == mExpectedSequence) { mReportingStarted = true; } } + /* virtual */ void httpFailure() + { + // if we add retry, this should be removed from the httpFailure case + LL_WARNS("Avatar") << dumpResponse() << LL_ENDL; + gPendingMetricsUploads--; + } + private: S32 mExpectedSequence; volatile const S32 & mLiveSequence; @@ -2425,6 +2419,7 @@ void LLVOAvatarSelf::sendViewerAppearanceChangeMetrics() class CheckAgentAppearanceServiceResponder: public LLHTTPClient::Responder { + LOG_CLASS(CheckAgentAppearanceServiceResponder); public: CheckAgentAppearanceServiceResponder() { @@ -2434,22 +2429,24 @@ public: { } - /* virtual */ void result(const LLSD& content) +private: + /* virtual */ void httpSuccess() { - LL_DEBUGS("Avatar") << "status OK" << llendl; + LL_DEBUGS("Avatar") << "OK" << llendl; } // Error - /*virtual*/ void errorWithContent(U32 status, const std::string& reason, const LLSD& content) + /*virtual*/ void httpFailure() { if (isAgentAvatarValid()) { - LL_DEBUGS("Avatar") << "failed, will rebake [status:" - << status << "]: " << content << llendl; + LL_DEBUGS("Avatar") << "failed, will rebake " + << dumpResponse() << LL_ENDL; forceAppearanceUpdate(); } - } + } +public: static void forceAppearanceUpdate() { // Trying to rebake immediately after crossing region boundary diff --git a/indra/newview/llvoicechannel.cpp b/indra/newview/llvoicechannel.cpp index 181735ee30..be836d7752 100644 --- a/indra/newview/llvoicechannel.cpp +++ b/indra/newview/llvoicechannel.cpp @@ -53,26 +53,27 @@ const U32 DEFAULT_RETRIES_COUNT = 3; class LLVoiceCallCapResponder : public LLHTTPClient::Responder { + LOG_CLASS(LLVoiceCallCapResponder); public: LLVoiceCallCapResponder(const LLUUID& session_id) : mSessionID(session_id) {}; +protected: // called with bad status codes - virtual void errorWithContent(U32 status, const std::string& reason, const LLSD& content); - virtual void result(const LLSD& content); + virtual void httpFailure(); + virtual void httpSuccess(); private: LLUUID mSessionID; }; -void LLVoiceCallCapResponder::errorWithContent(U32 status, const std::string& reason, const LLSD& content) +void LLVoiceCallCapResponder::httpFailure() { - LL_WARNS("Voice") << "LLVoiceCallCapResponder error [status:" - << status << "]: " << content << LL_ENDL; + LL_WARNS("Voice") << dumpResponse() << LL_ENDL; LLVoiceChannel* channelp = LLVoiceChannel::getChannelByID(mSessionID); if ( channelp ) { - if ( 403 == status ) + if ( HTTP_FORBIDDEN == getStatus() ) { //403 == no ability LLNotificationsUtil::add( @@ -89,12 +90,18 @@ void LLVoiceCallCapResponder::errorWithContent(U32 status, const std::string& re } } -void LLVoiceCallCapResponder::result(const LLSD& content) +void LLVoiceCallCapResponder::httpSuccess() { LLVoiceChannel* channelp = LLVoiceChannel::getChannelByID(mSessionID); if (channelp) { //*TODO: DEBUG SPAM + const LLSD& content = getContent(); + if (!content.isMap()) + { + failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content); + return; + } LLSD::map_const_iterator iter; for(iter = content.beginMap(); iter != content.endMap(); ++iter) { diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index e112c589e9..360f8f15a3 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -120,17 +120,19 @@ static int scale_speaker_volume(float volume) class LLVivoxVoiceAccountProvisionResponder : public LLHTTPClient::Responder { + LOG_CLASS(LLVivoxVoiceAccountProvisionResponder); public: LLVivoxVoiceAccountProvisionResponder(int retries) { mRetries = retries; } - virtual void errorWithContent(U32 status, const std::string& reason, const LLSD& content) +private: + /* virtual */ void httpFailure() { LL_WARNS("Voice") << "ProvisionVoiceAccountRequest returned an error, " << ( (mRetries > 0) ? "retrying" : "too many retries (giving up)" ) - << status << "]: " << content << LL_ENDL; + << " " << dumpResponse() << LL_ENDL; if ( mRetries > 0 ) { @@ -142,14 +144,19 @@ public: } } - virtual void result(const LLSD& content) + /* virtual */ void httpSuccess() { - std::string voice_sip_uri_hostname; std::string voice_account_server_uri; - LL_DEBUGS("Voice") << "ProvisionVoiceAccountRequest response:" << ll_pretty_print_sd(content) << LL_ENDL; + LL_DEBUGS("Voice") << "ProvisionVoiceAccountRequest response:" << dumpResponse() << LL_ENDL; + const LLSD& content = getContent(); + if (!content.isMap()) + { + failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content); + return; + } if(content.has("voice_sip_uri_hostname")) voice_sip_uri_hostname = content["voice_sip_uri_hostname"].asString(); @@ -162,7 +169,6 @@ public: content["password"].asString(), voice_sip_uri_hostname, voice_account_server_uri); - } private: @@ -193,33 +199,34 @@ static LLVivoxVoiceClientFriendsObserver *friendslist_listener = NULL; class LLVivoxVoiceClientCapResponder : public LLHTTPClient::Responder { + LOG_CLASS(LLVivoxVoiceClientCapResponder); public: LLVivoxVoiceClientCapResponder(LLVivoxVoiceClient::state requesting_state) : mRequestingState(requesting_state) {}; +private: // called with bad status codes - virtual void errorWithContent(U32 status, const std::string& reason, const LLSD& content); - virtual void result(const LLSD& content); + /* virtual */ void httpFailure(); + /* virtual */ void httpSuccess(); -private: LLVivoxVoiceClient::state mRequestingState; // state }; -void LLVivoxVoiceClientCapResponder::errorWithContent(U32 status, const std::string& reason, const LLSD& content) +void LLVivoxVoiceClientCapResponder::httpFailure() { - LL_WARNS("Voice") << "LLVivoxVoiceClientCapResponder error [status:" - << status << "]: " << content << LL_ENDL; + LL_WARNS("Voice") << dumpResponse() << LL_ENDL; LLVivoxVoiceClient::getInstance()->sessionTerminate(); } -void LLVivoxVoiceClientCapResponder::result(const LLSD& content) +void LLVivoxVoiceClientCapResponder::httpSuccess() { LLSD::map_const_iterator iter; - LL_DEBUGS("Voice") << "ParcelVoiceInfoRequest response:" << ll_pretty_print_sd(content) << LL_ENDL; + LL_DEBUGS("Voice") << "ParcelVoiceInfoRequest response:" << dumpResponse() << LL_ENDL; std::string uri; std::string credentials; + const LLSD& content = getContent(); if ( content.has("voice_credentials") ) { LLSD voice_credentials = content["voice_credentials"]; @@ -2982,7 +2989,7 @@ void LLVivoxVoiceClient::loginResponse(int statusCode, std::string &statusString // Status code of 20200 means "bad password". We may want to special-case that at some point. - if ( statusCode == 401 ) + if ( statusCode == HTTP_UNAUTHORIZED ) { // Login failure which is probably caused by the delay after a user's password being updated. LL_INFOS("Voice") << "Account.Login response failure (" << statusCode << "): " << statusString << LL_ENDL; @@ -3484,7 +3491,7 @@ void LLVivoxVoiceClient::mediaStreamUpdatedEvent( switch(statusCode) { case 0: - case 200: + case HTTP_OK: // generic success // Don't change the saved error code (it may have been set elsewhere) break; @@ -3835,7 +3842,7 @@ void LLVivoxVoiceClient::messageEvent( LL_DEBUGS("Voice") << "Message event, session " << sessionHandle << " from " << uriString << LL_ENDL; // LL_DEBUGS("Voice") << " header " << messageHeader << ", body: \n" << messageBody << LL_ENDL; - if(messageHeader.find("text/html") != std::string::npos) + if(messageHeader.find(HTTP_CONTENT_TEXT_HTML) != std::string::npos) { std::string message; @@ -6119,9 +6126,10 @@ void LLVivoxVoiceClient::notifyStatusObservers(LLVoiceClientStatusObserver::ESta { switch(mAudioSession->mErrorStatusCode) { - case 404: // NOT_FOUND + case HTTP_NOT_FOUND: // NOT_FOUND + // *TODO: Should this be 503? case 480: // TEMPORARILY_UNAVAILABLE - case 408: // REQUEST_TIMEOUT + case HTTP_REQUEST_TIME_OUT: // REQUEST_TIMEOUT // call failed because other user was not available // treat this as an error case status = LLVoiceClientStatusObserver::ERROR_NOT_AVAILABLE; diff --git a/indra/newview/llwebprofile.cpp b/indra/newview/llwebprofile.cpp index 641f338f2c..ee78ba20cb 100644 --- a/indra/newview/llwebprofile.cpp +++ b/indra/newview/llwebprofile.cpp @@ -67,9 +67,8 @@ public: { } + // *TODO: Check for 'application/json' content type, and parse json at the base class. /*virtual*/ void completedRaw( - U32 status, - const std::string& reason, const LLChannelDescriptors& channels, const LLIOPipe::buffer_ptr_t& buffer) { @@ -78,9 +77,9 @@ public: strstrm << istr.rdbuf(); const std::string body = strstrm.str(); - if (status != 200) + if (getStatus() != HTTP_OK) { - llwarns << "Failed to get upload config (" << status << ")" << llendl; + llwarns << "Failed to get upload config " << dumpResponse() << llendl; LLWebProfile::reportImageUploadStatus(false); return; } @@ -128,14 +127,12 @@ class LLWebProfileResponders::PostImageRedirectResponder : public LLHTTPClient:: public: /*virtual*/ void completedRaw( - U32 status, - const std::string& reason, const LLChannelDescriptors& channels, const LLIOPipe::buffer_ptr_t& buffer) { - if (status != 200) + if (getStatus() != HTTP_OK) { - llwarns << "Failed to upload image: " << status << " " << reason << llendl; + llwarns << "Failed to upload image " << dumpResponse() << llendl; LLWebProfile::reportImageUploadStatus(false); return; } @@ -161,33 +158,37 @@ class LLWebProfileResponders::PostImageResponder : public LLHTTPClient::Responde LOG_CLASS(LLWebProfileResponders::PostImageResponder); public: - /*virtual*/ void completedHeader(U32 status, const std::string& reason, const LLSD& content) + /*virtual*/ void completedRaw(const LLChannelDescriptors& channels, + const LLIOPipe::buffer_ptr_t& buffer) { // Viewer seems to fail to follow a 303 redirect on POST request // (URLRequest Error: 65, Send failed since rewinding of the data stream failed). // Handle it manually. - if (status == 303) + if (getStatus() == HTTP_SEE_OTHER) { LLSD headers = LLViewerMedia::getHeaders(); - headers["Cookie"] = LLWebProfile::getAuthCookie(); - const std::string& redir_url = content["location"]; - LL_DEBUGS("Snapshots") << "Got redirection URL: " << redir_url << llendl; - LLHTTPClient::get(redir_url, new LLWebProfileResponders::PostImageRedirectResponder, headers); + headers[HTTP_HEADER_COOKIE] = LLWebProfile::getAuthCookie(); + const bool check_lower=true; + const std::string& redir_url = getResponseHeader(HTTP_HEADER_LOCATION, check_lower); + if (redir_url.empty()) + { + llwarns << "Received empty redirection URL " << dumpResponse() << llendl; + LL_DEBUGS("Snapshots") << "[headers:" << getResponseHeaders() << "]" << LL_ENDL; + LLWebProfile::reportImageUploadStatus(false); + } + else + { + LL_DEBUGS("Snapshots") << "Got redirection URL: " << redir_url << llendl; + LLHTTPClient::get(redir_url, new LLWebProfileResponders::PostImageRedirectResponder, headers); + } } else { - llwarns << "Unexpected POST status: " << status << " " << reason << llendl; - LL_DEBUGS("Snapshots") << "headers: [" << content << "]" << llendl; + llwarns << "Unexpected POST response " << dumpResponse() << llendl; + LL_DEBUGS("Snapshots") << "[headers:" << getResponseHeaders() << "]" << LL_ENDL; LLWebProfile::reportImageUploadStatus(false); } } - - // Override just to suppress warnings. - /*virtual*/ void completedRaw(U32 status, const std::string& reason, - const LLChannelDescriptors& channels, - const LLIOPipe::buffer_ptr_t& buffer) - { - } }; /////////////////////////////////////////////////////////////////////////////// @@ -206,7 +207,7 @@ void LLWebProfile::uploadImage(LLPointer<LLImageFormatted> image, const std::str LL_DEBUGS("Snapshots") << "Requesting " << config_url << llendl; LLSD headers = LLViewerMedia::getHeaders(); - headers["Cookie"] = getAuthCookie(); + headers[HTTP_HEADER_COOKIE] = getAuthCookie(); LLHTTPClient::get(config_url, new LLWebProfileResponders::ConfigResponder(image), headers); } @@ -230,8 +231,8 @@ void LLWebProfile::post(LLPointer<LLImageFormatted> image, const LLSD& config, c const std::string boundary = "----------------------------0123abcdefab"; LLSD headers = LLViewerMedia::getHeaders(); - headers["Cookie"] = getAuthCookie(); - headers["Content-Type"] = "multipart/form-data; boundary=" + boundary; + headers[HTTP_HEADER_COOKIE] = getAuthCookie(); + headers[HTTP_HEADER_CONTENT_TYPE] = "multipart/form-data; boundary=" + boundary; std::ostringstream body; diff --git a/indra/newview/llwebsharing.cpp b/indra/newview/llwebsharing.cpp index 3a80051b9b..ba536ac582 100644 --- a/indra/newview/llwebsharing.cpp +++ b/indra/newview/llwebsharing.cpp @@ -32,7 +32,7 @@ #include "llagentui.h" #include "llbufferstream.h" #include "llhttpclient.h" -#include "llhttpstatuscodes.h" +#include "llhttpconstants.h" #include "llsdserialize.h" #include "llsdutil.h" #include "llurl.h" @@ -45,36 +45,57 @@ /////////////////////////////////////////////////////////////////////////////// // -class LLWebSharingConfigResponder : public LLHTTPClient::Responder + +class LLWebSharingJSONResponder : public LLHTTPClient::Responder { - LOG_CLASS(LLWebSharingConfigResponder); + LOG_CLASS(LLWebSharingJSONResponder); public: /// Overrides the default LLSD parsing behaviour, to allow parsing a JSON response. - virtual void completedRaw(U32 status, const std::string& reason, - const LLChannelDescriptors& channels, + virtual void completedRaw(const LLChannelDescriptors& channels, const LLIOPipe::buffer_ptr_t& buffer) { - LLSD content; LLBufferStream istr(channels, buffer.get()); LLPointer<LLSDParser> parser = new LLSDNotationParser(); - if (parser->parse(istr, content, LLSDSerialize::SIZE_UNLIMITED) == LLSDParser::PARSE_FAILURE) - { - LL_WARNS("WebSharing") << "Failed to deserialize LLSD from JSON response. " << " [" << status << "]: " << reason << LL_ENDL; - } - else + if (parser->parse(istr, mContent, LLSDSerialize::SIZE_UNLIMITED) == LLSDParser::PARSE_FAILURE) { - completed(status, reason, content); + if (HTTP_CONTENT_JSON == getResponseHeader(HTTP_HEADER_CONTENT_TYPE)) + { + mStatus = HTTP_INTERNAL_ERROR; + mReason = "Failed to deserialize LLSD from JSON response."; + char body[1025]; + body[1024] = '\0'; + istr.seekg(0, std::ios::beg); + istr.get(body,1024); + if (strlen(body) > 0) + { + mContent["body"] = body; + } + } } + + httpCompleted(); } +}; + +class LLWebSharingConfigResponder : public LLWebSharingJSONResponder +{ + LOG_CLASS(LLWebSharingConfigResponder); +private: - virtual void errorWithContent(U32 status, const std::string& reason, const LLSD& content) + virtual void httpFailure() { - LL_WARNS("WebSharing") << "Error [status:" << status << "]: " << content << LL_ENDL; + LL_WARNS("WebSharing") << dumpResponse() << LL_ENDL; } - virtual void result(const LLSD& content) + virtual void httpSuccess() { + const LLSD& content = getContent(); + if (!content.isMap()) + { + failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content); + return; + } LLWebSharing::instance().receiveConfig(content); } }; @@ -87,39 +108,35 @@ class LLWebSharingOpenIDAuthResponder : public LLHTTPClient::Responder { LOG_CLASS(LLWebSharingOpenIDAuthResponder); public: - /* virtual */ void completedHeader(U32 status, const std::string& reason, const LLSD& content) - { - completed(status, reason, content); - } - - /* virtual */ void completedRaw(U32 status, const std::string& reason, - const LLChannelDescriptors& channels, + /* virtual */ void completedRaw(const LLChannelDescriptors& channels, const LLIOPipe::buffer_ptr_t& buffer) { /// Left empty to override the default LLSD parsing behaviour. + httpCompleted(); } - virtual void errorWithContent(U32 status, const std::string& reason, const LLSD& content) +private: + virtual void httpFailure() { - if (HTTP_UNAUTHORIZED == status) + if (HTTP_UNAUTHORIZED == getStatus()) { LL_WARNS("WebSharing") << "AU account not authenticated." << LL_ENDL; // *TODO: No account found on AU, so start the account creation process here. } else { - LL_WARNS("WebSharing") << "Error [status:" << status << "]: " << content << LL_ENDL; + LL_WARNS("WebSharing") << dumpResponse() << LL_ENDL; LLWebSharing::instance().retryOpenIDAuth(); } - } - virtual void result(const LLSD& content) + virtual void httpSuccess() { - if (content.has("set-cookie")) + const bool check_lower=true; + if (hasResponseHeader(HTTP_HEADER_SET_COOKIE, check_lower)) { // OpenID request succeeded and returned a session cookie. - LLWebSharing::instance().receiveSessionCookie(content["set-cookie"].asString()); + LLWebSharing::instance().receiveSessionCookie(getResponseHeader(HTTP_HEADER_SET_COOKIE, check_lower)); } } }; @@ -128,38 +145,19 @@ public: /////////////////////////////////////////////////////////////////////////////// // -class LLWebSharingSecurityTokenResponder : public LLHTTPClient::Responder +class LLWebSharingSecurityTokenResponder : public LLWebSharingJSONResponder { LOG_CLASS(LLWebSharingSecurityTokenResponder); -public: - /// Overrides the default LLSD parsing behaviour, to allow parsing a JSON response. - virtual void completedRaw(U32 status, const std::string& reason, - const LLChannelDescriptors& channels, - const LLIOPipe::buffer_ptr_t& buffer) +private: + virtual void httpFailure() { - LLSD content; - LLBufferStream istr(channels, buffer.get()); - LLPointer<LLSDParser> parser = new LLSDNotationParser(); - - if (parser->parse(istr, content, LLSDSerialize::SIZE_UNLIMITED) == LLSDParser::PARSE_FAILURE) - { - LL_WARNS("WebSharing") << "Failed to deserialize LLSD from JSON response. " << " [" << status << "]: " << reason << LL_ENDL; - LLWebSharing::instance().retryOpenIDAuth(); - } - else - { - completed(status, reason, content); - } - } - - virtual void errorWithContent(U32 status, const std::string& reason, const LLSD& content) - { - LL_WARNS("WebSharing") << "Error [status:" << status << "]: " << content << LL_ENDL; + LL_WARNS("WebSharing") << dumpResponse() << LL_ENDL; LLWebSharing::instance().retryOpenIDAuth(); } - virtual void result(const LLSD& content) + virtual void httpSuccess() { + const LLSD& content = getContent(); if (content[0].has("st") && content[0].has("expires")) { const std::string& token = content[0]["st"].asString(); @@ -172,7 +170,8 @@ public: } else { - LL_WARNS("WebSharing") << "No security token received." << LL_ENDL; + failureResult(HTTP_INTERNAL_ERROR, "No security token received.", content); + return; } LLWebSharing::instance().retryOpenIDAuth(); @@ -183,51 +182,18 @@ public: /////////////////////////////////////////////////////////////////////////////// // -class LLWebSharingUploadResponder : public LLHTTPClient::Responder +class LLWebSharingUploadResponder : public LLWebSharingJSONResponder { LOG_CLASS(LLWebSharingUploadResponder); -public: - /// Overrides the default LLSD parsing behaviour, to allow parsing a JSON response. - virtual void completedRaw(U32 status, const std::string& reason, - const LLChannelDescriptors& channels, - const LLIOPipe::buffer_ptr_t& buffer) - { -/* - // Dump the body, for debugging. - - LLBufferStream istr1(channels, buffer.get()); - std::ostringstream ostr; - std::string body; - - while (istr1.good()) - { - char buf[1024]; - istr1.read(buf, sizeof(buf)); - body.append(buf, istr1.gcount()); - } - LL_DEBUGS("WebSharing") << body << LL_ENDL; -*/ - LLSD content; - LLBufferStream istr(channels, buffer.get()); - LLPointer<LLSDParser> parser = new LLSDNotationParser(); - - if (parser->parse(istr, content, LLSDSerialize::SIZE_UNLIMITED) == LLSDParser::PARSE_FAILURE) - { - LL_WARNS("WebSharing") << "Failed to deserialize LLSD from JSON response. " << " [" << status << "]: " << reason << LL_ENDL; - } - else - { - completed(status, reason, content); - } - } - - virtual void errorWithContent(U32 status, const std::string& reason, const LLSD& content) +private: + virtual void httpFailure() { - LL_WARNS("WebSharing") << "Error [status:" << status << "]: " << content << LL_ENDL; + LL_WARNS("WebSharing") << dumpResponse() << LL_ENDL; } - virtual void result(const LLSD& content) + virtual void httpSuccess() { + const LLSD& content = getContent(); if (content[0].has("result") && content[0].has("id") && content[0]["id"].asString() == "newMediaItem") { @@ -235,8 +201,8 @@ public: } else { - LL_WARNS("WebSharing") << "Error [" << content[0]["code"].asString() - << "]: " << content[0]["message"].asString() << LL_ENDL; + failureResult(HTTP_INTERNAL_ERROR, "Invalid response content", content); + return; } } }; @@ -333,7 +299,7 @@ void LLWebSharing::sendConfigRequest() LL_DEBUGS("WebSharing") << "Requesting Snapshot Sharing config data from: " << config_url << LL_ENDL; LLSD headers = LLSD::emptyMap(); - headers["Accept"] = "application/json"; + headers[HTTP_HEADER_ACCEPT] = HTTP_CONTENT_JSON; LLHTTPClient::get(config_url, new LLWebSharingConfigResponder(), headers); } @@ -344,8 +310,8 @@ void LLWebSharing::sendOpenIDAuthRequest() LL_DEBUGS("WebSharing") << "Starting OpenID Auth: " << auth_url << LL_ENDL; LLSD headers = LLSD::emptyMap(); - headers["Cookie"] = mOpenIDCookie; - headers["Accept"] = "*/*"; + headers[HTTP_HEADER_COOKIE] = mOpenIDCookie; + headers[HTTP_HEADER_ACCEPT] = "*/*"; // Send request, successful login will trigger fetching a security token. LLHTTPClient::get(auth_url, new LLWebSharingOpenIDAuthResponder(), headers); @@ -371,10 +337,10 @@ void LLWebSharing::sendSecurityTokenRequest() LL_DEBUGS("WebSharing") << "Fetching security token from: " << token_url << LL_ENDL; LLSD headers = LLSD::emptyMap(); - headers["Cookie"] = mSessionCookie; + headers[HTTP_HEADER_COOKIE] = mSessionCookie; - headers["Accept"] = "application/json"; - headers["Content-Type"] = "application/json"; + headers[HTTP_HEADER_ACCEPT] = HTTP_CONTENT_JSON; + headers[HTTP_HEADER_CONTENT_TYPE] = HTTP_CONTENT_JSON; std::ostringstream body; body << "{ \"gadgets\": [{ \"url\":\"" @@ -400,10 +366,10 @@ void LLWebSharing::sendUploadRequest() static const std::string BOUNDARY("------------abcdef012345xyZ"); LLSD headers = LLSD::emptyMap(); - headers["Cookie"] = mSessionCookie; + headers[HTTP_HEADER_COOKIE] = mSessionCookie; - headers["Accept"] = "application/json"; - headers["Content-Type"] = "multipart/form-data; boundary=" + BOUNDARY; + headers[HTTP_HEADER_ACCEPT] = HTTP_CONTENT_JSON; + headers[HTTP_HEADER_CONTENT_TYPE] = "multipart/form-data; boundary=" + BOUNDARY; std::ostringstream body; body << "--" << BOUNDARY << "\r\n" diff --git a/indra/newview/llwlhandlers.cpp b/indra/newview/llwlhandlers.cpp index 93eba5b604..3bedfbe502 100644 --- a/indra/newview/llwlhandlers.cpp +++ b/indra/newview/llwlhandlers.cpp @@ -95,8 +95,9 @@ LLEnvironmentRequestResponder::LLEnvironmentRequestResponder() { mID = ++sCount; } -/*virtual*/ void LLEnvironmentRequestResponder::result(const LLSD& unvalidated_content) +/*virtual*/ void LLEnvironmentRequestResponder::httpSuccess() { + const LLSD& unvalidated_content = getContent(); LL_INFOS("WindlightCaps") << "Received region windlight settings" << LL_ENDL; if (mID != sCount) @@ -122,10 +123,10 @@ LLEnvironmentRequestResponder::LLEnvironmentRequestResponder() LLEnvManagerNew::getInstance()->onRegionSettingsResponse(unvalidated_content); } /*virtual*/ -void LLEnvironmentRequestResponder::errorWithContent(U32 status, const std::string& reason, const LLSD& content) +void LLEnvironmentRequestResponder::httpFailure() { - LL_INFOS("WindlightCaps") << "Got an error, not using region windlight... [status:" - << status << "]: " << content << LL_ENDL; + LL_WARNS("WindlightCaps") << "Got an error, not using region windlight... " + << dumpResponse() << LL_ENDL; LLEnvManagerNew::getInstance()->onRegionSettingsResponse(LLSD()); } @@ -169,8 +170,14 @@ bool LLEnvironmentApply::initiateRequest(const LLSD& content) /**** * LLEnvironmentApplyResponder ****/ -/*virtual*/ void LLEnvironmentApplyResponder::result(const LLSD& content) +/*virtual*/ void LLEnvironmentApplyResponder::httpSuccess() { + const LLSD& content = getContent(); + if (!content.isMap() || !content.has("regionID")) + { + failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content); + return; + } if (content["regionID"].asUUID() != gAgent.getRegion()->getRegionID()) { LL_WARNS("WindlightCaps") << "No longer in the region where data was sent (currently " @@ -185,7 +192,7 @@ bool LLEnvironmentApply::initiateRequest(const LLSD& content) } else { - LL_WARNS("WindlightCaps") << "Region couldn't apply windlight settings! Reason from sim: " << content["fail_reason"].asString() << LL_ENDL; + LL_WARNS("WindlightCaps") << "Region couldn't apply windlight settings! " << dumpResponse() << LL_ENDL; LLSD args(LLSD::emptyMap()); args["FAIL_REASON"] = content["fail_reason"].asString(); LLNotificationsUtil::add("WLRegionApplyFail", args); @@ -193,14 +200,14 @@ bool LLEnvironmentApply::initiateRequest(const LLSD& content) } } /*virtual*/ -void LLEnvironmentApplyResponder::errorWithContent(U32 status, const std::string& reason, const LLSD& content) +void LLEnvironmentApplyResponder::httpFailure() { - LL_WARNS("WindlightCaps") << "Couldn't apply windlight settings to region! [status:" - << status << "]: " << content << LL_ENDL; + LL_WARNS("WindlightCaps") << "Couldn't apply windlight settings to region! " + << dumpResponse() << LL_ENDL; LLSD args(LLSD::emptyMap()); std::stringstream msg; - msg << reason << " (Code " << status << ")"; + msg << getReason() << " (Code " << getStatus() << ")"; args["FAIL_REASON"] = msg.str(); LLNotificationsUtil::add("WLRegionApplyFail", args); } diff --git a/indra/newview/llwlhandlers.h b/indra/newview/llwlhandlers.h index 598ce6d52a..089c799da7 100644 --- a/indra/newview/llwlhandlers.h +++ b/indra/newview/llwlhandlers.h @@ -45,9 +45,9 @@ private: class LLEnvironmentRequestResponder: public LLHTTPClient::Responder { LOG_CLASS(LLEnvironmentRequestResponder); -public: - virtual void result(const LLSD& content); - virtual void errorWithContent(U32 status, const std::string& reason, const LLSD& content); +private: + /* virtual */ void httpSuccess(); + /* virtual */ void httpFailure(); private: friend class LLEnvironmentRequest; @@ -72,7 +72,7 @@ private: class LLEnvironmentApplyResponder: public LLHTTPClient::Responder { LOG_CLASS(LLEnvironmentApplyResponder); -public: +private: /* * Expecting reply from sim in form of: * { @@ -87,10 +87,10 @@ public: * fail_reason : string * } */ - virtual void result(const LLSD& content); + /* virtual */ void httpSuccess(); - // non-200 errors only - virtual void errorWithContent(U32 status, const std::string& reason, const LLSD& content); + // non-2xx errors only + /* virtual */ void httpFailure(); private: friend class LLEnvironmentApply; diff --git a/indra/newview/llxmlrpctransaction.cpp b/indra/newview/llxmlrpctransaction.cpp index 0da70d398b..604e08161e 100644 --- a/indra/newview/llxmlrpctransaction.cpp +++ b/indra/newview/llxmlrpctransaction.cpp @@ -331,7 +331,7 @@ void LLXMLRPCTransaction::Impl::init(XMLRPC_REQUEST request, bool useGzip) This might help with bug #503 */ mCurlRequest->setopt(CURLOPT_DNS_CACHE_TIMEOUT, -1); - mCurlRequest->slist_append("Content-Type: text/xml"); + mCurlRequest->slist_append(HTTP_HEADER_CONTENT_TYPE, HTTP_CONTENT_TEXT_XML); if (useGzip) { diff --git a/indra/newview/tests/llmediadataclient_test.cpp b/indra/newview/tests/llmediadataclient_test.cpp index 41cb344808..01195d1269 100644 --- a/indra/newview/tests/llmediadataclient_test.cpp +++ b/indra/newview/tests/llmediadataclient_test.cpp @@ -33,7 +33,7 @@ #include "llsdserialize.h" #include "llsdutil.h" #include "llerrorcontrol.h" -#include "llhttpstatuscodes.h" +#include "llhttpconstants.h" #include "../llmediadataclient.h" #include "../llvovolume.h" @@ -128,7 +128,7 @@ void LLHTTPClient::post( { LLSD content; content["reason"] = "fake reason"; - responder->errorWithContent(HTTP_SERVICE_UNAVAILABLE, "fake reason", content); + responder->failureResult(HTTP_SERVICE_UNAVAILABLE, "fake reason", content); return; } else if (url == FAKE_OBJECT_MEDIA_NAVIGATE_CAP_URL_ERROR) @@ -136,8 +136,8 @@ void LLHTTPClient::post( LLSD error; error["code"] = LLObjectMediaNavigateClient::ERROR_PERMISSION_DENIED_CODE; result["error"] = error; - } - responder->result(result); + } + responder->successResult(result); } const F32 HTTP_REQUEST_EXPIRY_SECS = 60.0f; diff --git a/indra/newview/tests/llremoteparcelrequest_test.cpp b/indra/newview/tests/llremoteparcelrequest_test.cpp index ed66066b0a..c49b0350e9 100644 --- a/indra/newview/tests/llremoteparcelrequest_test.cpp +++ b/indra/newview/tests/llremoteparcelrequest_test.cpp @@ -40,12 +40,14 @@ namespace { LLCurl::Responder::Responder() { } LLCurl::Responder::~Responder() { } -void LLCurl::Responder::error(U32,std::string const &) { } -void LLCurl::Responder::result(LLSD const &) { } -void LLCurl::Responder::errorWithContent(U32 status,std::string const &,LLSD const &) { } -void LLCurl::Responder::completedRaw(U32 status, std::string const &, LLChannelDescriptors const &,boost::shared_ptr<LLBufferArray> const &) { } -void LLCurl::Responder::completed(U32 status, std::string const &, LLSD const &) { } -void LLCurl::Responder::completedHeader(U32 status, std::string const &, LLSD const &) { } +void LLCurl::Responder::httpFailure() { } +void LLCurl::Responder::httpSuccess() { } +void LLCurl::Responder::httpCompleted() { } +void LLCurl::Responder::failureResult(S32 status, const std::string& reason, const LLSD& content) { } +void LLCurl::Responder::successResult(const LLSD& content) { } +void LLCurl::Responder::completeResult(S32 status, const std::string& reason, const LLSD& content) { } +std::string LLCurl::Responder::dumpResponse() const { return "(failure)"; } +void LLCurl::Responder::completedRaw(LLChannelDescriptors const &,boost::shared_ptr<LLBufferArray> const &) { } void LLMessageSystem::getF32(char const *,char const *,F32 &,S32) { } void LLMessageSystem::getU8(char const *,char const *,U8 &,S32) { } void LLMessageSystem::getS32(char const *,char const *,S32 &,S32) { } @@ -85,7 +87,7 @@ namespace tut virtual void setParcelID(const LLUUID& parcel_id) { } - virtual void setErrorStatus(U32 status, const std::string& reason) { } + virtual void setErrorStatus(S32 status, const std::string& reason) { } bool mProcessed; }; diff --git a/indra/newview/tests/lltranslate_test.cpp b/indra/newview/tests/lltranslate_test.cpp index fd9527d631..b28eb5db43 100644 --- a/indra/newview/tests/lltranslate_test.cpp +++ b/indra/newview/tests/lltranslate_test.cpp @@ -34,6 +34,8 @@ #include "lltrans.h" #include "llui.h" +#include "../../llmessage/llhttpconstants.cpp" + static const std::string GOOGLE_VALID_RESPONSE1 = "{\ \"data\": {\ @@ -300,12 +302,10 @@ std::string LLControlGroup::getString(const std::string& name) { return "dummy"; LLControlGroup::~LLControlGroup() {} LLCurl::Responder::Responder() {} -void LLCurl::Responder::completedHeader(U32, std::string const&, LLSD const&) {} -void LLCurl::Responder::completedRaw(U32, const std::string&, const LLChannelDescriptors&, const LLIOPipe::buffer_ptr_t& buffer) {} -void LLCurl::Responder::completed(U32, std::string const&, LLSD const&) {} -void LLCurl::Responder::error(U32, std::string const&) {} -void LLCurl::Responder::errorWithContent(U32, std::string const&, LLSD const&) {} -void LLCurl::Responder::result(LLSD const&) {} +void LLCurl::Responder::httpFailure() { } +void LLCurl::Responder::httpSuccess() { } +void LLCurl::Responder::httpCompleted() { } +void LLCurl::Responder::completedRaw(LLChannelDescriptors const &,boost::shared_ptr<LLBufferArray> const &) { } LLCurl::Responder::~Responder() {} void LLHTTPClient::get(const std::string&, const LLSD&, ResponderPtr, const LLSD&, const F32) {} -- cgit v1.2.3 From 626cb6319945f6ff8feee2aec862924581a66056 Mon Sep 17 00:00:00 2001 From: Don Kjer <don@lindenlab.com> Date: Tue, 19 Mar 2013 20:19:40 +0000 Subject: Fixing booking issues in inventory background fetching (especially when caps are not resolved) --- indra/newview/llinventorymodelbackgroundfetch.cpp | 64 ++++++++--------------- 1 file changed, 22 insertions(+), 42 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llinventorymodelbackgroundfetch.cpp b/indra/newview/llinventorymodelbackgroundfetch.cpp index e1537033f9..01b0e647a9 100644 --- a/indra/newview/llinventorymodelbackgroundfetch.cpp +++ b/indra/newview/llinventorymodelbackgroundfetch.cpp @@ -1,6 +1,6 @@ /** - * @file llinventorymodel.cpp - * @brief Implementation of the inventory model used to track agent inventory. + * @file llinventorymodelbackgroundfetch.cpp + * @brief Implementation of background fetching of inventory. * * $LicenseInfo:firstyear=2002&license=viewerlgpl$ * Second Life Viewer Source Code @@ -365,25 +365,19 @@ class LLInventoryModelFetchItemResponder : public LLInventoryModel::fetchInvento { LOG_CLASS(LLInventoryModelFetchItemResponder); public: - LLInventoryModelFetchItemResponder(const LLSD& request_sd) : LLInventoryModel::fetchInventoryResponder(request_sd) {}; + LLInventoryModelFetchItemResponder(const LLSD& request_sd) : + LLInventoryModel::fetchInventoryResponder(request_sd) + { + LLInventoryModelBackgroundFetch::instance().incrFetchCount(1); + } private: - /* virtual */ void httpSuccess(); - /* virtual */ void httpFailure(); + /* virtual */ void httpCompleted() + { + LLInventoryModelBackgroundFetch::instance().incrFetchCount(-1); + LLInventoryModel::fetchInventoryResponder::httpCompleted(); + } }; -void LLInventoryModelFetchItemResponder::httpSuccess() -{ - LLInventoryModel::fetchInventoryResponder::httpSuccess(); - LLInventoryModelBackgroundFetch::instance().incrFetchCount(-1); -} - -void LLInventoryModelFetchItemResponder::httpFailure() -{ - LLInventoryModel::fetchInventoryResponder::httpFailure(); - LLInventoryModelBackgroundFetch::instance().incrFetchCount(-1); -} - - class LLInventoryModelFetchDescendentsResponder: public LLHTTPClient::Responder { LOG_CLASS(LLInventoryModelFetchDescendentsResponder); @@ -391,9 +385,16 @@ public: LLInventoryModelFetchDescendentsResponder(const LLSD& request_sd, uuid_vec_t recursive_cats) : mRequestSD(request_sd), mRecursiveCatUUIDs(recursive_cats) - {}; + { + LLInventoryModelBackgroundFetch::instance().incrFetchCount(1); + } //LLInventoryModelFetchDescendentsResponder() {}; private: + /* virtual */ void httpCompleted() + { + LLInventoryModelBackgroundFetch::instance().incrFetchCount(-1); + LLHTTPClient::Responder::httpCompleted(); + } /* virtual */ void httpSuccess(); /* virtual */ void httpFailure(); protected: @@ -527,8 +528,6 @@ void LLInventoryModelFetchDescendentsResponder::httpSuccess() << "Error: " << folder_sd["error"].asString() << llendl; } } - - fetcher->incrFetchCount(-1); if (fetcher->isBulkFetchProcessingComplete()) { @@ -545,8 +544,6 @@ void LLInventoryModelFetchDescendentsResponder::httpFailure() llwarns << dumpResponse() << llendl; LLInventoryModelBackgroundFetch *fetcher = LLInventoryModelBackgroundFetch::getInstance(); - fetcher->incrFetchCount(-1); - if (getStatus()==HTTP_INTERNAL_ERROR) // timed out or curl failure { for(LLSD::array_const_iterator folder_it = mRequestSD["folders"].beginArray(); @@ -595,7 +592,7 @@ void LLInventoryModelBackgroundFetch::bulkFetch() (mFetchTimer.getElapsedTimeF32() < mMinTimeBetweenFetches)) { return; // just bail if we are disconnected - } + } U32 item_count=0; U32 folder_count=0; @@ -698,7 +695,6 @@ void LLInventoryModelBackgroundFetch::bulkFetch() std::string url = region->getCapability("FetchInventoryDescendents2"); if ( !url.empty() ) { - mFetchCount++; if (folder_request_body["folders"].size()) { LLInventoryModelFetchDescendentsResponder *fetcher = new LLInventoryModelFetchDescendentsResponder(folder_request_body, recursive_cats); @@ -711,7 +707,7 @@ void LLInventoryModelBackgroundFetch::bulkFetch() LLInventoryModelFetchDescendentsResponder *fetcher = new LLInventoryModelFetchDescendentsResponder(folder_request_body_lib, recursive_cats); LLHTTPClient::post(url_lib, folder_request_body_lib, fetcher, 300.0); } - } + } } if (item_count) { @@ -719,39 +715,23 @@ void LLInventoryModelBackgroundFetch::bulkFetch() if (item_request_body.size()) { - mFetchCount++; url = region->getCapability("FetchInventory2"); if (!url.empty()) { LLSD body; - body["agent_id"] = gAgent.getID(); body["items"] = item_request_body; LLHTTPClient::post(url, body, new LLInventoryModelFetchItemResponder(body)); } - //else - //{ - // LLMessageSystem* msg = gMessageSystem; - // msg->newMessage("FetchInventory"); - // msg->nextBlock("AgentData"); - // msg->addUUID("AgentID", gAgent.getID()); - // msg->addUUID("SessionID", gAgent.getSessionID()); - // msg->nextBlock("InventoryData"); - // msg->addUUID("OwnerID", mPermissions.getOwner()); - // msg->addUUID("ItemID", mUUID); - // gAgent.sendReliableMessage(); - //} } if (item_request_body_lib.size()) { - mFetchCount++; url = region->getCapability("FetchLib2"); if (!url.empty()) { LLSD body; - body["agent_id"] = gAgent.getID(); body["items"] = item_request_body_lib; LLHTTPClient::post(url, body, new LLInventoryModelFetchItemResponder(body)); -- cgit v1.2.3 From cfd35b8b22e8043ab14c57f6ee6108cea471a1ab Mon Sep 17 00:00:00 2001 From: Logan Dethrow <log@lindenlab.com> Date: Thu, 28 Mar 2013 18:07:54 -0400 Subject: Made a bug that was masking the warning about mismatched caps coming from a region. They could never match because certain capabilities are explicitly not stored when we receive them. * Made mSecondCapabilitiesTracker set capabilities in a way that more closely matches mCapabilities so that they will match up when we get a second cap grant from a region if the caps that were sent are actually the same. * Added more logging around setting a region's seed capability. * Also added a static function in llviewerregion to dump out a CapabilityMap based on the logActiveCapabilities method. Defined the old method in terms of the new static free function. --- indra/newview/app_settings/logcontrol.xml | 4 +- indra/newview/llstartup.cpp | 2 + indra/newview/llviewermessage.cpp | 5 ++ indra/newview/llviewerregion.cpp | 81 +++++++++++++++++++++++-------- indra/newview/llworld.cpp | 2 + 5 files changed, 70 insertions(+), 24 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/logcontrol.xml b/indra/newview/app_settings/logcontrol.xml index c5561166fc..04b3c81602 100644 --- a/indra/newview/app_settings/logcontrol.xml +++ b/indra/newview/app_settings/logcontrol.xml @@ -43,9 +43,7 @@ <key>tags</key> <array> <string>Avatar</string> - <!-- sample entry for debugging specific items - <string>Voice</string> - --> + <string>CrossingCaps</string> </array> </map> </array> diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 8b71f1067f..e4627b132f 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -1279,6 +1279,8 @@ bool idle_startup() LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(gFirstSimHandle); LL_INFOS("AppInit") << "Adding initial simulator " << regionp->getOriginGlobal() << LL_ENDL; + LL_DEBUGS("CrossingCaps") << "Calling setSeedCapability from init_idle(). Seed cap == " + << gFirstSimSeedCap << LL_ENDL; regionp->setSeedCapability(gFirstSimSeedCap); LL_DEBUGS("AppInit") << "Waiting for seed grant ...." << LL_ENDL; display_startup(); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index f167bd14d8..0178982d45 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -3922,6 +3922,8 @@ void process_teleport_finish(LLMessageSystem* msg, void**) gAgent.setTeleportState( LLAgent::TELEPORT_MOVING ); gAgent.setTeleportMessage(LLAgent::sTeleportProgressMessages["contacting"]); + LL_DEBUGS("CrossingCaps") << "Calling setSeedCapability from process_teleport_finish(). Seed cap == " + << seedCap << LL_ENDL; regionp->setSeedCapability(seedCap); // Don't send camera updates to the new region until we're @@ -4176,6 +4178,9 @@ void process_crossed_region(LLMessageSystem* msg, void**) send_complete_agent_movement(sim_host); LLViewerRegion* regionp = LLWorld::getInstance()->addRegion(region_handle, sim_host); + + LL_DEBUGS("CrossingCaps") << "Calling setSeedCapability from process_crossed_region(). Seed cap == " + << seedCap << LL_ENDL; regionp->setSeedCapability(seedCap); } diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 2286bb09e1..223f754c2e 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -87,6 +87,8 @@ const S32 MAX_CAP_REQUEST_ATTEMPTS = 30; typedef std::map<std::string, std::string> CapabilityMap; +static void logCapabilities(const CapabilityMap &capmap); + class LLViewerRegionImpl { public: LLViewerRegionImpl(LLViewerRegion * region, LLHost const & host) @@ -321,17 +323,36 @@ private: if ( regionp->getRegionImpl()->mCapabilities.size() != regionp->getRegionImpl()->mSecondCapabilitiesTracker.size() ) { LL_WARNS2("AppInit", "Capabilities") - << "Sim sent duplicate seed caps that differs in size - most likely content." << LL_ENDL; - //todo#add cap debug versus original check? - /*CapabilityMap::const_iterator iter = regionp->getRegionImpl()->mCapabilities.begin(); - while (iter!=regionp->getRegionImpl()->mCapabilities.end() ) - { - llinfos<<"BaseCapabilitiesCompleteTracker Original "<<iter->first<<" "<< iter->second<<llendl; - ++iter; - } - */ + << "Sim sent duplicate base caps that differ in size from what we initially received - most likely content. " + << "mCapabilities == " << regionp->getRegionImpl()->mCapabilities.size() + << " mSecondCapabilitiesTracker == " << regionp->getRegionImpl()->mSecondCapabilitiesTracker.size() + << LL_ENDL; + + //LL_WARNS2("AppInit", "Capabilities") + // << "Initial Base capabilities: " << LL_ENDL; + + //logCapabilities(regionp->getRegionImpl()->mCapabilities); + + //LL_WARNS2("AppInit", "Capabilities") + // << "Latest base capabilities: " << LL_ENDL; + + //logCapabilities(regionp->getRegionImpl()->mSecondCapabilitiesTracker); + + // *TODO + //add cap debug versus original check? + //CapabilityMap::const_iterator iter = regionp->getRegionImpl()->mCapabilities.begin(); + //while (iter!=regionp->getRegionImpl()->mCapabilities.end() ) + //{ + // llinfos<<"BaseCapabilitiesCompleteTracker Original "<<iter->first<<" "<< iter->second<<llendl; + // ++iter; + //} + regionp->getRegionImplNC()->mSecondCapabilitiesTracker.clear(); } + else + { + LL_DEBUGS("CrossingCaps") << "Sim sent multiple base cap grants with matching sizes." << LL_ENDL; + } } @@ -1671,7 +1692,9 @@ void LLViewerRegion::setSeedCapability(const std::string& url) { if (getCapability("Seed") == url) { - //llwarns << "Ignoring duplicate seed capability" << llendl; + setCapabilityDebug("Seed", url); + LL_DEBUGS("CrossingCaps") << "Received duplicate seed capability, posting to seed " << + url << llendl; //Instead of just returning we build up a second set of seed caps and compare them //to the "original" seed cap received and determine why there is problem! LLSD capabilityNames = LLSD::emptyArray(); @@ -1821,7 +1844,16 @@ void LLViewerRegion::setCapability(const std::string& name, const std::string& u void LLViewerRegion::setCapabilityDebug(const std::string& name, const std::string& url) { - mImpl->mSecondCapabilitiesTracker[name] = url; + // Continue to not add certain caps, as we do in setCapability. This is so they match up when we check them later. + if ( ! ( name == "EventQueueGet" || name == "UntrustedSimulatorMessage" || name == "SimulatorFeatures" ) ) + { + mImpl->mSecondCapabilitiesTracker[name] = url; + if(name == "GetTexture") + { + mHttpUrl = url ; + } + } + } bool LLViewerRegion::isSpecialCapabilityName(const std::string &name) @@ -1872,16 +1904,7 @@ boost::signals2::connection LLViewerRegion::setCapabilitiesReceivedCallback(cons void LLViewerRegion::logActiveCapabilities() const { - int count = 0; - CapabilityMap::const_iterator iter; - for (iter = mImpl->mCapabilities.begin(); iter != mImpl->mCapabilities.end(); ++iter, ++count) - { - if (!iter->second.empty()) - { - llinfos << iter->first << " URL is " << iter->second << llendl; - } - } - llinfos << "Dumped " << count << " entries." << llendl; + logCapabilities(mImpl->mCapabilities); } LLSpatialPartition* LLViewerRegion::getSpatialPartition(U32 type) @@ -1965,3 +1988,19 @@ bool LLViewerRegion::dynamicPathfindingEnabled() const mSimulatorFeatures["DynamicPathfindingEnabled"].asBoolean()); } +/* Static Functions */ + +void logCapabilities(const CapabilityMap &capmap) +{ + S32 count = 0; + CapabilityMap::const_iterator iter; + for (iter = capmap.begin(); iter != capmap.end(); ++iter, ++count) + { + if (!iter->second.empty()) + { + llinfos << "logCapabilities: " << iter->first << " URL is " << iter->second << llendl; + } + } + llinfos << "logCapabilities: Dumped " << count << " entries." << llendl; +} + diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index 793becf0c8..d9da639af9 100644 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -1065,6 +1065,8 @@ public: << sim << llendl; return; } + LL_DEBUGS("CrossingCaps") << "Calling setSeedCapability from LLEstablishAgentCommunication::post. Seed cap == " + << input["body"]["seed-capability"] << LL_ENDL; regionp->setSeedCapability(input["body"]["seed-capability"]); } }; -- cgit v1.2.3 From 298660a5f15e08ef00c240330553f3228db5437f Mon Sep 17 00:00:00 2001 From: Logan Dethrow <log@lindenlab.com> Date: Mon, 1 Apr 2013 11:59:27 -0400 Subject: Backed out accidentally committed change to logcontrol.xml. --- indra/newview/app_settings/logcontrol.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/logcontrol.xml b/indra/newview/app_settings/logcontrol.xml index 04b3c81602..c5561166fc 100644 --- a/indra/newview/app_settings/logcontrol.xml +++ b/indra/newview/app_settings/logcontrol.xml @@ -43,7 +43,9 @@ <key>tags</key> <array> <string>Avatar</string> - <string>CrossingCaps</string> + <!-- sample entry for debugging specific items + <string>Voice</string> + --> </array> </map> </array> -- cgit v1.2.3 From 9927963ac9d7ef19db96e8d5ffa04c04d0e3b803 Mon Sep 17 00:00:00 2001 From: Logan Dethrow <log@lindenlab.com> Date: Mon, 1 Apr 2013 20:10:39 -0400 Subject: If we get more caps from a subsequent grant for a region, go ahead and use them. This is a hack that should be safe to remove after SH-3895 is fixed everywhere on the sim side. --- indra/newview/llviewerregion.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 223f754c2e..f4b6ff318b 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -347,12 +347,23 @@ private: // ++iter; //} - regionp->getRegionImplNC()->mSecondCapabilitiesTracker.clear(); + if (regionp->getRegionImpl()->mSecondCapabilitiesTracker.size() > regionp->getRegionImpl()->mCapabilities.size() ) + { + // *HACK Since we were granted more base capabilities in this grant request than the initial, replace + // the old with the new. This shouldn't happen i.e. we should always get the same capabilities from a + // sim. The simulator fix from SH-3895 should prevent it from happening, at least in the case of the + // inventory api capability grants. + + // Need to clear a std::map before copying into it because old keys take precedence. + regionp->getRegionImplNC()->mCapabilities.clear(); + regionp->getRegionImplNC()->mCapabilities = regionp->getRegionImpl()->mSecondCapabilitiesTracker; + } } else { LL_DEBUGS("CrossingCaps") << "Sim sent multiple base cap grants with matching sizes." << LL_ENDL; } + regionp->getRegionImplNC()->mSecondCapabilitiesTracker.clear(); } -- cgit v1.2.3 From 557adcabb925acbcc79f39f76f7cb74b6202a8da Mon Sep 17 00:00:00 2001 From: Logan Dethrow <log@lindenlab.com> Date: Tue, 2 Apr 2013 19:51:45 +0000 Subject: Renamed logCapabilites static function to log_capabilities in llviewerregion.cpp to better match coding standard. --- indra/newview/llviewerregion.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index f4b6ff318b..f0d81c599c 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -87,7 +87,7 @@ const S32 MAX_CAP_REQUEST_ATTEMPTS = 30; typedef std::map<std::string, std::string> CapabilityMap; -static void logCapabilities(const CapabilityMap &capmap); +static void log_capabilities(const CapabilityMap &capmap); class LLViewerRegionImpl { public: @@ -331,12 +331,12 @@ private: //LL_WARNS2("AppInit", "Capabilities") // << "Initial Base capabilities: " << LL_ENDL; - //logCapabilities(regionp->getRegionImpl()->mCapabilities); + //log_capabilities(regionp->getRegionImpl()->mCapabilities); //LL_WARNS2("AppInit", "Capabilities") // << "Latest base capabilities: " << LL_ENDL; - //logCapabilities(regionp->getRegionImpl()->mSecondCapabilitiesTracker); + //log_capabilities(regionp->getRegionImpl()->mSecondCapabilitiesTracker); // *TODO //add cap debug versus original check? @@ -1915,7 +1915,7 @@ boost::signals2::connection LLViewerRegion::setCapabilitiesReceivedCallback(cons void LLViewerRegion::logActiveCapabilities() const { - logCapabilities(mImpl->mCapabilities); + log_capabilities(mImpl->mCapabilities); } LLSpatialPartition* LLViewerRegion::getSpatialPartition(U32 type) @@ -2001,7 +2001,7 @@ bool LLViewerRegion::dynamicPathfindingEnabled() const /* Static Functions */ -void logCapabilities(const CapabilityMap &capmap) +void log_capabilities(const CapabilityMap &capmap) { S32 count = 0; CapabilityMap::const_iterator iter; @@ -2009,9 +2009,9 @@ void logCapabilities(const CapabilityMap &capmap) { if (!iter->second.empty()) { - llinfos << "logCapabilities: " << iter->first << " URL is " << iter->second << llendl; + llinfos << "log_capabilities: " << iter->first << " URL is " << iter->second << llendl; } } - llinfos << "logCapabilities: Dumped " << count << " entries." << llendl; + llinfos << "log_capabilities: Dumped " << count << " entries." << llendl; } -- cgit v1.2.3 From beeefb45269f45ea717f58b30a0985951ae23c20 Mon Sep 17 00:00:00 2001 From: Don Kjer <don@lindenlab.com> Date: Thu, 4 Apr 2013 21:50:45 +0000 Subject: Renaming HTTP_HEADER_* into HTTP_IN_HEADER_* and HTTP_OUT_HEADER_* to make it more clear which header strings should be used for incoming vs outgoing situations. Using constants for commonly used llhttpnode context strings. --- indra/newview/llappearancemgr.cpp | 4 +- indra/newview/llfloaterabout.cpp | 3 +- indra/newview/llfloaterurlentry.cpp | 3 +- indra/newview/llmarketplacefunctions.cpp | 23 +++++------ indra/newview/llmediadataclient.cpp | 4 +- indra/newview/llmeshrepository.cpp | 10 ++--- indra/newview/lltexturefetch.cpp | 6 +-- indra/newview/lltranslate.cpp | 4 +- indra/newview/llviewerdisplayname.cpp | 2 +- indra/newview/llviewermedia.cpp | 34 +++++++--------- indra/newview/llwebprofile.cpp | 11 +++-- indra/newview/llwebsharing.cpp | 69 +++++++++++++++++++++----------- indra/newview/llxmlrpctransaction.cpp | 2 +- 13 files changed, 94 insertions(+), 81 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 43439bac5d..0b85f438bd 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -3008,8 +3008,8 @@ public: #if 0 // *TODO: Honor server Retry-After header. // Status 503 may ask us to wait for a certain amount of time before retrying. - if (!headers.has(HTTP_HEADER_RETRY_AFTER) - || !getSecondsUntilRetryAfter(headers[HTTP_HEADER_RETRY_AFTER].asStringRef(), seconds_to_wait)) + if (!headers.has(HTTP_IN_HEADER_RETRY_AFTER) + || !getSecondsUntilRetryAfter(headers[HTTP_IN_HEADER_RETRY_AFTER].asStringRef(), seconds_to_wait)) #endif { seconds_to_wait = mDelay; diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp index 63888ace11..801a24f472 100644 --- a/indra/newview/llfloaterabout.cpp +++ b/indra/newview/llfloaterabout.cpp @@ -474,8 +474,7 @@ void LLServerReleaseNotesURLFetcher::httpCompleted() LLFloaterAbout* floater_about = LLFloaterReg::getTypedInstance<LLFloaterAbout>("sl_about"); if (floater_about) { - const bool check_lower = true; - const std::string& location = getResponseHeader(HTTP_HEADER_LOCATION, check_lower); + const std::string& location = getResponseHeader(HTTP_IN_HEADER_LOCATION); if (location.empty()) { LL_WARNS("ServerReleaseNotes") << "Missing Location header " diff --git a/indra/newview/llfloaterurlentry.cpp b/indra/newview/llfloaterurlentry.cpp index 0751c830d5..e26f1e9ea5 100644 --- a/indra/newview/llfloaterurlentry.cpp +++ b/indra/newview/llfloaterurlentry.cpp @@ -59,8 +59,7 @@ public: private: /* virtual */ void httpCompleted() { - const bool check_lower = true; - const std::string& media_type = getResponseHeader(HTTP_HEADER_CONTENT_TYPE, check_lower); + const std::string& media_type = getResponseHeader(HTTP_IN_HEADER_CONTENT_TYPE); std::string::size_type idx1 = media_type.find_first_of(";"); std::string mime_type = media_type.substr(0, idx1); diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp index bea1d62b93..28e1df725a 100644 --- a/indra/newview/llmarketplacefunctions.cpp +++ b/indra/newview/llmarketplacefunctions.cpp @@ -167,8 +167,7 @@ namespace LLMarketplaceImport protected: /* virtual */ void httpCompleted() { - const bool check_lower = true; - const std::string& set_cookie_string = getResponseHeader(HTTP_HEADER_SET_COOKIE, check_lower); + const std::string& set_cookie_string = getResponseHeader(HTTP_IN_HEADER_SET_COOKIE); if (!set_cookie_string.empty()) { @@ -278,10 +277,11 @@ namespace LLMarketplaceImport // Make the headers for the post LLSD headers = LLSD::emptyMap(); - headers[HTTP_HEADER_ACCEPT] = "*/*"; - headers[HTTP_HEADER_COOKIE] = sMarketplaceCookie; - headers[HTTP_HEADER_CONTENT_TYPE] = HTTP_CONTENT_LLSD_XML; - headers[HTTP_HEADER_USER_AGENT] = LLViewerMedia::getCurrentUserAgent(); + headers[HTTP_OUT_HEADER_ACCEPT] = "*/*"; + headers[HTTP_OUT_HEADER_COOKIE] = sMarketplaceCookie; + // *TODO: Why are we setting Content-Type for a GET request? + headers[HTTP_OUT_HEADER_CONTENT_TYPE] = HTTP_CONTENT_LLSD_XML; + headers[HTTP_OUT_HEADER_USER_AGENT] = LLViewerMedia::getCurrentUserAgent(); if (gSavedSettings.getBOOL("InventoryOutboxLogging")) { @@ -311,12 +311,11 @@ namespace LLMarketplaceImport // Make the headers for the post LLSD headers = LLSD::emptyMap(); - headers[HTTP_HEADER_ACCEPT] = "*/*"; - headers[HTTP_HEADER_CONNECTION] = "Keep-Alive"; - headers[HTTP_HEADER_COOKIE] = sMarketplaceCookie; - // *TODO: Should this be 'application/llsd+xml'? - headers[HTTP_HEADER_CONTENT_TYPE] = HTTP_CONTENT_XML; - headers[HTTP_HEADER_USER_AGENT] = LLViewerMedia::getCurrentUserAgent(); + headers[HTTP_OUT_HEADER_ACCEPT] = "*/*"; + headers[HTTP_OUT_HEADER_CONNECTION] = "Keep-Alive"; + headers[HTTP_OUT_HEADER_COOKIE] = sMarketplaceCookie; + headers[HTTP_OUT_HEADER_CONTENT_TYPE] = HTTP_CONTENT_XML; + headers[HTTP_OUT_HEADER_USER_AGENT] = LLViewerMedia::getCurrentUserAgent(); if (gSavedSettings.getBOOL("InventoryOutboxLogging")) { diff --git a/indra/newview/llmediadataclient.cpp b/indra/newview/llmediadataclient.cpp index bc1aa087e5..691be13610 100644 --- a/indra/newview/llmediadataclient.cpp +++ b/indra/newview/llmediadataclient.cpp @@ -579,8 +579,8 @@ void LLMediaDataClient::Responder::httpFailure() F32 retry_timeout; #if 0 // *TODO: Honor server Retry-After header. - if (!hasResponseHeader(HTTP_HEADER_RETRY_AFTER) - || !getSecondsUntilRetryAfter(getResponseHeader(HTTP_HEADER_RETRY_AFTER), retry_timeout)) + if (!hasResponseHeader(HTTP_IN_HEADER_RETRY_AFTER) + || !getSecondsUntilRetryAfter(getResponseHeader(HTTP_IN_HEADER_RETRY_AFTER), retry_timeout)) #endif { retry_timeout = mRequest->getRetryTimerDelay(); diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 1469dbc346..524467a37e 100755 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -808,7 +808,7 @@ bool LLMeshRepoThread::fetchMeshSkinInfo(const LLUUID& mesh_id) //reading from VFS failed for whatever reason, fetch from sim std::vector<std::string> headers; - headers.push_back(HTTP_HEADER_ACCEPT + ": " + HTTP_CONTENT_OCTET_STREAM); + headers.push_back(HTTP_OUT_HEADER_ACCEPT + ": " + HTTP_CONTENT_OCTET_STREAM); std::string http_url = constructUrl(mesh_id); if (!http_url.empty()) @@ -890,7 +890,7 @@ bool LLMeshRepoThread::fetchMeshDecomposition(const LLUUID& mesh_id) //reading from VFS failed for whatever reason, fetch from sim std::vector<std::string> headers; - headers.push_back(HTTP_HEADER_ACCEPT + ": " + HTTP_CONTENT_OCTET_STREAM); + headers.push_back(HTTP_OUT_HEADER_ACCEPT + ": " + HTTP_CONTENT_OCTET_STREAM); std::string http_url = constructUrl(mesh_id); if (!http_url.empty()) @@ -971,7 +971,7 @@ bool LLMeshRepoThread::fetchMeshPhysicsShape(const LLUUID& mesh_id) //reading from VFS failed for whatever reason, fetch from sim std::vector<std::string> headers; - headers.push_back(HTTP_HEADER_ACCEPT + ": " + HTTP_CONTENT_OCTET_STREAM); + headers.push_back(HTTP_OUT_HEADER_ACCEPT + ": " + HTTP_CONTENT_OCTET_STREAM); std::string http_url = constructUrl(mesh_id); if (!http_url.empty()) @@ -1052,7 +1052,7 @@ bool LLMeshRepoThread::fetchMeshHeader(const LLVolumeParams& mesh_params, U32& c //either cache entry doesn't exist or is corrupt, request header from simulator bool retval = true ; std::vector<std::string> headers; - headers.push_back(HTTP_HEADER_ACCEPT + ": " + HTTP_CONTENT_OCTET_STREAM); + headers.push_back(HTTP_OUT_HEADER_ACCEPT + ": " + HTTP_CONTENT_OCTET_STREAM); std::string http_url = constructUrl(mesh_params.getSculptID()); if (!http_url.empty()) @@ -1127,7 +1127,7 @@ bool LLMeshRepoThread::fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod, //reading from VFS failed for whatever reason, fetch from sim std::vector<std::string> headers; - headers.push_back(HTTP_HEADER_ACCEPT + ": " + HTTP_CONTENT_OCTET_STREAM); + headers.push_back(HTTP_OUT_HEADER_ACCEPT + ": " + HTTP_CONTENT_OCTET_STREAM); std::string http_url = constructUrl(mesh_id); if (!http_url.empty()) diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 9e9efa7ebd..cc6dc64626 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -2408,9 +2408,9 @@ LLTextureFetch::LLTextureFetch(LLTextureCache* cache, LLImageDecodeThread* image mHttpOptions = new LLCore::HttpOptions; mHttpHeaders = new LLCore::HttpHeaders; // *TODO: Should this be 'image/j2c' instead of 'image/x-j2c' ? - mHttpHeaders->mHeaders.push_back(HTTP_HEADER_ACCEPT + ": " + HTTP_CONTENT_IMAGE_X_J2C); + mHttpHeaders->mHeaders.push_back(HTTP_OUT_HEADER_ACCEPT + ": " + HTTP_CONTENT_IMAGE_X_J2C); mHttpMetricsHeaders = new LLCore::HttpHeaders; - mHttpMetricsHeaders->mHeaders.push_back(HTTP_HEADER_CONTENT_TYPE + ": " + HTTP_CONTENT_LLSD_XML); + mHttpMetricsHeaders->mHeaders.push_back(HTTP_OUT_HEADER_CONTENT_TYPE + ": " + HTTP_CONTENT_LLSD_XML); mHttpPolicyClass = LLAppViewer::instance()->getAppCoreHttp().getPolicyDefault(); } @@ -4043,7 +4043,7 @@ void LLTextureFetchDebugger::init() { mHttpHeaders = new LLCore::HttpHeaders; // *TODO: Should this be 'image/j2c' instead of 'image/x-j2c' ? - mHttpHeaders->mHeaders.push_back(HTTP_HEADER_ACCEPT + ": " + HTTP_CONTENT_IMAGE_X_J2C); + mHttpHeaders->mHeaders.push_back(HTTP_OUT_HEADER_ACCEPT + ": " + HTTP_CONTENT_IMAGE_X_J2C); } } diff --git a/indra/newview/lltranslate.cpp b/indra/newview/lltranslate.cpp index b9840fa3e4..ae934d9f5a 100755 --- a/indra/newview/lltranslate.cpp +++ b/indra/newview/lltranslate.cpp @@ -394,8 +394,8 @@ void LLTranslate::sendRequest(const std::string& url, LLHTTPClient::ResponderPtr LLVersionInfo::getPatch(), LLVersionInfo::getBuild()); - sHeader.insert(HTTP_HEADER_ACCEPT, HTTP_CONTENT_TEXT_PLAIN); - sHeader.insert(HTTP_HEADER_USER_AGENT, user_agent); + sHeader.insert(HTTP_OUT_HEADER_ACCEPT, HTTP_CONTENT_TEXT_PLAIN); + sHeader.insert(HTTP_OUT_HEADER_USER_AGENT, user_agent); } LLHTTPClient::get(url, responder, sHeader, REQUEST_TIMEOUT); diff --git a/indra/newview/llviewerdisplayname.cpp b/indra/newview/llviewerdisplayname.cpp index 5d94756da3..3f836efdd3 100644 --- a/indra/newview/llviewerdisplayname.cpp +++ b/indra/newview/llviewerdisplayname.cpp @@ -86,7 +86,7 @@ void LLViewerDisplayName::set(const std::string& display_name, const set_name_sl // People API can return localized error messages. Indicate our // language preference via header. LLSD headers; - headers[HTTP_HEADER_ACCEPT_LANGUAGE] = LLUI::getLanguage(); + headers[HTTP_OUT_HEADER_ACCEPT_LANGUAGE] = LLUI::getLanguage(); // People API requires both the old and new value to change a variable. // Our display name will be in cache before the viewer's UI is available diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 8c29a03176..2cec808f19 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -185,8 +185,7 @@ private: llwarns << dumpResponse() << " [headers:" << getResponseHeaders() << "]" << llendl; } - const bool check_lower = true; - const std::string& media_type = getResponseHeader(HTTP_HEADER_CONTENT_TYPE, check_lower); + const std::string& media_type = getResponseHeader(HTTP_IN_HEADER_CONTENT_TYPE); std::string::size_type idx1 = media_type.find_first_of(";"); std::string mime_type = media_type.substr(0, idx1); @@ -289,8 +288,7 @@ public: // We don't care about the content of the response, only the Set-Cookie header. LL_DEBUGS("MediaAuth") << dumpResponse() << " [headers:" << getResponseHeaders() << "]" << LL_ENDL; - const bool check_lower = true; - const std::string& cookie = getResponseHeader(HTTP_HEADER_SET_COOKIE, check_lower); + const std::string& cookie = getResponseHeader(HTTP_IN_HEADER_SET_COOKIE); // *TODO: What about bad status codes? Does this destroy previous cookies? LLViewerMedia::openIDCookieResponse(cookie); @@ -321,12 +319,10 @@ public: LLSD stripped_content = getResponseHeaders(); // *TODO: Check that this works. - stripped_content.erase(HTTP_HEADER_SET_COOKIE); - stripped_content.erase("set-cookie"); + stripped_content.erase(HTTP_IN_HEADER_SET_COOKIE); LL_WARNS("MediaAuth") << stripped_content << LL_ENDL; - const bool check_lower = true; - const std::string& cookie = getResponseHeader(HTTP_HEADER_SET_COOKIE, check_lower); + const std::string& cookie = getResponseHeader(HTTP_IN_HEADER_SET_COOKIE); LL_DEBUGS("MediaAuth") << "cookie = " << cookie << LL_ENDL; // *TODO: What about bad status codes? Does this destroy previous cookies? @@ -1383,12 +1379,12 @@ void LLViewerMedia::removeCookie(const std::string &name, const std::string &dom LLSD LLViewerMedia::getHeaders() { LLSD headers = LLSD::emptyMap(); - headers[HTTP_HEADER_ACCEPT] = "*/*"; + headers[HTTP_OUT_HEADER_ACCEPT] = "*/*"; // *TODO: Should this be 'application/llsd+xml' ? // *TODO: Should this even be set at all? This header is only not overridden in 'GET' methods. - headers[HTTP_HEADER_CONTENT_TYPE] = HTTP_CONTENT_XML; - headers[HTTP_HEADER_COOKIE] = sOpenIDCookie; - headers[HTTP_HEADER_USER_AGENT] = getCurrentUserAgent(); + headers[HTTP_OUT_HEADER_CONTENT_TYPE] = HTTP_CONTENT_XML; + headers[HTTP_OUT_HEADER_COOKIE] = sOpenIDCookie; + headers[HTTP_OUT_HEADER_USER_AGENT] = getCurrentUserAgent(); return headers; } @@ -1429,9 +1425,9 @@ void LLViewerMedia::setOpenIDCookie() // Do a web profile get so we can store the cookie LLSD headers = LLSD::emptyMap(); - headers[HTTP_HEADER_ACCEPT] = "*/*"; - headers[HTTP_HEADER_COOKIE] = sOpenIDCookie; - headers[HTTP_HEADER_USER_AGENT] = getCurrentUserAgent(); + headers[HTTP_OUT_HEADER_ACCEPT] = "*/*"; + headers[HTTP_OUT_HEADER_COOKIE] = sOpenIDCookie; + headers[HTTP_OUT_HEADER_USER_AGENT] = getCurrentUserAgent(); std::string profile_url = getProfileURL(""); LLURL raw_profile_url( profile_url.c_str() ); @@ -1461,9 +1457,9 @@ void LLViewerMedia::openIDSetup(const std::string &openid_url, const std::string LLSD headers = LLSD::emptyMap(); // Keep LLHTTPClient from adding an "Accept: application/llsd+xml" header - headers[HTTP_HEADER_ACCEPT] = "*/*"; + headers[HTTP_OUT_HEADER_ACCEPT] = "*/*"; // and use the expected content-type for a post, instead of the LLHTTPClient::postRaw() default of "application/octet-stream" - headers[HTTP_HEADER_CONTENT_TYPE] = "application/x-www-form-urlencoded"; + headers[HTTP_OUT_HEADER_CONTENT_TYPE] = "application/x-www-form-urlencoded"; // postRaw() takes ownership of the buffer and releases it later, so we need to allocate a new buffer here. size_t size = openid_token.size(); @@ -2631,9 +2627,9 @@ void LLViewerMediaImpl::navigateInternal() // Accept: application/llsd+xml // which is really not what we want. LLSD headers = LLSD::emptyMap(); - headers[HTTP_HEADER_ACCEPT] = "*/*"; + headers[HTTP_OUT_HEADER_ACCEPT] = "*/*"; // Allow cookies in the response, to prevent a redirect loop when accessing join.secondlife.com - headers[HTTP_HEADER_COOKIE] = ""; + headers[HTTP_OUT_HEADER_COOKIE] = ""; LLHTTPClient::getHeaderOnly( mMediaURL, new LLMimeDiscoveryResponder(this), headers, 10.0f); } else if("data" == scheme || "file" == scheme || "about" == scheme) diff --git a/indra/newview/llwebprofile.cpp b/indra/newview/llwebprofile.cpp index ee78ba20cb..567138e160 100644 --- a/indra/newview/llwebprofile.cpp +++ b/indra/newview/llwebprofile.cpp @@ -167,9 +167,8 @@ public: if (getStatus() == HTTP_SEE_OTHER) { LLSD headers = LLViewerMedia::getHeaders(); - headers[HTTP_HEADER_COOKIE] = LLWebProfile::getAuthCookie(); - const bool check_lower=true; - const std::string& redir_url = getResponseHeader(HTTP_HEADER_LOCATION, check_lower); + headers[HTTP_OUT_HEADER_COOKIE] = LLWebProfile::getAuthCookie(); + const std::string& redir_url = getResponseHeader(HTTP_IN_HEADER_LOCATION); if (redir_url.empty()) { llwarns << "Received empty redirection URL " << dumpResponse() << llendl; @@ -207,7 +206,7 @@ void LLWebProfile::uploadImage(LLPointer<LLImageFormatted> image, const std::str LL_DEBUGS("Snapshots") << "Requesting " << config_url << llendl; LLSD headers = LLViewerMedia::getHeaders(); - headers[HTTP_HEADER_COOKIE] = getAuthCookie(); + headers[HTTP_OUT_HEADER_COOKIE] = getAuthCookie(); LLHTTPClient::get(config_url, new LLWebProfileResponders::ConfigResponder(image), headers); } @@ -231,8 +230,8 @@ void LLWebProfile::post(LLPointer<LLImageFormatted> image, const LLSD& config, c const std::string boundary = "----------------------------0123abcdefab"; LLSD headers = LLViewerMedia::getHeaders(); - headers[HTTP_HEADER_COOKIE] = getAuthCookie(); - headers[HTTP_HEADER_CONTENT_TYPE] = "multipart/form-data; boundary=" + boundary; + headers[HTTP_OUT_HEADER_COOKIE] = getAuthCookie(); + headers[HTTP_OUT_HEADER_CONTENT_TYPE] = "multipart/form-data; boundary=" + boundary; std::ostringstream body; diff --git a/indra/newview/llwebsharing.cpp b/indra/newview/llwebsharing.cpp index ba536ac582..7036162014 100644 --- a/indra/newview/llwebsharing.cpp +++ b/indra/newview/llwebsharing.cpp @@ -55,25 +55,47 @@ public: const LLIOPipe::buffer_ptr_t& buffer) { LLBufferStream istr(channels, buffer.get()); + // *TODO: LLSD notation is not actually JSON. LLPointer<LLSDParser> parser = new LLSDNotationParser(); - if (parser->parse(istr, mContent, LLSDSerialize::SIZE_UNLIMITED) == LLSDParser::PARSE_FAILURE) + std::string debug_body("(empty)"); + bool parsed=true; + if (EOF == istr.peek()) { - if (HTTP_CONTENT_JSON == getResponseHeader(HTTP_HEADER_CONTENT_TYPE)) + parsed=false; + } + // Try to parse body as llsd, no matter what 'content-type' says. + else if (parser->parse(istr, mContent, LLSDSerialize::SIZE_UNLIMITED) == LLSDParser::PARSE_FAILURE) + { + parsed=false; + char body[1025]; + body[1024] = '\0'; + istr.seekg(0, std::ios::beg); + istr.get(body,1024); + if (strlen(body) > 0) { - mStatus = HTTP_INTERNAL_ERROR; - mReason = "Failed to deserialize LLSD from JSON response."; - char body[1025]; - body[1024] = '\0'; - istr.seekg(0, std::ios::beg); - istr.get(body,1024); - if (strlen(body) > 0) - { - mContent["body"] = body; - } + mContent = body; + debug_body = body; } } + // Only emit a warning if we failed to parse when 'content-type' == 'application/json' + if (!parsed && (HTTP_CONTENT_JSON == getResponseHeader(HTTP_IN_HEADER_CONTENT_TYPE))) + { + llwarns << "Failed to deserialize LLSD from JSON response. " << getURL() + << " [status:" << mStatus << "] " + << "(" << mReason << ") body: " << debug_body << llendl; + } + + if (!parsed) + { + // *TODO: This isn't necessarily the server's fault. Using a 5xx code + // isn't really appropriate here. + // Also, this hides the actual status returned by the server.... + mStatus = HTTP_INTERNAL_ERROR; + mReason = "Failed to deserialize LLSD from JSON response."; + } + httpCompleted(); } }; @@ -132,11 +154,10 @@ private: virtual void httpSuccess() { - const bool check_lower=true; - if (hasResponseHeader(HTTP_HEADER_SET_COOKIE, check_lower)) + if (hasResponseHeader(HTTP_IN_HEADER_SET_COOKIE)) { // OpenID request succeeded and returned a session cookie. - LLWebSharing::instance().receiveSessionCookie(getResponseHeader(HTTP_HEADER_SET_COOKIE, check_lower)); + LLWebSharing::instance().receiveSessionCookie(getResponseHeader(HTTP_IN_HEADER_SET_COOKIE)); } } }; @@ -299,7 +320,7 @@ void LLWebSharing::sendConfigRequest() LL_DEBUGS("WebSharing") << "Requesting Snapshot Sharing config data from: " << config_url << LL_ENDL; LLSD headers = LLSD::emptyMap(); - headers[HTTP_HEADER_ACCEPT] = HTTP_CONTENT_JSON; + headers[HTTP_OUT_HEADER_ACCEPT] = HTTP_CONTENT_JSON; LLHTTPClient::get(config_url, new LLWebSharingConfigResponder(), headers); } @@ -310,8 +331,8 @@ void LLWebSharing::sendOpenIDAuthRequest() LL_DEBUGS("WebSharing") << "Starting OpenID Auth: " << auth_url << LL_ENDL; LLSD headers = LLSD::emptyMap(); - headers[HTTP_HEADER_COOKIE] = mOpenIDCookie; - headers[HTTP_HEADER_ACCEPT] = "*/*"; + headers[HTTP_OUT_HEADER_COOKIE] = mOpenIDCookie; + headers[HTTP_OUT_HEADER_ACCEPT] = "*/*"; // Send request, successful login will trigger fetching a security token. LLHTTPClient::get(auth_url, new LLWebSharingOpenIDAuthResponder(), headers); @@ -337,10 +358,10 @@ void LLWebSharing::sendSecurityTokenRequest() LL_DEBUGS("WebSharing") << "Fetching security token from: " << token_url << LL_ENDL; LLSD headers = LLSD::emptyMap(); - headers[HTTP_HEADER_COOKIE] = mSessionCookie; + headers[HTTP_OUT_HEADER_COOKIE] = mSessionCookie; - headers[HTTP_HEADER_ACCEPT] = HTTP_CONTENT_JSON; - headers[HTTP_HEADER_CONTENT_TYPE] = HTTP_CONTENT_JSON; + headers[HTTP_OUT_HEADER_ACCEPT] = HTTP_CONTENT_JSON; + headers[HTTP_OUT_HEADER_CONTENT_TYPE] = HTTP_CONTENT_JSON; std::ostringstream body; body << "{ \"gadgets\": [{ \"url\":\"" @@ -366,10 +387,10 @@ void LLWebSharing::sendUploadRequest() static const std::string BOUNDARY("------------abcdef012345xyZ"); LLSD headers = LLSD::emptyMap(); - headers[HTTP_HEADER_COOKIE] = mSessionCookie; + headers[HTTP_OUT_HEADER_COOKIE] = mSessionCookie; - headers[HTTP_HEADER_ACCEPT] = HTTP_CONTENT_JSON; - headers[HTTP_HEADER_CONTENT_TYPE] = "multipart/form-data; boundary=" + BOUNDARY; + headers[HTTP_OUT_HEADER_ACCEPT] = HTTP_CONTENT_JSON; + headers[HTTP_OUT_HEADER_CONTENT_TYPE] = "multipart/form-data; boundary=" + BOUNDARY; std::ostringstream body; body << "--" << BOUNDARY << "\r\n" diff --git a/indra/newview/llxmlrpctransaction.cpp b/indra/newview/llxmlrpctransaction.cpp index 604e08161e..7c5f8be1b5 100644 --- a/indra/newview/llxmlrpctransaction.cpp +++ b/indra/newview/llxmlrpctransaction.cpp @@ -331,7 +331,7 @@ void LLXMLRPCTransaction::Impl::init(XMLRPC_REQUEST request, bool useGzip) This might help with bug #503 */ mCurlRequest->setopt(CURLOPT_DNS_CACHE_TIMEOUT, -1); - mCurlRequest->slist_append(HTTP_HEADER_CONTENT_TYPE, HTTP_CONTENT_TEXT_XML); + mCurlRequest->slist_append(HTTP_OUT_HEADER_CONTENT_TYPE, HTTP_CONTENT_TEXT_XML); if (useGzip) { -- cgit v1.2.3 From 0a6a5f63b45bf3d97c7926b8d415b0b3885f64a1 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Fri, 5 Apr 2013 13:44:33 -0400 Subject: SH-4061 WIP - spelling fix, allow un-set of missing asset flag for textures --- indra/newview/llviewertexture.cpp | 44 ++++++++++++++++++++++++--------------- indra/newview/llviewertexture.h | 2 +- indra/newview/llvoavatar.cpp | 6 +++--- indra/newview/llvoavatar.h | 2 +- indra/newview/llvoavatarself.cpp | 2 +- 5 files changed, 33 insertions(+), 23 deletions(-) mode change 100644 => 100755 indra/newview/llviewertexture.cpp mode change 100644 => 100755 indra/newview/llviewertexture.h (limited to 'indra/newview') diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp old mode 100644 new mode 100755 index eb6c453e76..500a6c8869 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -2005,29 +2005,39 @@ void LLViewerFetchedTexture::forceToDeleteRequest() mDesiredDiscardLevel = getMaxDiscardLevel() + 1; } -void LLViewerFetchedTexture::setIsMissingAsset() +void LLViewerFetchedTexture::setIsMissingAsset(bool is_missing) { - if (mUrl.empty()) + if (is_missing) { - llwarns << mID << ": Marking image as missing" << llendl; + if (mUrl.empty()) + { + llwarns << mID << ": Marking image as missing" << llendl; + } + else + { + // This may or may not be an error - it is normal to have no + // map tile on an empty region, but bad if we're failing on a + // server bake texture. + if (getFTType() != FTT_MAP_TILE) + { + llwarns << mUrl << ": Marking image as missing" << llendl; + } + } + if (mHasFetcher) + { + LLAppViewer::getTextureFetch()->deleteRequest(getID(), true); + mHasFetcher = FALSE; + mIsFetching = FALSE; + mLastPacketTimer.reset(); + mFetchState = 0; + mFetchPriority = 0; + } } else { - // This may or may not be an error - it is normal to have no - // map tile on an empty region, but bad if we're failing on a - // server bake texture. - llwarns << mUrl << ": Marking image as missing" << llendl; - } - if (mHasFetcher) - { - LLAppViewer::getTextureFetch()->deleteRequest(getID(), true); - mHasFetcher = FALSE; - mIsFetching = FALSE; - mLastPacketTimer.reset(); - mFetchState = 0; - mFetchPriority = 0; + llinfos << mID << ": un-flagging missing asset" << llendl; } - mIsMissingAsset = TRUE; + mIsMissingAsset = is_missing; } void LLViewerFetchedTexture::setLoadedCallback( loaded_callback_func loaded_callback, diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h old mode 100644 new mode 100755 index f2e1a90713..1f2079104f --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -338,7 +338,7 @@ public: // more data. /*virtual*/ void setKnownDrawSize(S32 width, S32 height); - void setIsMissingAsset(); + void setIsMissingAsset(bool is_missing = true); /*virtual*/ BOOL isMissingAsset() const { return mIsMissingAsset; } // returns dimensions of original image for local files (before power of two scaling) diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 5695fc04b9..a71bb93ba2 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -4408,7 +4408,7 @@ void LLVOAvatar::addLocalTextureStats( ETextureIndex idx, LLViewerFetchedTexture } const S32 MAX_TEXTURE_UPDATE_INTERVAL = 64 ; //need to call updateTextures() at least every 32 frames. -const S32 MAX_TEXTURE_VIRTURE_SIZE_RESET_INTERVAL = S32_MAX ; //frames +const S32 MAX_TEXTURE_VIRTUAL_SIZE_RESET_INTERVAL = S32_MAX ; //frames void LLVOAvatar::checkTextureLoading() { static const F32 MAX_INVISIBLE_WAITING_TIME = 15.f ; //seconds @@ -4471,11 +4471,11 @@ const F32 ADDITIONAL_PRI = 0.5f; void LLVOAvatar::addBakedTextureStats( LLViewerFetchedTexture* imagep, F32 pixel_area, F32 texel_area_ratio, S32 boost_level) { //Note: - //if this function is not called for the last MAX_TEXTURE_VIRTURE_SIZE_RESET_INTERVAL frames, + //if this function is not called for the last MAX_TEXTURE_VIRTUAL_SIZE_RESET_INTERVAL frames, //the texture pipeline will stop fetching this texture. imagep->resetTextureStats(); - imagep->setMaxVirtualSizeResetInterval(MAX_TEXTURE_VIRTURE_SIZE_RESET_INTERVAL); + imagep->setMaxVirtualSizeResetInterval(MAX_TEXTURE_VIRTUAL_SIZE_RESET_INTERVAL); imagep->resetMaxVirtualSizeResetCounter() ; mMaxPixelArea = llmax(pixel_area, mMaxPixelArea); diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 85f6f25009..98e8491cb1 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -991,7 +991,7 @@ protected: // Shared with LLVOAvatarSelf }; // LLVOAvatar extern const F32 SELF_ADDITIONAL_PRI; -extern const S32 MAX_TEXTURE_VIRTURE_SIZE_RESET_INTERVAL; +extern const S32 MAX_TEXTURE_VIRTUAL_SIZE_RESET_INTERVAL; std::string get_sequential_numbered_file_name(const std::string& prefix, const std::string& suffix); diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 0404884245..5f9b4a59e7 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2587,7 +2587,7 @@ void LLVOAvatarSelf::addLocalTextureStats( ETextureIndex type, LLViewerFetchedTe imagep->setBoostLevel(getAvatarBoostLevel()); imagep->setAdditionalDecodePriority(SELF_ADDITIONAL_PRI) ; imagep->resetTextureStats(); - imagep->setMaxVirtualSizeResetInterval(MAX_TEXTURE_VIRTURE_SIZE_RESET_INTERVAL); + imagep->setMaxVirtualSizeResetInterval(MAX_TEXTURE_VIRTUAL_SIZE_RESET_INTERVAL); imagep->addTextureStats( desired_pixels / texel_area_ratio ); imagep->forceUpdateBindStats() ; if (imagep->getDiscardLevel() < 0) -- cgit v1.2.3 From e16435c37cb7410f3ea4596e30fd232ac558bc71 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Mon, 8 Apr 2013 13:26:05 -0400 Subject: SH-4061 WIP - added ability to un-set missing asset, do this in the case of FTT_SERVER_BAKE images. This is needed because 'missing' is not necessarily permanent for such images. --- indra/newview/llpaneloutfitsinventory.cpp | 3 ++- indra/newview/llviewertexture.cpp | 6 +++++- indra/newview/llviewertexture.h | 8 ++++---- indra/newview/llvoavatar.cpp | 4 ++++ 4 files changed, 15 insertions(+), 6 deletions(-) mode change 100644 => 100755 indra/newview/llpaneloutfitsinventory.cpp (limited to 'indra/newview') diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp old mode 100644 new mode 100755 index f90236f6f2..d6c927ab58 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -76,7 +76,8 @@ BOOL LLPanelOutfitsInventory::postBuild() // Fetch your outfits folder so that the links are in memory. // ( This is only necessary if we want to show a warning if a user deletes an item that has a // a link in an outfit, see "ConfirmItemDeleteHasLinks". ) - const LLUUID &outfits_cat = gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTFIT, false); + + const LLUUID &outfits_cat = gInventory.findCategoryUUIDForType(LLFolderType::FT_MY_OUTFITS, false); if (outfits_cat.notNull()) { LLInventoryModelBackgroundFetch::instance().start(outfits_cat); diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 500a6c8869..9cca8a244e 100755 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -2005,8 +2005,12 @@ void LLViewerFetchedTexture::forceToDeleteRequest() mDesiredDiscardLevel = getMaxDiscardLevel() + 1; } -void LLViewerFetchedTexture::setIsMissingAsset(bool is_missing) +void LLViewerFetchedTexture::setIsMissingAsset(BOOL is_missing) { + if (is_missing == mIsMissingAsset) + { + return; + } if (is_missing) { if (mUrl.empty()) diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index 1f2079104f..9465fe180b 100755 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -120,7 +120,7 @@ public: LLViewerTexture(const U32 width, const U32 height, const U8 components, BOOL usemipmaps) ; virtual S8 getType() const; - virtual BOOL isMissingAsset()const ; + virtual BOOL isMissingAsset() const ; virtual void dump(); // debug info to llinfos /*virtual*/ bool bindDefaultImage(const S32 stage = 0) ; @@ -338,8 +338,8 @@ public: // more data. /*virtual*/ void setKnownDrawSize(S32 width, S32 height); - void setIsMissingAsset(bool is_missing = true); - /*virtual*/ BOOL isMissingAsset() const { return mIsMissingAsset; } + void setIsMissingAsset(BOOL is_missing = true); + /*virtual*/ BOOL isMissingAsset() const { return mIsMissingAsset; } // returns dimensions of original image for local files (before power of two scaling) // and returns 0 for all asset system images @@ -449,7 +449,7 @@ protected: bool mCanUseHTTP ; //This texture can be fetched through http if true. FTType mFTType; // What category of image is this - map tile, server bake, etc? - mutable S8 mIsMissingAsset; // True if we know that there is no image asset with this image id in the database. + mutable BOOL mIsMissingAsset; // True if we know that there is no image asset with this image id in the database. typedef std::list<LLLoadedCallbackEntry*> callback_list_t; S8 mLoadedCallbackDesiredDiscardLevel; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index a71bb93ba2..58da77efbb 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1884,6 +1884,10 @@ LLViewerFetchedTexture *LLVOAvatar::getBakedTextureImage(const U8 te, const LLUU LL_DEBUGS("Avatar") << avString() << "from URL " << url << llendl; result = LLViewerTextureManager::getFetchedTextureFromUrl( url, FTT_SERVER_BAKE, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE, 0, 0, uuid); + if (result->isMissingAsset()) + { + result->setIsMissingAsset(false); + } } else { -- cgit v1.2.3 From 985b7277e824c39275d9a06c6262b6f394b02133 Mon Sep 17 00:00:00 2001 From: prep <prep@lindenlab.com> Date: Mon, 8 Apr 2013 17:10:46 -0400 Subject: WIP SH-4035: confirmation when closing appearance window when changes present --- indra/newview/llfloatersidepanelcontainer.cpp | 16 ++-- indra/newview/llfloatersidepanelcontainer.h | 2 + indra/newview/llinspectavatar.cpp | 5 +- indra/newview/llsidepanelappearance.cpp | 88 +++++++++++++++++++++- indra/newview/llsidepanelappearance.h | 16 +++- indra/newview/llspeakers.cpp | 5 +- .../newview/skins/default/xui/en/notifications.xml | 13 ++++ 7 files changed, 126 insertions(+), 19 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloatersidepanelcontainer.cpp b/indra/newview/llfloatersidepanelcontainer.cpp index 5f9556a870..b1f9a18d6f 100644 --- a/indra/newview/llfloatersidepanelcontainer.cpp +++ b/indra/newview/llfloatersidepanelcontainer.cpp @@ -67,15 +67,17 @@ void LLFloaterSidePanelContainer::onClickCloseBtn() if (parent == this ) { LLSidepanelAppearance* panel_appearance = dynamic_cast<LLSidepanelAppearance*>(getPanel("appearance")); - if ( panel_appearance ) - { - panel_appearance->getWearable()->onClose(); - panel_appearance->showOutfitsInventoryPanel(); - } + panel_appearance->onClose(this); } } - - LLFloater::onClickCloseBtn(); + else + { + LLFloater::onClickCloseBtn(); + } +} +void LLFloaterSidePanelContainer::close() +{ + LLFloater::onClickCloseBtn(); } LLPanel* LLFloaterSidePanelContainer::openChildPanel(const std::string& panel_name, const LLSD& params) diff --git a/indra/newview/llfloatersidepanelcontainer.h b/indra/newview/llfloatersidepanelcontainer.h index 491723471f..940673b643 100644 --- a/indra/newview/llfloatersidepanelcontainer.h +++ b/indra/newview/llfloatersidepanelcontainer.h @@ -55,6 +55,8 @@ public: LLPanel* openChildPanel(const std::string& panel_name, const LLSD& params); + void close(); + static void showPanel(const std::string& floater_name, const LLSD& key); static void showPanel(const std::string& floater_name, const std::string& panel_name, const LLSD& key); diff --git a/indra/newview/llinspectavatar.cpp b/indra/newview/llinspectavatar.cpp index 0b3268eb54..6ff16742dd 100644 --- a/indra/newview/llinspectavatar.cpp +++ b/indra/newview/llinspectavatar.cpp @@ -292,10 +292,7 @@ void LLInspectAvatar::processAvatarData(LLAvatarData* data) delete mPropertiesRequest; mPropertiesRequest = NULL; } -/* -prep# - virtual void httpFailure() - */ + void LLInspectAvatar::updateVolumeSlider() { diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp index 74fa5a87bb..53b5593ac9 100644 --- a/indra/newview/llsidepanelappearance.cpp +++ b/indra/newview/llsidepanelappearance.cpp @@ -48,6 +48,8 @@ #include "llviewerregion.h" #include "llvoavatarself.h" #include "llviewerwearable.h" +#include "llnotificationsutil.h" +#include "llfloatersidepanelcontainer.h" static LLRegisterPanelClassWrapper<LLSidepanelAppearance> t_appearance("sidepanel_appearance"); @@ -70,13 +72,84 @@ private: LLSidepanelAppearance *mPanel; }; +bool LLSidepanelAppearance::callBackExitWithoutSaveViaBack(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if ( option == 0 ) + { + gSavedSettings.setBOOL("ExitOutfitEditWithoutSave", TRUE); + LLAppearanceMgr::instance().setOutfitDirty( true ); + showOutfitsInventoryPanel(); + LLAppearanceMgr::getInstance()->wearBaseOutfit(); + return true; + } + gSavedSettings.setBOOL("ExitOutfitEditWithoutSave", FALSE); + return false; +} + +bool LLSidepanelAppearance::callBackExitWithoutSaveViaClose(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if ( option == 0 ) + { + gSavedSettings.setBOOL("ExitOutfitEditWithoutSave", TRUE); + mEditWearable->revertChanges(); + LLAppearanceMgr::getInstance()->wearBaseOutfit(); + mLLFloaterSidePanelContainer->close(); + return true; + } + gSavedSettings.setBOOL("ExitOutfitEditWithoutSave", FALSE); + return false; +} + +void LLSidepanelAppearance::onClickConfirmExitWithoutSaveViaClose() +{ + if ( LLAppearanceMgr::getInstance()->isOutfitDirty() && !LLAppearanceMgr::getInstance()->isOutfitLocked() ) + { + LLSidepanelAppearance* pSelf = (LLSidepanelAppearance *)this; + LLNotificationsUtil::add("ConfirmExitWithoutSave", LLSD(), LLSD(), boost::bind(&LLSidepanelAppearance::callBackExitWithoutSaveViaClose,pSelf,_1,_2) ); + } + else + { + showOutfitsInventoryPanel(); + } +} + +void LLSidepanelAppearance::onClickConfirmExitWithoutSaveViaBack() +{ + if ( LLAppearanceMgr::getInstance()->isOutfitDirty() && !mSidePanelJustOpened && !LLAppearanceMgr::getInstance()->isOutfitLocked() ) + { + LLSidepanelAppearance* pSelf = (LLSidepanelAppearance *)this; + LLNotificationsUtil::add("ConfirmExitWithoutSave", LLSD(), LLSD(), boost::bind(&LLSidepanelAppearance::callBackExitWithoutSaveViaBack,pSelf,_1,_2) ); + } + else + { + showOutfitsInventoryPanel(); + } +} + +void LLSidepanelAppearance::onClose(LLFloaterSidePanelContainer* obj) +{ + mLLFloaterSidePanelContainer = obj; + if ( LLAppearanceMgr::getInstance()->isOutfitDirty() && !LLAppearanceMgr::getInstance()->isOutfitLocked() ) + { + LLSidepanelAppearance* pSelf = (LLSidepanelAppearance *)this; + LLNotificationsUtil::add("ConfirmExitWithoutSave", LLSD(), LLSD(), boost::bind(&LLSidepanelAppearance::callBackExitWithoutSaveViaClose,pSelf,_1,_2) ); + } + else + { + mLLFloaterSidePanelContainer->close(); + } +} + LLSidepanelAppearance::LLSidepanelAppearance() : LLPanel(), mFilterSubString(LLStringUtil::null), mFilterEditor(NULL), mOutfitEdit(NULL), mCurrOutfitPanel(NULL), - mOpened(false) + mOpened(false), + mSidePanelJustOpened(true) { LLOutfitObserver& outfit_observer = LLOutfitObserver::instance(); outfit_observer.addBOFReplacedCallback(boost::bind(&LLSidepanelAppearance::refreshCurrentOutfitName, this, "")); @@ -85,6 +158,8 @@ LLSidepanelAppearance::LLSidepanelAppearance() : gAgentWearables.addLoadingStartedCallback(boost::bind(&LLSidepanelAppearance::setWearablesLoading, this, true)); gAgentWearables.addLoadedCallback(boost::bind(&LLSidepanelAppearance::setWearablesLoading, this, false)); + + } LLSidepanelAppearance::~LLSidepanelAppearance() @@ -119,8 +194,8 @@ BOOL LLSidepanelAppearance::postBuild() { LLButton* back_btn = mOutfitEdit->getChild<LLButton>("back_btn"); if (back_btn) - { - back_btn->setClickedCallback(boost::bind(&LLSidepanelAppearance::showOutfitsInventoryPanel, this)); + { + back_btn->setClickedCallback(boost::bind(&LLSidepanelAppearance::onClickConfirmExitWithoutSaveViaBack, this)); } } @@ -144,6 +219,7 @@ BOOL LLSidepanelAppearance::postBuild() setVisibleCallback(boost::bind(&LLSidepanelAppearance::onVisibilityChange,this,_2)); + return TRUE; } @@ -183,6 +259,12 @@ void LLSidepanelAppearance::onOpen(const LLSD& key) void LLSidepanelAppearance::onVisibilityChange(const LLSD &new_visibility) { + //handle leaving and subsequent user verification of discarding any unsaved data + if ( mSidePanelJustOpened ) + { + mSidePanelJustOpened = false; + } + LLSD visibility; visibility["visible"] = new_visibility.asBoolean(); visibility["reset_accordion"] = false; diff --git a/indra/newview/llsidepanelappearance.h b/indra/newview/llsidepanelappearance.h index 762f557a80..85e7734567 100644 --- a/indra/newview/llsidepanelappearance.h +++ b/indra/newview/llsidepanelappearance.h @@ -38,9 +38,11 @@ class LLCurrentlyWornFetchObserver; class LLPanelEditWearable; class LLViewerWearable; class LLPanelOutfitsInventory; +class LLFloaterSidePanelContainer; class LLSidepanelAppearance : public LLPanel -{ +{ + LOG_CLASS(LLSidepanelAppearance); public: LLSidepanelAppearance(); @@ -48,6 +50,8 @@ public: /*virtual*/ BOOL postBuild(); /*virtual*/ void onOpen(const LLSD& key); + void onClose(LLFloaterSidePanelContainer* obj); + void onClickCloseBtn(); void refreshCurrentOutfitName(const std::string& name = ""); @@ -65,6 +69,11 @@ public: void updateScrollingPanelList(); void updateToVisibility( const LLSD& new_visibility ); LLPanelEditWearable* getWearable(){ return mEditWearable; } + bool callBackExitWithoutSaveViaBack(const LLSD& notification, const LLSD& response); + void onClickConfirmExitWithoutSaveViaBack(); + bool callBackExitWithoutSaveViaClose(const LLSD& notification, const LLSD& response); + void onClickConfirmExitWithoutSaveViaClose(); + private: void onFilterEdit(const std::string& search_string); @@ -85,6 +94,7 @@ private: LLButton* mOpenOutfitBtn; LLButton* mEditAppearanceBtn; LLButton* mNewOutfitBtn; + LLPanel* mCurrOutfitPanel; LLTextBox* mCurrentLookName; @@ -99,6 +109,10 @@ private: // Gets set to true when we're opened for the first time. bool mOpened; + // Set to true if sidepanel has just been opened + bool mSidePanelJustOpened; + LLFloaterSidePanelContainer* mLLFloaterSidePanelContainer; + }; #endif //LL_LLSIDEPANELAPPEARANCE_H diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp index 3c3c699d17..bf209df863 100644 --- a/indra/newview/llspeakers.cpp +++ b/indra/newview/llspeakers.cpp @@ -855,10 +855,7 @@ void LLIMSpeakerMgr::updateSpeakers(const LLSD& update) } } } -/*prep# - virtual void httpFailure() - llwarns << dumpResponse() << llendl; - */ + void LLIMSpeakerMgr::toggleAllowTextChat(const LLUUID& speaker_id) { LLPointer<LLSpeaker> speakerp = findSpeaker(speaker_id); diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 105bef7321..2170283af2 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -10030,5 +10030,18 @@ Cannot create large prims that intersect other players. Please re-try when othe name="okignore" yestext="OK"/> </notification> + + + <notification + icon="alertmodal.tga" + name="ConfirmExitWithoutSave" + type="alertmodal"> + Closing this window will discard any changes you have made. + <tag>confirm</tag> + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> </notifications> -- cgit v1.2.3 From 4bbcd26941c3be6b83214d0dc45c70f99e474dda Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Mon, 8 Apr 2013 18:16:58 -0400 Subject: SH-4061 FIX - texture fetch failures added retry logic and fault injection for testing --- indra/newview/app_settings/settings.xml | 11 +++++++++++ indra/newview/lltexturefetch.cpp | 28 ++++++++++++++++++++-------- indra/newview/lltexturefetch.h | 2 +- indra/newview/llviewertexture.cpp | 29 ++++++++++++++++++++++------- indra/newview/llviewertexture.h | 1 + 5 files changed, 55 insertions(+), 16 deletions(-) mode change 100644 => 100755 indra/newview/lltexturefetch.h (limited to 'indra/newview') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index f66d8fca5b..0b7f99ebc1 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -11130,6 +11130,17 @@ <key>Value</key> <integer>0</integer> </map> + <key>TextureFetchFakeFailures</key> + <map> + <key>Comment</key> + <string>Simulate HTTP fetch failures for some server bake textures.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> <key>TextureFetchSource</key> <map> <key>Comment</key> diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index cc6dc64626..2e6fb160d5 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -388,10 +388,12 @@ public: // Threads: Ttf virtual void onCompleted(LLCore::HttpHandle handle, LLCore::HttpResponse * response); + void setFakeFailure(bool fake_failure) { mFakeFailure = fake_failure; } + protected: LLTextureFetchWorker(LLTextureFetch* fetcher, FTType f_type, const std::string& url, const LLUUID& id, const LLHost& host, - F32 priority, S32 discard, S32 size); + F32 priority, S32 discard, S32 size, bool fake_failure); private: @@ -547,6 +549,7 @@ private: S32 mActiveCount; LLCore::HttpStatus mGetStatus; std::string mGetReason; + bool mFakeFailure; // Work Data LLMutex mWorkMutex; @@ -836,7 +839,8 @@ LLTextureFetchWorker::LLTextureFetchWorker(LLTextureFetch* fetcher, const LLHost& host, // Simulator host F32 priority, // Priority S32 discard, // Desired discard - S32 size) // Desired size + S32 size, // Desired size + bool fake_failure) // For testing, simulate http failure if true. : LLWorkerClass(fetcher, "TextureFetch"), LLCore::HttpHandler(), mState(INIT), @@ -889,7 +893,8 @@ LLTextureFetchWorker::LLTextureFetchWorker(LLTextureFetch* fetcher, mHttpHasResource(false), mCacheReadCount(0U), mCacheWriteCount(0U), - mResourceWaitCount(0U) + mResourceWaitCount(0U), + mFakeFailure(fake_failure) { mCanUseNET = mUrl.empty() ; @@ -1519,15 +1524,16 @@ bool LLTextureFetchWorker::doWork(S32 param) { if (http_not_found == mGetStatus) { + llwarns << "Texture missing from server (404): " << mUrl << llendl; + if(mWriteToCacheState == NOT_WRITE) //map tiles { setState(DONE); releaseHttpSemaphore(); - LL_DEBUGS("Texture") << mID << " abort: WAIT_HTTP_REQ not found" << llendl; + LL_WARNS("Texture") << mID << " abort: WAIT_HTTP_REQ not found" << llendl; return true; // failed, means no map tile on the empty region. } - llwarns << "Texture missing from server (404): " << mUrl << llendl; // roll back to try UDP if (mCanUseNET) @@ -1891,6 +1897,11 @@ void LLTextureFetchWorker::onCompleted(LLCore::HttpHandle handle, LLCore::HttpRe mFetcher->mTextureInfo.setRequestCompleteTimeAndLog(mID, timeNow); } + if (mFakeFailure) + { + llwarns << "For debugging, setting fake failure status for texture " << mID << llendl; + response->setStatus(LLCore::HttpStatus(404)); + } bool success = true; bool partial = false; LLCore::HttpStatus status(response->getStatus()); @@ -2455,7 +2466,7 @@ LLTextureFetch::~LLTextureFetch() } bool LLTextureFetch::createRequest(FTType f_type, const std::string& url, const LLUUID& id, const LLHost& host, F32 priority, - S32 w, S32 h, S32 c, S32 desired_discard, bool needs_aux, bool can_use_http) + S32 w, S32 h, S32 c, S32 desired_discard, bool needs_aux, bool can_use_http, bool fake_failure) { if(mFetcherLocked) { @@ -2523,7 +2534,8 @@ bool LLTextureFetch::createRequest(FTType f_type, const std::string& url, const worker->mNeedsAux = needs_aux; worker->setImagePriority(priority); worker->setDesiredDiscard(desired_discard, desired_size); - worker->setCanUseHTTP(can_use_http) ; + worker->setCanUseHTTP(can_use_http); + worker->setFakeFailure(fake_failure); if (!worker->haveWork()) { worker->setState(LLTextureFetchWorker::INIT); @@ -2538,7 +2550,7 @@ bool LLTextureFetch::createRequest(FTType f_type, const std::string& url, const } else { - worker = new LLTextureFetchWorker(this, f_type, url, id, host, priority, desired_discard, desired_size); + worker = new LLTextureFetchWorker(this, f_type, url, id, host, priority, desired_discard, desired_size, fake_failure); lockQueue(); // +Mfq mRequestMap[id] = worker; unlockQueue(); // -Mfq diff --git a/indra/newview/lltexturefetch.h b/indra/newview/lltexturefetch.h old mode 100644 new mode 100755 index 902a3d7a25..b99480d18e --- a/indra/newview/lltexturefetch.h +++ b/indra/newview/lltexturefetch.h @@ -78,7 +78,7 @@ public: // Threads: T* (but Tmain mostly) bool createRequest(FTType f_type, const std::string& url, const LLUUID& id, const LLHost& host, F32 priority, - S32 w, S32 h, S32 c, S32 discard, bool needs_aux, bool can_use_http); + S32 w, S32 h, S32 c, S32 discard, bool needs_aux, bool can_use_http, bool fake_failure); // Requests that a fetch operation be deleted from the queue. // If @cancel is true, also stops any I/O operations pending. diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 9cca8a244e..a157600cc9 100755 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -962,6 +962,8 @@ void LLViewerFetchedTexture::init(bool firstinit) // does not contain this image. mIsMissingAsset = FALSE; + mFetchFailureCount = 0; + mLoadedCallbackDesiredDiscardLevel = S8_MAX; mPauseLoadedCallBacks = FALSE ; @@ -1823,12 +1825,18 @@ bool LLViewerFetchedTexture::updateFetch() // We finished but received no data if (current_discard < 0) { - llwarns << "!mIsFetching, setting as missing, decode_priority " << decode_priority - << " mRawDiscardLevel " << mRawDiscardLevel - << " current_discard " << current_discard - << llendl; - setIsMissingAsset(); - desired_discard = -1; + const S32 MAX_FETCH_FAILURE = 1; + mFetchFailureCount++; + llwarns << "Fetch failure for " << mID << " failure count " << mFetchFailureCount << llendl; + if (getFTType() != FTT_SERVER_BAKE || mFetchFailureCount >= MAX_FETCH_FAILURE) + { + llwarns << "!mIsFetching, setting as missing, decode_priority " << decode_priority + << " mRawDiscardLevel " << mRawDiscardLevel + << " current_discard " << current_discard + << llendl; + setIsMissingAsset(); + desired_discard = -1; + } } else { @@ -1942,8 +1950,14 @@ bool LLViewerFetchedTexture::updateFetch() // bypass texturefetch directly by pulling from LLTextureCache bool fetch_request_created = false; + bool fake_failure = false; + const bool debug_setting_fake_failures = gSavedSettings.getBOOL("TextureFetchFakeFailures"); + if (getFTType() == FTT_SERVER_BAKE && mFetchFailureCount == 0 && debug_setting_fake_failures) + { + fake_failure = true; + } fetch_request_created = LLAppViewer::getTextureFetch()->createRequest(mFTType, mUrl, getID(), getTargetHost(), decode_priority, - w, h, c, desired_discard, needsAux(), mCanUseHTTP); + w, h, c, desired_discard, needsAux(), mCanUseHTTP, fake_failure); if (fetch_request_created) { @@ -2040,6 +2054,7 @@ void LLViewerFetchedTexture::setIsMissingAsset(BOOL is_missing) else { llinfos << mID << ": un-flagging missing asset" << llendl; + mFetchFailureCount = 0; } mIsMissingAsset = is_missing; } diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index 9465fe180b..320e6f8630 100755 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -450,6 +450,7 @@ protected: FTType mFTType; // What category of image is this - map tile, server bake, etc? mutable BOOL mIsMissingAsset; // True if we know that there is no image asset with this image id in the database. + S32 mFetchFailureCount; // How many times has a fetch failed in a way that suggests the asset is missing? typedef std::list<LLLoadedCallbackEntry*> callback_list_t; S8 mLoadedCallbackDesiredDiscardLevel; -- cgit v1.2.3 From 67790d0dd8fec2750906ae3d3fed1e735be6b078 Mon Sep 17 00:00:00 2001 From: "prep@lindenlab.com" <prep@lindenlab.com> Date: Tue, 9 Apr 2013 15:14:51 -0500 Subject: SH-4035: Bug fix to handle closing the panel when editing a specific wearable --- indra/newview/llsidepanelappearance.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp index 53b5593ac9..3899450804 100644 --- a/indra/newview/llsidepanelappearance.cpp +++ b/indra/newview/llsidepanelappearance.cpp @@ -131,7 +131,9 @@ void LLSidepanelAppearance::onClickConfirmExitWithoutSaveViaBack() void LLSidepanelAppearance::onClose(LLFloaterSidePanelContainer* obj) { mLLFloaterSidePanelContainer = obj; - if ( LLAppearanceMgr::getInstance()->isOutfitDirty() && !LLAppearanceMgr::getInstance()->isOutfitLocked() ) + if ( LLAppearanceMgr::getInstance()->isOutfitDirty() && + !LLAppearanceMgr::getInstance()->isOutfitLocked() || + ( mEditWearable->isAvailable() && mEditWearable->isDirty() ) ) { LLSidepanelAppearance* pSelf = (LLSidepanelAppearance *)this; LLNotificationsUtil::add("ConfirmExitWithoutSave", LLSD(), LLSD(), boost::bind(&LLSidepanelAppearance::callBackExitWithoutSaveViaClose,pSelf,_1,_2) ); -- cgit v1.2.3 From 24fa7736dd123429425d91b2b72c3b3b7110b764 Mon Sep 17 00:00:00 2001 From: "prep@lindenlab.com" <prep@lindenlab.com> Date: Tue, 9 Apr 2013 15:30:51 -0500 Subject: SH-4035: Removed unneeded functional call --- indra/newview/llsidepanelappearance.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp index 3899450804..ae6ceabdaa 100644 --- a/indra/newview/llsidepanelappearance.cpp +++ b/indra/newview/llsidepanelappearance.cpp @@ -93,7 +93,6 @@ bool LLSidepanelAppearance::callBackExitWithoutSaveViaClose(const LLSD& notifica if ( option == 0 ) { gSavedSettings.setBOOL("ExitOutfitEditWithoutSave", TRUE); - mEditWearable->revertChanges(); LLAppearanceMgr::getInstance()->wearBaseOutfit(); mLLFloaterSidePanelContainer->close(); return true; -- cgit v1.2.3 From f78da987913de659367b24e3aa0add2c570f8e1f Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Wed, 10 Apr 2013 11:43:48 -0400 Subject: SH-4061 WIP - capture http status codes from requests, restrict SB fetch retries to 5xx errors --- indra/newview/lltexturefetch.cpp | 15 ++++++++++----- indra/newview/lltexturefetch.h | 3 ++- indra/newview/llviewertexture.cpp | 20 ++++++++++++++++---- indra/newview/llviewertexture.h | 4 +++- 4 files changed, 31 insertions(+), 11 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 2e6fb160d5..5a6338d9d8 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -382,6 +382,8 @@ public: void setCanUseHTTP(bool can_use_http) { mCanUseHTTP = can_use_http; } bool getCanUseHTTP() const { return mCanUseHTTP; } + void setUrl(const std::string& url) { mUrl = url; } + LLTextureFetch & getFetcher() { return *mFetcher; } // Inherited from LLCore::HttpHandler @@ -1291,7 +1293,7 @@ bool LLTextureFetchWorker::doWork(S32 param) std::string http_url = region->getHttpUrl() ; if (!http_url.empty()) { - mUrl = http_url + "/?texture_id=" + mID.asString().c_str(); + setUrl(http_url + "/?texture_id=" + mID.asString().c_str()); mWriteToCacheState = CAN_WRITE ; //because this texture has a fixed texture id. } else @@ -1900,7 +1902,7 @@ void LLTextureFetchWorker::onCompleted(LLCore::HttpHandle handle, LLCore::HttpRe if (mFakeFailure) { llwarns << "For debugging, setting fake failure status for texture " << mID << llendl; - response->setStatus(LLCore::HttpStatus(404)); + response->setStatus(LLCore::HttpStatus(500)); } bool success = true; bool partial = false; @@ -1918,11 +1920,11 @@ void LLTextureFetchWorker::onCompleted(LLCore::HttpHandle handle, LLCore::HttpRe // << " offset: " << offset << " length: " << length // << llendl; + std::string reason(status.toString()); + setGetStatus(status, reason); if (! status) { success = false; - std::string reason(status.toString()); - setGetStatus(status, reason); llwarns << "CURL GET FAILED, status: " << status.toHex() << " reason: " << reason << llendl; } @@ -2535,6 +2537,7 @@ bool LLTextureFetch::createRequest(FTType f_type, const std::string& url, const worker->setImagePriority(priority); worker->setDesiredDiscard(desired_discard, desired_size); worker->setCanUseHTTP(can_use_http); + worker->setUrl(url); worker->setFakeFailure(fake_failure); if (!worker->haveWork()) { @@ -2741,7 +2744,8 @@ LLTextureFetchWorker* LLTextureFetch::getWorker(const LLUUID& id) // Threads: T* bool LLTextureFetch::getRequestFinished(const LLUUID& id, S32& discard_level, - LLPointer<LLImageRaw>& raw, LLPointer<LLImageRaw>& aux) + LLPointer<LLImageRaw>& raw, LLPointer<LLImageRaw>& aux, + LLCore::HttpStatus& last_http_get_status) { bool res = false; LLTextureFetchWorker* worker = getWorker(id); @@ -2763,6 +2767,7 @@ bool LLTextureFetch::getRequestFinished(const LLUUID& id, S32& discard_level, else if (worker->checkWork()) { worker->lockWorkMutex(); // +Mw + last_http_get_status = worker->mGetStatus; discard_level = worker->mDecodedDiscard; raw = worker->mRawImage; aux = worker->mAuxImage; diff --git a/indra/newview/lltexturefetch.h b/indra/newview/lltexturefetch.h index b99480d18e..9f77d58727 100755 --- a/indra/newview/lltexturefetch.h +++ b/indra/newview/lltexturefetch.h @@ -95,7 +95,8 @@ public: // Threads: T* bool getRequestFinished(const LLUUID& id, S32& discard_level, - LLPointer<LLImageRaw>& raw, LLPointer<LLImageRaw>& aux); + LLPointer<LLImageRaw>& raw, LLPointer<LLImageRaw>& aux, + LLCore::HttpStatus& last_http_get_status); // Threads: T* bool updateRequestPriority(const LLUUID& id, F32 priority); diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index a157600cc9..7a1afb1238 100755 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -1760,7 +1760,8 @@ bool LLViewerFetchedTexture::updateFetch() if (mRawImage.notNull()) sRawCount--; if (mAuxRawImage.notNull()) sAuxCount--; - bool finished = LLAppViewer::getTextureFetch()->getRequestFinished(getID(), fetch_discard, mRawImage, mAuxRawImage); + bool finished = LLAppViewer::getTextureFetch()->getRequestFinished(getID(), fetch_discard, mRawImage, mAuxRawImage, + mLastHttpGetStatus); if (mRawImage.notNull()) sRawCount++; if (mAuxRawImage.notNull()) sAuxCount++; if (finished) @@ -1825,14 +1826,25 @@ bool LLViewerFetchedTexture::updateFetch() // We finished but received no data if (current_discard < 0) { - const S32 MAX_FETCH_FAILURE = 1; + const S32 MAX_FETCH_FAILURE = 3; mFetchFailureCount++; - llwarns << "Fetch failure for " << mID << " failure count " << mFetchFailureCount << llendl; - if (getFTType() != FTT_SERVER_BAKE || mFetchFailureCount >= MAX_FETCH_FAILURE) + llwarns << "Fetch failure for " << mID << " failure count " << mFetchFailureCount + << " status " << mLastHttpGetStatus.toHex() << llendl; + // Will retry server-bake textures under a limited set of circumstances. + if (getFTType() == FTT_SERVER_BAKE && + mLastHttpGetStatus.isHttpStatus() && + mLastHttpGetStatus.mType >= 500 && + mLastHttpGetStatus.mType <= 599 && // Only retry 5xx failures. + mFetchFailureCount < MAX_FETCH_FAILURE) + { + llwarns << "Will retry fetch" << llendl; + } + else // Otherwise, assume the image is missing. { llwarns << "!mIsFetching, setting as missing, decode_priority " << decode_priority << " mRawDiscardLevel " << mRawDiscardLevel << " current_discard " << current_discard + << " stats " << mLastHttpGetStatus.toHex() << llendl; setIsMissingAsset(); desired_discard = -1; diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index 320e6f8630..91e903ffd6 100755 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -34,6 +34,7 @@ #include "llgltypes.h" #include "llrender.h" #include "llmetricperformancetester.h" +#include "httpcommon.h" #include <map> #include <list> @@ -446,7 +447,8 @@ protected: S8 mIsRawImageValid; S8 mHasFetcher; // We've made a fecth request S8 mIsFetching; // Fetch request is active - bool mCanUseHTTP ; //This texture can be fetched through http if true. + bool mCanUseHTTP; //This texture can be fetched through http if true. + LLCore::HttpStatus mLastHttpGetStatus; // Result of the most recently completed http request for this texture. FTType mFTType; // What category of image is this - map tile, server bake, etc? mutable BOOL mIsMissingAsset; // True if we know that there is no image asset with this image id in the database. -- cgit v1.2.3 From 34e2478388341a1add33bf88cac43031e351340e Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Wed, 10 Apr 2013 11:57:22 -0400 Subject: SH-4061 WIP - less log spamming for (expected and normal) map tile failures. --- indra/newview/lltexturefetch.cpp | 21 +++++++++++++++------ indra/newview/llviewertexture.cpp | 20 +++++++++++++------- 2 files changed, 28 insertions(+), 13 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 5a6338d9d8..58cfc80839 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -1526,14 +1526,20 @@ bool LLTextureFetchWorker::doWork(S32 param) { if (http_not_found == mGetStatus) { - llwarns << "Texture missing from server (404): " << mUrl << llendl; + if (mFTType != FTT_MAP_TILE) + { + llwarns << "Texture missing from server (404): " << mUrl << llendl; + } - if(mWriteToCacheState == NOT_WRITE) //map tiles + if(mWriteToCacheState == NOT_WRITE) //map tiles or server bakes { setState(DONE); releaseHttpSemaphore(); - LL_WARNS("Texture") << mID << " abort: WAIT_HTTP_REQ not found" << llendl; - return true; // failed, means no map tile on the empty region. + if (mFTType != FTT_MAP_TILE) + { + LL_WARNS("Texture") << mID << " abort: WAIT_HTTP_REQ not found" << llendl; + } + return true; } @@ -1925,8 +1931,11 @@ void LLTextureFetchWorker::onCompleted(LLCore::HttpHandle handle, LLCore::HttpRe if (! status) { success = false; - llwarns << "CURL GET FAILED, status: " << status.toHex() - << " reason: " << reason << llendl; + if (mFTType != FTT_MAP_TILE) // missing map tiles are normal, don't complain about them. + { + llwarns << "CURL GET FAILED, status: " << status.toHex() + << " reason: " << reason << llendl; + } } else { diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 7a1afb1238..5f4c66a04c 100755 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -1828,8 +1828,11 @@ bool LLViewerFetchedTexture::updateFetch() { const S32 MAX_FETCH_FAILURE = 3; mFetchFailureCount++; - llwarns << "Fetch failure for " << mID << " failure count " << mFetchFailureCount - << " status " << mLastHttpGetStatus.toHex() << llendl; + if (getFTType() != FTT_MAP_TILE) + { + llwarns << "Fetch failure for " << mID << " failure count " << mFetchFailureCount + << " status " << mLastHttpGetStatus.toHex() << llendl; + } // Will retry server-bake textures under a limited set of circumstances. if (getFTType() == FTT_SERVER_BAKE && mLastHttpGetStatus.isHttpStatus() && @@ -1841,11 +1844,14 @@ bool LLViewerFetchedTexture::updateFetch() } else // Otherwise, assume the image is missing. { - llwarns << "!mIsFetching, setting as missing, decode_priority " << decode_priority - << " mRawDiscardLevel " << mRawDiscardLevel - << " current_discard " << current_discard - << " stats " << mLastHttpGetStatus.toHex() - << llendl; + if (getFTType() != FTT_MAP_TILE) + { + llwarns << "!mIsFetching, setting as missing, decode_priority " << decode_priority + << " mRawDiscardLevel " << mRawDiscardLevel + << " current_discard " << current_discard + << " stats " << mLastHttpGetStatus.toHex() + << llendl; + } setIsMissingAsset(); desired_discard = -1; } -- cgit v1.2.3 From 2798c355c441f8d92a02537eca6e253c8fbf2bc4 Mon Sep 17 00:00:00 2001 From: "prep@lindenlab.com" <prep@lindenlab.com> Date: Wed, 10 Apr 2013 16:53:46 -0500 Subject: SH-4035:Added ignore message to notification --- indra/newview/llsidepanelappearance.cpp | 6 +----- indra/newview/skins/default/xui/en/notifications.xml | 7 ++++--- 2 files changed, 5 insertions(+), 8 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp index ae6ceabdaa..6d2b643434 100644 --- a/indra/newview/llsidepanelappearance.cpp +++ b/indra/newview/llsidepanelappearance.cpp @@ -77,13 +77,11 @@ bool LLSidepanelAppearance::callBackExitWithoutSaveViaBack(const LLSD& notificat S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if ( option == 0 ) { - gSavedSettings.setBOOL("ExitOutfitEditWithoutSave", TRUE); LLAppearanceMgr::instance().setOutfitDirty( true ); showOutfitsInventoryPanel(); LLAppearanceMgr::getInstance()->wearBaseOutfit(); return true; } - gSavedSettings.setBOOL("ExitOutfitEditWithoutSave", FALSE); return false; } @@ -91,13 +89,11 @@ bool LLSidepanelAppearance::callBackExitWithoutSaveViaClose(const LLSD& notifica { S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if ( option == 0 ) - { - gSavedSettings.setBOOL("ExitOutfitEditWithoutSave", TRUE); + { LLAppearanceMgr::getInstance()->wearBaseOutfit(); mLLFloaterSidePanelContainer->close(); return true; } - gSavedSettings.setBOOL("ExitOutfitEditWithoutSave", FALSE); return false; } diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 2170283af2..1ff63c6def 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -10039,9 +10039,10 @@ Cannot create large prims that intersect other players. Please re-try when othe Closing this window will discard any changes you have made. <tag>confirm</tag> <usetemplate - name="okcancelbuttons" + name="okcancelignore" notext="Cancel" - yestext="OK"/> + yestext="OK" + ignoretext="Don't show me this again."/> </notification> - + </notifications> -- cgit v1.2.3 From 14ca6a1247e68805aae22cf573a39819383fe3d4 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Thu, 11 Apr 2013 11:18:16 -0400 Subject: SH-4061 WIP - moved retry policy to llmessage, added integration test --- indra/newview/llappearancemgr.cpp | 79 +++------------------------------------ 1 file changed, 5 insertions(+), 74 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index c2be472cbc..85f6f92278 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -52,6 +52,7 @@ #include "llwearablelist.h" #include "llsdutil.h" #include "llsdserialize.h" +#include "llhttpretrypolicy.h" #if LL_MSVC // disable boost::lexical_cast warning @@ -2957,78 +2958,6 @@ void LLAppearanceMgr::updateClothingOrderingInfo(LLUUID cat_id, bool update_base if (inventory_changed) gInventory.notifyObservers(); } -// This is intended for use with HTTP Clients/Responders, but is not -// specifically coupled with those classes. -class LLHTTPRetryPolicy: public LLThreadSafeRefCount -{ -public: - LLHTTPRetryPolicy() {} - virtual ~LLHTTPRetryPolicy() {} - virtual bool shouldRetry(S32 status, const LLSD& headers, F32& seconds_to_wait) = 0; -}; - -// Example of simplest possible policy, not necessarily recommended. -// This would be a potentially dangerous policy to enable. Removing for now: -#if 0 -class LLAlwaysRetryImmediatelyPolicy: public LLHTTPRetryPolicy -{ -public: - LLAlwaysRetryImmediatelyPolicy() {} - bool shouldRetry(S32 status, const LLSD& headers, F32& seconds_to_wait) - { - seconds_to_wait = 0.0; - return true; - } -}; -#endif - -// Very general policy with geometric back-off after failures, -// up to a maximum delay, and maximum number of retries. -class LLAdaptiveRetryPolicy: public LLHTTPRetryPolicy -{ -public: - LLAdaptiveRetryPolicy(F32 min_delay, F32 max_delay, F32 backoff_factor, U32 max_retries): - mMinDelay(min_delay), - mMaxDelay(max_delay), - mBackoffFactor(backoff_factor), - mMaxRetries(max_retries), - mDelay(min_delay), - mRetryCount(0) - { - } - - bool shouldRetry(S32 status, const LLSD& headers, F32& seconds_to_wait) - { -#if 0 - // *TODO: Test using status codes to only retry server errors. - // Only server errors would potentially return a different result on retry. - if (!isHttpServerErrorStatus(status)) return false; -#endif - -#if 0 - // *TODO: Honor server Retry-After header. - // Status 503 may ask us to wait for a certain amount of time before retrying. - if (!headers.has(HTTP_IN_HEADER_RETRY_AFTER) - || !getSecondsUntilRetryAfter(headers[HTTP_IN_HEADER_RETRY_AFTER].asStringRef(), seconds_to_wait)) -#endif - { - seconds_to_wait = mDelay; - mDelay = llclamp(mDelay*mBackoffFactor,mMinDelay,mMaxDelay); - } - - mRetryCount++; - return (mRetryCount<=mMaxRetries); - } - -private: - F32 mMinDelay; // delay never less than this value - F32 mMaxDelay; // delay never exceeds this value - F32 mBackoffFactor; // delay increases by this factor after each retry, up to mMaxDelay. - U32 mMaxRetries; // maximum number of times shouldRetry will return true. - F32 mDelay; // current delay. - U32 mRetryCount; // number of times shouldRetry has been called. -}; - class RequestAgentUpdateAppearanceResponder: public LLHTTPClient::Responder { LOG_CLASS(RequestAgentUpdateAppearanceResponder); @@ -3084,7 +3013,8 @@ protected: void onFailure() { F32 seconds_to_wait; - if (mRetryPolicy->shouldRetry(getStatus(), getResponseHeaders(), seconds_to_wait)) + mRetryPolicy->onFailure(getStatus(), getResponseHeaders()); + if (mRetryPolicy->shouldRetry(seconds_to_wait)) { llinfos << "retrying" << llendl; doAfterInterval(boost::bind(&LLAppearanceMgr::requestServerAppearanceUpdate, @@ -3327,7 +3257,8 @@ protected: LL_WARNS("Avatar") << "While attempting to increment the agent's cof we got an error " << dumpResponse() << LL_ENDL; F32 seconds_to_wait; - if (mRetryPolicy->shouldRetry(getStatus(), getResponseHeaders(), seconds_to_wait)) + mRetryPolicy->onFailure(getStatus(), getResponseHeaders()); + if (mRetryPolicy->shouldRetry(seconds_to_wait)) { llinfos << "retrying" << llendl; doAfterInterval(boost::bind(&LLAppearanceMgr::incrementCofVersion, -- cgit v1.2.3 From e17920defbf1d39ecd9e88500ba268c59bb84008 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Thu, 11 Apr 2013 16:17:23 -0400 Subject: SH-4061 WIP - started adding retry to texture fetch, making retry policy compatible with old and new http libraries --- indra/newview/lltexturefetch.cpp | 1 + indra/newview/lltexturefetch.h | 3 +++ 2 files changed, 4 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 58cfc80839..026f36e205 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -1918,6 +1918,7 @@ void LLTextureFetchWorker::onCompleted(LLCore::HttpHandle handle, LLCore::HttpRe << " status: " << status.toHex() << " '" << status.toString() << "'" << llendl; + // unsigned int offset(0), length(0), full_length(0); // response->getRange(&offset, &length, &full_length); // llwarns << "HTTP COMPLETE: " << mID << " handle: " << handle diff --git a/indra/newview/lltexturefetch.h b/indra/newview/lltexturefetch.h index 9f77d58727..c6bd342a7b 100755 --- a/indra/newview/lltexturefetch.h +++ b/indra/newview/lltexturefetch.h @@ -396,6 +396,9 @@ private: e_tex_source mFetchSource; e_tex_source mOriginFetchSource; + // Retry logic + LLAdaptiveRetryPolicy mFetchRetryPolicy; + public: //debug use LLTextureFetchDebugger* getFetchDebugger() { return mFetchDebugger;} -- cgit v1.2.3 From a8cdcfc9a893b7debf7c006022b57c389b50bf0d Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Fri, 12 Apr 2013 09:16:25 -0400 Subject: SH-4061 WIP - moved retry policy to newview so it can work with either llmessage or CoreHttp libraries. Updated tests. --- indra/newview/CMakeLists.txt | 5 + indra/newview/llhttpretrypolicy.cpp | 117 +++++++++++ indra/newview/llhttpretrypolicy.h | 94 +++++++++ indra/newview/lltexturefetch.h | 2 +- indra/newview/tests/llhttpretrypolicy_test.cpp | 275 +++++++++++++++++++++++++ 5 files changed, 492 insertions(+), 1 deletion(-) mode change 100644 => 100755 indra/newview/CMakeLists.txt create mode 100755 indra/newview/llhttpretrypolicy.cpp create mode 100755 indra/newview/llhttpretrypolicy.h create mode 100755 indra/newview/tests/llhttpretrypolicy_test.cpp (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt old mode 100644 new mode 100755 index 05736f6360..27dbe15005 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -299,6 +299,7 @@ set(viewer_SOURCE_FILES llgroupmgr.cpp llhints.cpp llhomelocationresponder.cpp + llhttpretrypolicy.cpp llhudeffect.cpp llhudeffectbeam.cpp llhudeffectlookat.cpp @@ -877,6 +878,7 @@ set(viewer_HEADER_FILES llgrouplist.h llgroupmgr.h llhints.h + llhttpretrypolicy.h llhomelocationresponder.h llhudeffect.h llhudeffectbeam.h @@ -2152,6 +2154,7 @@ if (LL_TESTS) set(test_libs ${LLMESSAGE_LIBRARIES} + ${LLCOREHTTP_LIBRARIES} ${WINDOWS_LIBRARIES} ${LLVFS_LIBRARIES} ${LLMATH_LIBRARIES} @@ -2197,6 +2200,8 @@ if (LL_TESTS) "${test_libs}" ) + LL_ADD_INTEGRATION_TEST(llhttpretrypolicy "llhttpretrypolicy.cpp" "${test_libs}") + #ADD_VIEWER_BUILD_TEST(llmemoryview viewer) #ADD_VIEWER_BUILD_TEST(llagentaccess viewer) #ADD_VIEWER_BUILD_TEST(lltextureinfo viewer) diff --git a/indra/newview/llhttpretrypolicy.cpp b/indra/newview/llhttpretrypolicy.cpp new file mode 100755 index 0000000000..5c6dabbe99 --- /dev/null +++ b/indra/newview/llhttpretrypolicy.cpp @@ -0,0 +1,117 @@ +/** + * @file llhttpretrypolicy.h + * @brief Header for a retry policy class intended for use with http responders. + * + * $LicenseInfo:firstyear=2013&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2013, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llhttpretrypolicy.h" + +bool LLAdaptiveRetryPolicy::getRetryAfter(const LLSD& headers, F32& retry_header_time) +{ + return (headers.has(HTTP_IN_HEADER_RETRY_AFTER) + && getSecondsUntilRetryAfter(headers[HTTP_IN_HEADER_RETRY_AFTER].asStringRef(), retry_header_time)); +} + +bool LLAdaptiveRetryPolicy::getRetryAfter(const LLCore::HttpHeaders *headers, F32& retry_header_time) +{ + // Look for matching header. Hopefully it's correct enough to let + // us extract the field we are looking for. Does not purport to be + // in any way a viable general HTTP header parser. + if (headers) + { + for (std::vector<std::string>::const_iterator it = headers->mHeaders.begin(); + it != headers->mHeaders.end(); + ++it) + { + const std::string& str = *it; + const std::string match = HTTP_IN_HEADER_RETRY_AFTER + ":"; + size_t pos = str.find(match); + if ((pos != std::string::npos) && + (pos+match.length() <= str.length())) + { + retry_header_time = strtod(str.substr(pos+match.length()).c_str(), NULL); + return true; + } + } + } + return false; +} + +void LLAdaptiveRetryPolicy::onFailure(S32 status, const LLSD& headers) +{ + F32 retry_header_time; + bool has_retry_header_time = getRetryAfter(headers,retry_header_time); + onFailureCommon(status, has_retry_header_time, retry_header_time); +} + +// TODO: replace this parsing junk once CoreHttp has its own header parsing capabilities. +void LLAdaptiveRetryPolicy::onFailure(const LLCore::HttpResponse *response) +{ + F32 retry_header_time; + const LLCore::HttpHeaders *headers = response->getHeaders(); + bool has_retry_header_time = getRetryAfter(headers,retry_header_time); + onFailureCommon(response->getStatus().mType, has_retry_header_time, retry_header_time); +} + +void LLAdaptiveRetryPolicy::onFailureCommon(S32 status, bool has_retry_header_time, F32 retry_header_time) +{ + if (mRetryCount > 0) + { + mDelay = llclamp(mDelay*mBackoffFactor,mMinDelay,mMaxDelay); + } + // Honor server Retry-After header. + // Status 503 may ask us to wait for a certain amount of time before retrying. + F32 wait_time = mDelay; + if (has_retry_header_time) + { + wait_time = retry_header_time; + } + + if (mRetryCount>=mMaxRetries) + { + llinfos << "Too many retries " << mRetryCount << ", will not retry" << llendl; + mShouldRetry = false; + } + if (!isHttpServerErrorStatus(status)) + { + llinfos << "Non-server error " << status << ", will not retry" << llendl; + mShouldRetry = false; + } + if (mShouldRetry) + { + llinfos << "Retry count " << mRetryCount << " should retry after " << wait_time << llendl; + mRetryTimer.reset(); + mRetryTimer.setTimerExpirySec(wait_time); + } + mRetryCount++; +} + + +bool LLAdaptiveRetryPolicy::shouldRetry(F32& seconds_to_wait) const +{ + llassert(mRetryCount>0); // have to call onFailure() before shouldRetry() + seconds_to_wait = mShouldRetry ? mRetryTimer.getRemainingTimeF32() : F32_MAX; + return mShouldRetry; +} diff --git a/indra/newview/llhttpretrypolicy.h b/indra/newview/llhttpretrypolicy.h new file mode 100755 index 0000000000..ca37e5f73c --- /dev/null +++ b/indra/newview/llhttpretrypolicy.h @@ -0,0 +1,94 @@ +/** + * @file file llhttpretrypolicy.h + * @brief declarations for http retry policy class. + * + * $LicenseInfo:firstyear=2013&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2013, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_RETRYPOLICY_H +#define LL_RETRYPOLICY_H + +#include "lltimer.h" +#include "llthread.h" + +#include "llhttpconstants.h" + +// For compatibility with new core http lib. +#include "httpresponse.h" +#include "httpheaders.h" + +// This is intended for use with HTTP Clients/Responders, but is not +// specifically coupled with those classes. +class LLHTTPRetryPolicy: public LLThreadSafeRefCount +{ +public: + LLHTTPRetryPolicy() {} + virtual ~LLHTTPRetryPolicy() {} + // Call once after an HTTP failure to update state. + virtual void onFailure(S32 status, const LLSD& headers) = 0; + + virtual void onFailure(const LLCore::HttpResponse *response) = 0; + + virtual bool shouldRetry(F32& seconds_to_wait) const = 0; +}; + +// Very general policy with geometric back-off after failures, +// up to a maximum delay, and maximum number of retries. +class LLAdaptiveRetryPolicy: public LLHTTPRetryPolicy +{ +public: + LLAdaptiveRetryPolicy(F32 min_delay, F32 max_delay, F32 backoff_factor, U32 max_retries): + mMinDelay(min_delay), + mMaxDelay(max_delay), + mBackoffFactor(backoff_factor), + mMaxRetries(max_retries), + mDelay(min_delay), + mRetryCount(0), + mShouldRetry(true) + { + } + + // virtual + void onFailure(S32 status, const LLSD& headers); + // virtual + void onFailure(const LLCore::HttpResponse *response); + // virtual + bool shouldRetry(F32& seconds_to_wait) const; + +protected: + bool getRetryAfter(const LLSD& headers, F32& retry_header_time); + bool getRetryAfter(const LLCore::HttpHeaders *headers, F32& retry_header_time); + void onFailureCommon(S32 status, bool has_retry_header_time, F32 retry_header_time); + +private: + + F32 mMinDelay; // delay never less than this value + F32 mMaxDelay; // delay never exceeds this value + F32 mBackoffFactor; // delay increases by this factor after each retry, up to mMaxDelay. + U32 mMaxRetries; // maximum number of times shouldRetry will return true. + F32 mDelay; // current default delay. + U32 mRetryCount; // number of times shouldRetry has been called. + LLTimer mRetryTimer; // time until next retry. + bool mShouldRetry; // Becomes false after too many retries, or the wrong sort of status received, etc. +}; + +#endif diff --git a/indra/newview/lltexturefetch.h b/indra/newview/lltexturefetch.h index c6bd342a7b..12226d51c8 100755 --- a/indra/newview/lltexturefetch.h +++ b/indra/newview/lltexturefetch.h @@ -397,7 +397,7 @@ private: e_tex_source mOriginFetchSource; // Retry logic - LLAdaptiveRetryPolicy mFetchRetryPolicy; + //LLAdaptiveRetryPolicy mFetchRetryPolicy; public: //debug use diff --git a/indra/newview/tests/llhttpretrypolicy_test.cpp b/indra/newview/tests/llhttpretrypolicy_test.cpp new file mode 100755 index 0000000000..39bd15d62f --- /dev/null +++ b/indra/newview/tests/llhttpretrypolicy_test.cpp @@ -0,0 +1,275 @@ +/** + * @file llhttpretrypolicy_test.cpp + * @brief Header tests to exercise the LLHTTPRetryPolicy classes. + * + * $LicenseInfo:firstyear=2013&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2013, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "../llviewerprecompiledheaders.h" +#include "../llhttpretrypolicy.h" +#include "lltut.h" + +namespace tut +{ +struct TestData +{ +}; + +typedef test_group<TestData> RetryPolicyTestGroup; +typedef RetryPolicyTestGroup::object RetryPolicyTestObject; +RetryPolicyTestGroup retryPolicyTestGroup("retry_policy"); + +template<> template<> +void RetryPolicyTestObject::test<1>() +{ + LLAdaptiveRetryPolicy never_retry(1.0,1.0,1.0,0); + LLSD headers; + F32 wait_seconds; + + never_retry.onFailure(500,headers); + ensure("never retry", !never_retry.shouldRetry(wait_seconds)); +} + +template<> template<> +void RetryPolicyTestObject::test<2>() +{ + LLAdaptiveRetryPolicy retry404(1.0,2.0,3.0,10); + LLSD headers; + F32 wait_seconds; + + retry404.onFailure(404,headers); + ensure("no retry on 404", !retry404.shouldRetry(wait_seconds)); +} + +template<> template<> +void RetryPolicyTestObject::test<3>() +{ + // Should retry after 1.0, 2.0, 3.0, 3.0 seconds. + LLAdaptiveRetryPolicy basic_retry(1.0,3.0,2.0,4); + LLSD headers; + F32 wait_seconds; + bool should_retry; + U32 frac_bits = 6; + + // Starting wait 1.0 + basic_retry.onFailure(500,headers); + should_retry = basic_retry.shouldRetry(wait_seconds); + ensure("basic_retry 1", should_retry); + ensure_approximately_equals("basic_retry 1", wait_seconds, 1.0F, frac_bits); + + // Double wait to 2.0 + basic_retry.onFailure(500,headers); + should_retry = basic_retry.shouldRetry(wait_seconds); + ensure("basic_retry 2", should_retry); + ensure_approximately_equals("basic_retry 2", wait_seconds, 2.0F, frac_bits); + + // Hit max wait of 3.0 (4.0 clamped to max 3) + basic_retry.onFailure(500,headers); + should_retry = basic_retry.shouldRetry(wait_seconds); + ensure("basic_retry 3", should_retry); + ensure_approximately_equals("basic_retry 3", wait_seconds, 3.0F, frac_bits); + + // At max wait, should stay at 3.0 + basic_retry.onFailure(500,headers); + should_retry = basic_retry.shouldRetry(wait_seconds); + ensure("basic_retry 4", should_retry); + ensure_approximately_equals("basic_retry 4", wait_seconds, 3.0F, frac_bits); + + // Max retries, should fail now. + basic_retry.onFailure(500,headers); + should_retry = basic_retry.shouldRetry(wait_seconds); + ensure("basic_retry 5", !should_retry); +} + +// Retries should stop as soon as a non-5xx error is received. +template<> template<> +void RetryPolicyTestObject::test<4>() +{ + // Should retry after 1.0, 2.0, 3.0, 3.0 seconds. + LLAdaptiveRetryPolicy killer404(1.0,3.0,2.0,4); + LLSD headers; + F32 wait_seconds; + bool should_retry; + U32 frac_bits = 6; + + // Starting wait 1.0 + killer404.onFailure(500,headers); + should_retry = killer404.shouldRetry(wait_seconds); + ensure("killer404 1", should_retry); + ensure_approximately_equals("killer404 1", wait_seconds, 1.0F, frac_bits); + + // Double wait to 2.0 + killer404.onFailure(500,headers); + should_retry = killer404.shouldRetry(wait_seconds); + ensure("killer404 2", should_retry); + ensure_approximately_equals("killer404 2", wait_seconds, 2.0F, frac_bits); + + // Should fail on non-5xx + killer404.onFailure(404,headers); + should_retry = killer404.shouldRetry(wait_seconds); + ensure("killer404 3", !should_retry); + + // After a non-5xx, should keep failing. + killer404.onFailure(500,headers); + should_retry = killer404.shouldRetry(wait_seconds); + ensure("killer404 4", !should_retry); +} + +// Test handling of "retry-after" header. If present, this header +// value overrides the computed delay, but does not affect the +// progression of delay values. For example, if the normal +// progression of delays would be 1,2,4,8..., but the 2nd and 3rd calls +// get a retry header of 33, the pattern would become 1,33,33,8... +template<> template<> +void RetryPolicyTestObject::test<5>() +{ + LLAdaptiveRetryPolicy policy(1.0,25.0,2.0,6); + LLSD headers_with_retry; + headers_with_retry[HTTP_IN_HEADER_RETRY_AFTER] = "666"; + LLSD headers_without_retry; + F32 wait_seconds; + bool should_retry; + U32 frac_bits = 6; + + policy.onFailure(500,headers_without_retry); + should_retry = policy.shouldRetry(wait_seconds); + ensure("retry header 1", should_retry); + ensure_approximately_equals("retry header 1", wait_seconds, 1.0F, frac_bits); + + policy.onFailure(500,headers_without_retry); + should_retry = policy.shouldRetry(wait_seconds); + ensure("retry header 2", should_retry); + ensure_approximately_equals("retry header 2", wait_seconds, 2.0F, frac_bits); + + policy.onFailure(500,headers_with_retry); + should_retry = policy.shouldRetry(wait_seconds); + ensure("retry header 3", should_retry); + // 4.0 overrides by header -> 666.0 + ensure_approximately_equals("retry header 3", wait_seconds, 666.0F, frac_bits); + + policy.onFailure(500,headers_with_retry); + should_retry = policy.shouldRetry(wait_seconds); + ensure("retry header 4", should_retry); + // 8.0 overrides by header -> 666.0 + ensure_approximately_equals("retry header 4", wait_seconds, 666.0F, frac_bits); + + policy.onFailure(500,headers_without_retry); + should_retry = policy.shouldRetry(wait_seconds); + ensure("retry header 5", should_retry); + ensure_approximately_equals("retry header 5", wait_seconds, 16.0F, frac_bits); + + policy.onFailure(500,headers_without_retry); + should_retry = policy.shouldRetry(wait_seconds); + ensure("retry header 6", should_retry); + ensure_approximately_equals("retry header 6", wait_seconds, 25.0F, frac_bits); + + policy.onFailure(500,headers_with_retry); + should_retry = policy.shouldRetry(wait_seconds); + ensure("retry header 7", !should_retry); +} + +// Test getSecondsUntilRetryAfter(const std::string& retry_after, F32& seconds_to_wait), +// used by header parsing of the retry policy. +template<> template<> +void RetryPolicyTestObject::test<6>() +{ + F32 seconds_to_wait; + bool success; + + std::string str1("0"); + seconds_to_wait = F32_MAX; + success = getSecondsUntilRetryAfter(str1, seconds_to_wait); + ensure("parse 1", success); + ensure_equals("parse 1", seconds_to_wait, 0.0); + + std::string str2("999.9"); + seconds_to_wait = F32_MAX; + success = getSecondsUntilRetryAfter(str2, seconds_to_wait); + ensure("parse 2", success); + ensure_approximately_equals("parse 2", seconds_to_wait, 999.9F, 8); + + time_t nowseconds; + time(&nowseconds); + std::string str3 = LLDate((F64)nowseconds).asRFC1123(); + seconds_to_wait = F32_MAX; + success = getSecondsUntilRetryAfter(str3, seconds_to_wait); + ensure("parse 3", success); + ensure_approximately_equals("parse 3", seconds_to_wait, 0.0F, 6); +} + +// Test retry-after field in both llmessage and CoreHttp headers. +template<> template<> +void RetryPolicyTestObject::test<7>() +{ + LLSD sd_headers; + time_t nowseconds; + time(&nowseconds); + sd_headers[HTTP_IN_HEADER_RETRY_AFTER] = LLDate((F64)nowseconds).asRFC1123(); + LLAdaptiveRetryPolicy policy(17.0,644.0,3.0,10); + F32 seconds_to_wait; + bool should_retry; + + // no retry header, use default. + policy.onFailure(500,LLSD()); + should_retry = policy.shouldRetry(seconds_to_wait); + ensure("header 1", should_retry); + ensure_approximately_equals("header 1", seconds_to_wait, 17.0F, 6); + + // retry header should override, give delay of 0 + policy.onFailure(503,sd_headers); + should_retry = policy.shouldRetry(seconds_to_wait); + ensure("header 2", should_retry); + ensure_approximately_equals("header 2", seconds_to_wait, 0.0F, 6); + + // retry header in LLCore::HttpHeaders + { + LLCore::HttpResponse *response = new LLCore::HttpResponse(); + LLCore::HttpHeaders *headers = new LLCore::HttpHeaders(); + response->setStatus(503); + response->setHeaders(headers); + headers->mHeaders.push_back("retry-after: 600"); + policy.onFailure(response); + should_retry = policy.shouldRetry(seconds_to_wait); + ensure("header 3",should_retry); + ensure_approximately_equals("header 3", seconds_to_wait, 600.0F, 6); + response->release(); + } + + // retry header in LLCore::HttpHeaders + { + LLCore::HttpResponse *response = new LLCore::HttpResponse(); + LLCore::HttpHeaders *headers = new LLCore::HttpHeaders(); + response->setStatus(503); + response->setHeaders(headers); + LLSD sd_headers; + time(&nowseconds); + headers->mHeaders.push_back("retry-after: " + LLDate((F64)nowseconds).asRFC1123()); + policy.onFailure(response); + should_retry = policy.shouldRetry(seconds_to_wait); + ensure("header 3",should_retry); + ensure_approximately_equals("header 3", seconds_to_wait, 0.0F, 6); + response->release(); + } +} + +} + -- cgit v1.2.3 From 766daa73a29d34cb3410c033fc99bfc156844c92 Mon Sep 17 00:00:00 2001 From: "prep@lindenlab.com" <prep@lindenlab.com> Date: Fri, 12 Apr 2013 10:09:44 -0500 Subject: Sh-4035: Fix for skin changes not being reverted after cancel --- indra/newview/llsidepanelappearance.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview') diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp index 6d2b643434..7b89e0617b 100644 --- a/indra/newview/llsidepanelappearance.cpp +++ b/indra/newview/llsidepanelappearance.cpp @@ -90,6 +90,7 @@ bool LLSidepanelAppearance::callBackExitWithoutSaveViaClose(const LLSD& notifica S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if ( option == 0 ) { + mEditWearable->revertChanges(); LLAppearanceMgr::getInstance()->wearBaseOutfit(); mLLFloaterSidePanelContainer->close(); return true; -- cgit v1.2.3 From bb237ce15f0a7bc4a3fbffc45b1e4548fd1d2f81 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Fri, 12 Apr 2013 17:04:48 -0400 Subject: SH_4061 WIP - retry policy org and tests --- indra/newview/llhttpretrypolicy.cpp | 23 +++++++++++++++++- indra/newview/llhttpretrypolicy.h | 11 +-------- indra/newview/tests/llhttpretrypolicy_test.cpp | 33 +++++++++++++++++++++----- 3 files changed, 50 insertions(+), 17 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llhttpretrypolicy.cpp b/indra/newview/llhttpretrypolicy.cpp index 5c6dabbe99..82f6eab00e 100755 --- a/indra/newview/llhttpretrypolicy.cpp +++ b/indra/newview/llhttpretrypolicy.cpp @@ -28,6 +28,17 @@ #include "llhttpretrypolicy.h" +LLAdaptiveRetryPolicy::LLAdaptiveRetryPolicy(F32 min_delay, F32 max_delay, F32 backoff_factor, U32 max_retries): + mMinDelay(min_delay), + mMaxDelay(max_delay), + mBackoffFactor(backoff_factor), + mMaxRetries(max_retries), + mDelay(min_delay), + mRetryCount(0), + mShouldRetry(true) +{ +} + bool LLAdaptiveRetryPolicy::getRetryAfter(const LLSD& headers, F32& retry_header_time) { return (headers.has(HTTP_IN_HEADER_RETRY_AFTER) @@ -77,6 +88,11 @@ void LLAdaptiveRetryPolicy::onFailure(const LLCore::HttpResponse *response) void LLAdaptiveRetryPolicy::onFailureCommon(S32 status, bool has_retry_header_time, F32 retry_header_time) { + if (!mShouldRetry) + { + llinfos << "keep on failing" << llendl; + return; + } if (mRetryCount > 0) { mDelay = llclamp(mDelay*mBackoffFactor,mMinDelay,mMaxDelay); @@ -111,7 +127,12 @@ void LLAdaptiveRetryPolicy::onFailureCommon(S32 status, bool has_retry_header_ti bool LLAdaptiveRetryPolicy::shouldRetry(F32& seconds_to_wait) const { - llassert(mRetryCount>0); // have to call onFailure() before shouldRetry() + if (mRetryCount == 0) + { + // Called shouldRetry before any failure. + seconds_to_wait = F32_MAX; + return false; + } seconds_to_wait = mShouldRetry ? mRetryTimer.getRemainingTimeF32() : F32_MAX; return mShouldRetry; } diff --git a/indra/newview/llhttpretrypolicy.h b/indra/newview/llhttpretrypolicy.h index ca37e5f73c..6f63f047de 100755 --- a/indra/newview/llhttpretrypolicy.h +++ b/indra/newview/llhttpretrypolicy.h @@ -56,16 +56,7 @@ public: class LLAdaptiveRetryPolicy: public LLHTTPRetryPolicy { public: - LLAdaptiveRetryPolicy(F32 min_delay, F32 max_delay, F32 backoff_factor, U32 max_retries): - mMinDelay(min_delay), - mMaxDelay(max_delay), - mBackoffFactor(backoff_factor), - mMaxRetries(max_retries), - mDelay(min_delay), - mRetryCount(0), - mShouldRetry(true) - { - } + LLAdaptiveRetryPolicy(F32 min_delay, F32 max_delay, F32 backoff_factor, U32 max_retries); // virtual void onFailure(S32 status, const LLSD& headers); diff --git a/indra/newview/tests/llhttpretrypolicy_test.cpp b/indra/newview/tests/llhttpretrypolicy_test.cpp index 39bd15d62f..43fc1178cc 100755 --- a/indra/newview/tests/llhttpretrypolicy_test.cpp +++ b/indra/newview/tests/llhttpretrypolicy_test.cpp @@ -45,8 +45,12 @@ void RetryPolicyTestObject::test<1>() LLSD headers; F32 wait_seconds; + // No retry until we've finished a try. + ensure("never retry 0", !never_retry.shouldRetry(wait_seconds)); + + // 0 retries max. never_retry.onFailure(500,headers); - ensure("never retry", !never_retry.shouldRetry(wait_seconds)); + ensure("never retry 1", !never_retry.shouldRetry(wait_seconds)); } template<> template<> @@ -70,6 +74,9 @@ void RetryPolicyTestObject::test<3>() bool should_retry; U32 frac_bits = 6; + // No retry until we've finished a try. + ensure("basic_retry 0", !basic_retry.shouldRetry(wait_seconds)); + // Starting wait 1.0 basic_retry.onFailure(500,headers); should_retry = basic_retry.shouldRetry(wait_seconds); @@ -224,10 +231,13 @@ void RetryPolicyTestObject::test<7>() time_t nowseconds; time(&nowseconds); sd_headers[HTTP_IN_HEADER_RETRY_AFTER] = LLDate((F64)nowseconds).asRFC1123(); - LLAdaptiveRetryPolicy policy(17.0,644.0,3.0,10); + LLAdaptiveRetryPolicy policy(17.0,644.0,3.0,5); F32 seconds_to_wait; bool should_retry; + // No retry until we've finished a try. + ensure("header 0", !policy.shouldRetry(seconds_to_wait)); + // no retry header, use default. policy.onFailure(500,LLSD()); should_retry = policy.shouldRetry(seconds_to_wait); @@ -246,7 +256,7 @@ void RetryPolicyTestObject::test<7>() LLCore::HttpHeaders *headers = new LLCore::HttpHeaders(); response->setStatus(503); response->setHeaders(headers); - headers->mHeaders.push_back("retry-after: 600"); + headers->mHeaders.push_back(HTTP_IN_HEADER_RETRY_AFTER + ": 600"); policy.onFailure(response); should_retry = policy.shouldRetry(seconds_to_wait); ensure("header 3",should_retry); @@ -262,13 +272,24 @@ void RetryPolicyTestObject::test<7>() response->setHeaders(headers); LLSD sd_headers; time(&nowseconds); - headers->mHeaders.push_back("retry-after: " + LLDate((F64)nowseconds).asRFC1123()); + headers->mHeaders.push_back(HTTP_IN_HEADER_RETRY_AFTER + ": " + LLDate((F64)nowseconds).asRFC1123()); policy.onFailure(response); should_retry = policy.shouldRetry(seconds_to_wait); - ensure("header 3",should_retry); - ensure_approximately_equals("header 3", seconds_to_wait, 0.0F, 6); + ensure("header 4",should_retry); + ensure_approximately_equals("header 4", seconds_to_wait, 0.0F, 6); response->release(); } + + // Timeout should be clamped at max. + policy.onFailure(500,LLSD()); + should_retry = policy.shouldRetry(seconds_to_wait); + ensure("header 5", should_retry); + ensure_approximately_equals("header 5", seconds_to_wait, 644.0F, 6); + + // No more retries. + policy.onFailure(500,LLSD()); + should_retry = policy.shouldRetry(seconds_to_wait); + ensure("header 6", !should_retry); } } -- cgit v1.2.3 From 8868964b549822f260694c2bf26b903dbce8ed0a Mon Sep 17 00:00:00 2001 From: Monty Brandenberg <monty@lindenlab.com> Date: Mon, 15 Apr 2013 16:55:35 +0000 Subject: SH-4106 Significantly upgrade the HttpHeaders interface for SSB. Header container moves from a vector of raw lines to a vector of string pairs representing name/value pairs in headers. For incoming headers, we normalize the name to lowercase and trim it. Values are only left-trimmed. Outgoing headers are left as-is. Simple find() method for the common case, forward and reverse iterators for those few who need to do it themselves. The HTTP status line (e.g. 'HTTP/1.1 200 Ok') is no longer treated as a header to be returned to caller. Unit tests, as usual, were a bear but they absolutely ensured outgoing HTTP header conformance after the change. Grunt work paid off. LLTextureFetch was also given a second options structure for texture fetches. Same as the original but with header return to caller requested. Baked textures should use this, the other 20,000 texture fetch requests should continue to use the original. --- indra/newview/lltexturefetch.cpp | 17 +++++++++++++---- indra/newview/lltexturefetch.h | 3 ++- 2 files changed, 15 insertions(+), 5 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index cc6dc64626..5e12c341d5 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2000&license=viewerlgpl$ * Second Life Viewer Source Code - * Copyright (C) 2012, Linden Research, Inc. + * Copyright (C) 2012-2013, Linden Research, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -2376,6 +2376,7 @@ LLTextureFetch::LLTextureFetch(LLTextureCache* cache, LLImageDecodeThread* image mQAMode(qa_mode), mHttpRequest(NULL), mHttpOptions(NULL), + mHttpOptionsWithHeaders(NULL), mHttpHeaders(NULL), mHttpMetricsHeaders(NULL), mHttpPolicyClass(LLCore::HttpRequest::DEFAULT_POLICY_ID), @@ -2406,11 +2407,13 @@ LLTextureFetch::LLTextureFetch(LLTextureCache* cache, LLImageDecodeThread* image mHttpRequest = new LLCore::HttpRequest; mHttpOptions = new LLCore::HttpOptions; + mHttpOptionsWithHeaders = new LLCore::HttpOptions; + mHttpOptionsWithHeaders->setWantHeaders(true); mHttpHeaders = new LLCore::HttpHeaders; // *TODO: Should this be 'image/j2c' instead of 'image/x-j2c' ? - mHttpHeaders->mHeaders.push_back(HTTP_OUT_HEADER_ACCEPT + ": " + HTTP_CONTENT_IMAGE_X_J2C); + mHttpHeaders->append(HTTP_OUT_HEADER_ACCEPT, HTTP_CONTENT_IMAGE_X_J2C); mHttpMetricsHeaders = new LLCore::HttpHeaders; - mHttpMetricsHeaders->mHeaders.push_back(HTTP_OUT_HEADER_CONTENT_TYPE + ": " + HTTP_CONTENT_LLSD_XML); + mHttpMetricsHeaders->append(HTTP_OUT_HEADER_CONTENT_TYPE, HTTP_CONTENT_LLSD_XML); mHttpPolicyClass = LLAppViewer::instance()->getAppCoreHttp().getPolicyDefault(); } @@ -2431,6 +2434,12 @@ LLTextureFetch::~LLTextureFetch() mHttpOptions = NULL; } + if (mHttpOptionsWithHeaders) + { + mHttpOptionsWithHeaders->release(); + mHttpOptionsWithHeaders = NULL; + } + if (mHttpHeaders) { mHttpHeaders->release(); @@ -4043,7 +4052,7 @@ void LLTextureFetchDebugger::init() { mHttpHeaders = new LLCore::HttpHeaders; // *TODO: Should this be 'image/j2c' instead of 'image/x-j2c' ? - mHttpHeaders->mHeaders.push_back(HTTP_OUT_HEADER_ACCEPT + ": " + HTTP_CONTENT_IMAGE_X_J2C); + mHttpHeaders->append(HTTP_OUT_HEADER_ACCEPT, HTTP_CONTENT_IMAGE_X_J2C); } } diff --git a/indra/newview/lltexturefetch.h b/indra/newview/lltexturefetch.h index 902a3d7a25..3c79a5a24d 100644 --- a/indra/newview/lltexturefetch.h +++ b/indra/newview/lltexturefetch.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2000&license=viewerlgpl$ * Second Life Viewer Source Code - * Copyright (C) 2012, Linden Research, Inc. + * Copyright (C) 2012-2013, Linden Research, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -351,6 +351,7 @@ private: // LLCurl interfaces used in the past. LLCore::HttpRequest * mHttpRequest; // Ttf LLCore::HttpOptions * mHttpOptions; // Ttf + LLCore::HttpOptions * mHttpOptionsWithHeaders; // Ttf LLCore::HttpHeaders * mHttpHeaders; // Ttf LLCore::HttpHeaders * mHttpMetricsHeaders; // Ttf LLCore::HttpRequest::policy_t mHttpPolicyClass; // T* -- cgit v1.2.3 From 5976dc144e774ae363cbf774337ccf663015cc6d Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Mon, 15 Apr 2013 15:12:22 -0400 Subject: SH-4061 WIP - simulated failures/image fetch retries --- indra/newview/lltexturefetch.cpp | 113 ++++++++++++++++++++++++++++++-------- indra/newview/llviewertexture.cpp | 2 +- indra/newview/llvoavatar.cpp | 2 +- 3 files changed, 92 insertions(+), 25 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 026f36e205..8e78638c0a 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -63,6 +63,8 @@ #include "bufferarray.h" #include "bufferstream.h" +#include "llhttpretrypolicy.h" + bool LLTextureFetchDebugger::sDebuggerEnabled = false ; LLStat LLTextureFetch::sCacheHitRate("texture_cache_hits", 128); LLStat LLTextureFetch::sCacheReadLatency("texture_cache_read_latency", 128); @@ -244,6 +246,25 @@ static const S32 HTTP_REQUESTS_IN_QUEUE_LOW_WATER = 20; // Active level at whi ////////////////////////////////////////////////////////////////////////////// +static const char* e_state_name[] = +{ + "INVALID", + "INIT", + "LOAD_FROM_TEXTURE_CACHE", + "CACHE_POST", + "LOAD_FROM_NETWORK", + "LOAD_FROM_SIMULATOR", + "WAIT_HTTP_RESOURCE", + "WAIT_HTTP_RESOURCE2", + "SEND_HTTP_REQ", + "WAIT_HTTP_REQ", + "DECODE_IMAGE", + "DECODE_IMAGE_UPDATE", + "WRITE_TO_CACHE", + "WAIT_ON_WRITE", + "DONE" +}; + class LLTextureFetchWorker : public LLWorkerClass, public LLCore::HttpHandler { @@ -552,6 +573,8 @@ private: LLCore::HttpStatus mGetStatus; std::string mGetReason; bool mFakeFailure; + LLAdaptiveRetryPolicy mFetchRetryPolicy; + // Work Data LLMutex mWorkMutex; @@ -896,7 +919,8 @@ LLTextureFetchWorker::LLTextureFetchWorker(LLTextureFetch* fetcher, mCacheReadCount(0U), mCacheWriteCount(0U), mResourceWaitCount(0U), - mFakeFailure(fake_failure) + mFakeFailure(fake_failure), + mFetchRetryPolicy(15.0,15.0,1.0,10) { mCanUseNET = mUrl.empty() ; @@ -1277,6 +1301,20 @@ bool LLTextureFetchWorker::doWork(S32 param) if (mState == LOAD_FROM_NETWORK) { + // Check for retries to previous server failures. + F32 wait_seconds; + if (mFetchRetryPolicy.shouldRetry(wait_seconds)) + { + if (wait_seconds <= 0.0) + { + llinfos << mID << " retrying now" << llendl; + } + else + { + //llinfos << mID << " waiting to retry for " << wait_seconds << " seconds" << llendl; + return false; + } + } static LLCachedControl<bool> use_http(gSavedSettings,"ImagePipelineUseHTTP"); // if (mHost != LLHost::invalid) get_url = false; @@ -1557,6 +1595,10 @@ bool LLTextureFetchWorker::doWork(S32 param) else if (http_service_unavail == mGetStatus) { LL_INFOS_ONCE("Texture") << "Texture server busy (503): " << mUrl << LL_ENDL; + llinfos << "503: HTTP GET failed for: " << mUrl + << " Status: " << mGetStatus.toHex() + << " Reason: '" << mGetReason << "'" + << llendl; } else if (http_not_sat == mGetStatus) { @@ -1565,11 +1607,29 @@ bool LLTextureFetchWorker::doWork(S32 param) } else { - llinfos << "HTTP GET failed for: " << mUrl + llinfos << "other: HTTP GET failed for: " << mUrl << " Status: " << mGetStatus.toHex() << " Reason: '" << mGetReason << "'" << llendl; } +#if 0 + if (isHttpServerErrorStatus(mGetStatus.mType)) + { + // Check for retry + F32 wait_seconds; + if (mFetchRetryPolicy.shouldRetry(wait_seconds)) + { + llinfos << mID << " status " << (S32) mGetStatus.mType << " will retry after " << wait_seconds << llendl; + setState(INIT); + releaseHttpSemaphore(); + return false; + } + else + { + llinfos << mID << " will not retry on status " << (S32) mGetStatus.mType << llendl; + } + } +#endif mUrl.clear(); if (cur_size > 0) @@ -1907,12 +1967,33 @@ void LLTextureFetchWorker::onCompleted(LLCore::HttpHandle handle, LLCore::HttpRe if (mFakeFailure) { - llwarns << "For debugging, setting fake failure status for texture " << mID << llendl; + llwarns << mID << " for debugging, setting fake failure status for texture " << mID << llendl; response->setStatus(LLCore::HttpStatus(500)); + setFakeFailure(false); } bool success = true; bool partial = false; LLCore::HttpStatus status(response->getStatus()); + if (!status && (mFTType == FTT_SERVER_BAKE)) + { + llinfos << mID << " state " << e_state_name[mState] << llendl; + mFetchRetryPolicy.onFailure(response); + F32 retry_after; + if (mFetchRetryPolicy.shouldRetry(retry_after)) + { + llinfos << mID << " should retry after " << retry_after << ", resetting state to INIT" << llendl; + mFetcher->removeFromHTTPQueue(mID, 0); + std::string reason(status.toString()); + setGetStatus(status, reason); + releaseHttpSemaphore(); + setState(INIT); + return; + } + else + { + llinfos << mID << " should not retry" << llendl; + } + } LL_DEBUGS("Texture") << "HTTP COMPLETE: " << mID << " status: " << status.toHex() @@ -1934,7 +2015,7 @@ void LLTextureFetchWorker::onCompleted(LLCore::HttpHandle handle, LLCore::HttpRe success = false; if (mFTType != FTT_MAP_TILE) // missing map tiles are normal, don't complain about them. { - llwarns << "CURL GET FAILED, status: " << status.toHex() + llwarns << mID << " CURL GET FAILED, status: " << status.toHex() << " reason: " << reason << llendl; } } @@ -2488,7 +2569,11 @@ bool LLTextureFetch::createRequest(FTType f_type, const std::string& url, const { return false; } - + + if (f_type == FTT_SERVER_BAKE) + { + llinfos << " requesting " << id << " " << w << "x" << h << " discard " << desired_discard << llendl; + } LLTextureFetchWorker* worker = getWorker(id) ; if (worker) { @@ -3248,24 +3333,6 @@ bool LLTextureFetchWorker::insertPacket(S32 index, U8* data, S32 size) void LLTextureFetchWorker::setState(e_state new_state) { - static const char* e_state_name[] = - { - "INVALID", - "INIT", - "LOAD_FROM_TEXTURE_CACHE", - "CACHE_POST", - "LOAD_FROM_NETWORK", - "LOAD_FROM_SIMULATOR", - "WAIT_HTTP_RESOURCE", - "WAIT_HTTP_RESOURCE2", - "SEND_HTTP_REQ", - "WAIT_HTTP_REQ", - "DECODE_IMAGE", - "DECODE_IMAGE_UPDATE", - "WRITE_TO_CACHE", - "WAIT_ON_WRITE", - "DONE" - }; LL_DEBUGS("Texture") << "id: " << mID << " FTType: " << mFTType << " disc: " << mDesiredDiscard << " sz: " << mDesiredSize << " state: " << e_state_name[mState] << " => " << e_state_name[new_state] << llendl; mState = new_state; } diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 5f4c66a04c..8f7c8e40b7 100755 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -1826,7 +1826,7 @@ bool LLViewerFetchedTexture::updateFetch() // We finished but received no data if (current_discard < 0) { - const S32 MAX_FETCH_FAILURE = 3; + const S32 MAX_FETCH_FAILURE = 1; mFetchFailureCount++; if (getFTType() != FTT_MAP_TILE) { diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index cf4cc64ac3..a2ba8f36aa 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -7302,7 +7302,7 @@ void LLVOAvatar::useBakedTexture( const LLUUID& id ) LLViewerTexture* image_baked = getImage( mBakedTextureDatas[i].mTextureIndex, 0 ); if (id == image_baked->getID()) { - LL_DEBUGS("Avatar") << avString() << " i " << i << " id " << id << LL_ENDL; + //LL_DEBUGS("Avatar") << avString() << " i " << i << " id " << id << LL_ENDL; mBakedTextureDatas[i].mIsLoaded = true; mBakedTextureDatas[i].mLastTextureID = id; mBakedTextureDatas[i].mIsUsed = true; -- cgit v1.2.3 From 7182203ebf4ba914c3a49f9593b1ed831fa6c1e9 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Mon, 15 Apr 2013 17:46:28 -0400 Subject: SH-4061 WIP - moved all retry logic into lltexturefetch, some cleanup. Debug setting now defines a fake failure rate. --- indra/newview/app_settings/logcontrol.xml | 0 indra/newview/app_settings/settings.xml | 6 ++--- indra/newview/lltexturefetch.cpp | 37 +++++++++++++------------ indra/newview/lltexturefetch.h | 2 +- indra/newview/llviewertexture.cpp | 45 +++++++------------------------ indra/newview/llviewertexture.h | 1 - 6 files changed, 33 insertions(+), 58 deletions(-) mode change 100644 => 100755 indra/newview/app_settings/logcontrol.xml (limited to 'indra/newview') diff --git a/indra/newview/app_settings/logcontrol.xml b/indra/newview/app_settings/logcontrol.xml old mode 100644 new mode 100755 diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 0b7f99ebc1..18a33b3542 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -11130,16 +11130,16 @@ <key>Value</key> <integer>0</integer> </map> - <key>TextureFetchFakeFailures</key> + <key>TextureFetchFakeFailureRate</key> <map> <key>Comment</key> <string>Simulate HTTP fetch failures for some server bake textures.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>F32</string> <key>Value</key> - <integer>0</integer> + <integer>0.0</integer> </map> <key>TextureFetchSource</key> <map> diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 8e78638c0a..2cebd4b6eb 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -410,13 +410,11 @@ public: // Inherited from LLCore::HttpHandler // Threads: Ttf virtual void onCompleted(LLCore::HttpHandle handle, LLCore::HttpResponse * response); - - void setFakeFailure(bool fake_failure) { mFakeFailure = fake_failure; } protected: LLTextureFetchWorker(LLTextureFetch* fetcher, FTType f_type, const std::string& url, const LLUUID& id, const LLHost& host, - F32 priority, S32 discard, S32 size, bool fake_failure); + F32 priority, S32 discard, S32 size); private: @@ -572,7 +570,6 @@ private: S32 mActiveCount; LLCore::HttpStatus mGetStatus; std::string mGetReason; - bool mFakeFailure; LLAdaptiveRetryPolicy mFetchRetryPolicy; @@ -864,8 +861,7 @@ LLTextureFetchWorker::LLTextureFetchWorker(LLTextureFetch* fetcher, const LLHost& host, // Simulator host F32 priority, // Priority S32 discard, // Desired discard - S32 size, // Desired size - bool fake_failure) // For testing, simulate http failure if true. + S32 size) // Desired size : LLWorkerClass(fetcher, "TextureFetch"), LLCore::HttpHandler(), mState(INIT), @@ -919,7 +915,6 @@ LLTextureFetchWorker::LLTextureFetchWorker(LLTextureFetch* fetcher, mCacheReadCount(0U), mCacheWriteCount(0U), mResourceWaitCount(0U), - mFakeFailure(fake_failure), mFetchRetryPolicy(15.0,15.0,1.0,10) { mCanUseNET = mUrl.empty() ; @@ -1179,6 +1174,7 @@ bool LLTextureFetchWorker::doWork(S32 param) mDesiredSize = llmax(mDesiredSize, TEXTURE_CACHE_ENTRY_SIZE); // min desired size is TEXTURE_CACHE_ENTRY_SIZE LL_DEBUGS("Texture") << mID << ": Priority: " << llformat("%8.0f",mImagePriority) << " Desired Discard: " << mDesiredDiscard << " Desired Size: " << mDesiredSize << LL_ENDL; + // fall through } @@ -1315,6 +1311,7 @@ bool LLTextureFetchWorker::doWork(S32 param) return false; } } + static LLCachedControl<bool> use_http(gSavedSettings,"ImagePipelineUseHTTP"); // if (mHost != LLHost::invalid) get_url = false; @@ -1965,11 +1962,14 @@ void LLTextureFetchWorker::onCompleted(LLCore::HttpHandle handle, LLCore::HttpRe mFetcher->mTextureInfo.setRequestCompleteTimeAndLog(mID, timeNow); } - if (mFakeFailure) + static LLCachedControl<F32> fake_failure_rate(gSavedSettings, "TextureFetchFakeFailureRate"); + F32 rand_val = ll_frand(); + F32 rate = fake_failure_rate; + if (mFTType == FTT_SERVER_BAKE && (fake_failure_rate > 0.0) && (rand_val < fake_failure_rate)) { - llwarns << mID << " for debugging, setting fake failure status for texture " << mID << llendl; - response->setStatus(LLCore::HttpStatus(500)); - setFakeFailure(false); + llwarns << mID << " for debugging, setting fake failure status for texture " << mID + << " (rand was " << rand_val << "/" << rate << ")" << llendl; + response->setStatus(LLCore::HttpStatus(503)); } bool success = true; bool partial = false; @@ -1981,12 +1981,12 @@ void LLTextureFetchWorker::onCompleted(LLCore::HttpHandle handle, LLCore::HttpRe F32 retry_after; if (mFetchRetryPolicy.shouldRetry(retry_after)) { - llinfos << mID << " should retry after " << retry_after << ", resetting state to INIT" << llendl; + llinfos << mID << " should retry after " << retry_after << ", resetting state to LOAD_FROM_NETWORK" << llendl; mFetcher->removeFromHTTPQueue(mID, 0); std::string reason(status.toString()); setGetStatus(status, reason); releaseHttpSemaphore(); - setState(INIT); + setState(LOAD_FROM_NETWORK); return; } else @@ -2559,7 +2559,7 @@ LLTextureFetch::~LLTextureFetch() } bool LLTextureFetch::createRequest(FTType f_type, const std::string& url, const LLUUID& id, const LLHost& host, F32 priority, - S32 w, S32 h, S32 c, S32 desired_discard, bool needs_aux, bool can_use_http, bool fake_failure) + S32 w, S32 h, S32 c, S32 desired_discard, bool needs_aux, bool can_use_http) { if(mFetcherLocked) { @@ -2633,7 +2633,6 @@ bool LLTextureFetch::createRequest(FTType f_type, const std::string& url, const worker->setDesiredDiscard(desired_discard, desired_size); worker->setCanUseHTTP(can_use_http); worker->setUrl(url); - worker->setFakeFailure(fake_failure); if (!worker->haveWork()) { worker->setState(LLTextureFetchWorker::INIT); @@ -2648,7 +2647,7 @@ bool LLTextureFetch::createRequest(FTType f_type, const std::string& url, const } else { - worker = new LLTextureFetchWorker(this, f_type, url, id, host, priority, desired_discard, desired_size, fake_failure); + worker = new LLTextureFetchWorker(this, f_type, url, id, host, priority, desired_discard, desired_size); lockQueue(); // +Mfq mRequestMap[id] = worker; unlockQueue(); // -Mfq @@ -3333,7 +3332,11 @@ bool LLTextureFetchWorker::insertPacket(S32 index, U8* data, S32 size) void LLTextureFetchWorker::setState(e_state new_state) { - LL_DEBUGS("Texture") << "id: " << mID << " FTType: " << mFTType << " disc: " << mDesiredDiscard << " sz: " << mDesiredSize << " state: " << e_state_name[mState] << " => " << e_state_name[new_state] << llendl; + if (mFTType == FTT_SERVER_BAKE) + { +// LL_INFOS("Texture") << "id: " << mID << " FTType: " << mFTType << " disc: " << mDesiredDiscard << " sz: " << mDesiredSize << " state: " << e_state_name[mState] << " => " << e_state_name[new_state] << llendl; + } +// LL_DEBUGS("Texture") << "id: " << mID << " FTType: " << mFTType << " disc: " << mDesiredDiscard << " sz: " << mDesiredSize << " state: " << e_state_name[mState] << " => " << e_state_name[new_state] << llendl; mState = new_state; } diff --git a/indra/newview/lltexturefetch.h b/indra/newview/lltexturefetch.h index 12226d51c8..5e2b55dbbb 100755 --- a/indra/newview/lltexturefetch.h +++ b/indra/newview/lltexturefetch.h @@ -78,7 +78,7 @@ public: // Threads: T* (but Tmain mostly) bool createRequest(FTType f_type, const std::string& url, const LLUUID& id, const LLHost& host, F32 priority, - S32 w, S32 h, S32 c, S32 discard, bool needs_aux, bool can_use_http, bool fake_failure); + S32 w, S32 h, S32 c, S32 discard, bool needs_aux, bool can_use_http); // Requests that a fetch operation be deleted from the queue. // If @cancel is true, also stops any I/O operations pending. diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 8f7c8e40b7..45b402f0f6 100755 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -962,8 +962,6 @@ void LLViewerFetchedTexture::init(bool firstinit) // does not contain this image. mIsMissingAsset = FALSE; - mFetchFailureCount = 0; - mLoadedCallbackDesiredDiscardLevel = S8_MAX; mPauseLoadedCallBacks = FALSE ; @@ -1826,35 +1824,17 @@ bool LLViewerFetchedTexture::updateFetch() // We finished but received no data if (current_discard < 0) { - const S32 MAX_FETCH_FAILURE = 1; - mFetchFailureCount++; if (getFTType() != FTT_MAP_TILE) { - llwarns << "Fetch failure for " << mID << " failure count " << mFetchFailureCount - << " status " << mLastHttpGetStatus.toHex() << llendl; - } - // Will retry server-bake textures under a limited set of circumstances. - if (getFTType() == FTT_SERVER_BAKE && - mLastHttpGetStatus.isHttpStatus() && - mLastHttpGetStatus.mType >= 500 && - mLastHttpGetStatus.mType <= 599 && // Only retry 5xx failures. - mFetchFailureCount < MAX_FETCH_FAILURE) - { - llwarns << "Will retry fetch" << llendl; - } - else // Otherwise, assume the image is missing. - { - if (getFTType() != FTT_MAP_TILE) - { - llwarns << "!mIsFetching, setting as missing, decode_priority " << decode_priority - << " mRawDiscardLevel " << mRawDiscardLevel - << " current_discard " << current_discard - << " stats " << mLastHttpGetStatus.toHex() - << llendl; - } - setIsMissingAsset(); - desired_discard = -1; + llwarns << mID + << " Fetch failure, setting as missing, decode_priority " << decode_priority + << " mRawDiscardLevel " << mRawDiscardLevel + << " current_discard " << current_discard + << " stats " << mLastHttpGetStatus.toHex() + << llendl; } + setIsMissingAsset(); + desired_discard = -1; } else { @@ -1968,14 +1948,8 @@ bool LLViewerFetchedTexture::updateFetch() // bypass texturefetch directly by pulling from LLTextureCache bool fetch_request_created = false; - bool fake_failure = false; - const bool debug_setting_fake_failures = gSavedSettings.getBOOL("TextureFetchFakeFailures"); - if (getFTType() == FTT_SERVER_BAKE && mFetchFailureCount == 0 && debug_setting_fake_failures) - { - fake_failure = true; - } fetch_request_created = LLAppViewer::getTextureFetch()->createRequest(mFTType, mUrl, getID(), getTargetHost(), decode_priority, - w, h, c, desired_discard, needsAux(), mCanUseHTTP, fake_failure); + w, h, c, desired_discard, needsAux(), mCanUseHTTP); if (fetch_request_created) { @@ -2072,7 +2046,6 @@ void LLViewerFetchedTexture::setIsMissingAsset(BOOL is_missing) else { llinfos << mID << ": un-flagging missing asset" << llendl; - mFetchFailureCount = 0; } mIsMissingAsset = is_missing; } diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index 91e903ffd6..bf6aadd218 100755 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -452,7 +452,6 @@ protected: FTType mFTType; // What category of image is this - map tile, server bake, etc? mutable BOOL mIsMissingAsset; // True if we know that there is no image asset with this image id in the database. - S32 mFetchFailureCount; // How many times has a fetch failed in a way that suggests the asset is missing? typedef std::list<LLLoadedCallbackEntry*> callback_list_t; S8 mLoadedCallbackDesiredDiscardLevel; -- cgit v1.2.3 From 68cdbf387cf876da8833157b76048991120dc3f6 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Mon, 15 Apr 2013 18:03:31 -0400 Subject: SH-4061 WIP - comments, timing of retries --- indra/newview/lltexturefetch.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 2cebd4b6eb..7b719190a4 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -915,7 +915,7 @@ LLTextureFetchWorker::LLTextureFetchWorker(LLTextureFetch* fetcher, mCacheReadCount(0U), mCacheWriteCount(0U), mResourceWaitCount(0U), - mFetchRetryPolicy(15.0,15.0,1.0,10) + mFetchRetryPolicy(10.0,3600.0,2.0,10) { mCanUseNET = mUrl.empty() ; @@ -1981,7 +1981,7 @@ void LLTextureFetchWorker::onCompleted(LLCore::HttpHandle handle, LLCore::HttpRe F32 retry_after; if (mFetchRetryPolicy.shouldRetry(retry_after)) { - llinfos << mID << " should retry after " << retry_after << ", resetting state to LOAD_FROM_NETWORK" << llendl; + llinfos << mID << " will retry after " << retry_after << " seconds, resetting state to LOAD_FROM_NETWORK" << llendl; mFetcher->removeFromHTTPQueue(mID, 0); std::string reason(status.toString()); setGetStatus(status, reason); @@ -1991,7 +1991,7 @@ void LLTextureFetchWorker::onCompleted(LLCore::HttpHandle handle, LLCore::HttpRe } else { - llinfos << mID << " should not retry" << llendl; + llinfos << mID << " will not retry" << llendl; } } @@ -3334,9 +3334,12 @@ void LLTextureFetchWorker::setState(e_state new_state) { if (mFTType == FTT_SERVER_BAKE) { + // NOTE: turning on these log statements is a reliable way to get + // blurry images fairly frequently. Presumably this is an + // indication of some subtle timing or locking issue. + // LL_INFOS("Texture") << "id: " << mID << " FTType: " << mFTType << " disc: " << mDesiredDiscard << " sz: " << mDesiredSize << " state: " << e_state_name[mState] << " => " << e_state_name[new_state] << llendl; } -// LL_DEBUGS("Texture") << "id: " << mID << " FTType: " << mFTType << " disc: " << mDesiredDiscard << " sz: " << mDesiredSize << " state: " << e_state_name[mState] << " => " << e_state_name[new_state] << llendl; mState = new_state; } -- cgit v1.2.3 From 24b9657597be6d0b7af472d5deda4b4828ead606 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Mon, 15 Apr 2013 20:35:26 -0400 Subject: SH-4061 WIP - improved retry policy test, turned up and fixed a bug in getSecondsUntilRetryAfter --- indra/newview/tests/llhttpretrypolicy_test.cpp | 70 +++++++++++++------------- 1 file changed, 36 insertions(+), 34 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/tests/llhttpretrypolicy_test.cpp b/indra/newview/tests/llhttpretrypolicy_test.cpp index 42bb9abe90..6fa3a57364 100755 --- a/indra/newview/tests/llhttpretrypolicy_test.cpp +++ b/indra/newview/tests/llhttpretrypolicy_test.cpp @@ -216,21 +216,23 @@ void RetryPolicyTestObject::test<6>() time_t nowseconds; time(&nowseconds); - std::string str3 = LLDate((F64)nowseconds).asRFC1123(); + std::string str3 = LLDate((F64)(nowseconds+44)).asRFC1123(); seconds_to_wait = F32_MAX; success = getSecondsUntilRetryAfter(str3, seconds_to_wait); + std::cerr << " str3 [" << str3 << "]" << std::endl; ensure("parse 3", success); - ensure_approximately_equals("parse 3", seconds_to_wait, 0.0F, 6); + ensure_approximately_equals("parse 3", seconds_to_wait, 44.0F, 2); } // Test retry-after field in both llmessage and CoreHttp headers. template<> template<> void RetryPolicyTestObject::test<7>() { + std::cerr << "7 starts" << std::endl; + LLSD sd_headers; time_t nowseconds; time(&nowseconds); - sd_headers[HTTP_IN_HEADER_RETRY_AFTER] = LLDate((F64)nowseconds).asRFC1123(); LLAdaptiveRetryPolicy policy(17.0,644.0,3.0,5); F32 seconds_to_wait; bool should_retry; @@ -245,40 +247,40 @@ void RetryPolicyTestObject::test<7>() ensure_approximately_equals("header 1", seconds_to_wait, 17.0F, 6); // retry header should override, give delay of 0 + std::string date_string = LLDate((F64)(nowseconds+7)).asRFC1123(); + sd_headers[HTTP_IN_HEADER_RETRY_AFTER] = date_string; policy.onFailure(503,sd_headers); should_retry = policy.shouldRetry(seconds_to_wait); ensure("header 2", should_retry); - ensure_approximately_equals("header 2", seconds_to_wait, 0.0F, 6); - - // retry header in LLCore::HttpHeaders - { - LLCore::HttpResponse *response = new LLCore::HttpResponse(); - LLCore::HttpHeaders *headers = new LLCore::HttpHeaders(); - response->setStatus(503); - response->setHeaders(headers); - headers->append(HTTP_IN_HEADER_RETRY_AFTER, std::string("600")); - policy.onFailure(response); - should_retry = policy.shouldRetry(seconds_to_wait); - ensure("header 3",should_retry); - ensure_approximately_equals("header 3", seconds_to_wait, 600.0F, 6); - response->release(); - } - - // retry header in LLCore::HttpHeaders - { - LLCore::HttpResponse *response = new LLCore::HttpResponse(); - LLCore::HttpHeaders *headers = new LLCore::HttpHeaders(); - response->setStatus(503); - response->setHeaders(headers); - LLSD sd_headers; - time(&nowseconds); - headers->append(HTTP_IN_HEADER_RETRY_AFTER,LLDate((F64)nowseconds).asRFC1123()); - policy.onFailure(response); - should_retry = policy.shouldRetry(seconds_to_wait); - ensure("header 4",should_retry); - ensure_approximately_equals("header 4", seconds_to_wait, 0.0F, 6); - response->release(); - } + ensure_approximately_equals("header 2", seconds_to_wait, 7.0F, 2); + + LLCore::HttpResponse *response; + LLCore::HttpHeaders *headers; + + response = new LLCore::HttpResponse(); + headers = new LLCore::HttpHeaders(); + response->setStatus(503); + response->setHeaders(headers); + headers->append(HTTP_IN_HEADER_RETRY_AFTER, std::string("600")); + policy.onFailure(response); + should_retry = policy.shouldRetry(seconds_to_wait); + ensure("header 3",should_retry); + ensure_approximately_equals("header 3", seconds_to_wait, 600.0F, 6); + response->release(); + + response = new LLCore::HttpResponse(); + headers = new LLCore::HttpHeaders(); + response->setStatus(503); + response->setHeaders(headers); + time(&nowseconds); + date_string = LLDate((F64)(nowseconds+77)).asRFC1123(); + std::cerr << "date_string [" << date_string << "]" << std::endl; + headers->append(HTTP_IN_HEADER_RETRY_AFTER,date_string); + policy.onFailure(response); + should_retry = policy.shouldRetry(seconds_to_wait); + ensure("header 4",should_retry); + ensure_approximately_equals("header 4", seconds_to_wait, 77.0F, 2); + response->release(); // Timeout should be clamped at max. policy.onFailure(500,LLSD()); -- cgit v1.2.3 From 9cbbb45a0ca8a56707125cdb3f6ea95de7f9deef Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Tue, 16 Apr 2013 09:19:35 -0400 Subject: SH-4061 WIP - cleanup --- indra/newview/lltexturefetch.cpp | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index ce7bd61ce4..1a6a308230 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -1609,24 +1609,6 @@ bool LLTextureFetchWorker::doWork(S32 param) << " Reason: '" << mGetReason << "'" << llendl; } -#if 0 - if (isHttpServerErrorStatus(mGetStatus.mType)) - { - // Check for retry - F32 wait_seconds; - if (mFetchRetryPolicy.shouldRetry(wait_seconds)) - { - llinfos << mID << " status " << (S32) mGetStatus.mType << " will retry after " << wait_seconds << llendl; - setState(INIT); - releaseHttpSemaphore(); - return false; - } - else - { - llinfos << mID << " will not retry on status " << (S32) mGetStatus.mType << llendl; - } - } -#endif mUrl.clear(); if (cur_size > 0) -- cgit v1.2.3 From 0a413e1dc82bbe18c5c9fe510b10e33f8fb0a93c Mon Sep 17 00:00:00 2001 From: "prep@lindenlab.com" <prep@lindenlab.com> Date: Tue, 16 Apr 2013 11:54:16 -0500 Subject: Fix for SH-4108 - observer does not see the outfit change when closing appearance panel. --- indra/newview/llsidepanelappearance.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview') diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp index 7b89e0617b..3c21219dc1 100644 --- a/indra/newview/llsidepanelappearance.cpp +++ b/indra/newview/llsidepanelappearance.cpp @@ -136,6 +136,7 @@ void LLSidepanelAppearance::onClose(LLFloaterSidePanelContainer* obj) } else { + LLVOAvatarSelf::onCustomizeEnd(FALSE); mLLFloaterSidePanelContainer->close(); } } -- cgit v1.2.3 From e3bad9fb86c3f44ad67488402ce2e46743a2422e Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Tue, 16 Apr 2013 20:27:49 -0400 Subject: SH-4061 WIP - fix for build issues on mac, reset the retry policy on success. --- indra/newview/llhttpretrypolicy.cpp | 18 ++++++++++--- indra/newview/llhttpretrypolicy.h | 16 +++++++++--- indra/newview/lltexturefetch.cpp | 4 +++ indra/newview/tests/llhttpretrypolicy_test.cpp | 35 +++++++++++++++++++++----- 4 files changed, 59 insertions(+), 14 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llhttpretrypolicy.cpp b/indra/newview/llhttpretrypolicy.cpp index 10b923be5a..80d97e4362 100755 --- a/indra/newview/llhttpretrypolicy.cpp +++ b/indra/newview/llhttpretrypolicy.cpp @@ -32,11 +32,16 @@ LLAdaptiveRetryPolicy::LLAdaptiveRetryPolicy(F32 min_delay, F32 max_delay, F32 b mMinDelay(min_delay), mMaxDelay(max_delay), mBackoffFactor(backoff_factor), - mMaxRetries(max_retries), - mDelay(min_delay), - mRetryCount(0), - mShouldRetry(true) + mMaxRetries(max_retries) { + init(); +} + +void LLAdaptiveRetryPolicy::init() +{ + mDelay = mMinDelay; + mRetryCount = 0; + mShouldRetry = true; } bool LLAdaptiveRetryPolicy::getRetryAfter(const LLSD& headers, F32& retry_header_time) @@ -59,6 +64,11 @@ bool LLAdaptiveRetryPolicy::getRetryAfter(const LLCore::HttpHeaders *headers, F3 return false; } +void LLAdaptiveRetryPolicy::onSuccess() +{ + init(); +} + void LLAdaptiveRetryPolicy::onFailure(S32 status, const LLSD& headers) { F32 retry_header_time; diff --git a/indra/newview/llhttpretrypolicy.h b/indra/newview/llhttpretrypolicy.h index 6f63f047de..1fb0cac03f 100755 --- a/indra/newview/llhttpretrypolicy.h +++ b/indra/newview/llhttpretrypolicy.h @@ -42,7 +42,11 @@ class LLHTTPRetryPolicy: public LLThreadSafeRefCount { public: LLHTTPRetryPolicy() {} + virtual ~LLHTTPRetryPolicy() {} + // Call after a sucess to reset retry state. + + virtual void onSuccess() = 0; // Call once after an HTTP failure to update state. virtual void onFailure(S32 status, const LLSD& headers) = 0; @@ -58,6 +62,9 @@ class LLAdaptiveRetryPolicy: public LLHTTPRetryPolicy public: LLAdaptiveRetryPolicy(F32 min_delay, F32 max_delay, F32 backoff_factor, U32 max_retries); + // virtual + void onSuccess(); + // virtual void onFailure(S32 status, const LLSD& headers); // virtual @@ -66,16 +73,17 @@ public: bool shouldRetry(F32& seconds_to_wait) const; protected: + void init(); bool getRetryAfter(const LLSD& headers, F32& retry_header_time); bool getRetryAfter(const LLCore::HttpHeaders *headers, F32& retry_header_time); void onFailureCommon(S32 status, bool has_retry_header_time, F32 retry_header_time); private: - F32 mMinDelay; // delay never less than this value - F32 mMaxDelay; // delay never exceeds this value - F32 mBackoffFactor; // delay increases by this factor after each retry, up to mMaxDelay. - U32 mMaxRetries; // maximum number of times shouldRetry will return true. + const F32 mMinDelay; // delay never less than this value + const F32 mMaxDelay; // delay never exceeds this value + const F32 mBackoffFactor; // delay increases by this factor after each retry, up to mMaxDelay. + const U32 mMaxRetries; // maximum number of times shouldRetry will return true. F32 mDelay; // current default delay. U32 mRetryCount; // number of times shouldRetry has been called. LLTimer mRetryTimer; // time until next retry. diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 1a6a308230..774c925fa1 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -1976,6 +1976,10 @@ void LLTextureFetchWorker::onCompleted(LLCore::HttpHandle handle, LLCore::HttpRe llinfos << mID << " will not retry" << llendl; } } + else + { + mFetchRetryPolicy.onSuccess(); + } LL_DEBUGS("Texture") << "HTTP COMPLETE: " << mID << " status: " << status.toHex() diff --git a/indra/newview/tests/llhttpretrypolicy_test.cpp b/indra/newview/tests/llhttpretrypolicy_test.cpp index 6fa3a57364..ed7f3ba326 100755 --- a/indra/newview/tests/llhttpretrypolicy_test.cpp +++ b/indra/newview/tests/llhttpretrypolicy_test.cpp @@ -45,7 +45,7 @@ void RetryPolicyTestObject::test<1>() LLSD headers; F32 wait_seconds; - // No retry until we've finished a try. + // No retry until we've failed a try. ensure("never retry 0", !never_retry.shouldRetry(wait_seconds)); // 0 retries max. @@ -74,7 +74,7 @@ void RetryPolicyTestObject::test<3>() bool should_retry; U32 frac_bits = 6; - // No retry until we've finished a try. + // No retry until we've failed a try. ensure("basic_retry 0", !basic_retry.shouldRetry(wait_seconds)); // Starting wait 1.0 @@ -105,6 +105,29 @@ void RetryPolicyTestObject::test<3>() basic_retry.onFailure(500,headers); should_retry = basic_retry.shouldRetry(wait_seconds); ensure("basic_retry 5", !should_retry); + + // Max retries, should fail now. + basic_retry.onFailure(500,headers); + should_retry = basic_retry.shouldRetry(wait_seconds); + ensure("basic_retry 5", !should_retry); + + // After a success, should reset to the starting state. + basic_retry.onSuccess(); + + // No retry until we've failed a try. + ensure("basic_retry 6", !basic_retry.shouldRetry(wait_seconds)); + + // Starting wait 1.0 + basic_retry.onFailure(500,headers); + should_retry = basic_retry.shouldRetry(wait_seconds); + ensure("basic_retry 7", should_retry); + ensure_approximately_equals("basic_retry 7", wait_seconds, 1.0F, frac_bits); + + // Double wait to 2.0 + basic_retry.onFailure(500,headers); + should_retry = basic_retry.shouldRetry(wait_seconds); + ensure("basic_retry 8", should_retry); + ensure_approximately_equals("basic_retry 8", wait_seconds, 2.0F, frac_bits); } // Retries should stop as soon as a non-5xx error is received. @@ -221,7 +244,7 @@ void RetryPolicyTestObject::test<6>() success = getSecondsUntilRetryAfter(str3, seconds_to_wait); std::cerr << " str3 [" << str3 << "]" << std::endl; ensure("parse 3", success); - ensure_approximately_equals("parse 3", seconds_to_wait, 44.0F, 2); + ensure_approximately_equals_range("parse 3", seconds_to_wait, 44.0F, 2.0F); } // Test retry-after field in both llmessage and CoreHttp headers. @@ -237,7 +260,7 @@ void RetryPolicyTestObject::test<7>() F32 seconds_to_wait; bool should_retry; - // No retry until we've finished a try. + // No retry until we've failed a try. ensure("header 0", !policy.shouldRetry(seconds_to_wait)); // no retry header, use default. @@ -252,7 +275,7 @@ void RetryPolicyTestObject::test<7>() policy.onFailure(503,sd_headers); should_retry = policy.shouldRetry(seconds_to_wait); ensure("header 2", should_retry); - ensure_approximately_equals("header 2", seconds_to_wait, 7.0F, 2); + ensure_approximately_equals_range("header 2", seconds_to_wait, 7.0F, 2.0F); LLCore::HttpResponse *response; LLCore::HttpHeaders *headers; @@ -279,7 +302,7 @@ void RetryPolicyTestObject::test<7>() policy.onFailure(response); should_retry = policy.shouldRetry(seconds_to_wait); ensure("header 4",should_retry); - ensure_approximately_equals("header 4", seconds_to_wait, 77.0F, 2); + ensure_approximately_equals_range("header 4", seconds_to_wait, 77.0F, 2.0F); response->release(); // Timeout should be clamped at max. -- cgit v1.2.3 From 8cf67fe50cfa070e5aa786acdb9bce58c350d840 Mon Sep 17 00:00:00 2001 From: prep <prep@lindenlab.com> Date: Wed, 17 Apr 2013 10:33:33 -0400 Subject: Fix for SH-4104: Inventory window does not close --- indra/newview/llfloatersidepanelcontainer.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llfloatersidepanelcontainer.cpp b/indra/newview/llfloatersidepanelcontainer.cpp index b1f9a18d6f..4dd558c9c0 100644 --- a/indra/newview/llfloatersidepanelcontainer.cpp +++ b/indra/newview/llfloatersidepanelcontainer.cpp @@ -69,6 +69,10 @@ void LLFloaterSidePanelContainer::onClickCloseBtn() LLSidepanelAppearance* panel_appearance = dynamic_cast<LLSidepanelAppearance*>(getPanel("appearance")); panel_appearance->onClose(this); } + else + { + LLFloater::onClickCloseBtn(); + } } else { -- cgit v1.2.3 From 392f561b6c28aede2b61bc9cc2cc75de587926b6 Mon Sep 17 00:00:00 2001 From: prep <prep@lindenlab.com> Date: Wed, 17 Apr 2013 11:08:40 -0400 Subject: Fix for SH-4123: outfit update corrected for edit/save/abandon sequence --- indra/newview/llsidepanelappearance.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp index 3c21219dc1..75da23b558 100644 --- a/indra/newview/llsidepanelappearance.cpp +++ b/indra/newview/llsidepanelappearance.cpp @@ -90,8 +90,9 @@ bool LLSidepanelAppearance::callBackExitWithoutSaveViaClose(const LLSD& notifica S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if ( option == 0 ) { + //revert curernt edits mEditWearable->revertChanges(); - LLAppearanceMgr::getInstance()->wearBaseOutfit(); + LLVOAvatarSelf::onCustomizeEnd(FALSE); mLLFloaterSidePanelContainer->close(); return true; } -- cgit v1.2.3 From b224b8978adfd42c89e1c66bc5495ead8fa1e85d Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Wed, 17 Apr 2013 11:32:23 -0400 Subject: SH-4061 WIP - request headers for server-bake images --- indra/newview/lltexturefetch.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 774c925fa1..346374ef4e 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -1524,12 +1524,14 @@ bool LLTextureFetchWorker::doWork(S32 param) << LL_ENDL; // Will call callbackHttpGet when curl request completes + // Only server bake images use the returned headers currently, for getting retry-after field. + HttpOptions *options = (mFTType == FTT_SERVER_BAKE) ? mFetcher->mHttpOptionsWithHeaders: mFetcher->mHttpOptions; mHttpHandle = mFetcher->mHttpRequest->requestGetByteRange(mHttpPolicyClass, mWorkPriority, mUrl, mRequestedOffset, mRequestedSize, - mFetcher->mHttpOptions, + options, mFetcher->mHttpHeaders, this); } -- cgit v1.2.3 From b29e6f656eb28d557ef4488a022b6757a58d29e1 Mon Sep 17 00:00:00 2001 From: prep <prep@lindenlab.com> Date: Wed, 17 Apr 2013 11:32:49 -0400 Subject: Fix for SH-4124: Closing appearance panel also closes the edit wearable panel if it was active --- indra/newview/llsidepanelappearance.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp index 75da23b558..77e9604460 100644 --- a/indra/newview/llsidepanelappearance.cpp +++ b/indra/newview/llsidepanelappearance.cpp @@ -92,6 +92,7 @@ bool LLSidepanelAppearance::callBackExitWithoutSaveViaClose(const LLSD& notifica { //revert curernt edits mEditWearable->revertChanges(); + toggleWearableEditPanel(FALSE); LLVOAvatarSelf::onCustomizeEnd(FALSE); mLLFloaterSidePanelContainer->close(); return true; @@ -138,6 +139,7 @@ void LLSidepanelAppearance::onClose(LLFloaterSidePanelContainer* obj) else { LLVOAvatarSelf::onCustomizeEnd(FALSE); + toggleWearableEditPanel(FALSE); mLLFloaterSidePanelContainer->close(); } } -- cgit v1.2.3 From 17af76fae18e305d0a42192a326648f00c84d1f3 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Thu, 18 Apr 2013 13:56:16 -0400 Subject: SH-4128 WIP - use the AISv3 inventory cap when available for cof link deletion, hook in to callback mechanism so all link operations should be done before outfit is worn. --- indra/newview/llappearancemgr.cpp | 20 ++----- indra/newview/llappearancemgr.h | 2 +- indra/newview/lltexturefetch.cpp | 4 +- indra/newview/llviewerinventory.cpp | 101 ++++++++++++++++++++++++++++++++++++ indra/newview/llviewerinventory.h | 4 ++ indra/newview/llviewerregion.cpp | 1 + 6 files changed, 113 insertions(+), 19 deletions(-) mode change 100644 => 100755 indra/newview/llviewerinventory.cpp mode change 100644 => 100755 indra/newview/llviewerinventory.h (limited to 'indra/newview') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 85f6f92278..f1a2141b99 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1661,7 +1661,7 @@ void LLAppearanceMgr::purgeBaseOutfitLink(const LLUUID& category) } } -void LLAppearanceMgr::purgeCategory(const LLUUID& category, bool keep_outfit_links, LLInventoryModel::item_array_t* keep_items) +void LLAppearanceMgr::purgeCategory(const LLUUID& category, bool keep_outfit_links, LLPointer<LLInventoryCallback> cb) { LLInventoryModel::cat_array_t cats; LLInventoryModel::item_array_t items; @@ -1674,19 +1674,8 @@ void LLAppearanceMgr::purgeCategory(const LLUUID& category, bool keep_outfit_lin continue; if (item->getIsLinkType()) { -#if 0 - if (keep_items && keep_items->find(item) != LLInventoryModel::item_array_t::FAIL) - { - llinfos << "preserved item" << llendl; - } - else - { - gInventory.purgeObject(item->getUUID()); - } -#else - gInventory.purgeObject(item->getUUID()); + remove_inventory_item(item->getUUID(), cb); } -#endif } } @@ -1819,7 +1808,7 @@ void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append) // carried over (e.g. keeping old shape if the new outfit does not // contain one) bool keep_outfit_links = append; - purgeCategory(cof, keep_outfit_links, &all_items); + purgeCategory(cof, keep_outfit_links, link_waiter); gInventory.notifyObservers(); LL_DEBUGS("Avatar") << self_av_string() << "waiting for LLUpdateAppearanceOnDestroy" << LL_ENDL; @@ -2824,7 +2813,7 @@ bool LLAppearanceMgr::updateBaseOutfit() updateClothingOrderingInfo(); // in a Base Outfit we do not remove items, only links - purgeCategory(base_outfit_id, false); + purgeCategory(base_outfit_id, false, NULL); LLPointer<LLInventoryCallback> dirty_state_updater = new LLBoostFuncInventoryCallback(no_op_inventory_func, appearance_mgr_update_dirty_state); @@ -3211,7 +3200,6 @@ void LLAppearanceMgr::requestServerAppearanceUpdate(LLCurl::ResponderPtr respond } LL_DEBUGS("Avatar") << "request url " << url << " my_cof_version " << cof_version << llendl; - //LLCurl::ResponderPtr responder_ptr; if (!responder_ptr.get()) { responder_ptr = new RequestAgentUpdateAppearanceResponder; diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index 46252afbde..b933b4fc50 100755 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -222,7 +222,7 @@ private: LLInventoryModel::item_array_t& gest_items, bool follow_folder_links); - void purgeCategory(const LLUUID& category, bool keep_outfit_links, LLInventoryModel::item_array_t* keep_items = NULL); + void purgeCategory(const LLUUID& category, bool keep_outfit_links, LLPointer<LLInventoryCallback> cb); static void onOutfitRename(const LLSD& notification, const LLSD& response); void setOutfitLocked(bool locked); diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 346374ef4e..f7fbb19bdc 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -1525,7 +1525,7 @@ bool LLTextureFetchWorker::doWork(S32 param) // Will call callbackHttpGet when curl request completes // Only server bake images use the returned headers currently, for getting retry-after field. - HttpOptions *options = (mFTType == FTT_SERVER_BAKE) ? mFetcher->mHttpOptionsWithHeaders: mFetcher->mHttpOptions; + LLCore::HttpOptions *options = (mFTType == FTT_SERVER_BAKE) ? mFetcher->mHttpOptionsWithHeaders: mFetcher->mHttpOptions; mHttpHandle = mFetcher->mHttpRequest->requestGetByteRange(mHttpPolicyClass, mWorkPriority, mUrl, @@ -2569,7 +2569,7 @@ bool LLTextureFetch::createRequest(FTType f_type, const std::string& url, const if (f_type == FTT_SERVER_BAKE) { - llinfos << " requesting " << id << " " << w << "x" << h << " discard " << desired_discard << llendl; + LL_DEBUGS("Avatar") << " requesting " << id << " " << w << "x" << h << " discard " << desired_discard << llendl; } LLTextureFetchWorker* worker = getWorker(id) ; if (worker) diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp old mode 100644 new mode 100755 index fff9821e86..316fca7769 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -1179,6 +1179,107 @@ void move_inventory_item( gAgent.sendReliableMessage(); } +void handle_item_deletion(const LLUUID& item_id) +{ + LLPointer<LLViewerInventoryItem> obj = gInventory.getItem(item_id); + if(obj) + { + // From item removeFromServer() + LLInventoryModel::LLCategoryUpdate up(obj->getParentUUID(), -1); + gInventory.accountForUpdate(up); + + // From purgeObject() + LLPreview::hide(item_id); + gInventory.deleteObject(item_id); + } +} + +class RemoveItemResponder: public LLHTTPClient::Responder +{ +public: + RemoveItemResponder(const LLUUID& item_id, LLPointer<LLInventoryCallback> callback): + mItemUUID(item_id), + mCallback(callback) + { + } + /* virtual */ void httpSuccess() + { + const LLSD& content = getContent(); + if (!content.isMap()) + { + failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content); + return; + } + llinfos << "succeeded: " << ll_pretty_print_sd(content) << llendl; + + handle_item_deletion(mItemUUID); + + if (mCallback) + { + mCallback->fire(mItemUUID); + } + } + /*virtual*/ void httpFailure() + { + const LLSD& content = getContent(); + if (!content.isMap()) + { + failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content); + return; + } + llwarns << "failed for " << mItemUUID << " content: " << ll_pretty_print_sd(content) << llendl; + } +private: + LLPointer<LLInventoryCallback> mCallback; + const LLUUID mItemUUID; +}; + +void remove_inventory_item( + const LLUUID& item_id, + LLPointer<LLInventoryCallback> cb) +{ + llinfos << "item_id: [" << item_id << "] " << llendl; + LLPointer<LLViewerInventoryItem> obj = gInventory.getItem(item_id); + if(obj) + { + std::string cap; + if (gAgent.getRegion()) + { + cap = gAgent.getRegion()->getCapability("InventoryAPIv3"); + } + if (!cap.empty()) + { + std::string url = cap + std::string("/item/") + item_id.asString(); + llinfos << "url: " << url << llendl; + LLCurl::ResponderPtr responder_ptr = new RemoveItemResponder(item_id,cb); + LLHTTPClient::del(url,responder_ptr); + } + else // no cap + { + LLMessageSystem* msg = gMessageSystem; + msg->newMessageFast(_PREHASH_RemoveInventoryItem); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + msg->nextBlockFast(_PREHASH_InventoryData); + msg->addUUIDFast(_PREHASH_ItemID, item_id); + gAgent.sendReliableMessage(); + + // Update inventory and call callback immediately since + // message-based system has no callback mechanism (!) + handle_item_deletion(item_id); + if (cb) + { + cb->fire(item_id); + } + } + } + else + { + llwarns << "remove_inventory_item called for nonexistent item " << item_id << llendl; + } +} + const LLUUID get_folder_by_itemtype(const LLInventoryItem *src) { LLUUID retval = LLUUID::null; diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h old mode 100644 new mode 100755 index 61b1b8d846..7cb62efb47 --- a/indra/newview/llviewerinventory.h +++ b/indra/newview/llviewerinventory.h @@ -365,6 +365,10 @@ void move_inventory_item( const std::string& new_name, LLPointer<LLInventoryCallback> cb); +void remove_inventory_item( + const LLUUID& item_id, + LLPointer<LLInventoryCallback> cb); + const LLUUID get_folder_by_itemtype(const LLInventoryItem *src); void copy_inventory_from_notecard(const LLUUID& destination_id, diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index f0d81c599c..e77b29aca4 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -1641,6 +1641,7 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames) capabilityNames.append("FetchInventory2"); capabilityNames.append("FetchInventoryDescendents2"); capabilityNames.append("IncrementCOFVersion"); + capabilityNames.append("InventoryAPIv3"); } capabilityNames.append("GetDisplayNames"); -- cgit v1.2.3 From e3ceb10c48b7ce339fab8c3c7a726bd4bf2e30e8 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Thu, 18 Apr 2013 17:31:35 -0400 Subject: SH-4128 WIP - avoid needless called to updateLinkedObjectsFromPurge() --- indra/newview/llinventorymodel.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) mode change 100644 => 100755 indra/newview/llinventorymodel.cpp (limited to 'indra/newview') diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp old mode 100644 new mode 100755 index 8d7478233a..3d2fcdc494 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1171,8 +1171,14 @@ void LLInventoryModel::deleteObject(const LLUUID& id) mParentChildCategoryTree.erase(id); } addChangedMask(LLInventoryObserver::REMOVE, id); + bool is_link_type = obj->getIsLinkType(); obj = NULL; // delete obj - updateLinkedObjectsFromPurge(id); + // Can't have links to links, so there's no need for this update + // if the item removed is a link. + if (!is_link_type) + { + updateLinkedObjectsFromPurge(id); + } gInventory.notifyObservers(); } -- cgit v1.2.3 From 7b52a41e34e1fefd751d69be708b23df59774c6a Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Thu, 18 Apr 2013 17:49:10 -0400 Subject: SH-4116 WIP - removed follow_folder_links behavior, which was used nowhere and isn't really desirable currently --- indra/newview/llappearancemgr.cpp | 49 ++++++++++++++++---------------------- indra/newview/llappearancemgr.h | 6 ++--- indra/newview/llinventorymodel.cpp | 33 +------------------------ indra/newview/llinventorymodel.h | 3 +-- 4 files changed, 24 insertions(+), 67 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index f1a2141b99..fffec223d7 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1204,8 +1204,7 @@ const LLViewerInventoryItem* LLAppearanceMgr::getBaseOutfitLink() cat_array, item_array, false, - is_category, - false); + is_category); for (LLInventoryModel::item_array_t::const_iterator iter = item_array.begin(); iter != item_array.end(); iter++) @@ -1738,7 +1737,7 @@ void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append) if (!append) { LLInventoryModel::item_array_t gest_items; - getDescendentsOfAssetType(cof, gest_items, LLAssetType::AT_GESTURE, false); + getDescendentsOfAssetType(cof, gest_items, LLAssetType::AT_GESTURE); for(S32 i = 0; i < gest_items.count(); ++i) { LLViewerInventoryItem *gest_item = gest_items.get(i); @@ -1755,8 +1754,8 @@ void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append) // required parts are missing. // Preserve body parts from COF if appending. LLInventoryModel::item_array_t body_items; - getDescendentsOfAssetType(cof, body_items, LLAssetType::AT_BODYPART, false); - getDescendentsOfAssetType(category, body_items, LLAssetType::AT_BODYPART, false); + getDescendentsOfAssetType(cof, body_items, LLAssetType::AT_BODYPART); + getDescendentsOfAssetType(category, body_items, LLAssetType::AT_BODYPART); if (append) reverse(body_items.begin(), body_items.end()); // Reduce body items to max of one per type. @@ -1766,8 +1765,8 @@ void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append) // - Wearables: include COF contents only if appending. LLInventoryModel::item_array_t wear_items; if (append) - getDescendentsOfAssetType(cof, wear_items, LLAssetType::AT_CLOTHING, false); - getDescendentsOfAssetType(category, wear_items, LLAssetType::AT_CLOTHING, false); + getDescendentsOfAssetType(cof, wear_items, LLAssetType::AT_CLOTHING); + getDescendentsOfAssetType(category, wear_items, LLAssetType::AT_CLOTHING); // Reduce wearables to max of one per type. removeDuplicateItems(wear_items); filterWearableItems(wear_items, LLAgentWearables::MAX_CLOTHING_PER_TYPE); @@ -1775,15 +1774,15 @@ void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append) // - Attachments: include COF contents only if appending. LLInventoryModel::item_array_t obj_items; if (append) - getDescendentsOfAssetType(cof, obj_items, LLAssetType::AT_OBJECT, false); - getDescendentsOfAssetType(category, obj_items, LLAssetType::AT_OBJECT, false); + getDescendentsOfAssetType(cof, obj_items, LLAssetType::AT_OBJECT); + getDescendentsOfAssetType(category, obj_items, LLAssetType::AT_OBJECT); removeDuplicateItems(obj_items); // - Gestures: include COF contents only if appending. LLInventoryModel::item_array_t gest_items; if (append) - getDescendentsOfAssetType(cof, gest_items, LLAssetType::AT_GESTURE, false); - getDescendentsOfAssetType(category, gest_items, LLAssetType::AT_GESTURE, false); + getDescendentsOfAssetType(cof, gest_items, LLAssetType::AT_GESTURE); + getDescendentsOfAssetType(category, gest_items, LLAssetType::AT_GESTURE); removeDuplicateItems(gest_items); // Create links to new COF contents. @@ -1927,7 +1926,7 @@ S32 LLAppearanceMgr::findExcessOrDuplicateItems(const LLUUID& cat_id, S32 to_kill_count = 0; LLInventoryModel::item_array_t items; - getDescendentsOfAssetType(cat_id, items, type, false); + getDescendentsOfAssetType(cat_id, items, type); LLInventoryModel::item_array_t curr_items = items; removeDuplicateItems(items); if (max_items > 0) @@ -2009,7 +2008,6 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering) //dumpCat(getCOF(),"COF, start"); - bool follow_folder_links = false; LLUUID current_outfit_id = getCOF(); // Find all the wearables that are in the COF's subtree. @@ -2017,7 +2015,7 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering) LLInventoryModel::item_array_t wear_items; LLInventoryModel::item_array_t obj_items; LLInventoryModel::item_array_t gest_items; - getUserDescendents(current_outfit_id, wear_items, obj_items, gest_items, follow_folder_links); + getUserDescendents(current_outfit_id, wear_items, obj_items, gest_items); // Get rid of non-links in case somehow the COF was corrupted. remove_non_link_items(wear_items); remove_non_link_items(obj_items); @@ -2113,8 +2111,7 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering) void LLAppearanceMgr::getDescendentsOfAssetType(const LLUUID& category, LLInventoryModel::item_array_t& items, - LLAssetType::EType type, - bool follow_folder_links) + LLAssetType::EType type) { LLInventoryModel::cat_array_t cats; LLIsType is_of_type(type); @@ -2122,15 +2119,13 @@ void LLAppearanceMgr::getDescendentsOfAssetType(const LLUUID& category, cats, items, LLInventoryModel::EXCLUDE_TRASH, - is_of_type, - follow_folder_links); + is_of_type); } void LLAppearanceMgr::getUserDescendents(const LLUUID& category, LLInventoryModel::item_array_t& wear_items, LLInventoryModel::item_array_t& obj_items, - LLInventoryModel::item_array_t& gest_items, - bool follow_folder_links) + LLInventoryModel::item_array_t& gest_items) { LLInventoryModel::cat_array_t wear_cats; LLFindWearables is_wearable; @@ -2138,8 +2133,7 @@ void LLAppearanceMgr::getUserDescendents(const LLUUID& category, wear_cats, wear_items, LLInventoryModel::EXCLUDE_TRASH, - is_wearable, - follow_folder_links); + is_wearable); LLInventoryModel::cat_array_t obj_cats; LLIsType is_object( LLAssetType::AT_OBJECT ); @@ -2147,8 +2141,7 @@ void LLAppearanceMgr::getUserDescendents(const LLUUID& category, obj_cats, obj_items, LLInventoryModel::EXCLUDE_TRASH, - is_object, - follow_folder_links); + is_object); // Find all gestures in this folder LLInventoryModel::cat_array_t gest_cats; @@ -2157,8 +2150,7 @@ void LLAppearanceMgr::getUserDescendents(const LLUUID& category, gest_cats, gest_items, LLInventoryModel::EXCLUDE_TRASH, - is_gesture, - follow_folder_links); + is_gesture); } void LLAppearanceMgr::wearInventoryCategory(LLInventoryCategory* category, bool copy, bool append) @@ -2514,8 +2506,7 @@ void LLAppearanceMgr::removeAllClothesFromAvatar() dummy, clothing_items, LLInventoryModel::EXCLUDE_TRASH, - is_clothing, - false); + is_clothing); uuid_vec_t item_ids; for (LLInventoryModel::item_array_t::iterator it = clothing_items.begin(); it != clothing_items.end(); ++it) @@ -2910,7 +2901,7 @@ void LLAppearanceMgr::updateClothingOrderingInfo(LLUUID cat_id, bool update_base // COF is processed if cat_id is not specified LLInventoryModel::item_array_t wear_items; - getDescendentsOfAssetType(cat_id, wear_items, LLAssetType::AT_CLOTHING, false); + getDescendentsOfAssetType(cat_id, wear_items, LLAssetType::AT_CLOTHING); wearables_by_type_t items_by_type(LLWearableType::WT_COUNT); divvyWearablesByType(wear_items, items_by_type); diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index b933b4fc50..6c014b1a4b 100755 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -213,14 +213,12 @@ private: void getDescendentsOfAssetType(const LLUUID& category, LLInventoryModel::item_array_t& items, - LLAssetType::EType type, - bool follow_folder_links); + LLAssetType::EType type); void getUserDescendents(const LLUUID& category, LLInventoryModel::item_array_t& wear_items, LLInventoryModel::item_array_t& obj_items, - LLInventoryModel::item_array_t& gest_items, - bool follow_folder_links); + LLInventoryModel::item_array_t& gest_items); void purgeCategory(const LLUUID& category, bool keep_outfit_links, LLPointer<LLInventoryCallback> cb); static void onOutfitRename(const LLSD& notification, const LLSD& response); diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 3d2fcdc494..bbf284147a 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -624,8 +624,7 @@ void LLInventoryModel::collectDescendentsIf(const LLUUID& id, cat_array_t& cats, item_array_t& items, BOOL include_trash, - LLInventoryCollectFunctor& add, - BOOL follow_folder_links) + LLInventoryCollectFunctor& add) { // Start with categories if(!include_trash) @@ -652,36 +651,6 @@ void LLInventoryModel::collectDescendentsIf(const LLUUID& id, LLViewerInventoryItem* item = NULL; item_array_t* item_array = get_ptr_in_map(mParentChildItemTree, id); - // Follow folder links recursively. Currently never goes more - // than one level deep (for current outfit support) - // Note: if making it fully recursive, need more checking against infinite loops. - if (follow_folder_links && item_array) - { - S32 count = item_array->count(); - for(S32 i = 0; i < count; ++i) - { - item = item_array->get(i); - if (item && item->getActualType() == LLAssetType::AT_LINK_FOLDER) - { - LLViewerInventoryCategory *linked_cat = item->getLinkedCategory(); - if (linked_cat && linked_cat->getPreferredType() != LLFolderType::FT_OUTFIT) - // BAP - was - // LLAssetType::lookupIsEnsembleCategoryType(linked_cat->getPreferredType())) - // Change back once ensemble typing is in place. - { - if(add(linked_cat,NULL)) - { - // BAP should this be added here? May not - // matter if it's only being used in current - // outfit traversal. - cats.put(LLPointer<LLViewerInventoryCategory>(linked_cat)); - } - collectDescendentsIf(linked_cat->getUUID(), cats, items, include_trash, add, FALSE); - } - } - } - } - // Move onto items if(item_array) { diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index 3aa29bd91d..0b017b7514 100644 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -213,8 +213,7 @@ public: cat_array_t& categories, item_array_t& items, BOOL include_trash, - LLInventoryCollectFunctor& add, - BOOL follow_folder_links = FALSE); + LLInventoryCollectFunctor& add); // Collect all items in inventory that are linked to item_id. // Assumes item_id is itself not a linked item. -- cgit v1.2.3 From d807a9162662aa3b921020af2df2c30cc71b1b32 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Mon, 22 Apr 2013 16:48:02 -0400 Subject: SH-4128 WIP - more stages of outfit change now go through the callback mechanism for link removals --- indra/newview/llappearancemgr.cpp | 89 +++++++++++++++++++++++---------------- indra/newview/llappearancemgr.h | 17 ++++++-- 2 files changed, 66 insertions(+), 40 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index fffec223d7..21af5adf09 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -501,9 +501,11 @@ public: } }; -LLUpdateAppearanceOnDestroy::LLUpdateAppearanceOnDestroy(bool update_base_outfit_ordering): +LLUpdateAppearanceOnDestroy::LLUpdateAppearanceOnDestroy(bool update_base_outfit_ordering, + bool enforce_item_restrictions): mFireCount(0), - mUpdateBaseOrder(update_base_outfit_ordering) + mUpdateBaseOrder(update_base_outfit_ordering), + mEnforceItemRestrictions(enforce_item_restrictions) { selfStartPhase("update_appearance_on_destroy"); } @@ -517,7 +519,7 @@ LLUpdateAppearanceOnDestroy::~LLUpdateAppearanceOnDestroy() selfStopPhase("update_appearance_on_destroy"); - LLAppearanceMgr::instance().updateAppearanceFromCOF(mUpdateBaseOrder); + LLAppearanceMgr::instance().updateAppearanceFromCOF(mUpdateBaseOrder, mEnforceItemRestrictions); } } @@ -1660,7 +1662,8 @@ void LLAppearanceMgr::purgeBaseOutfitLink(const LLUUID& category) } } -void LLAppearanceMgr::purgeCategory(const LLUUID& category, bool keep_outfit_links, LLPointer<LLInventoryCallback> cb) +void LLAppearanceMgr::removeCategoryContents(const LLUUID& category, bool keep_outfit_links, + LLPointer<LLInventoryCallback> cb) { LLInventoryModel::cat_array_t cats; LLInventoryModel::item_array_t items; @@ -1726,6 +1729,18 @@ void LLAppearanceMgr::linkAll(const LLUUID& cat_uuid, } } +void LLAppearanceMgr::removeAll(LLInventoryModel::item_array_t& items_to_kill, + LLPointer<LLInventoryCallback> cb) +{ + for (LLInventoryModel::item_array_t::iterator it = items_to_kill.begin(); + it != items_to_kill.end(); + ++it) + { + LLViewerInventoryItem *item = *it; + remove_inventory_item(item->getUUID(), cb); + } +} + void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append) { LLViewerInventoryCategory *pcat = gInventory.getCategory(category); @@ -1807,8 +1822,7 @@ void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append) // carried over (e.g. keeping old shape if the new outfit does not // contain one) bool keep_outfit_links = append; - purgeCategory(cof, keep_outfit_links, link_waiter); - gInventory.notifyObservers(); + removeCategoryContents(cof, keep_outfit_links, link_waiter); LL_DEBUGS("Avatar") << self_av_string() << "waiting for LLUpdateAppearanceOnDestroy" << LL_ENDL; } @@ -1945,34 +1959,20 @@ S32 LLAppearanceMgr::findExcessOrDuplicateItems(const LLUUID& cat_id, return to_kill_count; } - -void LLAppearanceMgr::enforceItemRestrictions() -{ - S32 purge_count = 0; - LLInventoryModel::item_array_t items_to_kill; - - purge_count += findExcessOrDuplicateItems(getCOF(),LLAssetType::AT_BODYPART, - 1, items_to_kill); - purge_count += findExcessOrDuplicateItems(getCOF(),LLAssetType::AT_CLOTHING, - LLAgentWearables::MAX_CLOTHING_PER_TYPE, items_to_kill); - purge_count += findExcessOrDuplicateItems(getCOF(),LLAssetType::AT_OBJECT, - -1, items_to_kill); - if (items_to_kill.size()>0) - { - for (LLInventoryModel::item_array_t::iterator it = items_to_kill.begin(); - it != items_to_kill.end(); - ++it) - { - LLViewerInventoryItem *item = *it; - LL_DEBUGS("Avatar") << self_av_string() << "purging duplicate or excess item " << item->getName() << LL_ENDL; - gInventory.purgeObject(item->getUUID()); - } - gInventory.notifyObservers(); - } +void LLAppearanceMgr::findAllExcessOrDuplicateItems(const LLUUID& cat_id, + LLInventoryModel::item_array_t& items_to_kill) +{ + findExcessOrDuplicateItems(cat_id,LLAssetType::AT_BODYPART, + 1, items_to_kill); + findExcessOrDuplicateItems(cat_id,LLAssetType::AT_CLOTHING, + LLAgentWearables::MAX_CLOTHING_PER_TYPE, items_to_kill); + findExcessOrDuplicateItems(cat_id,LLAssetType::AT_OBJECT, + -1, items_to_kill); } -void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering) +void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering, + bool enforce_item_restrictions) { if (mIsInUpdateAppearanceFromCOF) { @@ -1985,14 +1985,31 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering) LL_DEBUGS("Avatar") << self_av_string() << "starting" << LL_ENDL; + if (enforce_item_restrictions) + { + LLInventoryModel::item_array_t items_to_kill; + findAllExcessOrDuplicateItems(getCOF(), items_to_kill); + if (items_to_kill.size()>0) + { + // The point here is just to call + // updateAppearanceFromCOF() again after excess items + // have been removed. That time we will set + // enforce_item_restrictions to false so we don't get + // caught in a perpetual loop. + LLPointer<LLInventoryCallback> cb( + new LLUpdateAppearanceOnDestroy(update_base_outfit_ordering, false)); + + // Remove duplicate or excess wearables. Should normally be enforced at the UI level, but + // this should catch anything that gets through. + removeAll(items_to_kill, cb); + return; + } + } + //checking integrity of the COF in terms of ordering of wearables, //checking and updating links' descriptions of wearables in the COF (before analyzed for "dirty" state) updateClothingOrderingInfo(LLUUID::null, update_base_outfit_ordering); - // Remove duplicate or excess wearables. Should normally be enforced at the UI level, but - // this should catch anything that gets through. - enforceItemRestrictions(); - // update dirty flag to see if the state of the COF matches // the saved outfit stored as a folder link updateIsDirty(); @@ -2804,7 +2821,7 @@ bool LLAppearanceMgr::updateBaseOutfit() updateClothingOrderingInfo(); // in a Base Outfit we do not remove items, only links - purgeCategory(base_outfit_id, false, NULL); + removeCategoryContents(base_outfit_id, false, NULL); LLPointer<LLInventoryCallback> dirty_state_updater = new LLBoostFuncInventoryCallback(no_op_inventory_func, appearance_mgr_update_dirty_state); diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index 6c014b1a4b..0cc06ab210 100755 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -49,7 +49,8 @@ class LLAppearanceMgr: public LLSingleton<LLAppearanceMgr> public: typedef std::vector<LLInventoryModel::item_array_t> wearables_by_type_t; - void updateAppearanceFromCOF(bool update_base_outfit_ordering = false); + void updateAppearanceFromCOF(bool update_base_outfit_ordering = false, + bool enforce_item_restrictions = true); bool needToSaveCOF(); void updateCOF(const LLUUID& category, bool append = false); void wearInventoryCategory(LLInventoryCategory* category, bool copy, bool append); @@ -65,7 +66,8 @@ public: LLAssetType::EType type, S32 max_items, LLInventoryModel::item_array_t& items_to_kill); - void enforceItemRestrictions(); + void findAllExcessOrDuplicateItems(const LLUUID& cat_id, + LLInventoryModel::item_array_t& items_to_kill); // Copy all items and the src category itself. void shallowCopyCategory(const LLUUID& src_id, const LLUUID& dst_id, @@ -129,6 +131,10 @@ public: LLInventoryModel::item_array_t& items, LLPointer<LLInventoryCallback> cb); + // And bulk removal. + void removeAll(LLInventoryModel::item_array_t& items, + LLPointer<LLInventoryCallback> cb); + // Add COF link to individual item. void addCOFItemLink(const LLUUID& item_id, bool do_update = true, LLPointer<LLInventoryCallback> cb = NULL, const std::string description = ""); void addCOFItemLink(const LLInventoryItem *item, bool do_update = true, LLPointer<LLInventoryCallback> cb = NULL, const std::string description = ""); @@ -220,7 +226,8 @@ private: LLInventoryModel::item_array_t& obj_items, LLInventoryModel::item_array_t& gest_items); - void purgeCategory(const LLUUID& category, bool keep_outfit_links, LLPointer<LLInventoryCallback> cb); + void removeCategoryContents(const LLUUID& category, bool keep_outfit_links, + LLPointer<LLInventoryCallback> cb); static void onOutfitRename(const LLSD& notification, const LLSD& response); void setOutfitLocked(bool locked); @@ -254,13 +261,15 @@ public: class LLUpdateAppearanceOnDestroy: public LLInventoryCallback { public: - LLUpdateAppearanceOnDestroy(bool update_base_outfit_ordering = false); + LLUpdateAppearanceOnDestroy(bool update_base_outfit_ordering = false, + bool enforce_item_restrictions = true); virtual ~LLUpdateAppearanceOnDestroy(); /* virtual */ void fire(const LLUUID& inv_item); private: U32 mFireCount; bool mUpdateBaseOrder; + bool mEnforceItemRestrictions; }; -- cgit v1.2.3 From 1bf66885617564c8df9baac3b45ed5e9d96ef153 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Tue, 23 Apr 2013 15:52:12 -0400 Subject: SH-4128 WIP - rewiring various link-deleting operations to support callbacks --- indra/newview/llagentwearables.cpp | 9 +- indra/newview/llappearancemgr.cpp | 203 ++++++++++++------------------------ indra/newview/llappearancemgr.h | 27 +++-- indra/newview/llfloatergesture.cpp | 2 +- indra/newview/llpaneloutfitedit.cpp | 4 +- indra/newview/llviewerinventory.h | 2 +- 6 files changed, 95 insertions(+), 152 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index c88694ef76..b4c3e33e0e 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -69,7 +69,7 @@ void wear_and_edit_cb(const LLUUID& inv_item) gAgentWearables.requestEditingWearable(inv_item); // Wear it. - LLAppearanceMgr::instance().wearItemOnAvatar(inv_item); + LLAppearanceMgr::instance().wearItemOnAvatar(inv_item,true); } /////////////////////////////////////////////////////////////////////////////// @@ -239,7 +239,7 @@ void LLAgentWearables::addWearableToAgentInventoryCallback::fire(const LLUUID& i } if (mTodo & CALL_RECOVERDONE) { - LLAppearanceMgr::instance().addCOFItemLink(inv_item,false); + LLAppearanceMgr::instance().addCOFItemLink(inv_item); gAgentWearables.recoverMissingWearableDone(); } /* @@ -247,7 +247,7 @@ void LLAgentWearables::addWearableToAgentInventoryCallback::fire(const LLUUID& i */ if (mTodo & CALL_CREATESTANDARDDONE) { - LLAppearanceMgr::instance().addCOFItemLink(inv_item,false); + LLAppearanceMgr::instance().addCOFItemLink(inv_item); gAgentWearables.createStandardWearablesDone(mType, mIndex); } if (mTodo & CALL_MAKENEWOUTFITDONE) @@ -256,7 +256,8 @@ void LLAgentWearables::addWearableToAgentInventoryCallback::fire(const LLUUID& i } if (mTodo & CALL_WEARITEM) { - LLAppearanceMgr::instance().addCOFItemLink(inv_item, true, NULL, mDescription); + LLAppearanceMgr::instance().addCOFItemLink(inv_item, + new LLUpdateAppearanceAndEditWearableOnDestroy(inv_item), mDescription); } } diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 21af5adf09..634f5d1389 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -421,86 +421,6 @@ public: } }; -class LLCallAfterInventoryLinkMgr: public LLCallAfterInventoryBatchMgr -{ -public: - LLCallAfterInventoryLinkMgr(LLInventoryModel::item_array_t& src_items, - const LLUUID& dst_cat_id, - const std::string& phase_name, - nullary_func_t on_completion_func, - nullary_func_t on_failure_func = no_op, - F32 retry_after = DEFAULT_RETRY_AFTER_INTERVAL, - S32 max_retries = DEFAULT_MAX_RETRIES - ): - LLCallAfterInventoryBatchMgr(dst_cat_id, phase_name, on_completion_func, on_failure_func, retry_after, max_retries) - { - addItems(src_items); - } - - virtual bool requestOperation(const LLUUID& item_id) - { - bool request_sent = false; - LLViewerInventoryItem *item = gInventory.getItem(item_id); - if (item) - { - if (item->getParentUUID() == mDstCatID) - { - LL_DEBUGS("Avatar") << "item " << item_id << " name " << item->getName() << " is already a child of " << mDstCatID << llendl; - return false; - } - LL_DEBUGS("Avatar") << "linking item " << item_id << " name " << item->getName() << " to " << mDstCatID << llendl; - // create an inventory item link. - if (ll_frand() < gSavedSettings.getF32("InventoryDebugSimulateOpFailureRate")) - { - LL_DEBUGS("Avatar") << "simulating failure by not sending request for item " << item_id << llendl; - return true; - } - link_inventory_item(gAgent.getID(), - item->getLinkedUUID(), - mDstCatID, - item->getName(), - item->getActualDescription(), - LLAssetType::AT_LINK, - new LLBoostFuncInventoryCallback( - boost::bind(&LLCallAfterInventoryBatchMgr::onOp,this,item_id,_1,LLTimer()))); - return true; - } - else - { - // create a base outfit link if appropriate. - LLViewerInventoryCategory *catp = gInventory.getCategory(item_id); - if (!catp) - { - llwarns << "link request failed, id not found as inventory item or category " << item_id << llendl; - return false; - } - const LLUUID cof = LLAppearanceMgr::instance().getCOF(); - std::string new_outfit_name = ""; - - LLAppearanceMgr::instance().purgeBaseOutfitLink(cof); - - if (catp && catp->getPreferredType() == LLFolderType::FT_OUTFIT) - { - if (ll_frand() < gSavedSettings.getF32("InventoryDebugSimulateOpFailureRate")) - { - LL_DEBUGS("Avatar") << "simulating failure by not sending request for item " << item_id << llendl; - return true; - } - LL_DEBUGS("Avatar") << "linking folder " << item_id << " name " << catp->getName() << " to cof " << cof << llendl; - link_inventory_item(gAgent.getID(), item_id, cof, catp->getName(), "", - LLAssetType::AT_LINK_FOLDER, - new LLBoostFuncInventoryCallback( - boost::bind(&LLCallAfterInventoryBatchMgr::onOp,this,item_id,_1,LLTimer()))); - new_outfit_name = catp->getName(); - request_sent = true; - } - - LLAppearanceMgr::instance().updatePanelOutfitName(new_outfit_name); - } - return request_sent; - } -}; - LLUpdateAppearanceOnDestroy::LLUpdateAppearanceOnDestroy(bool update_base_outfit_ordering, bool enforce_item_restrictions): mFireCount(0), @@ -533,6 +453,32 @@ void LLUpdateAppearanceOnDestroy::fire(const LLUUID& inv_item) mFireCount++; } +LLUpdateAppearanceAndEditWearableOnDestroy::LLUpdateAppearanceAndEditWearableOnDestroy(const LLUUID& item_id): + mItemID(item_id) +{ +} + +LLUpdateAppearanceAndEditWearableOnDestroy::~LLUpdateAppearanceAndEditWearableOnDestroy() +{ + LLAppearanceMgr::instance().updateAppearanceFromCOF(); + + // Start editing the item if previously requested. + gAgentWearables.editWearableIfRequested(mItemID); + + // TODO: camera mode may not be changed if a debug setting is tweaked + if( gAgentCamera.cameraCustomizeAvatar() ) + { + // If we're in appearance editing mode, the current tab may need to be refreshed + LLSidepanelAppearance *panel = dynamic_cast<LLSidepanelAppearance*>( + LLFloaterSidePanelContainer::getPanel("appearance")); + if (panel) + { + panel->showDefaultSubpart(); + } + } +} + + struct LLFoundData { LLFoundData() : @@ -1272,8 +1218,12 @@ void wear_on_avatar_cb(const LLUUID& inv_item, bool do_replace = false) } } -bool LLAppearanceMgr::wearItemOnAvatar(const LLUUID& item_id_to_wear, bool do_update, bool replace, LLPointer<LLInventoryCallback> cb) +bool LLAppearanceMgr::wearItemOnAvatar(const LLUUID& item_id_to_wear, + bool do_update, + bool replace, + LLPointer<LLInventoryCallback> cb) { + if (item_id_to_wear.isNull()) return false; // *TODO: issue with multi-wearable should be fixed: @@ -1320,7 +1270,11 @@ bool LLAppearanceMgr::wearItemOnAvatar(const LLUUID& item_id_to_wear, bool do_up { removeCOFItemLinks(gAgentWearables.getWearableItemID(item_to_wear->getWearableType(), wearable_count-1)); } - addCOFItemLink(item_to_wear, do_update, cb); + if (!cb && do_update) + { + cb = new LLUpdateAppearanceAndEditWearableOnDestroy(item_id_to_wear); + } + addCOFItemLink(item_to_wear, cb); } break; case LLAssetType::AT_BODYPART: @@ -1329,8 +1283,11 @@ bool LLAppearanceMgr::wearItemOnAvatar(const LLUUID& item_id_to_wear, bool do_up // Remove the existing wearables of the same type. // Remove existing body parts anyway because we must not be able to wear e.g. two skins. removeCOFLinksOfType(item_to_wear->getWearableType()); - - addCOFItemLink(item_to_wear, do_update, cb); + if (!cb && do_update) + { + cb = new LLUpdateAppearanceAndEditWearableOnDestroy(item_id_to_wear); + } + addCOFItemLink(item_to_wear, cb); break; case LLAssetType::AT_OBJECT: rez_attachment(item_to_wear, NULL, replace); @@ -1640,7 +1597,7 @@ bool LLAppearanceMgr::getCanReplaceCOF(const LLUUID& outfit_cat_id) return items.size() > 0; } -void LLAppearanceMgr::purgeBaseOutfitLink(const LLUUID& category) +void LLAppearanceMgr::purgeBaseOutfitLink(const LLUUID& category, LLPointer<LLInventoryCallback> cb) { LLInventoryModel::cat_array_t cats; LLInventoryModel::item_array_t items; @@ -1656,7 +1613,7 @@ void LLAppearanceMgr::purgeBaseOutfitLink(const LLUUID& category) LLViewerInventoryCategory* catp = item->getLinkedCategory(); if(catp && catp->getPreferredType() == LLFolderType::FT_OUTFIT) { - gInventory.purgeObject(item->getUUID()); + remove_inventory_item(item->getUUID(), cb); } } } @@ -1843,7 +1800,7 @@ void LLAppearanceMgr::createBaseOutfitLink(const LLUUID& category, LLPointer<LLI LLViewerInventoryCategory* catp = gInventory.getCategory(category); std::string new_outfit_name = ""; - purgeBaseOutfitLink(cof); + purgeBaseOutfitLink(cof, link_waiter); if (catp && catp->getPreferredType() == LLFolderType::FT_OUTFIT) { @@ -2339,9 +2296,8 @@ bool areMatchingWearables(const LLViewerInventoryItem *a, const LLViewerInventor class LLDeferredCOFLinkObserver: public LLInventoryObserver { public: - LLDeferredCOFLinkObserver(const LLUUID& item_id, bool do_update, LLPointer<LLInventoryCallback> cb = NULL, std::string description = ""): + LLDeferredCOFLinkObserver(const LLUUID& item_id, LLPointer<LLInventoryCallback> cb = NULL, std::string description = ""): mItemID(item_id), - mDoUpdate(do_update), mCallback(cb), mDescription(description) { @@ -2357,14 +2313,13 @@ public: if (item) { gInventory.removeObserver(this); - LLAppearanceMgr::instance().addCOFItemLink(item,mDoUpdate,mCallback); + LLAppearanceMgr::instance().addCOFItemLink(item, mCallback); delete this; } } private: const LLUUID mItemID; - bool mDoUpdate; std::string mDescription; LLPointer<LLInventoryCallback> mCallback; }; @@ -2372,42 +2327,26 @@ private: // BAP - note that this runs asynchronously if the item is not already loaded from inventory. // Dangerous if caller assumes link will exist after calling the function. -void LLAppearanceMgr::addCOFItemLink(const LLUUID &item_id, bool do_update, LLPointer<LLInventoryCallback> cb, const std::string description) +void LLAppearanceMgr::addCOFItemLink(const LLUUID &item_id, + LLPointer<LLInventoryCallback> cb, + const std::string description) { const LLInventoryItem *item = gInventory.getItem(item_id); if (!item) { - LLDeferredCOFLinkObserver *observer = new LLDeferredCOFLinkObserver(item_id, do_update, cb, description); + LLDeferredCOFLinkObserver *observer = new LLDeferredCOFLinkObserver(item_id, cb, description); gInventory.addObserver(observer); } else { - addCOFItemLink(item, do_update, cb, description); + addCOFItemLink(item, cb, description); } } -void modified_cof_cb(const LLUUID& inv_item) -{ - LLAppearanceMgr::instance().updateAppearanceFromCOF(); - - // Start editing the item if previously requested. - gAgentWearables.editWearableIfRequested(inv_item); - - // TODO: camera mode may not be changed if a debug setting is tweaked - if( gAgentCamera.cameraCustomizeAvatar() ) - { - // If we're in appearance editing mode, the current tab may need to be refreshed - LLSidepanelAppearance *panel = dynamic_cast<LLSidepanelAppearance*>(LLFloaterSidePanelContainer::getPanel("appearance")); - if (panel) - { - panel->showDefaultSubpart(); - } - } -} - -void LLAppearanceMgr::addCOFItemLink(const LLInventoryItem *item, bool do_update, LLPointer<LLInventoryCallback> cb, const std::string description) +void LLAppearanceMgr::addCOFItemLink(const LLInventoryItem *item, + LLPointer<LLInventoryCallback> cb, + const std::string description) { - std::string link_description = description; const LLViewerInventoryItem *vitem = dynamic_cast<const LLViewerInventoryItem*>(item); if (!vitem) { @@ -2447,30 +2386,19 @@ void LLAppearanceMgr::addCOFItemLink(const LLInventoryItem *item, bool do_update ++count; if (is_body_part && inv_item->getIsLinkType() && (vitem->getWearableType() == wearable_type)) { - gInventory.purgeObject(inv_item->getUUID()); + remove_inventory_item(inv_item->getUUID(), cb); } else if (count >= LLAgentWearables::MAX_CLOTHING_PER_TYPE) { // MULTI-WEARABLES: make sure we don't go over MAX_CLOTHING_PER_TYPE - gInventory.purgeObject(inv_item->getUUID()); + remove_inventory_item(inv_item->getUUID(), cb); } } } - if (linked_already) + if (!linked_already) { - if (do_update) - { - LLAppearanceMgr::updateAppearanceFromCOF(); - } - return; - } - else - { - if(do_update && cb.isNull()) - { - cb = new LLBoostFuncInventoryCallback(modified_cof_cb); - } + std::string link_description = description; if (vitem->getIsLinkType()) { link_description = vitem->getActualDescription(); @@ -2483,7 +2411,6 @@ void LLAppearanceMgr::addCOFItemLink(const LLInventoryItem *item, bool do_update LLAssetType::AT_LINK, cb); } - return; } LLInventoryModel::item_array_t LLAppearanceMgr::findCOFItemLinks(const LLUUID& item_id) @@ -2567,7 +2494,7 @@ void LLAppearanceMgr::removeAllAttachmentsFromAvatar() removeItemsFromAvatar(ids_to_remove); } -void LLAppearanceMgr::removeCOFItemLinks(const LLUUID& item_id) +void LLAppearanceMgr::removeCOFItemLinks(const LLUUID& item_id, LLPointer<LLInventoryCallback> cb) { gInventory.addChangedMask(LLInventoryObserver::LABEL, item_id); @@ -2582,12 +2509,12 @@ void LLAppearanceMgr::removeCOFItemLinks(const LLUUID& item_id) const LLInventoryItem* item = item_array.get(i).get(); if (item->getIsLinkType() && item->getLinkedUUID() == item_id) { - gInventory.purgeObject(item->getUUID()); + remove_inventory_item(item->getUUID(), cb); } } } -void LLAppearanceMgr::removeCOFLinksOfType(LLWearableType::EType type) +void LLAppearanceMgr::removeCOFLinksOfType(LLWearableType::EType type, LLPointer<LLInventoryCallback> cb) { LLFindWearablesOfType filter_wearables_of_type(type); LLInventoryModel::cat_array_t cats; @@ -2600,7 +2527,7 @@ void LLAppearanceMgr::removeCOFLinksOfType(LLWearableType::EType type) const LLViewerInventoryItem* item = *it; if (item->getIsLinkType()) // we must operate on links only { - gInventory.purgeObject(item->getUUID()); + remove_inventory_item(item->getUUID(), cb); } } } @@ -3550,7 +3477,7 @@ void LLAppearanceMgr::registerAttachment(const LLUUID& item_id) // we have to pass do_update = true to call LLAppearanceMgr::updateAppearanceFromCOF. // it will trigger gAgentWariables.notifyLoadingFinished() // But it is not acceptable solution. See EXT-7777 - LLAppearanceMgr::addCOFItemLink(item_id, false); // Add COF link for item. + LLAppearanceMgr::addCOFItemLink(item_id); // Add COF link for item. } else { @@ -3586,8 +3513,8 @@ bool LLAppearanceMgr::isLinkInCOF(const LLUUID& obj_id) gInventory.collectDescendentsIf(LLAppearanceMgr::instance().getCOF(), cats, items, - LLInventoryModel::EXCLUDE_TRASH, - find_links); + LLInventoryModel::EXCLUDE_TRASH, + find_links); return !items.empty(); } diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index 0cc06ab210..2cc76c4b4c 100755 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -107,12 +107,13 @@ public: const LLUUID getBaseOutfitUUID(); // Wear/attach an item (from a user's inventory) on the agent - bool wearItemOnAvatar(const LLUUID& item_to_wear, bool do_update = true, bool replace = false, LLPointer<LLInventoryCallback> cb = NULL); + bool wearItemOnAvatar(const LLUUID& item_to_wear, bool do_update, bool replace = false, + LLPointer<LLInventoryCallback> cb = NULL); // Update the displayed outfit name in UI. void updatePanelOutfitName(const std::string& name); - void purgeBaseOutfitLink(const LLUUID& category); + void purgeBaseOutfitLink(const LLUUID& category, LLPointer<LLInventoryCallback> cb = NULL); void createBaseOutfitLink(const LLUUID& category, LLPointer<LLInventoryCallback> link_waiter); void updateAgentWearables(LLWearableHoldingPattern* holder, bool append); @@ -136,15 +137,15 @@ public: LLPointer<LLInventoryCallback> cb); // Add COF link to individual item. - void addCOFItemLink(const LLUUID& item_id, bool do_update = true, LLPointer<LLInventoryCallback> cb = NULL, const std::string description = ""); - void addCOFItemLink(const LLInventoryItem *item, bool do_update = true, LLPointer<LLInventoryCallback> cb = NULL, const std::string description = ""); + void addCOFItemLink(const LLUUID& item_id, LLPointer<LLInventoryCallback> cb = NULL, const std::string description = ""); + void addCOFItemLink(const LLInventoryItem *item, LLPointer<LLInventoryCallback> cb = NULL, const std::string description = ""); // 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); + void removeCOFItemLinks(const LLUUID& item_id, LLPointer<LLInventoryCallback> cb = NULL); + void removeCOFLinksOfType(LLWearableType::EType type, LLPointer<LLInventoryCallback> cb = NULL); void removeAllClothesFromAvatar(); void removeAllAttachmentsFromAvatar(); @@ -272,6 +273,20 @@ private: bool mEnforceItemRestrictions; }; +class LLUpdateAppearanceAndEditWearableOnDestroy: public LLInventoryCallback +{ +public: + LLUpdateAppearanceAndEditWearableOnDestroy(const LLUUID& item_id); + + /* virtual */ void fire(const LLUUID& item_id) {} + + ~LLUpdateAppearanceAndEditWearableOnDestroy(); + +private: + LLUUID mItemID; +}; + +class #define SUPPORT_ENSEMBLES 0 diff --git a/indra/newview/llfloatergesture.cpp b/indra/newview/llfloatergesture.cpp index 56051ff684..def4d40f9f 100644 --- a/indra/newview/llfloatergesture.cpp +++ b/indra/newview/llfloatergesture.cpp @@ -619,7 +619,7 @@ void LLFloaterGesture::addToCurrentOutFit() LLAppearanceMgr* am = LLAppearanceMgr::getInstance(); for(uuid_vec_t::const_iterator it = ids.begin(); it != ids.end(); it++) { - am->addCOFItemLink(*it); + am->addCOFItemLink(*it, new LLUpdateAppearanceAndEditWearableOnDestroy(*it)); } } diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index c09d4393c8..0e3057dcad 100644 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -1184,12 +1184,12 @@ BOOL LLPanelOutfitEdit::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, * second argument is used to delay the appearance update until all dragged items * are added to optimize user experience. */ - LLAppearanceMgr::instance().addCOFItemLink(item->getLinkedUUID(), false); + LLAppearanceMgr::instance().addCOFItemLink(item->getLinkedUUID()); } else { // if asset id is not available for the item we must wear it immediately (attachments only) - LLAppearanceMgr::instance().addCOFItemLink(item->getLinkedUUID(), true); + LLAppearanceMgr::instance().addCOFItemLink(item->getLinkedUUID(), new LLUpdateAppearanceAndEditWearableOnDestroy(item->getUUID())); } } diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h index 7cb62efb47..6b0e8ed4ef 100755 --- a/indra/newview/llviewerinventory.h +++ b/indra/newview/llviewerinventory.h @@ -274,7 +274,7 @@ class LLBoostFuncInventoryCallback: public LLInventoryCallback { public: - LLBoostFuncInventoryCallback(inventory_func_type fire_func, + LLBoostFuncInventoryCallback(inventory_func_type fire_func = no_op_inventory_func, nullary_func_type destroy_func = no_op): mFireFunc(fire_func), mDestroyFunc(destroy_func) -- cgit v1.2.3 From 4967998a5c10abcc64e097a4e95505f9adbe4de7 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Wed, 24 Apr 2013 13:27:04 -0400 Subject: CHUI-849 WIP, SH-4116 WIP - added simpler match check in inventory for when we don't need the list of matches to be returned. --- indra/newview/llappearancemgr.cpp | 61 +++++++++----------------------------- indra/newview/llinventorymodel.cpp | 59 ++++++++++++++++++++++++++++++------ indra/newview/llinventorymodel.h | 3 ++ 3 files changed, 67 insertions(+), 56 deletions(-) mode change 100644 => 100755 indra/newview/llinventorymodel.h (limited to 'indra/newview') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 634f5d1389..5a9901f12d 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1541,15 +1541,8 @@ bool LLAppearanceMgr::getCanRemoveOutfit(const LLUUID& outfit_cat_id) // static bool LLAppearanceMgr::getCanRemoveFromCOF(const LLUUID& outfit_cat_id) { - LLInventoryModel::cat_array_t cats; - LLInventoryModel::item_array_t items; LLFindWearablesEx is_worn(/*is_worn=*/ true, /*include_body_parts=*/ false); - gInventory.collectDescendentsIf(outfit_cat_id, - cats, - items, - LLInventoryModel::EXCLUDE_TRASH, - is_worn); - return items.size() > 0; + return gInventory.hasMatchingDirectDescendent(outfit_cat_id, is_worn); } // static @@ -1560,15 +1553,8 @@ bool LLAppearanceMgr::getCanAddToCOF(const LLUUID& outfit_cat_id) return false; } - LLInventoryModel::cat_array_t cats; - LLInventoryModel::item_array_t items; LLFindWearablesEx not_worn(/*is_worn=*/ false, /*include_body_parts=*/ false); - gInventory.collectDescendentsIf(outfit_cat_id, - cats, - items, - LLInventoryModel::EXCLUDE_TRASH, - not_worn); - return items.size() > 0; + return gInventory.hasMatchingDirectDescendent(outfit_cat_id, not_worn); } bool LLAppearanceMgr::getCanReplaceCOF(const LLUUID& outfit_cat_id) @@ -1586,15 +1572,8 @@ bool LLAppearanceMgr::getCanReplaceCOF(const LLUUID& outfit_cat_id) } // Check whether the outfit contains any wearables we aren't wearing already (STORM-702). - LLInventoryModel::cat_array_t cats; - LLInventoryModel::item_array_t items; LLFindWearablesEx is_worn(/*is_worn=*/ false, /*include_body_parts=*/ true); - gInventory.collectDescendentsIf(outfit_cat_id, - cats, - items, - LLInventoryModel::EXCLUDE_TRASH, - is_worn); - return items.size() > 0; + return gInventory.hasMatchingDirectDescendent(outfit_cat_id, is_worn); } void LLAppearanceMgr::purgeBaseOutfitLink(const LLUUID& category, LLPointer<LLInventoryCallback> cb) @@ -2243,6 +2222,7 @@ void LLAppearanceMgr::wearInventoryCategoryOnAvatar( LLInventoryCategory* catego LLAppearanceMgr::changeOutfit(TRUE, category->getUUID(), append); } +// FIXME do we really want to search entire inventory for matching name? void LLAppearanceMgr::wearOutfitByName(const std::string& name) { LL_INFOS("Avatar") << self_av_string() << "Wearing category " << name << LL_ENDL; @@ -3501,22 +3481,21 @@ void LLAppearanceMgr::unregisterAttachment(const LLUUID& item_id) BOOL LLAppearanceMgr::getIsInCOF(const LLUUID& obj_id) const { - return gInventory.isObjectDescendentOf(obj_id, getCOF()); + const LLUUID& cof = getCOF(); + if (obj_id == cof) + return TRUE; + const LLInventoryObject* obj = gInventory.getObject(obj_id); + if (obj && obj->getParentUUID() == cof) + return TRUE; + return FALSE; } // static bool LLAppearanceMgr::isLinkInCOF(const LLUUID& obj_id) { - LLInventoryModel::cat_array_t cats; - LLInventoryModel::item_array_t items; - LLLinkedItemIDMatches find_links(gInventory.getLinkedItemID(obj_id)); - gInventory.collectDescendentsIf(LLAppearanceMgr::instance().getCOF(), - cats, - items, - LLInventoryModel::EXCLUDE_TRASH, - find_links); - - return !items.empty(); + const LLUUID& target_id = gInventory.getLinkedItemID(obj_id); + LLLinkedItemIDMatches find_links(target_id); + return gInventory.hasMatchingDirectDescendent(LLAppearanceMgr::instance().getCOF(), find_links); } BOOL LLAppearanceMgr::getIsProtectedCOFItem(const LLUUID& obj_id) const @@ -3533,18 +3512,6 @@ BOOL LLAppearanceMgr::getIsProtectedCOFItem(const LLUUID& obj_id) const // For now, don't allow direct deletion from the COF. Instead, force users // to choose "Detach" or "Take Off". return TRUE; - /* - const LLInventoryObject *obj = gInventory.getObject(obj_id); - if (!obj) return FALSE; - - // Can't delete bodyparts, since this would be equivalent to removing the item. - if (obj->getType() == LLAssetType::AT_BODYPART) return TRUE; - - // Can't delete the folder link, since this is saved for bookkeeping. - if (obj->getActualType() == LLAssetType::AT_LINK_FOLDER) return TRUE; - - return FALSE; - */ } class CallAfterCategoryFetchStage2: public LLInventoryFetchItemsObserver diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index bbf284147a..11223d96b6 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -593,6 +593,40 @@ LLUUID LLInventoryModel::createNewCategory(const LLUUID& parent_id, return id; } +// This is optimized for the case that we just want to know whether a +// category has any immediate children meeting a condition, without +// needing to recurse or build up any lists. +bool LLInventoryModel::hasMatchingDirectDescendent(const LLUUID& cat_id, + LLInventoryCollectFunctor& filter) +{ + LLInventoryModel::cat_array_t *cats; + LLInventoryModel::item_array_t *items; + getDirectDescendentsOf(cat_id, cats, items); + if (cats) + { + for (LLInventoryModel::cat_array_t::const_iterator it = cats->begin(); + it != cats->end(); ++it) + { + if (filter(*it,NULL)) + { + return true; + } + } + } + if (items) + { + for (LLInventoryModel::item_array_t::const_iterator it = items->begin(); + it != items->end(); ++it) + { + if (filter(NULL,*it)) + { + return true; + } + } + } + return false; +} + // Starting with the object specified, add it's descendents to the // array provided, but do not add the inventory object specified by // id. There is no guaranteed order. Neither array will be erased @@ -723,6 +757,10 @@ LLInventoryModel::item_array_t LLInventoryModel::collectLinkedItems(const LLUUID const LLUUID& start_folder_id) { item_array_t items; + const LLInventoryObject *obj = getObject(id); + if (!obj || obj->getIsLinkType()) + return items; + LLInventoryModel::cat_array_t cat_array; LLLinkedItemIDMatches is_linked_item_match(id); collectDescendentsIf((start_folder_id == LLUUID::null ? gInventory.getRootFolderID() : start_folder_id), @@ -1170,17 +1208,20 @@ void LLInventoryModel::updateLinkedObjectsFromPurge(const LLUUID &baseobj_id) // REBUILD is expensive, so clear the current change list first else // everything else on the changelist will also get rebuilt. - gInventory.notifyObservers(); - for (LLInventoryModel::item_array_t::const_iterator iter = item_array.begin(); - iter != item_array.end(); - iter++) + if (item_array.size()) { - const LLViewerInventoryItem *linked_item = (*iter); - const LLUUID &item_id = linked_item->getUUID(); - if (item_id == baseobj_id) continue; - addChangedMask(LLInventoryObserver::REBUILD, item_id); + gInventory.notifyObservers(); + for (LLInventoryModel::item_array_t::const_iterator iter = item_array.begin(); + iter != item_array.end(); + iter++) + { + const LLViewerInventoryItem *linked_item = (*iter); + const LLUUID &item_id = linked_item->getUUID(); + if (item_id == baseobj_id) continue; + addChangedMask(LLInventoryObserver::REBUILD, item_id); + } + gInventory.notifyObservers(); } - gInventory.notifyObservers(); } // This is a method which collects the descendents of the id diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h old mode 100644 new mode 100755 index 0b017b7514..50b57ea08d --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -205,6 +205,9 @@ public: EXCLUDE_TRASH = FALSE, INCLUDE_TRASH = TRUE }; + // Simpler existence test if matches don't actually need to be collected. + bool hasMatchingDirectDescendent(const LLUUID& cat_id, + LLInventoryCollectFunctor& filter); void collectDescendents(const LLUUID& id, cat_array_t& categories, item_array_t& items, -- cgit v1.2.3 From a9fa707a7da9977914db8527f15b59bb6a4bc6b7 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Wed, 24 Apr 2013 16:09:33 -0400 Subject: SH-4128 - more cleanup of COF-link manipulating functions --- indra/newview/llappearancemgr.cpp | 60 +++++++++++++++++++------------------- indra/newview/llfloatergesture.cpp | 3 +- 2 files changed, 32 insertions(+), 31 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 5a9901f12d..792220c385 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -430,6 +430,16 @@ LLUpdateAppearanceOnDestroy::LLUpdateAppearanceOnDestroy(bool update_base_outfit selfStartPhase("update_appearance_on_destroy"); } +void LLUpdateAppearanceOnDestroy::fire(const LLUUID& inv_item) +{ + LLViewerInventoryItem* item = (LLViewerInventoryItem*)gInventory.getItem(inv_item); + const std::string item_name = item ? item->getName() : "ITEM NOT FOUND"; +#ifndef LL_RELEASE_FOR_DOWNLOAD + LL_DEBUGS("Avatar") << self_av_string() << "callback fired [ name:" << item_name << " UUID:" << inv_item << " count:" << mFireCount << " ] " << LL_ENDL; +#endif + mFireCount++; +} + LLUpdateAppearanceOnDestroy::~LLUpdateAppearanceOnDestroy() { if (!LLApp::isExiting()) @@ -443,16 +453,6 @@ LLUpdateAppearanceOnDestroy::~LLUpdateAppearanceOnDestroy() } } -void LLUpdateAppearanceOnDestroy::fire(const LLUUID& inv_item) -{ - LLViewerInventoryItem* item = (LLViewerInventoryItem*)gInventory.getItem(inv_item); - const std::string item_name = item ? item->getName() : "ITEM NOT FOUND"; -#ifndef LL_RELEASE_FOR_DOWNLOAD - LL_DEBUGS("Avatar") << self_av_string() << "callback fired [ name:" << item_name << " UUID:" << inv_item << " count:" << mFireCount << " ] " << LL_ENDL; -#endif - mFireCount++; -} - LLUpdateAppearanceAndEditWearableOnDestroy::LLUpdateAppearanceAndEditWearableOnDestroy(const LLUUID& item_id): mItemID(item_id) { @@ -460,20 +460,23 @@ LLUpdateAppearanceAndEditWearableOnDestroy::LLUpdateAppearanceAndEditWearableOnD LLUpdateAppearanceAndEditWearableOnDestroy::~LLUpdateAppearanceAndEditWearableOnDestroy() { - LLAppearanceMgr::instance().updateAppearanceFromCOF(); - - // Start editing the item if previously requested. - gAgentWearables.editWearableIfRequested(mItemID); - - // TODO: camera mode may not be changed if a debug setting is tweaked - if( gAgentCamera.cameraCustomizeAvatar() ) + if (!LLApp::isExiting()) { - // If we're in appearance editing mode, the current tab may need to be refreshed - LLSidepanelAppearance *panel = dynamic_cast<LLSidepanelAppearance*>( - LLFloaterSidePanelContainer::getPanel("appearance")); - if (panel) + LLAppearanceMgr::instance().updateAppearanceFromCOF(); + + // Start editing the item if previously requested. + gAgentWearables.editWearableIfRequested(mItemID); + + // TODO: camera mode may not be changed if a debug setting is tweaked + if( gAgentCamera.cameraCustomizeAvatar() ) { - panel->showDefaultSubpart(); + // If we're in appearance editing mode, the current tab may need to be refreshed + LLSidepanelAppearance *panel = dynamic_cast<LLSidepanelAppearance*>( + LLFloaterSidePanelContainer::getPanel("appearance")); + if (panel) + { + panel->showDefaultSubpart(); + } } } } @@ -1587,13 +1590,10 @@ void LLAppearanceMgr::purgeBaseOutfitLink(const LLUUID& category, LLPointer<LLIn LLViewerInventoryItem *item = items.get(i); if (item->getActualType() != LLAssetType::AT_LINK_FOLDER) continue; - if (item->getIsLinkType()) + LLViewerInventoryCategory* catp = item->getLinkedCategory(); + if(catp && catp->getPreferredType() == LLFolderType::FT_OUTFIT) { - LLViewerInventoryCategory* catp = item->getLinkedCategory(); - if(catp && catp->getPreferredType() == LLFolderType::FT_OUTFIT) - { - remove_inventory_item(item->getUUID(), cb); - } + remove_inventory_item(item->getUUID(), cb); } } } @@ -2276,7 +2276,7 @@ bool areMatchingWearables(const LLViewerInventoryItem *a, const LLViewerInventor class LLDeferredCOFLinkObserver: public LLInventoryObserver { public: - LLDeferredCOFLinkObserver(const LLUUID& item_id, LLPointer<LLInventoryCallback> cb = NULL, std::string description = ""): + LLDeferredCOFLinkObserver(const LLUUID& item_id, LLPointer<LLInventoryCallback> cb, const std::string& description): mItemID(item_id), mCallback(cb), mDescription(description) @@ -2293,7 +2293,7 @@ public: if (item) { gInventory.removeObserver(this); - LLAppearanceMgr::instance().addCOFItemLink(item, mCallback); + LLAppearanceMgr::instance().addCOFItemLink(item, mCallback, mDescription); delete this; } } diff --git a/indra/newview/llfloatergesture.cpp b/indra/newview/llfloatergesture.cpp index def4d40f9f..af5c11e12c 100644 --- a/indra/newview/llfloatergesture.cpp +++ b/indra/newview/llfloatergesture.cpp @@ -617,9 +617,10 @@ void LLFloaterGesture::addToCurrentOutFit() uuid_vec_t ids; getSelectedIds(ids); LLAppearanceMgr* am = LLAppearanceMgr::getInstance(); + LLPointer<LLInventoryCallback> cb = new LLUpdateAppearanceOnDestroy; for(uuid_vec_t::const_iterator it = ids.begin(); it != ids.end(); it++) { - am->addCOFItemLink(*it, new LLUpdateAppearanceAndEditWearableOnDestroy(*it)); + am->addCOFItemLink(*it, cb); } } -- cgit v1.2.3 From eb88e4d37850a48132193d332fa8945d3932369b Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Wed, 24 Apr 2013 18:08:20 -0400 Subject: SH-4128 WIP - cleanup around item link removal and callbacks --- indra/newview/llappearancemgr.cpp | 24 ++++++++++++++---------- indra/newview/llgesturemgr.cpp | 13 ++++++++++--- indra/newview/llinventorymodel.cpp | 5 +++-- indra/newview/llpaneleditwearable.cpp | 23 ++++++++++++++++++----- 4 files changed, 45 insertions(+), 20 deletions(-) mode change 100644 => 100755 indra/newview/llgesturemgr.cpp mode change 100644 => 100755 indra/newview/llpaneleditwearable.cpp (limited to 'indra/newview') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 792220c385..399cea676c 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1265,18 +1265,21 @@ bool LLAppearanceMgr::wearItemOnAvatar(const LLUUID& item_id_to_wear, switch (item_to_wear->getType()) { case LLAssetType::AT_CLOTHING: - if (gAgentWearables.areWearablesLoaded()) + if (gAgentWearables.areWearablesLoaded()) { + if (!cb && do_update) + { + cb = new LLUpdateAppearanceAndEditWearableOnDestroy(item_id_to_wear); + } S32 wearable_count = gAgentWearables.getWearableCount(item_to_wear->getWearableType()); if ((replace && wearable_count != 0) || (wearable_count >= LLAgentWearables::MAX_CLOTHING_PER_TYPE) ) { - removeCOFItemLinks(gAgentWearables.getWearableItemID(item_to_wear->getWearableType(), wearable_count-1)); - } - if (!cb && do_update) - { - cb = new LLUpdateAppearanceAndEditWearableOnDestroy(item_id_to_wear); + LLUUID item_id = gAgentWearables.getWearableItemID(item_to_wear->getWearableType(), + wearable_count-1); + removeCOFItemLinks(item_id, cb); } + addCOFItemLink(item_to_wear, cb); } break; @@ -3284,21 +3287,22 @@ void LLAppearanceMgr::removeItemsFromAvatar(const uuid_vec_t& ids_to_remove) if (ids_to_remove.empty()) { llwarns << "called with empty list, nothing to do" << llendl; + return; } + LLPointer<LLInventoryCallback> cb = new LLUpdateAppearanceOnDestroy; for (uuid_vec_t::const_iterator it = ids_to_remove.begin(); it != ids_to_remove.end(); ++it) { const LLUUID& id_to_remove = *it; const LLUUID& linked_item_id = gInventory.getLinkedItemID(id_to_remove); - removeCOFItemLinks(linked_item_id); + removeCOFItemLinks(linked_item_id, cb); } - updateAppearanceFromCOF(); } void LLAppearanceMgr::removeItemFromAvatar(const LLUUID& id_to_remove) { LLUUID linked_item_id = gInventory.getLinkedItemID(id_to_remove); - removeCOFItemLinks(linked_item_id); - updateAppearanceFromCOF(); + LLPointer<LLInventoryCallback> cb = new LLUpdateAppearanceOnDestroy; + removeCOFItemLinks(linked_item_id, cb); } bool LLAppearanceMgr::moveWearable(LLViewerInventoryItem* item, bool closer_to_body) diff --git a/indra/newview/llgesturemgr.cpp b/indra/newview/llgesturemgr.cpp old mode 100644 new mode 100755 index 9aa86297fc..5eaa83d872 --- a/indra/newview/llgesturemgr.cpp +++ b/indra/newview/llgesturemgr.cpp @@ -299,6 +299,12 @@ void LLGestureMgr::activateGestureWithAsset(const LLUUID& item_id, } +void notify_update_label(const LLUUID& base_item_id) +{ + gInventory.addChangedMask(LLInventoryObserver::LABEL, base_item_id); + LLGestureMgr::instance().notifyObservers(); +} + void LLGestureMgr::deactivateGesture(const LLUUID& item_id) { const LLUUID& base_item_id = get_linked_uuid(item_id); @@ -322,7 +328,6 @@ void LLGestureMgr::deactivateGesture(const LLUUID& item_id) } mActive.erase(it); - gInventory.addChangedMask(LLInventoryObserver::LABEL, base_item_id); // Inform the database of this change LLMessageSystem* msg = gMessageSystem; @@ -338,9 +343,11 @@ void LLGestureMgr::deactivateGesture(const LLUUID& item_id) gAgent.sendReliableMessage(); - LLAppearanceMgr::instance().removeCOFItemLinks(base_item_id); + LLPointer<LLInventoryCallback> cb = + new LLBoostFuncInventoryCallback(no_op_inventory_func, + boost::bind(notify_update_label,base_item_id)); - notifyObservers(); + LLAppearanceMgr::instance().removeCOFItemLinks(base_item_id, cb); } diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 11223d96b6..bc327b8359 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1178,10 +1178,11 @@ void LLInventoryModel::deleteObject(const LLUUID& id) mParentChildCategoryTree.erase(id); } addChangedMask(LLInventoryObserver::REMOVE, id); - bool is_link_type = obj->getIsLinkType(); obj = NULL; // delete obj + // Can't have links to links, so there's no need for this update // if the item removed is a link. + bool is_link_type = obj->getIsLinkType(); if (!is_link_type) { updateLinkedObjectsFromPurge(id); @@ -1208,7 +1209,7 @@ void LLInventoryModel::updateLinkedObjectsFromPurge(const LLUUID &baseobj_id) // REBUILD is expensive, so clear the current change list first else // everything else on the changelist will also get rebuilt. - if (item_array.size()) + if (item_array.size() > 0) { gInventory.notifyObservers(); for (LLInventoryModel::item_array_t::const_iterator iter = item_array.begin(); diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp old mode 100644 new mode 100755 index e71dba5cae..06c923273b --- a/indra/newview/llpaneleditwearable.cpp +++ b/indra/newview/llpaneleditwearable.cpp @@ -1079,10 +1079,15 @@ 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()); + // FIXME race condition if removeCOFItemLinks does not + // complete immediately. Looks like we're counting on the + // fact that updateAppearanceFromCOF will get called after + // we exit customize mode. + + // 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 { @@ -1091,6 +1096,14 @@ void LLPanelEditWearable::saveChanges(bool force_save_as) // version so texture baking service knows appearance has changed. if (link_item) { + // FIXME - two link-modifying calls here plus one + // inventory change request, none of which use a + // callback. When does a new appearance request go out + // and how is it synced with these changes? As above, + // we seem to be implicitly depending on + // updateAppearanceFromCOF() to be called when we + // exit customize mode. + // Create new link link_inventory_item( gAgent.getID(), link_item->getLinkedUUID(), @@ -1100,9 +1113,9 @@ void LLPanelEditWearable::saveChanges(bool force_save_as) LLAssetType::AT_LINK, NULL); // Remove old link - gInventory.purgeObject(link_item->getUUID()); + remove_inventory_item(link_item->getUUID()); } - gAgentWearables.saveWearable(mWearablePtr->getType(), index, TRUE, new_name); + gAgentWearables.saveWearable(mWearablePtr->getType(), index, TRUE, new_name); } -- cgit v1.2.3 From d73588eaddb1ada6ac896850c3aa9d25307e076a Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Wed, 24 Apr 2013 18:38:40 -0400 Subject: SH-4128 WIP - misc cleanup --- indra/newview/llinventorymodel.cpp | 4 ++-- indra/newview/llpaneleditwearable.cpp | 2 +- indra/newview/llviewerinventory.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index bc327b8359..a0b9e7b0ec 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1178,11 +1178,11 @@ void LLInventoryModel::deleteObject(const LLUUID& id) mParentChildCategoryTree.erase(id); } addChangedMask(LLInventoryObserver::REMOVE, id); - obj = NULL; // delete obj - + // Can't have links to links, so there's no need for this update // if the item removed is a link. bool is_link_type = obj->getIsLinkType(); + obj = NULL; // delete obj if (!is_link_type) { updateLinkedObjectsFromPurge(id); diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp index 06c923273b..580e31591c 100755 --- a/indra/newview/llpaneleditwearable.cpp +++ b/indra/newview/llpaneleditwearable.cpp @@ -1113,7 +1113,7 @@ void LLPanelEditWearable::saveChanges(bool force_save_as) LLAssetType::AT_LINK, NULL); // Remove old link - remove_inventory_item(link_item->getUUID()); + remove_inventory_item(link_item->getUUID(), NULL); } gAgentWearables.saveWearable(mWearablePtr->getType(), index, TRUE, new_name); } diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 316fca7769..06efeb86d9 100755 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -1276,7 +1276,7 @@ void remove_inventory_item( } else { - llwarns << "remove_inventory_item called for nonexistent item " << item_id << llendl; + llwarns << "remove_inventory_item called for invalid or nonexistent item " << item_id << llendl; } } -- cgit v1.2.3 From d58b9ee54e84b709e063cdbbc349de25feafa59b Mon Sep 17 00:00:00 2001 From: Nyx Linden <nyx@lindenlab.com> Date: Thu, 25 Apr 2013 14:09:42 -0400 Subject: SH-4050 FIX camera goes underground if hover set low enough Changing viewer limit for avatar height to match server limit, camera does not go underground. Also clarified where we do not need avatar offset in the code, through comments --- indra/newview/llvoavatar.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 0475e9fc89..bf6e28b93d 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -2144,7 +2144,7 @@ void LLVOAvatar::idleUpdateVoiceVisualizer(bool voice_enabled) { LLVector3 tagPos = mRoot->getWorldPosition(); tagPos[VZ] -= mPelvisToFoot; - tagPos[VZ] += ( mBodySize[VZ] + 0.125f ); + tagPos[VZ] += ( mBodySize[VZ] + 0.125f ); // does not need mAvatarOffset -Nyx mVoiceVisualizer->setVoiceSourceWorldPosition( tagPos ); } }//if ( voiceEnabled ) @@ -2885,6 +2885,8 @@ void LLVOAvatar::idleUpdateNameTagPosition(const LLVector3& root_pos_last) local_camera_up.normalize(); local_camera_up = local_camera_up * inv_root_rot; + + // position is based on head position, does not require mAvatarOffset here. - Nyx LLVector3 avatar_ellipsoid(mBodySize.mV[VX] * 0.4f, mBodySize.mV[VY] * 0.4f, mBodySize.mV[VZ] * NAMETAG_VERT_OFFSET_WEIGHT); -- cgit v1.2.3 From d843a0d8bef5d36d3a4ef838b1b0335b4532147b Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Thu, 25 Apr 2013 17:09:05 -0400 Subject: SH-4137 WIP - added callback-based support for purge descendents, remove category --- indra/newview/llinventorybridge.cpp | 9 +- indra/newview/llinventorymodel.cpp | 207 ++++++++++---------------- indra/newview/llinventorymodel.h | 19 +-- indra/newview/llpreview.cpp | 7 - indra/newview/llviewerinventory.cpp | 286 ++++++++++++++++++++++++++++-------- indra/newview/llviewerinventory.h | 14 +- 6 files changed, 321 insertions(+), 221 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index a5043a30ac..27f35c5946 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1159,17 +1159,10 @@ LLInvFVBridge* LLInvFVBridge::createBridge(LLAssetType::EType asset_type, void LLInvFVBridge::purgeItem(LLInventoryModel *model, const LLUUID &uuid) { - LLInventoryCategory* cat = model->getCategory(uuid); - if (cat) - { - model->purgeDescendentsOf(uuid); - model->notifyObservers(); - } LLInventoryObject* obj = model->getObject(uuid); if (obj) { - model->purgeObject(uuid); - model->notifyObservers(); + remove_inventory_object(uuid, NULL); } } diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index a0b9e7b0ec..ae8efeecda 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1136,6 +1136,79 @@ void LLInventoryModel::changeCategoryParent(LLViewerInventoryCategory* cat, notifyObservers(); } +// Update model after descendents have been purged. +void LLInventoryModel::onDescendentsPurgedFromServer(const LLUUID& object_id) +{ + LLPointer<LLViewerInventoryCategory> cat = getCategory(object_id); + if (cat.notNull()) + { + // do the cache accounting + S32 descendents = cat->getDescendentCount(); + if(descendents > 0) + { + LLInventoryModel::LLCategoryUpdate up(object_id, -descendents); + accountForUpdate(up); + } + + // we know that descendent count is 0, however since the + // accounting may actually not do an update, we should force + // it here. + cat->setDescendentCount(0); + + // unceremoniously remove anything we have locally stored. + LLInventoryModel::cat_array_t categories; + LLInventoryModel::item_array_t items; + collectDescendents(object_id, + categories, + items, + LLInventoryModel::INCLUDE_TRASH); + S32 count = items.count(); + + LLUUID uu_id; + for(S32 i = 0; i < count; ++i) + { + uu_id = items.get(i)->getUUID(); + + // This check prevents the deletion of a previously deleted item. + // This is necessary because deletion is not done in a hierarchical + // order. The current item may have been already deleted as a child + // of its deleted parent. + if (getItem(uu_id)) + { + deleteObject(uu_id); + } + } + + count = categories.count(); + for(S32 i = 0; i < count; ++i) + { + uu_id = categories.get(i)->getUUID(); + if (getCategory(uu_id)) + { + deleteObject(uu_id); + } + } + } +} + +// Update model after an item is confirmed as removed from +// server. Works for categories or items. +void LLInventoryModel::onObjectDeletedFromServer(const LLUUID& object_id) +{ + LLPointer<LLInventoryObject> obj = getObject(object_id); + if(obj) + { + // From item/cat removeFromServer() + LLInventoryModel::LLCategoryUpdate up(obj->getParentUUID(), -1); + accountForUpdate(up); + + // From purgeObject() + LLPreview::hide(object_id); + deleteObject(object_id); + } +} + + // Delete a particular inventory object by ID. void LLInventoryModel::deleteObject(const LLUUID& id) { @@ -1187,20 +1260,7 @@ void LLInventoryModel::deleteObject(const LLUUID& id) { updateLinkedObjectsFromPurge(id); } - gInventory.notifyObservers(); -} - -// Delete a particular inventory item by ID, and remove it from the server. -void LLInventoryModel::purgeObject(const LLUUID &id) -{ - lldebugs << "LLInventoryModel::purgeObject() [ id: " << id << " ] " << llendl; - LLPointer<LLInventoryObject> obj = getObject(id); - if(obj) - { - obj->removeFromServer(); - LLPreview::hide(id); - deleteObject(id); - } + notifyObservers(); } void LLInventoryModel::updateLinkedObjectsFromPurge(const LLUUID &baseobj_id) @@ -1225,119 +1285,6 @@ void LLInventoryModel::updateLinkedObjectsFromPurge(const LLUUID &baseobj_id) } } -// This is a method which collects the descendents of the id -// provided. If the category is not found, no action is -// taken. This method goes through the long winded process of -// cancelling any calling cards, removing server representation of -// folders, items, etc in a fairly efficient manner. -void LLInventoryModel::purgeDescendentsOf(const LLUUID& id) -{ - EHasChildren children = categoryHasChildren(id); - if(children == CHILDREN_NO) - { - llinfos << "Not purging descendents of " << id << llendl; - return; - } - LLPointer<LLViewerInventoryCategory> cat = getCategory(id); - if (cat.notNull()) - { - if (LLClipboard::instance().hasContents() && LLClipboard::instance().isCutMode()) - { - // Something on the clipboard is in "cut mode" and needs to be preserved - llinfos << "LLInventoryModel::purgeDescendentsOf " << cat->getName() - << " iterate and purge non hidden items" << llendl; - cat_array_t* categories; - item_array_t* items; - // Get the list of direct descendants in tha categoy passed as argument - getDirectDescendentsOf(id, categories, items); - std::vector<LLUUID> list_uuids; - // Make a unique list with all the UUIDs of the direct descendants (items and categories are not treated differently) - // Note: we need to do that shallow copy as purging things will invalidate the categories or items lists - for (cat_array_t::const_iterator it = categories->begin(); it != categories->end(); ++it) - { - list_uuids.push_back((*it)->getUUID()); - } - for (item_array_t::const_iterator it = items->begin(); it != items->end(); ++it) - { - list_uuids.push_back((*it)->getUUID()); - } - // Iterate through the list and only purge the UUIDs that are not on the clipboard - for (std::vector<LLUUID>::const_iterator it = list_uuids.begin(); it != list_uuids.end(); ++it) - { - if (!LLClipboard::instance().isOnClipboard(*it)) - { - purgeObject(*it); - } - } - } - else - { - // Fast purge - // do the cache accounting - llinfos << "LLInventoryModel::purgeDescendentsOf " << cat->getName() - << llendl; - S32 descendents = cat->getDescendentCount(); - if(descendents > 0) - { - LLCategoryUpdate up(id, -descendents); - accountForUpdate(up); - } - - // we know that descendent count is 0, however since the - // accounting may actually not do an update, we should force - // it here. - cat->setDescendentCount(0); - - // send it upstream - LLMessageSystem* msg = gMessageSystem; - msg->newMessage("PurgeInventoryDescendents"); - msg->nextBlock("AgentData"); - msg->addUUID("AgentID", gAgent.getID()); - msg->addUUID("SessionID", gAgent.getSessionID()); - msg->nextBlock("InventoryData"); - msg->addUUID("FolderID", id); - gAgent.sendReliableMessage(); - - // unceremoniously remove anything we have locally stored. - cat_array_t categories; - item_array_t items; - collectDescendents(id, - categories, - items, - INCLUDE_TRASH); - S32 count = items.count(); - - item_map_t::iterator item_map_end = mItemMap.end(); - cat_map_t::iterator cat_map_end = mCategoryMap.end(); - LLUUID uu_id; - - for(S32 i = 0; i < count; ++i) - { - uu_id = items.get(i)->getUUID(); - - // This check prevents the deletion of a previously deleted item. - // This is necessary because deletion is not done in a hierarchical - // order. The current item may have been already deleted as a child - // of its deleted parent. - if (mItemMap.find(uu_id) != item_map_end) - { - deleteObject(uu_id); - } - } - - count = categories.count(); - for(S32 i = 0; i < count; ++i) - { - uu_id = categories.get(i)->getUUID(); - if (mCategoryMap.find(uu_id) != cat_map_end) - { - deleteObject(uu_id); - } - } - } - } -} - // Add/remove an observer. If the observer is destroyed, be sure to // remove it. void LLInventoryModel::addObserver(LLInventoryObserver* observer) @@ -3114,8 +3061,7 @@ bool LLInventoryModel::callbackEmptyFolderType(const LLSD& notification, const L if (option == 0) // YES { const LLUUID folder_id = findCategoryUUIDForType(preferred_type); - purgeDescendentsOf(folder_id); - notifyObservers(); + purge_descendents_of(folder_id, NULL); } return false; } @@ -3130,8 +3076,7 @@ void LLInventoryModel::emptyFolderType(const std::string notification, LLFolderT else { const LLUUID folder_id = findCategoryUUIDForType(preferred_type); - purgeDescendentsOf(folder_id); - notifyObservers(); + purge_descendents_of(folder_id, NULL); } } diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index 50b57ea08d..b7e1888f20 100755 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -325,6 +325,14 @@ public: // Delete //-------------------------------------------------------------------- public: + + // Update model after an item is confirmed as removed from + // server. Works for categories or items. + void onObjectDeletedFromServer(const LLUUID& item_id); + + // Update model after all descendents removed from server. + void onDescendentsPurgedFromServer(const LLUUID& object_id); + // Delete a particular inventory object by ID. Will purge one // object from the internal data structures, maintaining a // consistent internal state. No cache accounting, observer @@ -337,17 +345,6 @@ public: /// removeItem() or removeCategory(), whichever is appropriate void removeObject(const LLUUID& object_id); - // Delete a particular inventory object by ID, and delete it from - // the server. Also updates linked items. - void purgeObject(const LLUUID& id); - - // Collects and purges the descendants of the id - // provided. If the category is not found, no action is - // taken. This method goes through the long winded process of - // removing server representation of folders and items while doing - // cache accounting in a fairly efficient manner. This method does - // not notify observers (though maybe it should...) - void purgeDescendentsOf(const LLUUID& id); protected: void updateLinkedObjectsFromPurge(const LLUUID& baseobj_id); diff --git a/indra/newview/llpreview.cpp b/indra/newview/llpreview.cpp index 04934b13f1..452efad291 100644 --- a/indra/newview/llpreview.cpp +++ b/indra/newview/llpreview.cpp @@ -401,13 +401,6 @@ void LLPreview::onDiscardBtn(void* data) self->mForceClose = TRUE; self->closeFloater(); - // Delete the item entirely - /* - item->removeFromServer(); - gInventory.deleteObject(item->getUUID()); - gInventory.notifyObservers(); - */ - // Move the item to the trash const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH); if (item->getParentUUID() != trash_id) diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 06efeb86d9..fbd6b292bd 100755 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -65,6 +65,7 @@ #include "llavataractions.h" #include "lllogininstance.h" #include "llfavoritesbar.h" +#include "llclipboard.h" // Two do-nothing ops for use in callbacks. void no_op_inventory_func(const LLUUID&) {} @@ -345,24 +346,6 @@ void LLViewerInventoryItem::cloneViewerItem(LLPointer<LLViewerInventoryItem>& ne } } -void LLViewerInventoryItem::removeFromServer() -{ - lldebugs << "Removing inventory item " << mUUID << " from server." - << llendl; - - LLInventoryModel::LLCategoryUpdate up(mParentUUID, -1); - gInventory.accountForUpdate(up); - - LLMessageSystem* msg = gMessageSystem; - msg->newMessageFast(_PREHASH_RemoveInventoryItem); - msg->nextBlockFast(_PREHASH_AgentData); - msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - msg->nextBlockFast(_PREHASH_InventoryData); - msg->addUUIDFast(_PREHASH_ItemID, mUUID); - gAgent.sendReliableMessage(); -} - void LLViewerInventoryItem::updateServer(BOOL is_new) const { if(!mIsComplete) @@ -637,30 +620,6 @@ void LLViewerInventoryCategory::updateServer(BOOL is_new) const gAgent.sendReliableMessage(); } -void LLViewerInventoryCategory::removeFromServer( void ) -{ - llinfos << "Removing inventory category " << mUUID << " from server." - << llendl; - // communicate that change with the server. - if(LLFolderType::lookupIsProtectedType(mPreferredType)) - { - LLNotificationsUtil::add("CannotRemoveProtectedCategories"); - return; - } - - LLInventoryModel::LLCategoryUpdate up(mParentUUID, -1); - gInventory.accountForUpdate(up); - - LLMessageSystem* msg = gMessageSystem; - msg->newMessageFast(_PREHASH_RemoveInventoryFolder); - msg->nextBlockFast(_PREHASH_AgentData); - msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - msg->nextBlockFast(_PREHASH_FolderData); - msg->addUUIDFast(_PREHASH_FolderID, mUUID); - gAgent.sendReliableMessage(); -} - S32 LLViewerInventoryCategory::getVersion() const { return mVersion; @@ -1179,25 +1138,10 @@ void move_inventory_item( gAgent.sendReliableMessage(); } -void handle_item_deletion(const LLUUID& item_id) -{ - LLPointer<LLViewerInventoryItem> obj = gInventory.getItem(item_id); - if(obj) - { - // From item removeFromServer() - LLInventoryModel::LLCategoryUpdate up(obj->getParentUUID(), -1); - gInventory.accountForUpdate(up); - - // From purgeObject() - LLPreview::hide(item_id); - gInventory.deleteObject(item_id); - } -} - -class RemoveItemResponder: public LLHTTPClient::Responder +class RemoveObjectResponder: public LLHTTPClient::Responder { public: - RemoveItemResponder(const LLUUID& item_id, LLPointer<LLInventoryCallback> callback): + RemoveObjectResponder(const LLUUID& item_id, LLPointer<LLInventoryCallback> callback): mItemUUID(item_id), mCallback(callback) { @@ -1212,7 +1156,7 @@ public: } llinfos << "succeeded: " << ll_pretty_print_sd(content) << llendl; - handle_item_deletion(mItemUUID); + gInventory.onObjectDeletedFromServer(mItemUUID); if (mCallback) { @@ -1251,7 +1195,7 @@ void remove_inventory_item( { std::string url = cap + std::string("/item/") + item_id.asString(); llinfos << "url: " << url << llendl; - LLCurl::ResponderPtr responder_ptr = new RemoveItemResponder(item_id,cb); + LLCurl::ResponderPtr responder_ptr = new RemoveObjectResponder(item_id,cb); LLHTTPClient::del(url,responder_ptr); } else // no cap @@ -1267,7 +1211,7 @@ void remove_inventory_item( // Update inventory and call callback immediately since // message-based system has no callback mechanism (!) - handle_item_deletion(item_id); + gInventory.onObjectDeletedFromServer(item_id); if (cb) { cb->fire(item_id); @@ -1280,6 +1224,224 @@ void remove_inventory_item( } } +class LLRemoveObjectOnDestroy: public LLInventoryCallback +{ +public: + LLRemoveObjectOnDestroy(const LLUUID& item_id, LLPointer<LLInventoryCallback> cb): + mID(item_id), + mCB(cb) + { + } + /* virtual */ void fire(const LLUUID& item_id) {} + ~LLRemoveObjectOnDestroy() + { + remove_inventory_object(mID, mCB); + } +private: + LLUUID mID; + LLPointer<LLInventoryCallback> mCB; +}; + +void remove_inventory_category( + const LLUUID& cat_id, + LLPointer<LLInventoryCallback> cb) +{ + llinfos << "cat_id: [" << cat_id << "] " << llendl; + LLPointer<LLViewerInventoryCategory> obj = gInventory.getCategory(cat_id); + if(obj) + { + if(LLFolderType::lookupIsProtectedType(obj->getPreferredType())) + { + LLNotificationsUtil::add("CannotRemoveProtectedCategories"); + return; + } + LLInventoryModel::EHasChildren children = gInventory.categoryHasChildren(cat_id); + if(children != LLInventoryModel::CHILDREN_NO) + { + llinfos << "Will purge descendents first before deleting category " << cat_id << llendl; + LLPointer<LLInventoryCallback> wrap_cb = new LLRemoveObjectOnDestroy(cat_id,cb); + purge_descendents_of(cat_id, wrap_cb); + return; + } + + std::string cap; + if (gAgent.getRegion()) + { + cap = gAgent.getRegion()->getCapability("InventoryAPIv3"); + } + if (!cap.empty()) + { + std::string url = cap + std::string("/category/") + cat_id.asString(); + llinfos << "url: " << url << llendl; + LLCurl::ResponderPtr responder_ptr = new RemoveObjectResponder(cat_id,cb); + LLHTTPClient::del(url,responder_ptr); + } + else // no cap + { + + LLMessageSystem* msg = gMessageSystem; + msg->newMessageFast(_PREHASH_RemoveInventoryFolder); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + msg->nextBlockFast(_PREHASH_FolderData); + msg->addUUIDFast(_PREHASH_FolderID, cat_id); + gAgent.sendReliableMessage(); + + // Update inventory and call callback immediately since + // message-based system has no callback mechanism (!) + gInventory.onObjectDeletedFromServer(cat_id); + if (cb) + { + cb->fire(cat_id); + } + } + } + else + { + llwarns << "remove_inventory_category called for invalid or nonexistent item " << cat_id << llendl; + } +} + +void remove_inventory_object( + const LLUUID& object_id, + LLPointer<LLInventoryCallback> cb) +{ + if (gInventory.getCategory(object_id)) + { + remove_inventory_category(object_id, cb); + } + else + { + remove_inventory_item(object_id, cb); + } +} + +class PurgeDescendentsResponder: public LLHTTPClient::Responder +{ +public: + PurgeDescendentsResponder(const LLUUID& item_id, LLPointer<LLInventoryCallback> callback): + mItemUUID(item_id), + mCallback(callback) + { + } + /* virtual */ void httpSuccess() + { + const LLSD& content = getContent(); + if (!content.isMap()) + { + failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content); + return; + } + llinfos << "succeeded: " << ll_pretty_print_sd(content) << llendl; + + gInventory.onDescendentsPurgedFromServer(mItemUUID); + + if (mCallback) + { + mCallback->fire(mItemUUID); + } + } + /*virtual*/ void httpFailure() + { + const LLSD& content = getContent(); + if (!content.isMap()) + { + failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content); + return; + } + llwarns << "failed for " << mItemUUID << " content: " << ll_pretty_print_sd(content) << llendl; + } +private: + LLPointer<LLInventoryCallback> mCallback; + const LLUUID mItemUUID; +}; + +// This is a method which collects the descendents of the id +// provided. If the category is not found, no action is +// taken. This method goes through the long winded process of +// cancelling any calling cards, removing server representation of +// folders, items, etc in a fairly efficient manner. +void purge_descendents_of(const LLUUID& id, LLPointer<LLInventoryCallback> cb) +{ + LLInventoryModel::EHasChildren children = gInventory.categoryHasChildren(id); + if(children == LLInventoryModel::CHILDREN_NO) + { + llinfos << "No descendents to purge for " << id << llendl; + return; + } + LLPointer<LLViewerInventoryCategory> cat = gInventory.getCategory(id); + if (cat.notNull()) + { + if (LLClipboard::instance().hasContents() && LLClipboard::instance().isCutMode()) + { + // Something on the clipboard is in "cut mode" and needs to be preserved + llinfos << "purge_descendents_of clipboard case " << cat->getName() + << " iterate and purge non hidden items" << llendl; + LLInventoryModel::cat_array_t* categories; + LLInventoryModel::item_array_t* items; + // Get the list of direct descendants in tha categoy passed as argument + gInventory.getDirectDescendentsOf(id, categories, items); + std::vector<LLUUID> list_uuids; + // Make a unique list with all the UUIDs of the direct descendants (items and categories are not treated differently) + // Note: we need to do that shallow copy as purging things will invalidate the categories or items lists + for (LLInventoryModel::cat_array_t::const_iterator it = categories->begin(); it != categories->end(); ++it) + { + list_uuids.push_back((*it)->getUUID()); + } + for (LLInventoryModel::item_array_t::const_iterator it = items->begin(); it != items->end(); ++it) + { + list_uuids.push_back((*it)->getUUID()); + } + // Iterate through the list and only purge the UUIDs that are not on the clipboard + for (std::vector<LLUUID>::const_iterator it = list_uuids.begin(); it != list_uuids.end(); ++it) + { + if (!LLClipboard::instance().isOnClipboard(*it)) + { + remove_inventory_object(*it, NULL); + } + } + } + else + { + std::string cap; + if (gAgent.getRegion()) + { + cap = gAgent.getRegion()->getCapability("InventoryAPIv3"); + } + if (!cap.empty()) + { + std::string url = cap + std::string("/category/") + id.asString() + "/children"; + llinfos << "url: " << url << llendl; + LLCurl::ResponderPtr responder_ptr = new PurgeDescendentsResponder(id,cb); + LLHTTPClient::del(url,responder_ptr); + } + else // no cap + { + // Fast purge + llinfos << "purge_descendents_of fast case " << cat->getName() << llendl; + + // send it upstream + LLMessageSystem* msg = gMessageSystem; + msg->newMessage("PurgeInventoryDescendents"); + msg->nextBlock("AgentData"); + msg->addUUID("AgentID", gAgent.getID()); + msg->addUUID("SessionID", gAgent.getSessionID()); + msg->nextBlock("InventoryData"); + msg->addUUID("FolderID", id); + gAgent.sendReliableMessage(); + + // Update model immediately because there is no callback mechanism. + gInventory.onDescendentsPurgedFromServer(id); + if (cb) + { + cb->fire(id); + } + } + } + } +} + const LLUUID get_folder_by_itemtype(const LLInventoryItem *src) { LLUUID retval = LLUUID::null; diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h index 6b0e8ed4ef..4e24dc87d1 100755 --- a/indra/newview/llviewerinventory.h +++ b/indra/newview/llviewerinventory.h @@ -118,7 +118,6 @@ public: void cloneViewerItem(LLPointer<LLViewerInventoryItem>& newitem) const; // virtual methods - virtual void removeFromServer( void ); virtual void updateParentOnServer(BOOL restamp) const; virtual void updateServer(BOOL is_new) const; void fetchFromServer(void) const; @@ -198,7 +197,6 @@ public: LLViewerInventoryCategory(const LLViewerInventoryCategory* other); void copyViewerCategory(const LLViewerInventoryCategory* other); - virtual void removeFromServer(); virtual void updateParentOnServer(BOOL restamp_children) const; virtual void updateServer(BOOL is_new) const; @@ -369,6 +367,18 @@ void remove_inventory_item( const LLUUID& item_id, LLPointer<LLInventoryCallback> cb); +void remove_inventory_category( + const LLUUID& cat_id, + LLPointer<LLInventoryCallback> cb); + +void remove_inventory_object( + const LLUUID& object_id, + LLPointer<LLInventoryCallback> cb); + +void purge_descendents_of( + const LLUUID& cat_id, + LLPointer<LLInventoryCallback> cb); + const LLUUID get_folder_by_itemtype(const LLInventoryItem *src); void copy_inventory_from_notecard(const LLUUID& destination_id, -- cgit v1.2.3 From 638514ca0cbc666a324e757c8de4cceaaaeeadd4 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Fri, 26 Apr 2013 10:01:09 -0400 Subject: SH-4142 FIX - avoid stack overflow in an AISv3 responder failure case. --- indra/newview/llviewerinventory.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index fbd6b292bd..c44552d7d2 100755 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -1168,7 +1168,7 @@ public: const LLSD& content = getContent(); if (!content.isMap()) { - failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content); + llwarns << "Malformed response contents" << content << llendl; return; } llwarns << "failed for " << mItemUUID << " content: " << ll_pretty_print_sd(content) << llendl; @@ -1347,7 +1347,7 @@ public: const LLSD& content = getContent(); if (!content.isMap()) { - failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content); + llwarns << "Malformed response contents" << content << llendl; return; } llwarns << "failed for " << mItemUUID << " content: " << ll_pretty_print_sd(content) << llendl; -- cgit v1.2.3 From fb51bab6cd2e3f037142ce7c5f547113d76f0504 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Fri, 26 Apr 2013 10:17:41 -0400 Subject: SH-4142 FIX - made error messages a bit more informative --- indra/newview/llviewerinventory.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index c44552d7d2..3eab85b8b3 100755 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -1166,12 +1166,14 @@ public: /*virtual*/ void httpFailure() { const LLSD& content = getContent(); + S32 status = getStatus(); + const std::string& reason = getReason(); if (!content.isMap()) { - llwarns << "Malformed response contents" << content << llendl; + llwarns << "Malformed response contents " << content << " id " << mItemUUID << " status " << status << " reason " << reason << llendl; return; } - llwarns << "failed for " << mItemUUID << " content: " << ll_pretty_print_sd(content) << llendl; + llwarns << "failed for " << mItemUUID << " content: " << ll_pretty_print_sd(content) << " status " << status << " reason " << reason << llendl; } private: LLPointer<LLInventoryCallback> mCallback; @@ -1345,12 +1347,14 @@ public: /*virtual*/ void httpFailure() { const LLSD& content = getContent(); + S32 status = getStatus(); + const std::string& reason = getReason(); if (!content.isMap()) { - llwarns << "Malformed response contents" << content << llendl; + llwarns << "Malformed response contents " << content << " id " << mItemUUID << " status " << status << " reason " << reason << llendl; return; } - llwarns << "failed for " << mItemUUID << " content: " << ll_pretty_print_sd(content) << llendl; + llwarns << "failed for " << mItemUUID << " content: " << ll_pretty_print_sd(content) << " status " << status << " reason " << reason << llendl; } private: LLPointer<LLInventoryCallback> mCallback; -- cgit v1.2.3 From e4c96827d237a489873ce8453640d3a13f83d01a Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Mon, 29 Apr 2013 14:24:05 -0400 Subject: SH-4144 FIX - Debug setting now disables use of AISv3 by default. This is just a workaround for the problem of aditi advertising the cap when it isn't really present. Once we have aditi in a consistent state we should remove the setting, or at least default it to true. --- indra/newview/app_settings/logcontrol.xml | 2 +- indra/newview/app_settings/settings.xml | 11 +++++++++++ indra/newview/llviewerinventory.cpp | 10 +++++++--- 3 files changed, 19 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/logcontrol.xml b/indra/newview/app_settings/logcontrol.xml index 92a241857e..c5561166fc 100755 --- a/indra/newview/app_settings/logcontrol.xml +++ b/indra/newview/app_settings/logcontrol.xml @@ -42,8 +42,8 @@ </array> <key>tags</key> <array> - <!-- sample entry for debugging specific items <string>Avatar</string> + <!-- sample entry for debugging specific items <string>Voice</string> --> </array> diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 18a33b3542..1262089b3d 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -14033,6 +14033,17 @@ <key>Value</key> <integer>1</integer> </map> + <key>UseAISv3Inventory</key> + <map> + <key>Comment</key> + <string>Allow use of AISv3 inventory - this setting should only be needed during development.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> <key>ClickToWalk</key> <map> <key>Comment</key> diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 3eab85b8b3..d45512df9c 100755 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -627,6 +627,10 @@ S32 LLViewerInventoryCategory::getVersion() const void LLViewerInventoryCategory::setVersion(S32 version) { + if (mPreferredType == LLFolderType::FT_CURRENT_OUTFIT) + { + llinfos << "cof version change " << mVersion << " => " << version << llendl; + } mVersion = version; } @@ -1189,7 +1193,7 @@ void remove_inventory_item( if(obj) { std::string cap; - if (gAgent.getRegion()) + if (gAgent.getRegion() && gSavedSettings.getBOOL("UseAISv3Inventory")) { cap = gAgent.getRegion()->getCapability("InventoryAPIv3"); } @@ -1267,7 +1271,7 @@ void remove_inventory_category( } std::string cap; - if (gAgent.getRegion()) + if (gAgent.getRegion() && gSavedSettings.getBOOL("UseAISv3Inventory")) { cap = gAgent.getRegion()->getCapability("InventoryAPIv3"); } @@ -1409,7 +1413,7 @@ void purge_descendents_of(const LLUUID& id, LLPointer<LLInventoryCallback> cb) else { std::string cap; - if (gAgent.getRegion()) + if (gAgent.getRegion() && gSavedSettings.getBOOL("UseAISv3Inventory")) { cap = gAgent.getRegion()->getCapability("InventoryAPIv3"); } -- cgit v1.2.3 From 72aa727a3f371cf592d33e6cccefbf74be053b70 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Mon, 29 Apr 2013 14:29:04 -0400 Subject: removed overly enthusiastic log setting --- indra/newview/app_settings/logcontrol.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/logcontrol.xml b/indra/newview/app_settings/logcontrol.xml index c5561166fc..92a241857e 100755 --- a/indra/newview/app_settings/logcontrol.xml +++ b/indra/newview/app_settings/logcontrol.xml @@ -42,8 +42,8 @@ </array> <key>tags</key> <array> - <string>Avatar</string> <!-- sample entry for debugging specific items + <string>Avatar</string> <string>Voice</string> --> </array> -- cgit v1.2.3 From 9caeb5ad5045352c4bb77195c5c0bc71575bc3fd Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Mon, 29 Apr 2013 14:31:15 -0400 Subject: removed debugging code that got pushed incorrectly. --- indra/newview/app_settings/logcontrol.xml | 2 +- indra/newview/llviewerinventory.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/logcontrol.xml b/indra/newview/app_settings/logcontrol.xml index 92a241857e..c5561166fc 100755 --- a/indra/newview/app_settings/logcontrol.xml +++ b/indra/newview/app_settings/logcontrol.xml @@ -42,8 +42,8 @@ </array> <key>tags</key> <array> - <!-- sample entry for debugging specific items <string>Avatar</string> + <!-- sample entry for debugging specific items <string>Voice</string> --> </array> diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index d45512df9c..b39dbd51a1 100755 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -627,10 +627,12 @@ S32 LLViewerInventoryCategory::getVersion() const void LLViewerInventoryCategory::setVersion(S32 version) { +#if 0 if (mPreferredType == LLFolderType::FT_CURRENT_OUTFIT) { llinfos << "cof version change " << mVersion << " => " << version << llendl; } +#endif mVersion = version; } -- cgit v1.2.3 From 48d684c7befae1ca7f7b43f682d7bea03fc4e0c0 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Mon, 29 Apr 2013 14:32:03 -0400 Subject: logcontrol.xml fix this time for sure. --- indra/newview/app_settings/logcontrol.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/logcontrol.xml b/indra/newview/app_settings/logcontrol.xml index c5561166fc..92a241857e 100755 --- a/indra/newview/app_settings/logcontrol.xml +++ b/indra/newview/app_settings/logcontrol.xml @@ -42,8 +42,8 @@ </array> <key>tags</key> <array> - <string>Avatar</string> <!-- sample entry for debugging specific items + <string>Avatar</string> <string>Voice</string> --> </array> -- cgit v1.2.3 From ae53d22141288ab1b5ba4a5927d11cf84c59d445 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Mon, 29 Apr 2013 16:59:10 -0400 Subject: SH-4140 FIX, SH-3860 FIX - appearance on first-time login should now be reliable without depending on retries of appearance update requests. May still see COF mismatch errors in the log - these will only be fixed, if at all, with AISv3 integration. --- indra/newview/llappearancemgr.cpp | 13 ++++++++++--- indra/newview/llviewerinventory.cpp | 2 -- 2 files changed, 10 insertions(+), 5 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 399cea676c..40ec88f1be 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -2890,7 +2890,7 @@ protected: } if (content["success"].asBoolean()) { - LL_DEBUGS("Avatar") << dumpResponse() << LL_ENDL; + //LL_DEBUGS("Avatar") << dumpResponse() << LL_ENDL; if (gSavedSettings.getBOOL("DebugAvatarAppearanceMessage")) { dumpContents(gAgentAvatarp->getFullname() + "_appearance_request_ok", content); @@ -2907,7 +2907,8 @@ protected: { const LLSD& content = getContent(); LL_WARNS("Avatar") << "appearance update request failed " - << dumpResponse() << LL_ENDL; + << dumpResponse() << LL_ENDL; + if (gSavedSettings.getBOOL("DebugAvatarAppearanceMessage")) { dumpContents(gAgentAvatarp->getFullname() + "_appearance_request_error", content); @@ -3247,6 +3248,13 @@ void show_created_outfit(LLUUID& folder_id, bool show_panel = true) LLAppearanceMgr::getInstance()->updateIsDirty(); gAgentWearables.notifyLoadingFinished(); // New outfit is saved. LLAppearanceMgr::getInstance()->updatePanelOutfitName(""); + + // For SSB, need to update appearance after we add a base outfit + // link, since, the COF version has changed. There is a race + // condition in initial outfit setup which can lead to rez + // failures - SH-3860. + LLPointer<LLInventoryCallback> cb = new LLUpdateAppearanceOnDestroy; + LLAppearanceMgr::getInstance()->createBaseOutfitLink(folder_id, cb); } LLUUID LLAppearanceMgr::makeNewOutfitLinks(const std::string& new_folder_name, bool show_panel) @@ -3267,7 +3275,6 @@ LLUUID LLAppearanceMgr::makeNewOutfitLinks(const std::string& new_folder_name, b LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(no_op_inventory_func, boost::bind(show_created_outfit,folder_id,show_panel)); shallowCopyCategoryContents(getCOF(),folder_id, cb); - createBaseOutfitLink(folder_id, cb); dumpCat(folder_id,"COF, new outfit"); diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index b39dbd51a1..d45512df9c 100755 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -627,12 +627,10 @@ S32 LLViewerInventoryCategory::getVersion() const void LLViewerInventoryCategory::setVersion(S32 version) { -#if 0 if (mPreferredType == LLFolderType::FT_CURRENT_OUTFIT) { llinfos << "cof version change " << mVersion << " => " << version << llendl; } -#endif mVersion = version; } -- cgit v1.2.3 From b322c1dbaceaa9359243e030a125e312c54448f3 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Tue, 30 Apr 2013 16:54:52 -0400 Subject: SH-4140 FIX - removed a gratuitous log message --- indra/newview/llviewerinventory.cpp | 4 ---- 1 file changed, 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index d45512df9c..f9afdee4f9 100755 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -627,10 +627,6 @@ S32 LLViewerInventoryCategory::getVersion() const void LLViewerInventoryCategory::setVersion(S32 version) { - if (mPreferredType == LLFolderType::FT_CURRENT_OUTFIT) - { - llinfos << "cof version change " << mVersion << " => " << version << llendl; - } mVersion = version; } -- cgit v1.2.3 From 89cef0cad260e7c8369070c32478621f1cd22f62 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Wed, 1 May 2013 17:55:49 -0400 Subject: SH-4154 WIP - gInventory.validate() has inventory model internal consistency checks --- indra/newview/llinventorymodel.cpp | 197 +++++++++++++++++++++- indra/newview/llinventorymodel.h | 4 + indra/newview/llinventorymodelbackgroundfetch.cpp | 2 + 3 files changed, 202 insertions(+), 1 deletion(-) mode change 100644 => 100755 indra/newview/llinventorymodelbackgroundfetch.cpp (limited to 'indra/newview') diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index ae8efeecda..f60fd63eee 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -252,6 +252,23 @@ const LLViewerInventoryCategory* LLInventoryModel::getFirstDescendantOf(const LL return NULL; } +bool LLInventoryModel::getObjectTopmostAncestor(const LLUUID& object_id, LLUUID& result) const +{ + LLInventoryObject *object = getObject(object_id); + while (object && object->getParentUUID().notNull()) + { + LLInventoryObject *parent_object = getObject(object->getParentUUID()); + if (!parent_object) + { + llwarns << "unable to trace topmost ancestor, missing item for uuid " << object->getParentUUID() << llendl; + return false; + } + object = parent_object; + } + result = object->getUUID(); + return true; +} + // Get the object by id. Returns NULL if not found. LLInventoryObject* LLInventoryModel::getObject(const LLUUID& id) const { @@ -2083,7 +2100,7 @@ void LLInventoryModel::buildParentChildMap() // implement it, we would need a set or map of uuid pairs // which would be (folder_id, new_parent_id) to be sent up // to the server. - llinfos << "Lost categroy: " << cat->getUUID() << " - " + llinfos << "Lost category: " << cat->getUUID() << " - " << cat->getName() << llendl; ++lost; // plop it into the lost & found. @@ -2102,6 +2119,8 @@ void LLInventoryModel::buildParentChildMap() // it's a protected folder. cat->setParent(gInventory.getRootFolderID()); } + // FIXME note that updateServer() fails with protected + // types, so this will not work as intended in that case. cat->updateServer(TRUE); catsp = getUnlockedCatArray(cat->getParentUUID()); if(catsp) @@ -2247,6 +2266,11 @@ void LLInventoryModel::buildParentChildMap() notifyObservers(); } } + + //if (!gInventory.validate()) + //{ + // llwarns << "model failed validity check!" << llendl; + //} } struct LLUUIDAndName @@ -2917,6 +2941,9 @@ void LLInventoryModel::processBulkUpdateInventory(LLMessageSystem* msg, void**) InventoryCallbackInfo cbinfo = (*inv_it); gInventoryCallbacks.fire(cbinfo.mCallback, cbinfo.mInvID); } + + //gInventory.validate(); + // Don't show the inventory. We used to call showAgentInventory here. //LLFloaterInventory* view = LLFloaterInventory::getActiveInventory(); //if(view) @@ -3363,6 +3390,174 @@ void LLInventoryModel::dumpInventory() const llinfos << "\n**********************\nEnd Inventory Dump" << llendl; } +// Do various integrity checks on model, logging issues found and +// returning an overall good/bad flag. +bool LLInventoryModel::validate() const +{ + bool valid = true; + + if (getRootFolderID().isNull()) + { + llwarns << "no root folder id" << llendl; + valid = false; + } + if (getLibraryRootFolderID().isNull()) + { + llwarns << "no root folder id" << llendl; + valid = false; + } + + if (mCategoryMap.size() + 1 != mParentChildCategoryTree.size()) + { + // ParentChild should be one larger because of the special entry for null uuid. + llinfos << "unexpected sizes: cat map size " << mCategoryMap.size() + << " parent/child " << mParentChildCategoryTree.size() << llendl; + valid = false; + } + S32 cat_lock = 0; + S32 item_lock = 0; + S32 desc_unknown_count = 0; + S32 version_unknown_count = 0; + for(cat_map_t::const_iterator cit = mCategoryMap.begin(); cit != mCategoryMap.end(); ++cit) + { + const LLUUID& cat_id = cit->first; + const LLViewerInventoryCategory *cat = cit->second; + if (!cat) + { + llwarns << "invalid cat" << llendl; + valid = false; + continue; + } + if (cat_id != cat->getUUID()) + { + llwarns << "cat id/index mismatch " << cat_id << " " << cat->getUUID() << llendl; + valid = false; + } + + if (cat->getParentUUID().isNull()) + { + if (cat_id != getRootFolderID() && cat_id != getLibraryRootFolderID()) + { + llwarns << "cat " << cat_id << " has no parent, but is not root (" + << getRootFolderID() << ") or library root (" + << getLibraryRootFolderID() << ")" << llendl; + } + } + cat_array_t* cats; + item_array_t* items; + getDirectDescendentsOf(cat_id,cats,items); + if (!cats || !items) + { + llwarns << "invalid direct descendents for " << cat_id << llendl; + valid = false; + continue; + } + if (cat->getDescendentCount() == LLViewerInventoryCategory::DESCENDENT_COUNT_UNKNOWN) + { + desc_unknown_count++; + } + else if (cats->size() + items->size() != cat->getDescendentCount()) + { + llwarns << "invalid desc count for " << cat_id << " name " << cat->getName() + << " cached " << cat->getDescendentCount() + << " expected " << cats->size() << "+" << items->size() + << "=" << cats->size() +items->size() << llendl; + valid = false; + } + if (cat->getVersion() == LLViewerInventoryCategory::VERSION_UNKNOWN) + { + version_unknown_count++; + } + if (mCategoryLock.count(cat_id)) + { + cat_lock++; + } + if (mItemLock.count(cat_id)) + { + item_lock++; + } + for (S32 i = 0; i<items->size(); i++) + { + LLViewerInventoryItem *item = items->get(i); + + if (!item) + { + llwarns << "null item at index " << i << " for cat " << cat_id << llendl; + valid = false; + continue; + } + + const LLUUID& item_id = item->getUUID(); + + if (item->getParentUUID() != cat_id) + { + llwarns << "wrong parent for " << item_id << " found " + << item->getParentUUID() << " expected " << cat_id + << llendl; + valid = false; + } + + + // Entries in items and mItemMap should correspond. + item_map_t::const_iterator it = mItemMap.find(item_id); + if (it == mItemMap.end()) + { + llwarns << "item " << item_id << " found as child of " + << cat_id << " but not in top level mItemMap" << llendl; + valid = false; + } + else + { + LLViewerInventoryItem *top_item = it->second; + if (top_item != item) + { + llwarns << "item mismatch, item_id " << item_id + << " top level entry is different, uuid " << top_item->getUUID() << llendl; + } + } + + // Topmost ancestor should be root or library. + LLUUID topmost_ancestor_id; + bool found = getObjectTopmostAncestor(item_id, topmost_ancestor_id); + if (!found) + { + llwarns << "unable to find topmost ancestor for " << item_id << llendl; + valid = false; + } + else + { + if (topmost_ancestor_id != getRootFolderID() && + topmost_ancestor_id != getLibraryRootFolderID()) + { + llwarns << "unrecognized top level ancestor for " << item_id + << " got " << topmost_ancestor_id + << " expected " << getRootFolderID() + << " or " << getLibraryRootFolderID() << llendl; + valid = false; + } + } + } + + } + if (cat_lock > 0 || item_lock > 0) + { + llwarns << "Found locks on some categories: sub-cat arrays " + << cat_lock << ", item arrays " << item_lock << llendl; + } + if (desc_unknown_count != 0) + { + llinfos << "Found " << desc_unknown_count << " cats with unknown descendent count" << llendl; + } + if (version_unknown_count != 0) + { + llinfos << "Found " << version_unknown_count << " cats with unknown version" << llendl; + } + + llinfos << "Validate done, valid = " << (U32) valid << llendl; + + return valid; +} + ///---------------------------------------------------------------------------- /// Local function definitions ///---------------------------------------------------------------------------- diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index b7e1888f20..2459f10a37 100755 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -227,6 +227,9 @@ public: // Check if one object has a parent chain up to the category specified by UUID. BOOL isObjectDescendentOf(const LLUUID& obj_id, const LLUUID& cat_id) const; + // Follow parent chain to the top. + bool getObjectTopmostAncestor(const LLUUID& object_id, LLUUID& result) const; + //-------------------------------------------------------------------- // Find //-------------------------------------------------------------------- @@ -551,6 +554,7 @@ private: //-------------------------------------------------------------------- public: void dumpInventory() const; + bool validate() const; /** Miscellaneous ** ** diff --git a/indra/newview/llinventorymodelbackgroundfetch.cpp b/indra/newview/llinventorymodelbackgroundfetch.cpp old mode 100644 new mode 100755 index 01b0e647a9..4eeb528c66 --- a/indra/newview/llinventorymodelbackgroundfetch.cpp +++ b/indra/newview/llinventorymodelbackgroundfetch.cpp @@ -172,6 +172,8 @@ void LLInventoryModelBackgroundFetch::setAllFoldersFetched() mRecursiveLibraryFetchStarted) { mAllFoldersFetched = TRUE; + //llinfos << "All folders fetched, validating" << llendl; + //gInventory.validate(); } mFolderFetchActive = false; } -- cgit v1.2.3 From af1431731802320e241037486b8bff0003a4d827 Mon Sep 17 00:00:00 2001 From: Nyx Linden <nyx@lindenlab.com> Date: Thu, 2 May 2013 13:56:10 -0400 Subject: SH-4060 FIX avatar hover being set to minimum at seemingly random times avatar hover was being temporarily set to -2.0 for the preview render, which was triggering the minimum enforcement, even when the user's requested value is no where near the minimum. Added a flag to disable the minimum enforcement if we are temporarily changing the value. --- indra/newview/lltoolmorph.cpp | 12 ++++++++++++ indra/newview/llviewerwearable.h | 4 ++++ indra/newview/llvoavatar.cpp | 30 ++++++++++++++++++++++++++++++ indra/newview/llvoavatar.h | 3 +++ 4 files changed, 49 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/lltoolmorph.cpp b/indra/newview/lltoolmorph.cpp index 148e5a015b..f39b98dd31 100644 --- a/indra/newview/lltoolmorph.cpp +++ b/indra/newview/lltoolmorph.cpp @@ -54,6 +54,7 @@ #include "llviewercamera.h" #include "llviewertexturelist.h" #include "llviewerobject.h" +#include "llviewerwearable.h" #include "llviewerwindow.h" #include "llvoavatarself.h" #include "pipeline.h" @@ -147,6 +148,11 @@ BOOL LLVisualParamHint::needsRender() void LLVisualParamHint::preRender(BOOL clear_depth) { + LLViewerWearable* wearable = (LLViewerWearable*)mWearablePtr; + if (wearable) + { + wearable->setVolitile(TRUE); + } mLastParamWeight = mVisualParam->getWeight(); mWearablePtr->setVisualParamWeight(mVisualParam->getID(), mVisualParamWeight, FALSE); gAgentAvatarp->setVisualParamWeight(mVisualParam->getID(), mVisualParamWeight, FALSE); @@ -239,6 +245,12 @@ BOOL LLVisualParamHint::render() } gAgentAvatarp->setVisualParamWeight(mVisualParam->getID(), mLastParamWeight); mWearablePtr->setVisualParamWeight(mVisualParam->getID(), mLastParamWeight, FALSE); + LLViewerWearable* wearable = (LLViewerWearable*)mWearablePtr; + if (wearable) + { + wearable->setVolitile(FALSE); + } + gAgentAvatarp->updateVisualParams(); gGL.color4f(1,1,1,1); mGLTexturep->setGLTextureCreated(true); diff --git a/indra/newview/llviewerwearable.h b/indra/newview/llviewerwearable.h index 65566f23a5..047b2ce143 100644 --- a/indra/newview/llviewerwearable.h +++ b/indra/newview/llviewerwearable.h @@ -68,6 +68,8 @@ public: void setParamsToDefaults(); void setTexturesToDefaults(); + void setVolitile(BOOL volitle) { mVolitle = volitle; } // TRUE when doing preview renders, some updates will be suppressed. + BOOL getVolitile() { return mVolitle; } /*virtual*/ LLUUID getDefaultTextureImageID(LLAvatarAppearanceDefines::ETextureIndex index) const; @@ -96,6 +98,8 @@ protected: LLAssetID mAssetID; LLTransactionID mTransactionID; + BOOL mVolitle; // True when rendering preview images. Can suppress some updates. + LLUUID mItemID; // ID of the inventory item in the agent's inventory }; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index a56e09cde0..919627c47c 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5214,6 +5214,36 @@ void LLVOAvatar::updateVisualParams() updateHeadOffset(); } +/*virtual*/ +void LLVOAvatar::computeBodySize() +{ + LLAvatarAppearance::computeBodySize(); + + // Certain configurations of avatars can force the overall height (with offset) to go negative. + // Enforce a constraint to make sure we don't go below 0.1 meters. + // Camera positioning and other things start to break down when your avatar is "walking" while being fully underground + if (isSelf() && getWearableData()) + { + LLViewerWearable* shape = (LLViewerWearable*)getWearableData()->getWearable(LLWearableType::WT_SHAPE, 0); + if (shape && shape->getVolitile()) + { + F32 hover_value = shape->getVisualParamWeight(AVATAR_HOVER); + if (hover_value < 0.0f && (mBodySize.mV[VZ] + hover_value < 1.1f)) + { + hover_value = -(mBodySize.mV[VZ] - 1.1f); // avoid floating point rounding making the above check continue to fail. + llassert(mBodySize.mV[VZ] + hover_value >= 1.1f); + + hover_value = llmin(hover_value, 0.0f); // don't force the hover value to be greater than 0. + + mAvatarOffset.mV[VZ] = hover_value; + shape->setVisualParamWeight(AVATAR_HOVER,hover_value, FALSE); + + } + } + } +} + + //----------------------------------------------------------------------------- // isActive() //----------------------------------------------------------------------------- diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 98e8491cb1..19ad49d3a1 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -212,6 +212,9 @@ public: /*virtual*/ LLVector3 getPosAgentFromGlobal(const LLVector3d &position); virtual void updateVisualParams(); + /*virtual*/ void computeBodySize(); + + /** Inherited ** ** -- cgit v1.2.3 From 668a822ace1a7f1dffd090bbdd68712c31d0ac5c Mon Sep 17 00:00:00 2001 From: Nyx Linden <nyx@lindenlab.com> Date: Fri, 3 May 2013 17:30:36 -0400 Subject: SH-4147 FIX Macro avatars with hover==0 look incorrect on relog Inverted logic meant that we would enforce minimums only while in preview renders, not for actual user adjustments. This seems to fix it. --- indra/newview/llvoavatar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 3189507b53..e2ed6f54cc 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5225,7 +5225,7 @@ void LLVOAvatar::computeBodySize() if (isSelf() && getWearableData()) { LLViewerWearable* shape = (LLViewerWearable*)getWearableData()->getWearable(LLWearableType::WT_SHAPE, 0); - if (shape && shape->getVolitile()) + if (shape && !shape->getVolitile()) { F32 hover_value = shape->getVisualParamWeight(AVATAR_HOVER); if (hover_value < 0.0f && (mBodySize.mV[VZ] + hover_value < 1.1f)) -- cgit v1.2.3 From e6bc0c5d695796c56bdc2a53f5db594e93e58aff Mon Sep 17 00:00:00 2001 From: Nyx Linden <nyx@lindenlab.com> Date: Mon, 6 May 2013 18:31:17 -0400 Subject: SH-4147 FIX macro avatars with low hover look wrong after relog Preventing hover limit from being applied during startup or shutdown when the rigged mesh may not be fully loaded. --- indra/newview/llvoavatar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index e2ed6f54cc..8e7bed39c4 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5222,7 +5222,7 @@ void LLVOAvatar::computeBodySize() // Certain configurations of avatars can force the overall height (with offset) to go negative. // Enforce a constraint to make sure we don't go below 0.1 meters. // Camera positioning and other things start to break down when your avatar is "walking" while being fully underground - if (isSelf() && getWearableData()) + if (isSelf() && getWearableData() && isFullyLoaded() && !LLApp::isQuitting()) { LLViewerWearable* shape = (LLViewerWearable*)getWearableData()->getWearable(LLWearableType::WT_SHAPE, 0); if (shape && !shape->getVolitile()) -- cgit v1.2.3 From 9881b65845b7320a2fc23b8ebc2a68996840ca16 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Tue, 7 May 2013 16:12:18 -0400 Subject: SH-4154 FIX - added a few more validity checks. Disabled by default so users won't have logs spammed. --- indra/newview/llinventorymodel.cpp | 92 +++++++++++++++++++++-- indra/newview/llinventorymodelbackgroundfetch.cpp | 1 + 2 files changed, 87 insertions(+), 6 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index f60fd63eee..bb5da2e9db 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -2267,10 +2267,10 @@ void LLInventoryModel::buildParentChildMap() } } - //if (!gInventory.validate()) - //{ - // llwarns << "model failed validity check!" << llendl; - //} + // if (!gInventory.validate()) + // { + // llwarns << "model failed validity check!" << llendl; + // } } struct LLUUIDAndName @@ -3002,7 +3002,7 @@ void LLInventoryModel::processInventoryDescendents(LLMessageSystem* msg,void**) // If the item has already been added (e.g. from link prefetch), then it doesn't need to be re-added. if (gInventory.getItem(titem->getUUID())) { - lldebugs << "Skipping prefetched item [ Name: " << titem->getName() << " | Type: " << titem->getActualType() << " | ItemUUID: " << titem->getUUID() << " ] " << llendl; + llinfos << "Skipping prefetched item [ Name: " << titem->getName() << " | Type: " << titem->getActualType() << " | ItemUUID: " << titem->getUUID() << " ] " << llendl; continue; } gInventory.updateItem(titem); @@ -3458,7 +3458,8 @@ bool LLInventoryModel::validate() const } else if (cats->size() + items->size() != cat->getDescendentCount()) { - llwarns << "invalid desc count for " << cat_id << " name " << cat->getName() + llwarns << "invalid desc count for " << cat_id << " name [" << cat->getName() + << "] parent " << cat->getParentUUID() << " cached " << cat->getDescendentCount() << " expected " << cats->size() << "+" << items->size() << "=" << cats->size() +items->size() << llendl; @@ -3538,7 +3539,86 @@ bool LLInventoryModel::validate() const } } + // Does this category appear as a child of its supposed parent? + const LLUUID& parent_id = cat->getParentUUID(); + if (!parent_id.isNull()) + { + cat_array_t* cats; + item_array_t* items; + getDirectDescendentsOf(parent_id,cats,items); + if (!cats) + { + llwarns << "cat " << cat_id << " name [" << cat->getName() + << "] orphaned - no child cat array for alleged parent " << parent_id << llendl; + valid = false; + } + else + { + bool found = false; + for (S32 i = 0; i<cats->size(); i++) + { + LLViewerInventoryCategory *kid_cat = cats->get(i); + if (kid_cat == cat) + { + found = true; + break; + } + } + if (!found) + { + llwarns << "cat " << cat_id << " name [" << cat->getName() + << "] orphaned - not found in child cat array of alleged parent " << parent_id << llendl; + } + } + } + } + + for(item_map_t::const_iterator iit = mItemMap.begin(); iit != mItemMap.end(); ++iit) + { + const LLUUID& item_id = iit->first; + LLViewerInventoryItem *item = iit->second; + if (item->getUUID() != item_id) + { + llwarns << "item_id " << item_id << " does not match " << item->getUUID() << llendl; + valid = false; + } + + const LLUUID& parent_id = item->getParentUUID(); + if (parent_id.isNull()) + { + llwarns << "item " << item_id << " name [" << item->getName() << "] has null parent id!" << llendl; + } + else + { + cat_array_t* cats; + item_array_t* items; + getDirectDescendentsOf(parent_id,cats,items); + if (!items) + { + llwarns << "item " << item_id << " name [" << item->getName() + << "] orphaned - alleged parent has no child items list " << parent_id << llendl; + } + else + { + bool found = false; + for (S32 i=0; i<items->size(); ++i) + { + if (items->get(i) == item) + { + found = true; + break; + } + } + if (!found) + { + llwarns << "item " << item_id << " name [" << item->getName() + << "] orphaned - not found as child of alleged parent " << parent_id << llendl; + } + } + + } } + if (cat_lock > 0 || item_lock > 0) { llwarns << "Found locks on some categories: sub-cat arrays " diff --git a/indra/newview/llinventorymodelbackgroundfetch.cpp b/indra/newview/llinventorymodelbackgroundfetch.cpp index 4eeb528c66..864f38cbde 100755 --- a/indra/newview/llinventorymodelbackgroundfetch.cpp +++ b/indra/newview/llinventorymodelbackgroundfetch.cpp @@ -176,6 +176,7 @@ void LLInventoryModelBackgroundFetch::setAllFoldersFetched() //gInventory.validate(); } mFolderFetchActive = false; + mBackgroundFetchActive = false; } void LLInventoryModelBackgroundFetch::backgroundFetchCB(void *) -- cgit v1.2.3 From 23c6016481ebc6de5433b9e9b9d07ebc4d5ae3cd Mon Sep 17 00:00:00 2001 From: Nyx Linden <nyx@lindenlab.com> 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 +- indra/newview/lltoolmorph.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'indra/newview') 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 diff --git a/indra/newview/lltoolmorph.cpp b/indra/newview/lltoolmorph.cpp index f39b98dd31..fa94b52362 100644 --- a/indra/newview/lltoolmorph.cpp +++ b/indra/newview/lltoolmorph.cpp @@ -159,7 +159,9 @@ void LLVisualParamHint::preRender(BOOL clear_depth) gAgentAvatarp->setVisualParamWeight("Blink_Left", 0.f); gAgentAvatarp->setVisualParamWeight("Blink_Right", 0.f); gAgentAvatarp->updateComposites(); - gAgentAvatarp->updateVisualParams(); + // Calling LLCharacter version, as we don't want position/height changes to cause the avatar to jump + // up and down when we're doing preview renders. -Nyx + gAgentAvatarp->LLCharacter::updateVisualParams(); gAgentAvatarp->updateGeometry(gAgentAvatarp->mDrawable); gAgentAvatarp->updateLOD(); -- cgit v1.2.3 From 228178ac15f60f9b66b72a9d3f13e706d7d6de36 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Thu, 9 May 2013 11:01:29 -0400 Subject: SH-4168 WIP - fixed some bugs in inventory deletion and lost-and-found handling. --- indra/newview/llinventorymodel.cpp | 121 +++++++++++++++++++++++++------------ 1 file changed, 84 insertions(+), 37 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index bb5da2e9db..b49e617f62 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1197,14 +1197,39 @@ void LLInventoryModel::onDescendentsPurgedFromServer(const LLUUID& object_id) } count = categories.count(); - for(S32 i = 0; i < count; ++i) + // Slightly kludgy way to make sure categories are removed + // only after their child categories have gone away. + + // FIXME: Would probably make more sense to have this whole + // descendent-clearing thing be a post-order recursive + // function to get the leaf-up behavior automatically. + S32 deleted_count; + S32 total_deleted_count = 0; + do { - uu_id = categories.get(i)->getUUID(); - if (getCategory(uu_id)) + deleted_count = 0; + for(S32 i = 0; i < count; ++i) { - deleteObject(uu_id); + uu_id = categories.get(i)->getUUID(); + if (getCategory(uu_id)) + { + cat_array_t* cat_list = getUnlockedCatArray(uu_id); + if (!cat_list || (cat_list->size() == 0)) + { + deleteObject(uu_id); + deleted_count++; + } + } } + total_deleted_count += deleted_count; + } + while (deleted_count > 0); + if (total_deleted_count != count) + { + llwarns << "Unexpected count of categories deleted, got " + << total_deleted_count << " expected " << count << llendl; } + gInventory.validate(); } } @@ -1258,12 +1283,20 @@ void LLInventoryModel::deleteObject(const LLUUID& id) item_list = getUnlockedItemArray(id); if(item_list) { + if (item_list->size()) + { + llwarns << "Deleting cat " << id << " while it still has child items" << llendl; + } delete item_list; mParentChildItemTree.erase(id); } cat_list = getUnlockedCatArray(id); if(cat_list) { + if (cat_list->size()) + { + llwarns << "Deleting cat " << id << " while it still has child cats" << llendl; + } delete cat_list; mParentChildCategoryTree.erase(id); } @@ -2084,11 +2117,16 @@ void LLInventoryModel::buildParentChildMap() S32 count = cats.count(); S32 i; S32 lost = 0; + cat_array_t lost_cats; for(i = 0; i < count; ++i) { LLViewerInventoryCategory* cat = cats.get(i); catsp = getUnlockedCatArray(cat->getParentUUID()); - if(catsp) + if(catsp && + // Only the two root folders should be children of null. + // Others should go to lost & found. + (cat->getParentUUID().notNull() || + cat->getPreferredType() == LLFolderType::FT_ROOT_INVENTORY )) { catsp->put(cat); } @@ -2103,34 +2141,7 @@ void LLInventoryModel::buildParentChildMap() llinfos << "Lost category: " << cat->getUUID() << " - " << cat->getName() << llendl; ++lost; - // plop it into the lost & found. - LLFolderType::EType pref = cat->getPreferredType(); - if(LLFolderType::FT_NONE == pref) - { - cat->setParent(findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND)); - } - else if(LLFolderType::FT_ROOT_INVENTORY == pref) - { - // it's the root - cat->setParent(LLUUID::null); - } - else - { - // it's a protected folder. - cat->setParent(gInventory.getRootFolderID()); - } - // FIXME note that updateServer() fails with protected - // types, so this will not work as intended in that case. - cat->updateServer(TRUE); - catsp = getUnlockedCatArray(cat->getParentUUID()); - if(catsp) - { - catsp->put(cat); - } - else - { - llwarns << "Lost and found Not there!!" << llendl; - } + lost_cats.put(cat); } } if(lost) @@ -2138,6 +2149,42 @@ void LLInventoryModel::buildParentChildMap() llwarns << "Found " << lost << " lost categories." << llendl; } + // Do moves in a separate pass to make sure we've properly filed + // the FT_LOST_AND_FOUND category before we try to find its UUID. + for(i = 0; i<lost_cats.count(); ++i) + { + LLViewerInventoryCategory *cat = lost_cats.get(i); + + // plop it into the lost & found. + LLFolderType::EType pref = cat->getPreferredType(); + if(LLFolderType::FT_NONE == pref) + { + cat->setParent(findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND)); + } + else if(LLFolderType::FT_ROOT_INVENTORY == pref) + { + // it's the root + cat->setParent(LLUUID::null); + } + else + { + // it's a protected folder. + cat->setParent(gInventory.getRootFolderID()); + } + // FIXME note that updateServer() fails with protected + // types, so this will not work as intended in that case. + cat->updateServer(TRUE); + catsp = getUnlockedCatArray(cat->getParentUUID()); + if(catsp) + { + catsp->put(cat); + } + else + { + llwarns << "Lost and found Not there!!" << llendl; + } + } + const BOOL COF_exists = (findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT, FALSE) != LLUUID::null); sFirstTimeInViewer2 = !COF_exists || gAgent.isFirstLogin(); @@ -2267,10 +2314,10 @@ void LLInventoryModel::buildParentChildMap() } } - // if (!gInventory.validate()) - // { - // llwarns << "model failed validity check!" << llendl; - // } + if (!gInventory.validate()) + { + llwarns << "model failed validity check!" << llendl; + } } struct LLUUIDAndName -- cgit v1.2.3 From d4e537b3ef1319af451eeebc31bbe080242ed7d5 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Thu, 9 May 2013 16:41:55 -0400 Subject: SH-4176 WIP - made debugCOF() slightly harder to get to. --- indra/newview/llappearancemgr.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 40ec88f1be..543eb04c0b 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -2947,7 +2947,7 @@ protected: void debugCOF(const LLSD& content) { - LL_DEBUGS("Avatar") << "AIS COF, version found: " << content["expected"].asInteger() << llendl; + LL_INFOS("Avatar") << "AIS COF, version found: " << content["expected"].asInteger() << llendl; std::set<LLUUID> ais_items, local_items; const LLSD& cof_raw = content["cof_raw"]; for (LLSD::array_const_iterator it = cof_raw.beginArray(); @@ -2959,14 +2959,14 @@ protected: ais_items.insert(item["item_id"].asUUID()); if (item["type"].asInteger() == 24) // link { - LL_DEBUGS("Avatar") << "Link: item_id: " << item["item_id"].asUUID() + LL_INFOS("Avatar") << "Link: item_id: " << item["item_id"].asUUID() << " linked_item_id: " << item["asset_id"].asUUID() << " name: " << item["name"].asString() << llendl; } else if (item["type"].asInteger() == 25) // folder link { - LL_DEBUGS("Avatar") << "Folder link: item_id: " << item["item_id"].asUUID() + LL_INFOS("Avatar") << "Folder link: item_id: " << item["item_id"].asUUID() << " linked_item_id: " << item["asset_id"].asUUID() << " name: " << item["name"].asString() << llendl; @@ -2974,15 +2974,15 @@ protected: } else { - LL_DEBUGS("Avatar") << "Other: item_id: " << item["item_id"].asUUID() + LL_INFOS("Avatar") << "Other: item_id: " << item["item_id"].asUUID() << " linked_item_id: " << item["asset_id"].asUUID() << " name: " << item["name"].asString() << llendl; } } } - LL_DEBUGS("Avatar") << llendl; - LL_DEBUGS("Avatar") << "Local COF, version requested: " << content["observed"].asInteger() << llendl; + LL_INFOS("Avatar") << llendl; + LL_INFOS("Avatar") << "Local COF, version requested: " << content["observed"].asInteger() << llendl; LLInventoryModel::cat_array_t cat_array; LLInventoryModel::item_array_t item_array; gInventory.collectDescendents(LLAppearanceMgr::instance().getCOF(), @@ -2991,24 +2991,24 @@ protected: { const LLViewerInventoryItem* inv_item = item_array.get(i).get(); local_items.insert(inv_item->getUUID()); - LL_DEBUGS("Avatar") << "item_id: " << inv_item->getUUID() + LL_INFOS("Avatar") << "item_id: " << inv_item->getUUID() << " linked_item_id: " << inv_item->getLinkedUUID() << " name: " << inv_item->getName() << llendl; } - LL_DEBUGS("Avatar") << llendl; + LL_INFOS("Avatar") << llendl; for (std::set<LLUUID>::iterator it = local_items.begin(); it != local_items.end(); ++it) { if (ais_items.find(*it) == ais_items.end()) { - LL_DEBUGS("Avatar") << "LOCAL ONLY: " << *it << llendl; + LL_INFOS("Avatar") << "LOCAL ONLY: " << *it << llendl; } } for (std::set<LLUUID>::iterator it = ais_items.begin(); it != ais_items.end(); ++it) { if (local_items.find(*it) == local_items.end()) { - LL_DEBUGS("Avatar") << "AIS ONLY: " << *it << llendl; + LL_INFOS("Avatar") << "AIS ONLY: " << *it << llendl; } } } -- cgit v1.2.3 From 55e686b0e305fa14ae5e40f7917f0ce3f3e3c6a1 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Fri, 10 May 2013 07:52:22 -0400 Subject: SH-4176 WIP - tweaks to debugCOF(), which shows differences between viewer and server side views of the COF when a mismatch occurs --- indra/newview/llappearancemgr.cpp | 49 ++++++++++++++++++++++++--------------- 1 file changed, 30 insertions(+), 19 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 543eb04c0b..e8bdb0d7ec 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -2947,7 +2947,8 @@ protected: void debugCOF(const LLSD& content) { - LL_INFOS("Avatar") << "AIS COF, version found: " << content["expected"].asInteger() << llendl; + LL_INFOS("Avatar") << "AIS COF, version received: " << content["expected"].asInteger() + << " ================================= " << llendl; std::set<LLUUID> ais_items, local_items; const LLSD& cof_raw = content["cof_raw"]; for (LLSD::array_const_iterator it = cof_raw.beginArray(); @@ -2959,30 +2960,32 @@ protected: ais_items.insert(item["item_id"].asUUID()); if (item["type"].asInteger() == 24) // link { - LL_INFOS("Avatar") << "Link: item_id: " << item["item_id"].asUUID() - << " linked_item_id: " << item["asset_id"].asUUID() - << " name: " << item["name"].asString() - << llendl; + LL_INFOS("Avatar") << "AIS Link: item_id: " << item["item_id"].asUUID() + << " linked_item_id: " << item["asset_id"].asUUID() + << " name: " << item["name"].asString() + << llendl; } else if (item["type"].asInteger() == 25) // folder link { - LL_INFOS("Avatar") << "Folder link: item_id: " << item["item_id"].asUUID() - << " linked_item_id: " << item["asset_id"].asUUID() - << " name: " << item["name"].asString() - << llendl; + LL_INFOS("Avatar") << "AIS Folder link: item_id: " << item["item_id"].asUUID() + << " linked_item_id: " << item["asset_id"].asUUID() + << " name: " << item["name"].asString() + << llendl; } else { - LL_INFOS("Avatar") << "Other: item_id: " << item["item_id"].asUUID() - << " linked_item_id: " << item["asset_id"].asUUID() - << " name: " << item["name"].asString() - << llendl; + LL_INFOS("Avatar") << "AIS Other: item_id: " << item["item_id"].asUUID() + << " linked_item_id: " << item["asset_id"].asUUID() + << " name: " << item["name"].asString() + << " type: " << item["type"].asInteger() + << llendl; } } } LL_INFOS("Avatar") << llendl; - LL_INFOS("Avatar") << "Local COF, version requested: " << content["observed"].asInteger() << llendl; + LL_INFOS("Avatar") << "Local COF, version requested: " << content["observed"].asInteger() + << " ================================= " << llendl; LLInventoryModel::cat_array_t cat_array; LLInventoryModel::item_array_t item_array; gInventory.collectDescendents(LLAppearanceMgr::instance().getCOF(), @@ -2991,12 +2994,13 @@ protected: { const LLViewerInventoryItem* inv_item = item_array.get(i).get(); local_items.insert(inv_item->getUUID()); - LL_INFOS("Avatar") << "item_id: " << inv_item->getUUID() - << " linked_item_id: " << inv_item->getLinkedUUID() - << " name: " << inv_item->getName() - << llendl; + LL_INFOS("Avatar") << "LOCAL: item_id: " << inv_item->getUUID() + << " linked_item_id: " << inv_item->getLinkedUUID() + << " name: " << inv_item->getName() + << " parent: " << inv_item->getParentUUID() + << llendl; } - LL_INFOS("Avatar") << llendl; + LL_INFOS("Avatar") << " ================================= " << llendl; for (std::set<LLUUID>::iterator it = local_items.begin(); it != local_items.end(); ++it) { if (ais_items.find(*it) == ais_items.end()) @@ -3011,6 +3015,13 @@ protected: LL_INFOS("Avatar") << "AIS ONLY: " << *it << llendl; } } + if (local_items.size()==0 && ais_items.size()==0) + { + LL_INFOS("Avatar") << "COF contents identical, only version numbers differ (req " + << content["observed"].asInteger() + << " rcv " << content["expected"].asInteger() + << ")" << llendl; + } } LLPointer<LLHTTPRetryPolicy> mRetryPolicy; -- cgit v1.2.3 From 43224062a64cc658d429e434a7b673fac0b7c012 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Fri, 10 May 2013 09:19:34 -0400 Subject: SH-4176 WIP - avoid raw dump of whole error contents in log file --- indra/newview/llappearancemgr.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index e8bdb0d7ec..3c141aa37a 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -2905,15 +2905,14 @@ protected: // Error /*virtual*/ void httpFailure() { - const LLSD& content = getContent(); - LL_WARNS("Avatar") << "appearance update request failed " - << dumpResponse() << LL_ENDL; + LL_WARNS("Avatar") << "appearance update request failed, status " + << getStatus() << " reason " << getReason() << LL_ENDL; if (gSavedSettings.getBOOL("DebugAvatarAppearanceMessage")) { + const LLSD& content = getContent(); dumpContents(gAgentAvatarp->getFullname() + "_appearance_request_error", content); debugCOF(content); - } onFailure(); } -- cgit v1.2.3 From 96a2173c643e145a6f5d4964282c4d43f0fc0c3e Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Fri, 10 May 2013 09:32:30 -0400 Subject: SH-4176 WIP - allow retries on 4xx errors if enabled by flag. So enable in the case of appearance requests. --- indra/newview/llappearancemgr.cpp | 3 ++- indra/newview/llhttpretrypolicy.cpp | 7 ++++--- indra/newview/llhttpretrypolicy.h | 3 ++- indra/newview/tests/llhttpretrypolicy_test.cpp | 15 +++++++++++---- 4 files changed, 19 insertions(+), 9 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 3c141aa37a..84a494186f 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -2871,7 +2871,8 @@ class RequestAgentUpdateAppearanceResponder: public LLHTTPClient::Responder public: RequestAgentUpdateAppearanceResponder() { - mRetryPolicy = new LLAdaptiveRetryPolicy(1.0, 32.0, 2.0, 10); + bool retry_on_4xx = true; + mRetryPolicy = new LLAdaptiveRetryPolicy(1.0, 32.0, 2.0, 10, retry_on_4xx); } virtual ~RequestAgentUpdateAppearanceResponder() diff --git a/indra/newview/llhttpretrypolicy.cpp b/indra/newview/llhttpretrypolicy.cpp index 80d97e4362..1512b46103 100755 --- a/indra/newview/llhttpretrypolicy.cpp +++ b/indra/newview/llhttpretrypolicy.cpp @@ -28,11 +28,12 @@ #include "llhttpretrypolicy.h" -LLAdaptiveRetryPolicy::LLAdaptiveRetryPolicy(F32 min_delay, F32 max_delay, F32 backoff_factor, U32 max_retries): +LLAdaptiveRetryPolicy::LLAdaptiveRetryPolicy(F32 min_delay, F32 max_delay, F32 backoff_factor, U32 max_retries, bool retry_on_4xx): mMinDelay(min_delay), mMaxDelay(max_delay), mBackoffFactor(backoff_factor), - mMaxRetries(max_retries) + mMaxRetries(max_retries), + mRetryOn4xx(retry_on_4xx) { init(); } @@ -108,7 +109,7 @@ void LLAdaptiveRetryPolicy::onFailureCommon(S32 status, bool has_retry_header_ti llinfos << "Too many retries " << mRetryCount << ", will not retry" << llendl; mShouldRetry = false; } - if (!isHttpServerErrorStatus(status)) + if (!mRetryOn4xx && !isHttpServerErrorStatus(status)) { llinfos << "Non-server error " << status << ", will not retry" << llendl; mShouldRetry = false; diff --git a/indra/newview/llhttpretrypolicy.h b/indra/newview/llhttpretrypolicy.h index 1fb0cac03f..5b1a1d79e0 100755 --- a/indra/newview/llhttpretrypolicy.h +++ b/indra/newview/llhttpretrypolicy.h @@ -60,7 +60,7 @@ public: class LLAdaptiveRetryPolicy: public LLHTTPRetryPolicy { public: - LLAdaptiveRetryPolicy(F32 min_delay, F32 max_delay, F32 backoff_factor, U32 max_retries); + LLAdaptiveRetryPolicy(F32 min_delay, F32 max_delay, F32 backoff_factor, U32 max_retries, bool retry_on_4xx = false); // virtual void onSuccess(); @@ -88,6 +88,7 @@ private: U32 mRetryCount; // number of times shouldRetry has been called. LLTimer mRetryTimer; // time until next retry. bool mShouldRetry; // Becomes false after too many retries, or the wrong sort of status received, etc. + bool mRetryOn4xx; // Normally only retry on 5xx server errors. }; #endif diff --git a/indra/newview/tests/llhttpretrypolicy_test.cpp b/indra/newview/tests/llhttpretrypolicy_test.cpp index ed7f3ba326..25e6de46d9 100755 --- a/indra/newview/tests/llhttpretrypolicy_test.cpp +++ b/indra/newview/tests/llhttpretrypolicy_test.cpp @@ -56,12 +56,19 @@ void RetryPolicyTestObject::test<1>() template<> template<> void RetryPolicyTestObject::test<2>() { - LLAdaptiveRetryPolicy retry404(1.0,2.0,3.0,10); LLSD headers; F32 wait_seconds; - - retry404.onFailure(404,headers); - ensure("no retry on 404", !retry404.shouldRetry(wait_seconds)); + + // Normally only retry on server error (5xx) + LLAdaptiveRetryPolicy noRetry404(1.0,2.0,3.0,10); + noRetry404.onFailure(404,headers); + ensure("no retry on 404", !noRetry404.shouldRetry(wait_seconds)); + + // Can retry on 4xx errors if enabled by flag. + bool do_retry_4xx = true; + LLAdaptiveRetryPolicy doRetry404(1.0,2.0,3.0,10,do_retry_4xx); + doRetry404.onFailure(404,headers); + ensure("do retry on 404", doRetry404.shouldRetry(wait_seconds)); } template<> template<> -- cgit v1.2.3 From 5c219f694a97d010332618eff9de7bdbeb5b6ed6 Mon Sep 17 00:00:00 2001 From: Nyx Linden <nyx@lindenlab.com> 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') 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 <nyx@lindenlab.com> 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') 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 3f1d360a04c4e4d8f07b7e93cd926961ae379430 Mon Sep 17 00:00:00 2001 From: "prep@lindenlab.com" <prep@lindenlab.com> Date: Fri, 10 May 2013 13:57:02 -0500 Subject: SH-4035: Removed prompt to save if av just has outfit changes. Hooked up logic to handle ctrl+w and ctrl+shift+w confirmation prompts --- indra/newview/llfloatersidepanelcontainer.cpp | 33 +++++++++++++++++++++++++++ indra/newview/llfloatersidepanelcontainer.h | 3 ++- indra/newview/llsidepanelappearance.cpp | 22 ++++++++++-------- 3 files changed, 47 insertions(+), 11 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloatersidepanelcontainer.cpp b/indra/newview/llfloatersidepanelcontainer.cpp index 4dd558c9c0..43ee54ecd2 100644 --- a/indra/newview/llfloatersidepanelcontainer.cpp +++ b/indra/newview/llfloatersidepanelcontainer.cpp @@ -45,6 +45,39 @@ LLFloaterSidePanelContainer::LLFloaterSidePanelContainer(const LLSD& key, const // Prevent transient floaters (e.g. IM windows) from hiding // when this floater is clicked. LLTransientFloaterMgr::getInstance()->addControlView(LLTransientFloaterMgr::GLOBAL, this); + //We want this container to handle the shutdown logic of the sidepanelappearance. + mVerifyUponClose = TRUE; +} + +BOOL LLFloaterSidePanelContainer::postBuild() +{ + setCloseConfirmationCallback( boost::bind(&LLFloaterSidePanelContainer::onConfirmationClose,this,_2)); + return TRUE; +} + +void LLFloaterSidePanelContainer::onConfirmationClose( const LLSD &confirm ) +{ + /* + LLPanelOutfitEdit* panel_outfit_edit = dynamic_cast<LLPanelOutfitEdit*>(LLFloaterSidePanelContainer::getPanel("appearance", "panel_outfit_edit")); + if (panel_outfit_edit) + { + LLFloater *parent = gFloaterView->getParentFloater(panel_outfit_edit); + if (parent == this ) + { + LLSidepanelAppearance* panel_appearance = dynamic_cast<LLSidepanelAppearance*>(getPanel("appearance")); + panel_appearance->onClose(this); + } + else + { + LLFloater::onClickCloseBtn(); + } + } + else + { + LLFloater::onClickCloseBtn(); + } + */ + onClickCloseBtn(); } LLFloaterSidePanelContainer::~LLFloaterSidePanelContainer() diff --git a/indra/newview/llfloatersidepanelcontainer.h b/indra/newview/llfloatersidepanelcontainer.h index 940673b643..26fc092200 100644 --- a/indra/newview/llfloatersidepanelcontainer.h +++ b/indra/newview/llfloatersidepanelcontainer.h @@ -50,8 +50,9 @@ public: ~LLFloaterSidePanelContainer(); /*virtual*/ void onOpen(const LLSD& key); - /*virtual*/ void onClickCloseBtn(); + /*virtual*/ BOOL postBuild(); + void onConfirmationClose( const LLSD &confirm ); LLPanel* openChildPanel(const std::string& panel_name, const LLSD& params); diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp index 77e9604460..f77275fd1c 100644 --- a/indra/newview/llsidepanelappearance.cpp +++ b/indra/newview/llsidepanelappearance.cpp @@ -90,11 +90,12 @@ bool LLSidepanelAppearance::callBackExitWithoutSaveViaClose(const LLSD& notifica S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if ( option == 0 ) { - //revert curernt edits - mEditWearable->revertChanges(); - toggleWearableEditPanel(FALSE); - LLVOAvatarSelf::onCustomizeEnd(FALSE); - mLLFloaterSidePanelContainer->close(); + //revert current edits + mEditWearable->revertChanges(); + //LLAppearanceMgr::getInstance()->wearBaseOutfit(); + toggleWearableEditPanel(FALSE); + LLVOAvatarSelf::onCustomizeEnd( FALSE ); + mLLFloaterSidePanelContainer->close(); return true; } return false; @@ -115,7 +116,7 @@ void LLSidepanelAppearance::onClickConfirmExitWithoutSaveViaClose() void LLSidepanelAppearance::onClickConfirmExitWithoutSaveViaBack() { - if ( LLAppearanceMgr::getInstance()->isOutfitDirty() && !mSidePanelJustOpened && !LLAppearanceMgr::getInstance()->isOutfitLocked() ) + if ( LLAppearanceMgr::getInstance()->isOutfitDirty() && !mSidePanelJustOpened /*&& !LLAppearanceMgr::getInstance()->isOutfitLocked()*/ ) { LLSidepanelAppearance* pSelf = (LLSidepanelAppearance *)this; LLNotificationsUtil::add("ConfirmExitWithoutSave", LLSD(), LLSD(), boost::bind(&LLSidepanelAppearance::callBackExitWithoutSaveViaBack,pSelf,_1,_2) ); @@ -128,9 +129,9 @@ void LLSidepanelAppearance::onClickConfirmExitWithoutSaveViaBack() void LLSidepanelAppearance::onClose(LLFloaterSidePanelContainer* obj) { - mLLFloaterSidePanelContainer = obj; - if ( LLAppearanceMgr::getInstance()->isOutfitDirty() && - !LLAppearanceMgr::getInstance()->isOutfitLocked() || + mLLFloaterSidePanelContainer = obj; + if ( /*LLAppearanceMgr::getInstance()->isOutfitDirty() && */ + /*!LLAppearanceMgr::getInstance()->isOutfitLocked() ||*/ ( mEditWearable->isAvailable() && mEditWearable->isDirty() ) ) { LLSidepanelAppearance* pSelf = (LLSidepanelAppearance *)this; @@ -275,8 +276,9 @@ void LLSidepanelAppearance::onVisibilityChange(const LLSD &new_visibility) void LLSidepanelAppearance::updateToVisibility(const LLSD &new_visibility) { - if (new_visibility["visible"].asBoolean()) + if (new_visibility["visible"].asBoolean() ) { + const BOOL is_outfit_edit_visible = mOutfitEdit && mOutfitEdit->getVisible(); const BOOL is_wearable_edit_visible = mEditWearable && mEditWearable->getVisible(); -- cgit v1.2.3 From 69df2f1b0430dc00519b08bd2f0abd6712d3d2bc Mon Sep 17 00:00:00 2001 From: "prep@lindenlab.com" <prep@lindenlab.com> Date: Mon, 13 May 2013 11:54:37 -0500 Subject: SH-4035: Hooked up logic to handle 'me->appearance'. Refactored out some commonly used code in llfloatersidepanelcontainer --- indra/newview/llfloatersidepanelcontainer.cpp | 83 +++++++++++++++------------ indra/newview/llfloatersidepanelcontainer.h | 5 ++ indra/newview/llsidepanelappearance.cpp | 34 +++++++++++ indra/newview/llsidepanelappearance.h | 4 +- 4 files changed, 87 insertions(+), 39 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloatersidepanelcontainer.cpp b/indra/newview/llfloatersidepanelcontainer.cpp index 43ee54ecd2..3ea39cf196 100644 --- a/indra/newview/llfloatersidepanelcontainer.cpp +++ b/indra/newview/llfloatersidepanelcontainer.cpp @@ -56,30 +56,11 @@ BOOL LLFloaterSidePanelContainer::postBuild() } void LLFloaterSidePanelContainer::onConfirmationClose( const LLSD &confirm ) -{ - /* - LLPanelOutfitEdit* panel_outfit_edit = dynamic_cast<LLPanelOutfitEdit*>(LLFloaterSidePanelContainer::getPanel("appearance", "panel_outfit_edit")); - if (panel_outfit_edit) - { - LLFloater *parent = gFloaterView->getParentFloater(panel_outfit_edit); - if (parent == this ) - { - LLSidepanelAppearance* panel_appearance = dynamic_cast<LLSidepanelAppearance*>(getPanel("appearance")); - panel_appearance->onClose(this); - } - else - { - LLFloater::onClickCloseBtn(); - } - } - else - { - LLFloater::onClickCloseBtn(); - } - */ +{ onClickCloseBtn(); } + LLFloaterSidePanelContainer::~LLFloaterSidePanelContainer() { LLTransientFloaterMgr::getInstance()->removeControlView(LLTransientFloaterMgr::GLOBAL, this); @@ -92,20 +73,10 @@ void LLFloaterSidePanelContainer::onOpen(const LLSD& key) void LLFloaterSidePanelContainer::onClickCloseBtn() { - LLPanelOutfitEdit* panel_outfit_edit = - dynamic_cast<LLPanelOutfitEdit*>(LLFloaterSidePanelContainer::getPanel("appearance", "panel_outfit_edit")); - if (panel_outfit_edit) + LLSidepanelAppearance* panel = getSidePanelAppearance(); + if ( panel ) { - LLFloater *parent = gFloaterView->getParentFloater(panel_outfit_edit); - if (parent == this ) - { - LLSidepanelAppearance* panel_appearance = dynamic_cast<LLSidepanelAppearance*>(getPanel("appearance")); - panel_appearance->onClose(this); - } - else - { - LLFloater::onClickCloseBtn(); - } + panel->onClose( this ); } else { @@ -114,7 +85,7 @@ void LLFloaterSidePanelContainer::onClickCloseBtn() } void LLFloaterSidePanelContainer::close() { - LLFloater::onClickCloseBtn(); + LLFloater::onClickCloseBtn(); } LLPanel* LLFloaterSidePanelContainer::openChildPanel(const std::string& panel_name, const LLSD& params) @@ -124,7 +95,7 @@ LLPanel* LLFloaterSidePanelContainer::openChildPanel(const std::string& panel_na if (!getVisible()) { - openFloater(); + openFloater(); } LLPanel* panel = NULL; @@ -145,10 +116,30 @@ LLPanel* LLFloaterSidePanelContainer::openChildPanel(const std::string& panel_na void LLFloaterSidePanelContainer::showPanel(const std::string& floater_name, const LLSD& key) { - LLFloaterSidePanelContainer* floaterp = LLFloaterReg::getTypedInstance<LLFloaterSidePanelContainer>(floater_name); + //If we're already open then check whether anything is dirty + LLFloaterSidePanelContainer* floaterp = LLFloaterReg::getTypedInstance<LLFloaterSidePanelContainer>(floater_name); if (floaterp) { - floaterp->openChildPanel(sMainPanelName, key); + if ( floaterp->getVisible() ) + { + LLSidepanelAppearance* panel = floaterp->getSidePanelAppearance(); + if ( panel ) + { + if ( panel->checkForDirtyEdits() ) + { + panel->onClickConfirmExitWithoutSaveIntoAppearance(); + } + else + { + //or a call into some new f() that just shows inv panel? + floaterp->openChildPanel(sMainPanelName, key); + } + } + } + else + { + floaterp->openChildPanel(sMainPanelName, key); + } } } @@ -172,3 +163,19 @@ LLPanel* LLFloaterSidePanelContainer::getPanel(const std::string& floater_name, return NULL; } + +LLSidepanelAppearance* LLFloaterSidePanelContainer::getSidePanelAppearance() +{ + LLSidepanelAppearance* panel_appearance = NULL; + LLPanelOutfitEdit* panel_outfit_edit = dynamic_cast<LLPanelOutfitEdit*>(LLFloaterSidePanelContainer::getPanel("appearance", "panel_outfit_edit")); + if (panel_outfit_edit) + { + LLFloater *parent = gFloaterView->getParentFloater(panel_outfit_edit); + if (parent == this ) + { + panel_appearance = dynamic_cast<LLSidepanelAppearance*>(getPanel("appearance")); + } + } + return panel_appearance; + +} \ No newline at end of file diff --git a/indra/newview/llfloatersidepanelcontainer.h b/indra/newview/llfloatersidepanelcontainer.h index 26fc092200..974934b48f 100644 --- a/indra/newview/llfloatersidepanelcontainer.h +++ b/indra/newview/llfloatersidepanelcontainer.h @@ -30,6 +30,8 @@ #include "llfloater.h" +class LLSidepanelAppearance; + /** * Class LLFloaterSidePanelContainer * @@ -81,6 +83,9 @@ public: } return panel; } + +private: + LLSidepanelAppearance* getSidePanelAppearance(); }; #endif // LL_LLFLOATERSIDEPANELCONTAINER_H diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp index f77275fd1c..cf759dd8f7 100644 --- a/indra/newview/llsidepanelappearance.cpp +++ b/indra/newview/llsidepanelappearance.cpp @@ -114,6 +114,35 @@ void LLSidepanelAppearance::onClickConfirmExitWithoutSaveViaClose() } } + +bool LLSidepanelAppearance::callBackExitWithoutSaveIntoAppearance(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if ( option == 0 ) + { + //revert current edits + mEditWearable->revertChanges(); + toggleWearableEditPanel(FALSE); + LLVOAvatarSelf::onCustomizeEnd( FALSE ); + //mLLFloaterSidePanelContainer->close(); + showOutfitsInventoryPanel(); + return true; + } + return false; +} + +void LLSidepanelAppearance::onClickConfirmExitWithoutSaveIntoAppearance() +{ + if ( LLAppearanceMgr::getInstance()->isOutfitDirty() && !LLAppearanceMgr::getInstance()->isOutfitLocked() ) + { + LLSidepanelAppearance* pSelf = (LLSidepanelAppearance *)this; + LLNotificationsUtil::add("ConfirmExitWithoutSave", LLSD(), LLSD(), boost::bind(&LLSidepanelAppearance::callBackExitWithoutSaveIntoAppearance,pSelf,_1,_2) ); + } + else + { + showOutfitsInventoryPanel(); + } +} void LLSidepanelAppearance::onClickConfirmExitWithoutSaveViaBack() { if ( LLAppearanceMgr::getInstance()->isOutfitDirty() && !mSidePanelJustOpened /*&& !LLAppearanceMgr::getInstance()->isOutfitLocked()*/ ) @@ -629,3 +658,8 @@ void LLSidepanelAppearance::updateScrollingPanelList() mEditWearable->updateScrollingPanelList(); } } + +bool LLSidepanelAppearance::checkForDirtyEdits() +{ + return ( mEditWearable->isDirty() ) ? true : false; +} \ No newline at end of file diff --git a/indra/newview/llsidepanelappearance.h b/indra/newview/llsidepanelappearance.h index 85e7734567..caf5be62e9 100644 --- a/indra/newview/llsidepanelappearance.h +++ b/indra/newview/llsidepanelappearance.h @@ -73,7 +73,9 @@ public: void onClickConfirmExitWithoutSaveViaBack(); bool callBackExitWithoutSaveViaClose(const LLSD& notification, const LLSD& response); void onClickConfirmExitWithoutSaveViaClose(); - + bool checkForDirtyEdits(); + bool callBackExitWithoutSaveIntoAppearance(const LLSD& notification, const LLSD& response); + void onClickConfirmExitWithoutSaveIntoAppearance(); private: void onFilterEdit(const std::string& search_string); -- cgit v1.2.3 From b7161fcd58853fb60900e51a4ac221b02941905e Mon Sep 17 00:00:00 2001 From: "prep@lindenlab.com" <prep@lindenlab.com> Date: Mon, 13 May 2013 16:03:22 -0500 Subject: SH-4035: Removed prompt to save if av just has outfit changes and you click on the back button --- indra/newview/llsidepanelappearance.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp index cf759dd8f7..1b56aff3b6 100644 --- a/indra/newview/llsidepanelappearance.cpp +++ b/indra/newview/llsidepanelappearance.cpp @@ -145,12 +145,14 @@ void LLSidepanelAppearance::onClickConfirmExitWithoutSaveIntoAppearance() } void LLSidepanelAppearance::onClickConfirmExitWithoutSaveViaBack() { - if ( LLAppearanceMgr::getInstance()->isOutfitDirty() && !mSidePanelJustOpened /*&& !LLAppearanceMgr::getInstance()->isOutfitLocked()*/ ) + /* + if ( LLAppearanceMgr::getInstance()->isOutfitDirty() && !mSidePanelJustOpened && !LLAppearanceMgr::getInstance()->isOutfitLocked() ) { LLSidepanelAppearance* pSelf = (LLSidepanelAppearance *)this; LLNotificationsUtil::add("ConfirmExitWithoutSave", LLSD(), LLSD(), boost::bind(&LLSidepanelAppearance::callBackExitWithoutSaveViaBack,pSelf,_1,_2) ); } else + */ { showOutfitsInventoryPanel(); } -- cgit v1.2.3 From b1998cabc487c434555276a389ed19847b98f998 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Mon, 13 May 2013 17:08:37 -0400 Subject: SH-4168 WIP, SH-4155 WIP - update inventory model based on ais returns, try to maintain loading... string more consistently in folder bridge --- indra/newview/llinventorybridge.cpp | 18 ++++---- indra/newview/llinventorymodel.cpp | 85 +++++++++++++++++++++++++++++++++---- indra/newview/llinventorymodel.h | 11 +++-- indra/newview/llviewerinventory.cpp | 8 ++-- 4 files changed, 96 insertions(+), 26 deletions(-) mode change 100644 => 100755 indra/newview/llinventorybridge.cpp (limited to 'indra/newview') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp old mode 100644 new mode 100755 index 27f35c5946..abebd0aa5e --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1566,18 +1566,18 @@ void LLItemBridge::buildDisplayName() const else { mDisplayName.assign(LLStringUtil::null); -} - + } + mSearchableName.assign(mDisplayName); mSearchableName.append(getLabelSuffix()); LLStringUtil::toUpper(mSearchableName); - + //Name set, so trigger a sort if(mParent) -{ - mParent->requestSort(); - } + { + mParent->requestSort(); } +} LLFontGL::StyleFlags LLItemBridge::getLabelStyle() const { @@ -1901,8 +1901,7 @@ void LLFolderBridge::update() possibly_has_children = true; } - bool loading = (possibly_has_children - && !up_to_date ); + bool loading = (possibly_has_children && !up_to_date ); if (loading != mIsLoading) { @@ -1929,12 +1928,13 @@ void LLFolderBridge::update() || (LLInventoryModelBackgroundFetch::instance().folderFetchActive() && root_is_loading)) { + buildDisplayName(); mDisplayName = LLInvFVBridge::getDisplayName() + " ( " + LLTrans::getString("LoadingData") + " ) "; mIsLoading = true; } else { - mDisplayName = LLInvFVBridge::getDisplayName(); + buildDisplayName(); mIsLoading = false; } } diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index b49e617f62..fd57845c0e 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -48,6 +48,7 @@ #include "llcallbacklist.h" #include "llvoavatarself.h" #include "llgesturemgr.h" +#include "llsdutil.h" #include <typeinfo> //#define DIFF_INVENTORY_FILES @@ -1153,8 +1154,69 @@ void LLInventoryModel::changeCategoryParent(LLViewerInventoryCategory* cat, notifyObservers(); } +void parse_llsd_uuid_array(const LLSD& content, const std::string& name, uuid_vec_t& ids) +{ + ids.clear(); + if (content.has(name)) + { + for(LLSD::array_const_iterator it = content[name].beginArray(), + end = content[name].endArray(); + it != end; ++it) + { + ids.push_back((*it).asUUID()); + } + } +} + +void LLInventoryModel::onAISUpdateReceived(const std::string& context, const LLSD& update) +{ + llinfos << "ais update " << context << ":" << ll_pretty_print_sd(update) << llendl; + + uuid_vec_t cat_ids; + parse_llsd_uuid_array(update,"_categories_removed",cat_ids); + for (uuid_vec_t::const_iterator it = cat_ids.begin(); + it != cat_ids.end(); ++it) + { + llinfos << "remove category: " << *it << llendl; + onObjectDeletedFromServer(*it, false); + } + + uuid_vec_t item_ids; + parse_llsd_uuid_array(update,"_category_items_removed",item_ids); + for (uuid_vec_t::const_iterator it = item_ids.begin(); + it != item_ids.end(); ++it) + { + llinfos << "remove item: " << *it << llendl; + onObjectDeletedFromServer(*it, false); + } + + uuid_vec_t broken_link_ids; + parse_llsd_uuid_array(update,"_broken_links_removed",broken_link_ids); + for (uuid_vec_t::const_iterator it = broken_link_ids.begin(); + it != broken_link_ids.end(); ++it) + { + llinfos << "remove broken link: " << *it << llendl; + onObjectDeletedFromServer(*it, false); + } + + const std::string& ucv = "_updated_category_versions"; + if (update.has(ucv)) + { + for(LLSD::map_const_iterator it = update[ucv].beginMap(), + end = update[ucv].endMap(); + it != end; ++it) + { + const LLUUID id((*it).first); + S32 version = (*it).second.asInteger(); + llinfos << "update category: " << id << " to version " << version << llendl; + } + } + + +} + // Update model after descendents have been purged. -void LLInventoryModel::onDescendentsPurgedFromServer(const LLUUID& object_id) +void LLInventoryModel::onDescendentsPurgedFromServer(const LLUUID& object_id, bool fix_broken_links) { LLPointer<LLViewerInventoryCategory> cat = getCategory(object_id); if (cat.notNull()) @@ -1192,7 +1254,7 @@ void LLInventoryModel::onDescendentsPurgedFromServer(const LLUUID& object_id) // of its deleted parent. if (getItem(uu_id)) { - deleteObject(uu_id); + deleteObject(uu_id, fix_broken_links); } } @@ -1216,7 +1278,7 @@ void LLInventoryModel::onDescendentsPurgedFromServer(const LLUUID& object_id) cat_array_t* cat_list = getUnlockedCatArray(uu_id); if (!cat_list || (cat_list->size() == 0)) { - deleteObject(uu_id); + deleteObject(uu_id, fix_broken_links); deleted_count++; } } @@ -1235,24 +1297,30 @@ void LLInventoryModel::onDescendentsPurgedFromServer(const LLUUID& object_id) // Update model after an item is confirmed as removed from // server. Works for categories or items. -void LLInventoryModel::onObjectDeletedFromServer(const LLUUID& object_id) +void LLInventoryModel::onObjectDeletedFromServer(const LLUUID& object_id, bool fix_broken_links) { LLPointer<LLInventoryObject> obj = getObject(object_id); if(obj) { + if (getCategory(object_id)) + { + // For category, need to delete/update all children first. + onDescendentsPurgedFromServer(object_id, fix_broken_links); + } + // From item/cat removeFromServer() LLInventoryModel::LLCategoryUpdate up(obj->getParentUUID(), -1); accountForUpdate(up); // From purgeObject() LLPreview::hide(object_id); - deleteObject(object_id); + deleteObject(object_id, fix_broken_links); } } // Delete a particular inventory object by ID. -void LLInventoryModel::deleteObject(const LLUUID& id) +void LLInventoryModel::deleteObject(const LLUUID& id, bool fix_broken_links) { lldebugs << "LLInventoryModel::deleteObject()" << llendl; LLPointer<LLInventoryObject> obj = getObject(id); @@ -1303,10 +1371,11 @@ void LLInventoryModel::deleteObject(const LLUUID& id) addChangedMask(LLInventoryObserver::REMOVE, id); // Can't have links to links, so there's no need for this update - // if the item removed is a link. + // if the item removed is a link. Can also skip if source of the + // update is getting broken link info separately. bool is_link_type = obj->getIsLinkType(); obj = NULL; // delete obj - if (!is_link_type) + if (fix_broken_links && !is_link_type) { updateLinkedObjectsFromPurge(id); } diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index 2459f10a37..696d0a9163 100755 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -328,19 +328,22 @@ public: // Delete //-------------------------------------------------------------------- public: - + + // Update model after an AISv3 update received for any operation. + void onAISUpdateReceived(const std::string& context, const LLSD& update); + // Update model after an item is confirmed as removed from // server. Works for categories or items. - void onObjectDeletedFromServer(const LLUUID& item_id); + void onObjectDeletedFromServer(const LLUUID& item_id, bool fix_broken_links = true); // Update model after all descendents removed from server. - void onDescendentsPurgedFromServer(const LLUUID& object_id); + void onDescendentsPurgedFromServer(const LLUUID& object_id, bool fix_broken_links = true); // Delete a particular inventory object by ID. Will purge one // object from the internal data structures, maintaining a // consistent internal state. No cache accounting, observer // notification, or server update is performed. - void deleteObject(const LLUUID& id); + void deleteObject(const LLUUID& id, bool fix_broken_links = true); /// move Item item_id to Trash void removeItem(const LLUUID& item_id); /// move Category category_id to Trash diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index f9afdee4f9..5ffd560942 100755 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -1154,8 +1154,8 @@ public: failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content); return; } - llinfos << "succeeded: " << ll_pretty_print_sd(content) << llendl; - + gInventory.onAISUpdateReceived("removeObjectResponder " + mItemUUID.asString(), content); + // FIXME - not needed after AIS starts returning deleted item in its response. gInventory.onObjectDeletedFromServer(mItemUUID); if (mCallback) @@ -1335,9 +1335,7 @@ public: failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content); return; } - llinfos << "succeeded: " << ll_pretty_print_sd(content) << llendl; - - gInventory.onDescendentsPurgedFromServer(mItemUUID); + gInventory.onAISUpdateReceived("purgeDescendentsResponder " + mItemUUID.asString(), content); if (mCallback) { -- cgit v1.2.3 From 931410211e1d644028f5b09cbf77b179e0e75aab Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Wed, 15 May 2013 09:45:10 -0400 Subject: SH-4144 FIX - removed UseAISv3Inventory debug settings - cap is now managed sim-side --- indra/newview/app_settings/settings.xml | 11 ----------- indra/newview/llviewerinventory.cpp | 6 +++--- 2 files changed, 3 insertions(+), 14 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 1262089b3d..18a33b3542 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -14033,17 +14033,6 @@ <key>Value</key> <integer>1</integer> </map> - <key>UseAISv3Inventory</key> - <map> - <key>Comment</key> - <string>Allow use of AISv3 inventory - this setting should only be needed during development.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> <key>ClickToWalk</key> <map> <key>Comment</key> diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 5ffd560942..e819479923 100755 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -1189,7 +1189,7 @@ void remove_inventory_item( if(obj) { std::string cap; - if (gAgent.getRegion() && gSavedSettings.getBOOL("UseAISv3Inventory")) + if (gAgent.getRegion()) { cap = gAgent.getRegion()->getCapability("InventoryAPIv3"); } @@ -1267,7 +1267,7 @@ void remove_inventory_category( } std::string cap; - if (gAgent.getRegion() && gSavedSettings.getBOOL("UseAISv3Inventory")) + if (gAgent.getRegion()) { cap = gAgent.getRegion()->getCapability("InventoryAPIv3"); } @@ -1407,7 +1407,7 @@ void purge_descendents_of(const LLUUID& id, LLPointer<LLInventoryCallback> cb) else { std::string cap; - if (gAgent.getRegion() && gSavedSettings.getBOOL("UseAISv3Inventory")) + if (gAgent.getRegion()) { cap = gAgent.getRegion()->getCapability("InventoryAPIv3"); } -- cgit v1.2.3 From 2ed3746aee81901435f3f28f71a497d234d680d2 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Wed, 15 May 2013 13:27:16 -0400 Subject: SH-4197 FIX - also simplified the category remove flow for AIS, don't need to purge descendents first. --- indra/newview/llviewerinventory.cpp | 39 ++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 16 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index e819479923..202ed43caa 100755 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -1155,8 +1155,6 @@ public: return; } gInventory.onAISUpdateReceived("removeObjectResponder " + mItemUUID.asString(), content); - // FIXME - not needed after AIS starts returning deleted item in its response. - gInventory.onObjectDeletedFromServer(mItemUUID); if (mCallback) { @@ -1226,18 +1224,26 @@ void remove_inventory_item( } } -class LLRemoveObjectOnDestroy: public LLInventoryCallback +class LLRemoveCategoryOnDestroy: public LLInventoryCallback { public: - LLRemoveObjectOnDestroy(const LLUUID& item_id, LLPointer<LLInventoryCallback> cb): - mID(item_id), + LLRemoveCategoryOnDestroy(const LLUUID& cat_id, LLPointer<LLInventoryCallback> cb): + mID(cat_id), mCB(cb) { } /* virtual */ void fire(const LLUUID& item_id) {} - ~LLRemoveObjectOnDestroy() + ~LLRemoveCategoryOnDestroy() { - remove_inventory_object(mID, mCB); + LLInventoryModel::EHasChildren children = gInventory.categoryHasChildren(mID); + if(children != LLInventoryModel::CHILDREN_NO) + { + llwarns << "remove descendents failed, cannot remove category " << llendl; + } + else + { + remove_inventory_category(mID, mCB); + } } private: LLUUID mID; @@ -1257,15 +1263,6 @@ void remove_inventory_category( LLNotificationsUtil::add("CannotRemoveProtectedCategories"); return; } - LLInventoryModel::EHasChildren children = gInventory.categoryHasChildren(cat_id); - if(children != LLInventoryModel::CHILDREN_NO) - { - llinfos << "Will purge descendents first before deleting category " << cat_id << llendl; - LLPointer<LLInventoryCallback> wrap_cb = new LLRemoveObjectOnDestroy(cat_id,cb); - purge_descendents_of(cat_id, wrap_cb); - return; - } - std::string cap; if (gAgent.getRegion()) { @@ -1280,6 +1277,16 @@ void remove_inventory_category( } else // no cap { + // RemoveInventoryFolder does not remove children, so must + // clear descendents first. + LLInventoryModel::EHasChildren children = gInventory.categoryHasChildren(cat_id); + if(children != LLInventoryModel::CHILDREN_NO) + { + llinfos << "Will purge descendents first before deleting category " << cat_id << llendl; + LLPointer<LLInventoryCallback> wrap_cb = new LLRemoveCategoryOnDestroy(cat_id, cb); + purge_descendents_of(cat_id, wrap_cb); + return; + } LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_RemoveInventoryFolder); -- cgit v1.2.3 From 8a4add76b44bab32633c5432f8852e5351770c91 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Wed, 15 May 2013 18:08:12 -0400 Subject: SH-4175 WIP - Avoid add to outfit or remove from outfit when an outfit change is already in progress --- indra/newview/llappearancemgr.cpp | 14 +++++++++++--- indra/newview/llinventorybridge.cpp | 4 ++++ indra/newview/llviewerinventory.cpp | 2 +- 3 files changed, 16 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 84a494186f..f48755ecce 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1547,6 +1547,11 @@ bool LLAppearanceMgr::getCanRemoveOutfit(const LLUUID& outfit_cat_id) // static bool LLAppearanceMgr::getCanRemoveFromCOF(const LLUUID& outfit_cat_id) { + if (gAgentWearables.isCOFChangeInProgress()) + { + return false; + } + LLFindWearablesEx is_worn(/*is_worn=*/ true, /*include_body_parts=*/ false); return gInventory.hasMatchingDirectDescendent(outfit_cat_id, is_worn); } @@ -1578,8 +1583,8 @@ bool LLAppearanceMgr::getCanReplaceCOF(const LLUUID& outfit_cat_id) } // Check whether the outfit contains any wearables we aren't wearing already (STORM-702). - LLFindWearablesEx is_worn(/*is_worn=*/ false, /*include_body_parts=*/ true); - return gInventory.hasMatchingDirectDescendent(outfit_cat_id, is_worn); + LLFindWearablesEx not_worn(/*is_worn=*/ false, /*include_body_parts=*/ true); + return gInventory.hasMatchingDirectDescendent(outfit_cat_id, not_worn); } void LLAppearanceMgr::purgeBaseOutfitLink(const LLUUID& category, LLPointer<LLInventoryCallback> cb) @@ -3001,11 +3006,13 @@ protected: << llendl; } LL_INFOS("Avatar") << " ================================= " << llendl; + S32 local_only = 0, ais_only = 0; for (std::set<LLUUID>::iterator it = local_items.begin(); it != local_items.end(); ++it) { if (ais_items.find(*it) == ais_items.end()) { LL_INFOS("Avatar") << "LOCAL ONLY: " << *it << llendl; + local_only++; } } for (std::set<LLUUID>::iterator it = ais_items.begin(); it != ais_items.end(); ++it) @@ -3013,9 +3020,10 @@ protected: if (local_items.find(*it) == local_items.end()) { LL_INFOS("Avatar") << "AIS ONLY: " << *it << llendl; + ais_only++; } } - if (local_items.size()==0 && ais_items.size()==0) + if (local_only==0 && ais_only==0) { LL_INFOS("Avatar") << "COF contents identical, only version numbers differ (req " << content["observed"].asInteger() diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index abebd0aa5e..b857f8bbec 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3579,6 +3579,10 @@ void LLFolderBridge::buildContextMenuFolderOptions(U32 flags, menuentry_vec_t& { disabled_items.push_back(std::string("Replace Outfit")); } + if (!LLAppearanceMgr::instance().getCanAddToCOF(mUUID)) + { + disabled_items.push_back(std::string("Add To Outfit")); + } items.push_back(std::string("Outfit Separator")); } } diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 202ed43caa..18ea812471 100755 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -1182,8 +1182,8 @@ void remove_inventory_item( const LLUUID& item_id, LLPointer<LLInventoryCallback> cb) { - llinfos << "item_id: [" << item_id << "] " << llendl; LLPointer<LLViewerInventoryItem> obj = gInventory.getItem(item_id); + llinfos << "item_id: [" << item_id << "] name " << (obj ? obj->getName() : "(NOT FOUND)") << llendl; if(obj) { std::string cap; -- cgit v1.2.3 From 14a3c5187b644b084f0b0a024a8ac953e89f37de Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Thu, 16 May 2013 14:40:04 -0400 Subject: SH-4175 WIP - removed a case where we request to delete the base outfit link twice when changing outfits --- indra/newview/llappearancemgr.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index f48755ecce..cfe9055aab 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1765,7 +1765,10 @@ void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append) // the link_waiter so links can be followed for any items that get // carried over (e.g. keeping old shape if the new outfit does not // contain one) - bool keep_outfit_links = append; + + // even in the non-append case, createBaseOutfitLink() already + // deletes the existing link, don't need to do it again here. + bool keep_outfit_links = true; removeCategoryContents(cof, keep_outfit_links, link_waiter); LL_DEBUGS("Avatar") << self_av_string() << "waiting for LLUpdateAppearanceOnDestroy" << LL_ENDL; -- cgit v1.2.3 From 14f7ad902330051e1bb3ff17abbbfa05a0ebf7e8 Mon Sep 17 00:00:00 2001 From: Richard Linden <none@none> Date: Thu, 16 May 2013 19:17:52 -0700 Subject: SH-4168 FIX Inventory: Loading... Loading... shown on folders cleaned up logic for displaying "loading..." message so that it only applies to folders that are opened whose contents aren't yet loaded --- indra/newview/llinventorybridge.cpp | 48 ++++++++++--------------------------- indra/newview/llinventorybridge.h | 4 +++- 2 files changed, 16 insertions(+), 36 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index b857f8bbec..c32abe507e 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -200,6 +200,7 @@ const std::string& LLInvFVBridge::getDisplayName() const { buildDisplayName(); } + return mDisplayName; } @@ -1894,49 +1895,19 @@ void LLFolderBridge::buildDisplayName() const void LLFolderBridge::update() { - bool possibly_has_children = false; - bool up_to_date = isUpToDate(); - if(!up_to_date && hasChildren()) // we know we have children but haven't fetched them (doesn't obey filter) - { - possibly_has_children = true; - } - - bool loading = (possibly_has_children && !up_to_date ); + // we know we have children but haven't fetched them (doesn't obey filter) + bool loading = !isUpToDate() && hasChildren() && mFolderViewItem->isOpen(); if (loading != mIsLoading) { - if ( loading && !mIsLoading ) + if ( loading ) { // Measure how long we've been in the loading state mTimeSinceRequestStart.reset(); } + mIsLoading = loading; - const BOOL in_inventory = gInventory.isObjectDescendentOf(getUUID(), gInventory.getRootFolderID()); - const BOOL in_library = gInventory.isObjectDescendentOf(getUUID(), gInventory.getLibraryRootFolderID()); - - bool root_is_loading = false; - if (in_inventory) - { - root_is_loading = LLInventoryModelBackgroundFetch::instance().inventoryFetchInProgress(); - } - if (in_library) - { - root_is_loading = LLInventoryModelBackgroundFetch::instance().libraryFetchInProgress(); - } - if ((mIsLoading - && mTimeSinceRequestStart.getElapsedTimeF32() >= gSavedSettings.getF32("FolderLoadingMessageWaitTime")) - || (LLInventoryModelBackgroundFetch::instance().folderFetchActive() - && root_is_loading)) - { - buildDisplayName(); - mDisplayName = LLInvFVBridge::getDisplayName() + " ( " + LLTrans::getString("LoadingData") + " ) "; - mIsLoading = true; - } - else - { - buildDisplayName(); - mIsLoading = false; - } + mFolderViewItem->refresh(); } } @@ -3056,6 +3027,13 @@ LLUIImagePtr LLFolderBridge::getIconOverlay() const return NULL; } +std::string LLFolderBridge::getLabelSuffix() const +{ + static LLCachedControl<F32> folder_loading_message_delay(gSavedSettings, "FolderLoadingMessageWaitTime"); + return mIsLoading && mTimeSinceRequestStart.getElapsedTimeF32() >= folder_loading_message_delay() + ? llformat(" ( %s ) ", LLTrans::getString("LoadingData").c_str()) + : LLStringUtil::null; +} BOOL LLFolderBridge::renameItem(const std::string& new_name) { diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index 517153e171..2a937b574d 100644 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -248,7 +248,7 @@ public: LLFolderBridge(LLInventoryPanel* inventory, LLFolderView* root, const LLUUID& uuid) - : LLInvFVBridge(inventory, root, uuid), + : LLInvFVBridge(inventory, root, uuid), mCallingCards(FALSE), mWearables(FALSE), mIsLoading(false) @@ -272,6 +272,8 @@ public: virtual LLUIImagePtr getIconOverlay() const; static LLUIImagePtr getIcon(LLFolderType::EType preferred_type); + + virtual std::string getLabelSuffix() const; virtual BOOL renameItem(const std::string& new_name); -- cgit v1.2.3 From d09db5949050ac23547e1cd06712ebbf9a980b2a Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Fri, 17 May 2013 18:01:52 -0400 Subject: SH-4200 WIP - added AISCommand classes with retry capabilities. --- indra/newview/llviewerinventory.cpp | 205 +++++++++++++++++++++++------------- 1 file changed, 131 insertions(+), 74 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 18ea812471..31ff3bb5d6 100755 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -66,6 +66,7 @@ #include "lllogininstance.h" #include "llfavoritesbar.h" #include "llclipboard.h" +#include "llhttpretrypolicy.h" // Two do-nothing ops for use in callbacks. void no_op_inventory_func(const LLUUID&) {} @@ -1138,44 +1139,156 @@ void move_inventory_item( gAgent.sendReliableMessage(); } -class RemoveObjectResponder: public LLHTTPClient::Responder +class AISCommand: public LLHTTPClient::Responder { public: - RemoveObjectResponder(const LLUUID& item_id, LLPointer<LLInventoryCallback> callback): - mItemUUID(item_id), + typedef boost::function<void()> command_func_type; + + AISCommand(LLPointer<LLInventoryCallback> callback): mCallback(callback) { + llinfos << "constructor" << llendl; + mRetryPolicy = new LLAdaptiveRetryPolicy(1.0, 32.0, 2.0, 10); + } + + virtual ~AISCommand() + { + llinfos << "destructor" << llendl; + } + + void run_command() + { + mCommandFunc(); + } + + void setCommandFunc(command_func_type command_func) + { + mCommandFunc = command_func; + } + + // Need to do command-specific parsing to get an id here. May or + // may not need to bother, since most LLInventoryCallbacks do + // their work in the destructor. + virtual bool getResponseUUID(const LLSD& content, LLUUID& id) + { + return false; } + /* virtual */ void httpSuccess() { + // Command func holds a reference to self, need to release it + // after a success or final failure. + setCommandFunc(no_op); + const LLSD& content = getContent(); if (!content.isMap()) { failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content); return; } - gInventory.onAISUpdateReceived("removeObjectResponder " + mItemUUID.asString(), content); + mRetryPolicy->onSuccess(); + + gInventory.onAISUpdateReceived("AISCommand", content); if (mCallback) { - mCallback->fire(mItemUUID); + LLUUID item_id; // will default to null if parse fails. + getResponseUUID(content,item_id); + mCallback->fire(item_id); } } + /*virtual*/ void httpFailure() { const LLSD& content = getContent(); S32 status = getStatus(); const std::string& reason = getReason(); + const LLSD& headers = getResponseHeaders(); if (!content.isMap()) { - llwarns << "Malformed response contents " << content << " id " << mItemUUID << " status " << status << " reason " << reason << llendl; - return; + llwarns << "Malformed response contents " << content + << " status " << status << " reason " << reason << llendl; + } + else + { + llwarns << "failed with content: " << ll_pretty_print_sd(content) + << " status " << status << " reason " << reason << llendl; + } + mRetryPolicy->onFailure(status, headers); + F32 seconds_to_wait; + if (mRetryPolicy->shouldRetry(seconds_to_wait)) + { + doAfterInterval(boost::bind(&AISCommand::run_command,this),seconds_to_wait); + } + else + { + // Command func holds a reference to self, need to release it + // after a success or final failure. + setCommandFunc(no_op); } - llwarns << "failed for " << mItemUUID << " content: " << ll_pretty_print_sd(content) << " status " << status << " reason " << reason << llendl; } + + static bool getCap(std::string& cap) + { + if (gAgent.getRegion()) + { + cap = gAgent.getRegion()->getCapability("InventoryAPIv3"); + } + if (!cap.empty()) + { + return true; + } + return false; + } + private: + command_func_type mCommandFunc; + LLPointer<LLHTTPRetryPolicy> mRetryPolicy; LLPointer<LLInventoryCallback> mCallback; - const LLUUID mItemUUID; +}; + +class RemoveObjectCommand: public AISCommand +{ +public: + RemoveObjectCommand(const LLUUID& item_id, + LLPointer<LLInventoryCallback> callback): + AISCommand(callback) + { + std::string cap; + if (!getCap(cap)) + { + return; + } + const std::string url = cap + std::string("/item/") + item_id.asString(); + llinfos << "url: " << url << llendl; + LLHTTPClient::ResponderPtr responder = this; + LLSD headers; + F32 timeout = HTTP_REQUEST_EXPIRY_SECS; + command_func_type cmd = boost::bind(&LLHTTPClient::del, url, responder, headers, timeout); + setCommandFunc(cmd); + } +}; + +class PurgeDescendentsCommand: public AISCommand +{ +public: + PurgeDescendentsCommand(const LLUUID& item_id, + LLPointer<LLInventoryCallback> callback): + AISCommand(callback) + { + std::string cap; + if (!getCap(cap)) + { + return; + } + std::string url = cap + std::string("/category/") + item_id.asString() + "/children"; + llinfos << "url: " << url << llendl; + LLCurl::ResponderPtr responder = this; + LLSD headers; + F32 timeout = HTTP_REQUEST_EXPIRY_SECS; + command_func_type cmd = boost::bind(&LLHTTPClient::del, url, responder, headers, timeout); + setCommandFunc(cmd); + } }; void remove_inventory_item( @@ -1187,16 +1300,10 @@ void remove_inventory_item( if(obj) { std::string cap; - if (gAgent.getRegion()) - { - cap = gAgent.getRegion()->getCapability("InventoryAPIv3"); - } - if (!cap.empty()) + if (AISCommand::getCap(cap)) { - std::string url = cap + std::string("/item/") + item_id.asString(); - llinfos << "url: " << url << llendl; - LLCurl::ResponderPtr responder_ptr = new RemoveObjectResponder(item_id,cb); - LLHTTPClient::del(url,responder_ptr); + LLPointer<AISCommand> cmd_ptr = new RemoveObjectCommand(item_id, cb); + cmd_ptr->run_command(); } else // no cap { @@ -1264,16 +1371,12 @@ void remove_inventory_category( return; } std::string cap; - if (gAgent.getRegion()) - { - cap = gAgent.getRegion()->getCapability("InventoryAPIv3"); - } - if (!cap.empty()) + if (AISCommand::getCap(cap)) { std::string url = cap + std::string("/category/") + cat_id.asString(); llinfos << "url: " << url << llendl; - LLCurl::ResponderPtr responder_ptr = new RemoveObjectResponder(cat_id,cb); - LLHTTPClient::del(url,responder_ptr); + LLPointer<AISCommand> cmd_ptr = new RemoveObjectCommand(cat_id, cb); + cmd_ptr->run_command(); } else // no cap { @@ -1326,46 +1429,6 @@ void remove_inventory_object( } } -class PurgeDescendentsResponder: public LLHTTPClient::Responder -{ -public: - PurgeDescendentsResponder(const LLUUID& item_id, LLPointer<LLInventoryCallback> callback): - mItemUUID(item_id), - mCallback(callback) - { - } - /* virtual */ void httpSuccess() - { - const LLSD& content = getContent(); - if (!content.isMap()) - { - failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content); - return; - } - gInventory.onAISUpdateReceived("purgeDescendentsResponder " + mItemUUID.asString(), content); - - if (mCallback) - { - mCallback->fire(mItemUUID); - } - } - /*virtual*/ void httpFailure() - { - const LLSD& content = getContent(); - S32 status = getStatus(); - const std::string& reason = getReason(); - if (!content.isMap()) - { - llwarns << "Malformed response contents " << content << " id " << mItemUUID << " status " << status << " reason " << reason << llendl; - return; - } - llwarns << "failed for " << mItemUUID << " content: " << ll_pretty_print_sd(content) << " status " << status << " reason " << reason << llendl; - } -private: - LLPointer<LLInventoryCallback> mCallback; - const LLUUID mItemUUID; -}; - // This is a method which collects the descendents of the id // provided. If the category is not found, no action is // taken. This method goes through the long winded process of @@ -1414,16 +1477,10 @@ void purge_descendents_of(const LLUUID& id, LLPointer<LLInventoryCallback> cb) else { std::string cap; - if (gAgent.getRegion()) - { - cap = gAgent.getRegion()->getCapability("InventoryAPIv3"); - } - if (!cap.empty()) + if (AISCommand::getCap(cap)) { - std::string url = cap + std::string("/category/") + id.asString() + "/children"; - llinfos << "url: " << url << llendl; - LLCurl::ResponderPtr responder_ptr = new PurgeDescendentsResponder(id,cb); - LLHTTPClient::del(url,responder_ptr); + LLPointer<AISCommand> cmd_ptr = new PurgeDescendentsCommand(id, cb); + cmd_ptr->run_command(); } else // no cap { -- cgit v1.2.3 From 0f6a4a3389cdce6d5bb92cd6f4861a46def284cc Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Mon, 20 May 2013 18:06:26 -0400 Subject: SH-4200 FIX - retry ais ops on 5xx errors, dialed back some verbose logging. --- indra/newview/app_settings/logcontrol.xml | 1 + indra/newview/llinventorymodel.cpp | 28 +++++++------ indra/newview/llviewerinventory.cpp | 67 ++++++++++++++++++++----------- 3 files changed, 60 insertions(+), 36 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/logcontrol.xml b/indra/newview/app_settings/logcontrol.xml index 92a241857e..6594fdb249 100755 --- a/indra/newview/app_settings/logcontrol.xml +++ b/indra/newview/app_settings/logcontrol.xml @@ -43,6 +43,7 @@ <key>tags</key> <array> <!-- sample entry for debugging specific items + <string>Inventory</string> <string>Avatar</string> <string>Voice</string> --> diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index fd57845c0e..73ef3e60da 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1170,14 +1170,13 @@ void parse_llsd_uuid_array(const LLSD& content, const std::string& name, uuid_ve void LLInventoryModel::onAISUpdateReceived(const std::string& context, const LLSD& update) { - llinfos << "ais update " << context << ":" << ll_pretty_print_sd(update) << llendl; + LL_DEBUGS("Inventory") << "ais update " << context << ":" << ll_pretty_print_sd(update) << llendl; uuid_vec_t cat_ids; parse_llsd_uuid_array(update,"_categories_removed",cat_ids); for (uuid_vec_t::const_iterator it = cat_ids.begin(); it != cat_ids.end(); ++it) { - llinfos << "remove category: " << *it << llendl; onObjectDeletedFromServer(*it, false); } @@ -1186,7 +1185,6 @@ void LLInventoryModel::onAISUpdateReceived(const std::string& context, const LLS for (uuid_vec_t::const_iterator it = item_ids.begin(); it != item_ids.end(); ++it) { - llinfos << "remove item: " << *it << llendl; onObjectDeletedFromServer(*it, false); } @@ -1195,10 +1193,13 @@ void LLInventoryModel::onAISUpdateReceived(const std::string& context, const LLS for (uuid_vec_t::const_iterator it = broken_link_ids.begin(); it != broken_link_ids.end(); ++it) { - llinfos << "remove broken link: " << *it << llendl; onObjectDeletedFromServer(*it, false); } + // TODO - how can we use this version info? Need to be sure all + // changes are going through AIS first, or at least through + // something with a reliable responder. +#if 0 const std::string& ucv = "_updated_category_versions"; if (update.has(ucv)) { @@ -1208,9 +1209,9 @@ void LLInventoryModel::onAISUpdateReceived(const std::string& context, const LLS { const LLUUID id((*it).first); S32 version = (*it).second.asInteger(); - llinfos << "update category: " << id << " to version " << version << llendl; } } +#endif } @@ -1291,7 +1292,7 @@ void LLInventoryModel::onDescendentsPurgedFromServer(const LLUUID& object_id, bo llwarns << "Unexpected count of categories deleted, got " << total_deleted_count << " expected " << count << llendl; } - gInventory.validate(); + //gInventory.validate(); } } @@ -2925,7 +2926,7 @@ void LLInventoryModel::processBulkUpdateInventory(LLMessageSystem* msg, void**) LLUUID tid; msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_TransactionID, tid); #ifndef LL_RELEASE_FOR_DOWNLOAD - llinfos << "Bulk inventory: " << tid << llendl; + LL_DEBUGS("Inventory") << "Bulk inventory: " << tid << llendl; #endif update_map_t update; @@ -2937,9 +2938,9 @@ void LLInventoryModel::processBulkUpdateInventory(LLMessageSystem* msg, void**) { LLPointer<LLViewerInventoryCategory> tfolder = new LLViewerInventoryCategory(gAgent.getID()); tfolder->unpackMessage(msg, _PREHASH_FolderData, i); - llinfos << "unpacked folder '" << tfolder->getName() << "' (" - << tfolder->getUUID() << ") in " << tfolder->getParentUUID() - << llendl; + LL_DEBUGS("Inventory") << "unpacked folder '" << tfolder->getName() << "' (" + << tfolder->getUUID() << ") in " << tfolder->getParentUUID() + << llendl; if(tfolder->getUUID().notNull()) { folders.push_back(tfolder); @@ -2979,8 +2980,8 @@ void LLInventoryModel::processBulkUpdateInventory(LLMessageSystem* msg, void**) { LLPointer<LLViewerInventoryItem> titem = new LLViewerInventoryItem; titem->unpackMessage(msg, _PREHASH_ItemData, i); - llinfos << "unpacked item '" << titem->getName() << "' in " - << titem->getParentUUID() << llendl; + LL_DEBUGS("Inventory") << "unpacked item '" << titem->getName() << "' in " + << titem->getParentUUID() << llendl; U32 callback_id; msg->getU32Fast(_PREHASH_ItemData, _PREHASH_CallbackID, callback_id); if(titem->getUUID().notNull() ) // && callback_id.notNull() ) @@ -3118,7 +3119,8 @@ void LLInventoryModel::processInventoryDescendents(LLMessageSystem* msg,void**) // If the item has already been added (e.g. from link prefetch), then it doesn't need to be re-added. if (gInventory.getItem(titem->getUUID())) { - llinfos << "Skipping prefetched item [ Name: " << titem->getName() << " | Type: " << titem->getActualType() << " | ItemUUID: " << titem->getUUID() << " ] " << llendl; + LL_DEBUGS("Inventory") << "Skipping prefetched item [ Name: " << titem->getName() + << " | Type: " << titem->getActualType() << " | ItemUUID: " << titem->getUUID() << " ] " << llendl; continue; } gInventory.updateItem(titem); diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 31ff3bb5d6..50d67463c7 100755 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -1147,13 +1147,11 @@ public: AISCommand(LLPointer<LLInventoryCallback> callback): mCallback(callback) { - llinfos << "constructor" << llendl; mRetryPolicy = new LLAdaptiveRetryPolicy(1.0, 32.0, 2.0, 10); } virtual ~AISCommand() { - llinfos << "destructor" << llendl; } void run_command() @@ -1206,13 +1204,13 @@ public: const LLSD& headers = getResponseHeaders(); if (!content.isMap()) { - llwarns << "Malformed response contents " << content - << " status " << status << " reason " << reason << llendl; + LL_DEBUGS("Inventory") << "Malformed response contents " << content + << " status " << status << " reason " << reason << llendl; } else { - llwarns << "failed with content: " << ll_pretty_print_sd(content) - << " status " << status << " reason " << reason << llendl; + LL_DEBUGS("Inventory") << "failed with content: " << ll_pretty_print_sd(content) + << " status " << status << " reason " << reason << llendl; } mRetryPolicy->onFailure(status, headers); F32 seconds_to_wait; @@ -1247,20 +1245,44 @@ private: LLPointer<LLInventoryCallback> mCallback; }; -class RemoveObjectCommand: public AISCommand +class RemoveItemCommand: public AISCommand { public: - RemoveObjectCommand(const LLUUID& item_id, - LLPointer<LLInventoryCallback> callback): + RemoveItemCommand(const LLUUID& item_id, + LLPointer<LLInventoryCallback> callback): AISCommand(callback) { std::string cap; if (!getCap(cap)) { + llwarns << "No cap found" << llendl; return; } - const std::string url = cap + std::string("/item/") + item_id.asString(); - llinfos << "url: " << url << llendl; + std::string url = cap + std::string("/item/") + item_id.asString(); + LL_DEBUGS("Inventory") << "url: " << url << llendl; + LLHTTPClient::ResponderPtr responder = this; + LLSD headers; + F32 timeout = HTTP_REQUEST_EXPIRY_SECS; + command_func_type cmd = boost::bind(&LLHTTPClient::del, url, responder, headers, timeout); + setCommandFunc(cmd); + } +}; + +class RemoveCategoryCommand: public AISCommand +{ +public: + RemoveCategoryCommand(const LLUUID& item_id, + LLPointer<LLInventoryCallback> callback): + AISCommand(callback) + { + std::string cap; + if (!getCap(cap)) + { + llwarns << "No cap found" << llendl; + return; + } + std::string url = cap + std::string("/category/") + item_id.asString(); + LL_DEBUGS("Inventory") << "url: " << url << llendl; LLHTTPClient::ResponderPtr responder = this; LLSD headers; F32 timeout = HTTP_REQUEST_EXPIRY_SECS; @@ -1279,10 +1301,11 @@ public: std::string cap; if (!getCap(cap)) { + llwarns << "No cap found" << llendl; return; } std::string url = cap + std::string("/category/") + item_id.asString() + "/children"; - llinfos << "url: " << url << llendl; + LL_DEBUGS("Inventory") << "url: " << url << llendl; LLCurl::ResponderPtr responder = this; LLSD headers; F32 timeout = HTTP_REQUEST_EXPIRY_SECS; @@ -1296,13 +1319,13 @@ void remove_inventory_item( LLPointer<LLInventoryCallback> cb) { LLPointer<LLViewerInventoryItem> obj = gInventory.getItem(item_id); - llinfos << "item_id: [" << item_id << "] name " << (obj ? obj->getName() : "(NOT FOUND)") << llendl; + LL_DEBUGS("Inventory") << "item_id: [" << item_id << "] name " << (obj ? obj->getName() : "(NOT FOUND)") << llendl; if(obj) { std::string cap; if (AISCommand::getCap(cap)) { - LLPointer<AISCommand> cmd_ptr = new RemoveObjectCommand(item_id, cb); + LLPointer<AISCommand> cmd_ptr = new RemoveItemCommand(item_id, cb); cmd_ptr->run_command(); } else // no cap @@ -1361,7 +1384,7 @@ void remove_inventory_category( const LLUUID& cat_id, LLPointer<LLInventoryCallback> cb) { - llinfos << "cat_id: [" << cat_id << "] " << llendl; + LL_DEBUGS("Inventory") << "cat_id: [" << cat_id << "] " << llendl; LLPointer<LLViewerInventoryCategory> obj = gInventory.getCategory(cat_id); if(obj) { @@ -1373,9 +1396,7 @@ void remove_inventory_category( std::string cap; if (AISCommand::getCap(cap)) { - std::string url = cap + std::string("/category/") + cat_id.asString(); - llinfos << "url: " << url << llendl; - LLPointer<AISCommand> cmd_ptr = new RemoveObjectCommand(cat_id, cb); + LLPointer<AISCommand> cmd_ptr = new RemoveCategoryCommand(cat_id, cb); cmd_ptr->run_command(); } else // no cap @@ -1385,7 +1406,7 @@ void remove_inventory_category( LLInventoryModel::EHasChildren children = gInventory.categoryHasChildren(cat_id); if(children != LLInventoryModel::CHILDREN_NO) { - llinfos << "Will purge descendents first before deleting category " << cat_id << llendl; + LL_DEBUGS("Inventory") << "Will purge descendents first before deleting category " << cat_id << llendl; LLPointer<LLInventoryCallback> wrap_cb = new LLRemoveCategoryOnDestroy(cat_id, cb); purge_descendents_of(cat_id, wrap_cb); return; @@ -1439,7 +1460,7 @@ void purge_descendents_of(const LLUUID& id, LLPointer<LLInventoryCallback> cb) LLInventoryModel::EHasChildren children = gInventory.categoryHasChildren(id); if(children == LLInventoryModel::CHILDREN_NO) { - llinfos << "No descendents to purge for " << id << llendl; + LL_DEBUGS("Inventory") << "No descendents to purge for " << id << llendl; return; } LLPointer<LLViewerInventoryCategory> cat = gInventory.getCategory(id); @@ -1448,8 +1469,8 @@ void purge_descendents_of(const LLUUID& id, LLPointer<LLInventoryCallback> cb) if (LLClipboard::instance().hasContents() && LLClipboard::instance().isCutMode()) { // Something on the clipboard is in "cut mode" and needs to be preserved - llinfos << "purge_descendents_of clipboard case " << cat->getName() - << " iterate and purge non hidden items" << llendl; + LL_DEBUGS("Inventory") << "purge_descendents_of clipboard case " << cat->getName() + << " iterate and purge non hidden items" << llendl; LLInventoryModel::cat_array_t* categories; LLInventoryModel::item_array_t* items; // Get the list of direct descendants in tha categoy passed as argument @@ -1485,7 +1506,7 @@ void purge_descendents_of(const LLUUID& id, LLPointer<LLInventoryCallback> cb) else // no cap { // Fast purge - llinfos << "purge_descendents_of fast case " << cat->getName() << llendl; + LL_DEBUGS("Inventory") << "purge_descendents_of fast case " << cat->getName() << llendl; // send it upstream LLMessageSystem* msg = gMessageSystem; -- cgit v1.2.3 From 6c56c77ec575141963c5de8dfa228253fe175bc3 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Fri, 24 May 2013 08:53:21 -0400 Subject: SH-4027 WIP - initial implementation of item update via AIS. --- indra/newview/llappearancemgr.cpp | 4 +- indra/newview/llinventorybridge.cpp | 10 +- indra/newview/llinventoryfunctions.cpp | 9 +- indra/newview/llinventorymodel.cpp | 93 +++++- indra/newview/llinventorymodel.h | 6 + indra/newview/llviewerinventory.cpp | 510 +++++++++++++++++++++++---------- indra/newview/llviewerinventory.h | 14 + 7 files changed, 475 insertions(+), 171 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index cfe9055aab..14eed6e1df 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -2812,8 +2812,10 @@ struct WearablesOrderComparator //items with ordering information but not for the associated wearables type if (!item1_valid && item2_valid) return false; + else if (item1_valid && !item2_valid) + return true; - return true; + return item1->getName() < item2->getName(); } U32 mControlSize; diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index c32abe507e..89c56ab82c 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1692,13 +1692,9 @@ BOOL LLItemBridge::renameItem(const std::string& new_name) LLViewerInventoryItem* item = getItem(); if(item && (item->getName() != new_name)) { - LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item); - new_item->rename(new_name); - new_item->updateServer(FALSE); - model->updateItem(new_item); - - model->notifyObservers(); - buildDisplayName(); + LLSD updates; + updates["name"] = new_name; + update_inventory_item(item->getUUID(),updates, NULL); } // return FALSE because we either notified observers (& therefore // rebuilt) or we didn't update. diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index f1a4889f5a..b5fb226872 100755 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -123,12 +123,9 @@ void rename_category(LLInventoryModel* model, const LLUUID& cat_id, const std::s return; } - LLPointer<LLViewerInventoryCategory> new_cat = new LLViewerInventoryCategory(cat); - new_cat->rename(new_name); - new_cat->updateServer(FALSE); - model->updateCategory(new_cat); - - model->notifyObservers(); + LLSD updates; + updates["name"] = new_name; + update_inventory_category(cat_id, updates, NULL); } void copy_inventory_category(LLInventoryModel* model, diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 73ef3e60da..06c614aeaa 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1196,6 +1196,36 @@ void LLInventoryModel::onAISUpdateReceived(const std::string& context, const LLS onObjectDeletedFromServer(*it, false); } + if (update.has("item_id")) + { + // item has been modified or possibly created (would be better if we could distinguish these cases directly) + LLUUID item_id = update["item_id"].asUUID(); + LLViewerInventoryItem *item = gInventory.getItem(item_id); + LLViewerInventoryCategory *cat = gInventory.getCategory(item_id); + if (item) + { + LLSD changes; + if (update.has("name") && update["name"] != item->getName()) + { + changes["name"] = update["name"]; + } + if (update.has("desc") && update["desc"] != item->getActualDescription()) + { + changes["desc"] = update["desc"]; + } + onItemUpdated(item_id,changes); + } + else if (cat) + { + llerrs << "don't handle cat update yet" << llendl; + } + else + { + llerrs << "don't handle creation case yet" << llendl; + } + + } + // TODO - how can we use this version info? Need to be sure all // changes are going through AIS first, or at least through // something with a reliable responder. @@ -1212,10 +1242,71 @@ void LLInventoryModel::onAISUpdateReceived(const std::string& context, const LLS } } #endif - } +void LLInventoryModel::onItemUpdated(const LLUUID& item_id, const LLSD& updates) +{ + U32 mask = LLInventoryObserver::NONE; + + LLPointer<LLViewerInventoryItem> item = gInventory.getItem(item_id); + LL_DEBUGS("Inventory") << "item_id: [" << item_id << "] name " << (item ? item->getName() : "(NOT FOUND)") << llendl; + if(item) + { + for (LLSD::map_const_iterator it = updates.beginMap(); + it != updates.endMap(); ++it) + { + if (it->first == "name") + { + llinfos << "Updating name from " << item->getName() << " to " << it->second.asString() << llendl; + item->rename(it->second.asString()); + mask |= LLInventoryObserver::LABEL; + } + else if (it->first == "desc") + { + llinfos << "Updating description from " << item->getActualDescription() + << " to " << it->second.asString() << llendl; + item->setDescription(it->second.asString()); + } + else + { + llerrs << "unhandled updates for field: " << it->first << llendl; + } + } + mask |= LLInventoryObserver::INTERNAL; + addChangedMask(mask, item->getUUID()); + gInventory.notifyObservers(); // do we want to be able to make this optional? + } +} + +void LLInventoryModel::onCategoryUpdated(const LLUUID& cat_id, const LLSD& updates) +{ + U32 mask = LLInventoryObserver::NONE; + + LLPointer<LLViewerInventoryCategory> cat = gInventory.getCategory(cat_id); + LL_DEBUGS("Inventory") << "cat_id: [" << cat_id << "] name " << (cat ? cat->getName() : "(NOT FOUND)") << llendl; + if(cat) + { + for (LLSD::map_const_iterator it = updates.beginMap(); + it != updates.endMap(); ++it) + { + if (it->first == "name") + { + llinfos << "Updating name from " << cat->getName() << " to " << it->second.asString() << llendl; + cat->rename(it->second.asString()); + mask |= LLInventoryObserver::LABEL; + } + else + { + llerrs << "unhandled updates for field: " << it->first << llendl; + } + } + mask |= LLInventoryObserver::INTERNAL; + addChangedMask(mask, cat->getUUID()); + gInventory.notifyObservers(); // do we want to be able to make this optional? + } +} + // Update model after descendents have been purged. void LLInventoryModel::onDescendentsPurgedFromServer(const LLUUID& object_id, bool fix_broken_links) { diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index 696d0a9163..515c99c0b4 100755 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -339,6 +339,12 @@ public: // Update model after all descendents removed from server. void onDescendentsPurgedFromServer(const LLUUID& object_id, bool fix_broken_links = true); + // Update model after an existing item gets updated on server. + void onItemUpdated(const LLUUID& item_id, const LLSD& updates); + + // Update model after an existing category gets updated on server. + void onCategoryUpdated(const LLUUID& cat_id, const LLSD& updates); + // Delete a particular inventory object by ID. Will purge one // object from the internal data structures, maintaining a // consistent internal state. No cache accounting, observer diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 50d67463c7..90fef3b5ed 100755 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -259,6 +259,240 @@ public: LLInventoryHandler gInventoryHandler; +///---------------------------------------------------------------------------- +/// Classes for AISv3 support. +///---------------------------------------------------------------------------- +class AISCommand: public LLHTTPClient::Responder +{ +public: + typedef boost::function<void()> command_func_type; + + AISCommand(LLPointer<LLInventoryCallback> callback): + mCallback(callback) + { + mRetryPolicy = new LLAdaptiveRetryPolicy(1.0, 32.0, 2.0, 10); + } + + virtual ~AISCommand() + { + } + + void run_command() + { + mCommandFunc(); + } + + void setCommandFunc(command_func_type command_func) + { + mCommandFunc = command_func; + } + + // Need to do command-specific parsing to get an id here. May or + // may not need to bother, since most LLInventoryCallbacks do + // their work in the destructor. + virtual bool getResponseUUID(const LLSD& content, LLUUID& id) + { + return false; + } + + /* virtual */ void httpSuccess() + { + // Command func holds a reference to self, need to release it + // after a success or final failure. + setCommandFunc(no_op); + + const LLSD& content = getContent(); + if (!content.isMap()) + { + failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content); + return; + } + mRetryPolicy->onSuccess(); + + gInventory.onAISUpdateReceived("AISCommand", content); + + if (mCallback) + { + LLUUID item_id; // will default to null if parse fails. + getResponseUUID(content,item_id); + mCallback->fire(item_id); + } + } + + /*virtual*/ void httpFailure() + { + const LLSD& content = getContent(); + S32 status = getStatus(); + const std::string& reason = getReason(); + const LLSD& headers = getResponseHeaders(); + if (!content.isMap()) + { + LL_DEBUGS("Inventory") << "Malformed response contents " << content + << " status " << status << " reason " << reason << llendl; + } + else + { + LL_DEBUGS("Inventory") << "failed with content: " << ll_pretty_print_sd(content) + << " status " << status << " reason " << reason << llendl; + } + mRetryPolicy->onFailure(status, headers); + F32 seconds_to_wait; + if (mRetryPolicy->shouldRetry(seconds_to_wait)) + { + doAfterInterval(boost::bind(&AISCommand::run_command,this),seconds_to_wait); + } + else + { + // Command func holds a reference to self, need to release it + // after a success or final failure. + setCommandFunc(no_op); + } + } + + static bool getCap(std::string& cap) + { + if (gAgent.getRegion()) + { + cap = gAgent.getRegion()->getCapability("InventoryAPIv3"); + } + if (!cap.empty()) + { + return true; + } + return false; + } + +private: + command_func_type mCommandFunc; + LLPointer<LLHTTPRetryPolicy> mRetryPolicy; + LLPointer<LLInventoryCallback> mCallback; +}; + +class RemoveItemCommand: public AISCommand +{ +public: + RemoveItemCommand(const LLUUID& item_id, + LLPointer<LLInventoryCallback> callback): + AISCommand(callback) + { + std::string cap; + if (!getCap(cap)) + { + llwarns << "No cap found" << llendl; + return; + } + std::string url = cap + std::string("/item/") + item_id.asString(); + LL_DEBUGS("Inventory") << "url: " << url << llendl; + LLHTTPClient::ResponderPtr responder = this; + LLSD headers; + F32 timeout = HTTP_REQUEST_EXPIRY_SECS; + command_func_type cmd = boost::bind(&LLHTTPClient::del, url, responder, headers, timeout); + setCommandFunc(cmd); + } +}; + +class RemoveCategoryCommand: public AISCommand +{ +public: + RemoveCategoryCommand(const LLUUID& item_id, + LLPointer<LLInventoryCallback> callback): + AISCommand(callback) + { + std::string cap; + if (!getCap(cap)) + { + llwarns << "No cap found" << llendl; + return; + } + std::string url = cap + std::string("/category/") + item_id.asString(); + LL_DEBUGS("Inventory") << "url: " << url << llendl; + LLHTTPClient::ResponderPtr responder = this; + LLSD headers; + F32 timeout = HTTP_REQUEST_EXPIRY_SECS; + command_func_type cmd = boost::bind(&LLHTTPClient::del, url, responder, headers, timeout); + setCommandFunc(cmd); + } +}; + +class PurgeDescendentsCommand: public AISCommand +{ +public: + PurgeDescendentsCommand(const LLUUID& item_id, + LLPointer<LLInventoryCallback> callback): + AISCommand(callback) + { + std::string cap; + if (!getCap(cap)) + { + llwarns << "No cap found" << llendl; + return; + } + std::string url = cap + std::string("/category/") + item_id.asString() + "/children"; + LL_DEBUGS("Inventory") << "url: " << url << llendl; + LLCurl::ResponderPtr responder = this; + LLSD headers; + F32 timeout = HTTP_REQUEST_EXPIRY_SECS; + command_func_type cmd = boost::bind(&LLHTTPClient::del, url, responder, headers, timeout); + setCommandFunc(cmd); + } +}; + +class UpdateItemCommand: public AISCommand +{ +public: + UpdateItemCommand(const LLUUID& item_id, + const LLSD& updates, + LLPointer<LLInventoryCallback> callback): + mUpdates(updates), + AISCommand(callback) + { + std::string cap; + if (!getCap(cap)) + { + llwarns << "No cap found" << llendl; + return; + } + std::string url = cap + std::string("/item/") + item_id.asString(); + LL_DEBUGS("Inventory") << "url: " << url << llendl; + LLCurl::ResponderPtr responder = this; + LLSD headers; + headers["Content-Type"] = "application/llsd+xml"; + F32 timeout = HTTP_REQUEST_EXPIRY_SECS; + command_func_type cmd = boost::bind(&LLHTTPClient::patch, url, mUpdates, responder, headers, timeout); + setCommandFunc(cmd); + } +private: + LLSD mUpdates; +}; + +class UpdateCategoryCommand: public AISCommand +{ +public: + UpdateCategoryCommand(const LLUUID& item_id, + const LLSD& updates, + LLPointer<LLInventoryCallback> callback): + mUpdates(updates), + AISCommand(callback) + { + std::string cap; + if (!getCap(cap)) + { + llwarns << "No cap found" << llendl; + return; + } + std::string url = cap + std::string("/category/") + item_id.asString(); + LL_DEBUGS("Inventory") << "url: " << url << llendl; + LLCurl::ResponderPtr responder = this; + LLSD headers; + headers["Content-Type"] = "application/llsd+xml"; + F32 timeout = HTTP_REQUEST_EXPIRY_SECS; + command_func_type cmd = boost::bind(&LLHTTPClient::patch, url, mUpdates, responder, headers, timeout); + setCommandFunc(cmd); + } +private: + LLSD mUpdates; +}; + ///---------------------------------------------------------------------------- /// Class LLViewerInventoryItem ///---------------------------------------------------------------------------- @@ -456,6 +690,20 @@ void LLViewerInventoryItem::setTransactionID(const LLTransactionID& transaction_ // virtual void LLViewerInventoryItem::packMessage(LLMessageSystem* msg) const { + static const LLSD updates; + packUpdateMessage(msg,updates); +} + +void LLViewerInventoryItem::packUpdateMessage(LLMessageSystem* msg, const LLSD& updates) const +{ + for (LLSD::map_const_iterator it = updates.beginMap(); it != updates.endMap(); ++it) + { + if ((it->first != "desc") && (it->first != "name")) + { + llerrs << "unhandled field: " << it->first << llendl; + } + } + msg->addUUIDFast(_PREHASH_ItemID, mUUID); msg->addUUIDFast(_PREHASH_FolderID, mParentUUID); mPermissions.packMessage(msg); @@ -466,12 +714,29 @@ void LLViewerInventoryItem::packMessage(LLMessageSystem* msg) const msg->addS8Fast(_PREHASH_InvType, type); msg->addU32Fast(_PREHASH_Flags, mFlags); mSaleInfo.packMessage(msg); - msg->addStringFast(_PREHASH_Name, mName); - msg->addStringFast(_PREHASH_Description, mDescription); + if (updates.has("name")) + { + std::string new_name = updates["name"].asString(); + LLInventoryObject::correctInventoryName(new_name); + msg->addStringFast(_PREHASH_Name, new_name); + } + else + { + msg->addStringFast(_PREHASH_Name, mName); + } + if (updates.has("desc")) + { + msg->addStringFast(_PREHASH_Description, updates["desc"].asString()); + } + else + { + msg->addStringFast(_PREHASH_Description, mDescription); + } msg->addS32Fast(_PREHASH_CreationDate, mCreationDate); U32 crc = getCRC32(); msg->addU32Fast(_PREHASH_CRC, crc); } + // virtual BOOL LLViewerInventoryItem::importFile(LLFILE* fp) { @@ -583,6 +848,32 @@ void LLViewerInventoryCategory::copyViewerCategory(const LLViewerInventoryCatego } +void LLViewerInventoryCategory::packUpdateMessage(LLMessageSystem* msg, const LLSD& updates) const +{ + for (LLSD::map_const_iterator it = updates.beginMap(); it != updates.endMap(); ++it) + { + if (it->first != "name") + { + llerrs << "unhandled field: " << it->first << llendl; + } + } + + msg->addUUIDFast(_PREHASH_FolderID, mUUID); + msg->addUUIDFast(_PREHASH_ParentID, mParentUUID); + S8 type = static_cast<S8>(mPreferredType); + msg->addS8Fast(_PREHASH_Type, type); + if (updates.has("name")) + { + std::string new_name = updates["name"].asString(); + LLInventoryObject::correctInventoryName(new_name); + msg->addStringFast(_PREHASH_Name, new_name); + } + else + { + msg->addStringFast(_PREHASH_Name, mName); + } +} + void LLViewerInventoryCategory::updateParentOnServer(BOOL restamp) const { LLMessageSystem* msg = gMessageSystem; @@ -1139,180 +1430,87 @@ void move_inventory_item( gAgent.sendReliableMessage(); } -class AISCommand: public LLHTTPClient::Responder +// Note this only supports updating an existing item. Goes through AISv3 +// code path where available. Not all uses of item->updateServer() can +// easily be switched to this paradigm. +void update_inventory_item( + const LLUUID& item_id, + const LLSD& updates, + LLPointer<LLInventoryCallback> cb) { -public: - typedef boost::function<void()> command_func_type; - - AISCommand(LLPointer<LLInventoryCallback> callback): - mCallback(callback) - { - mRetryPolicy = new LLAdaptiveRetryPolicy(1.0, 32.0, 2.0, 10); - } - - virtual ~AISCommand() - { - } - - void run_command() - { - mCommandFunc(); - } - - void setCommandFunc(command_func_type command_func) - { - mCommandFunc = command_func; - } - - // Need to do command-specific parsing to get an id here. May or - // may not need to bother, since most LLInventoryCallbacks do - // their work in the destructor. - virtual bool getResponseUUID(const LLSD& content, LLUUID& id) - { - return false; - } - - /* virtual */ void httpSuccess() - { - // Command func holds a reference to self, need to release it - // after a success or final failure. - setCommandFunc(no_op); - - const LLSD& content = getContent(); - if (!content.isMap()) - { - failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content); - return; - } - mRetryPolicy->onSuccess(); - - gInventory.onAISUpdateReceived("AISCommand", content); - - if (mCallback) - { - LLUUID item_id; // will default to null if parse fails. - getResponseUUID(content,item_id); - mCallback->fire(item_id); - } - } - - /*virtual*/ void httpFailure() + LLPointer<LLViewerInventoryItem> obj = gInventory.getItem(item_id); + LL_DEBUGS("Inventory") << "item_id: [" << item_id << "] name " << (obj ? obj->getName() : "(NOT FOUND)") << llendl; + if(obj) { - const LLSD& content = getContent(); - S32 status = getStatus(); - const std::string& reason = getReason(); - const LLSD& headers = getResponseHeaders(); - if (!content.isMap()) - { - LL_DEBUGS("Inventory") << "Malformed response contents " << content - << " status " << status << " reason " << reason << llendl; - } - else - { - LL_DEBUGS("Inventory") << "failed with content: " << ll_pretty_print_sd(content) - << " status " << status << " reason " << reason << llendl; - } - mRetryPolicy->onFailure(status, headers); - F32 seconds_to_wait; - if (mRetryPolicy->shouldRetry(seconds_to_wait)) + std::string cap; + if (AISCommand::getCap(cap)) { - doAfterInterval(boost::bind(&AISCommand::run_command,this),seconds_to_wait); + LLPointer<AISCommand> cmd_ptr = new UpdateItemCommand(item_id, updates, cb); + cmd_ptr->run_command(); } - else + else // no cap { - // Command func holds a reference to self, need to release it - // after a success or final failure. - setCommandFunc(no_op); - } - } + LLMessageSystem* msg = gMessageSystem; + msg->newMessageFast(_PREHASH_UpdateInventoryItem); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + msg->addUUIDFast(_PREHASH_TransactionID, obj->getTransactionID()); + msg->nextBlockFast(_PREHASH_InventoryData); + msg->addU32Fast(_PREHASH_CallbackID, 0); + obj->packUpdateMessage(msg, updates); + gAgent.sendReliableMessage(); - static bool getCap(std::string& cap) - { - if (gAgent.getRegion()) - { - cap = gAgent.getRegion()->getCapability("InventoryAPIv3"); - } - if (!cap.empty()) - { - return true; + gInventory.onItemUpdated(item_id, updates); + if (cb) + { + cb->fire(item_id); + } } - return false; } +} -private: - command_func_type mCommandFunc; - LLPointer<LLHTTPRetryPolicy> mRetryPolicy; - LLPointer<LLInventoryCallback> mCallback; -}; - -class RemoveItemCommand: public AISCommand +void update_inventory_category( + const LLUUID& cat_id, + const LLSD& updates, + LLPointer<LLInventoryCallback> cb) { -public: - RemoveItemCommand(const LLUUID& item_id, - LLPointer<LLInventoryCallback> callback): - AISCommand(callback) + LLPointer<LLViewerInventoryCategory> obj = gInventory.getCategory(cat_id); + LL_DEBUGS("Inventory") << "cat_id: [" << cat_id << "] name " << (obj ? obj->getName() : "(NOT FOUND)") << llendl; + if(obj) { - std::string cap; - if (!getCap(cap)) + if (LLFolderType::lookupIsProtectedType(obj->getPreferredType())) { - llwarns << "No cap found" << llendl; + LLNotificationsUtil::add("CannotModifyProtectedCategories"); return; } - std::string url = cap + std::string("/item/") + item_id.asString(); - LL_DEBUGS("Inventory") << "url: " << url << llendl; - LLHTTPClient::ResponderPtr responder = this; - LLSD headers; - F32 timeout = HTTP_REQUEST_EXPIRY_SECS; - command_func_type cmd = boost::bind(&LLHTTPClient::del, url, responder, headers, timeout); - setCommandFunc(cmd); - } -}; -class RemoveCategoryCommand: public AISCommand -{ -public: - RemoveCategoryCommand(const LLUUID& item_id, - LLPointer<LLInventoryCallback> callback): - AISCommand(callback) - { - std::string cap; - if (!getCap(cap)) + //std::string cap; + // FIXME - restore this once the back-end work has been done. + if (0) // if (AISCommand::getCap(cap)) { - llwarns << "No cap found" << llendl; - return; + LLPointer<AISCommand> cmd_ptr = new UpdateCategoryCommand(cat_id, updates, cb); + cmd_ptr->run_command(); } - std::string url = cap + std::string("/category/") + item_id.asString(); - LL_DEBUGS("Inventory") << "url: " << url << llendl; - LLHTTPClient::ResponderPtr responder = this; - LLSD headers; - F32 timeout = HTTP_REQUEST_EXPIRY_SECS; - command_func_type cmd = boost::bind(&LLHTTPClient::del, url, responder, headers, timeout); - setCommandFunc(cmd); - } -}; - -class PurgeDescendentsCommand: public AISCommand -{ -public: - PurgeDescendentsCommand(const LLUUID& item_id, - LLPointer<LLInventoryCallback> callback): - AISCommand(callback) - { - std::string cap; - if (!getCap(cap)) + else // no cap { - llwarns << "No cap found" << llendl; - return; + LLMessageSystem* msg = gMessageSystem; + msg->newMessageFast(_PREHASH_UpdateInventoryFolder); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + msg->nextBlockFast(_PREHASH_FolderData); + obj->packUpdateMessage(msg, updates); + gAgent.sendReliableMessage(); + + gInventory.onCategoryUpdated(cat_id, updates); + if (cb) + { + cb->fire(cat_id); + } } - std::string url = cap + std::string("/category/") + item_id.asString() + "/children"; - LL_DEBUGS("Inventory") << "url: " << url << llendl; - LLCurl::ResponderPtr responder = this; - LLSD headers; - F32 timeout = HTTP_REQUEST_EXPIRY_SECS; - command_func_type cmd = boost::bind(&LLHTTPClient::del, url, responder, headers, timeout); - setCommandFunc(cmd); } -}; +} void remove_inventory_item( const LLUUID& item_id, diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h index 4e24dc87d1..c52b0c2d9d 100755 --- a/indra/newview/llviewerinventory.h +++ b/indra/newview/llviewerinventory.h @@ -139,6 +139,8 @@ public: //void updateAssetOnServer() const; virtual void packMessage(LLMessageSystem* msg) const; + // Contents of updates will take precedence over fields of item where they differ. + void packUpdateMessage(LLMessageSystem* msg, const LLSD& updates) const; virtual void setTransactionID(const LLTransactionID& transaction_id); struct comparePointers { @@ -224,6 +226,8 @@ public: void determineFolderType(); void changeType(LLFolderType::EType new_folder_type); + void packUpdateMessage(LLMessageSystem* msg, const LLSD& updates) const; + private: friend class LLInventoryModel; void localizeName(); // intended to be called from the LLInventoryModel @@ -363,6 +367,16 @@ void move_inventory_item( const std::string& new_name, LLPointer<LLInventoryCallback> cb); +void update_inventory_item( + const LLUUID& item_id, + const LLSD& updates, + LLPointer<LLInventoryCallback> cb); + +void update_inventory_category( + const LLUUID& cat_id, + const LLSD& updates, + LLPointer<LLInventoryCallback> cb); + void remove_inventory_item( const LLUUID& item_id, LLPointer<LLInventoryCallback> cb); -- cgit v1.2.3 From 34d2cd03765b6b9b582035a933f4ec11fb262ff4 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Fri, 24 May 2013 15:51:33 -0400 Subject: SH-4207 WIP - use item updates with callback when updating link descriptions. Reworked updateAppearanceFromCOF() cof-validation stages. --- indra/newview/llappearancemgr.cpp | 96 ++++++++++++++++++++----------------- indra/newview/llappearancemgr.h | 12 +++-- indra/newview/llinventorymodel.cpp | 51 ++++---------------- indra/newview/llinventorymodel.h | 2 +- indra/newview/llviewerinventory.cpp | 6 ++- 5 files changed, 74 insertions(+), 93 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 14eed6e1df..83ad06a3c7 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -422,10 +422,12 @@ public: }; LLUpdateAppearanceOnDestroy::LLUpdateAppearanceOnDestroy(bool update_base_outfit_ordering, - bool enforce_item_restrictions): + bool enforce_item_restrictions, + bool enforce_ordering): mFireCount(0), mUpdateBaseOrder(update_base_outfit_ordering), - mEnforceItemRestrictions(enforce_item_restrictions) + mEnforceItemRestrictions(enforce_item_restrictions), + mEnforceOrdering(enforce_ordering) { selfStartPhase("update_appearance_on_destroy"); } @@ -449,7 +451,7 @@ LLUpdateAppearanceOnDestroy::~LLUpdateAppearanceOnDestroy() selfStopPhase("update_appearance_on_destroy"); - LLAppearanceMgr::instance().updateAppearanceFromCOF(mUpdateBaseOrder, mEnforceItemRestrictions); + LLAppearanceMgr::instance().updateAppearanceFromCOF(mUpdateBaseOrder, mEnforceItemRestrictions, mEnforceOrdering); } } @@ -1918,8 +1920,22 @@ void LLAppearanceMgr::findAllExcessOrDuplicateItems(const LLUUID& cat_id, -1, items_to_kill); } +void LLAppearanceMgr::enforceCOFItemRestrictions(LLPointer<LLInventoryCallback> cb) +{ + LLInventoryModel::item_array_t items_to_kill; + findAllExcessOrDuplicateItems(getCOF(), items_to_kill); + if (items_to_kill.size()>0) + { + // Remove duplicate or excess wearables. Should normally be enforced at the UI level, but + // this should catch anything that gets through. + removeAll(items_to_kill, cb); + return; + } +} + void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering, - bool enforce_item_restrictions) + bool enforce_item_restrictions, + bool enforce_ordering) { if (mIsInUpdateAppearanceFromCOF) { @@ -1927,35 +1943,37 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering, return; } - BoolSetter setIsInUpdateAppearanceFromCOF(mIsInUpdateAppearanceFromCOF); - selfStartPhase("update_appearance_from_cof"); - LL_DEBUGS("Avatar") << self_av_string() << "starting" << LL_ENDL; if (enforce_item_restrictions) { - LLInventoryModel::item_array_t items_to_kill; - findAllExcessOrDuplicateItems(getCOF(), items_to_kill); - if (items_to_kill.size()>0) - { - // The point here is just to call - // updateAppearanceFromCOF() again after excess items - // have been removed. That time we will set - // enforce_item_restrictions to false so we don't get - // caught in a perpetual loop. - LLPointer<LLInventoryCallback> cb( - new LLUpdateAppearanceOnDestroy(update_base_outfit_ordering, false)); - - // Remove duplicate or excess wearables. Should normally be enforced at the UI level, but - // this should catch anything that gets through. - removeAll(items_to_kill, cb); - return; - } + // The point here is just to call + // updateAppearanceFromCOF() again after excess items + // have been removed. That time we will set + // enforce_item_restrictions to false so we don't get + // caught in a perpetual loop. + LLPointer<LLInventoryCallback> cb( + new LLUpdateAppearanceOnDestroy(update_base_outfit_ordering, false, enforce_ordering)); + enforceCOFItemRestrictions(cb); + return; } - //checking integrity of the COF in terms of ordering of wearables, - //checking and updating links' descriptions of wearables in the COF (before analyzed for "dirty" state) - updateClothingOrderingInfo(LLUUID::null, update_base_outfit_ordering); + if (enforce_ordering) + { + //checking integrity of the COF in terms of ordering of wearables, + //checking and updating links' descriptions of wearables in the COF (before analyzed for "dirty" state) + + // As with enforce_item_restrictions handling above, we want + // to wait for the update callbacks, then (finally!) call + // updateAppearanceFromCOF() with no additional COF munging needed. + LLPointer<LLInventoryCallback> cb( + new LLUpdateAppearanceOnDestroy(false, false, false)); + updateClothingOrderingInfo(LLUUID::null, update_base_outfit_ordering, cb); + return; + } + + BoolSetter setIsInUpdateAppearanceFromCOF(mIsInUpdateAppearanceFromCOF); + selfStartPhase("update_appearance_from_cof"); // update dirty flag to see if the state of the COF matches // the saved outfit stored as a folder link @@ -1966,11 +1984,6 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering, { requestServerAppearanceUpdate(); } - // DRANO really should wait for the appearance message to set this. - // verify that deleting this line doesn't break anything. - //gAgentAvatarp->setIsUsingServerBakes(gAgent.getRegion() && gAgent.getRegion()->getCentralBakeVersion()); - - //dumpCat(getCOF(),"COF, start"); LLUUID current_outfit_id = getCOF(); @@ -2821,7 +2834,9 @@ struct WearablesOrderComparator U32 mControlSize; }; -void LLAppearanceMgr::updateClothingOrderingInfo(LLUUID cat_id, bool update_base_outfit_ordering) +void LLAppearanceMgr::updateClothingOrderingInfo(LLUUID cat_id, + bool update_base_outfit_ordering, + LLPointer<LLInventoryCallback> cb) { if (cat_id.isNull()) { @@ -2831,7 +2846,7 @@ void LLAppearanceMgr::updateClothingOrderingInfo(LLUUID cat_id, bool update_base const LLUUID base_outfit_id = getBaseOutfitUUID(); if (base_outfit_id.notNull()) { - updateClothingOrderingInfo(base_outfit_id,false); + updateClothingOrderingInfo(base_outfit_id,false,cb); } } } @@ -2843,7 +2858,6 @@ void LLAppearanceMgr::updateClothingOrderingInfo(LLUUID cat_id, bool update_base wearables_by_type_t items_by_type(LLWearableType::WT_COUNT); divvyWearablesByType(wear_items, items_by_type); - bool inventory_changed = false; for (U32 type = LLWearableType::WT_SHIRT; type < LLWearableType::WT_COUNT; type++) { @@ -2862,17 +2876,11 @@ void LLAppearanceMgr::updateClothingOrderingInfo(LLUUID cat_id, bool update_base std::string new_order_str = build_order_string((LLWearableType::EType)type, i); if (new_order_str == item->getActualDescription()) continue; - item->setDescription(new_order_str); - item->setComplete(TRUE); - item->updateServer(FALSE); - gInventory.updateItem(item); - - inventory_changed = true; + LLSD updates; + updates["desc"] = new_order_str; + update_inventory_item(item->getUUID(),updates,cb); } } - - //*TODO do we really need to notify observers? - if (inventory_changed) gInventory.notifyObservers(); } class RequestAgentUpdateAppearanceResponder: public LLHTTPClient::Responder diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index 2cc76c4b4c..246401ae85 100755 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -50,7 +50,8 @@ public: typedef std::vector<LLInventoryModel::item_array_t> wearables_by_type_t; void updateAppearanceFromCOF(bool update_base_outfit_ordering = false, - bool enforce_item_restrictions = true); + bool enforce_item_restrictions = true, + bool enforce_ordering = true); bool needToSaveCOF(); void updateCOF(const LLUUID& category, bool append = false); void wearInventoryCategory(LLInventoryCategory* category, bool copy, bool append); @@ -68,6 +69,7 @@ public: LLInventoryModel::item_array_t& items_to_kill); void findAllExcessOrDuplicateItems(const LLUUID& cat_id, LLInventoryModel::item_array_t& items_to_kill); + void enforceCOFItemRestrictions(LLPointer<LLInventoryCallback> cb); // Copy all items and the src category itself. void shallowCopyCategory(const LLUUID& src_id, const LLUUID& dst_id, @@ -190,7 +192,9 @@ public: //Check ordering information on wearables stored in links' descriptions and update if it is invalid // COF is processed if cat_id is not specified - void updateClothingOrderingInfo(LLUUID cat_id = LLUUID::null, bool update_base_outfit_ordering = false); + void updateClothingOrderingInfo(LLUUID cat_id = LLUUID::null, + bool update_base_outfit_ordering = false, + LLPointer<LLInventoryCallback> cb = NULL); bool isOutfitLocked() { return mOutfitLocked; } @@ -263,7 +267,8 @@ class LLUpdateAppearanceOnDestroy: public LLInventoryCallback { public: LLUpdateAppearanceOnDestroy(bool update_base_outfit_ordering = false, - bool enforce_item_restrictions = true); + bool enforce_item_restrictions = true, + bool enforce_ordering = true); virtual ~LLUpdateAppearanceOnDestroy(); /* virtual */ void fire(const LLUUID& inv_item); @@ -271,6 +276,7 @@ private: U32 mFireCount; bool mUpdateBaseOrder; bool mEnforceItemRestrictions; + bool mEnforceOrdering; }; class LLUpdateAppearanceAndEditWearableOnDestroy: public LLInventoryCallback diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 06c614aeaa..38fa3c36e3 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1213,7 +1213,7 @@ void LLInventoryModel::onAISUpdateReceived(const std::string& context, const LLS { changes["desc"] = update["desc"]; } - onItemUpdated(item_id,changes); + onItemUpdated(item_id,changes,true); } else if (cat) { @@ -1245,7 +1245,7 @@ void LLInventoryModel::onAISUpdateReceived(const std::string& context, const LLS } -void LLInventoryModel::onItemUpdated(const LLUUID& item_id, const LLSD& updates) +void LLInventoryModel::onItemUpdated(const LLUUID& item_id, const LLSD& updates, bool update_parent_version) { U32 mask = LLInventoryObserver::NONE; @@ -1275,6 +1275,12 @@ void LLInventoryModel::onItemUpdated(const LLUUID& item_id, const LLSD& updates) } mask |= LLInventoryObserver::INTERNAL; addChangedMask(mask, item->getUUID()); + if (update_parent_version) + { + // Descendent count is unchanged, but folder version incremented. + LLInventoryModel::LLCategoryUpdate up(item->getParentUUID(), 0); + accountForUpdate(up); + } gInventory.notifyObservers(); // do we want to be able to make this optional? } } @@ -1852,47 +1858,6 @@ void LLInventoryModel::accountForUpdate( } } - -/* -void LLInventoryModel::incrementCategoryVersion(const LLUUID& category_id) -{ - LLViewerInventoryCategory* cat = getCategory(category_id); - if(cat) - { - S32 version = cat->getVersion(); - if(LLViewerInventoryCategory::VERSION_UNKNOWN != version) - { - cat->setVersion(version + 1); - llinfos << "IncrementVersion: " << cat->getName() << " " - << cat->getVersion() << llendl; - } - else - { - llinfos << "Attempt to increment version when unknown: " - << category_id << llendl; - } - } - else - { - llinfos << "Attempt to increment category: " << category_id << llendl; - } -} -void LLInventoryModel::incrementCategorySetVersion( - const std::set<LLUUID>& categories) -{ - if(!categories.empty()) - { - std::set<LLUUID>::const_iterator it = categories.begin(); - std::set<LLUUID>::const_iterator end = categories.end(); - for(; it != end; ++it) - { - incrementCategoryVersion(*it); - } - } -} -*/ - - LLInventoryModel::EHasChildren LLInventoryModel::categoryHasChildren( const LLUUID& cat_id) const { diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index 515c99c0b4..fd2481b531 100755 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -340,7 +340,7 @@ public: void onDescendentsPurgedFromServer(const LLUUID& object_id, bool fix_broken_links = true); // Update model after an existing item gets updated on server. - void onItemUpdated(const LLUUID& item_id, const LLSD& updates); + void onItemUpdated(const LLUUID& item_id, const LLSD& updates, bool update_parent_version); // Update model after an existing category gets updated on server. void onCategoryUpdated(const LLUUID& cat_id, const LLSD& updates); diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 90fef3b5ed..62bcfd20a7 100755 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -726,7 +726,9 @@ void LLViewerInventoryItem::packUpdateMessage(LLMessageSystem* msg, const LLSD& } if (updates.has("desc")) { - msg->addStringFast(_PREHASH_Description, updates["desc"].asString()); + std::string new_desc = updates["desc"].asString(); + LLInventoryItem::correctInventoryDescription(new_desc); + msg->addStringFast(_PREHASH_Description, new_desc); } else { @@ -1461,7 +1463,7 @@ void update_inventory_item( obj->packUpdateMessage(msg, updates); gAgent.sendReliableMessage(); - gInventory.onItemUpdated(item_id, updates); + gInventory.onItemUpdated(item_id, updates,false); if (cb) { cb->fire(item_id); -- cgit v1.2.3 From c498f53d9ab02a41886b55762883d116801fd39b Mon Sep 17 00:00:00 2001 From: "prep@lindenlab.com" <prep@lindenlab.com> Date: Tue, 28 May 2013 11:51:11 -0500 Subject: Sh-4035: Updated implementation according to new specs. Fixed a couple of outstanding bugs. --- indra/newview/llfloatersidepanelcontainer.cpp | 13 ++- indra/newview/llfloatersidepanelcontainer.h | 3 + indra/newview/llsidepanelappearance.cpp | 125 ++++++++++++--------- indra/newview/llsidepanelappearance.h | 14 ++- .../newview/skins/default/xui/en/notifications.xml | 30 ++++- 5 files changed, 122 insertions(+), 63 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloatersidepanelcontainer.cpp b/indra/newview/llfloatersidepanelcontainer.cpp index d5bb8157cf..13a9ba1695 100755 --- a/indra/newview/llfloatersidepanelcontainer.cpp +++ b/indra/newview/llfloatersidepanelcontainer.cpp @@ -70,7 +70,16 @@ void LLFloaterSidePanelContainer::onOpen(const LLSD& key) { getChild<LLPanel>(sMainPanelName)->onOpen(key); } - +void LLFloaterSidePanelContainer::onClose(bool app_quitting) +{ + mForceCloseAfterVerify = true; + LLSidepanelAppearance* panel = getSidePanelAppearance(); + if ( panel ) + { + panel->mRevertSet = true; + panel->onCloseFromAppearance( this ); + } +} void LLFloaterSidePanelContainer::onClickCloseBtn() { LLSidepanelAppearance* panel = getSidePanelAppearance(); @@ -127,7 +136,7 @@ void LLFloaterSidePanelContainer::showPanel(const std::string& floater_name, con { if ( panel->checkForDirtyEdits() ) { - panel->onClickConfirmExitWithoutSaveIntoAppearance(); + panel->onClickConfirmExitWithoutSaveIntoAppearance( floaterp ); } else { diff --git a/indra/newview/llfloatersidepanelcontainer.h b/indra/newview/llfloatersidepanelcontainer.h index 974934b48f..dc85570f7e 100755 --- a/indra/newview/llfloatersidepanelcontainer.h +++ b/indra/newview/llfloatersidepanelcontainer.h @@ -44,6 +44,8 @@ class LLSidepanelAppearance; */ class LLFloaterSidePanelContainer : public LLFloater { + friend class LLSidePanelAppearance; + private: static const std::string sMainPanelName; @@ -52,6 +54,7 @@ public: ~LLFloaterSidePanelContainer(); /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ void onClose(bool app_quitting); /*virtual*/ void onClickCloseBtn(); /*virtual*/ BOOL postBuild(); void onConfirmationClose( const LLSD &confirm ); diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp index 858ed06544..70da576c83 100755 --- a/indra/newview/llsidepanelappearance.cpp +++ b/indra/newview/llsidepanelappearance.cpp @@ -50,6 +50,7 @@ #include "llviewerwearable.h" #include "llnotificationsutil.h" #include "llfloatersidepanelcontainer.h" +#include "llviewerfoldertype.h" static LLRegisterPanelClassWrapper<LLSidepanelAppearance> t_appearance("sidepanel_appearance"); @@ -85,58 +86,86 @@ bool LLSidepanelAppearance::callBackExitWithoutSaveViaBack(const LLSD& notificat return false; } -bool LLSidepanelAppearance::callBackExitWithoutSaveViaClose(const LLSD& notification, const LLSD& response) +void LLSidepanelAppearance::onCloseFromAppearance(LLFloaterSidePanelContainer* obj) { - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - if ( option == 0 ) - { - //revert current edits - mEditWearable->revertChanges(); - //LLAppearanceMgr::getInstance()->wearBaseOutfit(); - toggleWearableEditPanel(FALSE); - LLVOAvatarSelf::onCustomizeEnd( FALSE ); - mLLFloaterSidePanelContainer->close(); - return true; - } - return false; -} - -void LLSidepanelAppearance::onClickConfirmExitWithoutSaveViaClose() -{ - if ( LLAppearanceMgr::getInstance()->isOutfitDirty() && !LLAppearanceMgr::getInstance()->isOutfitLocked() ) + mLLFloaterSidePanelContainer = obj; + if ( mEditWearable->isAvailable() && mEditWearable->isDirty() ) { LLSidepanelAppearance* pSelf = (LLSidepanelAppearance *)this; LLNotificationsUtil::add("ConfirmExitWithoutSave", LLSD(), LLSD(), boost::bind(&LLSidepanelAppearance::callBackExitWithoutSaveViaClose,pSelf,_1,_2) ); } else - { - showOutfitsInventoryPanel(); + { + LLVOAvatarSelf::onCustomizeEnd(FALSE); + toggleWearableEditPanel(FALSE); + mLLFloaterSidePanelContainer->mForceCloseAfterVerify=false; } } - - -bool LLSidepanelAppearance::callBackExitWithoutSaveIntoAppearance(const LLSD& notification, const LLSD& response) +bool LLSidepanelAppearance::onSaveCommit(const LLSD& notification, const LLSD& response) { S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (0 == option) + { + std::string outfit_name = response["message"].asString(); + LLStringUtil::trim(outfit_name); + std::string current_outfit_name; + + LLAppearanceMgr::getInstance()->getBaseOutfitName(current_outfit_name); + + if ( current_outfit_name == outfit_name ) + { + LLAppearanceMgr::getInstance()->updateBaseOutfit(); + } + else + { + LLUUID outfit_folder = LLAppearanceMgr::getInstance()->makeNewOutfitLinks( outfit_name,FALSE ); + } + + LLVOAvatarSelf::onCustomizeEnd( FALSE ); + mLLFloaterSidePanelContainer->close(); + } + + return false; +} +bool LLSidepanelAppearance::callBackExitWithoutSaveViaClose(const LLSD& notification, const LLSD& response) +{ S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if ( option == 0 ) { - //revert current edits - mEditWearable->revertChanges(); - toggleWearableEditPanel(FALSE); + std::string outfit_name; + if (!LLAppearanceMgr::getInstance()->getBaseOutfitName(outfit_name)) + { + outfit_name = LLViewerFolderType::lookupNewCategoryName(LLFolderType::FT_OUTFIT); + } + + LLSD args; + args["DESC"] = outfit_name; + + LLSD payload; + LLNotificationsUtil::add("SaveOutfitEither", args, payload, boost::bind(&LLSidepanelAppearance::onSaveCommit, this, _1, _2)); + showOutfitEditPanel(); + return false; + } + else if ( option == 1 ) + { + mEditWearable->revertChanges(); + toggleWearableEditPanel(FALSE); + showOutfitEditPanel(); LLVOAvatarSelf::onCustomizeEnd( FALSE ); - //mLLFloaterSidePanelContainer->close(); - showOutfitsInventoryPanel(); - return true; + mRevertSet = true; + return false; } + mLLFloaterSidePanelContainer->mForceCloseAfterVerify = false; + //mRevertSet = true; return false; } -void LLSidepanelAppearance::onClickConfirmExitWithoutSaveIntoAppearance() +void LLSidepanelAppearance::onClickConfirmExitWithoutSaveIntoAppearance( LLFloaterSidePanelContainer* obj ) { - if ( LLAppearanceMgr::getInstance()->isOutfitDirty() && !LLAppearanceMgr::getInstance()->isOutfitLocked() ) + mLLFloaterSidePanelContainer = obj; + if ( LLAppearanceMgr::getInstance()->isOutfitDirty() || mEditWearable->isDirty() ) { LLSidepanelAppearance* pSelf = (LLSidepanelAppearance *)this; - LLNotificationsUtil::add("ConfirmExitWithoutSave", LLSD(), LLSD(), boost::bind(&LLSidepanelAppearance::callBackExitWithoutSaveIntoAppearance,pSelf,_1,_2) ); + LLNotificationsUtil::add("ConfirmExitWithoutSave", LLSD(), LLSD(), boost::bind(&LLSidepanelAppearance::callBackExitWithoutSaveViaClose,pSelf,_1,_2) ); } else { @@ -145,33 +174,19 @@ void LLSidepanelAppearance::onClickConfirmExitWithoutSaveIntoAppearance() } void LLSidepanelAppearance::onClickConfirmExitWithoutSaveViaBack() { - /* - if ( LLAppearanceMgr::getInstance()->isOutfitDirty() && !mSidePanelJustOpened && !LLAppearanceMgr::getInstance()->isOutfitLocked() ) - { - LLSidepanelAppearance* pSelf = (LLSidepanelAppearance *)this; - LLNotificationsUtil::add("ConfirmExitWithoutSave", LLSD(), LLSD(), boost::bind(&LLSidepanelAppearance::callBackExitWithoutSaveViaBack,pSelf,_1,_2) ); - } - else - */ - { - showOutfitsInventoryPanel(); - } + showOutfitsInventoryPanel(); } void LLSidepanelAppearance::onClose(LLFloaterSidePanelContainer* obj) -{ - mLLFloaterSidePanelContainer = obj; - if ( /*LLAppearanceMgr::getInstance()->isOutfitDirty() && */ - /*!LLAppearanceMgr::getInstance()->isOutfitLocked() ||*/ - ( mEditWearable->isAvailable() && mEditWearable->isDirty() ) ) +{ mLLFloaterSidePanelContainer = obj; + if ( mEditWearable->isAvailable() && mEditWearable->isDirty() ) { LLSidepanelAppearance* pSelf = (LLSidepanelAppearance *)this; LLNotificationsUtil::add("ConfirmExitWithoutSave", LLSD(), LLSD(), boost::bind(&LLSidepanelAppearance::callBackExitWithoutSaveViaClose,pSelf,_1,_2) ); } else - { + { LLVOAvatarSelf::onCustomizeEnd(FALSE); - toggleWearableEditPanel(FALSE); mLLFloaterSidePanelContainer->close(); } } @@ -183,7 +198,8 @@ LLSidepanelAppearance::LLSidepanelAppearance() : mOutfitEdit(NULL), mCurrOutfitPanel(NULL), mOpened(false), - mSidePanelJustOpened(true) + mSidePanelJustOpened(true), + mRevertSet(false) { LLOutfitObserver& outfit_observer = LLOutfitObserver::instance(); outfit_observer.addBOFReplacedCallback(boost::bind(&LLSidepanelAppearance::refreshCurrentOutfitName, this, "")); @@ -264,11 +280,15 @@ void LLSidepanelAppearance::onOpen(const LLSD& key) { // No specific panel requested. // If we're opened for the first time then show My Outfits. - // Else do nothing. + // Else show outfit edit panel if (!mOpened) { showOutfitsInventoryPanel(); } + else + { + showOutfitEditPanel(); + } } else { @@ -665,3 +685,4 @@ bool LLSidepanelAppearance::checkForDirtyEdits() { return ( mEditWearable->isDirty() ) ? true : false; } + diff --git a/indra/newview/llsidepanelappearance.h b/indra/newview/llsidepanelappearance.h index caf5be62e9..5042e92f4b 100755 --- a/indra/newview/llsidepanelappearance.h +++ b/indra/newview/llsidepanelappearance.h @@ -50,7 +50,8 @@ public: /*virtual*/ BOOL postBuild(); /*virtual*/ void onOpen(const LLSD& key); - void onClose(LLFloaterSidePanelContainer* obj); + /*virtual*/ void onClose(LLFloaterSidePanelContainer* obj); + void onClickCloseBtn(); void refreshCurrentOutfitName(const std::string& name = ""); @@ -72,10 +73,9 @@ public: bool callBackExitWithoutSaveViaBack(const LLSD& notification, const LLSD& response); void onClickConfirmExitWithoutSaveViaBack(); bool callBackExitWithoutSaveViaClose(const LLSD& notification, const LLSD& response); - void onClickConfirmExitWithoutSaveViaClose(); bool checkForDirtyEdits(); - bool callBackExitWithoutSaveIntoAppearance(const LLSD& notification, const LLSD& response); - void onClickConfirmExitWithoutSaveIntoAppearance(); + void onClickConfirmExitWithoutSaveIntoAppearance(LLFloaterSidePanelContainer* obj); + void onCloseFromAppearance(LLFloaterSidePanelContainer* obj); private: void onFilterEdit(const std::string& search_string); @@ -88,6 +88,9 @@ private: void toggleOutfitEditPanel(BOOL visible, BOOL disable_camera_switch = FALSE); void toggleWearableEditPanel(BOOL visible, LLViewerWearable* wearable = NULL, BOOL disable_camera_switch = FALSE); + + bool onSaveCommit(const LLSD& notification, const LLSD& response); + LLFilterEditor* mFilterEditor; LLPanelOutfitsInventory* mPanelOutfitsInventory; LLPanelOutfitEdit* mOutfitEdit; @@ -115,6 +118,9 @@ private: bool mSidePanelJustOpened; LLFloaterSidePanelContainer* mLLFloaterSidePanelContainer; +public: + + bool mRevertSet; }; #endif //LL_LLSIDEPANELAPPEARANCE_H diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 07c8ecc4dd..860dabdcc8 100755 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -10118,13 +10118,33 @@ Cannot create large prims that intersect other players. Please re-try when othe icon="alertmodal.tga" name="ConfirmExitWithoutSave" type="alertmodal"> - Closing this window will discard any changes you have made. + You have not saved the changes to your outfit. Would you like to save it now? <tag>confirm</tag> <usetemplate - name="okcancelignore" - notext="Cancel" - yestext="OK" - ignoretext="Don't show me this again."/> + name="yesnocancelbuttons" + notext="Revert" + yestext="Yes" + canceltext="Dismiss"/> + </notification> + + <notification + icon="alertmodal.tga" + label="Save Outfit" + name="SaveOutfitEither" + type="alertmodal"> + <unique/> + Save outfit (defaults to current outfit): + <tag>confirm</tag> + <form name="form"> + <input name="message" type="text"> + [DESC] + </input> + <button + default="true" + index="0" + name="OK" + text="Save"/> + </form> </notification> </notifications> -- cgit v1.2.3 From faaf8ba5c75c925d9922dda8ce43293222cadb3b Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Wed, 29 May 2013 14:54:59 -0400 Subject: SH-4222 FIX, SH-3635 WIP - start of stuck-appearance checker, always increment folder version when a contained item is updated. --- indra/newview/llagentwearables.cpp | 1 + indra/newview/llagentwearables.h | 2 ++ indra/newview/llappearancemgr.cpp | 6 ++++++ indra/newview/llappearancemgr.h | 2 ++ indra/newview/llviewerinventory.cpp | 2 +- indra/newview/llvoavatar.cpp | 2 +- indra/newview/llvoavatarself.cpp | 16 ++++++++++++++++ indra/newview/llvoavatarself.h | 1 + 8 files changed, 30 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index b4c3e33e0e..80c8364223 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -1897,6 +1897,7 @@ bool LLAgentWearables::changeInProgress() const void LLAgentWearables::notifyLoadingStarted() { mCOFChangeInProgress = true; + mCOFChangeTimer.reset(); mLoadingStartedSignal(); } diff --git a/indra/newview/llagentwearables.h b/indra/newview/llagentwearables.h index 5be4648636..0adf545aab 100755 --- a/indra/newview/llagentwearables.h +++ b/indra/newview/llagentwearables.h @@ -77,6 +77,7 @@ public: BOOL isWearableCopyable(LLWearableType::EType type, U32 index /*= 0*/) const; BOOL areWearablesLoaded() const; bool isCOFChangeInProgress() const { return mCOFChangeInProgress; } + F32 getCOFChangeTime() const { return mCOFChangeTimer.getElapsedTimeF32(); } void updateWearablesLoaded(); void checkWearablesLoaded() const; bool canMoveWearable(const LLUUID& item_id, bool closer_to_body) const; @@ -237,6 +238,7 @@ private: * True if agent's outfit is being changed now. */ BOOL mCOFChangeInProgress; + LLTimer mCOFChangeTimer; //-------------------------------------------------------------------------------- // Support classes diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 83ad06a3c7..30b6169b46 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -547,6 +547,7 @@ public: bool isMostRecent(); void handleLateArrivals(); void resetTime(F32 timeout); + static S32 countActive() { return sActiveHoldingPatterns.size(); } private: found_list_t mFoundList; @@ -1836,6 +1837,11 @@ void LLAppearanceMgr::updateAgentWearables(LLWearableHoldingPattern* holder, boo } } +S32 LLAppearanceMgr::countActiveHoldingPatterns() +{ + return LLWearableHoldingPattern::countActive(); +} + static void remove_non_link_items(LLInventoryModel::item_array_t &items) { LLInventoryModel::item_array_t pruned_items; diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index 246401ae85..3fb470ef14 100755 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -120,6 +120,8 @@ public: void updateAgentWearables(LLWearableHoldingPattern* holder, bool append); + S32 countActiveHoldingPatterns(); + // For debugging - could be moved elsewhere. void dumpCat(const LLUUID& cat_id, const std::string& msg); void dumpItemArray(const LLInventoryModel::item_array_t& items, const std::string& msg); diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 62bcfd20a7..465a49d004 100755 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -1463,7 +1463,7 @@ void update_inventory_item( obj->packUpdateMessage(msg, updates); gAgent.sendReliableMessage(); - gInventory.onItemUpdated(item_id, updates,false); + gInventory.onItemUpdated(item_id, updates,true); if (cb) { cb->fire(item_id); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 8e7bed39c4..6df5fab42b 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -6023,7 +6023,7 @@ void LLVOAvatar::startPhase(const std::string& phase_name) return; } } - LL_DEBUGS("Avatar") << "started phase " << phase_name << llendl; + LL_DEBUGS("Avatar") << avString() << " started phase " << phase_name << llendl; getPhases().startPhase(phase_name); } diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 52c44e6e1b..5b6fcc5d27 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -234,6 +234,22 @@ void LLVOAvatarSelf::initInstance() //doPeriodically(output_self_av_texture_diagnostics, 30.0); doPeriodically(update_avatar_rez_metrics, 5.0); doPeriodically(check_for_unsupported_baked_appearance, 120.0); + doPeriodically(boost::bind(&LLVOAvatarSelf::checkStuckAppearance, this), 30.0); +} + +bool LLVOAvatarSelf::checkStuckAppearance() +{ + if (gAgentWearables.isCOFChangeInProgress()) + { + LL_DEBUGS("Avatar") << "checking for stuck appearance" << llendl; + F32 change_time = gAgentWearables.getCOFChangeTime(); + LL_DEBUGS("Avatar") << "change in progress for " << change_time << " seconds" << llendl; + S32 active_hp = LLAppearanceMgr::instance().countActiveHoldingPatterns(); + LL_DEBUGS("Avatar") << "active holding patterns " << active_hp << " seconds" << llendl; + } + + // Return false to continue running check periodically. + return LLApp::isExiting(); } // virtual diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index 3b7b6bac64..e8b9a25327 100755 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -138,6 +138,7 @@ public: public: /*virtual*/ BOOL updateCharacter(LLAgent &agent); /*virtual*/ void idleUpdateTractorBeam(); + bool checkStuckAppearance(); //-------------------------------------------------------------------- // Loading state -- cgit v1.2.3 From 7f2cf1fa9cf7c09af8eeab3aa077eb0a9922d631 Mon Sep 17 00:00:00 2001 From: Nyx Linden <nyx@lindenlab.com> Date: Thu, 30 May 2013 17:44:51 -0400 Subject: SH-4147 FIX Macro avatar hover gets reset on relog Hover minimum enforcement was getting triggered on relog for macro avatars before the joint offsets were applied when loading the avatar. Added code to verify that all attachments in COF have been rezzed, and all attached objects are not in the process of being rebuilt to the enforcement code. This should verify that we only apply the hover value enforcement when all rigged meshes are actually loaded before enforcing minimum hover value --- indra/newview/llappearancemgr.cpp | 9 +++++++ indra/newview/llappearancemgr.h | 2 ++ indra/newview/llviewerobject.cpp | 22 +++++++++++++++ indra/newview/llviewerobject.h | 1 + indra/newview/llvoavatar.cpp | 56 ++++++++++++++++++++++++++++++++------- 5 files changed, 80 insertions(+), 10 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 30b6169b46..d817f10aee 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -3250,6 +3250,15 @@ void LLAppearanceMgr::incrementCofVersion(LLHTTPClient::ResponderPtr responder_p LLHTTPClient::get(url, body, responder_ptr, headers, 30.0f); } +U32 LLAppearanceMgr::getNumAttachmentsInCOF() +{ + const LLUUID cof = getCOF(); + LLInventoryModel::item_array_t obj_items; + getDescendentsOfAssetType(cof, obj_items, LLAssetType::AT_OBJECT); + return obj_items.size(); +} + + std::string LLAppearanceMgr::getAppearanceServiceURL() const { if (gSavedSettings.getString("DebugAvatarAppearanceServiceURLOverride").empty()) diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index 3fb470ef14..b63e883426 100755 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -206,6 +206,8 @@ public: void incrementCofVersion(LLHTTPClient::ResponderPtr responder_ptr = NULL); + U32 getNumAttachmentsInCOF(); + // *HACK Remove this after server side texture baking is deployed on all sims. void incrementCofVersionLegacy(); diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 064e96e394..63de1ab77a 100755 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -5038,6 +5038,28 @@ void LLViewerObject::clearDrawableState(U32 state, BOOL recursive) } } +BOOL LLViewerObject::isDrawableState(U32 state, BOOL recursive) const +{ + BOOL matches = FALSE; + if (mDrawable) + { + matches = mDrawable->isState(state); + } + if (recursive) + { + for (child_list_t::const_iterator iter = mChildList.begin(); + (iter != mChildList.end()) && matches; iter++) + { + LLViewerObject* child = *iter; + matches &= child->isDrawableState(state, recursive); + } + } + + return matches; +} + + + //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! // RN: these functions assume a 2-level hierarchy //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index 316dbce7d0..0390cbc5b0 100755 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -394,6 +394,7 @@ public: void setDrawableState(U32 state, BOOL recursive = TRUE); void clearDrawableState(U32 state, BOOL recursive = TRUE); + BOOL isDrawableState(U32 state, BOOL recursive = TRUE) const; // Called when the drawable shifts virtual void onShift(const LLVector4a &shift_vector) { } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 6df5fab42b..310ff47cf5 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5220,24 +5220,60 @@ void LLVOAvatar::computeBodySize() LLAvatarAppearance::computeBodySize(); // Certain configurations of avatars can force the overall height (with offset) to go negative. - // Enforce a constraint to make sure we don't go below 0.1 meters. + // Enforce a constraint to make sure we don't go below 1.1 meters (server-enforced limit) // Camera positioning and other things start to break down when your avatar is "walking" while being fully underground + const LLViewerObject * last_object = NULL; if (isSelf() && getWearableData() && isFullyLoaded() && !LLApp::isQuitting()) { - LLViewerWearable* shape = (LLViewerWearable*)getWearableData()->getWearable(LLWearableType::WT_SHAPE, 0); - if (shape && !shape->getVolitile()) + // Do not force a hover parameter change while we have pending attachments, which may be mesh-based with + // joint offsets. + if (LLAppearanceMgr::instance().getNumAttachmentsInCOF() == getNumAttachments()) { - F32 hover_value = shape->getVisualParamWeight(AVATAR_HOVER); - if (hover_value < 0.0f && (mBodySize.mV[VZ] + hover_value < 1.1f)) + LLViewerWearable* shape = (LLViewerWearable*)getWearableData()->getWearable(LLWearableType::WT_SHAPE, 0); + BOOL loaded = TRUE; + for (attachment_map_t::const_iterator points_iter = mAttachmentPoints.begin(); + points_iter != mAttachmentPoints.end() && loaded; + ++points_iter) { - hover_value = -(mBodySize.mV[VZ] - 1.1f); // avoid floating point rounding making the above check continue to fail. - llassert(mBodySize.mV[VZ] + hover_value >= 1.1f); + const LLViewerJointAttachment *attachment_pt = (*points_iter).second; + if (attachment_pt) + { + for (LLViewerJointAttachment::attachedobjs_vec_t::const_iterator attach_iter = attachment_pt->mAttachedObjects.begin(); attach_iter != attachment_pt->mAttachedObjects.end(); attach_iter++) + { + const LLViewerObject* object = (LLViewerObject*)*attach_iter; + if (object) + { + last_object = object; + llwarns << "attachment at point: " << (*points_iter).first << " object exists: " << object->getAttachmentItemID() << llendl; + loaded &=!object->isDrawableState(LLDrawable::REBUILD_ALL); + if (!loaded && shape && !shape->getVolitile()) + { + llwarns << "caught unloaded attachment! skipping enforcement" << llendl; + } + } + } + } + } - hover_value = llmin(hover_value, 0.0f); // don't force the hover value to be greater than 0. + if (last_object) + { + LL_DEBUGS("Avatar") << "scanned at least one object!" << LL_ENDL; + } + if (loaded && shape && !shape->getVolitile()) + { + F32 hover_value = shape->getVisualParamWeight(AVATAR_HOVER); + if (hover_value < 0.0f && (mBodySize.mV[VZ] + hover_value < 1.1f)) + { + hover_value = -(mBodySize.mV[VZ] - 1.1f); // avoid floating point rounding making the above check continue to fail. + llassert(mBodySize.mV[VZ] + hover_value >= 1.1f); + + hover_value = llmin(hover_value, 0.0f); // don't force the hover value to be greater than 0. - mAvatarOffset.mV[VZ] = hover_value; - shape->setVisualParamWeight(AVATAR_HOVER,hover_value, FALSE); + LL_DEBUGS("Avatar") << "changed hover value to: " << hover_value << " from: " << mAvatarOffset.mV[VZ] << LL_ENDL; + mAvatarOffset.mV[VZ] = hover_value; + shape->setVisualParamWeight(AVATAR_HOVER,hover_value, FALSE); + } } } } -- cgit v1.2.3 From 9552f733ef0b581158665a1a464b5be7d4bada2a Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Fri, 31 May 2013 13:54:32 -0400 Subject: SH-3635 WIP --- indra/newview/llappearancemgr.cpp | 18 ++++++++++++++++++ indra/newview/llappearancemgr.h | 2 ++ indra/newview/llviewerregion.cpp | 2 +- indra/newview/llviewerstats.cpp | 40 ++++++++++++++------------------------- indra/newview/llviewerstats.h | 5 ++--- indra/newview/llvoavatar.cpp | 18 ++++++++++++------ indra/newview/llvoavatarself.cpp | 3 ++- 7 files changed, 51 insertions(+), 37 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 30b6169b46..2288f633f4 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -397,6 +397,12 @@ public: LLCallAfterInventoryBatchMgr(dst_cat_id, phase_name, on_completion_func, on_failure_func, retry_after, max_retries) { addItems(src_items); + sInstanceCount++; + } + + ~LLCallAfterInventoryCopyMgr() + { + sInstanceCount--; } virtual bool requestOperation(const LLUUID& item_id) @@ -419,8 +425,15 @@ public: ); return true; } + + static S32 getInstanceCount() { return sInstanceCount; } + +private: + static S32 sInstanceCount; }; +S32 LLCallAfterInventoryCopyMgr::sInstanceCount = 0; + LLUpdateAppearanceOnDestroy::LLUpdateAppearanceOnDestroy(bool update_base_outfit_ordering, bool enforce_item_restrictions, bool enforce_ordering): @@ -2154,6 +2167,11 @@ void LLAppearanceMgr::wearInventoryCategory(LLInventoryCategory* category, bool category->getUUID(), copy, append)); } +S32 LLAppearanceMgr::getActiveCopyOperations() const +{ + return LLCallAfterInventoryCopyMgr::getInstanceCount(); +} + void LLAppearanceMgr::wearCategoryFinal(LLUUID& cat_id, bool copy_items, bool append) { LL_INFOS("Avatar") << self_av_string() << "starting" << LL_ENDL; diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index 3fb470ef14..4679ceaf57 100755 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -71,6 +71,8 @@ public: LLInventoryModel::item_array_t& items_to_kill); void enforceCOFItemRestrictions(LLPointer<LLInventoryCallback> cb); + S32 getActiveCopyOperations() const; + // Copy all items and the src category itself. void shallowCopyCategory(const LLUUID& src_id, const LLUUID& dst_id, LLPointer<LLInventoryCallback> cb); diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index e77b29aca4..b635087d66 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -1877,7 +1877,7 @@ std::string LLViewerRegion::getCapability(const std::string& name) const { if (!capabilitiesReceived() && (name!=std::string("Seed")) && (name!=std::string("ObjectMedia"))) { - llwarns << "getCapability called before caps received" << llendl; + llwarns << "getCapability called before caps received for " << name << llendl; } CapabilityMap::const_iterator iter = mImpl->mCapabilities.find(name); diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index b73411080a..68633fba6e 100755 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -734,44 +734,28 @@ void send_stats() LLHTTPClient::post(url, body, new ViewerStatsResponder()); } -LLFrameTimer& LLViewerStats::PhaseMap::getPhaseTimer(const std::string& phase_name) +LLTimer& LLViewerStats::PhaseMap::getPhaseTimer(const std::string& phase_name) { phase_map_t::iterator iter = mPhaseMap.find(phase_name); if (iter == mPhaseMap.end()) { - LLFrameTimer timer; + LLTimer timer; mPhaseMap[phase_name] = timer; } - LLFrameTimer& timer = mPhaseMap[phase_name]; + LLTimer& timer = mPhaseMap[phase_name]; return timer; } void LLViewerStats::PhaseMap::startPhase(const std::string& phase_name) { - LLFrameTimer& timer = getPhaseTimer(phase_name); - lldebugs << "startPhase " << phase_name << llendl; - timer.unpause(); -} - -void LLViewerStats::PhaseMap::stopAllPhases() -{ - for (phase_map_t::iterator iter = mPhaseMap.begin(); - iter != mPhaseMap.end(); ++iter) - { - const std::string& phase_name = iter->first; - if (iter->second.getStarted()) - { - // Going from started to paused state - record stats. - recordPhaseStat(phase_name,iter->second.getElapsedTimeF32()); - } - lldebugs << "stopPhase (all) " << phase_name << llendl; - iter->second.pause(); - } + LLTimer& timer = getPhaseTimer(phase_name); + timer.start(); + LL_DEBUGS("Avatar") << "startPhase " << phase_name << llendl; } void LLViewerStats::PhaseMap::clearPhases() { - lldebugs << "clearPhases" << llendl; + LL_DEBUGS("Avatar") << "clearPhases" << llendl; mPhaseMap.clear(); } @@ -796,7 +780,6 @@ LLViewerStats::PhaseMap::PhaseMap() { } - void LLViewerStats::PhaseMap::stopPhase(const std::string& phase_name) { phase_map_t::iterator iter = mPhaseMap.find(phase_name); @@ -809,6 +792,7 @@ void LLViewerStats::PhaseMap::stopPhase(const std::string& phase_name) } } } + // static LLViewerStats::StatsAccumulator& LLViewerStats::PhaseMap::getPhaseStats(const std::string& phase_name) { @@ -832,14 +816,18 @@ void LLViewerStats::PhaseMap::recordPhaseStat(const std::string& phase_name, F32 bool LLViewerStats::PhaseMap::getPhaseValues(const std::string& phase_name, F32& elapsed, bool& completed) { phase_map_t::iterator iter = mPhaseMap.find(phase_name); + bool found = false; if (iter != mPhaseMap.end()) { + found = true; elapsed = iter->second.getElapsedTimeF32(); completed = !iter->second.getStarted(); - return true; + LL_DEBUGS("Avatar") << " phase_name " << phase_name << " elapsed " << elapsed << " completed " << completed << " timer addr " << (S32)(&iter->second) << llendl; } else { - return false; + LL_DEBUGS("Avatar") << " phase_name " << phase_name << " NOT FOUND" << llendl; } + + return found; } diff --git a/indra/newview/llviewerstats.h b/indra/newview/llviewerstats.h index 6b2461be41..eaa0b6beff 100755 --- a/indra/newview/llviewerstats.h +++ b/indra/newview/llviewerstats.h @@ -279,7 +279,7 @@ public: // Phase tracking (originally put in for avatar rezzing), tracking // progress of active/completed phases for activities like outfit changing. - typedef std::map<std::string,LLFrameTimer> phase_map_t; + typedef std::map<std::string,LLTimer> phase_map_t; typedef std::map<std::string,StatsAccumulator> phase_stats_t; class PhaseMap { @@ -288,11 +288,10 @@ public: static phase_stats_t sStats; public: PhaseMap(); - LLFrameTimer& getPhaseTimer(const std::string& phase_name); + LLTimer& getPhaseTimer(const std::string& phase_name); bool getPhaseValues(const std::string& phase_name, F32& elapsed, bool& completed); void startPhase(const std::string& phase_name); void stopPhase(const std::string& phase_name); - void stopAllPhases(); void clearPhases(); LLSD dumpPhases(); static StatsAccumulator& getPhaseStats(const std::string& phase_name); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 6df5fab42b..2cbdf93eeb 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -6013,9 +6013,12 @@ void LLVOAvatar::clearPhases() void LLVOAvatar::startPhase(const std::string& phase_name) { - F32 elapsed; - bool completed; - if (getPhases().getPhaseValues(phase_name, elapsed, completed)) + F32 elapsed = 0.0; + bool completed = false; + bool found = getPhases().getPhaseValues(phase_name, elapsed, completed); + //LL_DEBUGS("Avatar") << avString() << " phase state " << phase_name + // << " found " << found << " elapsed " << elapsed << " completed " << completed << llendl; + if (found) { if (!completed) { @@ -6029,9 +6032,12 @@ void LLVOAvatar::startPhase(const std::string& phase_name) void LLVOAvatar::stopPhase(const std::string& phase_name, bool err_check) { - F32 elapsed; - bool completed; - if (getPhases().getPhaseValues(phase_name, elapsed, completed)) + F32 elapsed = 0.0; + bool completed = false; + bool found = getPhases().getPhaseValues(phase_name, elapsed, completed); + //LL_DEBUGS("Avatar") << avString() << " phase state " << phase_name + // << " found " << found << " elapsed " << elapsed << " completed " << completed << llendl; + if (found) { if (!completed) { diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 5b6fcc5d27..b2fcfb6250 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -246,6 +246,8 @@ bool LLVOAvatarSelf::checkStuckAppearance() LL_DEBUGS("Avatar") << "change in progress for " << change_time << " seconds" << llendl; S32 active_hp = LLAppearanceMgr::instance().countActiveHoldingPatterns(); LL_DEBUGS("Avatar") << "active holding patterns " << active_hp << " seconds" << llendl; + S32 active_copies = LLAppearanceMgr::instance().getActiveCopyOperations(); + LL_DEBUGS("Avatar") << "active copy operations " << active_copies << llendl; } // Return false to continue running check periodically. @@ -2369,7 +2371,6 @@ LLSD summarize_by_buckets(std::vector<LLSD> in_records, void LLVOAvatarSelf::sendViewerAppearanceChangeMetrics() { - // gAgentAvatarp->stopAllPhases(); static volatile bool reporting_started(false); static volatile S32 report_sequence(0); -- cgit v1.2.3 From 02d2808a419ce37df877756883b96147d06aa4d8 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Mon, 3 Jun 2013 13:21:42 -0400 Subject: SH-3635 WIP - unstick outfit change if stuck beyond a certain time range --- indra/newview/llvoavatarself.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index b2fcfb6250..232bf3e478 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -239,6 +239,9 @@ void LLVOAvatarSelf::initInstance() bool LLVOAvatarSelf::checkStuckAppearance() { + const F32 CONDITIONAL_UNSTICK_INTERVAL = 300.0; + const F32 UNCONDITIONAL_UNSTICK_INTERVAL = 600.0; + if (gAgentWearables.isCOFChangeInProgress()) { LL_DEBUGS("Avatar") << "checking for stuck appearance" << llendl; @@ -248,6 +251,12 @@ bool LLVOAvatarSelf::checkStuckAppearance() LL_DEBUGS("Avatar") << "active holding patterns " << active_hp << " seconds" << llendl; S32 active_copies = LLAppearanceMgr::instance().getActiveCopyOperations(); LL_DEBUGS("Avatar") << "active copy operations " << active_copies << llendl; + + if ((change_time > CONDITIONAL_UNSTICK_INTERVAL && active_copies == 0) || + (change_time > UNCONDITIONAL_UNSTICK_INTERVAL)) + { + gAgentWearables.notifyLoadingFinished(); + } } // Return false to continue running check periodically. -- cgit v1.2.3 From c81b685b4217b3c321815e1993d39fb0b479a767 Mon Sep 17 00:00:00 2001 From: prep <prep@lindenlab.com> Date: Mon, 3 Jun 2013 16:10:46 -0400 Subject: Fix for sh-4221 Sometimes ctrl+q needed to be hit twice --- indra/newview/llfloatersidepanelcontainer.cpp | 15 ++++++++++----- indra/newview/llfloatersidepanelcontainer.h | 2 ++ 2 files changed, 12 insertions(+), 5 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloatersidepanelcontainer.cpp b/indra/newview/llfloatersidepanelcontainer.cpp index 13a9ba1695..02216420da 100755 --- a/indra/newview/llfloatersidepanelcontainer.cpp +++ b/indra/newview/llfloatersidepanelcontainer.cpp @@ -40,7 +40,8 @@ const std::string LLFloaterSidePanelContainer::sMainPanelName("main_panel"); LLFloaterSidePanelContainer::LLFloaterSidePanelContainer(const LLSD& key, const Params& params) -: LLFloater(key, params) +: LLFloater(key, params) +, mAppQuiting( false ) { // Prevent transient floaters (e.g. IM windows) from hiding // when this floater is clicked. @@ -56,7 +57,8 @@ BOOL LLFloaterSidePanelContainer::postBuild() } void LLFloaterSidePanelContainer::onConfirmationClose( const LLSD &confirm ) -{ +{ + mAppQuiting = confirm.asBoolean(); onClickCloseBtn(); } @@ -69,10 +71,12 @@ LLFloaterSidePanelContainer::~LLFloaterSidePanelContainer() void LLFloaterSidePanelContainer::onOpen(const LLSD& key) { getChild<LLPanel>(sMainPanelName)->onOpen(key); + mAppQuiting = false; } -void LLFloaterSidePanelContainer::onClose(bool app_quitting) -{ - mForceCloseAfterVerify = true; + +void LLFloaterSidePanelContainer::onClose( bool app_quitting ) +{ + if (! mAppQuiting ) { mForceCloseAfterVerify = true; } LLSidepanelAppearance* panel = getSidePanelAppearance(); if ( panel ) { @@ -80,6 +84,7 @@ void LLFloaterSidePanelContainer::onClose(bool app_quitting) panel->onCloseFromAppearance( this ); } } + void LLFloaterSidePanelContainer::onClickCloseBtn() { LLSidepanelAppearance* panel = getSidePanelAppearance(); diff --git a/indra/newview/llfloatersidepanelcontainer.h b/indra/newview/llfloatersidepanelcontainer.h index dc85570f7e..f543cfd5c4 100755 --- a/indra/newview/llfloatersidepanelcontainer.h +++ b/indra/newview/llfloatersidepanelcontainer.h @@ -89,6 +89,8 @@ public: private: LLSidepanelAppearance* getSidePanelAppearance(); +private: + bool mAppQuiting; }; #endif // LL_LLFLOATERSIDEPANELCONTAINER_H -- cgit v1.2.3 From 63940048eff9c9a1929574ba7581f4c835af35d3 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Mon, 3 Jun 2013 17:09:25 -0400 Subject: SH-4166 WIP - COF-slammer infrastructure working for non-AIS case. --- indra/newview/llappearancemgr.cpp | 56 +++++++++++++++++++++++-------------- indra/newview/llappearancemgr.h | 2 -- indra/newview/llviewerinventory.cpp | 50 +++++++++++++++++++++++++++++++++ indra/newview/llviewerinventory.h | 7 +++++ 4 files changed, 92 insertions(+), 23 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 2288f633f4..0c09689a70 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1622,25 +1622,6 @@ void LLAppearanceMgr::purgeBaseOutfitLink(const LLUUID& category, LLPointer<LLIn } } -void LLAppearanceMgr::removeCategoryContents(const LLUUID& category, bool keep_outfit_links, - LLPointer<LLInventoryCallback> cb) -{ - LLInventoryModel::cat_array_t cats; - LLInventoryModel::item_array_t items; - gInventory.collectDescendents(category, cats, items, - LLInventoryModel::EXCLUDE_TRASH); - for (S32 i = 0; i < items.count(); ++i) - { - LLViewerInventoryItem *item = items.get(i); - if (keep_outfit_links && (item->getActualType() == LLAssetType::AT_LINK_FOLDER)) - continue; - if (item->getIsLinkType()) - { - remove_inventory_item(item->getUUID(), cb); - } - } -} - // Keep the last N wearables of each type. For viewer 2.0, N is 1 for // both body parts and clothing items. void LLAppearanceMgr::filterWearableItems( @@ -1704,6 +1685,11 @@ void LLAppearanceMgr::removeAll(LLInventoryModel::item_array_t& items_to_kill, void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append) { LLViewerInventoryCategory *pcat = gInventory.getCategory(category); + if (!pcat) + { + llwarns << "no category found for id " << category << llendl; + return; + } LL_INFOS("Avatar") << self_av_string() << "starting, cat '" << (pcat ? pcat->getName() : "[UNKNOWN]") << "'" << LL_ENDL; const LLUUID cof = getCOF(); @@ -1769,6 +1755,7 @@ void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append) // Will link all the above items. LLPointer<LLInventoryCallback> link_waiter = new LLUpdateAppearanceOnDestroy; +#if 0 linkAll(cof,all_items,link_waiter); // Add link to outfit if category is an outfit. @@ -1785,7 +1772,34 @@ void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append) // even in the non-append case, createBaseOutfitLink() already // deletes the existing link, don't need to do it again here. bool keep_outfit_links = true; - removeCategoryContents(cof, keep_outfit_links, link_waiter); + remove_folder_contents(cof, keep_outfit_links, link_waiter); +#else + LLSD contents = LLSD::emptyArray(); + for (LLInventoryModel::item_array_t::const_iterator it = all_items.begin(); + it != all_items.end(); ++it) + { + LLSD item_contents; + LLInventoryItem *item = *it; + item_contents["name"] = item->getName(); + item_contents["desc"] = item->getActualDescription(); + item_contents["linked_id"] = item->getLinkedUUID(); + item_contents["type"] = LLAssetType::AT_LINK; + contents.append(item_contents); + } + const LLUUID& base_id = append ? getBaseOutfitUUID() : category; + LLViewerInventoryCategory *base_cat = gInventory.getCategory(base_id); + if (base_cat) + { + LLSD base_contents; + base_contents["name"] = base_cat->getName(); + base_contents["desc"] = ""; + base_contents["linked_id"] = base_cat->getLinkedUUID(); + base_contents["type"] = LLAssetType::AT_LINK_FOLDER; + contents.append(base_contents); + } + llinfos << "slamming to: " << ll_pretty_print_sd(contents) << llendl; + slam_inventory_folder(getCOF(), contents, link_waiter); +#endif LL_DEBUGS("Avatar") << self_av_string() << "waiting for LLUpdateAppearanceOnDestroy" << LL_ENDL; } @@ -2776,7 +2790,7 @@ bool LLAppearanceMgr::updateBaseOutfit() updateClothingOrderingInfo(); // in a Base Outfit we do not remove items, only links - removeCategoryContents(base_outfit_id, false, NULL); + remove_folder_contents(base_outfit_id, false, NULL); LLPointer<LLInventoryCallback> dirty_state_updater = new LLBoostFuncInventoryCallback(no_op_inventory_func, appearance_mgr_update_dirty_state); diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index 4679ceaf57..97f3283818 100755 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -235,8 +235,6 @@ private: LLInventoryModel::item_array_t& obj_items, LLInventoryModel::item_array_t& gest_items); - void removeCategoryContents(const LLUUID& category, bool keep_outfit_links, - LLPointer<LLInventoryCallback> cb); static void onOutfitRename(const LLSD& notification, const LLSD& response); void setOutfitLocked(bool locked); diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 465a49d004..db8671d51b 100755 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -1828,6 +1828,54 @@ void create_new_item(const std::string& name, } +void slam_inventory_folder(const LLUUID& folder_id, + const LLSD& contents, + LLPointer<LLInventoryCallback> cb) +{ + std::string cap; + if (AISCommand::getCap(cap)) + { + //LLPointer<AISCommand> cmd_ptr = new SlamFolderCommand(folder_id, contents, cb); + //cmd_ptr->run_command(); + } + else // no cap + { + for (LLSD::array_const_iterator it = contents.beginArray(); + it != contents.endArray(); + ++it) + { + const LLSD& item_contents = *it; + link_inventory_item(gAgent.getID(), + item_contents["linked_id"].asUUID(), + folder_id, + item_contents["name"].asString(), + item_contents["desc"].asString(), + LLAssetType::EType(item_contents["type"].asInteger()), + cb); + } + remove_folder_contents(folder_id,false,cb); + } +} + +void remove_folder_contents(const LLUUID& category, bool keep_outfit_links, + LLPointer<LLInventoryCallback> cb) +{ + LLInventoryModel::cat_array_t cats; + LLInventoryModel::item_array_t items; + gInventory.collectDescendents(category, cats, items, + LLInventoryModel::EXCLUDE_TRASH); + for (S32 i = 0; i < items.count(); ++i) + { + LLViewerInventoryItem *item = items.get(i); + if (keep_outfit_links && (item->getActualType() == LLAssetType::AT_LINK_FOLDER)) + continue; + if (item->getIsLinkType()) + { + remove_inventory_item(item->getUUID(), cb); + } + } +} + const std::string NEW_LSL_NAME = "New Script"; // *TODO:Translate? (probably not) const std::string NEW_NOTECARD_NAME = "New Note"; // *TODO:Translate? (probably not) const std::string NEW_GESTURE_NAME = "New Gesture"; // *TODO:Translate? (probably not) @@ -2263,3 +2311,5 @@ BOOL LLViewerInventoryItem::regenerateLink() gInventory.notifyObservers(); return TRUE; } + + diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h index c52b0c2d9d..9af71dfc9c 100755 --- a/indra/newview/llviewerinventory.h +++ b/indra/newview/llviewerinventory.h @@ -407,4 +407,11 @@ void menu_create_inventory_item(LLInventoryPanel* root, const LLSD& userdata, const LLUUID& default_parent_uuid = LLUUID::null); +void slam_inventory_folder(const LLUUID& folder_id, + const LLSD& contents, + LLPointer<LLInventoryCallback> cb); + +void remove_folder_contents(const LLUUID& folder_id, bool keep_outfit_links, + LLPointer<LLInventoryCallback> cb); + #endif // LL_LLVIEWERINVENTORY_H -- cgit v1.2.3 From c5c2e7b405bbbcc3d1c1756e34c3069611f0e4a1 Mon Sep 17 00:00:00 2001 From: prep <prep@lindenlab.com> Date: Mon, 3 Jun 2013 18:08:48 -0400 Subject: SH-4035 spec change. If you revert after quiting, SL shutsdown. --- indra/newview/llfloatersidepanelcontainer.h | 3 ++- indra/newview/llsidepanelappearance.cpp | 10 ++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloatersidepanelcontainer.h b/indra/newview/llfloatersidepanelcontainer.h index f543cfd5c4..b276821805 100755 --- a/indra/newview/llfloatersidepanelcontainer.h +++ b/indra/newview/llfloatersidepanelcontainer.h @@ -89,7 +89,8 @@ public: private: LLSidepanelAppearance* getSidePanelAppearance(); -private: + +public: bool mAppQuiting; }; diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp index 70da576c83..775c148ea1 100755 --- a/indra/newview/llsidepanelappearance.cpp +++ b/indra/newview/llsidepanelappearance.cpp @@ -151,11 +151,17 @@ bool LLSidepanelAppearance::callBackExitWithoutSaveViaClose(const LLSD& notifica toggleWearableEditPanel(FALSE); showOutfitEditPanel(); LLVOAvatarSelf::onCustomizeEnd( FALSE ); - mRevertSet = true; + if ( !mLLFloaterSidePanelContainer->mAppQuiting ) + { + mRevertSet = true; + } + else + { + mLLFloaterSidePanelContainer->closeFloater( true ); + } return false; } mLLFloaterSidePanelContainer->mForceCloseAfterVerify = false; - //mRevertSet = true; return false; } -- cgit v1.2.3 From f7c9739fd9bb4355765ecff4b92e879b38302e49 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Wed, 5 Jun 2013 15:13:48 -0400 Subject: SH-3635 WIP - COF slammer works in AISv3 regions. Extensive rework of onAISUpdateReceived. --- indra/newview/llinventorymodel.cpp | 167 ++++++++++++++++++++++++++++++------ indra/newview/llinventorymodel.h | 2 +- indra/newview/llviewerinventory.cpp | 32 ++++++- 3 files changed, 172 insertions(+), 29 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 38fa3c36e3..1a5e76183c 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1172,77 +1172,188 @@ void LLInventoryModel::onAISUpdateReceived(const std::string& context, const LLS { LL_DEBUGS("Inventory") << "ais update " << context << ":" << ll_pretty_print_sd(update) << llendl; + // Track changes to descendent counts for accounting. + std::map<LLUUID,S32> cat_deltas; + typedef std::map<LLUUID,LLPointer<LLViewerInventoryItem> > deferred_item_map_t; + deferred_item_map_t items_created; + deferred_item_map_t items_updated; + std::set<LLUUID> objects_deleted; + + // parse _categories_removed -> objects_deleted uuid_vec_t cat_ids; parse_llsd_uuid_array(update,"_categories_removed",cat_ids); for (uuid_vec_t::const_iterator it = cat_ids.begin(); it != cat_ids.end(); ++it) { - onObjectDeletedFromServer(*it, false); + LLViewerInventoryCategory *cat = getCategory(*it); + cat_deltas[cat->getParentUUID()]--; + objects_deleted.insert(*it); } + // parse _categories_items_removed -> objects_deleted uuid_vec_t item_ids; parse_llsd_uuid_array(update,"_category_items_removed",item_ids); for (uuid_vec_t::const_iterator it = item_ids.begin(); it != item_ids.end(); ++it) { - onObjectDeletedFromServer(*it, false); + LLViewerInventoryItem *item = getItem(*it); + cat_deltas[item->getParentUUID()]--; + objects_deleted.insert(*it); } + // parse _broken_links_removed -> objects_deleted uuid_vec_t broken_link_ids; parse_llsd_uuid_array(update,"_broken_links_removed",broken_link_ids); for (uuid_vec_t::const_iterator it = broken_link_ids.begin(); it != broken_link_ids.end(); ++it) { - onObjectDeletedFromServer(*it, false); + LLViewerInventoryItem *item = getItem(*it); + cat_deltas[item->getParentUUID()]--; + objects_deleted.insert(*it); } - if (update.has("item_id")) + // parse _created_items + uuid_vec_t created_item_ids; + parse_llsd_uuid_array(update,"_created_items",created_item_ids); + + if (update.has("_embedded")) { - // item has been modified or possibly created (would be better if we could distinguish these cases directly) - LLUUID item_id = update["item_id"].asUUID(); - LLViewerInventoryItem *item = gInventory.getItem(item_id); - LLViewerInventoryCategory *cat = gInventory.getCategory(item_id); - if (item) + const LLSD& embedded = update["_embedded"]; + for(LLSD::map_const_iterator it = embedded.beginMap(), + end = embedded.endMap(); + it != end; ++it) { - LLSD changes; - if (update.has("name") && update["name"] != item->getName()) + const std::string& field = (*it).first; + + // parse created links + if (field == "link") { - changes["name"] = update["name"]; - } - if (update.has("desc") && update["desc"] != item->getActualDescription()) + const LLSD& links = embedded["link"]; + for(LLSD::map_const_iterator linkit = links.beginMap(), + linkend = links.endMap(); + linkit != linkend; ++linkit) + { + const LLUUID link_id((*linkit).first); + const LLSD& link_map = (*linkit).second; + uuid_vec_t::const_iterator pos = + std::find(created_item_ids.begin(), + created_item_ids.end(),link_id); + if (pos != created_item_ids.end()) + { + LLPointer<LLViewerInventoryItem> new_link(new LLViewerInventoryItem); + BOOL rv = new_link->unpackMessage(link_map); + if (rv) + { + items_created[link_id] = new_link; + const LLUUID& parent_id = new_link->getParentUUID(); + cat_deltas[parent_id]++; + } + else + { + llwarns << "failed to unpack" << llendl; + } + } + else + { + LL_DEBUGS("Inventory") << "Ignoring link not in created items list " << link_id << llendl; + } + } + } + else { - changes["desc"] = update["desc"]; + llwarns << "unrecognized embedded field " << field << llendl; } - onItemUpdated(item_id,changes,true); } - else if (cat) + + } + + // Parse item update at the top level. + if (update.has("item_id")) + { + LLUUID item_id = update["item_id"].asUUID(); + LLPointer<LLViewerInventoryItem> new_item(new LLViewerInventoryItem); + BOOL rv = new_item->unpackMessage(update); + if (rv) { - llerrs << "don't handle cat update yet" << llendl; + items_updated[item_id] = new_item; + // This statement is here to cause a new entry with 0 + // delta to be created if it does not already exist; + // otherwise has no effect. + cat_deltas[new_item->getParentUUID()]; } else { - llerrs << "don't handle creation case yet" << llendl; + llerrs << "unpack failed" << llendl; } - } + // Do descendent/version accounting. + // Can remove this if/when we use the version info directly. + for (std::map<LLUUID,S32>::const_iterator catit = cat_deltas.begin(); + catit != cat_deltas.end(); ++catit) + { + const LLUUID cat_id(catit->first); + S32 delta = catit->second; + LLInventoryModel::LLCategoryUpdate up(cat_id, delta); + gInventory.accountForUpdate(up); + } + // TODO - how can we use this version info? Need to be sure all // changes are going through AIS first, or at least through // something with a reliable responder. -#if 0 const std::string& ucv = "_updated_category_versions"; if (update.has(ucv)) { for(LLSD::map_const_iterator it = update[ucv].beginMap(), end = update[ucv].endMap(); - it != end; ++it) + it != end; ++it) { const LLUUID id((*it).first); S32 version = (*it).second.asInteger(); + LLViewerInventoryCategory *cat = gInventory.getCategory(id); + if (cat->getVersion() != version) + { + llwarns << "Possible version mismatch, viewer " << cat->getVersion() + << " server " << version << llendl; + } } } -#endif + + // CREATE ITEMS + for (deferred_item_map_t::const_iterator create_it = items_created.begin(); + create_it != items_created.end(); ++create_it) + { + LLUUID item_id(create_it->first); + LLPointer<LLViewerInventoryItem> new_item = create_it->second; + + // FIXME risky function since it calls updateServer() in some + // cases. Maybe break out the update/create cases, in which + // case this is create. + LL_DEBUGS("Inventory") << "created item " << item_id << llendl; + gInventory.updateItem(new_item); + } + // UPDATE ITEMS + for (deferred_item_map_t::const_iterator update_it = items_updated.begin(); + update_it != items_updated.end(); ++update_it) + { + LLUUID item_id(update_it->first); + LLPointer<LLViewerInventoryItem> new_item = update_it->second; + // FIXME risky function since it calls updateServer() in some + // cases. Maybe break out the update/create cases, in which + // case this is update. + LL_DEBUGS("Inventory") << "updated item " << item_id << llendl; + gInventory.updateItem(new_item); + } + + // DELETE OBJECTS + for (std::set<LLUUID>::const_iterator del_it = objects_deleted.begin(); + del_it != objects_deleted.end(); ++del_it) + { + LL_DEBUGS("Inventory") << "deleted item " << *del_it << llendl; + onObjectDeletedFromServer(*del_it, false, false); + } + } void LLInventoryModel::onItemUpdated(const LLUUID& item_id, const LLSD& updates, bool update_parent_version) @@ -1395,7 +1506,7 @@ void LLInventoryModel::onDescendentsPurgedFromServer(const LLUUID& object_id, bo // Update model after an item is confirmed as removed from // server. Works for categories or items. -void LLInventoryModel::onObjectDeletedFromServer(const LLUUID& object_id, bool fix_broken_links) +void LLInventoryModel::onObjectDeletedFromServer(const LLUUID& object_id, bool fix_broken_links, bool update_parent_version) { LLPointer<LLInventoryObject> obj = getObject(object_id); if(obj) @@ -1406,9 +1517,13 @@ void LLInventoryModel::onObjectDeletedFromServer(const LLUUID& object_id, bool f onDescendentsPurgedFromServer(object_id, fix_broken_links); } + // From item/cat removeFromServer() - LLInventoryModel::LLCategoryUpdate up(obj->getParentUUID(), -1); - accountForUpdate(up); + if (update_parent_version) + { + LLInventoryModel::LLCategoryUpdate up(obj->getParentUUID(), -1); + accountForUpdate(up); + } // From purgeObject() LLPreview::hide(object_id); diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index fd2481b531..a41a824906 100755 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -334,7 +334,7 @@ public: // Update model after an item is confirmed as removed from // server. Works for categories or items. - void onObjectDeletedFromServer(const LLUUID& item_id, bool fix_broken_links = true); + void onObjectDeletedFromServer(const LLUUID& item_id, bool fix_broken_links = true, bool update_parent_version = true); // Update model after all descendents removed from server. void onDescendentsPurgedFromServer(const LLUUID& object_id, bool fix_broken_links = true); diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index db8671d51b..0608c46051 100755 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -493,6 +493,34 @@ private: LLSD mUpdates; }; +class SlamFolderCommand: public AISCommand +{ +public: + SlamFolderCommand(const LLUUID& folder_id, const LLSD& contents, LLPointer<LLInventoryCallback> callback): + mContents(contents), + AISCommand(callback) + { + std::string cap; + if (!getCap(cap)) + { + llwarns << "No cap found" << llendl; + return; + } + LLUUID tid; + tid.generate(); + std::string url = cap + std::string("/category/") + folder_id.asString() + "/links?tid=" + tid.asString(); + llinfos << url << llendl; + LLCurl::ResponderPtr responder = this; + LLSD headers; + headers["Content-Type"] = "application/llsd+xml"; + F32 timeout = HTTP_REQUEST_EXPIRY_SECS; + command_func_type cmd = boost::bind(&LLHTTPClient::put, url, mContents, responder, headers, timeout); + setCommandFunc(cmd); + } +private: + LLSD mContents; +}; + ///---------------------------------------------------------------------------- /// Class LLViewerInventoryItem ///---------------------------------------------------------------------------- @@ -1835,8 +1863,8 @@ void slam_inventory_folder(const LLUUID& folder_id, std::string cap; if (AISCommand::getCap(cap)) { - //LLPointer<AISCommand> cmd_ptr = new SlamFolderCommand(folder_id, contents, cb); - //cmd_ptr->run_command(); + LLPointer<AISCommand> cmd_ptr = new SlamFolderCommand(folder_id, contents, cb); + cmd_ptr->run_command(); } else // no cap { -- cgit v1.2.3 From ca806315a98627b29a4933cbf8b27431ca43dd0f Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Wed, 5 Jun 2013 15:52:44 -0400 Subject: SH-3635 WIP - logging cleanup, moved some big dumps into separate XML files --- indra/newview/llappearancemgr.cpp | 18 ++++++------------ indra/newview/llinventorymodel.cpp | 5 ++++- indra/newview/llvoavatar.cpp | 9 +++++++++ indra/newview/llvoavatar.h | 1 + 4 files changed, 20 insertions(+), 13 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 0c09689a70..646b2d18dd 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1797,7 +1797,10 @@ void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append) base_contents["type"] = LLAssetType::AT_LINK_FOLDER; contents.append(base_contents); } - llinfos << "slamming to: " << ll_pretty_print_sd(contents) << llendl; + if (gSavedSettings.getBOOL("DebugAvatarAppearanceMessage")) + { + dump_sequential_xml(gAgentAvatarp->getFullname() + "_slam_request", contents); + } slam_inventory_folder(getCOF(), contents, link_waiter); #endif @@ -2950,7 +2953,7 @@ protected: //LL_DEBUGS("Avatar") << dumpResponse() << LL_ENDL; if (gSavedSettings.getBOOL("DebugAvatarAppearanceMessage")) { - dumpContents(gAgentAvatarp->getFullname() + "_appearance_request_ok", content); + dump_sequential_xml(gAgentAvatarp->getFullname() + "_appearance_request_ok", content); } } else @@ -2968,7 +2971,7 @@ protected: if (gSavedSettings.getBOOL("DebugAvatarAppearanceMessage")) { const LLSD& content = getContent(); - dumpContents(gAgentAvatarp->getFullname() + "_appearance_request_error", content); + dump_sequential_xml(gAgentAvatarp->getFullname() + "_appearance_request_error", content); debugCOF(content); } onFailure(); @@ -2992,15 +2995,6 @@ protected: } } - 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) { LL_INFOS("Avatar") << "AIS COF, version received: " << content["expected"].asInteger() diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 1a5e76183c..c0c48d6695 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1170,7 +1170,10 @@ void parse_llsd_uuid_array(const LLSD& content, const std::string& name, uuid_ve void LLInventoryModel::onAISUpdateReceived(const std::string& context, const LLSD& update) { - LL_DEBUGS("Inventory") << "ais update " << context << ":" << ll_pretty_print_sd(update) << llendl; + if (gSavedSettings.getBOOL("DebugAvatarAppearanceMessage")) + { + dump_sequential_xml(gAgentAvatarp->getFullname() + "_ais_update", update); + } // Track changes to descendent counts for accounting. std::map<LLUUID,S32> cat_deltas; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 2cbdf93eeb..1dbcabf2b3 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -7416,6 +7416,15 @@ std::string get_sequential_numbered_file_name(const std::string& prefix, return outfilename; } +void dump_sequential_xml(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 LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_wearables ) { std::string outprefix(prefix); diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 19ad49d3a1..fad2fd962c 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -998,6 +998,7 @@ extern const S32 MAX_TEXTURE_VIRTUAL_SIZE_RESET_INTERVAL; std::string get_sequential_numbered_file_name(const std::string& prefix, const std::string& suffix); +void dump_sequential_xml(const std::string outprefix, const LLSD& content); void dump_visual_param(apr_file_t* file, LLVisualParam* viewer_param, F32 value); #endif // LL_VOAVATAR_H -- cgit v1.2.3 From b1769b6a60954152111cc5d0f596ff21cce84ffa Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Thu, 6 Jun 2013 13:55:27 -0400 Subject: SH-4234 FIX - the only persistent failure seen was caused by a broken link in the outfit. Modified updateIsDirty() to ignore broken links. --- indra/newview/llappearancemgr.cpp | 19 ++++++++++++++++++- indra/newview/llinventoryfunctions.cpp | 7 +++++++ indra/newview/llinventoryfunctions.h | 7 +++++++ 3 files changed, 32 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 722587ec0e..2698e2db35 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -2611,7 +2611,7 @@ void LLAppearanceMgr::updateIsDirty() if (base_outfit.notNull()) { - LLIsOfAssetType collector = LLIsOfAssetType(LLAssetType::AT_LINK); + LLIsValidItemLink collector; LLInventoryModel::cat_array_t cof_cats; LLInventoryModel::item_array_t cof_items; @@ -2625,6 +2625,7 @@ void LLAppearanceMgr::updateIsDirty() if(outfit_items.count() != cof_items.count()) { + LL_DEBUGS("Avatar") << "item count different" << llendl; // Current outfit folder should have one more item than the outfit folder. // this one item is the link back to the outfit folder itself. mOutfitIsDirty = true; @@ -2644,6 +2645,22 @@ void LLAppearanceMgr::updateIsDirty() item1->getName() != item2->getName() || item1->getActualDescription() != item2->getActualDescription()) { + if (item1->getLinkedUUID() != item2->getLinkedUUID()) + { + LL_DEBUGS("Avatar") << "link id different " << llendl; + } + else + { + if (item1->getName() != item2->getName()) + { + LL_DEBUGS("Avatar") << "name different " << item1->getName() << " " << item2->getName() << llendl; + } + if (item1->getActualDescription() != item2->getActualDescription()) + { + LL_DEBUGS("Avatar") << "desc different " << item1->getActualDescription() + << " " << item2->getActualDescription() << llendl; + } + } mOutfitIsDirty = true; return; } diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index b5fb226872..faa5d70952 100755 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -738,6 +738,13 @@ bool LLIsOfAssetType::operator()(LLInventoryCategory* cat, LLInventoryItem* item return FALSE; } +bool LLIsValidItemLink::operator()(LLInventoryCategory* cat, LLInventoryItem* item) +{ + LLViewerInventoryItem *vitem = dynamic_cast<LLViewerInventoryItem*>(item); + if (!vitem) return false; + return (vitem->getActualType() == LLAssetType::AT_LINK && !vitem->getIsBrokenLink()); +} + bool LLIsTypeWithPermissions::operator()(LLInventoryCategory* cat, LLInventoryItem* item) { if(mType == LLAssetType::AT_CATEGORY) diff --git a/indra/newview/llinventoryfunctions.h b/indra/newview/llinventoryfunctions.h index f1066a4dc9..6b3861aa79 100755 --- a/indra/newview/llinventoryfunctions.h +++ b/indra/newview/llinventoryfunctions.h @@ -186,6 +186,13 @@ protected: LLAssetType::EType mType; }; +class LLIsValidItemLink : public LLInventoryCollectFunctor +{ +public: + virtual bool operator()(LLInventoryCategory* cat, + LLInventoryItem* item); +}; + class LLIsTypeWithPermissions : public LLInventoryCollectFunctor { public: -- cgit v1.2.3 From bee76e305214598b2cb148e399d86e28d80287ca Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Thu, 6 Jun 2013 17:59:16 -0400 Subject: SH-4166 WIP - fix for a permissions issue that was preventing cof-created links from being reordered in outfits. --- indra/newview/llinventorymodel.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index c0c48d6695..532d3a3495 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1247,6 +1247,13 @@ void LLInventoryModel::onAISUpdateReceived(const std::string& context, const LLS BOOL rv = new_link->unpackMessage(link_map); if (rv) { + LLPermissions default_perms; + default_perms.init(gAgent.getID(),gAgent.getID(),LLUUID::null,LLUUID::null); + default_perms.initMasks(PERM_NONE,PERM_NONE,PERM_NONE,PERM_NONE,PERM_NONE); + new_link->setPermissions(default_perms); + LLSaleInfo default_sale_info; + new_link->setSaleInfo(default_sale_info); + //LL_DEBUGS("Inventory") << "creating link from llsd: " << ll_pretty_print_sd(link_map) << llendl; items_created[link_id] = new_link; const LLUUID& parent_id = new_link->getParentUUID(); cat_deltas[parent_id]++; -- cgit v1.2.3 From 41694a902dc8cfebebb6e23691d41cb5627fa5a1 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Fri, 7 Jun 2013 10:35:07 -0400 Subject: SH-4216 WIP - broke up the onAISUpdateReceived monolith --- indra/newview/llinventorymodel.cpp | 252 ++++++++++++++++++++++--------------- 1 file changed, 149 insertions(+), 103 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 532d3a3495..3c7539a7f9 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1154,70 +1154,70 @@ void LLInventoryModel::changeCategoryParent(LLViewerInventoryCategory* cat, notifyObservers(); } -void parse_llsd_uuid_array(const LLSD& content, const std::string& name, uuid_vec_t& ids) +class AISUpdate { - ids.clear(); - if (content.has(name)) - { - for(LLSD::array_const_iterator it = content[name].beginArray(), - end = content[name].endArray(); - it != end; ++it) - { - ids.push_back((*it).asUUID()); - } - } -} - -void LLInventoryModel::onAISUpdateReceived(const std::string& context, const LLSD& update) -{ - if (gSavedSettings.getBOOL("DebugAvatarAppearanceMessage")) - { - dump_sequential_xml(gAgentAvatarp->getFullname() + "_ais_update", update); - } +public: + AISUpdate(const LLSD& update); + void parseUpdate(const LLSD& update); + void parseUUIDArray(const LLSD& content, const std::string& name, uuid_vec_t& ids); + void parseLink(const LLUUID& link_id, const LLSD& link_map); + void parseCreatedLinks(const LLSD& links); + void doUpdate(); +private: + typedef std::map<LLUUID,S32> uuid_int_map_t; + uuid_int_map_t mCatDeltas; + uuid_int_map_t mCatVersions; - // Track changes to descendent counts for accounting. - std::map<LLUUID,S32> cat_deltas; typedef std::map<LLUUID,LLPointer<LLViewerInventoryItem> > deferred_item_map_t; - deferred_item_map_t items_created; - deferred_item_map_t items_updated; - std::set<LLUUID> objects_deleted; + deferred_item_map_t mItemsCreated; + deferred_item_map_t mItemsUpdated; - // parse _categories_removed -> objects_deleted + std::set<LLUUID> mObjectsDeleted; + uuid_vec_t mItemsCreatedIds; +}; + +AISUpdate::AISUpdate(const LLSD& update) +{ + parseUpdate(update); +} + +void AISUpdate::parseUpdate(const LLSD& update) +{ + // parse _categories_removed -> mObjectsDeleted uuid_vec_t cat_ids; - parse_llsd_uuid_array(update,"_categories_removed",cat_ids); + parseUUIDArray(update,"_categories_removed",cat_ids); for (uuid_vec_t::const_iterator it = cat_ids.begin(); it != cat_ids.end(); ++it) { - LLViewerInventoryCategory *cat = getCategory(*it); - cat_deltas[cat->getParentUUID()]--; - objects_deleted.insert(*it); + LLViewerInventoryCategory *cat = gInventory.getCategory(*it); + mCatDeltas[cat->getParentUUID()]--; + mObjectsDeleted.insert(*it); } - // parse _categories_items_removed -> objects_deleted + // parse _categories_items_removed -> mObjectsDeleted uuid_vec_t item_ids; - parse_llsd_uuid_array(update,"_category_items_removed",item_ids); + parseUUIDArray(update,"_category_items_removed",item_ids); for (uuid_vec_t::const_iterator it = item_ids.begin(); it != item_ids.end(); ++it) { - LLViewerInventoryItem *item = getItem(*it); - cat_deltas[item->getParentUUID()]--; - objects_deleted.insert(*it); + LLViewerInventoryItem *item = gInventory.getItem(*it); + mCatDeltas[item->getParentUUID()]--; + mObjectsDeleted.insert(*it); } - // parse _broken_links_removed -> objects_deleted + // parse _broken_links_removed -> mObjectsDeleted uuid_vec_t broken_link_ids; - parse_llsd_uuid_array(update,"_broken_links_removed",broken_link_ids); + parseUUIDArray(update,"_broken_links_removed",broken_link_ids); for (uuid_vec_t::const_iterator it = broken_link_ids.begin(); it != broken_link_ids.end(); ++it) { - LLViewerInventoryItem *item = getItem(*it); - cat_deltas[item->getParentUUID()]--; - objects_deleted.insert(*it); + LLViewerInventoryItem *item = gInventory.getItem(*it); + mCatDeltas[item->getParentUUID()]--; + mObjectsDeleted.insert(*it); } // parse _created_items - uuid_vec_t created_item_ids; - parse_llsd_uuid_array(update,"_created_items",created_item_ids); + parseUUIDArray(update,"_created_items",mItemsCreatedIds); if (update.has("_embedded")) { @@ -1227,48 +1227,13 @@ void LLInventoryModel::onAISUpdateReceived(const std::string& context, const LLS it != end; ++it) { const std::string& field = (*it).first; - + // parse created links if (field == "link") { const LLSD& links = embedded["link"]; - for(LLSD::map_const_iterator linkit = links.beginMap(), - linkend = links.endMap(); - linkit != linkend; ++linkit) - { - const LLUUID link_id((*linkit).first); - const LLSD& link_map = (*linkit).second; - uuid_vec_t::const_iterator pos = - std::find(created_item_ids.begin(), - created_item_ids.end(),link_id); - if (pos != created_item_ids.end()) - { - LLPointer<LLViewerInventoryItem> new_link(new LLViewerInventoryItem); - BOOL rv = new_link->unpackMessage(link_map); - if (rv) - { - LLPermissions default_perms; - default_perms.init(gAgent.getID(),gAgent.getID(),LLUUID::null,LLUUID::null); - default_perms.initMasks(PERM_NONE,PERM_NONE,PERM_NONE,PERM_NONE,PERM_NONE); - new_link->setPermissions(default_perms); - LLSaleInfo default_sale_info; - new_link->setSaleInfo(default_sale_info); - //LL_DEBUGS("Inventory") << "creating link from llsd: " << ll_pretty_print_sd(link_map) << llendl; - items_created[link_id] = new_link; - const LLUUID& parent_id = new_link->getParentUUID(); - cat_deltas[parent_id]++; - } - else - { - llwarns << "failed to unpack" << llendl; - } - } - else - { - LL_DEBUGS("Inventory") << "Ignoring link not in created items list " << link_id << llendl; - } - } - } + parseCreatedLinks(links); + } else { llwarns << "unrecognized embedded field " << field << llendl; @@ -1285,11 +1250,11 @@ void LLInventoryModel::onAISUpdateReceived(const std::string& context, const LLS BOOL rv = new_item->unpackMessage(update); if (rv) { - items_updated[item_id] = new_item; + mItemsUpdated[item_id] = new_item; // This statement is here to cause a new entry with 0 // delta to be created if it does not already exist; // otherwise has no effect. - cat_deltas[new_item->getParentUUID()]; + mCatDeltas[new_item->getParentUUID()]; } else { @@ -1297,10 +1262,86 @@ void LLInventoryModel::onAISUpdateReceived(const std::string& context, const LLS } } + // Parse updated category versions. + const std::string& ucv = "_updated_category_versions"; + if (update.has(ucv)) + { + for(LLSD::map_const_iterator it = update[ucv].beginMap(), + end = update[ucv].endMap(); + it != end; ++it) + { + const LLUUID id((*it).first); + S32 version = (*it).second.asInteger(); + mCatVersions[id] = version; + } + } +} + +void AISUpdate::parseUUIDArray(const LLSD& content, const std::string& name, uuid_vec_t& ids) +{ + ids.clear(); + if (content.has(name)) + { + for(LLSD::array_const_iterator it = content[name].beginArray(), + end = content[name].endArray(); + it != end; ++it) + { + ids.push_back((*it).asUUID()); + } + } +} + +void AISUpdate::parseLink(const LLUUID& link_id, const LLSD& link_map) +{ + LLPointer<LLViewerInventoryItem> new_link(new LLViewerInventoryItem); + BOOL rv = new_link->unpackMessage(link_map); + if (rv) + { + LLPermissions default_perms; + default_perms.init(gAgent.getID(),gAgent.getID(),LLUUID::null,LLUUID::null); + default_perms.initMasks(PERM_NONE,PERM_NONE,PERM_NONE,PERM_NONE,PERM_NONE); + new_link->setPermissions(default_perms); + LLSaleInfo default_sale_info; + new_link->setSaleInfo(default_sale_info); + //LL_DEBUGS("Inventory") << "creating link from llsd: " << ll_pretty_print_sd(link_map) << llendl; + mItemsCreated[link_id] = new_link; + const LLUUID& parent_id = new_link->getParentUUID(); + mCatDeltas[parent_id]++; + } + else + { + llwarns << "failed to parse" << llendl; + } +} + +void AISUpdate::parseCreatedLinks(const LLSD& links) +{ + for(LLSD::map_const_iterator linkit = links.beginMap(), + linkend = links.endMap(); + linkit != linkend; ++linkit) + { + const LLUUID link_id((*linkit).first); + const LLSD& link_map = (*linkit).second; + uuid_vec_t::const_iterator pos = + std::find(mItemsCreatedIds.begin(), + mItemsCreatedIds.end(),link_id); + if (pos != mItemsCreatedIds.end()) + { + parseLink(link_id,link_map); + } + else + { + LL_DEBUGS("Inventory") << "Ignoring link not in created items list " << link_id << llendl; + } + } +} + +void AISUpdate::doUpdate() +{ // Do descendent/version accounting. // Can remove this if/when we use the version info directly. - for (std::map<LLUUID,S32>::const_iterator catit = cat_deltas.begin(); - catit != cat_deltas.end(); ++catit) + for (std::map<LLUUID,S32>::const_iterator catit = mCatDeltas.begin(); + catit != mCatDeltas.end(); ++catit) { const LLUUID cat_id(catit->first); S32 delta = catit->second; @@ -1311,27 +1352,22 @@ void LLInventoryModel::onAISUpdateReceived(const std::string& context, const LLS // TODO - how can we use this version info? Need to be sure all // changes are going through AIS first, or at least through // something with a reliable responder. - const std::string& ucv = "_updated_category_versions"; - if (update.has(ucv)) + for (uuid_int_map_t::iterator ucv_it = mCatVersions.begin(); + ucv_it != mCatVersions.end(); ++ucv_it) { - for(LLSD::map_const_iterator it = update[ucv].beginMap(), - end = update[ucv].endMap(); - it != end; ++it) + const LLUUID id = ucv_it->first; + S32 version = ucv_it->second; + LLViewerInventoryCategory *cat = gInventory.getCategory(id); + if (cat->getVersion() != version) { - const LLUUID id((*it).first); - S32 version = (*it).second.asInteger(); - LLViewerInventoryCategory *cat = gInventory.getCategory(id); - if (cat->getVersion() != version) - { - llwarns << "Possible version mismatch, viewer " << cat->getVersion() - << " server " << version << llendl; - } + llwarns << "Possible version mismatch, viewer " << cat->getVersion() + << " server " << version << llendl; } } // CREATE ITEMS - for (deferred_item_map_t::const_iterator create_it = items_created.begin(); - create_it != items_created.end(); ++create_it) + for (deferred_item_map_t::const_iterator create_it = mItemsCreated.begin(); + create_it != mItemsCreated.end(); ++create_it) { LLUUID item_id(create_it->first); LLPointer<LLViewerInventoryItem> new_item = create_it->second; @@ -1344,8 +1380,8 @@ void LLInventoryModel::onAISUpdateReceived(const std::string& context, const LLS } // UPDATE ITEMS - for (deferred_item_map_t::const_iterator update_it = items_updated.begin(); - update_it != items_updated.end(); ++update_it) + for (deferred_item_map_t::const_iterator update_it = mItemsUpdated.begin(); + update_it != mItemsUpdated.end(); ++update_it) { LLUUID item_id(update_it->first); LLPointer<LLViewerInventoryItem> new_item = update_it->second; @@ -1357,13 +1393,23 @@ void LLInventoryModel::onAISUpdateReceived(const std::string& context, const LLS } // DELETE OBJECTS - for (std::set<LLUUID>::const_iterator del_it = objects_deleted.begin(); - del_it != objects_deleted.end(); ++del_it) + for (std::set<LLUUID>::const_iterator del_it = mObjectsDeleted.begin(); + del_it != mObjectsDeleted.end(); ++del_it) { LL_DEBUGS("Inventory") << "deleted item " << *del_it << llendl; - onObjectDeletedFromServer(*del_it, false, false); + gInventory.onObjectDeletedFromServer(*del_it, false, false); + } +} + +void LLInventoryModel::onAISUpdateReceived(const std::string& context, const LLSD& update) +{ + if (gSavedSettings.getBOOL("DebugAvatarAppearanceMessage")) + { + dump_sequential_xml(gAgentAvatarp->getFullname() + "_ais_update", update); } + AISUpdate ais_update(update); // parse update llsd into stuff to do. + ais_update.doUpdate(); // execute the updates in the appropriate order. } void LLInventoryModel::onItemUpdated(const LLUUID& item_id, const LLSD& updates, bool update_parent_version) -- cgit v1.2.3 From 89e3959cf393ce9eeb058304264d4f55f4fe9ca2 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Fri, 7 Jun 2013 12:58:04 -0400 Subject: SH-4216 WIP - moved AISv3 commands and responders to llaisapi.* files --- indra/newview/CMakeLists.txt | 2 + indra/newview/llaisapi.cpp | 481 ++++++++++++++++++++++++++++++++++++ indra/newview/llaisapi.h | 143 +++++++++++ indra/newview/llinventorymodel.cpp | 248 +------------------ indra/newview/llviewerinventory.cpp | 3 + 5 files changed, 630 insertions(+), 247 deletions(-) create mode 100755 indra/newview/llaisapi.cpp create mode 100755 indra/newview/llaisapi.h (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 4560951900..dc9370bd69 100755 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -98,6 +98,7 @@ include_directories(SYSTEM set(viewer_SOURCE_FILES groupchatlistener.cpp llaccountingcostmanager.cpp + llaisapi.cpp llagent.cpp llagentaccess.cpp llagentcamera.cpp @@ -679,6 +680,7 @@ set(viewer_HEADER_FILES ViewerInstall.cmake groupchatlistener.h llaccountingcostmanager.h + llaisapi.h llagent.h llagentaccess.h llagentcamera.h diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp new file mode 100755 index 0000000000..6adf35efb8 --- /dev/null +++ b/indra/newview/llaisapi.cpp @@ -0,0 +1,481 @@ +/** + * @file llaisapi.cpp + * @brief classes and functions for interfacing with the v3+ ais inventory service. + * + * $LicenseInfo:firstyear=2013&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2013, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + * + */ + +#include "llviewerprecompiledheaders.h" +#include "llaisapi.h" + +#include "llagent.h" +#include "llcallbacklist.h" +#include "llinventorymodel.h" +#include "llsdutil.h" +#include "llviewerregion.h" + +///---------------------------------------------------------------------------- +/// Classes for AISv3 support. +///---------------------------------------------------------------------------- + +// AISCommand - base class for retry-able HTTP requests using the AISv3 cap. +AISCommand::AISCommand(LLPointer<LLInventoryCallback> callback): + mCallback(callback) +{ + mRetryPolicy = new LLAdaptiveRetryPolicy(1.0, 32.0, 2.0, 10); +} + +void AISCommand::run_command() +{ + mCommandFunc(); +} + +void AISCommand::setCommandFunc(command_func_type command_func) +{ + mCommandFunc = command_func; +} + +// virtual +bool AISCommand::getResponseUUID(const LLSD& content, LLUUID& id) +{ + return false; +} + +/* virtual */ +void AISCommand::httpSuccess() +{ + // Command func holds a reference to self, need to release it + // after a success or final failure. + setCommandFunc(no_op); + + const LLSD& content = getContent(); + if (!content.isMap()) + { + failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content); + return; + } + mRetryPolicy->onSuccess(); + + gInventory.onAISUpdateReceived("AISCommand", content); + + if (mCallback) + { + LLUUID item_id; // will default to null if parse fails. + getResponseUUID(content,item_id); + mCallback->fire(item_id); + } +} + +/*virtual*/ +void AISCommand::httpFailure() +{ + const LLSD& content = getContent(); + S32 status = getStatus(); + const std::string& reason = getReason(); + const LLSD& headers = getResponseHeaders(); + if (!content.isMap()) + { + LL_DEBUGS("Inventory") << "Malformed response contents " << content + << " status " << status << " reason " << reason << llendl; + } + else + { + LL_DEBUGS("Inventory") << "failed with content: " << ll_pretty_print_sd(content) + << " status " << status << " reason " << reason << llendl; + } + mRetryPolicy->onFailure(status, headers); + F32 seconds_to_wait; + if (mRetryPolicy->shouldRetry(seconds_to_wait)) + { + doAfterInterval(boost::bind(&AISCommand::run_command,this),seconds_to_wait); + } + else + { + // Command func holds a reference to self, need to release it + // after a success or final failure. + setCommandFunc(no_op); + } +} + +//static +bool AISCommand::getCap(std::string& cap) +{ + if (gAgent.getRegion()) + { + cap = gAgent.getRegion()->getCapability("InventoryAPIv3"); + } + if (!cap.empty()) + { + return true; + } + return false; +} + +RemoveItemCommand::RemoveItemCommand(const LLUUID& item_id, + LLPointer<LLInventoryCallback> callback): + AISCommand(callback) +{ + std::string cap; + if (!getCap(cap)) + { + llwarns << "No cap found" << llendl; + return; + } + std::string url = cap + std::string("/item/") + item_id.asString(); + LL_DEBUGS("Inventory") << "url: " << url << llendl; + LLHTTPClient::ResponderPtr responder = this; + LLSD headers; + F32 timeout = HTTP_REQUEST_EXPIRY_SECS; + command_func_type cmd = boost::bind(&LLHTTPClient::del, url, responder, headers, timeout); + setCommandFunc(cmd); +} + +RemoveCategoryCommand::RemoveCategoryCommand(const LLUUID& item_id, + LLPointer<LLInventoryCallback> callback): + AISCommand(callback) +{ + std::string cap; + if (!getCap(cap)) + { + llwarns << "No cap found" << llendl; + return; + } + std::string url = cap + std::string("/category/") + item_id.asString(); + LL_DEBUGS("Inventory") << "url: " << url << llendl; + LLHTTPClient::ResponderPtr responder = this; + LLSD headers; + F32 timeout = HTTP_REQUEST_EXPIRY_SECS; + command_func_type cmd = boost::bind(&LLHTTPClient::del, url, responder, headers, timeout); + setCommandFunc(cmd); +} + +PurgeDescendentsCommand::PurgeDescendentsCommand(const LLUUID& item_id, + LLPointer<LLInventoryCallback> callback): + AISCommand(callback) +{ + std::string cap; + if (!getCap(cap)) + { + llwarns << "No cap found" << llendl; + return; + } + std::string url = cap + std::string("/category/") + item_id.asString() + "/children"; + LL_DEBUGS("Inventory") << "url: " << url << llendl; + LLCurl::ResponderPtr responder = this; + LLSD headers; + F32 timeout = HTTP_REQUEST_EXPIRY_SECS; + command_func_type cmd = boost::bind(&LLHTTPClient::del, url, responder, headers, timeout); + setCommandFunc(cmd); +} + +UpdateItemCommand::UpdateItemCommand(const LLUUID& item_id, + const LLSD& updates, + LLPointer<LLInventoryCallback> callback): + mUpdates(updates), + AISCommand(callback) +{ + std::string cap; + if (!getCap(cap)) + { + llwarns << "No cap found" << llendl; + return; + } + std::string url = cap + std::string("/item/") + item_id.asString(); + LL_DEBUGS("Inventory") << "url: " << url << llendl; + LLCurl::ResponderPtr responder = this; + LLSD headers; + headers["Content-Type"] = "application/llsd+xml"; + F32 timeout = HTTP_REQUEST_EXPIRY_SECS; + command_func_type cmd = boost::bind(&LLHTTPClient::patch, url, mUpdates, responder, headers, timeout); + setCommandFunc(cmd); +} + +UpdateCategoryCommand::UpdateCategoryCommand(const LLUUID& item_id, + const LLSD& updates, + LLPointer<LLInventoryCallback> callback): + mUpdates(updates), + AISCommand(callback) +{ + std::string cap; + if (!getCap(cap)) + { + llwarns << "No cap found" << llendl; + return; + } + std::string url = cap + std::string("/category/") + item_id.asString(); + LL_DEBUGS("Inventory") << "url: " << url << llendl; + LLCurl::ResponderPtr responder = this; + LLSD headers; + headers["Content-Type"] = "application/llsd+xml"; + F32 timeout = HTTP_REQUEST_EXPIRY_SECS; + command_func_type cmd = boost::bind(&LLHTTPClient::patch, url, mUpdates, responder, headers, timeout); + setCommandFunc(cmd); +} + +SlamFolderCommand::SlamFolderCommand(const LLUUID& folder_id, const LLSD& contents, LLPointer<LLInventoryCallback> callback): + mContents(contents), + AISCommand(callback) +{ + std::string cap; + if (!getCap(cap)) + { + llwarns << "No cap found" << llendl; + return; + } + LLUUID tid; + tid.generate(); + std::string url = cap + std::string("/category/") + folder_id.asString() + "/links?tid=" + tid.asString(); + llinfos << url << llendl; + LLCurl::ResponderPtr responder = this; + LLSD headers; + headers["Content-Type"] = "application/llsd+xml"; + F32 timeout = HTTP_REQUEST_EXPIRY_SECS; + command_func_type cmd = boost::bind(&LLHTTPClient::put, url, mContents, responder, headers, timeout); + setCommandFunc(cmd); +} + +AISUpdate::AISUpdate(const LLSD& update) +{ + parseUpdate(update); +} + +void AISUpdate::parseUpdate(const LLSD& update) +{ + // parse _categories_removed -> mObjectsDeleted + uuid_vec_t cat_ids; + parseUUIDArray(update,"_categories_removed",cat_ids); + for (uuid_vec_t::const_iterator it = cat_ids.begin(); + it != cat_ids.end(); ++it) + { + LLViewerInventoryCategory *cat = gInventory.getCategory(*it); + mCatDeltas[cat->getParentUUID()]--; + mObjectsDeleted.insert(*it); + } + + // parse _categories_items_removed -> mObjectsDeleted + uuid_vec_t item_ids; + parseUUIDArray(update,"_category_items_removed",item_ids); + for (uuid_vec_t::const_iterator it = item_ids.begin(); + it != item_ids.end(); ++it) + { + LLViewerInventoryItem *item = gInventory.getItem(*it); + mCatDeltas[item->getParentUUID()]--; + mObjectsDeleted.insert(*it); + } + + // parse _broken_links_removed -> mObjectsDeleted + uuid_vec_t broken_link_ids; + parseUUIDArray(update,"_broken_links_removed",broken_link_ids); + for (uuid_vec_t::const_iterator it = broken_link_ids.begin(); + it != broken_link_ids.end(); ++it) + { + LLViewerInventoryItem *item = gInventory.getItem(*it); + mCatDeltas[item->getParentUUID()]--; + mObjectsDeleted.insert(*it); + } + + // parse _created_items + parseUUIDArray(update,"_created_items",mItemsCreatedIds); + + if (update.has("_embedded")) + { + const LLSD& embedded = update["_embedded"]; + for(LLSD::map_const_iterator it = embedded.beginMap(), + end = embedded.endMap(); + it != end; ++it) + { + const std::string& field = (*it).first; + + // parse created links + if (field == "link") + { + const LLSD& links = embedded["link"]; + parseCreatedLinks(links); + } + else + { + llwarns << "unrecognized embedded field " << field << llendl; + } + } + + } + + // Parse item update at the top level. + if (update.has("item_id")) + { + LLUUID item_id = update["item_id"].asUUID(); + LLPointer<LLViewerInventoryItem> new_item(new LLViewerInventoryItem); + BOOL rv = new_item->unpackMessage(update); + if (rv) + { + mItemsUpdated[item_id] = new_item; + // This statement is here to cause a new entry with 0 + // delta to be created if it does not already exist; + // otherwise has no effect. + mCatDeltas[new_item->getParentUUID()]; + } + else + { + llerrs << "unpack failed" << llendl; + } + } + + // Parse updated category versions. + const std::string& ucv = "_updated_category_versions"; + if (update.has(ucv)) + { + for(LLSD::map_const_iterator it = update[ucv].beginMap(), + end = update[ucv].endMap(); + it != end; ++it) + { + const LLUUID id((*it).first); + S32 version = (*it).second.asInteger(); + mCatVersions[id] = version; + } + } +} + +void AISUpdate::parseUUIDArray(const LLSD& content, const std::string& name, uuid_vec_t& ids) +{ + ids.clear(); + if (content.has(name)) + { + for(LLSD::array_const_iterator it = content[name].beginArray(), + end = content[name].endArray(); + it != end; ++it) + { + ids.push_back((*it).asUUID()); + } + } +} + +void AISUpdate::parseLink(const LLUUID& link_id, const LLSD& link_map) +{ + LLPointer<LLViewerInventoryItem> new_link(new LLViewerInventoryItem); + BOOL rv = new_link->unpackMessage(link_map); + if (rv) + { + LLPermissions default_perms; + default_perms.init(gAgent.getID(),gAgent.getID(),LLUUID::null,LLUUID::null); + default_perms.initMasks(PERM_NONE,PERM_NONE,PERM_NONE,PERM_NONE,PERM_NONE); + new_link->setPermissions(default_perms); + LLSaleInfo default_sale_info; + new_link->setSaleInfo(default_sale_info); + //LL_DEBUGS("Inventory") << "creating link from llsd: " << ll_pretty_print_sd(link_map) << llendl; + mItemsCreated[link_id] = new_link; + const LLUUID& parent_id = new_link->getParentUUID(); + mCatDeltas[parent_id]++; + } + else + { + llwarns << "failed to parse" << llendl; + } +} + +void AISUpdate::parseCreatedLinks(const LLSD& links) +{ + for(LLSD::map_const_iterator linkit = links.beginMap(), + linkend = links.endMap(); + linkit != linkend; ++linkit) + { + const LLUUID link_id((*linkit).first); + const LLSD& link_map = (*linkit).second; + uuid_vec_t::const_iterator pos = + std::find(mItemsCreatedIds.begin(), + mItemsCreatedIds.end(),link_id); + if (pos != mItemsCreatedIds.end()) + { + parseLink(link_id,link_map); + } + else + { + LL_DEBUGS("Inventory") << "Ignoring link not in created items list " << link_id << llendl; + } + } +} + +void AISUpdate::doUpdate() +{ + // Do descendent/version accounting. + // Can remove this if/when we use the version info directly. + for (std::map<LLUUID,S32>::const_iterator catit = mCatDeltas.begin(); + catit != mCatDeltas.end(); ++catit) + { + const LLUUID cat_id(catit->first); + S32 delta = catit->second; + LLInventoryModel::LLCategoryUpdate up(cat_id, delta); + gInventory.accountForUpdate(up); + } + + // TODO - how can we use this version info? Need to be sure all + // changes are going through AIS first, or at least through + // something with a reliable responder. + for (uuid_int_map_t::iterator ucv_it = mCatVersions.begin(); + ucv_it != mCatVersions.end(); ++ucv_it) + { + const LLUUID id = ucv_it->first; + S32 version = ucv_it->second; + LLViewerInventoryCategory *cat = gInventory.getCategory(id); + if (cat->getVersion() != version) + { + llwarns << "Possible version mismatch, viewer " << cat->getVersion() + << " server " << version << llendl; + } + } + + // CREATE ITEMS + for (deferred_item_map_t::const_iterator create_it = mItemsCreated.begin(); + create_it != mItemsCreated.end(); ++create_it) + { + LLUUID item_id(create_it->first); + LLPointer<LLViewerInventoryItem> new_item = create_it->second; + + // FIXME risky function since it calls updateServer() in some + // cases. Maybe break out the update/create cases, in which + // case this is create. + LL_DEBUGS("Inventory") << "created item " << item_id << llendl; + gInventory.updateItem(new_item); + } + + // UPDATE ITEMS + for (deferred_item_map_t::const_iterator update_it = mItemsUpdated.begin(); + update_it != mItemsUpdated.end(); ++update_it) + { + LLUUID item_id(update_it->first); + LLPointer<LLViewerInventoryItem> new_item = update_it->second; + // FIXME risky function since it calls updateServer() in some + // cases. Maybe break out the update/create cases, in which + // case this is update. + LL_DEBUGS("Inventory") << "updated item " << item_id << llendl; + gInventory.updateItem(new_item); + } + + // DELETE OBJECTS + for (std::set<LLUUID>::const_iterator del_it = mObjectsDeleted.begin(); + del_it != mObjectsDeleted.end(); ++del_it) + { + LL_DEBUGS("Inventory") << "deleted item " << *del_it << llendl; + gInventory.onObjectDeletedFromServer(*del_it, false, false); + } +} + diff --git a/indra/newview/llaisapi.h b/indra/newview/llaisapi.h new file mode 100755 index 0000000000..1f9555f004 --- /dev/null +++ b/indra/newview/llaisapi.h @@ -0,0 +1,143 @@ +/** + * @file llaisapi.h + * @brief classes and functions for interfacing with the v3+ ais inventory service. + * + * $LicenseInfo:firstyear=2013&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2013, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLAISAPI_H +#define LL_LLAISAPI_H + +#include "lluuid.h" +#include <map> +#include <set> +#include <string> +#include <vector> +#include "llcurl.h" +#include "llhttpclient.h" +#include "llhttpretrypolicy.h" +#include "llviewerinventory.h" + +class AISCommand: public LLHTTPClient::Responder +{ +public: + typedef boost::function<void()> command_func_type; + + AISCommand(LLPointer<LLInventoryCallback> callback); + + virtual ~AISCommand() {} + + void run_command(); + + void setCommandFunc(command_func_type command_func); + + // Need to do command-specific parsing to get an id here, for + // LLInventoryCallback::fire(). May or may not need to bother, + // since most LLInventoryCallbacks do their work in the + // destructor. + virtual bool getResponseUUID(const LLSD& content, LLUUID& id); + + /* virtual */ void httpSuccess(); + + /*virtual*/ void httpFailure(); + + static bool getCap(std::string& cap); + +private: + command_func_type mCommandFunc; + LLPointer<LLHTTPRetryPolicy> mRetryPolicy; + LLPointer<LLInventoryCallback> mCallback; +}; + +class RemoveItemCommand: public AISCommand +{ +public: + RemoveItemCommand(const LLUUID& item_id, + LLPointer<LLInventoryCallback> callback); +}; + +class RemoveCategoryCommand: public AISCommand +{ +public: + RemoveCategoryCommand(const LLUUID& item_id, + LLPointer<LLInventoryCallback> callback); +}; + +class PurgeDescendentsCommand: public AISCommand +{ +public: + PurgeDescendentsCommand(const LLUUID& item_id, + LLPointer<LLInventoryCallback> callback); +}; + +class UpdateItemCommand: public AISCommand +{ +public: + UpdateItemCommand(const LLUUID& item_id, + const LLSD& updates, + LLPointer<LLInventoryCallback> callback); +private: + LLSD mUpdates; +}; + +class UpdateCategoryCommand: public AISCommand +{ +public: + UpdateCategoryCommand(const LLUUID& item_id, + const LLSD& updates, + LLPointer<LLInventoryCallback> callback); +private: + LLSD mUpdates; +}; + +class SlamFolderCommand: public AISCommand +{ +public: + SlamFolderCommand(const LLUUID& folder_id, const LLSD& contents, LLPointer<LLInventoryCallback> callback); + +private: + LLSD mContents; +}; + +class AISUpdate +{ +public: + AISUpdate(const LLSD& update); + void parseUpdate(const LLSD& update); + void parseUUIDArray(const LLSD& content, const std::string& name, uuid_vec_t& ids); + void parseLink(const LLUUID& link_id, const LLSD& link_map); + void parseCreatedLinks(const LLSD& links); + void doUpdate(); +private: + typedef std::map<LLUUID,S32> uuid_int_map_t; + uuid_int_map_t mCatDeltas; + uuid_int_map_t mCatVersions; + + typedef std::map<LLUUID,LLPointer<LLViewerInventoryItem> > deferred_item_map_t; + deferred_item_map_t mItemsCreated; + deferred_item_map_t mItemsUpdated; + + std::set<LLUUID> mObjectsDeleted; + uuid_vec_t mItemsCreatedIds; +}; + +#endif diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 3c7539a7f9..6dc193292e 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -27,6 +27,7 @@ #include "llviewerprecompiledheaders.h" #include "llinventorymodel.h" +#include "llaisapi.h" #include "llagent.h" #include "llagentwearables.h" #include "llappearancemgr.h" @@ -1154,253 +1155,6 @@ void LLInventoryModel::changeCategoryParent(LLViewerInventoryCategory* cat, notifyObservers(); } -class AISUpdate -{ -public: - AISUpdate(const LLSD& update); - void parseUpdate(const LLSD& update); - void parseUUIDArray(const LLSD& content, const std::string& name, uuid_vec_t& ids); - void parseLink(const LLUUID& link_id, const LLSD& link_map); - void parseCreatedLinks(const LLSD& links); - void doUpdate(); -private: - typedef std::map<LLUUID,S32> uuid_int_map_t; - uuid_int_map_t mCatDeltas; - uuid_int_map_t mCatVersions; - - typedef std::map<LLUUID,LLPointer<LLViewerInventoryItem> > deferred_item_map_t; - deferred_item_map_t mItemsCreated; - deferred_item_map_t mItemsUpdated; - - std::set<LLUUID> mObjectsDeleted; - uuid_vec_t mItemsCreatedIds; -}; - -AISUpdate::AISUpdate(const LLSD& update) -{ - parseUpdate(update); -} - -void AISUpdate::parseUpdate(const LLSD& update) -{ - // parse _categories_removed -> mObjectsDeleted - uuid_vec_t cat_ids; - parseUUIDArray(update,"_categories_removed",cat_ids); - for (uuid_vec_t::const_iterator it = cat_ids.begin(); - it != cat_ids.end(); ++it) - { - LLViewerInventoryCategory *cat = gInventory.getCategory(*it); - mCatDeltas[cat->getParentUUID()]--; - mObjectsDeleted.insert(*it); - } - - // parse _categories_items_removed -> mObjectsDeleted - uuid_vec_t item_ids; - parseUUIDArray(update,"_category_items_removed",item_ids); - for (uuid_vec_t::const_iterator it = item_ids.begin(); - it != item_ids.end(); ++it) - { - LLViewerInventoryItem *item = gInventory.getItem(*it); - mCatDeltas[item->getParentUUID()]--; - mObjectsDeleted.insert(*it); - } - - // parse _broken_links_removed -> mObjectsDeleted - uuid_vec_t broken_link_ids; - parseUUIDArray(update,"_broken_links_removed",broken_link_ids); - for (uuid_vec_t::const_iterator it = broken_link_ids.begin(); - it != broken_link_ids.end(); ++it) - { - LLViewerInventoryItem *item = gInventory.getItem(*it); - mCatDeltas[item->getParentUUID()]--; - mObjectsDeleted.insert(*it); - } - - // parse _created_items - parseUUIDArray(update,"_created_items",mItemsCreatedIds); - - if (update.has("_embedded")) - { - const LLSD& embedded = update["_embedded"]; - for(LLSD::map_const_iterator it = embedded.beginMap(), - end = embedded.endMap(); - it != end; ++it) - { - const std::string& field = (*it).first; - - // parse created links - if (field == "link") - { - const LLSD& links = embedded["link"]; - parseCreatedLinks(links); - } - else - { - llwarns << "unrecognized embedded field " << field << llendl; - } - } - - } - - // Parse item update at the top level. - if (update.has("item_id")) - { - LLUUID item_id = update["item_id"].asUUID(); - LLPointer<LLViewerInventoryItem> new_item(new LLViewerInventoryItem); - BOOL rv = new_item->unpackMessage(update); - if (rv) - { - mItemsUpdated[item_id] = new_item; - // This statement is here to cause a new entry with 0 - // delta to be created if it does not already exist; - // otherwise has no effect. - mCatDeltas[new_item->getParentUUID()]; - } - else - { - llerrs << "unpack failed" << llendl; - } - } - - // Parse updated category versions. - const std::string& ucv = "_updated_category_versions"; - if (update.has(ucv)) - { - for(LLSD::map_const_iterator it = update[ucv].beginMap(), - end = update[ucv].endMap(); - it != end; ++it) - { - const LLUUID id((*it).first); - S32 version = (*it).second.asInteger(); - mCatVersions[id] = version; - } - } -} - -void AISUpdate::parseUUIDArray(const LLSD& content, const std::string& name, uuid_vec_t& ids) -{ - ids.clear(); - if (content.has(name)) - { - for(LLSD::array_const_iterator it = content[name].beginArray(), - end = content[name].endArray(); - it != end; ++it) - { - ids.push_back((*it).asUUID()); - } - } -} - -void AISUpdate::parseLink(const LLUUID& link_id, const LLSD& link_map) -{ - LLPointer<LLViewerInventoryItem> new_link(new LLViewerInventoryItem); - BOOL rv = new_link->unpackMessage(link_map); - if (rv) - { - LLPermissions default_perms; - default_perms.init(gAgent.getID(),gAgent.getID(),LLUUID::null,LLUUID::null); - default_perms.initMasks(PERM_NONE,PERM_NONE,PERM_NONE,PERM_NONE,PERM_NONE); - new_link->setPermissions(default_perms); - LLSaleInfo default_sale_info; - new_link->setSaleInfo(default_sale_info); - //LL_DEBUGS("Inventory") << "creating link from llsd: " << ll_pretty_print_sd(link_map) << llendl; - mItemsCreated[link_id] = new_link; - const LLUUID& parent_id = new_link->getParentUUID(); - mCatDeltas[parent_id]++; - } - else - { - llwarns << "failed to parse" << llendl; - } -} - -void AISUpdate::parseCreatedLinks(const LLSD& links) -{ - for(LLSD::map_const_iterator linkit = links.beginMap(), - linkend = links.endMap(); - linkit != linkend; ++linkit) - { - const LLUUID link_id((*linkit).first); - const LLSD& link_map = (*linkit).second; - uuid_vec_t::const_iterator pos = - std::find(mItemsCreatedIds.begin(), - mItemsCreatedIds.end(),link_id); - if (pos != mItemsCreatedIds.end()) - { - parseLink(link_id,link_map); - } - else - { - LL_DEBUGS("Inventory") << "Ignoring link not in created items list " << link_id << llendl; - } - } -} - -void AISUpdate::doUpdate() -{ - // Do descendent/version accounting. - // Can remove this if/when we use the version info directly. - for (std::map<LLUUID,S32>::const_iterator catit = mCatDeltas.begin(); - catit != mCatDeltas.end(); ++catit) - { - const LLUUID cat_id(catit->first); - S32 delta = catit->second; - LLInventoryModel::LLCategoryUpdate up(cat_id, delta); - gInventory.accountForUpdate(up); - } - - // TODO - how can we use this version info? Need to be sure all - // changes are going through AIS first, or at least through - // something with a reliable responder. - for (uuid_int_map_t::iterator ucv_it = mCatVersions.begin(); - ucv_it != mCatVersions.end(); ++ucv_it) - { - const LLUUID id = ucv_it->first; - S32 version = ucv_it->second; - LLViewerInventoryCategory *cat = gInventory.getCategory(id); - if (cat->getVersion() != version) - { - llwarns << "Possible version mismatch, viewer " << cat->getVersion() - << " server " << version << llendl; - } - } - - // CREATE ITEMS - for (deferred_item_map_t::const_iterator create_it = mItemsCreated.begin(); - create_it != mItemsCreated.end(); ++create_it) - { - LLUUID item_id(create_it->first); - LLPointer<LLViewerInventoryItem> new_item = create_it->second; - - // FIXME risky function since it calls updateServer() in some - // cases. Maybe break out the update/create cases, in which - // case this is create. - LL_DEBUGS("Inventory") << "created item " << item_id << llendl; - gInventory.updateItem(new_item); - } - - // UPDATE ITEMS - for (deferred_item_map_t::const_iterator update_it = mItemsUpdated.begin(); - update_it != mItemsUpdated.end(); ++update_it) - { - LLUUID item_id(update_it->first); - LLPointer<LLViewerInventoryItem> new_item = update_it->second; - // FIXME risky function since it calls updateServer() in some - // cases. Maybe break out the update/create cases, in which - // case this is update. - LL_DEBUGS("Inventory") << "updated item " << item_id << llendl; - gInventory.updateItem(new_item); - } - - // DELETE OBJECTS - for (std::set<LLUUID>::const_iterator del_it = mObjectsDeleted.begin(); - del_it != mObjectsDeleted.end(); ++del_it) - { - LL_DEBUGS("Inventory") << "deleted item " << *del_it << llendl; - gInventory.onObjectDeletedFromServer(*del_it, false, false); - } -} - void LLInventoryModel::onAISUpdateReceived(const std::string& context, const LLSD& update) { if (gSavedSettings.getBOOL("DebugAvatarAppearanceMessage")) diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 0608c46051..57d7d4fef6 100755 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -31,6 +31,7 @@ #include "llsdserialize.h" #include "message.h" +#include "llaisapi.h" #include "llagent.h" #include "llagentcamera.h" #include "llagentwearables.h" @@ -258,6 +259,7 @@ public: }; LLInventoryHandler gInventoryHandler; +#if 0 // DELETE these when working in their new home ///---------------------------------------------------------------------------- /// Classes for AISv3 support. @@ -520,6 +522,7 @@ public: private: LLSD mContents; }; +#endif ///---------------------------------------------------------------------------- /// Class LLViewerInventoryItem -- cgit v1.2.3 From d93ec94751e1c8c9a190b327720f432f9d9928c1 Mon Sep 17 00:00:00 2001 From: "prep@lindenlab.com" <prep@lindenlab.com> Date: Fri, 7 Jun 2013 14:43:18 -0500 Subject: sh-4109: Update agent appearance after attaching a rigged mesh --- indra/newview/llvovolume.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 8730ef66bb..b7f7a11a15 100755 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -76,6 +76,7 @@ #include "llviewershadermgr.h" #include "llvoavatar.h" #include "llvocache.h" +#include "llappearancemgr.h" const S32 MIN_QUIET_FRAMES_COALESCE = 30; const F32 FORCE_SIMPLE_RENDER_AREA = 512.f; @@ -4239,6 +4240,8 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) { LLFastTimer t(FTM_REBUILD_VOLUME_FACE_LIST); + bool requiredAppearanceUpdate = false; + //get all the faces into a list for (LLSpatialGroup::element_iter drawable_iter = group->getDataBegin(); drawable_iter != group->getDataEnd(); ++drawable_iter) { @@ -4337,6 +4340,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) const int jointCnt = pSkinData->mJointNames.size(); const F32 pelvisZOffset = pSkinData->mPelvisOffset; bool fullRig = (jointCnt>=20) ? true : false; + requiredAppearanceUpdate = true; if ( fullRig ) { for ( int i=0; i<jointCnt; ++i ) @@ -4361,12 +4365,14 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) pelvisGotSet = true; } } - } + } } } } } - } + } + + //If we've set the pelvis to a new position we need to also rebuild some information that the //viewer does at launch (e.g. body size etc.) if ( pelvisGotSet ) @@ -4606,6 +4612,11 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) drawablep->clearState(LLDrawable::RIGGED); } } + + if ( requiredAppearanceUpdate && gAgent.getRegion() && gAgent.getRegion()->getCentralBakeVersion() ) + { + LLAppearanceMgr::instance().requestServerAppearanceUpdate(); + } } group->mBufferUsage = useage; -- cgit v1.2.3 From 6d46132ef5218cd17d8d201f16e5a7df4b1e39a6 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Mon, 10 Jun 2013 16:29:10 -0400 Subject: SH-4216 WIP - finished item/cat update and reorg of aisv3 code --- indra/newview/llaisapi.cpp | 1 + indra/newview/llviewerinventory.cpp | 351 +++--------------------------------- indra/newview/llviewerinventory.h | 9 +- 3 files changed, 29 insertions(+), 332 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp index 6adf35efb8..393e5c0a68 100755 --- a/indra/newview/llaisapi.cpp +++ b/indra/newview/llaisapi.cpp @@ -202,6 +202,7 @@ UpdateItemCommand::UpdateItemCommand(const LLUUID& item_id, } std::string url = cap + std::string("/item/") + item_id.asString(); LL_DEBUGS("Inventory") << "url: " << url << llendl; + LL_DEBUGS("Inventory") << "request: " << ll_pretty_print_sd(mUpdates) << llendl; LLCurl::ResponderPtr responder = this; LLSD headers; headers["Content-Type"] = "application/llsd+xml"; diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 57d7d4fef6..55575764b9 100755 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -259,271 +259,6 @@ public: }; LLInventoryHandler gInventoryHandler; -#if 0 // DELETE these when working in their new home - -///---------------------------------------------------------------------------- -/// Classes for AISv3 support. -///---------------------------------------------------------------------------- -class AISCommand: public LLHTTPClient::Responder -{ -public: - typedef boost::function<void()> command_func_type; - - AISCommand(LLPointer<LLInventoryCallback> callback): - mCallback(callback) - { - mRetryPolicy = new LLAdaptiveRetryPolicy(1.0, 32.0, 2.0, 10); - } - - virtual ~AISCommand() - { - } - - void run_command() - { - mCommandFunc(); - } - - void setCommandFunc(command_func_type command_func) - { - mCommandFunc = command_func; - } - - // Need to do command-specific parsing to get an id here. May or - // may not need to bother, since most LLInventoryCallbacks do - // their work in the destructor. - virtual bool getResponseUUID(const LLSD& content, LLUUID& id) - { - return false; - } - - /* virtual */ void httpSuccess() - { - // Command func holds a reference to self, need to release it - // after a success or final failure. - setCommandFunc(no_op); - - const LLSD& content = getContent(); - if (!content.isMap()) - { - failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content); - return; - } - mRetryPolicy->onSuccess(); - - gInventory.onAISUpdateReceived("AISCommand", content); - - if (mCallback) - { - LLUUID item_id; // will default to null if parse fails. - getResponseUUID(content,item_id); - mCallback->fire(item_id); - } - } - - /*virtual*/ void httpFailure() - { - const LLSD& content = getContent(); - S32 status = getStatus(); - const std::string& reason = getReason(); - const LLSD& headers = getResponseHeaders(); - if (!content.isMap()) - { - LL_DEBUGS("Inventory") << "Malformed response contents " << content - << " status " << status << " reason " << reason << llendl; - } - else - { - LL_DEBUGS("Inventory") << "failed with content: " << ll_pretty_print_sd(content) - << " status " << status << " reason " << reason << llendl; - } - mRetryPolicy->onFailure(status, headers); - F32 seconds_to_wait; - if (mRetryPolicy->shouldRetry(seconds_to_wait)) - { - doAfterInterval(boost::bind(&AISCommand::run_command,this),seconds_to_wait); - } - else - { - // Command func holds a reference to self, need to release it - // after a success or final failure. - setCommandFunc(no_op); - } - } - - static bool getCap(std::string& cap) - { - if (gAgent.getRegion()) - { - cap = gAgent.getRegion()->getCapability("InventoryAPIv3"); - } - if (!cap.empty()) - { - return true; - } - return false; - } - -private: - command_func_type mCommandFunc; - LLPointer<LLHTTPRetryPolicy> mRetryPolicy; - LLPointer<LLInventoryCallback> mCallback; -}; - -class RemoveItemCommand: public AISCommand -{ -public: - RemoveItemCommand(const LLUUID& item_id, - LLPointer<LLInventoryCallback> callback): - AISCommand(callback) - { - std::string cap; - if (!getCap(cap)) - { - llwarns << "No cap found" << llendl; - return; - } - std::string url = cap + std::string("/item/") + item_id.asString(); - LL_DEBUGS("Inventory") << "url: " << url << llendl; - LLHTTPClient::ResponderPtr responder = this; - LLSD headers; - F32 timeout = HTTP_REQUEST_EXPIRY_SECS; - command_func_type cmd = boost::bind(&LLHTTPClient::del, url, responder, headers, timeout); - setCommandFunc(cmd); - } -}; - -class RemoveCategoryCommand: public AISCommand -{ -public: - RemoveCategoryCommand(const LLUUID& item_id, - LLPointer<LLInventoryCallback> callback): - AISCommand(callback) - { - std::string cap; - if (!getCap(cap)) - { - llwarns << "No cap found" << llendl; - return; - } - std::string url = cap + std::string("/category/") + item_id.asString(); - LL_DEBUGS("Inventory") << "url: " << url << llendl; - LLHTTPClient::ResponderPtr responder = this; - LLSD headers; - F32 timeout = HTTP_REQUEST_EXPIRY_SECS; - command_func_type cmd = boost::bind(&LLHTTPClient::del, url, responder, headers, timeout); - setCommandFunc(cmd); - } -}; - -class PurgeDescendentsCommand: public AISCommand -{ -public: - PurgeDescendentsCommand(const LLUUID& item_id, - LLPointer<LLInventoryCallback> callback): - AISCommand(callback) - { - std::string cap; - if (!getCap(cap)) - { - llwarns << "No cap found" << llendl; - return; - } - std::string url = cap + std::string("/category/") + item_id.asString() + "/children"; - LL_DEBUGS("Inventory") << "url: " << url << llendl; - LLCurl::ResponderPtr responder = this; - LLSD headers; - F32 timeout = HTTP_REQUEST_EXPIRY_SECS; - command_func_type cmd = boost::bind(&LLHTTPClient::del, url, responder, headers, timeout); - setCommandFunc(cmd); - } -}; - -class UpdateItemCommand: public AISCommand -{ -public: - UpdateItemCommand(const LLUUID& item_id, - const LLSD& updates, - LLPointer<LLInventoryCallback> callback): - mUpdates(updates), - AISCommand(callback) - { - std::string cap; - if (!getCap(cap)) - { - llwarns << "No cap found" << llendl; - return; - } - std::string url = cap + std::string("/item/") + item_id.asString(); - LL_DEBUGS("Inventory") << "url: " << url << llendl; - LLCurl::ResponderPtr responder = this; - LLSD headers; - headers["Content-Type"] = "application/llsd+xml"; - F32 timeout = HTTP_REQUEST_EXPIRY_SECS; - command_func_type cmd = boost::bind(&LLHTTPClient::patch, url, mUpdates, responder, headers, timeout); - setCommandFunc(cmd); - } -private: - LLSD mUpdates; -}; - -class UpdateCategoryCommand: public AISCommand -{ -public: - UpdateCategoryCommand(const LLUUID& item_id, - const LLSD& updates, - LLPointer<LLInventoryCallback> callback): - mUpdates(updates), - AISCommand(callback) - { - std::string cap; - if (!getCap(cap)) - { - llwarns << "No cap found" << llendl; - return; - } - std::string url = cap + std::string("/category/") + item_id.asString(); - LL_DEBUGS("Inventory") << "url: " << url << llendl; - LLCurl::ResponderPtr responder = this; - LLSD headers; - headers["Content-Type"] = "application/llsd+xml"; - F32 timeout = HTTP_REQUEST_EXPIRY_SECS; - command_func_type cmd = boost::bind(&LLHTTPClient::patch, url, mUpdates, responder, headers, timeout); - setCommandFunc(cmd); - } -private: - LLSD mUpdates; -}; - -class SlamFolderCommand: public AISCommand -{ -public: - SlamFolderCommand(const LLUUID& folder_id, const LLSD& contents, LLPointer<LLInventoryCallback> callback): - mContents(contents), - AISCommand(callback) - { - std::string cap; - if (!getCap(cap)) - { - llwarns << "No cap found" << llendl; - return; - } - LLUUID tid; - tid.generate(); - std::string url = cap + std::string("/category/") + folder_id.asString() + "/links?tid=" + tid.asString(); - llinfos << url << llendl; - LLCurl::ResponderPtr responder = this; - LLSD headers; - headers["Content-Type"] = "application/llsd+xml"; - F32 timeout = HTTP_REQUEST_EXPIRY_SECS; - command_func_type cmd = boost::bind(&LLHTTPClient::put, url, mContents, responder, headers, timeout); - setCommandFunc(cmd); - } -private: - LLSD mContents; -}; -#endif - ///---------------------------------------------------------------------------- /// Class LLViewerInventoryItem ///---------------------------------------------------------------------------- @@ -718,23 +453,9 @@ void LLViewerInventoryItem::setTransactionID(const LLTransactionID& transaction_ { mTransactionID = transaction_id; } -// virtual -void LLViewerInventoryItem::packMessage(LLMessageSystem* msg) const -{ - static const LLSD updates; - packUpdateMessage(msg,updates); -} -void LLViewerInventoryItem::packUpdateMessage(LLMessageSystem* msg, const LLSD& updates) const +void LLViewerInventoryItem::packMessage(LLMessageSystem* msg) const { - for (LLSD::map_const_iterator it = updates.beginMap(); it != updates.endMap(); ++it) - { - if ((it->first != "desc") && (it->first != "name")) - { - llerrs << "unhandled field: " << it->first << llendl; - } - } - msg->addUUIDFast(_PREHASH_ItemID, mUUID); msg->addUUIDFast(_PREHASH_FolderID, mParentUUID); mPermissions.packMessage(msg); @@ -745,26 +466,8 @@ void LLViewerInventoryItem::packUpdateMessage(LLMessageSystem* msg, const LLSD& msg->addS8Fast(_PREHASH_InvType, type); msg->addU32Fast(_PREHASH_Flags, mFlags); mSaleInfo.packMessage(msg); - if (updates.has("name")) - { - std::string new_name = updates["name"].asString(); - LLInventoryObject::correctInventoryName(new_name); - msg->addStringFast(_PREHASH_Name, new_name); - } - else - { - msg->addStringFast(_PREHASH_Name, mName); - } - if (updates.has("desc")) - { - std::string new_desc = updates["desc"].asString(); - LLInventoryItem::correctInventoryDescription(new_desc); - msg->addStringFast(_PREHASH_Description, new_desc); - } - else - { - msg->addStringFast(_PREHASH_Description, mDescription); - } + msg->addStringFast(_PREHASH_Name, mName); + msg->addStringFast(_PREHASH_Description, mDescription); msg->addS32Fast(_PREHASH_CreationDate, mCreationDate); U32 crc = getCRC32(); msg->addU32Fast(_PREHASH_CRC, crc); @@ -881,30 +584,13 @@ void LLViewerInventoryCategory::copyViewerCategory(const LLViewerInventoryCatego } -void LLViewerInventoryCategory::packUpdateMessage(LLMessageSystem* msg, const LLSD& updates) const +void LLViewerInventoryCategory::packMessage(LLMessageSystem* msg) const { - for (LLSD::map_const_iterator it = updates.beginMap(); it != updates.endMap(); ++it) - { - if (it->first != "name") - { - llerrs << "unhandled field: " << it->first << llendl; - } - } - msg->addUUIDFast(_PREHASH_FolderID, mUUID); msg->addUUIDFast(_PREHASH_ParentID, mParentUUID); S8 type = static_cast<S8>(mPreferredType); msg->addS8Fast(_PREHASH_Type, type); - if (updates.has("name")) - { - std::string new_name = updates["name"].asString(); - LLInventoryObject::correctInventoryName(new_name); - msg->addStringFast(_PREHASH_Name, new_name); - } - else - { - msg->addStringFast(_PREHASH_Name, mName); - } + msg->addStringFast(_PREHASH_Name, mName); } void LLViewerInventoryCategory::updateParentOnServer(BOOL restamp) const @@ -1475,10 +1161,16 @@ void update_inventory_item( LL_DEBUGS("Inventory") << "item_id: [" << item_id << "] name " << (obj ? obj->getName() : "(NOT FOUND)") << llendl; if(obj) { + LLPointer<LLViewerInventoryItem> new_item(new LLViewerInventoryItem); + new_item->copyViewerItem(obj); + new_item->fromLLSD(updates,false); + std::string cap; if (AISCommand::getCap(cap)) { - LLPointer<AISCommand> cmd_ptr = new UpdateItemCommand(item_id, updates, cb); + LLSD new_llsd; + new_item->asLLSD(new_llsd); + LLPointer<AISCommand> cmd_ptr = new UpdateItemCommand(item_id, new_llsd, cb); cmd_ptr->run_command(); } else // no cap @@ -1488,13 +1180,15 @@ void update_inventory_item( msg->nextBlockFast(_PREHASH_AgentData); msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - msg->addUUIDFast(_PREHASH_TransactionID, obj->getTransactionID()); + msg->addUUIDFast(_PREHASH_TransactionID, new_item->getTransactionID()); msg->nextBlockFast(_PREHASH_InventoryData); msg->addU32Fast(_PREHASH_CallbackID, 0); - obj->packUpdateMessage(msg, updates); + new_item->packMessage(msg); gAgent.sendReliableMessage(); - gInventory.onItemUpdated(item_id, updates,true); + LLInventoryModel::LLCategoryUpdate up(new_item->getParentUUID(), 0); + gInventory.accountForUpdate(up); + gInventory.updateItem(new_item); if (cb) { cb->fire(item_id); @@ -1518,11 +1212,14 @@ void update_inventory_category( return; } + LLPointer<LLViewerInventoryCategory> new_cat = new LLViewerInventoryCategory(obj); + new_cat->fromLLSD(updates); //std::string cap; // FIXME - restore this once the back-end work has been done. if (0) // if (AISCommand::getCap(cap)) { - LLPointer<AISCommand> cmd_ptr = new UpdateCategoryCommand(cat_id, updates, cb); + LLSD new_llsd = new_cat->asLLSD(); + LLPointer<AISCommand> cmd_ptr = new UpdateCategoryCommand(cat_id, new_llsd, cb); cmd_ptr->run_command(); } else // no cap @@ -1533,10 +1230,12 @@ void update_inventory_category( msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); msg->nextBlockFast(_PREHASH_FolderData); - obj->packUpdateMessage(msg, updates); + new_cat->packMessage(msg); gAgent.sendReliableMessage(); - gInventory.onCategoryUpdated(cat_id, updates); + LLInventoryModel::LLCategoryUpdate up(new_cat->getParentUUID(), 0); + gInventory.accountForUpdate(up); + gInventory.updateCategory(new_cat); if (cb) { cb->fire(cat_id); diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h index 9af71dfc9c..032efd9542 100755 --- a/indra/newview/llviewerinventory.h +++ b/indra/newview/llviewerinventory.h @@ -122,7 +122,7 @@ public: virtual void updateServer(BOOL is_new) const; void fetchFromServer(void) const; - //virtual void packMessage(LLMessageSystem* msg) const; + virtual void packMessage(LLMessageSystem* msg) const; virtual BOOL unpackMessage(LLMessageSystem* msg, const char* block, S32 block_num = 0); virtual BOOL unpackMessage(LLSD item); virtual BOOL importFile(LLFILE* fp); @@ -138,9 +138,6 @@ public: void setComplete(BOOL complete) { mIsComplete = complete; } //void updateAssetOnServer() const; - virtual void packMessage(LLMessageSystem* msg) const; - // Contents of updates will take precedence over fields of item where they differ. - void packUpdateMessage(LLMessageSystem* msg, const LLSD& updates) const; virtual void setTransactionID(const LLTransactionID& transaction_id); struct comparePointers { @@ -202,6 +199,8 @@ public: virtual void updateParentOnServer(BOOL restamp_children) const; virtual void updateServer(BOOL is_new) const; + virtual void packMessage(LLMessageSystem* msg) const; + const LLUUID& getOwnerID() const { return mOwnerID; } // Version handling @@ -226,8 +225,6 @@ public: void determineFolderType(); void changeType(LLFolderType::EType new_folder_type); - void packUpdateMessage(LLMessageSystem* msg, const LLSD& updates) const; - private: friend class LLInventoryModel; void localizeName(); // intended to be called from the LLInventoryModel -- cgit v1.2.3 From 56cf4297f3c603b8c39880ee20ce0fd6fb3341e5 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Thu, 13 Jun 2013 16:07:02 -0400 Subject: SH-4250 WIP - logging tweaks and cleanup --- indra/newview/llappearancemgr.cpp | 4 +++- indra/newview/llfriendcard.cpp | 2 +- indra/newview/llimview.cpp | 16 ++++++++-------- indra/newview/lltexturefetch.cpp | 3 +-- indra/newview/llviewertexture.cpp | 21 +++++++++++++++++++++ indra/newview/llviewertexture.h | 2 ++ indra/newview/llvoavatar.cpp | 10 ++++++++-- 7 files changed, 44 insertions(+), 14 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 2698e2db35..f5f6faf6b6 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -2625,7 +2625,7 @@ void LLAppearanceMgr::updateIsDirty() if(outfit_items.count() != cof_items.count()) { - LL_DEBUGS("Avatar") << "item count different" << llendl; + LL_DEBUGS("Avatar") << "item count different - base " << outfit_items.count() << " cof " << cof_items.count() << llendl; // Current outfit folder should have one more item than the outfit folder. // this one item is the link back to the outfit folder itself. mOutfitIsDirty = true; @@ -2666,6 +2666,8 @@ void LLAppearanceMgr::updateIsDirty() } } } + llassert(!mOutfitIsDirty); + LL_DEBUGS("Avatar") << "clean" << llendl; } // *HACK: Must match name in Library or agent inventory diff --git a/indra/newview/llfriendcard.cpp b/indra/newview/llfriendcard.cpp index 5c6ce9d311..0ce0534802 100755 --- a/indra/newview/llfriendcard.cpp +++ b/indra/newview/llfriendcard.cpp @@ -86,7 +86,7 @@ const LLUUID& get_folder_uuid(const LLUUID& parentFolderUUID, LLInventoryCollect if (cats_count > 1) { - LL_WARNS("LLFriendCardsManager") + LL_WARNS_ONCE("LLFriendCardsManager") << "There is more than one Friend card folder." << "The first folder will be used." << LL_ENDL; diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 9c0af79923..aed0414c50 100755 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -899,7 +899,7 @@ void LLIMModel::getMessagesSilently(const LLUUID& session_id, std::list<LLSD>& m LLIMSession* session = findIMSession(session_id); if (!session) { - llwarns << "session " << session_id << "does not exist " << llendl; + llwarns << "session " << session_id << " does not exist " << llendl; return; } @@ -921,7 +921,7 @@ void LLIMModel::sendNoUnreadMessages(const LLUUID& session_id) LLIMSession* session = findIMSession(session_id); if (!session) { - llwarns << "session " << session_id << "does not exist " << llendl; + llwarns << "session " << session_id << " does not exist " << llendl; return; } @@ -941,7 +941,7 @@ bool LLIMModel::addToHistory(const LLUUID& session_id, const std::string& from, if (!session) { - llwarns << "session " << session_id << "does not exist " << llendl; + llwarns << "session " << session_id << " does not exist " << llendl; return false; } @@ -1016,7 +1016,7 @@ LLIMModel::LLIMSession* LLIMModel::addMessageSilently(const LLUUID& session_id, if (!session) { - llwarns << "session " << session_id << "does not exist " << llendl; + llwarns << "session " << session_id << " does not exist " << llendl; return NULL; } @@ -1053,7 +1053,7 @@ const std::string LLIMModel::getName(const LLUUID& session_id) const if (!session) { - llwarns << "session " << session_id << "does not exist " << llendl; + llwarns << "session " << session_id << " does not exist " << llendl; return LLTrans::getString("no_session_message"); } @@ -1065,7 +1065,7 @@ const S32 LLIMModel::getNumUnread(const LLUUID& session_id) const LLIMSession* session = findIMSession(session_id); if (!session) { - llwarns << "session " << session_id << "does not exist " << llendl; + llwarns << "session " << session_id << " does not exist " << llendl; return -1; } @@ -1089,7 +1089,7 @@ EInstantMessage LLIMModel::getType(const LLUUID& session_id) const LLIMSession* session = findIMSession(session_id); if (!session) { - llwarns << "session " << session_id << "does not exist " << llendl; + llwarns << "session " << session_id << " does not exist " << llendl; return IM_COUNT; } @@ -1101,7 +1101,7 @@ LLVoiceChannel* LLIMModel::getVoiceChannel( const LLUUID& session_id ) const LLIMSession* session = findIMSession(session_id); if (!session) { - llwarns << "session " << session_id << "does not exist " << llendl; + llwarns << "session " << session_id << " does not exist " << llendl; return NULL; } diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index f7fbb19bdc..70e2c0f2dc 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -1382,7 +1382,6 @@ bool LLTextureFetchWorker::doWork(S32 param) //recordTextureStart(false); //setPriority(LLWorkerThread::PRIORITY_LOW | mWorkPriority); - LL_DEBUGS("Texture") << mID << " does this happen?" << llendl; return false; } } @@ -2656,7 +2655,7 @@ bool LLTextureFetch::createRequest(FTType f_type, const std::string& url, const worker->unlockWorkMutex(); // -Mw } - LL_DEBUGS("Texture") << "REQUESTED: " << id << " Discard: " << desired_discard << " size " << desired_size << llendl; + LL_DEBUGS("Texture") << "REQUESTED: " << id << " f_type " << fttype_to_string(f_type) << " Discard: " << desired_discard << " size " << desired_size << llendl; return true; } diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 45b402f0f6..4c9ca8b1d7 100755 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -901,6 +901,27 @@ void LLViewerTexture::updateBindStatsForTester() //end of LLViewerTexture //---------------------------------------------------------------------------------------------- +const std::string& fttype_to_string(const FTType& fttype) +{ + static const std::string ftt_unknown("FTT_UNKNOWN"); + static const std::string ftt_default("FTT_DEFAULT"); + static const std::string ftt_server_bake("FTT_SERVER_BAKE"); + static const std::string ftt_host_bake("FTT_HOST_BAKE"); + static const std::string ftt_map_tile("FTT_MAP_TILE"); + static const std::string ftt_local_file("FTT_LOCAL_FILE"); + static const std::string ftt_error("FTT_ERROR"); + switch(fttype) + { + case FTT_UNKNOWN: return ftt_unknown; break; + case FTT_DEFAULT: return ftt_default; break; + case FTT_SERVER_BAKE: return ftt_server_bake; break; + case FTT_HOST_BAKE: return ftt_host_bake; break; + case FTT_MAP_TILE: return ftt_map_tile; break; + case FTT_LOCAL_FILE: return ftt_local_file; break; + } + return ftt_error; +} + //---------------------------------------------------------------------------------------------- //start of LLViewerFetchedTexture //---------------------------------------------------------------------------------------------- diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index bf6aadd218..e99d52741d 100755 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -243,6 +243,8 @@ enum FTType FTT_LOCAL_FILE // fetch directly from a local file. }; +const std::string& fttype_to_string(const FTType& fttype); + // //textures are managed in gTextureList. //raw image data is fetched from remote or local cache diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 4593541f35..46b909c4a1 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1881,7 +1881,7 @@ LLViewerFetchedTexture *LLVOAvatar::getBakedTextureImage(const U8 te, const LLUU const std::string url = getImageURL(te,uuid); if (!url.empty()) { - LL_DEBUGS("Avatar") << avString() << "from URL " << url << llendl; + LL_DEBUGS("Avatar") << avString() << "get server-bake image from URL " << url << llendl; result = LLViewerTextureManager::getFetchedTextureFromUrl( url, FTT_SERVER_BAKE, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE, 0, 0, uuid); if (result->isMissingAsset()) @@ -1891,7 +1891,7 @@ LLViewerFetchedTexture *LLVOAvatar::getBakedTextureImage(const U8 te, const LLUU } else { - LL_DEBUGS("Avatar") << avString() << "from host " << uuid << llendl; + LL_DEBUGS("Avatar") << avString() << "get old-bake image from host " << uuid << llendl; LLHost host = getObjectHost(); result = LLViewerTextureManager::getFetchedTexture( uuid, FTT_HOST_BAKE, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE, 0, 0, host); @@ -7093,9 +7093,15 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) && mBakedTextureDatas[baked_index].mLastTextureID != IMG_DEFAULT && baked_index != BAKED_SKIRT) { + LL_DEBUGS("Avatar") << avString() << "sb " << (S32) isUsingServerBakes() << " baked_index " << (S32) baked_index << " using mLastTextureID " << mBakedTextureDatas[baked_index].mLastTextureID << llendl; setTEImage(mBakedTextureDatas[baked_index].mTextureIndex, LLViewerTextureManager::getFetchedTexture(mBakedTextureDatas[baked_index].mLastTextureID, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE)); } + else + { + LL_DEBUGS("Avatar") << avString() << "sb " << (S32) isUsingServerBakes() << " baked_index " << (S32) baked_index << " using texture id " + << getTE(mBakedTextureDatas[baked_index].mTextureIndex)->getID() << llendl; + } } // runway - was -- cgit v1.2.3 From 8c35b1b58bad66bfb5302e598536c0262263cbcb Mon Sep 17 00:00:00 2001 From: "prep@lindenlab.com" <prep@lindenlab.com> Date: Fri, 14 Jun 2013 12:34:45 -0500 Subject: WIP: sh-4035 backed out changes to appearance window confirmation --- indra/newview/llfloatersidepanelcontainer.cpp | 96 +++---------- indra/newview/llfloatersidepanelcontainer.h | 16 +-- indra/newview/llsidepanelappearance.cpp | 160 +-------------------- indra/newview/llsidepanelappearance.h | 24 +--- .../newview/skins/default/xui/en/notifications.xml | 34 +---- 5 files changed, 27 insertions(+), 303 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloatersidepanelcontainer.cpp b/indra/newview/llfloatersidepanelcontainer.cpp index 02216420da..5f9556a870 100755 --- a/indra/newview/llfloatersidepanelcontainer.cpp +++ b/indra/newview/llfloatersidepanelcontainer.cpp @@ -40,29 +40,13 @@ const std::string LLFloaterSidePanelContainer::sMainPanelName("main_panel"); LLFloaterSidePanelContainer::LLFloaterSidePanelContainer(const LLSD& key, const Params& params) -: LLFloater(key, params) -, mAppQuiting( false ) +: LLFloater(key, params) { // Prevent transient floaters (e.g. IM windows) from hiding // when this floater is clicked. LLTransientFloaterMgr::getInstance()->addControlView(LLTransientFloaterMgr::GLOBAL, this); - //We want this container to handle the shutdown logic of the sidepanelappearance. - mVerifyUponClose = TRUE; } -BOOL LLFloaterSidePanelContainer::postBuild() -{ - setCloseConfirmationCallback( boost::bind(&LLFloaterSidePanelContainer::onConfirmationClose,this,_2)); - return TRUE; -} - -void LLFloaterSidePanelContainer::onConfirmationClose( const LLSD &confirm ) -{ - mAppQuiting = confirm.asBoolean(); - onClickCloseBtn(); -} - - LLFloaterSidePanelContainer::~LLFloaterSidePanelContainer() { LLTransientFloaterMgr::getInstance()->removeControlView(LLTransientFloaterMgr::GLOBAL, this); @@ -71,34 +55,26 @@ LLFloaterSidePanelContainer::~LLFloaterSidePanelContainer() void LLFloaterSidePanelContainer::onOpen(const LLSD& key) { getChild<LLPanel>(sMainPanelName)->onOpen(key); - mAppQuiting = false; -} - -void LLFloaterSidePanelContainer::onClose( bool app_quitting ) -{ - if (! mAppQuiting ) { mForceCloseAfterVerify = true; } - LLSidepanelAppearance* panel = getSidePanelAppearance(); - if ( panel ) - { - panel->mRevertSet = true; - panel->onCloseFromAppearance( this ); - } } void LLFloaterSidePanelContainer::onClickCloseBtn() { - LLSidepanelAppearance* panel = getSidePanelAppearance(); - if ( panel ) - { - panel->onClose( this ); - } - else + LLPanelOutfitEdit* panel_outfit_edit = + dynamic_cast<LLPanelOutfitEdit*>(LLFloaterSidePanelContainer::getPanel("appearance", "panel_outfit_edit")); + if (panel_outfit_edit) { - LLFloater::onClickCloseBtn(); + LLFloater *parent = gFloaterView->getParentFloater(panel_outfit_edit); + if (parent == this ) + { + LLSidepanelAppearance* panel_appearance = dynamic_cast<LLSidepanelAppearance*>(getPanel("appearance")); + if ( panel_appearance ) + { + panel_appearance->getWearable()->onClose(); + panel_appearance->showOutfitsInventoryPanel(); + } + } } -} -void LLFloaterSidePanelContainer::close() -{ + LLFloater::onClickCloseBtn(); } @@ -109,7 +85,7 @@ LLPanel* LLFloaterSidePanelContainer::openChildPanel(const std::string& panel_na if (!getVisible()) { - openFloater(); + openFloater(); } LLPanel* panel = NULL; @@ -130,30 +106,10 @@ LLPanel* LLFloaterSidePanelContainer::openChildPanel(const std::string& panel_na void LLFloaterSidePanelContainer::showPanel(const std::string& floater_name, const LLSD& key) { - //If we're already open then check whether anything is dirty - LLFloaterSidePanelContainer* floaterp = LLFloaterReg::getTypedInstance<LLFloaterSidePanelContainer>(floater_name); + LLFloaterSidePanelContainer* floaterp = LLFloaterReg::getTypedInstance<LLFloaterSidePanelContainer>(floater_name); if (floaterp) { - if ( floaterp->getVisible() ) - { - LLSidepanelAppearance* panel = floaterp->getSidePanelAppearance(); - if ( panel ) - { - if ( panel->checkForDirtyEdits() ) - { - panel->onClickConfirmExitWithoutSaveIntoAppearance( floaterp ); - } - else - { - //or a call into some new f() that just shows inv panel? - floaterp->openChildPanel(sMainPanelName, key); - } - } - } - else - { - floaterp->openChildPanel(sMainPanelName, key); - } + floaterp->openChildPanel(sMainPanelName, key); } } @@ -177,19 +133,3 @@ LLPanel* LLFloaterSidePanelContainer::getPanel(const std::string& floater_name, return NULL; } - -LLSidepanelAppearance* LLFloaterSidePanelContainer::getSidePanelAppearance() -{ - LLSidepanelAppearance* panel_appearance = NULL; - LLPanelOutfitEdit* panel_outfit_edit = dynamic_cast<LLPanelOutfitEdit*>(LLFloaterSidePanelContainer::getPanel("appearance", "panel_outfit_edit")); - if (panel_outfit_edit) - { - LLFloater *parent = gFloaterView->getParentFloater(panel_outfit_edit); - if (parent == this ) - { - panel_appearance = dynamic_cast<LLSidepanelAppearance*>(getPanel("appearance")); - } - } - return panel_appearance; - -} diff --git a/indra/newview/llfloatersidepanelcontainer.h b/indra/newview/llfloatersidepanelcontainer.h index b276821805..491723471f 100755 --- a/indra/newview/llfloatersidepanelcontainer.h +++ b/indra/newview/llfloatersidepanelcontainer.h @@ -30,8 +30,6 @@ #include "llfloater.h" -class LLSidepanelAppearance; - /** * Class LLFloaterSidePanelContainer * @@ -44,8 +42,6 @@ class LLSidepanelAppearance; */ class LLFloaterSidePanelContainer : public LLFloater { - friend class LLSidePanelAppearance; - private: static const std::string sMainPanelName; @@ -54,15 +50,11 @@ public: ~LLFloaterSidePanelContainer(); /*virtual*/ void onOpen(const LLSD& key); - /*virtual*/ void onClose(bool app_quitting); + /*virtual*/ void onClickCloseBtn(); - /*virtual*/ BOOL postBuild(); - void onConfirmationClose( const LLSD &confirm ); LLPanel* openChildPanel(const std::string& panel_name, const LLSD& params); - void close(); - static void showPanel(const std::string& floater_name, const LLSD& key); static void showPanel(const std::string& floater_name, const std::string& panel_name, const LLSD& key); @@ -86,12 +78,6 @@ public: } return panel; } - -private: - LLSidepanelAppearance* getSidePanelAppearance(); - -public: - bool mAppQuiting; }; #endif // LL_LLFLOATERSIDEPANELCONTAINER_H diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp index 775c148ea1..d25d203feb 100755 --- a/indra/newview/llsidepanelappearance.cpp +++ b/indra/newview/llsidepanelappearance.cpp @@ -48,9 +48,6 @@ #include "llviewerregion.h" #include "llvoavatarself.h" #include "llviewerwearable.h" -#include "llnotificationsutil.h" -#include "llfloatersidepanelcontainer.h" -#include "llviewerfoldertype.h" static LLRegisterPanelClassWrapper<LLSidepanelAppearance> t_appearance("sidepanel_appearance"); @@ -73,139 +70,13 @@ private: LLSidepanelAppearance *mPanel; }; -bool LLSidepanelAppearance::callBackExitWithoutSaveViaBack(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - if ( option == 0 ) - { - LLAppearanceMgr::instance().setOutfitDirty( true ); - showOutfitsInventoryPanel(); - LLAppearanceMgr::getInstance()->wearBaseOutfit(); - return true; - } - return false; -} - -void LLSidepanelAppearance::onCloseFromAppearance(LLFloaterSidePanelContainer* obj) -{ - mLLFloaterSidePanelContainer = obj; - if ( mEditWearable->isAvailable() && mEditWearable->isDirty() ) - { - LLSidepanelAppearance* pSelf = (LLSidepanelAppearance *)this; - LLNotificationsUtil::add("ConfirmExitWithoutSave", LLSD(), LLSD(), boost::bind(&LLSidepanelAppearance::callBackExitWithoutSaveViaClose,pSelf,_1,_2) ); - } - else - { - LLVOAvatarSelf::onCustomizeEnd(FALSE); - toggleWearableEditPanel(FALSE); - mLLFloaterSidePanelContainer->mForceCloseAfterVerify=false; - } -} -bool LLSidepanelAppearance::onSaveCommit(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - if (0 == option) - { - std::string outfit_name = response["message"].asString(); - LLStringUtil::trim(outfit_name); - std::string current_outfit_name; - - LLAppearanceMgr::getInstance()->getBaseOutfitName(current_outfit_name); - - if ( current_outfit_name == outfit_name ) - { - LLAppearanceMgr::getInstance()->updateBaseOutfit(); - } - else - { - LLUUID outfit_folder = LLAppearanceMgr::getInstance()->makeNewOutfitLinks( outfit_name,FALSE ); - } - - LLVOAvatarSelf::onCustomizeEnd( FALSE ); - mLLFloaterSidePanelContainer->close(); - } - - return false; -} -bool LLSidepanelAppearance::callBackExitWithoutSaveViaClose(const LLSD& notification, const LLSD& response) -{ S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - if ( option == 0 ) - { - std::string outfit_name; - if (!LLAppearanceMgr::getInstance()->getBaseOutfitName(outfit_name)) - { - outfit_name = LLViewerFolderType::lookupNewCategoryName(LLFolderType::FT_OUTFIT); - } - - LLSD args; - args["DESC"] = outfit_name; - - LLSD payload; - LLNotificationsUtil::add("SaveOutfitEither", args, payload, boost::bind(&LLSidepanelAppearance::onSaveCommit, this, _1, _2)); - showOutfitEditPanel(); - return false; - } - else if ( option == 1 ) - { - mEditWearable->revertChanges(); - toggleWearableEditPanel(FALSE); - showOutfitEditPanel(); - LLVOAvatarSelf::onCustomizeEnd( FALSE ); - if ( !mLLFloaterSidePanelContainer->mAppQuiting ) - { - mRevertSet = true; - } - else - { - mLLFloaterSidePanelContainer->closeFloater( true ); - } - return false; - } - mLLFloaterSidePanelContainer->mForceCloseAfterVerify = false; - return false; -} - -void LLSidepanelAppearance::onClickConfirmExitWithoutSaveIntoAppearance( LLFloaterSidePanelContainer* obj ) -{ - mLLFloaterSidePanelContainer = obj; - if ( LLAppearanceMgr::getInstance()->isOutfitDirty() || mEditWearable->isDirty() ) - { - LLSidepanelAppearance* pSelf = (LLSidepanelAppearance *)this; - LLNotificationsUtil::add("ConfirmExitWithoutSave", LLSD(), LLSD(), boost::bind(&LLSidepanelAppearance::callBackExitWithoutSaveViaClose,pSelf,_1,_2) ); - } - else - { - showOutfitsInventoryPanel(); - } -} -void LLSidepanelAppearance::onClickConfirmExitWithoutSaveViaBack() -{ - showOutfitsInventoryPanel(); -} - -void LLSidepanelAppearance::onClose(LLFloaterSidePanelContainer* obj) -{ mLLFloaterSidePanelContainer = obj; - if ( mEditWearable->isAvailable() && mEditWearable->isDirty() ) - { - LLSidepanelAppearance* pSelf = (LLSidepanelAppearance *)this; - LLNotificationsUtil::add("ConfirmExitWithoutSave", LLSD(), LLSD(), boost::bind(&LLSidepanelAppearance::callBackExitWithoutSaveViaClose,pSelf,_1,_2) ); - } - else - { - LLVOAvatarSelf::onCustomizeEnd(FALSE); - mLLFloaterSidePanelContainer->close(); - } -} - LLSidepanelAppearance::LLSidepanelAppearance() : LLPanel(), mFilterSubString(LLStringUtil::null), mFilterEditor(NULL), mOutfitEdit(NULL), mCurrOutfitPanel(NULL), - mOpened(false), - mSidePanelJustOpened(true), - mRevertSet(false) + mOpened(false) { LLOutfitObserver& outfit_observer = LLOutfitObserver::instance(); outfit_observer.addBOFReplacedCallback(boost::bind(&LLSidepanelAppearance::refreshCurrentOutfitName, this, "")); @@ -214,8 +85,6 @@ LLSidepanelAppearance::LLSidepanelAppearance() : gAgentWearables.addLoadingStartedCallback(boost::bind(&LLSidepanelAppearance::setWearablesLoading, this, true)); gAgentWearables.addLoadedCallback(boost::bind(&LLSidepanelAppearance::setWearablesLoading, this, false)); - - } LLSidepanelAppearance::~LLSidepanelAppearance() @@ -250,8 +119,8 @@ BOOL LLSidepanelAppearance::postBuild() { LLButton* back_btn = mOutfitEdit->getChild<LLButton>("back_btn"); if (back_btn) - { - back_btn->setClickedCallback(boost::bind(&LLSidepanelAppearance::onClickConfirmExitWithoutSaveViaBack, this)); + { + back_btn->setClickedCallback(boost::bind(&LLSidepanelAppearance::showOutfitsInventoryPanel, this)); } } @@ -275,7 +144,6 @@ BOOL LLSidepanelAppearance::postBuild() setVisibleCallback(boost::bind(&LLSidepanelAppearance::onVisibilityChange,this,_2)); - return TRUE; } @@ -286,15 +154,11 @@ void LLSidepanelAppearance::onOpen(const LLSD& key) { // No specific panel requested. // If we're opened for the first time then show My Outfits. - // Else show outfit edit panel + // Else do nothing. if (!mOpened) { showOutfitsInventoryPanel(); } - else - { - showOutfitEditPanel(); - } } else { @@ -319,12 +183,6 @@ void LLSidepanelAppearance::onOpen(const LLSD& key) void LLSidepanelAppearance::onVisibilityChange(const LLSD &new_visibility) { - //handle leaving and subsequent user verification of discarding any unsaved data - if ( mSidePanelJustOpened ) - { - mSidePanelJustOpened = false; - } - LLSD visibility; visibility["visible"] = new_visibility.asBoolean(); visibility["reset_accordion"] = false; @@ -333,9 +191,8 @@ void LLSidepanelAppearance::onVisibilityChange(const LLSD &new_visibility) void LLSidepanelAppearance::updateToVisibility(const LLSD &new_visibility) { - if (new_visibility["visible"].asBoolean() ) + if (new_visibility["visible"].asBoolean()) { - const BOOL is_outfit_edit_visible = mOutfitEdit && mOutfitEdit->getVisible(); const BOOL is_wearable_edit_visible = mEditWearable && mEditWearable->getVisible(); @@ -596,6 +453,7 @@ void LLSidepanelAppearance::editWearable(LLViewerWearable *wearable, LLView *dat LLSidepanelAppearance *panel = dynamic_cast<LLSidepanelAppearance*>(data); if (panel) { + panel->showOutfitsInventoryPanel(); panel->showWearableEditPanel(wearable, disable_camera_switch); } } @@ -686,9 +544,3 @@ void LLSidepanelAppearance::updateScrollingPanelList() mEditWearable->updateScrollingPanelList(); } } - -bool LLSidepanelAppearance::checkForDirtyEdits() -{ - return ( mEditWearable->isDirty() ) ? true : false; -} - diff --git a/indra/newview/llsidepanelappearance.h b/indra/newview/llsidepanelappearance.h index 5042e92f4b..762f557a80 100755 --- a/indra/newview/llsidepanelappearance.h +++ b/indra/newview/llsidepanelappearance.h @@ -38,11 +38,9 @@ class LLCurrentlyWornFetchObserver; class LLPanelEditWearable; class LLViewerWearable; class LLPanelOutfitsInventory; -class LLFloaterSidePanelContainer; class LLSidepanelAppearance : public LLPanel -{ - +{ LOG_CLASS(LLSidepanelAppearance); public: LLSidepanelAppearance(); @@ -50,9 +48,6 @@ public: /*virtual*/ BOOL postBuild(); /*virtual*/ void onOpen(const LLSD& key); - /*virtual*/ void onClose(LLFloaterSidePanelContainer* obj); - - void onClickCloseBtn(); void refreshCurrentOutfitName(const std::string& name = ""); @@ -70,12 +65,6 @@ public: void updateScrollingPanelList(); void updateToVisibility( const LLSD& new_visibility ); LLPanelEditWearable* getWearable(){ return mEditWearable; } - bool callBackExitWithoutSaveViaBack(const LLSD& notification, const LLSD& response); - void onClickConfirmExitWithoutSaveViaBack(); - bool callBackExitWithoutSaveViaClose(const LLSD& notification, const LLSD& response); - bool checkForDirtyEdits(); - void onClickConfirmExitWithoutSaveIntoAppearance(LLFloaterSidePanelContainer* obj); - void onCloseFromAppearance(LLFloaterSidePanelContainer* obj); private: void onFilterEdit(const std::string& search_string); @@ -88,9 +77,6 @@ private: void toggleOutfitEditPanel(BOOL visible, BOOL disable_camera_switch = FALSE); void toggleWearableEditPanel(BOOL visible, LLViewerWearable* wearable = NULL, BOOL disable_camera_switch = FALSE); - - bool onSaveCommit(const LLSD& notification, const LLSD& response); - LLFilterEditor* mFilterEditor; LLPanelOutfitsInventory* mPanelOutfitsInventory; LLPanelOutfitEdit* mOutfitEdit; @@ -99,7 +85,6 @@ private: LLButton* mOpenOutfitBtn; LLButton* mEditAppearanceBtn; LLButton* mNewOutfitBtn; - LLPanel* mCurrOutfitPanel; LLTextBox* mCurrentLookName; @@ -114,13 +99,6 @@ private: // Gets set to true when we're opened for the first time. bool mOpened; - // Set to true if sidepanel has just been opened - bool mSidePanelJustOpened; - LLFloaterSidePanelContainer* mLLFloaterSidePanelContainer; - -public: - - bool mRevertSet; }; #endif //LL_LLSIDEPANELAPPEARANCE_H diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 860dabdcc8..c3d8a528c5 100755 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -10114,37 +10114,5 @@ Cannot create large prims that intersect other players. Please re-try when othe </notification> - <notification - icon="alertmodal.tga" - name="ConfirmExitWithoutSave" - type="alertmodal"> - You have not saved the changes to your outfit. Would you like to save it now? - <tag>confirm</tag> - <usetemplate - name="yesnocancelbuttons" - notext="Revert" - yestext="Yes" - canceltext="Dismiss"/> - </notification> - - <notification - icon="alertmodal.tga" - label="Save Outfit" - name="SaveOutfitEither" - type="alertmodal"> - <unique/> - Save outfit (defaults to current outfit): - <tag>confirm</tag> - <form name="form"> - <input name="message" type="text"> - [DESC] - </input> - <button - default="true" - index="0" - name="OK" - text="Save"/> - </form> - </notification> - + </notifications> -- cgit v1.2.3 From 2d0b329003d0350c12ce4686f1261e68ce39573b Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Mon, 17 Jun 2013 16:20:17 -0400 Subject: SH-4238 WIP - postpone calling notifyObservers until all deletes are processed. --- indra/newview/llaisapi.cpp | 4 +++- indra/newview/llinventorymodel.cpp | 13 +++++++++---- indra/newview/llinventorymodel.h | 7 +++++-- 3 files changed, 17 insertions(+), 7 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp index 393e5c0a68..21f6482a06 100755 --- a/indra/newview/llaisapi.cpp +++ b/indra/newview/llaisapi.cpp @@ -476,7 +476,9 @@ void AISUpdate::doUpdate() del_it != mObjectsDeleted.end(); ++del_it) { LL_DEBUGS("Inventory") << "deleted item " << *del_it << llendl; - gInventory.onObjectDeletedFromServer(*del_it, false, false); + gInventory.onObjectDeletedFromServer(*del_it, false, false, false); } + + gInventory.notifyObservers(); } diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 6dc193292e..aadf87ab35 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1157,6 +1157,7 @@ void LLInventoryModel::changeCategoryParent(LLViewerInventoryCategory* cat, void LLInventoryModel::onAISUpdateReceived(const std::string& context, const LLSD& update) { + LLTimer timer; if (gSavedSettings.getBOOL("DebugAvatarAppearanceMessage")) { dump_sequential_xml(gAgentAvatarp->getFullname() + "_ais_update", update); @@ -1164,6 +1165,7 @@ void LLInventoryModel::onAISUpdateReceived(const std::string& context, const LLS AISUpdate ais_update(update); // parse update llsd into stuff to do. ais_update.doUpdate(); // execute the updates in the appropriate order. + llinfos << "elapsed: " << timer.getElapsedTimeF32() << llendl; } void LLInventoryModel::onItemUpdated(const LLUUID& item_id, const LLSD& updates, bool update_parent_version) @@ -1316,7 +1318,7 @@ void LLInventoryModel::onDescendentsPurgedFromServer(const LLUUID& object_id, bo // Update model after an item is confirmed as removed from // server. Works for categories or items. -void LLInventoryModel::onObjectDeletedFromServer(const LLUUID& object_id, bool fix_broken_links, bool update_parent_version) +void LLInventoryModel::onObjectDeletedFromServer(const LLUUID& object_id, bool fix_broken_links, bool update_parent_version, bool do_notify_observers) { LLPointer<LLInventoryObject> obj = getObject(object_id); if(obj) @@ -1337,13 +1339,13 @@ void LLInventoryModel::onObjectDeletedFromServer(const LLUUID& object_id, bool f // From purgeObject() LLPreview::hide(object_id); - deleteObject(object_id, fix_broken_links); + deleteObject(object_id, fix_broken_links, do_notify_observers); } } // Delete a particular inventory object by ID. -void LLInventoryModel::deleteObject(const LLUUID& id, bool fix_broken_links) +void LLInventoryModel::deleteObject(const LLUUID& id, bool fix_broken_links, bool do_notify_observers) { lldebugs << "LLInventoryModel::deleteObject()" << llendl; LLPointer<LLInventoryObject> obj = getObject(id); @@ -1402,7 +1404,10 @@ void LLInventoryModel::deleteObject(const LLUUID& id, bool fix_broken_links) { updateLinkedObjectsFromPurge(id); } - notifyObservers(); + if (do_notify_observers) + { + notifyObservers(); + } } void LLInventoryModel::updateLinkedObjectsFromPurge(const LLUUID &baseobj_id) diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index a41a824906..5de951ed05 100755 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -334,7 +334,10 @@ public: // Update model after an item is confirmed as removed from // server. Works for categories or items. - void onObjectDeletedFromServer(const LLUUID& item_id, bool fix_broken_links = true, bool update_parent_version = true); + void onObjectDeletedFromServer(const LLUUID& item_id, + bool fix_broken_links = true, + bool update_parent_version = true, + bool do_notify_observers = true); // Update model after all descendents removed from server. void onDescendentsPurgedFromServer(const LLUUID& object_id, bool fix_broken_links = true); @@ -349,7 +352,7 @@ public: // object from the internal data structures, maintaining a // consistent internal state. No cache accounting, observer // notification, or server update is performed. - void deleteObject(const LLUUID& id, bool fix_broken_links = true); + void deleteObject(const LLUUID& id, bool fix_broken_links = true, bool do_notify_observers = true); /// move Item item_id to Trash void removeItem(const LLUUID& item_id); /// move Category category_id to Trash -- cgit v1.2.3 From 1a42b98a8f55662aed448e9bcd5035082140bbcf Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Mon, 17 Jun 2013 16:56:59 -0400 Subject: SH-4237 WIP - logging cleanup in onAIS handling --- indra/newview/llaisapi.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp index 21f6482a06..e57bbbb0be 100755 --- a/indra/newview/llaisapi.cpp +++ b/indra/newview/llaisapi.cpp @@ -315,7 +315,7 @@ void AISUpdate::parseUpdate(const LLSD& update) } else { - llwarns << "unrecognized embedded field " << field << llendl; + //LL_DEBUGS("Inventory") << "unhandled embedded field " << field << llendl; } } @@ -439,8 +439,9 @@ void AISUpdate::doUpdate() LLViewerInventoryCategory *cat = gInventory.getCategory(id); if (cat->getVersion() != version) { - llwarns << "Possible version mismatch, viewer " << cat->getVersion() - << " server " << version << llendl; + llwarns << "Possible version mismatch for category " << cat->getName() + << ", viewer version " << cat->getVersion() + << " server version " << version << llendl; } } -- cgit v1.2.3 From c67db8e75511de879c69de0faf06a88ac3cc731d Mon Sep 17 00:00:00 2001 From: Nyx Linden <nyx@lindenlab.com> Date: Mon, 17 Jun 2013 18:52:03 -0400 Subject: SH-4274 FIX Adding RegionHandshakeReply flags for SSA Adding a flag to hint to the sim that this viewer knows how to handle AvatarAppearance messages for self in SSA-enabled regions. --- indra/newview/llviewerregion.cpp | 6 +++++- indra/newview/llviewerregion.h | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index b8b53aa6e4..48c050f403 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -1568,7 +1568,11 @@ void LLViewerRegion::unpackRegionHandshake() msg->addUUID("AgentID", gAgent.getID()); msg->addUUID("SessionID", gAgent.getSessionID()); msg->nextBlock("RegionInfo"); - msg->addU32("Flags", 0x0 ); + + U32 flags = 0; + flags |= REGION_HANDSHAKE_SUPPORTS_SELF_APPEARANCE; + + msg->addU32("Flags", flags ); msg->sendReliable(host); } diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index b5fe4677b7..5ac2a83aaf 100755 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -49,6 +49,8 @@ #define WATER 2 const U32 MAX_OBJECT_CACHE_ENTRIES = 50000; +// Region handshake flags +const U32 REGION_HANDSHAKE_SUPPORTS_SELF_APPEARANCE = 1U << 2; class LLEventPoll; class LLVLComposition; -- cgit v1.2.3 From 425ff28e4bc38ba3f7bfeade4a72dce4eba63b54 Mon Sep 17 00:00:00 2001 From: "prep@lindenlab.com" <prep@lindenlab.com> Date: Tue, 18 Jun 2013 10:00:05 -0500 Subject: SH-4275: Fixed regression - appearances are no longer broadcasted before exiting appearance editor --- indra/newview/llsidepanelappearance.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp index d25d203feb..e082859767 100755 --- a/indra/newview/llsidepanelappearance.cpp +++ b/indra/newview/llsidepanelappearance.cpp @@ -452,8 +452,7 @@ void LLSidepanelAppearance::editWearable(LLViewerWearable *wearable, LLView *dat LLFloaterSidePanelContainer::showPanel("appearance", LLSD()); LLSidepanelAppearance *panel = dynamic_cast<LLSidepanelAppearance*>(data); if (panel) - { - panel->showOutfitsInventoryPanel(); + { panel->showWearableEditPanel(wearable, disable_camera_switch); } } -- cgit v1.2.3 From 27fc270c73fdf3db5c07e9ed43b7f4d0994b2cc2 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Tue, 18 Jun 2013 16:51:37 -0400 Subject: SH-4262 WIP - fix for the reordering bug in AIS regions. --- indra/newview/llaisapi.cpp | 7 +++++++ indra/newview/llappearancemgr.cpp | 5 +++++ indra/newview/llviewerinventory.cpp | 3 ++- 3 files changed, 14 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp index 393e5c0a68..aad12a9cc9 100755 --- a/indra/newview/llaisapi.cpp +++ b/indra/newview/llaisapi.cpp @@ -326,6 +326,12 @@ void AISUpdate::parseUpdate(const LLSD& update) { LLUUID item_id = update["item_id"].asUUID(); LLPointer<LLViewerInventoryItem> new_item(new LLViewerInventoryItem); + LLViewerInventoryItem *curr_item = gInventory.getItem(item_id); + if (curr_item) + { + // Default to current values where not provided. + new_item->copyViewerItem(curr_item); + } BOOL rv = new_item->unpackMessage(update); if (rv) { @@ -468,6 +474,7 @@ void AISUpdate::doUpdate() // cases. Maybe break out the update/create cases, in which // case this is update. LL_DEBUGS("Inventory") << "updated item " << item_id << llendl; + //LL_DEBUGS("Inventory") << ll_pretty_print_sd(new_item->asLLSD()) << llendl; gInventory.updateItem(new_item); } diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index f5f6faf6b6..16552f0082 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -3434,7 +3434,12 @@ bool LLAppearanceMgr::moveWearable(LLViewerInventoryItem* item, bool closer_to_b swap_item->setDescription(item->getActualDescription()); item->setDescription(tmp); + // LL_DEBUGS("Inventory") << "swap, item " + // << ll_pretty_print_sd(item->asLLSD()) + // << " swap_item " + // << ll_pretty_print_sd(swap_item->asLLSD()) << llendl; + // FIXME switch to use AISv3 where supported. //items need to be updated on a dataserver item->setComplete(TRUE); item->updateServer(FALSE); diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 55575764b9..26aecd39d1 100755 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -360,7 +360,8 @@ void LLViewerInventoryItem::updateServer(BOOL is_new) const if(gAgent.getID() != mPermissions.getOwner()) { // *FIX: deal with this better. - llwarns << "LLViewerInventoryItem::updateServer() - for unowned item" + llwarns << "LLViewerInventoryItem::updateServer() - for unowned item " + << ll_pretty_print_sd(this->asLLSD()) << llendl; return; } -- cgit v1.2.3 From f88594599c01edff981b6d070f84566fcb7d4ecf Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Tue, 18 Jun 2013 16:54:37 -0400 Subject: SH-4237 WIP - removed somewhat misleading warning --- indra/newview/llaisapi.cpp | 5 ----- 1 file changed, 5 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp index 7e751ad6c7..8037654812 100755 --- a/indra/newview/llaisapi.cpp +++ b/indra/newview/llaisapi.cpp @@ -313,12 +313,7 @@ void AISUpdate::parseUpdate(const LLSD& update) const LLSD& links = embedded["link"]; parseCreatedLinks(links); } - else - { - llwarns << "unrecognized embedded field " << field << llendl; - } } - } // Parse item update at the top level. -- cgit v1.2.3 From 4ffc162492a3fe882af0899ba70e835c80367d09 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Wed, 19 Jun 2013 16:17:33 -0400 Subject: SH-4263 FIX - added yet another level of callback kludgery to updateAppearanceFromCOF() --- indra/newview/llappearancemgr.cpp | 57 ++++++++++++++++++++++++--------------- indra/newview/llappearancemgr.h | 7 +++-- 2 files changed, 40 insertions(+), 24 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 16552f0082..cb32bf9c40 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -436,11 +436,14 @@ S32 LLCallAfterInventoryCopyMgr::sInstanceCount = 0; LLUpdateAppearanceOnDestroy::LLUpdateAppearanceOnDestroy(bool update_base_outfit_ordering, bool enforce_item_restrictions, - bool enforce_ordering): + bool enforce_ordering, + nullary_func_t post_update_func + ): mFireCount(0), mUpdateBaseOrder(update_base_outfit_ordering), mEnforceItemRestrictions(enforce_item_restrictions), - mEnforceOrdering(enforce_ordering) + mEnforceOrdering(enforce_ordering), + mPostUpdateFunc(post_update_func) { selfStartPhase("update_appearance_on_destroy"); } @@ -464,7 +467,10 @@ LLUpdateAppearanceOnDestroy::~LLUpdateAppearanceOnDestroy() selfStopPhase("update_appearance_on_destroy"); - LLAppearanceMgr::instance().updateAppearanceFromCOF(mUpdateBaseOrder, mEnforceItemRestrictions, mEnforceOrdering); + LLAppearanceMgr::instance().updateAppearanceFromCOF(mUpdateBaseOrder, + mEnforceItemRestrictions, + mEnforceOrdering, + mPostUpdateFunc); } } @@ -473,29 +479,34 @@ LLUpdateAppearanceAndEditWearableOnDestroy::LLUpdateAppearanceAndEditWearableOnD { } -LLUpdateAppearanceAndEditWearableOnDestroy::~LLUpdateAppearanceAndEditWearableOnDestroy() +void edit_wearable_and_customize_avatar(LLUUID item_id) { - if (!LLApp::isExiting()) + // Start editing the item if previously requested. + gAgentWearables.editWearableIfRequested(item_id); + + // TODO: camera mode may not be changed if a debug setting is tweaked + if( gAgentCamera.cameraCustomizeAvatar() ) { - LLAppearanceMgr::instance().updateAppearanceFromCOF(); - - // Start editing the item if previously requested. - gAgentWearables.editWearableIfRequested(mItemID); - - // TODO: camera mode may not be changed if a debug setting is tweaked - if( gAgentCamera.cameraCustomizeAvatar() ) + // If we're in appearance editing mode, the current tab may need to be refreshed + LLSidepanelAppearance *panel = dynamic_cast<LLSidepanelAppearance*>( + LLFloaterSidePanelContainer::getPanel("appearance")); + if (panel) { - // If we're in appearance editing mode, the current tab may need to be refreshed - LLSidepanelAppearance *panel = dynamic_cast<LLSidepanelAppearance*>( - LLFloaterSidePanelContainer::getPanel("appearance")); - if (panel) - { - panel->showDefaultSubpart(); - } + panel->showDefaultSubpart(); } } } +LLUpdateAppearanceAndEditWearableOnDestroy::~LLUpdateAppearanceAndEditWearableOnDestroy() +{ + if (!LLApp::isExiting()) + { + LLAppearanceMgr::instance().updateAppearanceFromCOF( + false,true,true, + boost::bind(edit_wearable_and_customize_avatar, mItemID)); + } +} + struct LLFoundData { @@ -1971,7 +1982,8 @@ void LLAppearanceMgr::enforceCOFItemRestrictions(LLPointer<LLInventoryCallback> void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering, bool enforce_item_restrictions, - bool enforce_ordering) + bool enforce_ordering, + nullary_func_t post_update_func) { if (mIsInUpdateAppearanceFromCOF) { @@ -1989,7 +2001,7 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering, // enforce_item_restrictions to false so we don't get // caught in a perpetual loop. LLPointer<LLInventoryCallback> cb( - new LLUpdateAppearanceOnDestroy(update_base_outfit_ordering, false, enforce_ordering)); + new LLUpdateAppearanceOnDestroy(update_base_outfit_ordering, false, enforce_ordering, post_update_func)); enforceCOFItemRestrictions(cb); return; } @@ -2003,7 +2015,7 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering, // to wait for the update callbacks, then (finally!) call // updateAppearanceFromCOF() with no additional COF munging needed. LLPointer<LLInventoryCallback> cb( - new LLUpdateAppearanceOnDestroy(false, false, false)); + new LLUpdateAppearanceOnDestroy(false, false, false, post_update_func)); updateClothingOrderingInfo(LLUUID::null, update_base_outfit_ordering, cb); return; } @@ -2120,6 +2132,7 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering, { doOnIdleRepeating(boost::bind(&LLWearableHoldingPattern::pollFetchCompletion,holder)); } + post_update_func(); } void LLAppearanceMgr::getDescendentsOfAssetType(const LLUUID& category, diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index 9eb26767c4..a257f30ea5 100755 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -51,7 +51,8 @@ public: void updateAppearanceFromCOF(bool update_base_outfit_ordering = false, bool enforce_item_restrictions = true, - bool enforce_ordering = true); + bool enforce_ordering = true, + nullary_func_t post_update_func = no_op); bool needToSaveCOF(); void updateCOF(const LLUUID& category, bool append = false); void wearInventoryCategory(LLInventoryCategory* category, bool copy, bool append); @@ -272,7 +273,8 @@ class LLUpdateAppearanceOnDestroy: public LLInventoryCallback public: LLUpdateAppearanceOnDestroy(bool update_base_outfit_ordering = false, bool enforce_item_restrictions = true, - bool enforce_ordering = true); + bool enforce_ordering = true, + nullary_func_t post_update_func = no_op); virtual ~LLUpdateAppearanceOnDestroy(); /* virtual */ void fire(const LLUUID& inv_item); @@ -281,6 +283,7 @@ private: bool mUpdateBaseOrder; bool mEnforceItemRestrictions; bool mEnforceOrdering; + nullary_func_t mPostUpdateFunc; }; class LLUpdateAppearanceAndEditWearableOnDestroy: public LLInventoryCallback -- cgit v1.2.3 From 01ffa6788793cdecff313b704422f0e814452489 Mon Sep 17 00:00:00 2001 From: Nyx Linden <nyx@lindenlab.com> Date: Fri, 21 Jun 2013 21:21:57 -0400 Subject: SH-4240 FIX Users can set their hover height to 0 Adjusted the startup conditions, and relogging should apply the enforcement as appropriate now. Note that this affects the startup enforcement and should re-test the macro avatar loading bug. --- indra/newview/lltoolmorph.cpp | 4 ++-- indra/newview/llviewerwearable.cpp | 6 ++++-- indra/newview/llviewerwearable.h | 6 +++--- indra/newview/llvoavatar.cpp | 6 +++--- 4 files changed, 12 insertions(+), 10 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/lltoolmorph.cpp b/indra/newview/lltoolmorph.cpp index fa94b52362..71e0509d03 100755 --- a/indra/newview/lltoolmorph.cpp +++ b/indra/newview/lltoolmorph.cpp @@ -151,7 +151,7 @@ void LLVisualParamHint::preRender(BOOL clear_depth) LLViewerWearable* wearable = (LLViewerWearable*)mWearablePtr; if (wearable) { - wearable->setVolitile(TRUE); + wearable->setVolatile(TRUE); } mLastParamWeight = mVisualParam->getWeight(); mWearablePtr->setVisualParamWeight(mVisualParam->getID(), mVisualParamWeight, FALSE); @@ -250,7 +250,7 @@ BOOL LLVisualParamHint::render() LLViewerWearable* wearable = (LLViewerWearable*)mWearablePtr; if (wearable) { - wearable->setVolitile(FALSE); + wearable->setVolatile(FALSE); } gAgentAvatarp->updateVisualParams(); diff --git a/indra/newview/llviewerwearable.cpp b/indra/newview/llviewerwearable.cpp index e8425dc76a..76f94935b8 100644 --- a/indra/newview/llviewerwearable.cpp +++ b/indra/newview/llviewerwearable.cpp @@ -72,14 +72,16 @@ private: static std::string asset_id_to_filename(const LLUUID &asset_id); LLViewerWearable::LLViewerWearable(const LLTransactionID& transaction_id) : - LLWearable() + LLWearable(), + mVolatile(FALSE) { mTransactionID = transaction_id; mAssetID = mTransactionID.makeAssetID(gAgent.getSecureSessionID()); } LLViewerWearable::LLViewerWearable(const LLAssetID& asset_id) : - LLWearable() + LLWearable(), + mVolatile(FALSE) { mAssetID = asset_id; mTransactionID.setNull(); diff --git a/indra/newview/llviewerwearable.h b/indra/newview/llviewerwearable.h index 047b2ce143..ef8c29323e 100644 --- a/indra/newview/llviewerwearable.h +++ b/indra/newview/llviewerwearable.h @@ -68,8 +68,8 @@ public: void setParamsToDefaults(); void setTexturesToDefaults(); - void setVolitile(BOOL volitle) { mVolitle = volitle; } // TRUE when doing preview renders, some updates will be suppressed. - BOOL getVolitile() { return mVolitle; } + void setVolatile(BOOL is_volatile) { mVolatile = is_volatile; } // TRUE when doing preview renders, some updates will be suppressed. + BOOL getVolatile() { return mVolatile; } /*virtual*/ LLUUID getDefaultTextureImageID(LLAvatarAppearanceDefines::ETextureIndex index) const; @@ -98,7 +98,7 @@ protected: LLAssetID mAssetID; LLTransactionID mTransactionID; - BOOL mVolitle; // True when rendering preview images. Can suppress some updates. + BOOL mVolatile; // True when rendering preview images. Can suppress some updates. LLUUID mItemID; // ID of the inventory item in the agent's inventory }; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 46b909c4a1..8c20533b4c 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5223,7 +5223,7 @@ void LLVOAvatar::computeBodySize() // Enforce a constraint to make sure we don't go below 1.1 meters (server-enforced limit) // Camera positioning and other things start to break down when your avatar is "walking" while being fully underground const LLViewerObject * last_object = NULL; - if (isSelf() && getWearableData() && isFullyLoaded() && !LLApp::isQuitting()) + if (isSelf() && getWearableData() && !LLApp::isQuitting()) { // Do not force a hover parameter change while we have pending attachments, which may be mesh-based with // joint offsets. @@ -5246,7 +5246,7 @@ void LLVOAvatar::computeBodySize() last_object = object; llwarns << "attachment at point: " << (*points_iter).first << " object exists: " << object->getAttachmentItemID() << llendl; loaded &=!object->isDrawableState(LLDrawable::REBUILD_ALL); - if (!loaded && shape && !shape->getVolitile()) + if (!loaded && shape && !shape->getVolatile()) { llwarns << "caught unloaded attachment! skipping enforcement" << llendl; } @@ -5259,7 +5259,7 @@ void LLVOAvatar::computeBodySize() { LL_DEBUGS("Avatar") << "scanned at least one object!" << LL_ENDL; } - if (loaded && shape && !shape->getVolitile()) + if (loaded && shape && !shape->getVolatile()) { F32 hover_value = shape->getVisualParamWeight(AVATAR_HOVER); if (hover_value < 0.0f && (mBodySize.mV[VZ] + hover_value < 1.1f)) -- cgit v1.2.3 From 3e0e236f33a866a3962295a99495fd1159532ba8 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Mon, 24 Jun 2013 15:42:27 -0400 Subject: SH-4243 WIP - cleaned up callback structure for createNewCategory, modified makeNewOutfitLinks() to wait for category creation before populating. --- indra/newview/llappearancemgr.cpp | 49 ++++++++++++++------- indra/newview/llappearancemgr.h | 4 +- indra/newview/llfloateropenobject.cpp | 21 +++------ indra/newview/llfloateropenobject.h | 11 +---- indra/newview/llinventorymodel.cpp | 72 ++++++++++++++----------------- indra/newview/llinventorymodel.h | 9 +--- indra/newview/llpaneloutfitsinventory.cpp | 2 +- indra/newview/llstartup.cpp | 4 +- indra/newview/llviewerinventory.cpp | 3 +- indra/newview/llviewerinventory.h | 6 ++- 10 files changed, 89 insertions(+), 92 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index cb32bf9c40..93b0e6f4e7 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1466,6 +1466,7 @@ void LLAppearanceMgr::shallowCopyCategoryContents(const LLUUID& src_id, const LL { case LLAssetType::AT_LINK: { + LL_DEBUGS("Avatar") << "linking inventory item " << item->getName() << llendl; //getActualDescription() is used for a new description //to propagate ordering information saved in descriptions of links link_inventory_item(gAgent.getID(), @@ -1482,6 +1483,7 @@ void LLAppearanceMgr::shallowCopyCategoryContents(const LLUUID& src_id, const LL // Skip copying outfit links. if (catp && catp->getPreferredType() != LLFolderType::FT_OUTFIT) { + LL_DEBUGS("Avatar") << "linking inventory folder " << item->getName() << llendl; link_inventory_item(gAgent.getID(), item->getLinkedUUID(), dst_id, @@ -1496,7 +1498,7 @@ void LLAppearanceMgr::shallowCopyCategoryContents(const LLUUID& src_id, const LL case LLAssetType::AT_BODYPART: case LLAssetType::AT_GESTURE: { - llinfos << "copying inventory item " << item->getName() << llendl; + LL_DEBUGS("Avatar") << "copying inventory item " << item->getName() << llendl; copy_inventory_item(gAgent.getID(), item->getPermissions().getOwner(), item->getUUID(), @@ -2815,11 +2817,14 @@ bool LLAppearanceMgr::updateBaseOutfit() llassert(!isOutfitLocked()); return false; } + + setOutfitLocked(true); gAgentWearables.notifyLoadingStarted(); const LLUUID base_outfit_id = getBaseOutfitUUID(); + LL_DEBUGS("Avatar") << "updating base outfit to " << base_outfit_id << llendl; if (base_outfit_id.isNull()) return false; updateClothingOrderingInfo(); @@ -3334,12 +3339,14 @@ void show_created_outfit(LLUUID& folder_id, bool show_panel = true) return; } + LL_DEBUGS("Avatar") << "called" << llendl; LLSD key; //EXT-7727. For new accounts inventory callback is created during login process // and may be processed after login process is finished if (show_panel) { + LL_DEBUGS("Avatar") << "showing panel" << llendl; LLFloaterSidePanelContainer::showPanel("appearance", "panel_outfits_inventory", key); } @@ -3358,32 +3365,44 @@ void show_created_outfit(LLUUID& folder_id, bool show_panel = true) // link, since, the COF version has changed. There is a race // condition in initial outfit setup which can lead to rez // failures - SH-3860. + LL_DEBUGS("Avatar") << "requesting appearance update after createBaseOutfitLink" << llendl; LLPointer<LLInventoryCallback> cb = new LLUpdateAppearanceOnDestroy; LLAppearanceMgr::getInstance()->createBaseOutfitLink(folder_id, cb); } -LLUUID LLAppearanceMgr::makeNewOutfitLinks(const std::string& new_folder_name, bool show_panel) +void LLAppearanceMgr::onOutfitFolderCreated(const LLSD& result, bool show_panel) { - if (!isAgentAvatarValid()) return LLUUID::null; - - gAgentWearables.notifyLoadingStarted(); - - // First, make a folder in the My Outfits directory. - const LLUUID parent_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MY_OUTFITS); - LLUUID folder_id = gInventory.createNewCategory( - parent_id, - LLFolderType::FT_OUTFIT, - new_folder_name); + LL_DEBUGS("Avatar") << ll_pretty_print_sd(result) << llendl; - updateClothingOrderingInfo(); + LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(no_op_inventory_func, + boost::bind(&LLAppearanceMgr::onOutfitFolderCreatedAndClothingOrdered,this,result,show_panel)); + updateClothingOrderingInfo(LLUUID::null, false, cb); +} +void LLAppearanceMgr::onOutfitFolderCreatedAndClothingOrdered(const LLSD& result, bool show_panel) +{ + LLUUID folder_id = result["folder_id"].asUUID(); LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(no_op_inventory_func, boost::bind(show_created_outfit,folder_id,show_panel)); shallowCopyCategoryContents(getCOF(),folder_id, cb); +} + +void LLAppearanceMgr::makeNewOutfitLinks(const std::string& new_folder_name, bool show_panel) +{ + if (!isAgentAvatarValid()) return; - dumpCat(folder_id,"COF, new outfit"); + LL_DEBUGS("Avatar") << "creating new outfit" << llendl; - return folder_id; + gAgentWearables.notifyLoadingStarted(); + + // First, make a folder in the My Outfits directory. + const LLUUID parent_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MY_OUTFITS); + llsd_func_type func = boost::bind(&LLAppearanceMgr::onOutfitFolderCreated,this,_1,show_panel); + gInventory.createNewCategory( + parent_id, + LLFolderType::FT_OUTFIT, + new_folder_name, + func); } void LLAppearanceMgr::wearBaseOutfit() diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index a257f30ea5..d4993780aa 100755 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -186,7 +186,9 @@ public: void removeItemFromAvatar(const LLUUID& item_id); - LLUUID makeNewOutfitLinks(const std::string& new_folder_name,bool show_panel = true); + void onOutfitFolderCreated(const LLSD& result, bool show_panel); + void onOutfitFolderCreatedAndClothingOrdered(const LLSD& result, bool show_panel); + void makeNewOutfitLinks(const std::string& new_folder_name, bool show_panel = true); bool moveWearable(LLViewerInventoryItem* item, bool closer_to_body); diff --git a/indra/newview/llfloateropenobject.cpp b/indra/newview/llfloateropenobject.cpp index 4bfef8b45f..1c086976ba 100755 --- a/indra/newview/llfloateropenobject.cpp +++ b/indra/newview/llfloateropenobject.cpp @@ -162,21 +162,17 @@ void LLFloaterOpenObject::moveToInventory(bool wear) { parent_category_id = gInventory.getRootFolderID(); } - - LLCategoryCreate* cat_data = new LLCategoryCreate(object_id, wear); - + + llsd_func_type func = boost::bind(LLFloaterOpenObject::callbackCreateInventoryCategory,_1,object_id,wear); LLUUID category_id = gInventory.createNewCategory(parent_category_id, LLFolderType::FT_NONE, name, - callbackCreateInventoryCategory, - (void*)cat_data); + func); //If we get a null category ID, we are using a capability in createNewCategory and we will //handle the following in the callbackCreateInventoryCategory routine. if ( category_id.notNull() ) { - delete cat_data; - LLCatAndWear* data = new LLCatAndWear; data->mCatID = category_id; data->mWear = wear; @@ -198,20 +194,18 @@ void LLFloaterOpenObject::moveToInventory(bool wear) } // static -void LLFloaterOpenObject::callbackCreateInventoryCategory(const LLSD& result, void* data) +void LLFloaterOpenObject::callbackCreateInventoryCategory(const LLSD& result, LLUUID object_id, bool wear) { - LLCategoryCreate* cat_data = (LLCategoryCreate*)data; - - LLUUID category_id = result["folder_id"].asUUID(); LLCatAndWear* wear_data = new LLCatAndWear; + LLUUID category_id = result["folder_id"].asUUID(); wear_data->mCatID = category_id; - wear_data->mWear = cat_data->mWear; + wear_data->mWear = wear; wear_data->mFolderResponded = true; // Copy and/or move the items into the newly created folder. // Ignore any "you're going to break this item" messages. - BOOL success = move_inv_category_world_to_agent(cat_data->mObjectID, category_id, TRUE, + BOOL success = move_inv_category_world_to_agent(object_id, category_id, TRUE, callbackMoveInventory, (void*)wear_data); if (!success) @@ -221,7 +215,6 @@ void LLFloaterOpenObject::callbackCreateInventoryCategory(const LLSD& result, vo LLNotificationsUtil::add("OpenObjectCannotCopy"); } - delete cat_data; } // static diff --git a/indra/newview/llfloateropenobject.h b/indra/newview/llfloateropenobject.h index bf7fe69c65..1d7eecd107 100755 --- a/indra/newview/llfloateropenobject.h +++ b/indra/newview/llfloateropenobject.h @@ -45,15 +45,6 @@ public: void dirty(); - class LLCategoryCreate - { - public: - LLCategoryCreate(LLUUID object_id, bool wear) : mObjectID(object_id), mWear(wear) {} - public: - LLUUID mObjectID; - bool mWear; - }; - struct LLCatAndWear { LLUUID mCatID; @@ -72,7 +63,7 @@ protected: void onClickMoveToInventory(); void onClickMoveAndWear(); - static void callbackCreateInventoryCategory(const LLSD& result, void* data); + static void callbackCreateInventoryCategory(const LLSD& result, LLUUID object_id, bool wear); static void callbackMoveInventory(S32 result, void* data); private: diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index aadf87ab35..82d58523ce 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -472,11 +472,9 @@ class LLCreateInventoryCategoryResponder : public LLHTTPClient::Responder LOG_CLASS(LLCreateInventoryCategoryResponder); public: LLCreateInventoryCategoryResponder(LLInventoryModel* model, - void (*callback)(const LLSD&, void*), - void* user_data) : - mModel(model), - mCallback(callback), - mData(user_data) + boost::optional<llsd_func_type> callback): + mModel(model), + mCallback(callback) { } @@ -497,7 +495,7 @@ protected: } LLUUID category_id = content["folder_id"].asUUID(); - + LL_DEBUGS("Avatar") << ll_pretty_print_sd(content) << llendl; // Add the category to the internal representation LLPointer<LLViewerInventoryCategory> cat = new LLViewerInventoryCategory( category_id, @@ -510,17 +508,15 @@ protected: LLInventoryModel::LLCategoryUpdate update(cat->getParentUUID(), 1); mModel->accountForUpdate(update); mModel->updateCategory(cat); - - if (mCallback && mData) + + if (mCallback) { - mCallback(content, mData); + mCallback.get()(content); } - } private: - void (*mCallback)(const LLSD&, void*); - void* mData; + boost::optional<llsd_func_type> mCallback; LLInventoryModel* mModel; }; @@ -531,8 +527,7 @@ private: LLUUID LLInventoryModel::createNewCategory(const LLUUID& parent_id, LLFolderType::EType preferred_type, const std::string& pname, - void (*callback)(const LLSD&, void*), //Default to NULL - void* user_data) //Default to NULL + boost::optional<llsd_func_type> callback) { LLUUID id; @@ -559,33 +554,32 @@ LLUUID LLInventoryModel::createNewCategory(const LLUUID& parent_id, name.assign(LLViewerFolderType::lookupNewCategoryName(preferred_type)); } - if ( callback && user_data ) //callback required for acked message. + LLViewerRegion* viewer_region = gAgent.getRegion(); + std::string url; + if ( viewer_region ) + url = viewer_region->getCapability("CreateInventoryCategory"); + + if (!url.empty() && callback.get_ptr()) { - LLViewerRegion* viewer_region = gAgent.getRegion(); - std::string url; - if ( viewer_region ) - url = viewer_region->getCapability("CreateInventoryCategory"); + //Let's use the new capability. - if (!url.empty()) - { - //Let's use the new capability. - - LLSD request, body; - body["folder_id"] = id; - body["parent_id"] = parent_id; - body["type"] = (LLSD::Integer) preferred_type; - body["name"] = name; - - request["message"] = "CreateInventoryCategory"; - request["payload"] = body; - - // viewer_region->getCapAPI().post(request); - LLHTTPClient::post( - url, - body, - new LLCreateInventoryCategoryResponder(this, callback, user_data) ); - return LLUUID::null; - } + LLSD request, body; + body["folder_id"] = id; + body["parent_id"] = parent_id; + body["type"] = (LLSD::Integer) preferred_type; + body["name"] = name; + + request["message"] = "CreateInventoryCategory"; + request["payload"] = body; + + LL_DEBUGS("Avatar") << "create category request: " << ll_pretty_print_sd(request) << llendl; + // viewer_region->getCapAPI().post(request); + LLHTTPClient::post( + url, + body, + new LLCreateInventoryCategoryResponder(this, callback) ); + + return LLUUID::null; } // Add the category to the internal representation diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index 5de951ed05..f28211cfa1 100755 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -34,6 +34,7 @@ #include "llhttpclient.h" #include "lluuid.h" #include "llpermissionsflags.h" +#include "llviewerinventory.h" #include "llstring.h" #include "llmd5.h" #include <map> @@ -45,14 +46,9 @@ class LLInventoryObserver; class LLInventoryObject; class LLInventoryItem; class LLInventoryCategory; -class LLViewerInventoryItem; -class LLViewerInventoryCategory; -class LLViewerInventoryItem; -class LLViewerInventoryCategory; class LLMessageSystem; class LLInventoryCollectFunctor; - //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // LLInventoryModel // @@ -394,8 +390,7 @@ public: LLUUID createNewCategory(const LLUUID& parent_id, LLFolderType::EType preferred_type, const std::string& name, - void (*callback)(const LLSD&, void*) = NULL, - void* user_data = NULL ); + boost::optional<llsd_func_type> callback = boost::optional<llsd_func_type>()); protected: // Internal methods that add inventory and make sure that all of // the internal data structures are consistent. These methods diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index d6c927ab58..21b77ef471 100755 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -184,7 +184,7 @@ bool LLPanelOutfitsInventory::onSaveCommit(const LLSD& notification, const LLSD& LLStringUtil::trim(outfit_name); if( !outfit_name.empty() ) { - LLUUID outfit_folder = LLAppearanceMgr::getInstance()->makeNewOutfitLinks(outfit_name); + LLAppearanceMgr::getInstance()->makeNewOutfitLinks(outfit_name); LLSidepanelAppearance* panel_appearance = getAppearanceSP(); if (panel_appearance) diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 8890df199b..84d42c6345 100755 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -2613,10 +2613,10 @@ void LLStartUp::saveInitialOutfit() if (sWearablesLoadedCon.connected()) { - lldebugs << "sWearablesLoadedCon is connected, disconnecting" << llendl; + LL_DEBUGS("Avatar") << "sWearablesLoadedCon is connected, disconnecting" << llendl; sWearablesLoadedCon.disconnect(); } - lldebugs << "calling makeNewOutfitLinks( \"" << sInitialOutfit << "\" )" << llendl; + LL_DEBUGS("Avatar") << "calling makeNewOutfitLinks( \"" << sInitialOutfit << "\" )" << llendl; LLAppearanceMgr::getInstance()->makeNewOutfitLinks(sInitialOutfit,false); } diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 26aecd39d1..9725ea6456 100755 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -69,8 +69,9 @@ #include "llclipboard.h" #include "llhttpretrypolicy.h" -// Two do-nothing ops for use in callbacks. +// do-nothing ops for use in callbacks. void no_op_inventory_func(const LLUUID&) {} +void no_op_llsd_func(const LLSD&) {} void no_op() {} ///---------------------------------------------------------------------------- diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h index 032efd9542..de1f3daa1e 100755 --- a/indra/newview/llviewerinventory.h +++ b/indra/newview/llviewerinventory.h @@ -263,9 +263,11 @@ private: }; typedef boost::function<void(const LLUUID&)> inventory_func_type; -void no_op_inventory_func(const LLUUID&); // A do-nothing inventory_func - +typedef boost::function<void(const LLSD&)> llsd_func_type; typedef boost::function<void()> nullary_func_type; + +void no_op_inventory_func(const LLUUID&); // A do-nothing inventory_func +void no_op_llsd_func(const LLSD&); // likewise for LLSD void no_op(); // A do-nothing nullary func. // Shim between inventory callback and boost function/callable -- cgit v1.2.3 From bbdd2a34d01d938226c7935a3d52ec0a7c483e90 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Tue, 25 Jun 2013 10:00:46 -0400 Subject: SH-4243 FIX - removed wait for category creation, since callback-based cap only works correctly if a recent fix is deployed server-side. May revisit at some point. --- indra/newview/llappearancemgr.cpp | 25 ++++++++++++------------- indra/newview/llappearancemgr.h | 4 ++-- 2 files changed, 14 insertions(+), 15 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 93b0e6f4e7..c068a6358f 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -3370,20 +3370,19 @@ void show_created_outfit(LLUUID& folder_id, bool show_panel = true) LLAppearanceMgr::getInstance()->createBaseOutfitLink(folder_id, cb); } -void LLAppearanceMgr::onOutfitFolderCreated(const LLSD& result, bool show_panel) +void LLAppearanceMgr::onOutfitFolderCreated(const LLUUID& folder_id, bool show_panel) { - LL_DEBUGS("Avatar") << ll_pretty_print_sd(result) << llendl; - - LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(no_op_inventory_func, - boost::bind(&LLAppearanceMgr::onOutfitFolderCreatedAndClothingOrdered,this,result,show_panel)); + LLPointer<LLInventoryCallback> cb = + new LLBoostFuncInventoryCallback(no_op_inventory_func, + boost::bind(&LLAppearanceMgr::onOutfitFolderCreatedAndClothingOrdered,this,folder_id,show_panel)); updateClothingOrderingInfo(LLUUID::null, false, cb); } -void LLAppearanceMgr::onOutfitFolderCreatedAndClothingOrdered(const LLSD& result, bool show_panel) +void LLAppearanceMgr::onOutfitFolderCreatedAndClothingOrdered(const LLUUID& folder_id, bool show_panel) { - LLUUID folder_id = result["folder_id"].asUUID(); - LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(no_op_inventory_func, - boost::bind(show_created_outfit,folder_id,show_panel)); + LLPointer<LLInventoryCallback> cb = + new LLBoostFuncInventoryCallback(no_op_inventory_func, + boost::bind(show_created_outfit,folder_id,show_panel)); shallowCopyCategoryContents(getCOF(),folder_id, cb); } @@ -3397,12 +3396,12 @@ void LLAppearanceMgr::makeNewOutfitLinks(const std::string& new_folder_name, boo // First, make a folder in the My Outfits directory. const LLUUID parent_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MY_OUTFITS); - llsd_func_type func = boost::bind(&LLAppearanceMgr::onOutfitFolderCreated,this,_1,show_panel); - gInventory.createNewCategory( + //llsd_func_type func = boost::bind(&LLAppearanceMgr::onOutfitFolderCreated,this,_1,show_panel); + LLUUID folder_id = gInventory.createNewCategory( parent_id, LLFolderType::FT_OUTFIT, - new_folder_name, - func); + new_folder_name); + onOutfitFolderCreated(folder_id, show_panel); } void LLAppearanceMgr::wearBaseOutfit() diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index d4993780aa..beed6e824a 100755 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -186,8 +186,8 @@ public: void removeItemFromAvatar(const LLUUID& item_id); - void onOutfitFolderCreated(const LLSD& result, bool show_panel); - void onOutfitFolderCreatedAndClothingOrdered(const LLSD& result, bool show_panel); + void onOutfitFolderCreated(const LLUUID& folder_id, bool show_panel); + void onOutfitFolderCreatedAndClothingOrdered(const LLUUID& folder_id, bool show_panel); void makeNewOutfitLinks(const std::string& new_folder_name, bool show_panel = true); bool moveWearable(LLViewerInventoryItem* item, bool closer_to_body); -- cgit v1.2.3 From ffd7b0d7e7ef13510d7299e601a71c7fedb0a4d1 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Tue, 25 Jun 2013 17:52:02 -0400 Subject: SH-4305 WIP --- indra/newview/llappearancemgr.cpp | 78 +++++++++++++++++++++++++++++++---- indra/newview/llappearancemgr.h | 4 ++ indra/newview/llfloateropenobject.cpp | 5 +-- indra/newview/llfloateropenobject.h | 2 +- indra/newview/llinventorymodel.cpp | 8 ++-- indra/newview/llinventorymodel.h | 2 +- 6 files changed, 83 insertions(+), 16 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index c068a6358f..f19500c98d 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -53,6 +53,7 @@ #include "llsdutil.h" #include "llsdserialize.h" #include "llhttpretrypolicy.h" +#include "llaisapi.h" #if LL_MSVC // disable boost::lexical_cast warning @@ -1449,6 +1450,53 @@ void LLAppearanceMgr::shallowCopyCategory(const LLUUID& src_id, const LLUUID& ds gInventory.notifyObservers(); } +void LLAppearanceMgr::copyCategoryLinks(const LLUUID& src_id, const LLUUID& dst_id, + bool include_folder_links, LLPointer<LLInventoryCallback> cb) +{ + LLInventoryModel::cat_array_t* cats; + LLInventoryModel::item_array_t* items; + LLSD contents = LLSD::emptyArray(); + gInventory.getDirectDescendentsOf(src_id, cats, items); + llinfos << "copying " << items->count() << " items" << llendl; + for (LLInventoryModel::item_array_t::const_iterator iter = items->begin(); + iter != items->end(); + ++iter) + { + const LLViewerInventoryItem* item = (*iter); + switch (item->getActualType()) + { + case LLAssetType::AT_LINK: + { + LL_DEBUGS("Avatar") << "linking inventory item " << item->getName() << llendl; + //getActualDescription() is used for a new description + //to propagate ordering information saved in descriptions of links + LLSD item_contents; + item_contents["name"] = item->getName(); + item_contents["desc"] = item->getActualDescription(); + item_contents["linked_id"] = item->getLinkedUUID(); + item_contents["type"] = LLAssetType::AT_LINK; + contents.append(item_contents); + break; + } + case LLAssetType::AT_LINK_FOLDER: + { + LLViewerInventoryCategory *catp = item->getLinkedCategory(); + if (catp && include_folder_links) + { + LL_DEBUGS("Avatar") << "linking inventory folder " << item->getName() << llendl; + LLSD base_contents; + base_contents["name"] = catp->getName(); + base_contents["desc"] = ""; // categories don't have descriptions. + base_contents["linked_id"] = catp->getLinkedUUID(); + base_contents["type"] = LLAssetType::AT_LINK_FOLDER; + contents.append(base_contents); + } + break; + } + } + } + slam_inventory_folder(dst_id, contents, cb); +} // Copy contents of src_id to dst_id. void LLAppearanceMgr::shallowCopyCategoryContents(const LLUUID& src_id, const LLUUID& dst_id, LLPointer<LLInventoryCallback> cb) @@ -3383,7 +3431,8 @@ void LLAppearanceMgr::onOutfitFolderCreatedAndClothingOrdered(const LLUUID& fold LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(no_op_inventory_func, boost::bind(show_created_outfit,folder_id,show_panel)); - shallowCopyCategoryContents(getCOF(),folder_id, cb); + bool copy_folder_links = false; + copyCategoryLinks(getCOF(), folder_id, copy_folder_links, cb); } void LLAppearanceMgr::makeNewOutfitLinks(const std::string& new_folder_name, bool show_panel) @@ -3396,12 +3445,27 @@ void LLAppearanceMgr::makeNewOutfitLinks(const std::string& new_folder_name, boo // First, make a folder in the My Outfits directory. const LLUUID parent_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MY_OUTFITS); - //llsd_func_type func = boost::bind(&LLAppearanceMgr::onOutfitFolderCreated,this,_1,show_panel); - LLUUID folder_id = gInventory.createNewCategory( - parent_id, - LLFolderType::FT_OUTFIT, - new_folder_name); - onOutfitFolderCreated(folder_id, show_panel); + std::string cap; + if (AISCommand::getCap(cap)) + { + // cap-based category creation was buggy until recently. use + // existence of AIS as an indicator the fix is present. Does + // not actually use AIS to create the category. + inventory_func_type func = boost::bind(&LLAppearanceMgr::onOutfitFolderCreated,this,_1,show_panel); + LLUUID folder_id = gInventory.createNewCategory( + parent_id, + LLFolderType::FT_OUTFIT, + new_folder_name, + func); + } + else + { + LLUUID folder_id = gInventory.createNewCategory( + parent_id, + LLFolderType::FT_OUTFIT, + new_folder_name); + onOutfitFolderCreated(folder_id, show_panel); + } } void LLAppearanceMgr::wearBaseOutfit() diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index beed6e824a..4d7c536b3d 100755 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -73,6 +73,10 @@ public: void enforceCOFItemRestrictions(LLPointer<LLInventoryCallback> cb); S32 getActiveCopyOperations() const; + + // Copy all links via the slam command (single inventory operation where supported) + void copyCategoryLinks(const LLUUID& src_id, const LLUUID& dst_id, + bool include_folder_links, LLPointer<LLInventoryCallback> cb); // Copy all items and the src category itself. void shallowCopyCategory(const LLUUID& src_id, const LLUUID& dst_id, diff --git a/indra/newview/llfloateropenobject.cpp b/indra/newview/llfloateropenobject.cpp index 1c086976ba..9986bdbd7f 100755 --- a/indra/newview/llfloateropenobject.cpp +++ b/indra/newview/llfloateropenobject.cpp @@ -163,7 +163,7 @@ void LLFloaterOpenObject::moveToInventory(bool wear) parent_category_id = gInventory.getRootFolderID(); } - llsd_func_type func = boost::bind(LLFloaterOpenObject::callbackCreateInventoryCategory,_1,object_id,wear); + inventory_func_type func = boost::bind(LLFloaterOpenObject::callbackCreateInventoryCategory,_1,object_id,wear); LLUUID category_id = gInventory.createNewCategory(parent_category_id, LLFolderType::FT_NONE, name, @@ -194,10 +194,9 @@ void LLFloaterOpenObject::moveToInventory(bool wear) } // static -void LLFloaterOpenObject::callbackCreateInventoryCategory(const LLSD& result, LLUUID object_id, bool wear) +void LLFloaterOpenObject::callbackCreateInventoryCategory(const LLUUID& category_id, LLUUID object_id, bool wear) { LLCatAndWear* wear_data = new LLCatAndWear; - LLUUID category_id = result["folder_id"].asUUID(); wear_data->mCatID = category_id; wear_data->mWear = wear; diff --git a/indra/newview/llfloateropenobject.h b/indra/newview/llfloateropenobject.h index 1d7eecd107..8e472804a4 100755 --- a/indra/newview/llfloateropenobject.h +++ b/indra/newview/llfloateropenobject.h @@ -63,7 +63,7 @@ protected: void onClickMoveToInventory(); void onClickMoveAndWear(); - static void callbackCreateInventoryCategory(const LLSD& result, LLUUID object_id, bool wear); + static void callbackCreateInventoryCategory(const LLUUID& category_id, LLUUID object_id, bool wear); static void callbackMoveInventory(S32 result, void* data); private: diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 82d58523ce..e1fd2e02fa 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -472,7 +472,7 @@ class LLCreateInventoryCategoryResponder : public LLHTTPClient::Responder LOG_CLASS(LLCreateInventoryCategoryResponder); public: LLCreateInventoryCategoryResponder(LLInventoryModel* model, - boost::optional<llsd_func_type> callback): + boost::optional<inventory_func_type> callback): mModel(model), mCallback(callback) { @@ -511,12 +511,12 @@ protected: if (mCallback) { - mCallback.get()(content); + mCallback.get()(category_id); } } private: - boost::optional<llsd_func_type> mCallback; + boost::optional<inventory_func_type> mCallback; LLInventoryModel* mModel; }; @@ -527,7 +527,7 @@ private: LLUUID LLInventoryModel::createNewCategory(const LLUUID& parent_id, LLFolderType::EType preferred_type, const std::string& pname, - boost::optional<llsd_func_type> callback) + boost::optional<inventory_func_type> callback) { LLUUID id; diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index f28211cfa1..ee0d4e1994 100755 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -390,7 +390,7 @@ public: LLUUID createNewCategory(const LLUUID& parent_id, LLFolderType::EType preferred_type, const std::string& name, - boost::optional<llsd_func_type> callback = boost::optional<llsd_func_type>()); + boost::optional<inventory_func_type> callback = boost::optional<inventory_func_type>()); protected: // Internal methods that add inventory and make sure that all of // the internal data structures are consistent. These methods -- cgit v1.2.3 From e2e198d9b36f4ef90ef7ca088e643b1fc399c53e Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Wed, 26 Jun 2013 10:50:07 -0400 Subject: SH-4305 WIP - fix for compiler grumbling on linux build. --- indra/newview/llappearancemgr.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index f19500c98d..8a0814734c 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1493,6 +1493,11 @@ void LLAppearanceMgr::copyCategoryLinks(const LLUUID& src_id, const LLUUID& dst_ } break; } + default: + { + // Linux refuses to compile unless all possible enums are handled. Really, Linux? + break; + } } } slam_inventory_folder(dst_id, contents, cb); -- cgit v1.2.3 From cbb83180e8ea6c1f64c77049ea62f2977f55e2f1 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Wed, 26 Jun 2013 11:27:13 -0400 Subject: SH-4305 WIP - one more case where we need to use slammer to update category --- indra/newview/llappearancemgr.cpp | 16 ++++------------ indra/newview/llappearancemgr.h | 5 +++-- 2 files changed, 7 insertions(+), 14 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 8a0814734c..5f061ca290 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1450,7 +1450,7 @@ void LLAppearanceMgr::shallowCopyCategory(const LLUUID& src_id, const LLUUID& ds gInventory.notifyObservers(); } -void LLAppearanceMgr::copyCategoryLinks(const LLUUID& src_id, const LLUUID& dst_id, +void LLAppearanceMgr::slamCategoryLinks(const LLUUID& src_id, const LLUUID& dst_id, bool include_folder_links, LLPointer<LLInventoryCallback> cb) { LLInventoryModel::cat_array_t* cats; @@ -2882,14 +2882,12 @@ bool LLAppearanceMgr::updateBaseOutfit() updateClothingOrderingInfo(); - // in a Base Outfit we do not remove items, only links - remove_folder_contents(base_outfit_id, false, NULL); - LLPointer<LLInventoryCallback> dirty_state_updater = new LLBoostFuncInventoryCallback(no_op_inventory_func, appearance_mgr_update_dirty_state); //COF contains only links so we copy to the Base Outfit only links - shallowCopyCategoryContents(getCOF(), base_outfit_id, dirty_state_updater); + bool copy_folder_links = false; + slamCategoryLinks(getCOF(), base_outfit_id, copy_folder_links, dirty_state_updater); return true; } @@ -2937,12 +2935,6 @@ struct WearablesOrderComparator bool operator()(const LLInventoryItem* item1, const LLInventoryItem* item2) { - if (!item1 || !item2) - { - llwarning("either item1 or item2 is NULL", 0); - return true; - } - const std::string& desc1 = item1->getActualDescription(); const std::string& desc2 = item2->getActualDescription(); @@ -3437,7 +3429,7 @@ void LLAppearanceMgr::onOutfitFolderCreatedAndClothingOrdered(const LLUUID& fold new LLBoostFuncInventoryCallback(no_op_inventory_func, boost::bind(show_created_outfit,folder_id,show_panel)); bool copy_folder_links = false; - copyCategoryLinks(getCOF(), folder_id, copy_folder_links, cb); + slamCategoryLinks(getCOF(), folder_id, copy_folder_links, cb); } void LLAppearanceMgr::makeNewOutfitLinks(const std::string& new_folder_name, bool show_panel) diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index 4d7c536b3d..ddef3b4a9b 100755 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -74,8 +74,9 @@ public: S32 getActiveCopyOperations() const; - // Copy all links via the slam command (single inventory operation where supported) - void copyCategoryLinks(const LLUUID& src_id, const LLUUID& dst_id, + // Replace category contents with copied links via the slam_inventory_folder + // command (single inventory operation where supported) + void slamCategoryLinks(const LLUUID& src_id, const LLUUID& dst_id, bool include_folder_links, LLPointer<LLInventoryCallback> cb); // Copy all items and the src category itself. -- cgit v1.2.3 From fd2893e23d002124c49416b7e7a497a1105d2fc4 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Wed, 26 Jun 2013 12:19:38 -0400 Subject: SH-4305 WIP - cleanup --- indra/newview/llappearancemgr.cpp | 20 ---------------- indra/newview/llappearancemgr.h | 13 +---------- indra/newview/llinventorybridge.cpp | 44 ------------------------------------ indra/newview/llviewerfoldertype.cpp | 6 +---- 4 files changed, 2 insertions(+), 81 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 5f061ca290..9c10c20cfe 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1821,25 +1821,6 @@ void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append) // Will link all the above items. LLPointer<LLInventoryCallback> link_waiter = new LLUpdateAppearanceOnDestroy; -#if 0 - linkAll(cof,all_items,link_waiter); - - // Add link to outfit if category is an outfit. - if (!append) - { - createBaseOutfitLink(category, link_waiter); - } - - // Remove current COF contents. Have to do this after creating - // the link_waiter so links can be followed for any items that get - // carried over (e.g. keeping old shape if the new outfit does not - // contain one) - - // even in the non-append case, createBaseOutfitLink() already - // deletes the existing link, don't need to do it again here. - bool keep_outfit_links = true; - remove_folder_contents(cof, keep_outfit_links, link_waiter); -#else LLSD contents = LLSD::emptyArray(); for (LLInventoryModel::item_array_t::const_iterator it = all_items.begin(); it != all_items.end(); ++it) @@ -1868,7 +1849,6 @@ void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append) dump_sequential_xml(gAgentAvatarp->getFullname() + "_slam_request", contents); } slam_inventory_folder(getCOF(), contents, link_waiter); -#endif LL_DEBUGS("Avatar") << self_av_string() << "waiting for LLUpdateAppearanceOnDestroy" << LL_ENDL; } diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index ddef3b4a9b..4b633ee9bd 100755 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -73,11 +73,6 @@ public: void enforceCOFItemRestrictions(LLPointer<LLInventoryCallback> cb); S32 getActiveCopyOperations() const; - - // Replace category contents with copied links via the slam_inventory_folder - // command (single inventory operation where supported) - void slamCategoryLinks(const LLUUID& src_id, const LLUUID& dst_id, - bool include_folder_links, LLPointer<LLInventoryCallback> cb); // Copy all items and the src category itself. void shallowCopyCategory(const LLUUID& src_id, const LLUUID& dst_id, @@ -191,9 +186,7 @@ public: void removeItemFromAvatar(const LLUUID& item_id); - void onOutfitFolderCreated(const LLUUID& folder_id, bool show_panel); - void onOutfitFolderCreatedAndClothingOrdered(const LLUUID& folder_id, bool show_panel); - void makeNewOutfitLinks(const std::string& new_folder_name, bool show_panel = true); + void makeNewOutfitLinks(const std::string& new_folder_name,bool show_panel = true); bool moveWearable(LLViewerInventoryItem* item, bool closer_to_body); @@ -306,10 +299,6 @@ private: LLUUID mItemID; }; -class - -#define SUPPORT_ENSEMBLES 0 - LLUUID findDescendentCategoryIDByName(const LLUUID& parent_id,const std::string& name); // Invoke a given callable after category contents are fully fetched. diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 89c56ab82c..09a96c82b5 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2436,29 +2436,6 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, LLAppearanceMgr::instance().linkAll(mUUID,items,NULL); } } - else - { -#if SUPPORT_ENSEMBLES - // BAP - should skip if dup. - if (move_is_into_current_outfit) - { - LLAppearanceMgr::instance().addEnsembleLink(inv_cat); - } - else - { - LLPointer<LLInventoryCallback> cb = NULL; - const std::string empty_description = ""; - link_inventory_item( - gAgent.getID(), - cat_id, - mUUID, - inv_cat->getName(), - empty_description, - LLAssetType::AT_LINK_FOLDER, - cb); - } -#endif - } } else if (move_is_into_outbox && !move_is_from_outbox) { @@ -2850,17 +2827,6 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) modifyOutfit(FALSE); return; } -#if SUPPORT_ENSEMBLES - else if ("wearasensemble" == action) - { - LLInventoryModel* model = getInventoryModel(); - if(!model) return; - LLViewerInventoryCategory* cat = getCategory(); - if(!cat) return; - LLAppearanceMgr::instance().addEnsembleLink(cat,true); - return; - } -#endif else if ("addtooutfit" == action) { modifyOutfit(TRUE); @@ -3382,16 +3348,6 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items items.push_back(std::string("New Clothes")); items.push_back(std::string("New Body Parts")); } -#if SUPPORT_ENSEMBLES - // Changing folder types is an unfinished unsupported feature - // and can lead to unexpected behavior if enabled. - items.push_back(std::string("Change Type")); - const LLViewerInventoryCategory *cat = getCategory(); - if (cat && LLFolderType::lookupIsProtectedType(cat->getPreferredType())) - { - disabled_items.push_back(std::string("Change Type")); - } -#endif getClipboardEntries(false, items, disabled_items, flags); } else diff --git a/indra/newview/llviewerfoldertype.cpp b/indra/newview/llviewerfoldertype.cpp index a179b61cff..4e028d2163 100755 --- a/indra/newview/llviewerfoldertype.cpp +++ b/indra/newview/llviewerfoldertype.cpp @@ -139,14 +139,10 @@ LLViewerFolderDictionary::LLViewerFolderDictionary() addEntry(LLFolderType::FT_NONE, new ViewerFolderEntry("New Folder", "Inv_FolderOpen", "Inv_FolderClosed", FALSE, false, "default")); -#if SUPPORT_ENSEMBLES - initEnsemblesFromFile(); -#else for (U32 type = (U32)LLFolderType::FT_ENSEMBLE_START; type <= (U32)LLFolderType::FT_ENSEMBLE_END; ++type) { addEntry((LLFolderType::EType)type, new ViewerFolderEntry("New Folder", "Inv_FolderOpen", "Inv_FolderClosed", FALSE, false)); - } -#endif + } } bool LLViewerFolderDictionary::initEnsemblesFromFile() -- cgit v1.2.3 From 1f133213b9d7645169db84d0e26ec166163ba564 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Wed, 26 Jun 2013 15:44:28 -0400 Subject: SH-4300 WIP - removed unused update_base_outfit stuff in updateClothingOrderingInfo() --- indra/newview/llappearancemgr.cpp | 29 ++++++++--------------------- indra/newview/llappearancemgr.h | 18 +++++++++++------- 2 files changed, 19 insertions(+), 28 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 9c10c20cfe..82d12ae60c 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -435,13 +435,11 @@ private: S32 LLCallAfterInventoryCopyMgr::sInstanceCount = 0; -LLUpdateAppearanceOnDestroy::LLUpdateAppearanceOnDestroy(bool update_base_outfit_ordering, - bool enforce_item_restrictions, +LLUpdateAppearanceOnDestroy::LLUpdateAppearanceOnDestroy(bool enforce_item_restrictions, bool enforce_ordering, nullary_func_t post_update_func ): mFireCount(0), - mUpdateBaseOrder(update_base_outfit_ordering), mEnforceItemRestrictions(enforce_item_restrictions), mEnforceOrdering(enforce_ordering), mPostUpdateFunc(post_update_func) @@ -468,8 +466,7 @@ LLUpdateAppearanceOnDestroy::~LLUpdateAppearanceOnDestroy() selfStopPhase("update_appearance_on_destroy"); - LLAppearanceMgr::instance().updateAppearanceFromCOF(mUpdateBaseOrder, - mEnforceItemRestrictions, + LLAppearanceMgr::instance().updateAppearanceFromCOF(mEnforceItemRestrictions, mEnforceOrdering, mPostUpdateFunc); } @@ -503,7 +500,7 @@ LLUpdateAppearanceAndEditWearableOnDestroy::~LLUpdateAppearanceAndEditWearableOn if (!LLApp::isExiting()) { LLAppearanceMgr::instance().updateAppearanceFromCOF( - false,true,true, + true,true, boost::bind(edit_wearable_and_customize_avatar, mItemID)); } } @@ -2015,8 +2012,7 @@ void LLAppearanceMgr::enforceCOFItemRestrictions(LLPointer<LLInventoryCallback> } } -void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering, - bool enforce_item_restrictions, +void LLAppearanceMgr::updateAppearanceFromCOF(bool enforce_item_restrictions, bool enforce_ordering, nullary_func_t post_update_func) { @@ -2036,7 +2032,7 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering, // enforce_item_restrictions to false so we don't get // caught in a perpetual loop. LLPointer<LLInventoryCallback> cb( - new LLUpdateAppearanceOnDestroy(update_base_outfit_ordering, false, enforce_ordering, post_update_func)); + new LLUpdateAppearanceOnDestroy(false, enforce_ordering, post_update_func)); enforceCOFItemRestrictions(cb); return; } @@ -2050,8 +2046,8 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering, // to wait for the update callbacks, then (finally!) call // updateAppearanceFromCOF() with no additional COF munging needed. LLPointer<LLInventoryCallback> cb( - new LLUpdateAppearanceOnDestroy(false, false, false, post_update_func)); - updateClothingOrderingInfo(LLUUID::null, update_base_outfit_ordering, cb); + new LLUpdateAppearanceOnDestroy(false, false, post_update_func)); + updateClothingOrderingInfo(LLUUID::null, cb); return; } @@ -2938,20 +2934,11 @@ struct WearablesOrderComparator }; void LLAppearanceMgr::updateClothingOrderingInfo(LLUUID cat_id, - bool update_base_outfit_ordering, LLPointer<LLInventoryCallback> cb) { if (cat_id.isNull()) { cat_id = getCOF(); - if (update_base_outfit_ordering) - { - const LLUUID base_outfit_id = getBaseOutfitUUID(); - if (base_outfit_id.notNull()) - { - updateClothingOrderingInfo(base_outfit_id,false,cb); - } - } } // COF is processed if cat_id is not specified @@ -3400,7 +3387,7 @@ void LLAppearanceMgr::onOutfitFolderCreated(const LLUUID& folder_id, bool show_p LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(no_op_inventory_func, boost::bind(&LLAppearanceMgr::onOutfitFolderCreatedAndClothingOrdered,this,folder_id,show_panel)); - updateClothingOrderingInfo(LLUUID::null, false, cb); + updateClothingOrderingInfo(LLUUID::null, cb); } void LLAppearanceMgr::onOutfitFolderCreatedAndClothingOrdered(const LLUUID& folder_id, bool show_panel) diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index 4b633ee9bd..59dc598ee5 100755 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -49,8 +49,7 @@ class LLAppearanceMgr: public LLSingleton<LLAppearanceMgr> public: typedef std::vector<LLInventoryModel::item_array_t> wearables_by_type_t; - void updateAppearanceFromCOF(bool update_base_outfit_ordering = false, - bool enforce_item_restrictions = true, + void updateAppearanceFromCOF(bool enforce_item_restrictions = true, bool enforce_ordering = true, nullary_func_t post_update_func = no_op); bool needToSaveCOF(); @@ -73,7 +72,12 @@ public: void enforceCOFItemRestrictions(LLPointer<LLInventoryCallback> cb); S32 getActiveCopyOperations() const; - + + // Replace category contents with copied links via the slam_inventory_folder + // command (single inventory operation where supported) + void slamCategoryLinks(const LLUUID& src_id, const LLUUID& dst_id, + bool include_folder_links, LLPointer<LLInventoryCallback> cb); + // Copy all items and the src category itself. void shallowCopyCategory(const LLUUID& src_id, const LLUUID& dst_id, LLPointer<LLInventoryCallback> cb); @@ -186,6 +190,9 @@ public: void removeItemFromAvatar(const LLUUID& item_id); + void onOutfitFolderCreated(const LLUUID& folder_id, bool show_panel); + void onOutfitFolderCreatedAndClothingOrdered(const LLUUID& folder_id, bool show_panel); + void makeNewOutfitLinks(const std::string& new_folder_name,bool show_panel = true); bool moveWearable(LLViewerInventoryItem* item, bool closer_to_body); @@ -198,7 +205,6 @@ public: //Check ordering information on wearables stored in links' descriptions and update if it is invalid // COF is processed if cat_id is not specified void updateClothingOrderingInfo(LLUUID cat_id = LLUUID::null, - bool update_base_outfit_ordering = false, LLPointer<LLInventoryCallback> cb = NULL); bool isOutfitLocked() { return mOutfitLocked; } @@ -271,8 +277,7 @@ public: class LLUpdateAppearanceOnDestroy: public LLInventoryCallback { public: - LLUpdateAppearanceOnDestroy(bool update_base_outfit_ordering = false, - bool enforce_item_restrictions = true, + LLUpdateAppearanceOnDestroy(bool enforce_item_restrictions = true, bool enforce_ordering = true, nullary_func_t post_update_func = no_op); virtual ~LLUpdateAppearanceOnDestroy(); @@ -280,7 +285,6 @@ public: private: U32 mFireCount; - bool mUpdateBaseOrder; bool mEnforceItemRestrictions; bool mEnforceOrdering; nullary_func_t mPostUpdateFunc; -- cgit v1.2.3 From 5be12cf0be170c5d886694db11605d197e418190 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Wed, 26 Jun 2013 17:40:41 -0400 Subject: SH-4300 WIP - set wearable ordering desc fields in slammer during updateCOF(), should need to go item-by-item fairly rarely. --- indra/newview/llappearancemgr.cpp | 78 +++++++++++++++++++++++++++++---------- indra/newview/llappearancemgr.h | 4 ++ 2 files changed, 63 insertions(+), 19 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 82d12ae60c..5322646629 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1816,16 +1816,35 @@ void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append) all_items += obj_items; all_items += gest_items; + // Find any wearables that need description set to enforce ordering. + desc_map_t desc_map; + getWearableOrderingDescUpdates(wear_items, desc_map); + // Will link all the above items. LLPointer<LLInventoryCallback> link_waiter = new LLUpdateAppearanceOnDestroy; LLSD contents = LLSD::emptyArray(); + for (LLInventoryModel::item_array_t::const_iterator it = all_items.begin(); it != all_items.end(); ++it) { LLSD item_contents; LLInventoryItem *item = *it; + + std::string desc; + desc_map_t::const_iterator desc_iter = desc_map.find(item->getUUID()); + if (desc_iter != desc_map.end()) + { + desc = desc_iter->second; + LL_DEBUGS("Avatar") << item->getName() << " overriding desc to: " << desc + << " (was: " << item->getActualDescription() << ")" << llendl; + } + else + { + desc = item->getActualDescription(); + } + item_contents["name"] = item->getName(); - item_contents["desc"] = item->getActualDescription(); + item_contents["desc"] = desc; item_contents["linked_id"] = item->getLinkedUUID(); item_contents["type"] = LLAssetType::AT_LINK; contents.append(item_contents); @@ -2933,45 +2952,66 @@ struct WearablesOrderComparator U32 mControlSize; }; -void LLAppearanceMgr::updateClothingOrderingInfo(LLUUID cat_id, - LLPointer<LLInventoryCallback> cb) +void LLAppearanceMgr::getWearableOrderingDescUpdates(LLInventoryModel::item_array_t& wear_items, + desc_map_t& desc_map) { - if (cat_id.isNull()) - { - cat_id = getCOF(); - } - - // COF is processed if cat_id is not specified - LLInventoryModel::item_array_t wear_items; - getDescendentsOfAssetType(cat_id, wear_items, LLAssetType::AT_CLOTHING); - wearables_by_type_t items_by_type(LLWearableType::WT_COUNT); divvyWearablesByType(wear_items, items_by_type); for (U32 type = LLWearableType::WT_SHIRT; type < LLWearableType::WT_COUNT; type++) { - U32 size = items_by_type[type].size(); if (!size) continue; - + //sinking down invalid items which need reordering std::sort(items_by_type[type].begin(), items_by_type[type].end(), WearablesOrderComparator((LLWearableType::EType) type)); - + //requesting updates only for those links which don't have "valid" descriptions for (U32 i = 0; i < size; i++) { LLViewerInventoryItem* item = items_by_type[type][i]; if (!item) continue; - + std::string new_order_str = build_order_string((LLWearableType::EType)type, i); if (new_order_str == item->getActualDescription()) continue; + + LL_DEBUGS("Avatar") << item->getName() << " need to update desc to: " << new_order_str + << " (from: " << item->getActualDescription() << ")" << llendl; - LLSD updates; - updates["desc"] = new_order_str; - update_inventory_item(item->getUUID(),updates,cb); + desc_map[item->getUUID()] = new_order_str; } } } +void LLAppearanceMgr::updateClothingOrderingInfo(LLUUID cat_id, + LLPointer<LLInventoryCallback> cb) +{ + // COF is processed if cat_id is not specified + if (cat_id.isNull()) + { + cat_id = getCOF(); + } + + LLInventoryModel::item_array_t wear_items; + getDescendentsOfAssetType(cat_id, wear_items, LLAssetType::AT_CLOTHING); + + // Identify items for which desc needs to change. + desc_map_t desc_map; + getWearableOrderingDescUpdates(wear_items, desc_map); + + for (desc_map_t::const_iterator it = desc_map.begin(); + it != desc_map.end(); ++it) + { + LLSD updates; + const LLUUID& item_id = it->first; + const std::string& new_order_str = it->second; + LLViewerInventoryItem *item = gInventory.getItem(item_id); + LL_DEBUGS("Avatar") << item->getName() << " updating desc to: " << new_order_str + << " (was: " << item->getActualDescription() << ")" << llendl; + updates["desc"] = new_order_str; + update_inventory_item(item_id,updates,cb); + } + +} class RequestAgentUpdateAppearanceResponder: public LLHTTPClient::Responder { diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index 59dc598ee5..3293212719 100755 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -202,6 +202,10 @@ public: //Divvy items into arrays by wearable type static void divvyWearablesByType(const LLInventoryModel::item_array_t& items, wearables_by_type_t& items_by_type); + typedef std::map<LLUUID,std::string> desc_map_t; + + void getWearableOrderingDescUpdates(LLInventoryModel::item_array_t& wear_items, desc_map_t& desc_map); + //Check ordering information on wearables stored in links' descriptions and update if it is invalid // COF is processed if cat_id is not specified void updateClothingOrderingInfo(LLUUID cat_id = LLUUID::null, -- cgit v1.2.3 From ec00f7f14fbf16992b71ddd54e583ba07fdfd523 Mon Sep 17 00:00:00 2001 From: Nyx Linden <nyx@lindenlab.com> Date: Wed, 26 Jun 2013 17:57:10 -0400 Subject: SH-4226 FIX wearing petite outfit gives appearance responder errors Requesting appearance updates on updateGeometry for the avatar was spamming the back-end and causing the throttling mechanism to get hit. Removing that caused a re-introduction of SH-4109, so added a callback to link creation in the COF for attachments to request an appearance update. This should cause us to request an appearance update once per attachment attached, where before we were seeing up to 8 redundant requests. --- indra/newview/llappearancemgr.cpp | 3 ++- indra/newview/llvovolume.cpp | 15 ++------------- 2 files changed, 4 insertions(+), 14 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index cb32bf9c40..57a836c070 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -3578,7 +3578,8 @@ void LLAppearanceMgr::registerAttachment(const LLUUID& item_id) // we have to pass do_update = true to call LLAppearanceMgr::updateAppearanceFromCOF. // it will trigger gAgentWariables.notifyLoadingFinished() // But it is not acceptable solution. See EXT-7777 - LLAppearanceMgr::addCOFItemLink(item_id); // Add COF link for item. + LLPointer<LLInventoryCallback> cb = new LLUpdateAppearanceOnDestroy(); + LLAppearanceMgr::addCOFItemLink(item_id, cb); // Add COF link for item. } else { diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index b7f7a11a15..8730ef66bb 100755 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -76,7 +76,6 @@ #include "llviewershadermgr.h" #include "llvoavatar.h" #include "llvocache.h" -#include "llappearancemgr.h" const S32 MIN_QUIET_FRAMES_COALESCE = 30; const F32 FORCE_SIMPLE_RENDER_AREA = 512.f; @@ -4240,8 +4239,6 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) { LLFastTimer t(FTM_REBUILD_VOLUME_FACE_LIST); - bool requiredAppearanceUpdate = false; - //get all the faces into a list for (LLSpatialGroup::element_iter drawable_iter = group->getDataBegin(); drawable_iter != group->getDataEnd(); ++drawable_iter) { @@ -4340,7 +4337,6 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) const int jointCnt = pSkinData->mJointNames.size(); const F32 pelvisZOffset = pSkinData->mPelvisOffset; bool fullRig = (jointCnt>=20) ? true : false; - requiredAppearanceUpdate = true; if ( fullRig ) { for ( int i=0; i<jointCnt; ++i ) @@ -4365,14 +4361,12 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) pelvisGotSet = true; } } - } + } } } } } - } - - + } //If we've set the pelvis to a new position we need to also rebuild some information that the //viewer does at launch (e.g. body size etc.) if ( pelvisGotSet ) @@ -4612,11 +4606,6 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) drawablep->clearState(LLDrawable::RIGGED); } } - - if ( requiredAppearanceUpdate && gAgent.getRegion() && gAgent.getRegion()->getCentralBakeVersion() ) - { - LLAppearanceMgr::instance().requestServerAppearanceUpdate(); - } } group->mBufferUsage = useage; -- cgit v1.2.3 From 4c75140008527ac9e5260978f4a256d84711644b Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Thu, 27 Jun 2013 11:43:06 -0400 Subject: SH-4300 WIP - added order validation --- indra/newview/llappearancemgr.cpp | 38 ++++++++++++++++++++++++++++++++++---- indra/newview/llappearancemgr.h | 2 ++ 2 files changed, 36 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 5322646629..98909c258a 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1821,7 +1821,8 @@ void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append) getWearableOrderingDescUpdates(wear_items, desc_map); // Will link all the above items. - LLPointer<LLInventoryCallback> link_waiter = new LLUpdateAppearanceOnDestroy; + // link_waiter enforce flags are false because we've already fixed everything up in updateCOF(). + LLPointer<LLInventoryCallback> link_waiter = new LLUpdateAppearanceOnDestroy(false,false); LLSD contents = LLSD::emptyArray(); for (LLInventoryModel::item_array_t::const_iterator it = all_items.begin(); @@ -2070,6 +2071,8 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool enforce_item_restrictions, return; } + llassert(validateClothingOrderingInfo()); + BoolSetter setIsInUpdateAppearanceFromCOF(mIsInUpdateAppearanceFromCOF); selfStartPhase("update_appearance_from_cof"); @@ -2975,13 +2978,40 @@ void LLAppearanceMgr::getWearableOrderingDescUpdates(LLInventoryModel::item_arra std::string new_order_str = build_order_string((LLWearableType::EType)type, i); if (new_order_str == item->getActualDescription()) continue; - LL_DEBUGS("Avatar") << item->getName() << " need to update desc to: " << new_order_str - << " (from: " << item->getActualDescription() << ")" << llendl; - desc_map[item->getUUID()] = new_order_str; } } } + +bool LLAppearanceMgr::validateClothingOrderingInfo(LLUUID cat_id) +{ + // COF is processed if cat_id is not specified + if (cat_id.isNull()) + { + cat_id = getCOF(); + } + + LLInventoryModel::item_array_t wear_items; + getDescendentsOfAssetType(cat_id, wear_items, LLAssetType::AT_CLOTHING); + + // Identify items for which desc needs to change. + desc_map_t desc_map; + getWearableOrderingDescUpdates(wear_items, desc_map); + + for (desc_map_t::const_iterator it = desc_map.begin(); + it != desc_map.end(); ++it) + { + const LLUUID& item_id = it->first; + const std::string& new_order_str = it->second; + LLViewerInventoryItem *item = gInventory.getItem(item_id); + llwarns << "Order validation fails: " << item->getName() + << " needs to update desc to: " << new_order_str + << " (from: " << item->getActualDescription() << ")" << llendl; + } + + return desc_map.size() == 0; +} + void LLAppearanceMgr::updateClothingOrderingInfo(LLUUID cat_id, LLPointer<LLInventoryCallback> cb) { diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index 3293212719..84a0afbb40 100755 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -208,6 +208,8 @@ public: //Check ordering information on wearables stored in links' descriptions and update if it is invalid // COF is processed if cat_id is not specified + bool validateClothingOrderingInfo(LLUUID cat_id = LLUUID::null); + void updateClothingOrderingInfo(LLUUID cat_id = LLUUID::null, LLPointer<LLInventoryCallback> cb = NULL); -- cgit v1.2.3 From 8090388a27dc7dfe9b9bb712db91227ecfea2116 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Thu, 27 Jun 2013 14:41:06 -0400 Subject: SH-4300 WIP - removed outfit autopopulate --- indra/newview/llagentwearables.cpp | 18 -- indra/newview/llagentwearables.h | 6 - indra/newview/llagentwearablesfetch.cpp | 394 -------------------------------- indra/newview/llagentwearablesfetch.h | 41 ---- indra/newview/llappearancemgr.cpp | 21 -- indra/newview/llappearancemgr.h | 3 - 6 files changed, 483 deletions(-) mode change 100644 => 100755 indra/newview/llagentwearables.cpp (limited to 'indra/newview') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp old mode 100644 new mode 100755 index 80c8364223..8e60bf1c6d --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -1861,24 +1861,6 @@ void LLAgentWearables::updateServer() gAgent.sendAgentSetAppearance(); } -void LLAgentWearables::populateMyOutfitsFolder(void) -{ - llinfos << "starting outfit population" << llendl; - - const LLUUID& my_outfits_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MY_OUTFITS); - LLLibraryOutfitsFetch* outfits = new LLLibraryOutfitsFetch(my_outfits_id); - outfits->mMyOutfitsID = my_outfits_id; - - // Get the complete information on the items in the inventory and - // setup an observer that will wait for that to happen. - gInventory.addObserver(outfits); - outfits->startFetch(); - if (outfits->isFinished()) - { - outfits->done(); - } -} - boost::signals2::connection LLAgentWearables::addLoadingStartedCallback(loading_started_callback_t cb) { return mLoadingStartedSignal.connect(cb); diff --git a/indra/newview/llagentwearables.h b/indra/newview/llagentwearables.h index 0adf545aab..b0ac988341 100755 --- a/indra/newview/llagentwearables.h +++ b/indra/newview/llagentwearables.h @@ -171,12 +171,6 @@ protected: //-------------------------------------------------------------------- // Outfits //-------------------------------------------------------------------- -public: - - // Should only be called if we *know* we've never done so before, since users may - // not want the Library outfits to stay in their quick outfit selector and can delete them. - void populateMyOutfitsFolder(); - private: void makeNewOutfitDone(S32 type, U32 index); diff --git a/indra/newview/llagentwearablesfetch.cpp b/indra/newview/llagentwearablesfetch.cpp index 2d2d730396..014c610a5c 100755 --- a/indra/newview/llagentwearablesfetch.cpp +++ b/indra/newview/llagentwearablesfetch.cpp @@ -35,46 +35,6 @@ #include "llvoavatarself.h" -void order_my_outfits_cb() -{ - if (!LLApp::isRunning()) - { - llwarns << "called during shutdown, skipping" << llendl; - return; - } - - const LLUUID& my_outfits_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MY_OUTFITS); - if (my_outfits_id.isNull()) return; - - LLInventoryModel::cat_array_t* cats; - LLInventoryModel::item_array_t* items; - gInventory.getDirectDescendentsOf(my_outfits_id, cats, items); - if (!cats) return; - - //My Outfits should at least contain saved initial outfit and one another outfit - if (cats->size() < 2) - { - llwarning("My Outfits category was not populated properly", 0); - return; - } - - llinfos << "Starting updating My Outfits with wearables ordering information" << llendl; - - for (LLInventoryModel::cat_array_t::iterator outfit_iter = cats->begin(); - outfit_iter != cats->end(); ++outfit_iter) - { - const LLUUID& cat_id = (*outfit_iter)->getUUID(); - if (cat_id.isNull()) continue; - - // saved initial outfit already contains wearables ordering information - if (cat_id == LLAppearanceMgr::getInstance()->getBaseOutfitUUID()) continue; - - LLAppearanceMgr::getInstance()->updateClothingOrderingInfo(cat_id); - } - - llinfos << "Finished updating My Outfits with wearables ordering information" << llendl; -} - LLInitialWearablesFetch::LLInitialWearablesFetch(const LLUUID& cof_id) : LLInventoryFetchDescendentsObserver(cof_id) { @@ -244,357 +204,3 @@ void LLInitialWearablesFetch::processWearablesMessage() } } -LLLibraryOutfitsFetch::LLLibraryOutfitsFetch(const LLUUID& my_outfits_id) : - LLInventoryFetchDescendentsObserver(my_outfits_id), - mCurrFetchStep(LOFS_FOLDER), - mOutfitsPopulated(false) -{ - llinfos << "created" << llendl; - - mMyOutfitsID = LLUUID::null; - mClothingID = LLUUID::null; - mLibraryClothingID = LLUUID::null; - mImportedClothingID = LLUUID::null; - mImportedClothingName = "Imported Library Clothing"; -} - -LLLibraryOutfitsFetch::~LLLibraryOutfitsFetch() -{ - llinfos << "destroyed" << llendl; -} - -void LLLibraryOutfitsFetch::done() -{ - llinfos << "start" << llendl; - - // Delay this until idle() routine, since it's a heavy operation and - // we also can't have it run within notifyObservers. - doOnIdleOneTime(boost::bind(&LLLibraryOutfitsFetch::doneIdle,this)); - gInventory.removeObserver(this); // Prevent doOnIdleOneTime from being added twice. -} - -void LLLibraryOutfitsFetch::doneIdle() -{ - llinfos << "start" << llendl; - - gInventory.addObserver(this); // Add this back in since it was taken out during ::done() - - switch (mCurrFetchStep) - { - case LOFS_FOLDER: - folderDone(); - mCurrFetchStep = LOFS_OUTFITS; - break; - case LOFS_OUTFITS: - outfitsDone(); - mCurrFetchStep = LOFS_LIBRARY; - break; - case LOFS_LIBRARY: - libraryDone(); - mCurrFetchStep = LOFS_IMPORTED; - break; - case LOFS_IMPORTED: - importedFolderDone(); - mCurrFetchStep = LOFS_CONTENTS; - break; - case LOFS_CONTENTS: - contentsDone(); - break; - default: - llwarns << "Got invalid state for outfit fetch: " << mCurrFetchStep << llendl; - mOutfitsPopulated = TRUE; - break; - } - - // We're completely done. Cleanup. - if (mOutfitsPopulated) - { - gInventory.removeObserver(this); - delete this; - return; - } -} - -void LLLibraryOutfitsFetch::folderDone() -{ - llinfos << "start" << llendl; - - LLInventoryModel::cat_array_t cat_array; - LLInventoryModel::item_array_t wearable_array; - gInventory.collectDescendents(mMyOutfitsID, cat_array, wearable_array, - LLInventoryModel::EXCLUDE_TRASH); - - // Early out if we already have items in My Outfits - // except the case when My Outfits contains just initial outfit - if (cat_array.count() > 1) - { - mOutfitsPopulated = true; - return; - } - - mClothingID = gInventory.findCategoryUUIDForType(LLFolderType::FT_CLOTHING); - mLibraryClothingID = gInventory.findLibraryCategoryUUIDForType(LLFolderType::FT_CLOTHING, false); - - // If Library->Clothing->Initial Outfits exists, use that. - LLNameCategoryCollector matchFolderFunctor("Initial Outfits"); - cat_array.clear(); - gInventory.collectDescendentsIf(mLibraryClothingID, - cat_array, wearable_array, - LLInventoryModel::EXCLUDE_TRASH, - matchFolderFunctor); - if (cat_array.count() > 0) - { - const LLViewerInventoryCategory *cat = cat_array.get(0); - mLibraryClothingID = cat->getUUID(); - } - - mComplete.clear(); - - // Get the complete information on the items in the inventory. - uuid_vec_t folders; - folders.push_back(mClothingID); - folders.push_back(mLibraryClothingID); - setFetchIDs(folders); - startFetch(); - if (isFinished()) - { - done(); - } -} - -void LLLibraryOutfitsFetch::outfitsDone() -{ - llinfos << "start" << llendl; - - LLInventoryModel::cat_array_t cat_array; - LLInventoryModel::item_array_t wearable_array; - uuid_vec_t folders; - - // Collect the contents of the Library's Clothing folder - gInventory.collectDescendents(mLibraryClothingID, cat_array, wearable_array, - LLInventoryModel::EXCLUDE_TRASH); - - llassert(cat_array.count() > 0); - for (LLInventoryModel::cat_array_t::const_iterator iter = cat_array.begin(); - iter != cat_array.end(); - ++iter) - { - const LLViewerInventoryCategory *cat = iter->get(); - - // Get the names and id's of every outfit in the library, skip "Ruth" - // because it's a low quality legacy outfit - if (cat->getName() != "Ruth") - { - // Get the name of every outfit in the library - folders.push_back(cat->getUUID()); - mLibraryClothingFolders.push_back(cat->getUUID()); - } - } - cat_array.clear(); - wearable_array.clear(); - - // Check if you already have an "Imported Library Clothing" folder - LLNameCategoryCollector matchFolderFunctor(mImportedClothingName); - gInventory.collectDescendentsIf(mClothingID, - cat_array, wearable_array, - LLInventoryModel::EXCLUDE_TRASH, - matchFolderFunctor); - if (cat_array.size() > 0) - { - const LLViewerInventoryCategory *cat = cat_array.get(0); - mImportedClothingID = cat->getUUID(); - } - - mComplete.clear(); - setFetchIDs(folders); - startFetch(); - if (isFinished()) - { - done(); - } -} - -class LLLibraryOutfitsCopyDone: public LLInventoryCallback -{ -public: - LLLibraryOutfitsCopyDone(LLLibraryOutfitsFetch * fetcher): - mFireCount(0), mLibraryOutfitsFetcher(fetcher) - { - } - - virtual ~LLLibraryOutfitsCopyDone() - { - if (!LLApp::isExiting() && mLibraryOutfitsFetcher) - { - gInventory.addObserver(mLibraryOutfitsFetcher); - mLibraryOutfitsFetcher->done(); - } - } - - /* virtual */ void fire(const LLUUID& inv_item) - { - mFireCount++; - } -private: - U32 mFireCount; - LLLibraryOutfitsFetch * mLibraryOutfitsFetcher; -}; - -// Copy the clothing folders from the library into the imported clothing folder -void LLLibraryOutfitsFetch::libraryDone() -{ - llinfos << "start" << llendl; - - if (mImportedClothingID != LLUUID::null) - { - // Skip straight to fetching the contents of the imported folder - importedFolderFetch(); - return; - } - - // Remove observer; next autopopulation step will be triggered externally by LLLibraryOutfitsCopyDone. - gInventory.removeObserver(this); - - LLPointer<LLInventoryCallback> copy_waiter = new LLLibraryOutfitsCopyDone(this); - mImportedClothingID = gInventory.createNewCategory(mClothingID, - LLFolderType::FT_NONE, - mImportedClothingName); - // Copy each folder from library into clothing unless it already exists. - for (uuid_vec_t::const_iterator iter = mLibraryClothingFolders.begin(); - iter != mLibraryClothingFolders.end(); - ++iter) - { - const LLUUID& src_folder_id = (*iter); // Library clothing folder ID - const LLViewerInventoryCategory *cat = gInventory.getCategory(src_folder_id); - if (!cat) - { - llwarns << "Library folder import for uuid:" << src_folder_id << " failed to find folder." << llendl; - continue; - } - - if (!LLAppearanceMgr::getInstance()->getCanMakeFolderIntoOutfit(src_folder_id)) - { - llinfos << "Skipping non-outfit folder name:" << cat->getName() << llendl; - continue; - } - - // Don't copy the category if it already exists. - LLNameCategoryCollector matchFolderFunctor(cat->getName()); - LLInventoryModel::cat_array_t cat_array; - LLInventoryModel::item_array_t wearable_array; - gInventory.collectDescendentsIf(mImportedClothingID, - cat_array, wearable_array, - LLInventoryModel::EXCLUDE_TRASH, - matchFolderFunctor); - if (cat_array.size() > 0) - { - continue; - } - - LLUUID dst_folder_id = gInventory.createNewCategory(mImportedClothingID, - LLFolderType::FT_NONE, - cat->getName()); - LLAppearanceMgr::getInstance()->shallowCopyCategoryContents(src_folder_id, dst_folder_id, copy_waiter); - } -} - -void LLLibraryOutfitsFetch::importedFolderFetch() -{ - llinfos << "start" << llendl; - - // Fetch the contents of the Imported Clothing Folder - uuid_vec_t folders; - folders.push_back(mImportedClothingID); - - mComplete.clear(); - setFetchIDs(folders); - startFetch(); - if (isFinished()) - { - done(); - } -} - -void LLLibraryOutfitsFetch::importedFolderDone() -{ - llinfos << "start" << llendl; - - LLInventoryModel::cat_array_t cat_array; - LLInventoryModel::item_array_t wearable_array; - uuid_vec_t folders; - - // Collect the contents of the Imported Clothing folder - gInventory.collectDescendents(mImportedClothingID, cat_array, wearable_array, - LLInventoryModel::EXCLUDE_TRASH); - - for (LLInventoryModel::cat_array_t::const_iterator iter = cat_array.begin(); - iter != cat_array.end(); - ++iter) - { - const LLViewerInventoryCategory *cat = iter->get(); - - // Get the name of every imported outfit - folders.push_back(cat->getUUID()); - mImportedClothingFolders.push_back(cat->getUUID()); - } - - mComplete.clear(); - setFetchIDs(folders); - startFetch(); - if (isFinished()) - { - done(); - } -} - -void LLLibraryOutfitsFetch::contentsDone() -{ - llinfos << "start" << llendl; - - LLInventoryModel::cat_array_t cat_array; - LLInventoryModel::item_array_t wearable_array; - - LLPointer<LLInventoryCallback> order_myoutfits_on_destroy = new LLBoostFuncInventoryCallback(no_op_inventory_func, order_my_outfits_cb); - - for (uuid_vec_t::const_iterator folder_iter = mImportedClothingFolders.begin(); - folder_iter != mImportedClothingFolders.end(); - ++folder_iter) - { - const LLUUID &folder_id = (*folder_iter); - const LLViewerInventoryCategory *cat = gInventory.getCategory(folder_id); - if (!cat) - { - llwarns << "Library folder import for uuid:" << folder_id << " failed to find folder." << llendl; - continue; - } - - //initial outfit should be already in My Outfits - if (cat->getName() == LLStartUp::getInitialOutfitName()) continue; - - // First, make a folder in the My Outfits directory. - LLUUID new_outfit_folder_id = gInventory.createNewCategory(mMyOutfitsID, LLFolderType::FT_OUTFIT, cat->getName()); - - cat_array.clear(); - wearable_array.clear(); - // Collect the contents of each imported clothing folder, so we can create new outfit links for it - gInventory.collectDescendents(folder_id, cat_array, wearable_array, - LLInventoryModel::EXCLUDE_TRASH); - - for (LLInventoryModel::item_array_t::const_iterator wearable_iter = wearable_array.begin(); - wearable_iter != wearable_array.end(); - ++wearable_iter) - { - const LLViewerInventoryItem *item = wearable_iter->get(); - link_inventory_item(gAgent.getID(), - item->getLinkedUUID(), - new_outfit_folder_id, - item->getName(), - item->getDescription(), - LLAssetType::AT_LINK, - order_myoutfits_on_destroy); - } - } - - mOutfitsPopulated = true; -} - diff --git a/indra/newview/llagentwearablesfetch.h b/indra/newview/llagentwearablesfetch.h index bedc445c0e..81b03110ae 100755 --- a/indra/newview/llagentwearablesfetch.h +++ b/indra/newview/llagentwearablesfetch.h @@ -70,45 +70,4 @@ private: initial_wearable_data_vec_t mAgentInitialWearables; // Wearables from the old agent wearables msg }; -//-------------------------------------------------------------------- -// InitialWearablesFetch -// -// This grabs outfits from the Library and copies those over to the user's -// outfits folder, typically during first-ever login. -//-------------------------------------------------------------------- -class LLLibraryOutfitsFetch : public LLInventoryFetchDescendentsObserver -{ -public: - enum ELibraryOutfitFetchStep - { - LOFS_FOLDER = 0, - LOFS_OUTFITS, - LOFS_LIBRARY, - LOFS_IMPORTED, - LOFS_CONTENTS - }; - - LLLibraryOutfitsFetch(const LLUUID& my_outfits_id); - ~LLLibraryOutfitsFetch(); - - virtual void done(); - void doneIdle(); - LLUUID mMyOutfitsID; - void importedFolderFetch(); -protected: - void folderDone(); - void outfitsDone(); - void libraryDone(); - void importedFolderDone(); - void contentsDone(); - enum ELibraryOutfitFetchStep mCurrFetchStep; - uuid_vec_t mLibraryClothingFolders; - uuid_vec_t mImportedClothingFolders; - bool mOutfitsPopulated; - LLUUID mClothingID; - LLUUID mLibraryClothingID; - LLUUID mImportedClothingID; - std::string mImportedClothingName; -}; - #endif // LL_AGENTWEARABLESINITIALFETCH_H diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 98909c258a..28099f59f3 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -2815,23 +2815,6 @@ void LLAppearanceMgr::copyLibraryGestures() } } -void LLAppearanceMgr::autopopulateOutfits() -{ - // If this is the very first time the user has logged into viewer2+ (from a legacy viewer, or new account) - // then auto-populate outfits from the library into the My Outfits folder. - - LL_INFOS("Avatar") << self_av_string() << "avatar fully visible" << LL_ENDL; - - static bool check_populate_my_outfits = true; - if (check_populate_my_outfits && - (LLInventoryModel::getIsFirstTimeInViewer2() - || gSavedSettings.getBOOL("MyOutfitsAutofill"))) - { - gAgentWearables.populateMyOutfitsFolder(); - } - check_populate_my_outfits = false; -} - // Handler for anything that's deferred until avatar de-clouds. void LLAppearanceMgr::onFirstFullyVisible() { @@ -2839,10 +2822,6 @@ void LLAppearanceMgr::onFirstFullyVisible() gAgentAvatarp->reportAvatarRezTime(); gAgentAvatarp->debugAvatarVisible(); - // The auto-populate is failing at the point of generating outfits - // folders, so don't do the library copy until that is resolved. - // autopopulateOutfits(); - // If this is the first time we've ever logged in, // then copy default gestures from the library. if (gAgent.isFirstLogin()) { diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index 84a0afbb40..b2917cced4 100755 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -173,9 +173,6 @@ public: // Called when self avatar is first fully visible. void onFirstFullyVisible(); - // Create initial outfits from library. - void autopopulateOutfits(); - // Copy initial gestures from library. void copyLibraryGestures(); -- cgit v1.2.3 From 47fb1fc67b9cc1d3a31359da871cb6477701173b Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Thu, 27 Jun 2013 15:30:14 -0400 Subject: SH-4300 WIP - added callback for a non-callback case of updateClothingOrderingInfo. Also removed some wrong code for drag-and-drop corresponding to a case that's not allowed anyway. --- indra/newview/llappearancemgr.cpp | 30 ++++++++++++++++++++---------- indra/newview/llinventorybridge.cpp | 25 ++++++------------------- 2 files changed, 26 insertions(+), 29 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 28099f59f3..f427214dbb 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -2839,6 +2839,22 @@ void appearance_mgr_update_dirty_state() } } +void update_base_outfit_after_ordering() +{ + LLAppearanceMgr& app_mgr = LLAppearanceMgr::instance(); + + LLPointer<LLInventoryCallback> dirty_state_updater = + new LLBoostFuncInventoryCallback(no_op_inventory_func, appearance_mgr_update_dirty_state); + + //COF contains only links so we copy to the Base Outfit only links + const LLUUID base_outfit_id = app_mgr.getBaseOutfitUUID(); + bool copy_folder_links = false; + app_mgr.slamCategoryLinks(app_mgr.getCOF(), base_outfit_id, copy_folder_links, dirty_state_updater); + +} + +// Save COF changes - update the contents of the current base outfit +// to match the current COF. Fails if no current base outfit is set. bool LLAppearanceMgr::updateBaseOutfit() { if (isOutfitLocked()) @@ -2848,23 +2864,17 @@ bool LLAppearanceMgr::updateBaseOutfit() return false; } - setOutfitLocked(true); gAgentWearables.notifyLoadingStarted(); const LLUUID base_outfit_id = getBaseOutfitUUID(); - LL_DEBUGS("Avatar") << "updating base outfit to " << base_outfit_id << llendl; if (base_outfit_id.isNull()) return false; + LL_DEBUGS("Avatar") << "saving cof to base outfit " << base_outfit_id << llendl; - updateClothingOrderingInfo(); - - LLPointer<LLInventoryCallback> dirty_state_updater = - new LLBoostFuncInventoryCallback(no_op_inventory_func, appearance_mgr_update_dirty_state); - - //COF contains only links so we copy to the Base Outfit only links - bool copy_folder_links = false; - slamCategoryLinks(getCOF(), base_outfit_id, copy_folder_links, dirty_state_updater); + LLPointer<LLInventoryCallback> cb = + new LLBoostFuncInventoryCallback(no_op_inventory_func, update_base_outfit_after_ordering); + updateClothingOrderingInfo(LLUUID::null, cb); return true; } diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 09a96c82b5..cb3f40a5bb 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2416,26 +2416,13 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, } } } - // if target is an outfit or current outfit folder we use link - if (move_is_into_current_outfit || move_is_into_outfit) + // if target is current outfit folder we use link + if (move_is_into_current_outfit && + inv_cat->getPreferredType() == LLFolderType::FT_NONE) { - if (inv_cat->getPreferredType() == LLFolderType::FT_NONE) - { - if (move_is_into_current_outfit) - { - // traverse category and add all contents to currently worn. - BOOL append = true; - LLAppearanceMgr::instance().wearInventoryCategory(inv_cat, false, append); - } - else - { - // Recursively create links in target outfit. - LLInventoryModel::cat_array_t cats; - LLInventoryModel::item_array_t items; - model->collectDescendents(cat_id, cats, items, LLInventoryModel::EXCLUDE_TRASH); - LLAppearanceMgr::instance().linkAll(mUUID,items,NULL); - } - } + // traverse category and add all contents to currently worn. + BOOL append = true; + LLAppearanceMgr::instance().wearInventoryCategory(inv_cat, false, append); } else if (move_is_into_outbox && !move_is_from_outbox) { -- cgit v1.2.3 From cda919cdbf048aef6f4d10ff804c6e2dad495eef Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Thu, 27 Jun 2013 15:37:57 -0400 Subject: SH-4300 WIP - comment --- indra/newview/llappearancemgr.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index f427214dbb..c162885961 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -2874,6 +2874,8 @@ bool LLAppearanceMgr::updateBaseOutfit() LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(no_op_inventory_func, update_base_outfit_after_ordering); + // Really shouldn't be needed unless there's a race condition - + // updateAppearanceFromCOF() already calls updateClothingOrderingInfo. updateClothingOrderingInfo(LLUUID::null, cb); return true; -- cgit v1.2.3 From 62a6009fa265cd56c8711300a830446b03532785 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Thu, 27 Jun 2013 16:15:47 -0400 Subject: Log slamming calls --- indra/newview/llviewerinventory.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 9725ea6456..c934dd991b 100755 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -1567,11 +1567,15 @@ void slam_inventory_folder(const LLUUID& folder_id, std::string cap; if (AISCommand::getCap(cap)) { + LL_DEBUGS("Avatar") << "using AISv3 to slam folder, id " << folder_id + << " new contents: " << ll_pretty_print_sd(contents) << llendl; LLPointer<AISCommand> cmd_ptr = new SlamFolderCommand(folder_id, contents, cb); cmd_ptr->run_command(); } else // no cap { + LL_DEBUGS("Avatar") << "using item-by-item calls to slam folder, id " << folder_id + << " new contents: " << ll_pretty_print_sd(contents) << llendl; for (LLSD::array_const_iterator it = contents.beginArray(); it != contents.endArray(); ++it) -- cgit v1.2.3 From 39b734a00199eb7d24edf06f9c496161819ebde7 Mon Sep 17 00:00:00 2001 From: Nyx Linden <nyx@lindenlab.com> Date: Fri, 28 Jun 2013 11:59:03 -0400 Subject: SH-4240 FIX users can set hover height to 0 removing minimum height enforcement, as changes are local-only and would not be visible by other users in this repro, unless the user explicitly saved the changes. Since there are many ways to get around the enforcement, and the enforced minimums won't be visible to other users, its simpler to allow users to use the full range of the hover slider. NOTE: this means that a user's avatar can be underground, leading to the camera pointing up at the sky. this is a known issue. --- indra/newview/llvoavatar.cpp | 66 -------------------------------------------- indra/newview/llvoavatar.h | 3 -- 2 files changed, 69 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 8c20533b4c..2fd26eae80 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5214,72 +5214,6 @@ void LLVOAvatar::updateVisualParams() updateHeadOffset(); } -/*virtual*/ -void LLVOAvatar::computeBodySize() -{ - LLAvatarAppearance::computeBodySize(); - - // Certain configurations of avatars can force the overall height (with offset) to go negative. - // Enforce a constraint to make sure we don't go below 1.1 meters (server-enforced limit) - // Camera positioning and other things start to break down when your avatar is "walking" while being fully underground - const LLViewerObject * last_object = NULL; - if (isSelf() && getWearableData() && !LLApp::isQuitting()) - { - // Do not force a hover parameter change while we have pending attachments, which may be mesh-based with - // joint offsets. - if (LLAppearanceMgr::instance().getNumAttachmentsInCOF() == getNumAttachments()) - { - LLViewerWearable* shape = (LLViewerWearable*)getWearableData()->getWearable(LLWearableType::WT_SHAPE, 0); - BOOL loaded = TRUE; - for (attachment_map_t::const_iterator points_iter = mAttachmentPoints.begin(); - points_iter != mAttachmentPoints.end() && loaded; - ++points_iter) - { - const LLViewerJointAttachment *attachment_pt = (*points_iter).second; - if (attachment_pt) - { - for (LLViewerJointAttachment::attachedobjs_vec_t::const_iterator attach_iter = attachment_pt->mAttachedObjects.begin(); attach_iter != attachment_pt->mAttachedObjects.end(); attach_iter++) - { - const LLViewerObject* object = (LLViewerObject*)*attach_iter; - if (object) - { - last_object = object; - llwarns << "attachment at point: " << (*points_iter).first << " object exists: " << object->getAttachmentItemID() << llendl; - loaded &=!object->isDrawableState(LLDrawable::REBUILD_ALL); - if (!loaded && shape && !shape->getVolatile()) - { - llwarns << "caught unloaded attachment! skipping enforcement" << llendl; - } - } - } - } - } - - if (last_object) - { - LL_DEBUGS("Avatar") << "scanned at least one object!" << LL_ENDL; - } - if (loaded && shape && !shape->getVolatile()) - { - F32 hover_value = shape->getVisualParamWeight(AVATAR_HOVER); - if (hover_value < 0.0f && (mBodySize.mV[VZ] + hover_value < 1.1f)) - { - hover_value = -(mBodySize.mV[VZ] - 1.1f); // avoid floating point rounding making the above check continue to fail. - llassert(mBodySize.mV[VZ] + hover_value >= 1.1f); - - hover_value = llmin(hover_value, 0.0f); // don't force the hover value to be greater than 0. - - LL_DEBUGS("Avatar") << "changed hover value to: " << hover_value << " from: " << mAvatarOffset.mV[VZ] << LL_ENDL; - - mAvatarOffset.mV[VZ] = hover_value; - shape->setVisualParamWeight(AVATAR_HOVER,hover_value, FALSE); - } - } - } - } -} - - //----------------------------------------------------------------------------- // isActive() //----------------------------------------------------------------------------- diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index fad2fd962c..48b5a6e873 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -212,9 +212,6 @@ public: /*virtual*/ LLVector3 getPosAgentFromGlobal(const LLVector3d &position); virtual void updateVisualParams(); - /*virtual*/ void computeBodySize(); - - /** Inherited ** ** -- cgit v1.2.3 From 8f4f7452308d41467b021ae0da821b33f559dd79 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Wed, 3 Jul 2013 12:45:56 -0400 Subject: SH-4226 WIP - try to be smarter about when to send appearance update requests, removed many redundant calls --- indra/newview/llappearancemgr.cpp | 413 +++++++++++++++++++++--------------- indra/newview/llappearancemgr.h | 5 +- indra/newview/llhttpretrypolicy.cpp | 5 + indra/newview/llhttpretrypolicy.h | 4 + indra/newview/llvoavatar.cpp | 15 +- 5 files changed, 270 insertions(+), 172 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 12c8c82af4..485c47b2f7 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -3037,158 +3037,274 @@ void LLAppearanceMgr::updateClothingOrderingInfo(LLUUID cat_id, class RequestAgentUpdateAppearanceResponder: public LLHTTPClient::Responder { LOG_CLASS(RequestAgentUpdateAppearanceResponder); + + friend class LLAppearanceMgr; + public: - RequestAgentUpdateAppearanceResponder() - { - bool retry_on_4xx = true; - mRetryPolicy = new LLAdaptiveRetryPolicy(1.0, 32.0, 2.0, 10, retry_on_4xx); - } + RequestAgentUpdateAppearanceResponder(); - virtual ~RequestAgentUpdateAppearanceResponder() - { - } + virtual ~RequestAgentUpdateAppearanceResponder(); + +private: + // Called when sendServerAppearanceUpdate called. May or may not + // trigger a request depending on various bits of state. + void onRequestRequested(); + + // Post the actual appearance request to cap. + void sendRequest(); + + void debugCOF(const LLSD& content); protected: // Successful completion. - /* virtual */ void httpSuccess() - { - const LLSD& content = getContent(); - if (!content.isMap()) - { - failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content); - return; - } - if (content["success"].asBoolean()) - { - //LL_DEBUGS("Avatar") << dumpResponse() << LL_ENDL; - if (gSavedSettings.getBOOL("DebugAvatarAppearanceMessage")) - { - dump_sequential_xml(gAgentAvatarp->getFullname() + "_appearance_request_ok", content); - } - } - else - { - failureResult(HTTP_INTERNAL_ERROR, "Non-success response", content); - } - } + /* virtual */ void httpSuccess(); // Error - /*virtual*/ void httpFailure() + /*virtual*/ void httpFailure(); + + void onFailure(); + void onSuccess(); + + S32 mInFlightCounter; + LLTimer mInFlightTimer; + LLPointer<LLHTTPRetryPolicy> mRetryPolicy; +}; + +RequestAgentUpdateAppearanceResponder::RequestAgentUpdateAppearanceResponder() +{ + bool retry_on_4xx = true; + mRetryPolicy = new LLAdaptiveRetryPolicy(1.0, 32.0, 2.0, 10, retry_on_4xx); + mInFlightCounter = 0; +} + +RequestAgentUpdateAppearanceResponder::~RequestAgentUpdateAppearanceResponder() +{ +} + +void RequestAgentUpdateAppearanceResponder::onRequestRequested() +{ + // If we have already received an update for this or higher cof version, ignore. + S32 cof_version = LLAppearanceMgr::instance().getCOFVersion(); + S32 last_rcv = gAgentAvatarp->mLastUpdateReceivedCOFVersion; + S32 last_req = gAgentAvatarp->mLastUpdateRequestCOFVersion; + LL_DEBUGS("Avatar") << "cof_version " << cof_version + << " last_rcv " << last_rcv + << " last_req " << last_req + << " in flight " << mInFlightCounter << llendl; + if ((mInFlightCounter>0) && (mInFlightTimer.hasExpired())) + { + LL_WARNS("Avatar") << "in flight timer expired, resetting " << llendl; + mInFlightCounter = 0; + } + if (cof_version < last_rcv) { - LL_WARNS("Avatar") << "appearance update request failed, status " - << getStatus() << " reason " << getReason() << LL_ENDL; + LL_DEBUGS("Avatar") << "Have already received update for cof version " << last_rcv + << " will not request for " << cof_version << llendl; + return; + } + if (mInFlightCounter>0 && last_req >= cof_version) + { + LL_DEBUGS("Avatar") << "Request already in flight for cof version " << last_req + << " will not request for " << cof_version << llendl; + return; + } - if (gSavedSettings.getBOOL("DebugAvatarAppearanceMessage")) - { - const LLSD& content = getContent(); - dump_sequential_xml(gAgentAvatarp->getFullname() + "_appearance_request_error", content); - debugCOF(content); - } - onFailure(); + // Actually send the request. + LL_DEBUGS("Avatar") << "Will send request for cof_version " << cof_version << llendl; + mRetryPolicy->reset(); + sendRequest(); +} + +void RequestAgentUpdateAppearanceResponder::sendRequest() +{ + if (gAgentAvatarp->isEditingAppearance()) + { + // don't send out appearance updates if in appearance editing mode + return; } - void onFailure() + if (!gAgent.getRegion()) { - F32 seconds_to_wait; - mRetryPolicy->onFailure(getStatus(), getResponseHeaders()); - if (mRetryPolicy->shouldRetry(seconds_to_wait)) - { - llinfos << "retrying" << llendl; - doAfterInterval(boost::bind(&LLAppearanceMgr::requestServerAppearanceUpdate, - LLAppearanceMgr::getInstance(), - LLHTTPClient::ResponderPtr(this)), - seconds_to_wait); - } - else + llwarns << "Region not set, cannot request server appearance update" << llendl; + return; + } + if (gAgent.getRegion()->getCentralBakeVersion()==0) + { + llwarns << "Region does not support baking" << llendl; + } + std::string url = gAgent.getRegion()->getCapability("UpdateAvatarAppearance"); + if (url.empty()) + { + llwarns << "No cap for UpdateAvatarAppearance." << llendl; + return; + } + + LLSD body; + S32 cof_version = LLAppearanceMgr::instance().getCOFVersion(); + if (gSavedSettings.getBOOL("DebugAvatarExperimentalServerAppearanceUpdate")) + { + body = LLAppearanceMgr::instance().dumpCOF(); + } + else + { + body["cof_version"] = cof_version; + if (gSavedSettings.getBOOL("DebugForceAppearanceRequestFailure")) { - llwarns << "giving up after too many retries" << llendl; + body["cof_version"] = cof_version+999; } - } + } + LL_DEBUGS("Avatar") << "request url " << url << " my_cof_version " << cof_version << llendl; + + mInFlightCounter++; + mInFlightTimer.setTimerExpirySec(30.0); + LLHTTPClient::post(url, body, this); + llassert(cof_version >= gAgentAvatarp->mLastUpdateRequestCOFVersion); + gAgentAvatarp->mLastUpdateRequestCOFVersion = cof_version; +} - void debugCOF(const LLSD& content) +void RequestAgentUpdateAppearanceResponder::debugCOF(const LLSD& content) +{ + LL_INFOS("Avatar") << "AIS COF, version received: " << content["expected"].asInteger() + << " ================================= " << llendl; + std::set<LLUUID> ais_items, local_items; + const LLSD& cof_raw = content["cof_raw"]; + for (LLSD::array_const_iterator it = cof_raw.beginArray(); + it != cof_raw.endArray(); ++it) { - LL_INFOS("Avatar") << "AIS COF, version received: " << content["expected"].asInteger() - << " ================================= " << llendl; - std::set<LLUUID> ais_items, local_items; - const LLSD& cof_raw = content["cof_raw"]; - for (LLSD::array_const_iterator it = cof_raw.beginArray(); - it != cof_raw.endArray(); ++it) + const LLSD& item = *it; + if (item["parent_id"].asUUID() == LLAppearanceMgr::instance().getCOF()) { - const LLSD& item = *it; - if (item["parent_id"].asUUID() == LLAppearanceMgr::instance().getCOF()) + ais_items.insert(item["item_id"].asUUID()); + if (item["type"].asInteger() == 24) // link { - ais_items.insert(item["item_id"].asUUID()); - if (item["type"].asInteger() == 24) // link - { - LL_INFOS("Avatar") << "AIS Link: item_id: " << item["item_id"].asUUID() - << " linked_item_id: " << item["asset_id"].asUUID() - << " name: " << item["name"].asString() - << llendl; - } - else if (item["type"].asInteger() == 25) // folder link - { - LL_INFOS("Avatar") << "AIS Folder link: item_id: " << item["item_id"].asUUID() - << " linked_item_id: " << item["asset_id"].asUUID() - << " name: " << item["name"].asString() - << llendl; + LL_INFOS("Avatar") << "AIS Link: item_id: " << item["item_id"].asUUID() + << " linked_item_id: " << item["asset_id"].asUUID() + << " name: " << item["name"].asString() + << llendl; + } + else if (item["type"].asInteger() == 25) // folder link + { + LL_INFOS("Avatar") << "AIS Folder link: item_id: " << item["item_id"].asUUID() + << " linked_item_id: " << item["asset_id"].asUUID() + << " name: " << item["name"].asString() + << llendl; - } - else - { - LL_INFOS("Avatar") << "AIS Other: item_id: " << item["item_id"].asUUID() - << " linked_item_id: " << item["asset_id"].asUUID() - << " name: " << item["name"].asString() - << " type: " << item["type"].asInteger() - << llendl; - } } - } - LL_INFOS("Avatar") << llendl; - LL_INFOS("Avatar") << "Local COF, version requested: " << content["observed"].asInteger() - << " ================================= " << llendl; - LLInventoryModel::cat_array_t cat_array; - LLInventoryModel::item_array_t item_array; - gInventory.collectDescendents(LLAppearanceMgr::instance().getCOF(), - cat_array,item_array,LLInventoryModel::EXCLUDE_TRASH); - for (S32 i=0; i<item_array.count(); i++) - { - const LLViewerInventoryItem* inv_item = item_array.get(i).get(); - local_items.insert(inv_item->getUUID()); - LL_INFOS("Avatar") << "LOCAL: item_id: " << inv_item->getUUID() - << " linked_item_id: " << inv_item->getLinkedUUID() - << " name: " << inv_item->getName() - << " parent: " << inv_item->getParentUUID() - << llendl; - } - LL_INFOS("Avatar") << " ================================= " << llendl; - S32 local_only = 0, ais_only = 0; - for (std::set<LLUUID>::iterator it = local_items.begin(); it != local_items.end(); ++it) - { - if (ais_items.find(*it) == ais_items.end()) + else { - LL_INFOS("Avatar") << "LOCAL ONLY: " << *it << llendl; - local_only++; + LL_INFOS("Avatar") << "AIS Other: item_id: " << item["item_id"].asUUID() + << " linked_item_id: " << item["asset_id"].asUUID() + << " name: " << item["name"].asString() + << " type: " << item["type"].asInteger() + << llendl; } } - for (std::set<LLUUID>::iterator it = ais_items.begin(); it != ais_items.end(); ++it) + } + LL_INFOS("Avatar") << llendl; + LL_INFOS("Avatar") << "Local COF, version requested: " << content["observed"].asInteger() + << " ================================= " << llendl; + LLInventoryModel::cat_array_t cat_array; + LLInventoryModel::item_array_t item_array; + gInventory.collectDescendents(LLAppearanceMgr::instance().getCOF(), + cat_array,item_array,LLInventoryModel::EXCLUDE_TRASH); + for (S32 i=0; i<item_array.count(); i++) + { + const LLViewerInventoryItem* inv_item = item_array.get(i).get(); + local_items.insert(inv_item->getUUID()); + LL_INFOS("Avatar") << "LOCAL: item_id: " << inv_item->getUUID() + << " linked_item_id: " << inv_item->getLinkedUUID() + << " name: " << inv_item->getName() + << " parent: " << inv_item->getParentUUID() + << llendl; + } + LL_INFOS("Avatar") << " ================================= " << llendl; + S32 local_only = 0, ais_only = 0; + for (std::set<LLUUID>::iterator it = local_items.begin(); it != local_items.end(); ++it) + { + if (ais_items.find(*it) == ais_items.end()) { - if (local_items.find(*it) == local_items.end()) - { - LL_INFOS("Avatar") << "AIS ONLY: " << *it << llendl; - ais_only++; - } + LL_INFOS("Avatar") << "LOCAL ONLY: " << *it << llendl; + local_only++; } - if (local_only==0 && ais_only==0) + } + for (std::set<LLUUID>::iterator it = ais_items.begin(); it != ais_items.end(); ++it) + { + if (local_items.find(*it) == local_items.end()) { - LL_INFOS("Avatar") << "COF contents identical, only version numbers differ (req " - << content["observed"].asInteger() - << " rcv " << content["expected"].asInteger() - << ")" << llendl; + LL_INFOS("Avatar") << "AIS ONLY: " << *it << llendl; + ais_only++; } } + if (local_only==0 && ais_only==0) + { + LL_INFOS("Avatar") << "COF contents identical, only version numbers differ (req " + << content["observed"].asInteger() + << " rcv " << content["expected"].asInteger() + << ")" << llendl; + } +} + +/* virtual */ void RequestAgentUpdateAppearanceResponder::httpSuccess() +{ + const LLSD& content = getContent(); + if (!content.isMap()) + { + failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content); + return; + } + if (content["success"].asBoolean()) + { + //LL_DEBUGS("Avatar") << dumpResponse() << LL_ENDL; + if (gSavedSettings.getBOOL("DebugAvatarAppearanceMessage")) + { + dump_sequential_xml(gAgentAvatarp->getFullname() + "_appearance_request_ok", content); + } + + onSuccess(); + } + else + { + failureResult(HTTP_INTERNAL_ERROR, "Non-success response", content); + } +} + +void RequestAgentUpdateAppearanceResponder::onSuccess() +{ + mInFlightCounter = llmax(mInFlightCounter-1,0); +} + +/*virtual*/ void RequestAgentUpdateAppearanceResponder::httpFailure() +{ + LL_WARNS("Avatar") << "appearance update request failed, status " + << getStatus() << " reason " << getReason() << LL_ENDL; + + if (gSavedSettings.getBOOL("DebugAvatarAppearanceMessage")) + { + const LLSD& content = getContent(); + dump_sequential_xml(gAgentAvatarp->getFullname() + "_appearance_request_error", content); + debugCOF(content); + } + onFailure(); +} + +void RequestAgentUpdateAppearanceResponder::onFailure() +{ + mInFlightCounter = llmax(mInFlightCounter-1,0); + + F32 seconds_to_wait; + mRetryPolicy->onFailure(getStatus(), getResponseHeaders()); + if (mRetryPolicy->shouldRetry(seconds_to_wait)) + { + llinfos << "retrying" << llendl; + doAfterInterval(boost::bind(&RequestAgentUpdateAppearanceResponder::sendRequest,this), + seconds_to_wait); + } + else + { + llwarns << "giving up after too many retries" << llendl; + } +} - LLPointer<LLHTTPRetryPolicy> mRetryPolicy; -}; LLSD LLAppearanceMgr::dumpCOF() const { @@ -3253,53 +3369,9 @@ LLSD LLAppearanceMgr::dumpCOF() const return result; } -void LLAppearanceMgr::requestServerAppearanceUpdate(LLCurl::ResponderPtr responder_ptr) +void LLAppearanceMgr::requestServerAppearanceUpdate() { - if (gAgentAvatarp->isEditingAppearance()) - { - // don't send out appearance updates if in appearance editing mode - return; - } - - if (!gAgent.getRegion()) - { - llwarns << "Region not set, cannot request server appearance update" << llendl; - return; - } - if (gAgent.getRegion()->getCentralBakeVersion()==0) - { - llwarns << "Region does not support baking" << llendl; - } - std::string url = gAgent.getRegion()->getCapability("UpdateAvatarAppearance"); - if (url.empty()) - { - llwarns << "No cap for UpdateAvatarAppearance." << llendl; - return; - } - - LLSD body; - S32 cof_version = getCOFVersion(); - if (gSavedSettings.getBOOL("DebugAvatarExperimentalServerAppearanceUpdate")) - { - body = dumpCOF(); - } - else - { - 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; - - if (!responder_ptr.get()) - { - responder_ptr = new RequestAgentUpdateAppearanceResponder; - } - LLHTTPClient::post(url, body, responder_ptr); - llassert(cof_version >= gAgentAvatarp->mLastUpdateRequestCOFVersion); - gAgentAvatarp->mLastUpdateRequestCOFVersion = cof_version; + mAppearanceResponder->onRequestRequested(); } class LLIncrementCofVersionResponder : public LLHTTPClient::Responder @@ -3635,7 +3707,8 @@ LLAppearanceMgr::LLAppearanceMgr(): mAttachmentInvLinkEnabled(false), mOutfitIsDirty(false), mOutfitLocked(false), - mIsInUpdateAppearanceFromCOF(false) + mIsInUpdateAppearanceFromCOF(false), + mAppearanceResponder(new RequestAgentUpdateAppearanceResponder) { LLOutfitObserver& outfit_observer = LLOutfitObserver::instance(); diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index b2917cced4..13a2a62717 100755 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -38,6 +38,7 @@ class LLWearableHoldingPattern; class LLInventoryCallback; class LLOutfitUnLockTimer; +class RequestAgentUpdateAppearanceResponder; class LLAppearanceMgr: public LLSingleton<LLAppearanceMgr> { @@ -214,7 +215,7 @@ public: bool isInUpdateAppearanceFromCOF() { return mIsInUpdateAppearanceFromCOF; } - void requestServerAppearanceUpdate(LLCurl::ResponderPtr responder_ptr = NULL); + void requestServerAppearanceUpdate(); void incrementCofVersion(LLHTTPClient::ResponderPtr responder_ptr = NULL); @@ -255,6 +256,8 @@ private: bool mOutfitIsDirty; bool mIsInUpdateAppearanceFromCOF; // to detect recursive calls. + LLPointer<RequestAgentUpdateAppearanceResponder> mAppearanceResponder; + /** * Lock for blocking operations on outfit until server reply or timeout exceed * to avoid unsynchronized outfit state or performing duplicate operations. diff --git a/indra/newview/llhttpretrypolicy.cpp b/indra/newview/llhttpretrypolicy.cpp index 1512b46103..ae429f11f8 100755 --- a/indra/newview/llhttpretrypolicy.cpp +++ b/indra/newview/llhttpretrypolicy.cpp @@ -45,6 +45,11 @@ void LLAdaptiveRetryPolicy::init() mShouldRetry = true; } +void LLAdaptiveRetryPolicy::reset() +{ + init(); +} + bool LLAdaptiveRetryPolicy::getRetryAfter(const LLSD& headers, F32& retry_header_time) { return (headers.has(HTTP_IN_HEADER_RETRY_AFTER) diff --git a/indra/newview/llhttpretrypolicy.h b/indra/newview/llhttpretrypolicy.h index 5b1a1d79e0..cf79e0b401 100755 --- a/indra/newview/llhttpretrypolicy.h +++ b/indra/newview/llhttpretrypolicy.h @@ -53,6 +53,8 @@ public: virtual void onFailure(const LLCore::HttpResponse *response) = 0; virtual bool shouldRetry(F32& seconds_to_wait) const = 0; + + virtual void reset() = 0; }; // Very general policy with geometric back-off after failures, @@ -64,6 +66,8 @@ public: // virtual void onSuccess(); + + void reset(); // virtual void onFailure(S32 status, const LLSD& headers); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 2fd26eae80..74fb51b943 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -7014,7 +7014,15 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) return; } - mLastUpdateReceivedCOFVersion = this_update_cof_version; + // No backsies zone - if we get here, the message should be valid and usable. + if (appearance_version > 0) + { + // Note: + // RequestAgentUpdateAppearanceResponder::onRequestRequested() + // assumes that cof version is only updated with server-bake + // appearance messages. + mLastUpdateReceivedCOFVersion = this_update_cof_version; + } setIsUsingServerBakes(appearance_version > 0); @@ -7061,6 +7069,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) LL_DEBUGS("Avatar") << avString() << " handle visual params, num_params " << num_params << LL_ENDL; BOOL params_changed = FALSE; BOOL interp_params = FALSE; + S32 params_changed_count = 0; for( S32 i = 0; i < num_params; i++ ) { @@ -7070,12 +7079,15 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) if (is_first_appearance_message || (param->getWeight() != newWeight)) { params_changed = TRUE; + params_changed_count++; if(is_first_appearance_message) { + //LL_DEBUGS("Avatar") << "param slam " << i << " " << newWeight << llendl; param->setWeight(newWeight, FALSE); } else { + //LL_DEBUGS("Avatar") << std::setprecision(5) << " param target " << i << " " << param->getWeight() << " -> " << newWeight << llendl; interp_params = TRUE; param->setAnimationTarget(newWeight, FALSE); } @@ -7087,6 +7099,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) LL_DEBUGS("Avatar") << "Number of params in AvatarAppearance msg (" << num_params << ") does not match number of tweakable params in avatar xml file (" << expected_tweakable_count << "). Processing what we can. object: " << getID() << llendl; } + LL_DEBUGS("Avatar") << "Changed " << params_changed_count << " params" << llendl; if (params_changed) { if (interp_params) -- cgit v1.2.3 From ca16e3ad26bcbf409ead1eb9acec4e23c992f6c1 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Wed, 3 Jul 2013 13:34:11 -0400 Subject: SH-4226 WIP - small tweaks --- indra/newview/llappearancemgr.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 485c47b2f7..d994b7ca42 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -3156,7 +3156,7 @@ void RequestAgentUpdateAppearanceResponder::sendRequest() LL_DEBUGS("Avatar") << "request url " << url << " my_cof_version " << cof_version << llendl; mInFlightCounter++; - mInFlightTimer.setTimerExpirySec(30.0); + mInFlightTimer.setTimerExpirySec(60.0); LLHTTPClient::post(url, body, this); llassert(cof_version >= gAgentAvatarp->mLastUpdateRequestCOFVersion); gAgentAvatarp->mLastUpdateRequestCOFVersion = cof_version; @@ -3254,7 +3254,7 @@ void RequestAgentUpdateAppearanceResponder::debugCOF(const LLSD& content) } if (content["success"].asBoolean()) { - //LL_DEBUGS("Avatar") << dumpResponse() << LL_ENDL; + LL_DEBUGS("Avatar") << "succeeded" << llendl; if (gSavedSettings.getBOOL("DebugAvatarAppearanceMessage")) { dump_sequential_xml(gAgentAvatarp->getFullname() + "_appearance_request_ok", content); -- cgit v1.2.3 From 6ba85bd6b300b471ec5f86af462f297bb54522e2 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Wed, 3 Jul 2013 16:01:32 -0400 Subject: SH-4305 WIP - unlock and set loading complete after base outfit saved. --- indra/newview/llappearancemgr.cpp | 2 ++ indra/newview/llappearancemgr.h | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index d994b7ca42..a0f8cbe911 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -2836,6 +2836,8 @@ void appearance_mgr_update_dirty_state() if (LLAppearanceMgr::instanceExists()) { LLAppearanceMgr::getInstance()->updateIsDirty(); + LLAppearanceMgr::getInstance()->setOutfitLocked(false); + gAgentWearables.notifyLoadingFinished(); } } diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index 13a2a62717..8c8b5e2489 100755 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -171,6 +171,8 @@ public: // should only be necessary to do on initial login. void updateIsDirty(); + void setOutfitLocked(bool locked); + // Called when self avatar is first fully visible. void onFirstFullyVisible(); @@ -250,8 +252,6 @@ private: static void onOutfitRename(const LLSD& notification, const LLSD& response); - void setOutfitLocked(bool locked); - bool mAttachmentInvLinkEnabled; bool mOutfitIsDirty; bool mIsInUpdateAppearanceFromCOF; // to detect recursive calls. -- cgit v1.2.3 From d079f0dcdc0d317813cda282496a1edae3feed64 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Wed, 10 Jul 2013 13:02:09 -0700 Subject: SH-4319 WIP - set using server bakes on receiving a cached texture response in a non-bake region --- indra/newview/llagentwearables.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 8e60bf1c6d..93ccec7d49 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -1443,6 +1443,7 @@ void LLAgentWearables::queryWearableCache() { return; } + gAgentAvatarp->setIsUsingServerBakes(false); // Look up affected baked textures. // If they exist: -- cgit v1.2.3 From a85fa3b10a406218cabfecc0d592e816f8dfdb53 Mon Sep 17 00:00:00 2001 From: Don Kjer <don@lindenlab.com> Date: Thu, 11 Jul 2013 15:15:04 -0700 Subject: Adding support for COPY methods to httpclient. Implementing viewer-side use of AISv3 COPY library folder operation. (SH-4304) --- indra/newview/llaisapi.cpp | 588 ++++++++++++++++++++++++++++-------- indra/newview/llaisapi.h | 55 +++- indra/newview/llappearancemgr.cpp | 76 ++++- indra/newview/llinventorymodel.cpp | 24 +- indra/newview/llviewerinventory.cpp | 62 ++-- indra/newview/llviewerinventory.h | 4 +- indra/newview/llviewerregion.cpp | 19 +- indra/newview/llviewerregion.h | 1 + 8 files changed, 645 insertions(+), 184 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp index 6d5f1951f9..cb8700865a 100755 --- a/indra/newview/llaisapi.cpp +++ b/indra/newview/llaisapi.cpp @@ -40,14 +40,25 @@ // AISCommand - base class for retry-able HTTP requests using the AISv3 cap. AISCommand::AISCommand(LLPointer<LLInventoryCallback> callback): + mCommandFunc(NULL), mCallback(callback) { mRetryPolicy = new LLAdaptiveRetryPolicy(1.0, 32.0, 2.0, 10); } -void AISCommand::run_command() +bool AISCommand::run_command() { - mCommandFunc(); + if (NULL == mCommandFunc) + { + // This may happen if a command failed to initiate itself. + LL_WARNS("Inventory") << "AIS command attempted with null command function" << LL_ENDL; + return false; + } + else + { + mCommandFunc(); + return true; + } } void AISCommand::setCommandFunc(command_func_type command_func) @@ -80,9 +91,9 @@ void AISCommand::httpSuccess() if (mCallback) { - LLUUID item_id; // will default to null if parse fails. - getResponseUUID(content,item_id); - mCallback->fire(item_id); + LLUUID id; // will default to null if parse fails. + getResponseUUID(content,id); + mCallback->fire(id); } } @@ -96,12 +107,12 @@ void AISCommand::httpFailure() if (!content.isMap()) { LL_DEBUGS("Inventory") << "Malformed response contents " << content - << " status " << status << " reason " << reason << llendl; + << " status " << status << " reason " << reason << LL_ENDL; } else { LL_DEBUGS("Inventory") << "failed with content: " << ll_pretty_print_sd(content) - << " status " << status << " reason " << reason << llendl; + << " status " << status << " reason " << reason << LL_ENDL; } mRetryPolicy->onFailure(status, headers); F32 seconds_to_wait; @@ -113,12 +124,23 @@ void AISCommand::httpFailure() { // Command func holds a reference to self, need to release it // after a success or final failure. + // *TODO: Notify user? This seems bad. setCommandFunc(no_op); } } //static -bool AISCommand::getCap(std::string& cap) +bool AISCommand::isAPIAvailable() +{ + if (gAgent.getRegion()) + { + return gAgent.getRegion()->isCapabilityAvailable("InventoryAPIv3"); + } + return false; +} + +//static +bool AISCommand::getInvCap(std::string& cap) { if (gAgent.getRegion()) { @@ -131,18 +153,39 @@ bool AISCommand::getCap(std::string& cap) return false; } +//static +bool AISCommand::getLibCap(std::string& cap) +{ + if (gAgent.getRegion()) + { + cap = gAgent.getRegion()->getCapability("LibraryAPIv3"); + } + if (!cap.empty()) + { + return true; + } + return false; +} + +//static +void AISCommand::getCapabilityNames(LLSD& capabilityNames) +{ + capabilityNames.append("InventoryAPIv3"); + capabilityNames.append("LibraryAPIv3"); +} + RemoveItemCommand::RemoveItemCommand(const LLUUID& item_id, LLPointer<LLInventoryCallback> callback): AISCommand(callback) { std::string cap; - if (!getCap(cap)) + if (!getInvCap(cap)) { llwarns << "No cap found" << llendl; return; } std::string url = cap + std::string("/item/") + item_id.asString(); - LL_DEBUGS("Inventory") << "url: " << url << llendl; + LL_DEBUGS("Inventory") << "url: " << url << LL_ENDL; LLHTTPClient::ResponderPtr responder = this; LLSD headers; F32 timeout = HTTP_REQUEST_EXPIRY_SECS; @@ -155,13 +198,13 @@ RemoveCategoryCommand::RemoveCategoryCommand(const LLUUID& item_id, AISCommand(callback) { std::string cap; - if (!getCap(cap)) + if (!getInvCap(cap)) { llwarns << "No cap found" << llendl; return; } std::string url = cap + std::string("/category/") + item_id.asString(); - LL_DEBUGS("Inventory") << "url: " << url << llendl; + LL_DEBUGS("Inventory") << "url: " << url << LL_ENDL; LLHTTPClient::ResponderPtr responder = this; LLSD headers; F32 timeout = HTTP_REQUEST_EXPIRY_SECS; @@ -174,13 +217,13 @@ PurgeDescendentsCommand::PurgeDescendentsCommand(const LLUUID& item_id, AISCommand(callback) { std::string cap; - if (!getCap(cap)) + if (!getInvCap(cap)) { llwarns << "No cap found" << llendl; return; } std::string url = cap + std::string("/category/") + item_id.asString() + "/children"; - LL_DEBUGS("Inventory") << "url: " << url << llendl; + LL_DEBUGS("Inventory") << "url: " << url << LL_ENDL; LLCurl::ResponderPtr responder = this; LLSD headers; F32 timeout = HTTP_REQUEST_EXPIRY_SECS; @@ -195,14 +238,14 @@ UpdateItemCommand::UpdateItemCommand(const LLUUID& item_id, AISCommand(callback) { std::string cap; - if (!getCap(cap)) + if (!getInvCap(cap)) { llwarns << "No cap found" << llendl; return; } std::string url = cap + std::string("/item/") + item_id.asString(); - LL_DEBUGS("Inventory") << "url: " << url << llendl; - LL_DEBUGS("Inventory") << "request: " << ll_pretty_print_sd(mUpdates) << llendl; + LL_DEBUGS("Inventory") << "url: " << url << LL_ENDL; + LL_DEBUGS("Inventory") << "request: " << ll_pretty_print_sd(mUpdates) << LL_ENDL; LLCurl::ResponderPtr responder = this; LLSD headers; headers["Content-Type"] = "application/llsd+xml"; @@ -218,13 +261,13 @@ UpdateCategoryCommand::UpdateCategoryCommand(const LLUUID& item_id, AISCommand(callback) { std::string cap; - if (!getCap(cap)) + if (!getInvCap(cap)) { llwarns << "No cap found" << llendl; return; } std::string url = cap + std::string("/category/") + item_id.asString(); - LL_DEBUGS("Inventory") << "url: " << url << llendl; + LL_DEBUGS("Inventory") << "url: " << url << LL_ENDL; LLCurl::ResponderPtr responder = this; LLSD headers; headers["Content-Type"] = "application/llsd+xml"; @@ -238,7 +281,7 @@ SlamFolderCommand::SlamFolderCommand(const LLUUID& folder_id, const LLSD& conten AISCommand(callback) { std::string cap; - if (!getCap(cap)) + if (!getInvCap(cap)) { llwarns << "No cap found" << llendl; return; @@ -255,146 +298,335 @@ SlamFolderCommand::SlamFolderCommand(const LLUUID& folder_id, const LLSD& conten setCommandFunc(cmd); } +CopyLibraryCategoryCommand::CopyLibraryCategoryCommand(const LLUUID& source_id, + const LLUUID& dest_id, + LLPointer<LLInventoryCallback> callback): + AISCommand(callback) +{ + std::string cap; + if (!getLibCap(cap)) + { + llwarns << "No cap found" << llendl; + return; + } + LL_DEBUGS("Inventory") << "Copying library category: " << source_id << " => " << dest_id << LL_ENDL; + LLUUID tid; + tid.generate(); + std::string url = cap + std::string("/category/") + source_id.asString() + "?tid=" + tid.asString(); + llinfos << url << llendl; + LLCurl::ResponderPtr responder = this; + LLSD headers; + F32 timeout = HTTP_REQUEST_EXPIRY_SECS; + command_func_type cmd = boost::bind(&LLHTTPClient::copy, url, dest_id.asString(), responder, headers, timeout); + setCommandFunc(cmd); +} + +bool CopyLibraryCategoryCommand::getResponseUUID(const LLSD& content, LLUUID& id) +{ + if (content.has("category_id")) + { + id = content["category_id"]; + return true; + } + return false; +} + AISUpdate::AISUpdate(const LLSD& update) { parseUpdate(update); } +void AISUpdate::clearParseResults() +{ + mCatDescendentDeltas.clear(); + mCatDescendentsKnown.clear(); + mCatVersionsUpdated.clear(); + mItemsCreated.clear(); + mItemsUpdated.clear(); + mCategoriesCreated.clear(); + mCategoriesUpdated.clear(); + mObjectsDeletedIds.clear(); + mItemIds.clear(); + mCategoryIds.clear(); +} + void AISUpdate::parseUpdate(const LLSD& update) { - // parse _categories_removed -> mObjectsDeleted - uuid_vec_t cat_ids; + clearParseResults(); + parseMeta(update); + parseContent(update); +} + +void AISUpdate::parseMeta(const LLSD& update) +{ + // parse _categories_removed -> mObjectsDeletedIds + uuid_list_t cat_ids; parseUUIDArray(update,"_categories_removed",cat_ids); - for (uuid_vec_t::const_iterator it = cat_ids.begin(); + for (uuid_list_t::const_iterator it = cat_ids.begin(); it != cat_ids.end(); ++it) { LLViewerInventoryCategory *cat = gInventory.getCategory(*it); - mCatDeltas[cat->getParentUUID()]--; - mObjectsDeleted.insert(*it); + mCatDescendentDeltas[cat->getParentUUID()]--; + mObjectsDeletedIds.insert(*it); } - // parse _categories_items_removed -> mObjectsDeleted - uuid_vec_t item_ids; + // parse _categories_items_removed -> mObjectsDeletedIds + uuid_list_t item_ids; parseUUIDArray(update,"_category_items_removed",item_ids); - for (uuid_vec_t::const_iterator it = item_ids.begin(); + parseUUIDArray(update,"_removed_items",item_ids); + for (uuid_list_t::const_iterator it = item_ids.begin(); it != item_ids.end(); ++it) { LLViewerInventoryItem *item = gInventory.getItem(*it); - mCatDeltas[item->getParentUUID()]--; - mObjectsDeleted.insert(*it); + mCatDescendentDeltas[item->getParentUUID()]--; + mObjectsDeletedIds.insert(*it); } - // parse _broken_links_removed -> mObjectsDeleted - uuid_vec_t broken_link_ids; + // parse _broken_links_removed -> mObjectsDeletedIds + uuid_list_t broken_link_ids; parseUUIDArray(update,"_broken_links_removed",broken_link_ids); - for (uuid_vec_t::const_iterator it = broken_link_ids.begin(); + for (uuid_list_t::const_iterator it = broken_link_ids.begin(); it != broken_link_ids.end(); ++it) { LLViewerInventoryItem *item = gInventory.getItem(*it); - mCatDeltas[item->getParentUUID()]--; - mObjectsDeleted.insert(*it); + mCatDescendentDeltas[item->getParentUUID()]--; + mObjectsDeletedIds.insert(*it); } // parse _created_items - parseUUIDArray(update,"_created_items",mItemsCreatedIds); + parseUUIDArray(update,"_created_items",mItemIds); + + // parse _created_categories + parseUUIDArray(update,"_created_categories",mCategoryIds); - if (update.has("_embedded")) + // Parse updated category versions. + const std::string& ucv = "_updated_category_versions"; + if (update.has(ucv)) { - const LLSD& embedded = update["_embedded"]; - for(LLSD::map_const_iterator it = embedded.beginMap(), - end = embedded.endMap(); - it != end; ++it) + for(LLSD::map_const_iterator it = update[ucv].beginMap(), + end = update[ucv].endMap(); + it != end; ++it) { - const std::string& field = (*it).first; - - // parse created links - if (field == "link") - { - const LLSD& links = embedded["link"]; - parseCreatedLinks(links); - } + const LLUUID id((*it).first); + S32 version = (*it).second.asInteger(); + mCatVersionsUpdated[id] = version; } } +} - // Parse item update at the top level. - if (update.has("item_id")) +void AISUpdate::parseContent(const LLSD& update) +{ + if (update.has("linked_id")) { - LLUUID item_id = update["item_id"].asUUID(); - LLPointer<LLViewerInventoryItem> new_item(new LLViewerInventoryItem); - LLViewerInventoryItem *curr_item = gInventory.getItem(item_id); - if (curr_item) + parseLink(update); + } + else if (update.has("item_id")) + { + parseItem(update); + } + + if (update.has("category_id")) + { + parseCategory(update); + } + else + { + if (update.has("_embedded")) { - // Default to current values where not provided. - new_item->copyViewerItem(curr_item); + parseEmbedded(update["_embedded"]); } - BOOL rv = new_item->unpackMessage(update); - if (rv) + } +} + +void AISUpdate::parseItem(const LLSD& item_map) +{ + LLUUID item_id = item_map["item_id"].asUUID(); + LLPointer<LLViewerInventoryItem> new_item(new LLViewerInventoryItem); + LLViewerInventoryItem *curr_item = gInventory.getItem(item_id); + if (curr_item) + { + // Default to current values where not provided. + new_item->copyViewerItem(curr_item); + } + BOOL rv = new_item->unpackMessage(item_map); + if (rv) + { + if (curr_item) { mItemsUpdated[item_id] = new_item; // This statement is here to cause a new entry with 0 // delta to be created if it does not already exist; // otherwise has no effect. - mCatDeltas[new_item->getParentUUID()]; + mCatDescendentDeltas[new_item->getParentUUID()]; } else { - llerrs << "unpack failed" << llendl; + mItemsCreated[item_id] = new_item; + mCatDescendentDeltas[new_item->getParentUUID()]++; } } + else + { + // *TODO: Wow, harsh. Should we just complain and get out? + llerrs << "unpack failed" << llendl; + } +} - // Parse updated category versions. - const std::string& ucv = "_updated_category_versions"; - if (update.has(ucv)) +void AISUpdate::parseLink(const LLSD& link_map) +{ + LLUUID item_id = link_map["item_id"].asUUID(); + LLPointer<LLViewerInventoryItem> new_link(new LLViewerInventoryItem); + LLViewerInventoryItem *curr_link = gInventory.getItem(item_id); + if (curr_link) { - for(LLSD::map_const_iterator it = update[ucv].beginMap(), - end = update[ucv].endMap(); - it != end; ++it) + // Default to current values where not provided. + new_link->copyViewerItem(curr_link); + } + BOOL rv = new_link->unpackMessage(link_map); + if (rv) + { + const LLUUID& parent_id = new_link->getParentUUID(); + if (curr_link) { - const LLUUID id((*it).first); - S32 version = (*it).second.asInteger(); - mCatVersions[id] = version; + mItemsUpdated[item_id] = new_link; + // This statement is here to cause a new entry with 0 + // delta to be created if it does not already exist; + // otherwise has no effect. + mCatDescendentDeltas[parent_id]; + } + else + { + LLPermissions default_perms; + default_perms.init(gAgent.getID(),gAgent.getID(),LLUUID::null,LLUUID::null); + default_perms.initMasks(PERM_NONE,PERM_NONE,PERM_NONE,PERM_NONE,PERM_NONE); + new_link->setPermissions(default_perms); + LLSaleInfo default_sale_info; + new_link->setSaleInfo(default_sale_info); + //LL_DEBUGS("Inventory") << "creating link from llsd: " << ll_pretty_print_sd(link_map) << LL_ENDL; + mItemsCreated[item_id] = new_link; + mCatDescendentDeltas[parent_id]++; } } + else + { + // *TODO: Wow, harsh. Should we just complain and get out? + llerrs << "unpack failed" << llendl; + } } -void AISUpdate::parseUUIDArray(const LLSD& content, const std::string& name, uuid_vec_t& ids) + +void AISUpdate::parseCategory(const LLSD& category_map) { - ids.clear(); - if (content.has(name)) + LLUUID category_id = category_map["category_id"].asUUID(); + + // Check descendent count first, as it may be needed + // to populate newly created categories + if (category_map.has("_embedded")) { - for(LLSD::array_const_iterator it = content[name].beginArray(), - end = content[name].endArray(); - it != end; ++it) + parseDescendentCount(category_id, category_map["_embedded"]); + } + + LLPointer<LLViewerInventoryCategory> new_cat(new LLViewerInventoryCategory(category_id)); + LLViewerInventoryCategory *curr_cat = gInventory.getCategory(category_id); + if (curr_cat) + { + // Default to current values where not provided. + new_cat->copyViewerCategory(curr_cat); + } + BOOL rv = new_cat->unpackMessage(category_map); + // *NOTE: unpackMessage does not unpack version or descendent count. + //if (category_map.has("version")) + //{ + // mCatVersionsUpdated[category_id] = category_map["version"].asInteger(); + //} + if (rv) + { + if (curr_cat) + { + mCategoriesUpdated[category_id] = new_cat; + // This statement is here to cause a new entry with 0 + // delta to be created if it does not already exist; + // otherwise has no effect. + mCatDescendentDeltas[new_cat->getParentUUID()]; + } + else { - ids.push_back((*it).asUUID()); + // Set version/descendents for newly created categories. + if (category_map.has("version")) + { + S32 version = category_map["version"].asInteger(); + LL_DEBUGS("Inventory") << "Setting version to " << version + << " for new category " << category_id << LL_ENDL; + new_cat->setVersion(version); + } + uuid_int_map_t::const_iterator lookup_it = mCatDescendentsKnown.find(category_id); + if (mCatDescendentsKnown.end() != lookup_it) + { + S32 descendent_count = lookup_it->second; + LL_DEBUGS("Inventory") << "Setting descendents count to " << descendent_count + << " for new category " << category_id << LL_ENDL; + new_cat->setDescendentCount(descendent_count); + } + mCategoriesCreated[category_id] = new_cat; + mCatDescendentDeltas[new_cat->getParentUUID()]++; } } + else + { + // *TODO: Wow, harsh. Should we just complain and get out? + llerrs << "unpack failed" << llendl; + } + + // Check for more embedded content. + if (category_map.has("_embedded")) + { + parseEmbedded(category_map["_embedded"]); + } } -void AISUpdate::parseLink(const LLUUID& link_id, const LLSD& link_map) +void AISUpdate::parseDescendentCount(const LLUUID& category_id, const LLSD& embedded) { - LLPointer<LLViewerInventoryItem> new_link(new LLViewerInventoryItem); - BOOL rv = new_link->unpackMessage(link_map); - if (rv) + // We can only determine true descendent count if this contains all descendent types. + if (embedded.has("category") && + embedded.has("link") && + embedded.has("item")) { - LLPermissions default_perms; - default_perms.init(gAgent.getID(),gAgent.getID(),LLUUID::null,LLUUID::null); - default_perms.initMasks(PERM_NONE,PERM_NONE,PERM_NONE,PERM_NONE,PERM_NONE); - new_link->setPermissions(default_perms); - LLSaleInfo default_sale_info; - new_link->setSaleInfo(default_sale_info); - //LL_DEBUGS("Inventory") << "creating link from llsd: " << ll_pretty_print_sd(link_map) << llendl; - mItemsCreated[link_id] = new_link; - const LLUUID& parent_id = new_link->getParentUUID(); - mCatDeltas[parent_id]++; + mCatDescendentsKnown[category_id] = embedded["category"].size(); + mCatDescendentsKnown[category_id] += embedded["link"].size(); + mCatDescendentsKnown[category_id] += embedded["item"].size(); } - else +} + +void AISUpdate::parseEmbedded(const LLSD& embedded) +{ + if (embedded.has("link")) + { + parseEmbeddedLinks(embedded["link"]); + } + if (embedded.has("item")) + { + parseEmbeddedItems(embedded["item"]); + } + if (embedded.has("category")) { - llwarns << "failed to parse" << llendl; + parseEmbeddedCategories(embedded["category"]); + } +} + +void AISUpdate::parseUUIDArray(const LLSD& content, const std::string& name, uuid_list_t& ids) +{ + if (content.has(name)) + { + for(LLSD::array_const_iterator it = content[name].beginArray(), + end = content[name].endArray(); + it != end; ++it) + { + ids.insert((*it).asUUID()); + } } } -void AISUpdate::parseCreatedLinks(const LLSD& links) +void AISUpdate::parseEmbeddedLinks(const LLSD& links) { for(LLSD::map_const_iterator linkit = links.beginMap(), linkend = links.endMap(); @@ -402,47 +634,134 @@ void AISUpdate::parseCreatedLinks(const LLSD& links) { const LLUUID link_id((*linkit).first); const LLSD& link_map = (*linkit).second; - uuid_vec_t::const_iterator pos = - std::find(mItemsCreatedIds.begin(), - mItemsCreatedIds.end(),link_id); - if (pos != mItemsCreatedIds.end()) + if (mItemIds.end() == mItemIds.find(link_id)) + { + LL_DEBUGS("Inventory") << "Ignoring link not in items list " << link_id << LL_ENDL; + } + else + { + parseLink(link_map); + } + } +} + +void AISUpdate::parseEmbeddedItems(const LLSD& items) +{ + // Special case: this may be a single item (_embedded in a link) + if (items.has("item_id")) + { + if (mItemIds.end() != mItemIds.find(items["item_id"].asUUID())) + { + parseContent(items); + } + return; + } + + for(LLSD::map_const_iterator itemit = items.beginMap(), + itemend = items.endMap(); + itemit != itemend; ++itemit) + { + const LLUUID item_id((*itemit).first); + const LLSD& item_map = (*itemit).second; + if (mItemIds.end() == mItemIds.find(item_id)) + { + LL_DEBUGS("Inventory") << "Ignoring item not in items list " << item_id << LL_ENDL; + } + else + { + parseItem(item_map); + } + } +} + +void AISUpdate::parseEmbeddedCategories(const LLSD& categories) +{ + for(LLSD::map_const_iterator categoryit = categories.beginMap(), + categoryend = categories.endMap(); + categoryit != categoryend; ++categoryit) + { + const LLUUID category_id((*categoryit).first); + const LLSD& category_map = (*categoryit).second; + if (mCategoryIds.end() == mCategoryIds.find(category_id)) { - parseLink(link_id,link_map); + LL_DEBUGS("Inventory") << "Ignoring category not in categories list " << category_id << LL_ENDL; } else { - LL_DEBUGS("Inventory") << "Ignoring link not in created items list " << link_id << llendl; + parseCategory(category_map); } } } void AISUpdate::doUpdate() { - // Do descendent/version accounting. - // Can remove this if/when we use the version info directly. - for (std::map<LLUUID,S32>::const_iterator catit = mCatDeltas.begin(); - catit != mCatDeltas.end(); ++catit) + // Do version/descendent accounting. + for (std::map<LLUUID,S32>::const_iterator catit = mCatDescendentDeltas.begin(); + catit != mCatDescendentDeltas.end(); ++catit) { const LLUUID cat_id(catit->first); - S32 delta = catit->second; - LLInventoryModel::LLCategoryUpdate up(cat_id, delta); - gInventory.accountForUpdate(up); + // Don't account for update if we just created this category. + if (mCategoriesCreated.find(cat_id) != mCategoriesCreated.end()) + { + LL_DEBUGS("Inventory") << "Skipping version increment for new category " << cat_id << LL_ENDL; + continue; + } + + // Don't account for update unless AIS told us it updated that category. + if (mCatVersionsUpdated.find(cat_id) == mCatVersionsUpdated.end()) + { + LL_DEBUGS("Inventory") << "Skipping version increment for non-updated category " << cat_id << LL_ENDL; + continue; + } + + // If we have a known descendent count, set that now. + LLViewerInventoryCategory* cat = gInventory.getCategory(cat_id); + if (cat) + { + S32 descendent_delta = catit->second; + S32 old_count = cat->getDescendentCount(); + LL_DEBUGS("Inventory") << "Updating descendent count for " << cat_id + << " with delta " << descendent_delta << " from " + << old_count << " to " << (old_count+descendent_delta) << LL_ENDL; + LLInventoryModel::LLCategoryUpdate up(cat_id, descendent_delta); + gInventory.accountForUpdate(up); + } + else + { + LL_DEBUGS("Inventory") << "Skipping version accounting for unknown category " << cat_id << LL_ENDL; + } } - - // TODO - how can we use this version info? Need to be sure all - // changes are going through AIS first, or at least through - // something with a reliable responder. - for (uuid_int_map_t::iterator ucv_it = mCatVersions.begin(); - ucv_it != mCatVersions.end(); ++ucv_it) + + // CREATE CATEGORIES + for (deferred_category_map_t::const_iterator create_it = mCategoriesCreated.begin(); + create_it != mCategoriesCreated.end(); ++create_it) { - const LLUUID id = ucv_it->first; - S32 version = ucv_it->second; - LLViewerInventoryCategory *cat = gInventory.getCategory(id); - if (cat->getVersion() != version) + LLUUID category_id(create_it->first); + LLPointer<LLViewerInventoryCategory> new_category = create_it->second; + + gInventory.updateCategory(new_category); + LL_DEBUGS("Inventory") << "created category " << category_id << LL_ENDL; + } + + // UPDATE CATEGORIES + for (deferred_category_map_t::const_iterator update_it = mCategoriesUpdated.begin(); + update_it != mCategoriesUpdated.end(); ++update_it) + { + LLUUID category_id(update_it->first); + LLPointer<LLViewerInventoryCategory> new_category = update_it->second; + // Since this is a copy of the category *before* the accounting update, above, + // we need to transfer back the updated version/descendent count. + LLViewerInventoryCategory* curr_cat = gInventory.getCategory(new_category->getUUID()); + if (NULL == curr_cat) { - llwarns << "Possible version mismatch for category " << cat->getName() - << ", viewer version " << cat->getVersion() - << " server version " << version << llendl; + LL_WARNS("Inventory") << "Failed to update unknown category " << new_category->getUUID() << LL_ENDL; + } + else + { + new_category->setVersion(curr_cat->getVersion()); + new_category->setDescendentCount(curr_cat->getDescendentCount()); + gInventory.updateCategory(new_category); + LL_DEBUGS("Inventory") << "updated category " << category_id << LL_ENDL; } } @@ -456,7 +775,7 @@ void AISUpdate::doUpdate() // FIXME risky function since it calls updateServer() in some // cases. Maybe break out the update/create cases, in which // case this is create. - LL_DEBUGS("Inventory") << "created item " << item_id << llendl; + LL_DEBUGS("Inventory") << "created item " << item_id << LL_ENDL; gInventory.updateItem(new_item); } @@ -469,19 +788,36 @@ void AISUpdate::doUpdate() // FIXME risky function since it calls updateServer() in some // cases. Maybe break out the update/create cases, in which // case this is update. - LL_DEBUGS("Inventory") << "updated item " << item_id << llendl; - //LL_DEBUGS("Inventory") << ll_pretty_print_sd(new_item->asLLSD()) << llendl; + LL_DEBUGS("Inventory") << "updated item " << item_id << LL_ENDL; + //LL_DEBUGS("Inventory") << ll_pretty_print_sd(new_item->asLLSD()) << LL_ENDL; gInventory.updateItem(new_item); } // DELETE OBJECTS - for (std::set<LLUUID>::const_iterator del_it = mObjectsDeleted.begin(); - del_it != mObjectsDeleted.end(); ++del_it) + for (std::set<LLUUID>::const_iterator del_it = mObjectsDeletedIds.begin(); + del_it != mObjectsDeletedIds.end(); ++del_it) { - LL_DEBUGS("Inventory") << "deleted item " << *del_it << llendl; + LL_DEBUGS("Inventory") << "deleted item " << *del_it << LL_ENDL; gInventory.onObjectDeletedFromServer(*del_it, false, false, false); } + // TODO - how can we use this version info? Need to be sure all + // changes are going through AIS first, or at least through + // something with a reliable responder. + for (uuid_int_map_t::iterator ucv_it = mCatVersionsUpdated.begin(); + ucv_it != mCatVersionsUpdated.end(); ++ucv_it) + { + const LLUUID id = ucv_it->first; + S32 version = ucv_it->second; + LLViewerInventoryCategory *cat = gInventory.getCategory(id); + if (cat->getVersion() != version) + { + llwarns << "Possible version mismatch for category " << cat->getName() + << ", viewer version " << cat->getVersion() + << " server version " << version << llendl; + } + } + gInventory.notifyObservers(); } diff --git a/indra/newview/llaisapi.h b/indra/newview/llaisapi.h index 1f9555f004..f4e219e9e6 100755 --- a/indra/newview/llaisapi.h +++ b/indra/newview/llaisapi.h @@ -31,7 +31,6 @@ #include <map> #include <set> #include <string> -#include <vector> #include "llcurl.h" #include "llhttpclient.h" #include "llhttpretrypolicy.h" @@ -46,7 +45,7 @@ public: virtual ~AISCommand() {} - void run_command(); + bool run_command(); void setCommandFunc(command_func_type command_func); @@ -54,13 +53,17 @@ public: // LLInventoryCallback::fire(). May or may not need to bother, // since most LLInventoryCallbacks do their work in the // destructor. - virtual bool getResponseUUID(const LLSD& content, LLUUID& id); /* virtual */ void httpSuccess(); + /* virtual */ void httpFailure(); - /*virtual*/ void httpFailure(); + static bool isAPIAvailable(); + static bool getInvCap(std::string& cap); + static bool getLibCap(std::string& cap); + static void getCapabilityNames(LLSD& capabilityNames); - static bool getCap(std::string& cap); +protected: + virtual bool getResponseUUID(const LLSD& content, LLUUID& id); private: command_func_type mCommandFunc; @@ -118,26 +121,52 @@ private: LLSD mContents; }; +class CopyLibraryCategoryCommand: public AISCommand +{ +public: + CopyLibraryCategoryCommand(const LLUUID& source_id, const LLUUID& dest_id, LLPointer<LLInventoryCallback> callback); + +protected: + /* virtual */ bool getResponseUUID(const LLSD& content, LLUUID& id); +}; + class AISUpdate { public: AISUpdate(const LLSD& update); void parseUpdate(const LLSD& update); - void parseUUIDArray(const LLSD& content, const std::string& name, uuid_vec_t& ids); - void parseLink(const LLUUID& link_id, const LLSD& link_map); - void parseCreatedLinks(const LLSD& links); + void parseMeta(const LLSD& update); + void parseContent(const LLSD& update); + void parseUUIDArray(const LLSD& content, const std::string& name, uuid_list_t& ids); + void parseLink(const LLSD& link_map); + void parseItem(const LLSD& link_map); + void parseCategory(const LLSD& link_map); + void parseDescendentCount(const LLUUID& category_id, const LLSD& embedded); + void parseEmbedded(const LLSD& embedded); + void parseEmbeddedLinks(const LLSD& links); + void parseEmbeddedItems(const LLSD& links); + void parseEmbeddedCategories(const LLSD& links); void doUpdate(); private: + void clearParseResults(); + typedef std::map<LLUUID,S32> uuid_int_map_t; - uuid_int_map_t mCatDeltas; - uuid_int_map_t mCatVersions; + uuid_int_map_t mCatDescendentDeltas; + uuid_int_map_t mCatDescendentsKnown; + uuid_int_map_t mCatVersionsUpdated; typedef std::map<LLUUID,LLPointer<LLViewerInventoryItem> > deferred_item_map_t; deferred_item_map_t mItemsCreated; deferred_item_map_t mItemsUpdated; - - std::set<LLUUID> mObjectsDeleted; - uuid_vec_t mItemsCreatedIds; + typedef std::map<LLUUID,LLPointer<LLViewerInventoryCategory> > deferred_category_map_t; + deferred_category_map_t mCategoriesCreated; + deferred_category_map_t mCategoriesUpdated; + + // These keep track of uuid's mentioned in meta values. + // Useful for filtering out which content we are interested in. + uuid_list_t mObjectsDeletedIds; + uuid_list_t mItemIds; + uuid_list_t mCategoryIds; }; #endif diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index a0f8cbe911..fc07932860 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -435,6 +435,50 @@ private: S32 LLCallAfterInventoryCopyMgr::sInstanceCount = 0; +class LLWearCategoryAfterCopy: public LLInventoryCallback +{ +public: + LLWearCategoryAfterCopy(bool append): + mAppend(append) + {} + + // virtual + void fire(const LLUUID& id) + { + // Wear the inventory category. + LLInventoryCategory* cat = gInventory.getCategory(id); + LLAppearanceMgr::instance().wearInventoryCategoryOnAvatar(cat, mAppend); + } + +private: + bool mAppend; +}; + +class LLTrackPhaseWrapper : public LLInventoryCallback +{ +public: + LLTrackPhaseWrapper(const std::string& phase_name, LLPointer<LLInventoryCallback> cb = NULL): + mTrackingPhase(phase_name), + mCB(cb) + { + selfStartPhase(mTrackingPhase); + } + + // virtual + void fire(const LLUUID& id) + { + selfStopPhase(mTrackingPhase); + if (mCB) + { + mCB->fire(id); + } + } + +protected: + std::string mTrackingPhase; + LLPointer<LLInventoryCallback> mCB; +}; + LLUpdateAppearanceOnDestroy::LLUpdateAppearanceOnDestroy(bool enforce_item_restrictions, bool enforce_ordering, nullary_func_t post_update_func @@ -2244,10 +2288,31 @@ void LLAppearanceMgr::wearInventoryCategory(LLInventoryCategory* category, bool LL_INFOS("Avatar") << self_av_string() << "wearInventoryCategory( " << category->getName() << " )" << LL_ENDL; - selfStartPhase("wear_inventory_category_fetch"); - callAfterCategoryFetch(category->getUUID(),boost::bind(&LLAppearanceMgr::wearCategoryFinal, - &LLAppearanceMgr::instance(), - category->getUUID(), copy, append)); + // If we are copying from library, attempt to use AIS to copy the category. + bool ais_ran=false; + if (copy && AISCommand::isAPIAvailable()) + { + LLUUID parent_id; + parent_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_CLOTHING); + if (parent_id.isNull()) + { + parent_id = gInventory.getRootFolderID(); + } + + LLPointer<LLInventoryCallback> copy_cb = new LLWearCategoryAfterCopy(append); + LLPointer<LLInventoryCallback> track_cb = new LLTrackPhaseWrapper( + std::string("wear_inventory_category_callback"), copy_cb); + LLPointer<AISCommand> cmd_ptr = new CopyLibraryCategoryCommand(category->getUUID(), parent_id, track_cb); + ais_ran=cmd_ptr->run_command(); + } + + if (!ais_ran) + { + selfStartPhase("wear_inventory_category_fetch"); + callAfterCategoryFetch(category->getUUID(),boost::bind(&LLAppearanceMgr::wearCategoryFinal, + &LLAppearanceMgr::instance(), + category->getUUID(), copy, append)); + } } S32 LLAppearanceMgr::getActiveCopyOperations() const @@ -3544,8 +3609,7 @@ void LLAppearanceMgr::makeNewOutfitLinks(const std::string& new_folder_name, boo // First, make a folder in the My Outfits directory. const LLUUID parent_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MY_OUTFITS); - std::string cap; - if (AISCommand::getCap(cap)) + if (AISCommand::isAPIAvailable()) { // cap-based category creation was buggy until recently. use // existence of AIS as an indicator the fix is present. Does diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index e1fd2e02fa..0d99bea3fc 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1718,7 +1718,6 @@ void LLInventoryModel::accountForUpdate(const LLCategoryUpdate& update) const LLViewerInventoryCategory* cat = getCategory(update.mCategoryID); if(cat) { - bool accounted = false; S32 version = cat->getVersion(); if(version != LLViewerInventoryCategory::VERSION_UNKNOWN) { @@ -1733,22 +1732,27 @@ void LLInventoryModel::accountForUpdate(const LLCategoryUpdate& update) const } if(descendents_server == descendents_actual) { - accounted = true; descendents_actual += update.mDescendentDelta; cat->setDescendentCount(descendents_actual); cat->setVersion(++version); - lldebugs << "accounted: '" << cat->getName() << "' " + LL_DEBUGS("Inventory") << "accounted: '" << cat->getName() << "' " << version << " with " << descendents_actual - << " descendents." << llendl; + << " descendents." << LL_ENDL; + } + else + { + // Error condition, this means that the category did not register that + // it got new descendents (perhaps because it is still being loaded) + // which means its descendent count will be wrong. + llwarns << "Accounting failed for '" << cat->getName() << "' version:" + << version << " due to mismatched descendent count: server == " + << descendents_server << ", viewer == " << descendents_actual << llendl; } } - if(!accounted) + else { - // Error condition, this means that the category did not register that - // it got new descendents (perhaps because it is still being loaded) - // which means its descendent count will be wrong. - llwarns << "Accounting failed for '" << cat->getName() << "' version:" - << version << llendl; + llwarns << "Accounting failed for '" << cat->getName() << "' version: unknown (" + << version << ")" << llendl; } } else diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index c934dd991b..5beae8ec24 100755 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -430,7 +430,7 @@ void LLViewerInventoryItem::fetchFromServer(void) const } // virtual -BOOL LLViewerInventoryItem::unpackMessage(LLSD item) +BOOL LLViewerInventoryItem::unpackMessage(const LLSD& item) { BOOL rv = LLInventoryItem::fromLLSD(item); @@ -866,6 +866,21 @@ void LLViewerInventoryCategory::localizeName() LLLocalizedInventoryItemsDictionary::getInstance()->localizeInventoryObjectName(mName); } +// virtual +BOOL LLViewerInventoryCategory::unpackMessage(const LLSD& category) +{ + BOOL rv = LLInventoryCategory::fromLLSD(category); + localizeName(); + return rv; +} + +// virtual +void LLViewerInventoryCategory::unpackMessage(LLMessageSystem* msg, const char* block, S32 block_num) +{ + LLInventoryCategory::unpackMessage(msg, block, block_num); + localizeName(); +} + ///---------------------------------------------------------------------------- /// Local function definitions ///---------------------------------------------------------------------------- @@ -1159,24 +1174,22 @@ void update_inventory_item( const LLSD& updates, LLPointer<LLInventoryCallback> cb) { - LLPointer<LLViewerInventoryItem> obj = gInventory.getItem(item_id); - LL_DEBUGS("Inventory") << "item_id: [" << item_id << "] name " << (obj ? obj->getName() : "(NOT FOUND)") << llendl; - if(obj) + bool ais_ran = false; + if (AISCommand::isAPIAvailable()) { - LLPointer<LLViewerInventoryItem> new_item(new LLViewerInventoryItem); - new_item->copyViewerItem(obj); - new_item->fromLLSD(updates,false); - - std::string cap; - if (AISCommand::getCap(cap)) - { - LLSD new_llsd; - new_item->asLLSD(new_llsd); - LLPointer<AISCommand> cmd_ptr = new UpdateItemCommand(item_id, new_llsd, cb); - cmd_ptr->run_command(); - } - else // no cap + LLPointer<AISCommand> cmd_ptr = new UpdateItemCommand(item_id, updates, cb); + ais_ran = cmd_ptr->run_command(); + } + if (!ais_ran) + { + LLPointer<LLViewerInventoryItem> obj = gInventory.getItem(item_id); + LL_DEBUGS("Inventory") << "item_id: [" << item_id << "] name " << (obj ? obj->getName() : "(NOT FOUND)") << llendl; + if(obj) { + LLPointer<LLViewerInventoryItem> new_item(new LLViewerInventoryItem); + new_item->copyViewerItem(obj); + new_item->fromLLSD(updates,false); + LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_UpdateInventoryItem); msg->nextBlockFast(_PREHASH_AgentData); @@ -1216,9 +1229,8 @@ void update_inventory_category( LLPointer<LLViewerInventoryCategory> new_cat = new LLViewerInventoryCategory(obj); new_cat->fromLLSD(updates); - //std::string cap; // FIXME - restore this once the back-end work has been done. - if (0) // if (AISCommand::getCap(cap)) + if (0) // if (AISCommand::isAPIAvailable()) { LLSD new_llsd = new_cat->asLLSD(); LLPointer<AISCommand> cmd_ptr = new UpdateCategoryCommand(cat_id, new_llsd, cb); @@ -1254,8 +1266,7 @@ void remove_inventory_item( LL_DEBUGS("Inventory") << "item_id: [" << item_id << "] name " << (obj ? obj->getName() : "(NOT FOUND)") << llendl; if(obj) { - std::string cap; - if (AISCommand::getCap(cap)) + if (AISCommand::isAPIAvailable()) { LLPointer<AISCommand> cmd_ptr = new RemoveItemCommand(item_id, cb); cmd_ptr->run_command(); @@ -1325,8 +1336,7 @@ void remove_inventory_category( LLNotificationsUtil::add("CannotRemoveProtectedCategories"); return; } - std::string cap; - if (AISCommand::getCap(cap)) + if (AISCommand::isAPIAvailable()) { LLPointer<AISCommand> cmd_ptr = new RemoveCategoryCommand(cat_id, cb); cmd_ptr->run_command(); @@ -1429,8 +1439,7 @@ void purge_descendents_of(const LLUUID& id, LLPointer<LLInventoryCallback> cb) } else { - std::string cap; - if (AISCommand::getCap(cap)) + if (AISCommand::isAPIAvailable()) { LLPointer<AISCommand> cmd_ptr = new PurgeDescendentsCommand(id, cb); cmd_ptr->run_command(); @@ -1564,8 +1573,7 @@ void slam_inventory_folder(const LLUUID& folder_id, const LLSD& contents, LLPointer<LLInventoryCallback> cb) { - std::string cap; - if (AISCommand::getCap(cap)) + if (AISCommand::isAPIAvailable()) { LL_DEBUGS("Avatar") << "using AISv3 to slam folder, id " << folder_id << " new contents: " << ll_pretty_print_sd(contents) << llendl; diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h index de1f3daa1e..0d4ffaa575 100755 --- a/indra/newview/llviewerinventory.h +++ b/indra/newview/llviewerinventory.h @@ -124,7 +124,7 @@ public: virtual void packMessage(LLMessageSystem* msg) const; virtual BOOL unpackMessage(LLMessageSystem* msg, const char* block, S32 block_num = 0); - virtual BOOL unpackMessage(LLSD item); + virtual BOOL unpackMessage(const LLSD& item); virtual BOOL importFile(LLFILE* fp); virtual BOOL importLegacyStream(std::istream& input_stream); @@ -224,6 +224,8 @@ public: bool importFileLocal(LLFILE* fp); void determineFolderType(); void changeType(LLFolderType::EType new_folder_type); + virtual void unpackMessage(LLMessageSystem* msg, const char* block, S32 block_num = 0); + virtual BOOL unpackMessage(const LLSD& category); private: friend class LLInventoryModel; diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index dca1a5b542..ad046accd0 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -30,6 +30,7 @@ // linden libraries #include "indra_constants.h" +#include "llaisapi.h" #include "llavatarnamecache.h" // name lookup cap url #include "llfloaterreg.h" #include "llmath.h" @@ -1645,7 +1646,7 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames) capabilityNames.append("FetchInventory2"); capabilityNames.append("FetchInventoryDescendents2"); capabilityNames.append("IncrementCOFVersion"); - capabilityNames.append("InventoryAPIv3"); + AISCommand::getCapabilityNames(capabilityNames); } capabilityNames.append("GetDisplayNames"); @@ -1893,6 +1894,22 @@ std::string LLViewerRegion::getCapability(const std::string& name) const return iter->second; } +bool LLViewerRegion::isCapabilityAvailable(const std::string& name) const +{ + if (!capabilitiesReceived() && (name!=std::string("Seed")) && (name!=std::string("ObjectMedia"))) + { + llwarns << "isCapabilityAvailable called before caps received for " << name << llendl; + } + + CapabilityMap::const_iterator iter = mImpl->mCapabilities.find(name); + if(iter == mImpl->mCapabilities.end()) + { + return false; + } + + return true; +} + bool LLViewerRegion::capabilitiesReceived() const { return mCapabilitiesReceived; diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index 5ac2a83aaf..4fb1b7402c 100755 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -244,6 +244,7 @@ public: S32 getNumSeedCapRetries(); void setCapability(const std::string& name, const std::string& url); void setCapabilityDebug(const std::string& name, const std::string& url); + bool isCapabilityAvailable(const std::string& name) const; // implements LLCapabilityProvider virtual std::string getCapability(const std::string& name) const; -- cgit v1.2.3 From a428acf331dc63b2d6bac10101a8339e91a73adc Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Tue, 16 Jul 2013 17:08:24 -0400 Subject: SH-4333 FIX - turned on category patch now that AISv3 has it --- indra/newview/llaisapi.cpp | 2 +- indra/newview/llappearancemgr.cpp | 5 ++++- indra/newview/llviewerinventory.cpp | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp index cb8700865a..9389aeb3b4 100755 --- a/indra/newview/llaisapi.cpp +++ b/indra/newview/llaisapi.cpp @@ -794,7 +794,7 @@ void AISUpdate::doUpdate() } // DELETE OBJECTS - for (std::set<LLUUID>::const_iterator del_it = mObjectsDeletedIds.begin(); + for (uuid_list_t::const_iterator del_it = mObjectsDeletedIds.begin(); del_it != mObjectsDeletedIds.end(); ++del_it) { LL_DEBUGS("Inventory") << "deleted item " << *del_it << LL_ENDL; diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index fc07932860..3818bd8aec 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -2115,7 +2115,10 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool enforce_item_restrictions, return; } - llassert(validateClothingOrderingInfo()); + if (!validateClothingOrderingInfo()) + { + llwarns << "Clothing ordering error" << llendl; + } BoolSetter setIsInUpdateAppearanceFromCOF(mIsInUpdateAppearanceFromCOF); selfStartPhase("update_appearance_from_cof"); diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 5beae8ec24..5b4ca97319 100755 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -1230,7 +1230,7 @@ void update_inventory_category( LLPointer<LLViewerInventoryCategory> new_cat = new LLViewerInventoryCategory(obj); new_cat->fromLLSD(updates); // FIXME - restore this once the back-end work has been done. - if (0) // if (AISCommand::isAPIAvailable()) + if (AISCommand::isAPIAvailable()) { LLSD new_llsd = new_cat->asLLSD(); LLPointer<AISCommand> cmd_ptr = new UpdateCategoryCommand(cat_id, new_llsd, cb); -- cgit v1.2.3 From 7af477f796f9926dfec4aaa1336047b41144fbbb Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Wed, 17 Jul 2013 15:32:06 -0400 Subject: SH-4344 FIX - return the lowest UUID for a child of root with the desired preferred type. Also removed some duplicate code between findCategoryUUIDForType and findLibraryCategoryUUIDForType --- indra/newview/llinventorymodel.cpp | 63 ++++++++++++-------------------------- indra/newview/llinventorymodel.h | 5 +++ 2 files changed, 25 insertions(+), 43 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 0d99bea3fc..be1a396fff 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -388,16 +388,13 @@ void LLInventoryModel::unlockDirectDescendentArrays(const LLUUID& cat_id) mItemLock[cat_id] = false; } -// findCategoryUUIDForType() returns the uuid of the category that -// specifies 'type' as what it defaults to containing. The category is -// not necessarily only for that type. *NOTE: This will create a new -// inventory category on the fly if one does not exist. -const LLUUID LLInventoryModel::findCategoryUUIDForType(LLFolderType::EType preferred_type, bool create_folder/*, - bool find_in_library*/) +const LLUUID LLInventoryModel::findCategoryUUIDForTypeInRoot( + LLFolderType::EType preferred_type, + bool create_folder, + const LLUUID& root_id) { LLUUID rv = LLUUID::null; - const LLUUID &root_id = /*(find_in_library) ? gInventory.getLibraryRootFolderID() :*/ gInventory.getRootFolderID(); if(LLFolderType::FT_ROOT_INVENTORY == preferred_type) { rv = root_id; @@ -413,14 +410,17 @@ const LLUUID LLInventoryModel::findCategoryUUIDForType(LLFolderType::EType prefe { if(cats->get(i)->getPreferredType() == preferred_type) { - rv = cats->get(i)->getUUID(); - break; + const LLUUID& folder_id = cats->get(i)->getUUID(); + if (rv.isNull() || folder_id < rv) + { + rv = folder_id; + } } } } } - if(rv.isNull() && isInventoryUsable() && (create_folder && true/*!find_in_library*/)) + if(rv.isNull() && isInventoryUsable() && create_folder) { if(root_id.notNull()) { @@ -430,41 +430,18 @@ const LLUUID LLInventoryModel::findCategoryUUIDForType(LLFolderType::EType prefe return rv; } -const LLUUID LLInventoryModel::findLibraryCategoryUUIDForType(LLFolderType::EType preferred_type, bool create_folder) +// findCategoryUUIDForType() returns the uuid of the category that +// specifies 'type' as what it defaults to containing. The category is +// not necessarily only for that type. *NOTE: This will create a new +// inventory category on the fly if one does not exist. +const LLUUID LLInventoryModel::findCategoryUUIDForType(LLFolderType::EType preferred_type, bool create_folder) { - LLUUID rv = LLUUID::null; - - const LLUUID &root_id = gInventory.getLibraryRootFolderID(); - if(LLFolderType::FT_ROOT_INVENTORY == preferred_type) - { - rv = root_id; - } - else if (root_id.notNull()) - { - cat_array_t* cats = NULL; - cats = get_ptr_in_map(mParentChildCategoryTree, root_id); - if(cats) - { - S32 count = cats->count(); - for(S32 i = 0; i < count; ++i) - { - if(cats->get(i)->getPreferredType() == preferred_type) - { - rv = cats->get(i)->getUUID(); - break; - } - } - } - } + return findCategoryUUIDForTypeInRoot(preferred_type, create_folder, gInventory.getRootFolderID()); +} - if(rv.isNull() && isInventoryUsable() && (create_folder && true/*!find_in_library*/)) - { - if(root_id.notNull()) - { - return createNewCategory(root_id, preferred_type, LLStringUtil::null); - } - } - return rv; +const LLUUID LLInventoryModel::findLibraryCategoryUUIDForType(LLFolderType::EType preferred_type, bool create_folder) +{ + return findCategoryUUIDForTypeInRoot(preferred_type, create_folder, gInventory.getLibraryRootFolderID()); } class LLCreateInventoryCategoryResponder : public LLHTTPClient::Responder diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index ee0d4e1994..2852a8da45 100755 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -230,6 +230,11 @@ public: // Find //-------------------------------------------------------------------- public: + const LLUUID LLInventoryModel::findCategoryUUIDForTypeInRoot( + LLFolderType::EType preferred_type, + bool create_folder, + const LLUUID& root_id); + // Returns the uuid of the category that specifies 'type' as what it // defaults to containing. The category is not necessarily only for that type. // NOTE: If create_folder is true, this will create a new inventory category -- cgit v1.2.3 From 47fabf5770bbb1b2f8272bb77ebdc993cda7c033 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Wed, 17 Jul 2013 18:13:24 -0400 Subject: fix for build failure mac, linux --- indra/newview/llinventorymodel.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index 2852a8da45..7afe1dea35 100755 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -230,7 +230,7 @@ public: // Find //-------------------------------------------------------------------- public: - const LLUUID LLInventoryModel::findCategoryUUIDForTypeInRoot( + const LLUUID findCategoryUUIDForTypeInRoot( LLFolderType::EType preferred_type, bool create_folder, const LLUUID& root_id); -- cgit v1.2.3 From a1ece43905db86cb6953ce9848228122637e5708 Mon Sep 17 00:00:00 2001 From: Nyx Linden <nyx@lindenlab.com> 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/character/avatar_lad.xml | 8 ++++---- indra/newview/llagent.cpp | 3 ++- indra/newview/llvoavatar.cpp | 12 ++++++++---- 3 files changed, 14 insertions(+), 9 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/character/avatar_lad.xml b/indra/newview/character/avatar_lad.xml index 284e9c44b2..d2ee09bcb5 100755 --- a/indra/newview/character/avatar_lad.xml +++ b/indra/newview/character/avatar_lad.xml @@ -7564,7 +7564,7 @@ render_pass="bump"> <param id="868" - group="0" + group="3" wearable="shirt" edit_group="shirt" edit_group_order="8" @@ -8687,7 +8687,7 @@ render_pass="bump"> <param id="869" - group="0" + group="3" wearable="pants" edit_group="pants" edit_group_order="6" @@ -9608,7 +9608,7 @@ render_pass="bump"> <param id="163" - group="0" + group="3" wearable="skin" edit_group="skin_facedetail" edit_group_order="3" @@ -11667,7 +11667,7 @@ render_pass="bump"> <param id="877" - group="0" + group="3" name="Jacket Wrinkles" label="Jacket Wrinkles" wearable="jacket" 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 ); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 74fb51b943..96afd2e15d 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -6797,7 +6797,8 @@ void LLVOAvatar::dumpAppearanceMsgParams( const std::string& dump_prefix, LLVisualParam* param = getFirstVisualParam(); for (S32 i = 0; i < params_for_dump.size(); i++) { - while( param && (param->getGroup() != VISUAL_PARAM_GROUP_TWEAKABLE) ) // should not be any of group VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT + while( param && ((param->getGroup() != VISUAL_PARAM_GROUP_TWEAKABLE) && + (param->getGroup() != VISUAL_PARAM_GROUP_TRANSMIT_NOT_TWEAKABLE)) ) // should not be any of group VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT { param = getNextVisualParam(); } @@ -6851,7 +6852,8 @@ void LLVOAvatar::parseAppearanceMessage(LLMessageSystem* mesgsys, LLAppearanceMe { for( S32 i = 0; i < num_blocks; i++ ) { - while( param && (param->getGroup() != VISUAL_PARAM_GROUP_TWEAKABLE) ) // should not be any of group VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT + while( param && ((param->getGroup() != VISUAL_PARAM_GROUP_TWEAKABLE) && + (param->getGroup() != VISUAL_PARAM_GROUP_TRANSMIT_NOT_TWEAKABLE)) ) // should not be any of group VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT { param = getNextVisualParam(); } @@ -6872,7 +6874,8 @@ void LLVOAvatar::parseAppearanceMessage(LLMessageSystem* mesgsys, LLAppearanceMe } } - const S32 expected_tweakable_count = getVisualParamCountInGroup(VISUAL_PARAM_GROUP_TWEAKABLE); // don't worry about VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT + const S32 expected_tweakable_count = getVisualParamCountInGroup(VISUAL_PARAM_GROUP_TWEAKABLE) + + getVisualParamCountInGroup(VISUAL_PARAM_GROUP_TRANSMIT_NOT_TWEAKABLE); // don't worry about VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT if (num_blocks != expected_tweakable_count) { LL_DEBUGS("Avatar") << "Number of params in AvatarAppearance msg (" << num_blocks << ") does not match number of tweakable params in avatar xml file (" << expected_tweakable_count << "). Processing what we can. object: " << getID() << llendl; @@ -7093,7 +7096,8 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) } } } - const S32 expected_tweakable_count = getVisualParamCountInGroup(VISUAL_PARAM_GROUP_TWEAKABLE); // don't worry about VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT + const S32 expected_tweakable_count = getVisualParamCountInGroup(VISUAL_PARAM_GROUP_TWEAKABLE) + + getVisualParamCountInGroup(VISUAL_PARAM_GROUP_TRANSMIT_NOT_TWEAKABLE); // don't worry about VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT if (num_params != expected_tweakable_count) { LL_DEBUGS("Avatar") << "Number of params in AvatarAppearance msg (" << num_params << ") does not match number of tweakable params in avatar xml file (" << expected_tweakable_count << "). Processing what we can. object: " << getID() << llendl; -- cgit v1.2.3 From 3d8d4227f1930f986c3b70227de98c12830c874a Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Fri, 19 Jul 2013 17:22:53 -0400 Subject: SH-3889 WIP - added callbacks to control ordering of operations after wearable save. --- indra/newview/llagentwearables.cpp | 29 ++++++++++------------- indra/newview/llagentwearables.h | 4 ++-- indra/newview/llpaneleditwearable.cpp | 22 +++++------------- indra/newview/llviewerinventory.cpp | 43 +++++++++++++++++++++++++++++++++++ indra/newview/llviewerinventory.h | 4 ++++ indra/newview/llvoavatarself.cpp | 12 ++++++++-- indra/newview/llvoavatarself.h | 2 ++ 7 files changed, 79 insertions(+), 37 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 93ccec7d49..8c33a778e3 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -209,7 +209,7 @@ LLAgentWearables::sendAgentWearablesUpdateCallback::~sendAgentWearablesUpdateCal * @param wearable The wearable data. * @param todo Bitmask of actions to take on completion. */ -LLAgentWearables::addWearableToAgentInventoryCallback::addWearableToAgentInventoryCallback( +LLAgentWearables::AddWearableToAgentInventoryCallback::AddWearableToAgentInventoryCallback( LLPointer<LLRefCount> cb, LLWearableType::EType type, U32 index, LLViewerWearable* wearable, U32 todo, const std::string description) : mType(type), mIndex(index), @@ -221,7 +221,7 @@ LLAgentWearables::addWearableToAgentInventoryCallback::addWearableToAgentInvento llinfos << "constructor" << llendl; } -void LLAgentWearables::addWearableToAgentInventoryCallback::fire(const LLUUID& inv_item) +void LLAgentWearables::AddWearableToAgentInventoryCallback::fire(const LLUUID& inv_item) { if (mTodo & CALL_CREATESTANDARDDONE) { @@ -317,12 +317,12 @@ void LLAgentWearables::sendAgentWearablesUpdate() if (wearable->getItemID().isNull()) { LLPointer<LLInventoryCallback> cb = - new addWearableToAgentInventoryCallback( + new AddWearableToAgentInventoryCallback( LLPointer<LLRefCount>(NULL), (LLWearableType::EType)type, index, wearable, - addWearableToAgentInventoryCallback::CALL_NONE); + AddWearableToAgentInventoryCallback::CALL_NONE); addWearableToAgentInventory(cb, wearable); } else @@ -419,23 +419,18 @@ void LLAgentWearables::saveWearable(const LLWearableType::EType type, const U32 item->getFlags(), item->getCreationDate()); template_item->setTransactionID(new_wearable->getTransactionID()); - template_item->updateServer(FALSE); - gInventory.updateItem(template_item); - if (name_changed) - { - gInventory.notifyObservers(); - } + update_inventory_item(template_item, gAgentAvatarp->mEndCustomizeCallback); } else { // Add a new inventory item (shouldn't ever happen here) - U32 todo = addWearableToAgentInventoryCallback::CALL_NONE; + U32 todo = AddWearableToAgentInventoryCallback::CALL_NONE; if (send_update) { - todo |= addWearableToAgentInventoryCallback::CALL_UPDATE; + todo |= AddWearableToAgentInventoryCallback::CALL_UPDATE; } LLPointer<LLInventoryCallback> cb = - new addWearableToAgentInventoryCallback( + new AddWearableToAgentInventoryCallback( LLPointer<LLRefCount>(NULL), type, index, @@ -484,12 +479,12 @@ void LLAgentWearables::saveWearableAs(const LLWearableType::EType type, old_wearable, trunc_name); LLPointer<LLInventoryCallback> cb = - new addWearableToAgentInventoryCallback( + new AddWearableToAgentInventoryCallback( LLPointer<LLRefCount>(NULL), type, index, new_wearable, - addWearableToAgentInventoryCallback::CALL_WEARITEM, + AddWearableToAgentInventoryCallback::CALL_WEARITEM, description ); LLUUID category_id; @@ -909,12 +904,12 @@ void LLAgentWearables::recoverMissingWearable(const LLWearableType::EType type, // destory content.) JC const LLUUID lost_and_found_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND); LLPointer<LLInventoryCallback> cb = - new addWearableToAgentInventoryCallback( + new AddWearableToAgentInventoryCallback( LLPointer<LLRefCount>(NULL), type, index, new_wearable, - addWearableToAgentInventoryCallback::CALL_RECOVERDONE); + AddWearableToAgentInventoryCallback::CALL_RECOVERDONE); addWearableToAgentInventory(cb, new_wearable, lost_and_found_id, TRUE); } diff --git a/indra/newview/llagentwearables.h b/indra/newview/llagentwearables.h index b0ac988341..8a1b470e22 100755 --- a/indra/newview/llagentwearables.h +++ b/indra/newview/llagentwearables.h @@ -249,7 +249,7 @@ private: ~sendAgentWearablesUpdateCallback(); }; - class addWearableToAgentInventoryCallback : public LLInventoryCallback + class AddWearableToAgentInventoryCallback : public LLInventoryCallback { public: enum ETodo @@ -262,7 +262,7 @@ private: CALL_WEARITEM = 16 }; - addWearableToAgentInventoryCallback(LLPointer<LLRefCount> cb, + AddWearableToAgentInventoryCallback(LLPointer<LLRefCount> cb, LLWearableType::EType type, U32 index, LLViewerWearable* wearable, diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp index 580e31591c..a1222424ee 100755 --- a/indra/newview/llpaneleditwearable.cpp +++ b/indra/newview/llpaneleditwearable.cpp @@ -1079,13 +1079,8 @@ void LLPanelEditWearable::saveChanges(bool force_save_as) if (force_save_as) { - // FIXME race condition if removeCOFItemLinks does not - // complete immediately. Looks like we're counting on the - // fact that updateAppearanceFromCOF will get called after - // we exit customize mode. - // the name of the wearable has changed, re-save wearable with new name - LLAppearanceMgr::instance().removeCOFItemLinks(mWearablePtr->getItemID()); + LLAppearanceMgr::instance().removeCOFItemLinks(mWearablePtr->getItemID(),gAgentAvatarp->mEndCustomizeCallback); gAgentWearables.saveWearableAs(mWearablePtr->getType(), index, new_name, description, FALSE); mNameEditor->setText(mWearableItem->getName()); } @@ -1096,24 +1091,19 @@ void LLPanelEditWearable::saveChanges(bool force_save_as) // version so texture baking service knows appearance has changed. if (link_item) { - // FIXME - two link-modifying calls here plus one - // inventory change request, none of which use a - // callback. When does a new appearance request go out - // and how is it synced with these changes? As above, - // we seem to be implicitly depending on - // updateAppearanceFromCOF() to be called when we - // exit customize mode. - // Create new link + LL_DEBUGS("Avatar") << "link refresh, creating new link to " << link_item->getLinkedUUID() + << " removing old link at " << link_item->getUUID() + << " wearable item id " << mWearablePtr->getItemID() << llendl; link_inventory_item( gAgent.getID(), link_item->getLinkedUUID(), LLAppearanceMgr::instance().getCOF(), link_item->getName(), description, LLAssetType::AT_LINK, - NULL); + gAgentAvatarp->mEndCustomizeCallback); // Remove old link - remove_inventory_item(link_item->getUUID(), NULL); + remove_inventory_item(link_item->getUUID(), gAgentAvatarp->mEndCustomizeCallback); } gAgentWearables.saveWearable(mWearablePtr->getType(), index, TRUE, new_name); } diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 5b4ca97319..bff6767617 100755 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -1166,6 +1166,49 @@ void move_inventory_item( gAgent.sendReliableMessage(); } +// Should call this with an update_item that's been copied and +// modified from an original source item, rather than modifying the +// source item directly. +void update_inventory_item( + LLViewerInventoryItem *update_item, + LLPointer<LLInventoryCallback> cb) +{ + const LLUUID& item_id = update_item->getUUID(); + bool ais_ran = false; + if (AISCommand::isAPIAvailable()) + { + LLSD updates = update_item->asLLSD(); + LLPointer<AISCommand> cmd_ptr = new UpdateItemCommand(item_id, updates, cb); + ais_ran = cmd_ptr->run_command(); + } + if (!ais_ran) + { + LLPointer<LLViewerInventoryItem> obj = gInventory.getItem(item_id); + LL_DEBUGS("Inventory") << "item_id: [" << item_id << "] name " << (update_item ? update_item->getName() : "(NOT FOUND)") << llendl; + if(obj) + { + LLMessageSystem* msg = gMessageSystem; + msg->newMessageFast(_PREHASH_UpdateInventoryItem); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + msg->addUUIDFast(_PREHASH_TransactionID, update_item->getTransactionID()); + msg->nextBlockFast(_PREHASH_InventoryData); + msg->addU32Fast(_PREHASH_CallbackID, 0); + update_item->packMessage(msg); + gAgent.sendReliableMessage(); + + LLInventoryModel::LLCategoryUpdate up(update_item->getParentUUID(), 0); + gInventory.accountForUpdate(up); + gInventory.updateItem(update_item); + if (cb) + { + cb->fire(item_id); + } + } + } +} + // Note this only supports updating an existing item. Goes through AISv3 // code path where available. Not all uses of item->updateServer() can // easily be switched to this paradigm. diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h index 0d4ffaa575..6bc6343f3f 100755 --- a/indra/newview/llviewerinventory.h +++ b/indra/newview/llviewerinventory.h @@ -368,6 +368,10 @@ void move_inventory_item( const std::string& new_name, LLPointer<LLInventoryCallback> cb); +void update_inventory_item( + LLViewerInventoryItem *update_item, + LLPointer<LLInventoryCallback> cb); + void update_inventory_item( const LLUUID& item_id, const LLSD& updates, diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 232bf3e478..05bd3101ea 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2978,6 +2978,11 @@ void LLVOAvatarSelf::onCustomizeStart(bool disable_camera_switch) { if (isAgentAvatarValid()) { + if (!gAgentAvatarp->mEndCustomizeCallback.get()) + { + gAgentAvatarp->mEndCustomizeCallback = new LLUpdateAppearanceOnDestroy; + } + gAgentAvatarp->mIsEditingAppearance = true; gAgentAvatarp->mUseLocalAppearance = true; @@ -3017,8 +3022,11 @@ void LLVOAvatarSelf::onCustomizeEnd(bool disable_camera_switch) gAgentCamera.changeCameraToDefault(); gAgentCamera.resetView(); } - - LLAppearanceMgr::instance().updateAppearanceFromCOF(); + + // Dereferencing the previous callback will cause + // updateAppearanceFromCOF to be called, whenever all refs + // have resolved. + gAgentAvatarp->mEndCustomizeCallback = NULL; } } diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index e8b9a25327..3cbf2b5cf5 100755 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -32,6 +32,7 @@ #include "llvoavatar.h" struct LocalTextureData; +class LLInventoryCallback; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -342,6 +343,7 @@ private: public: static void onCustomizeStart(bool disable_camera_switch = false); static void onCustomizeEnd(bool disable_camera_switch = false); + LLPointer<LLInventoryCallback> mEndCustomizeCallback; //-------------------------------------------------------------------- // Visibility -- cgit v1.2.3 From 28a5015074e3f6e0ba961dc260edcb9662e6f14b Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Mon, 22 Jul 2013 17:07:45 -0400 Subject: SH-4333 WIP - do version accounting for category when updated --- indra/newview/llaisapi.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp index 9389aeb3b4..f8c9447b17 100755 --- a/indra/newview/llaisapi.cpp +++ b/indra/newview/llaisapi.cpp @@ -548,6 +548,8 @@ void AISUpdate::parseCategory(const LLSD& category_map) // delta to be created if it does not already exist; // otherwise has no effect. mCatDescendentDeltas[new_cat->getParentUUID()]; + // Capture update for the category itself as well. + mCatDescendentDeltas[category_id]; } else { @@ -699,6 +701,8 @@ void AISUpdate::doUpdate() for (std::map<LLUUID,S32>::const_iterator catit = mCatDescendentDeltas.begin(); catit != mCatDescendentDeltas.end(); ++catit) { + LL_DEBUGS("Inventory") << "descendent accounting for " << catit->first << llendl; + const LLUUID cat_id(catit->first); // Don't account for update if we just created this category. if (mCategoriesCreated.find(cat_id) != mCategoriesCreated.end()) @@ -720,7 +724,8 @@ void AISUpdate::doUpdate() { S32 descendent_delta = catit->second; S32 old_count = cat->getDescendentCount(); - LL_DEBUGS("Inventory") << "Updating descendent count for " << cat_id + LL_DEBUGS("Inventory") << "Updating descendent count for " + << cat->getName() << " " << cat_id << " with delta " << descendent_delta << " from " << old_count << " to " << (old_count+descendent_delta) << LL_ENDL; LLInventoryModel::LLCategoryUpdate up(cat_id, descendent_delta); @@ -761,7 +766,7 @@ void AISUpdate::doUpdate() new_category->setVersion(curr_cat->getVersion()); new_category->setDescendentCount(curr_cat->getDescendentCount()); gInventory.updateCategory(new_category); - LL_DEBUGS("Inventory") << "updated category " << category_id << LL_ENDL; + LL_DEBUGS("Inventory") << "updated category " << new_category->getName() << " " << category_id << LL_ENDL; } } -- cgit v1.2.3 From a1fadad9c0bd1ba261f827d6da572db5621f5bed Mon Sep 17 00:00:00 2001 From: prep <prep@lindenlab.com> Date: Wed, 24 Jul 2013 16:01:36 -0400 Subject: Sh-4321 # Fixes for detach deformations. General code cleanup as well. --- indra/newview/llvoavatar.cpp | 74 ++++++++++++++++------------------------ indra/newview/llvoavatar.h | 1 - indra/newview/llvoavatarself.cpp | 5 --- indra/newview/llvovolume.cpp | 51 +++++++++++++++------------ 4 files changed, 58 insertions(+), 73 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 96afd2e15d..83b7ac9e75 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -106,7 +106,7 @@ extern F32 SPEED_ADJUST_MAX; extern F32 SPEED_ADJUST_MAX_SEC; extern F32 ANIM_SPEED_MAX; extern F32 ANIM_SPEED_MIN; - +extern U32 JOINT_COUNT_REQUIRED_FOR_FULLRIG; // #define OUTPUT_BREAST_DATA @@ -1234,6 +1234,7 @@ LLTexLayerSet* LLVOAvatar::createTexLayerSet() const LLVector3 LLVOAvatar::getRenderPosition() const { + if (mDrawable.isNull() || mDrawable->getGeneration() < 0) { return getPositionAgent(); @@ -1256,6 +1257,8 @@ const LLVector3 LLVOAvatar::getRenderPosition() const { return getPosition() * mDrawable->getParent()->getRenderMatrix(); } + + } void LLVOAvatar::updateDrawable(BOOL force_damped) @@ -2992,7 +2995,7 @@ bool LLVOAvatar::isVisuallyMuted() const // called on both your avatar and other avatars //------------------------------------------------------------------------ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) -{ +{ // clear debug text mDebugText.clear(); @@ -3540,9 +3543,9 @@ void LLVOAvatar::setPelvisOffset( bool hasOffset, const LLVector3& offsetAmount, { mHasPelvisOffset = hasOffset; if ( mHasPelvisOffset ) - { + { //Store off last pelvis to foot value - mLastPelvisToFoot = mPelvisToFoot; + mLastPelvisToFoot = mPelvisToFoot; mPelvisOffset = offsetAmount; mLastPelvisFixup = mPelvisFixup; mPelvisFixup = pelvisFixup; @@ -3552,18 +3555,16 @@ void LLVOAvatar::setPelvisOffset( bool hasOffset, const LLVector3& offsetAmount, // postPelvisSetRecalc //------------------------------------------------------------------------ void LLVOAvatar::postPelvisSetRecalc( void ) -{ - computeBodySize(); - mRoot->touch(); - mRoot->updateWorldMatrixChildren(); - dirtyMesh(); - updateHeadOffset(); +{ + mRoot->updateWorldMatrixChildren(); + computeBodySize(); + dirtyMesh(2); } //------------------------------------------------------------------------ -// pelisPoke +// setPelvisOffset //------------------------------------------------------------------------ void LLVOAvatar::setPelvisOffset( F32 pelvisFixupAmount ) -{ +{ mHasPelvisOffset = true; mLastPelvisFixup = mPelvisFixup; mPelvisFixup = pelvisFixupAmount; @@ -4925,22 +4926,6 @@ LLJoint *LLVOAvatar::getJoint( const std::string &name ) return jointp; } - -//----------------------------------------------------------------------------- -// resetJointPositions -//----------------------------------------------------------------------------- -void LLVOAvatar::resetJointPositions( void ) -{ - avatar_joint_list_t::iterator iter = mSkeleton.begin(); - avatar_joint_list_t::iterator end = mSkeleton.end(); - for (; iter != end; ++iter) - { - (*iter)->restoreOldXform(); - (*iter)->setId( LLUUID::null ); - } - mHasPelvisOffset = false; - mPelvisFixup = mLastPelvisFixup; -} //----------------------------------------------------------------------------- // resetSpecificJointPosition //----------------------------------------------------------------------------- @@ -4967,28 +4952,25 @@ void LLVOAvatar::resetSpecificJointPosition( const std::string& name ) // resetJointPositionsToDefault //----------------------------------------------------------------------------- void LLVOAvatar::resetJointPositionsToDefault( void ) -{ +{ //Subsequent joints are relative to pelvis avatar_joint_list_t::iterator iter = mSkeleton.begin(); avatar_joint_list_t::iterator end = mSkeleton.end(); for (; iter != end; ++iter) { LLJoint* pJoint = (*iter); - if ( pJoint->doesJointNeedToBeReset() ) - { + if ( pJoint && pJoint->doesJointNeedToBeReset() ) + { pJoint->setId( LLUUID::null ); - //restore joints to default positions, however skip over the pelvis - // *TODO: How does this pointer check skip over pelvis? - if ( pJoint ) - { - pJoint->restoreOldXform(); - } - } + pJoint->restoreOldXform(); + } } + //make sure we don't apply the joint offset mHasPelvisOffset = false; mPelvisFixup = mLastPelvisFixup; - postPelvisSetRecalc(); + + postPelvisSetRecalc(); } //----------------------------------------------------------------------------- // getCharacterPosition() @@ -5604,10 +5586,10 @@ void LLVOAvatar::cleanupAttachedMesh( LLViewerObject* pVO ) { const LLMeshSkinInfo* pSkinData = gMeshRepo.getSkinInfo( pVObj->getVolume()->getParams().getSculptID(), pVObj ); if (pSkinData - && pSkinData->mJointNames.size() > 20 // full rig - && pSkinData->mAlternateBindMatrix.size() > 0) - { - LLVOAvatar::resetJointPositionsToDefault(); + && pSkinData->mJointNames.size() > JOINT_COUNT_REQUIRED_FOR_FULLRIG // full rig + && pSkinData->mAlternateBindMatrix.size() > 0 ) + { + LLVOAvatar::resetJointPositionsToDefault(); //Need to handle the repositioning of the cam, updating rig data etc during outfit editing //This handles the case where we detach a replacement rig. if ( gAgentCamera.cameraCustomizeAvatar() ) @@ -5625,6 +5607,7 @@ void LLVOAvatar::cleanupAttachedMesh( LLViewerObject* pVO ) //----------------------------------------------------------------------------- BOOL LLVOAvatar::detachObject(LLViewerObject *viewer_object) { + for (attachment_map_t::iterator iter = mAttachmentPoints.begin(); iter != mAttachmentPoints.end(); ++iter) @@ -5633,7 +5616,9 @@ BOOL LLVOAvatar::detachObject(LLViewerObject *viewer_object) if (attachment->isObjectAttached(viewer_object)) { + cleanupAttachedMesh( viewer_object ); + attachment->removeObject(viewer_object); lldebugs << "Detaching object " << viewer_object->mID << " from " << attachment->getName() << llendl; return TRUE; @@ -6942,7 +6927,7 @@ bool resolve_appearance_version(const LLAppearanceMessageContents& contents, S32 void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) { LL_DEBUGS("Avatar") << "starts" << llendl; - + bool enable_verbose_dumps = gSavedSettings.getBOOL("DebugAvatarAppearanceMessage"); std::string dump_prefix = getFullname() + "_" + (isSelf()?"s":"o") + "_"; if (gSavedSettings.getBOOL("BlockAvatarAppearanceMessages")) @@ -7153,7 +7138,6 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) } updateMeshTextures(); - //if (enable_verbose_dumps) dumpArchetypeXML(dump_prefix + "process_end"); } diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 48b5a6e873..90ade85177 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -199,7 +199,6 @@ public: virtual LLJoint* getJoint(const std::string &name); - void resetJointPositions( void ); void resetJointPositionsToDefault( void ); void resetSpecificJointPosition( const std::string& name ); diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 05bd3101ea..a710c95233 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -671,11 +671,6 @@ LLJoint *LLVOAvatarSelf::getJoint(const std::string &name) } return LLVOAvatar::getJoint(name); } -//virtual -void LLVOAvatarSelf::resetJointPositions( void ) -{ - return LLVOAvatar::resetJointPositions(); -} // virtual BOOL LLVOAvatarSelf::setVisualParamWeight(const LLVisualParam *which_param, F32 weight, BOOL upload_bake ) { diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 8730ef66bb..135c2e1eca 100755 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -81,7 +81,7 @@ const S32 MIN_QUIET_FRAMES_COALESCE = 30; const F32 FORCE_SIMPLE_RENDER_AREA = 512.f; const F32 FORCE_CULL_AREA = 8.f; const F32 MAX_LOD_DISTANCE = 24.f; - +U32 JOINT_COUNT_REQUIRED_FOR_FULLRIG = 20; BOOL gAnimateTextures = TRUE; //extern BOOL gHideSelectedObjects; @@ -4236,6 +4236,11 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) bool emissive = false; + //Determine if we've received skininfo that contains an + //alternate bind matrix - if it does then apply the translational component + //to the joints of the avatar. + bool pelvisGotSet = false; + { LLFastTimer t(FTM_REBUILD_VOLUME_FACE_LIST); @@ -4317,18 +4322,12 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) is_rigged = true; //get drawpool of avatar with rigged face - LLDrawPoolAvatar* pool = get_avatar_drawpool(vobj); - - //Determine if we've received skininfo that contains an - //alternate bind matrix - if it does then apply the translational component - //to the joints of the avatar. - bool pelvisGotSet = false; - + LLDrawPoolAvatar* pool = get_avatar_drawpool(vobj); + if ( pAvatarVO ) { - LLUUID currentId = vobj->getVolume()->getParams().getSculptID(); + LLUUID currentId = vobj->getVolume()->getParams().getSculptID(); const LLMeshSkinInfo* pSkinData = gMeshRepo.getSkinInfo( currentId, vobj ); - if ( pSkinData ) { const int bindCnt = pSkinData->mAlternateBindMatrix.size(); @@ -4336,43 +4335,42 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) { const int jointCnt = pSkinData->mJointNames.size(); const F32 pelvisZOffset = pSkinData->mPelvisOffset; - bool fullRig = (jointCnt>=20) ? true : false; + bool fullRig = (jointCnt>=JOINT_COUNT_REQUIRED_FOR_FULLRIG) ? true : false; if ( fullRig ) - { + { for ( int i=0; i<jointCnt; ++i ) { std::string lookingForJoint = pSkinData->mJointNames[i].c_str(); - //llinfos<<"joint name "<<lookingForJoint.c_str()<<llendl; LLJoint* pJoint = pAvatarVO->getJoint( lookingForJoint ); if ( pJoint && pJoint->getId() != currentId ) { pJoint->setId( currentId ); const LLVector3& jointPos = pSkinData->mAlternateBindMatrix[i].getTranslation(); + //Set the joint position - pJoint->storeCurrentXform( jointPos ); + pJoint->storeCurrentXform( jointPos ); + //If joint is a pelvis then handle old/new pelvis to foot values if ( lookingForJoint == "mPelvis" ) { - pJoint->storeCurrentXform( jointPos ); if ( !pAvatarVO->hasPelvisOffset() ) { pAvatarVO->setPelvisOffset( true, jointPos, pelvisZOffset ); - //Trigger to rebuild viewer AV pelvisGotSet = true; } } - } - } + } + } } } } } - //If we've set the pelvis to a new position we need to also rebuild some information that the - //viewer does at launch (e.g. body size etc.) - if ( pelvisGotSet ) + + //Rebuild body data if we altered joints/pelvis + if ( pelvisGotSet && pAvatarVO ) { pAvatarVO->postPelvisSetRecalc(); - } + } if (pool) { @@ -4605,7 +4603,16 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) { drawablep->clearState(LLDrawable::RIGGED); } + } + + + + + + + + } group->mBufferUsage = useage; -- cgit v1.2.3 From 8b612cab394dc46b52a359b2b24863c49a5bd2d7 Mon Sep 17 00:00:00 2001 From: "prep@lindenlab.com" <prep@lindenlab.com> Date: Tue, 6 Aug 2013 16:44:01 -0500 Subject: Fixes for SH-4321. Also removed some unnecessary transform updates, and unused joint resetting code --- indra/newview/llvoavatar.cpp | 49 +++++++++++++++++++------------------------- indra/newview/llvoavatar.h | 3 +-- 2 files changed, 22 insertions(+), 30 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 83b7ac9e75..a0a2ce0caf 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1294,6 +1294,8 @@ void LLVOAvatar::updateSpatialExtents(LLVector4a& newMin, LLVector4a &newMax) mImpostorOffset = LLVector3(pos_group.getF32ptr())-getRenderPosition(); mDrawable->setPositionGroup(pos_group); } + + } void LLVOAvatar::getSpatialExtents(LLVector4a& newMin, LLVector4a& newMax) @@ -3510,6 +3512,9 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) //mesh vertices need to be reskinned mNeedsSkin = TRUE; + + + return TRUE; } //----------------------------------------------------------------------------- @@ -4927,28 +4932,6 @@ LLJoint *LLVOAvatar::getJoint( const std::string &name ) return jointp; } //----------------------------------------------------------------------------- -// resetSpecificJointPosition -//----------------------------------------------------------------------------- -void LLVOAvatar::resetSpecificJointPosition( const std::string& name ) -{ - LLJoint* pJoint = mRoot->findJoint( name ); - - if ( pJoint && pJoint->doesJointNeedToBeReset() ) - { - pJoint->restoreOldXform(); - pJoint->setId( LLUUID::null ); - //If we're reseting the pelvis position make sure not to apply offset - if ( name == "mPelvis" ) - { - mHasPelvisOffset = false; - } - } - else - { - llinfos<<"Did not find "<< name.c_str()<<llendl; - } -} -//----------------------------------------------------------------------------- // resetJointPositionsToDefault //----------------------------------------------------------------------------- void LLVOAvatar::resetJointPositionsToDefault( void ) @@ -4956,20 +4939,30 @@ void LLVOAvatar::resetJointPositionsToDefault( void ) //Subsequent joints are relative to pelvis avatar_joint_list_t::iterator iter = mSkeleton.begin(); avatar_joint_list_t::iterator end = mSkeleton.end(); + + LLJoint* pJointPelvis = getJoint("mPelvis"); + for (; iter != end; ++iter) { LLJoint* pJoint = (*iter); - if ( pJoint && pJoint->doesJointNeedToBeReset() ) + //Reset joints except for pelvis + if ( pJoint && pJoint != pJointPelvis && pJoint->doesJointNeedToBeReset() ) { pJoint->setId( LLUUID::null ); pJoint->restoreOldXform(); } - } - + else + if ( pJoint && pJoint == pJointPelvis && pJoint->doesJointNeedToBeReset() ) + { + pJoint->setId( LLUUID::null ); + pJoint->setPosition( LLVector3( 0.0f, 0.0f, 0.0f) ); + pJoint->setJointResetFlag( false ); + } + } + //make sure we don't apply the joint offset mHasPelvisOffset = false; mPelvisFixup = mLastPelvisFixup; - postPelvisSetRecalc(); } //----------------------------------------------------------------------------- @@ -5125,7 +5118,7 @@ BOOL LLVOAvatar::loadSkeletonNode () { attachment->setOriginalPosition(info->mPosition); } - + if (info->mHasRotation) { LLQuaternion rotation; @@ -5195,7 +5188,6 @@ void LLVOAvatar::updateVisualParams() dirtyMesh(); updateHeadOffset(); } - //----------------------------------------------------------------------------- // isActive() //----------------------------------------------------------------------------- @@ -5534,6 +5526,7 @@ void LLVOAvatar::lazyAttach() void LLVOAvatar::resetHUDAttachments() { + for (attachment_map_t::iterator iter = mAttachmentPoints.begin(); iter != mAttachmentPoints.end(); ++iter) diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 90ade85177..8bf31e3cb3 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -200,7 +200,6 @@ public: virtual LLJoint* getJoint(const std::string &name); void resetJointPositionsToDefault( void ); - void resetSpecificJointPosition( const std::string& name ); /*virtual*/ const LLUUID& getID() const; /*virtual*/ void addDebugText(const std::string& text); @@ -209,7 +208,7 @@ public: /*virtual*/ F32 getPixelArea() const; /*virtual*/ LLVector3d getPosGlobalFromAgent(const LLVector3 &position); /*virtual*/ LLVector3 getPosAgentFromGlobal(const LLVector3d &position); - virtual void updateVisualParams(); + virtual void updateVisualParams(); /** Inherited -- cgit v1.2.3 From 0e8a966f3ba6db8a789b8053bc0eb70584c526fd Mon Sep 17 00:00:00 2001 From: Logan Dethrow <log@lindenlab.com> Date: Thu, 8 Aug 2013 17:13:53 -0400 Subject: Moved commented out capabilities debugging code into ifdef'd block and added a comment describing the use of it. --- indra/newview/llviewerregion.cpp | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index ad046accd0..7150089380 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -76,6 +76,11 @@ #pragma warning(disable:4355) #endif +// When we receive a base grant of capabilities that has a different number of +// capabilities than the original base grant received for the region, print +// out the two lists of capabilities for analysis. +//#define DEBUG_CAPS_GRANTS + const F32 WATER_TEXTURE_SCALE = 8.f; // Number of times to repeat the water texture across a region const S16 MAX_MAP_DIST = 10; // The server only keeps our pending agent info for 60 seconds. @@ -328,25 +333,18 @@ private: << "mCapabilities == " << regionp->getRegionImpl()->mCapabilities.size() << " mSecondCapabilitiesTracker == " << regionp->getRegionImpl()->mSecondCapabilitiesTracker.size() << LL_ENDL; +#ifdef DEBUG_CAPS_GRANTS + LL_WARNS2("AppInit", "Capabilities") + << "Initial Base capabilities: " << LL_ENDL; - //LL_WARNS2("AppInit", "Capabilities") - // << "Initial Base capabilities: " << LL_ENDL; - - //log_capabilities(regionp->getRegionImpl()->mCapabilities); + log_capabilities(regionp->getRegionImpl()->mCapabilities); - //LL_WARNS2("AppInit", "Capabilities") - // << "Latest base capabilities: " << LL_ENDL; + LL_WARNS2("AppInit", "Capabilities") + << "Latest base capabilities: " << LL_ENDL; - //log_capabilities(regionp->getRegionImpl()->mSecondCapabilitiesTracker); + log_capabilities(regionp->getRegionImpl()->mSecondCapabilitiesTracker); - // *TODO - //add cap debug versus original check? - //CapabilityMap::const_iterator iter = regionp->getRegionImpl()->mCapabilities.begin(); - //while (iter!=regionp->getRegionImpl()->mCapabilities.end() ) - //{ - // llinfos<<"BaseCapabilitiesCompleteTracker Original "<<iter->first<<" "<< iter->second<<llendl; - // ++iter; - //} +#endif if (regionp->getRegionImpl()->mSecondCapabilitiesTracker.size() > regionp->getRegionImpl()->mCapabilities.size() ) { -- cgit v1.2.3 From 3ed3b88892adb4234c375d2d6bd5f0d2da5566c7 Mon Sep 17 00:00:00 2001 From: Don Kjer <don@lindenlab.com> Date: Fri, 9 Aug 2013 13:36:36 -0700 Subject: Refactoring link creation calls in preparation for adding AIS v3 hook. --- indra/newview/llagentwearables.cpp | 8 +- indra/newview/llagentwearablesfetch.cpp | 15 +-- indra/newview/llappearancemgr.cpp | 103 ++++------------ indra/newview/llappearancemgr.h | 13 +- indra/newview/llinventorybridge.cpp | 32 +---- indra/newview/llpaneleditwearable.cpp | 15 +-- indra/newview/llviewerinventory.cpp | 212 ++++++++++++++++++++++---------- indra/newview/llviewerinventory.h | 27 ++-- 8 files changed, 209 insertions(+), 216 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 8c33a778e3..f3c9998a7d 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -952,15 +952,15 @@ public: /* virtual */ void fire(const LLUUID& inv_item) { llinfos << "One item created " << inv_item.asString() << llendl; - LLViewerInventoryItem *item = gInventory.getItem(inv_item); - mItemsToLink.put(item); + LLConstPointer<LLInventoryObject> item = gInventory.getItem(inv_item); + mItemsToLink.push_back(item); updatePendingWearable(inv_item); } ~OnWearableItemCreatedCB() { llinfos << "All items created" << llendl; LLPointer<LLInventoryCallback> link_waiter = new LLUpdateAppearanceOnDestroy; - LLAppearanceMgr::instance().linkAll(LLAppearanceMgr::instance().getCOF(), + link_inventory_array(LLAppearanceMgr::instance().getCOF(), mItemsToLink, link_waiter); } @@ -1011,7 +1011,7 @@ public: } private: - LLInventoryModel::item_array_t mItemsToLink; + LLInventoryObject::const_object_list_t mItemsToLink; std::vector<LLViewerWearable*> mWearablesAwaitingItems; }; diff --git a/indra/newview/llagentwearablesfetch.cpp b/indra/newview/llagentwearablesfetch.cpp index 014c610a5c..a2a667e660 100755 --- a/indra/newview/llagentwearablesfetch.cpp +++ b/indra/newview/llagentwearablesfetch.cpp @@ -117,26 +117,21 @@ public: // Link to all fetched items in COF. LLPointer<LLInventoryCallback> link_waiter = new LLUpdateAppearanceOnDestroy; + LLInventoryObject::const_object_list_t item_array; for (uuid_vec_t::iterator it = mIDs.begin(); it != mIDs.end(); ++it) { LLUUID id = *it; - LLViewerInventoryItem *item = gInventory.getItem(*it); + LLConstPointer<LLInventoryObject> item = gInventory.getItem(*it); if (!item) { - llwarns << "fetch failed!" << llendl; + llwarns << "fetch failed for item " << (*it) << "!" << llendl; continue; } - - link_inventory_item(gAgent.getID(), - item->getLinkedUUID(), - LLAppearanceMgr::instance().getCOF(), - item->getName(), - item->getDescription(), - LLAssetType::AT_LINK, - link_waiter); + item_array.push_back(item); } + link_inventory_array(LLAppearanceMgr::instance().getCOF(), item_array, link_waiter); } }; diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 3818bd8aec..c4bc6f648f 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -909,20 +909,15 @@ void recovered_item_cb(const LLUUID& item_id, LLWearableType::EType type, LLView } LL_DEBUGS("Avatar") << self_av_string() << "Recovered item for type " << type << LL_ENDL; - LLViewerInventoryItem *itemp = gInventory.getItem(item_id); + LLConstPointer<LLInventoryObject> itemp = gInventory.getItem(item_id); wearable->setItemID(item_id); - LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(boost::bind(recovered_item_link_cb,_1,type,wearable,holder)); holder->eraseTypeToRecover(type); llassert(itemp); if (itemp) { - link_inventory_item( gAgent.getID(), - item_id, - LLAppearanceMgr::instance().getCOF(), - itemp->getName(), - itemp->getDescription(), - LLAssetType::AT_LINK, - cb); + LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(boost::bind(recovered_item_link_cb,_1,type,wearable,holder)); + + link_inventory_object(LLAppearanceMgr::instance().getCOF(), itemp, cb); } } @@ -1551,6 +1546,7 @@ void LLAppearanceMgr::shallowCopyCategoryContents(const LLUUID& src_id, const LL LLInventoryModel::item_array_t* items; gInventory.getDirectDescendentsOf(src_id, cats, items); llinfos << "copying " << items->count() << " items" << llendl; + LLInventoryObject::const_object_list_t link_array; for (LLInventoryModel::item_array_t::const_iterator iter = items->begin(); iter != items->end(); ++iter) @@ -1561,14 +1557,7 @@ void LLAppearanceMgr::shallowCopyCategoryContents(const LLUUID& src_id, const LL case LLAssetType::AT_LINK: { LL_DEBUGS("Avatar") << "linking inventory item " << item->getName() << llendl; - //getActualDescription() is used for a new description - //to propagate ordering information saved in descriptions of links - link_inventory_item(gAgent.getID(), - item->getLinkedUUID(), - dst_id, - item->getName(), - item->getActualDescription(), - LLAssetType::AT_LINK, cb); + link_array.push_back(LLConstPointer<LLInventoryObject>(item)); break; } case LLAssetType::AT_LINK_FOLDER: @@ -1578,12 +1567,7 @@ void LLAppearanceMgr::shallowCopyCategoryContents(const LLUUID& src_id, const LL if (catp && catp->getPreferredType() != LLFolderType::FT_OUTFIT) { LL_DEBUGS("Avatar") << "linking inventory folder " << item->getName() << llendl; - link_inventory_item(gAgent.getID(), - item->getLinkedUUID(), - dst_id, - item->getName(), - item->getDescription(), - LLAssetType::AT_LINK_FOLDER, cb); + link_array.push_back(LLConstPointer<LLInventoryObject>(item)); } break; } @@ -1606,6 +1590,11 @@ void LLAppearanceMgr::shallowCopyCategoryContents(const LLUUID& src_id, const LL break; } } + if (!link_array.empty()) + { + const bool resolve_links = true; + link_inventory_array(dst_id, link_array, cb, resolve_links); + } } BOOL LLAppearanceMgr::getCanMakeFolderIntoOutfit(const LLUUID& folder_id) @@ -1753,42 +1742,6 @@ void LLAppearanceMgr::filterWearableItems( } } -// Create links to all listed items. -void LLAppearanceMgr::linkAll(const LLUUID& cat_uuid, - LLInventoryModel::item_array_t& items, - LLPointer<LLInventoryCallback> cb) -{ - for (S32 i=0; i<items.count(); i++) - { - const LLInventoryItem* item = items.get(i).get(); - link_inventory_item(gAgent.getID(), - item->getLinkedUUID(), - cat_uuid, - item->getName(), - item->getActualDescription(), - LLAssetType::AT_LINK, - cb); - - const LLViewerInventoryCategory *cat = gInventory.getCategory(cat_uuid); - const std::string cat_name = cat ? cat->getName() : "CAT NOT FOUND"; -#ifndef LL_RELEASE_FOR_DOWNLOAD - LL_DEBUGS("Avatar") << self_av_string() << "Linking Item [ name:" << item->getName() << " UUID:" << item->getUUID() << " ] to Category [ name:" << cat_name << " UUID:" << cat_uuid << " ] " << LL_ENDL; -#endif - } -} - -void LLAppearanceMgr::removeAll(LLInventoryModel::item_array_t& items_to_kill, - LLPointer<LLInventoryCallback> cb) -{ - for (LLInventoryModel::item_array_t::iterator it = items_to_kill.begin(); - it != items_to_kill.end(); - ++it) - { - LLViewerInventoryItem *item = *it; - remove_inventory_item(item->getUUID(), cb); - } -} - void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append) { LLViewerInventoryCategory *pcat = gInventory.getCategory(category); @@ -1934,8 +1887,7 @@ void LLAppearanceMgr::createBaseOutfitLink(const LLUUID& category, LLPointer<LLI if (catp && catp->getPreferredType() == LLFolderType::FT_OUTFIT) { - link_inventory_item(gAgent.getID(), category, cof, catp->getName(), "", - LLAssetType::AT_LINK_FOLDER, link_waiter); + link_inventory_object(cof, catp, link_waiter); new_outfit_name = catp->getName(); } @@ -2027,7 +1979,7 @@ void item_array_diff(LLInventoryModel::item_array_t& full_list, S32 LLAppearanceMgr::findExcessOrDuplicateItems(const LLUUID& cat_id, LLAssetType::EType type, S32 max_items, - LLInventoryModel::item_array_t& items_to_kill) + LLInventoryObject::object_list_t& items_to_kill) { S32 to_kill_count = 0; @@ -2045,7 +1997,7 @@ S32 LLAppearanceMgr::findExcessOrDuplicateItems(const LLUUID& cat_id, it != kill_items.end(); ++it) { - items_to_kill.push_back(*it); + items_to_kill.push_back(LLPointer<LLInventoryObject>(*it)); to_kill_count++; } return to_kill_count; @@ -2053,7 +2005,7 @@ S32 LLAppearanceMgr::findExcessOrDuplicateItems(const LLUUID& cat_id, void LLAppearanceMgr::findAllExcessOrDuplicateItems(const LLUUID& cat_id, - LLInventoryModel::item_array_t& items_to_kill) + LLInventoryObject::object_list_t& items_to_kill) { findExcessOrDuplicateItems(cat_id,LLAssetType::AT_BODYPART, 1, items_to_kill); @@ -2065,14 +2017,13 @@ void LLAppearanceMgr::findAllExcessOrDuplicateItems(const LLUUID& cat_id, void LLAppearanceMgr::enforceCOFItemRestrictions(LLPointer<LLInventoryCallback> cb) { - LLInventoryModel::item_array_t items_to_kill; + LLInventoryObject::object_list_t items_to_kill; findAllExcessOrDuplicateItems(getCOF(), items_to_kill); if (items_to_kill.size()>0) { // Remove duplicate or excess wearables. Should normally be enforced at the UI level, but // this should catch anything that gets through. - removeAll(items_to_kill, cb); - return; + remove_inventory_items(items_to_kill, cb); } } @@ -2525,7 +2476,7 @@ void LLAppearanceMgr::addCOFItemLink(const LLUUID &item_id, void LLAppearanceMgr::addCOFItemLink(const LLInventoryItem *item, LLPointer<LLInventoryCallback> cb, const std::string description) -{ +{ const LLViewerInventoryItem *vitem = dynamic_cast<const LLViewerInventoryItem*>(item); if (!vitem) { @@ -2577,18 +2528,10 @@ void LLAppearanceMgr::addCOFItemLink(const LLInventoryItem *item, if (!linked_already) { - std::string link_description = description; - if (vitem->getIsLinkType()) - { - link_description = vitem->getActualDescription(); - } - link_inventory_item( gAgent.getID(), - vitem->getLinkedUUID(), - getCOF(), - vitem->getName(), - link_description, - LLAssetType::AT_LINK, - cb); + LLInventoryObject::const_object_list_t obj_array; + obj_array.push_back(LLConstPointer<LLInventoryObject>(vitem)); + const bool resolve_links = true; + link_inventory_array(getCOF(), obj_array, cb, resolve_links); } } diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index 8c8b5e2489..346577ab9a 100755 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -67,9 +67,9 @@ public: S32 findExcessOrDuplicateItems(const LLUUID& cat_id, LLAssetType::EType type, S32 max_items, - LLInventoryModel::item_array_t& items_to_kill); + LLInventoryObject::object_list_t& items_to_kill); void findAllExcessOrDuplicateItems(const LLUUID& cat_id, - LLInventoryModel::item_array_t& items_to_kill); + LLInventoryObject::object_list_t& items_to_kill); void enforceCOFItemRestrictions(LLPointer<LLInventoryCallback> cb); S32 getActiveCopyOperations() const; @@ -139,15 +139,6 @@ public: void registerAttachment(const LLUUID& item_id); void setAttachmentInvLinkEnable(bool val); - // utility function for bulk linking. - void linkAll(const LLUUID& category, - LLInventoryModel::item_array_t& items, - LLPointer<LLInventoryCallback> cb); - - // And bulk removal. - void removeAll(LLInventoryModel::item_array_t& items, - LLPointer<LLInventoryCallback> cb); - // Add COF link to individual item. void addCOFItemLink(const LLUUID& item_id, LLPointer<LLInventoryCallback> cb = NULL, const std::string description = ""); void addCOFItemLink(const LLInventoryItem *item, LLPointer<LLInventoryCallback> cb = NULL, const std::string description = ""); diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index cb3f40a5bb..0481bf5f45 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3223,28 +3223,9 @@ void LLFolderBridge::pasteLinkFromClipboard() dropToOutfit(item, move_is_into_current_outfit); } } - else if (LLInventoryCategory *cat = model->getCategory(object_id)) + else if (LLConstPointer<LLInventoryObject> obj = model->getObject(object_id)) { - const std::string empty_description = ""; - link_inventory_item( - gAgent.getID(), - cat->getUUID(), - parent_id, - cat->getName(), - empty_description, - LLAssetType::AT_LINK_FOLDER, - LLPointer<LLInventoryCallback>(NULL)); - } - else if (LLInventoryItem *item = model->getItem(object_id)) - { - link_inventory_item( - gAgent.getID(), - item->getLinkedUUID(), - parent_id, - item->getName(), - item->getDescription(), - LLAssetType::AT_LINK, - LLPointer<LLInventoryCallback>(NULL)); + link_inventory_object(parent_id, obj, LLPointer<LLInventoryCallback>(NULL)); } } // Change mode to paste for next paste @@ -3830,14 +3811,7 @@ void LLFolderBridge::dropToOutfit(LLInventoryItem* inv_item, BOOL move_is_into_c else { LLPointer<LLInventoryCallback> cb = NULL; - link_inventory_item( - gAgent.getID(), - inv_item->getLinkedUUID(), - mUUID, - inv_item->getName(), - inv_item->getDescription(), - LLAssetType::AT_LINK, - cb); + link_inventory_object(mUUID, LLConstPointer<LLInventoryObject>(inv_item), cb); } } diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp index a1222424ee..0532370ff2 100755 --- a/indra/newview/llpaneleditwearable.cpp +++ b/indra/newview/llpaneleditwearable.cpp @@ -1095,13 +1095,14 @@ void LLPanelEditWearable::saveChanges(bool force_save_as) LL_DEBUGS("Avatar") << "link refresh, creating new link to " << link_item->getLinkedUUID() << " removing old link at " << link_item->getUUID() << " wearable item id " << mWearablePtr->getItemID() << llendl; - link_inventory_item( gAgent.getID(), - link_item->getLinkedUUID(), - LLAppearanceMgr::instance().getCOF(), - link_item->getName(), - description, - LLAssetType::AT_LINK, - gAgentAvatarp->mEndCustomizeCallback); + + LLInventoryObject::const_object_list_t obj_array; + obj_array.push_back(LLConstPointer<LLInventoryObject>(link_item)); + const bool resolve_links = true; + link_inventory_array(LLAppearanceMgr::instance().getCOF(), + obj_array, + gAgentAvatarp->mEndCustomizeCallback, + resolve_links); // Remove old link remove_inventory_item(link_item->getUUID(), gAgentAvatarp->mEndCustomizeCallback); } diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index bff6767617..33186a5a88 100755 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -1074,77 +1074,133 @@ void copy_inventory_item( gAgent.sendReliableMessage(); } -void link_inventory_item( - const LLUUID& agent_id, - const LLUUID& item_id, - const LLUUID& parent_id, - const std::string& new_name, - const std::string& new_description, - const LLAssetType::EType asset_type, - LLPointer<LLInventoryCallback> cb) +// Create link to single inventory object. +void link_inventory_object(const LLUUID& category, + LLConstPointer<LLInventoryObject> baseobj, + LLPointer<LLInventoryCallback> cb) { - const LLInventoryObject *baseobj = gInventory.getObject(item_id); if (!baseobj) { - llwarns << "attempt to link to unknown item, linked-to-item's itemID " << item_id << llendl; - return; - } - if (baseobj && baseobj->getIsLinkType()) - { - llwarns << "attempt to create a link to a link, linked-to-item's itemID " << item_id << llendl; + llwarns << "Attempt to link to non-existent object" << llendl; return; } - if (baseobj && !LLAssetType::lookupCanLink(baseobj->getType())) - { - // Fail if item can be found but is of a type that can't be linked. - // Arguably should fail if the item can't be found too, but that could - // be a larger behavioral change. - llwarns << "attempt to link an unlinkable item, type = " << baseobj->getActualType() << llendl; - return; - } - - LLUUID transaction_id; - LLInventoryType::EType inv_type = LLInventoryType::IT_NONE; - if (dynamic_cast<const LLInventoryCategory *>(baseobj)) - { - inv_type = LLInventoryType::IT_CATEGORY; - } - else + LLInventoryObject::const_object_list_t obj_array; + obj_array.push_back(baseobj); + link_inventory_array(category, obj_array, cb); +} + +void link_inventory_object(const LLUUID& category, + const LLUUID& id, + LLPointer<LLInventoryCallback> cb) +{ + LLConstPointer<LLInventoryObject> baseobj = gInventory.getObject(id); + link_inventory_object(category, baseobj, cb); +} + +// Create links to all listed inventory objects. +void link_inventory_array(const LLUUID& category, + LLInventoryObject::const_object_list_t& baseobj_array, + LLPointer<LLInventoryCallback> cb, + bool resolve_links /* = false */) +{ +#ifndef LL_RELEASE_FOR_DOWNLOAD + const LLViewerInventoryCategory *cat = gInventory.getCategory(category); + const std::string cat_name = cat ? cat->getName() : "CAT NOT FOUND"; +#endif + LLInventoryObject::const_object_list_t::const_iterator it = baseobj_array.begin(); + LLInventoryObject::const_object_list_t::const_iterator end = baseobj_array.end(); + for (; it != end; ++it) { - const LLViewerInventoryItem *baseitem = dynamic_cast<const LLViewerInventoryItem *>(baseobj); - if (baseitem) + const LLInventoryObject* baseobj = *it; + if (!baseobj) { - inv_type = baseitem->getInventoryType(); + llwarns << "attempt to link to unknown object" << llendl; + continue; + } + if (!resolve_links && baseobj->getIsLinkType()) + { + llwarns << "attempt to create a link to a link, linked-to-object's ID " << baseobj->getUUID() << llendl; + continue; } - } -#if 1 // debugging stuff - LLViewerInventoryCategory* cat = gInventory.getCategory(parent_id); - lldebugs << "cat: " << cat << llendl; - + if (!LLAssetType::lookupCanLink(baseobj->getType())) + { + // Fail if item can be found but is of a type that can't be linked. + // Arguably should fail if the item can't be found too, but that could + // be a larger behavioral change. + llwarns << "attempt to link an unlinkable object, type = " << baseobj->getActualType() << llendl; + continue; + } + + LLUUID transaction_id; + LLInventoryType::EType inv_type = LLInventoryType::IT_NONE; + LLAssetType::EType asset_type = LLAssetType::AT_NONE; + std::string new_desc; + LLUUID linkee_id; + if (dynamic_cast<const LLInventoryCategory *>(baseobj)) + { + inv_type = LLInventoryType::IT_CATEGORY; + asset_type = LLAssetType::AT_LINK_FOLDER; + linkee_id = baseobj->getUUID(); + } + else + { + const LLViewerInventoryItem *baseitem = dynamic_cast<const LLViewerInventoryItem *>(baseobj); + if (baseitem) + { + inv_type = baseitem->getInventoryType(); + new_desc = baseitem->getActualDescription(); + switch (baseitem->getActualType()) + { + case LLAssetType::AT_LINK: + case LLAssetType::AT_LINK_FOLDER: + linkee_id = baseobj->getLinkedUUID(); + asset_type = baseitem->getActualType(); + break; + default: + linkee_id = baseobj->getUUID(); + asset_type = LLAssetType::AT_LINK; + break; + } + } + else + { + llwarns << "could not convert object into an item or category: " << baseobj->getUUID() << llendl; + continue; + } + } + + LLMessageSystem* msg = gMessageSystem; + msg->newMessageFast(_PREHASH_LinkInventoryItem); + msg->nextBlock(_PREHASH_AgentData); + { + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + } + msg->nextBlock(_PREHASH_InventoryBlock); + { + msg->addU32Fast(_PREHASH_CallbackID, gInventoryCallbacks.registerCB(cb)); + msg->addUUIDFast(_PREHASH_FolderID, category); + msg->addUUIDFast(_PREHASH_TransactionID, transaction_id); + msg->addUUIDFast(_PREHASH_OldItemID, linkee_id); + msg->addS8Fast(_PREHASH_Type, (S8)asset_type); + msg->addS8Fast(_PREHASH_InvType, (S8)inv_type); + msg->addStringFast(_PREHASH_Name, baseobj->getName()); + msg->addStringFast(_PREHASH_Description, new_desc); + } + gAgent.sendReliableMessage(); +#ifndef LL_RELEASE_FOR_DOWNLOAD + LL_DEBUGS("Inventory") << "Linking Object [ name:" << baseobj->getName() + << " UUID:" << baseobj->getUUID() + << " ] into Category [ name:" << cat_name + << " UUID:" << category << " ] " << LL_ENDL; #endif - LLMessageSystem* msg = gMessageSystem; - msg->newMessageFast(_PREHASH_LinkInventoryItem); - msg->nextBlock(_PREHASH_AgentData); - { - msg->addUUIDFast(_PREHASH_AgentID, agent_id); - msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); } - msg->nextBlock(_PREHASH_InventoryBlock); - { - msg->addU32Fast(_PREHASH_CallbackID, gInventoryCallbacks.registerCB(cb)); - msg->addUUIDFast(_PREHASH_FolderID, parent_id); - msg->addUUIDFast(_PREHASH_TransactionID, transaction_id); - msg->addUUIDFast(_PREHASH_OldItemID, item_id); - msg->addS8Fast(_PREHASH_Type, (S8)asset_type); - msg->addS8Fast(_PREHASH_InvType, (S8)inv_type); - msg->addStringFast(_PREHASH_Name, new_name); - msg->addStringFast(_PREHASH_Description, new_description); - } - gAgent.sendReliableMessage(); } + + void move_inventory_item( const LLUUID& agent_id, const LLUUID& session_id, @@ -1301,14 +1357,41 @@ void update_inventory_category( } } +void remove_inventory_items( + LLInventoryObject::object_list_t& items_to_kill, + LLPointer<LLInventoryCallback> cb) +{ + for (LLInventoryObject::object_list_t::iterator it = items_to_kill.begin(); + it != items_to_kill.end(); + ++it) + { + remove_inventory_item(*it, cb); + } +} + void remove_inventory_item( const LLUUID& item_id, LLPointer<LLInventoryCallback> cb) { - LLPointer<LLViewerInventoryItem> obj = gInventory.getItem(item_id); - LL_DEBUGS("Inventory") << "item_id: [" << item_id << "] name " << (obj ? obj->getName() : "(NOT FOUND)") << llendl; + LLPointer<LLInventoryObject> obj = gInventory.getItem(item_id); + if (obj) + { + remove_inventory_item(obj, cb); + } + else + { + LL_DEBUGS("Inventory") << "item_id: [" << item_id << "] name " << "(NOT FOUND)" << llendl; + } +} + +void remove_inventory_item( + LLPointer<LLInventoryObject> obj, + LLPointer<LLInventoryCallback> cb) +{ if(obj) { + const LLUUID item_id(obj->getUUID()); + LL_DEBUGS("Inventory") << "item_id: [" << item_id << "] name " << obj->getName() << llendl; if (AISCommand::isAPIAvailable()) { LLPointer<AISCommand> cmd_ptr = new RemoveItemCommand(item_id, cb); @@ -1336,7 +1419,8 @@ void remove_inventory_item( } else { - llwarns << "remove_inventory_item called for invalid or nonexistent item " << item_id << llendl; + // *TODO: Clean up callback? + llwarns << "remove_inventory_item called for invalid or nonexistent item." << llendl; } } @@ -1632,13 +1716,7 @@ void slam_inventory_folder(const LLUUID& folder_id, ++it) { const LLSD& item_contents = *it; - link_inventory_item(gAgent.getID(), - item_contents["linked_id"].asUUID(), - folder_id, - item_contents["name"].asString(), - item_contents["desc"].asString(), - LLAssetType::EType(item_contents["type"].asInteger()), - cb); + link_inventory_object(folder_id, item_contents["linked_id"].asUUID(), cb); } remove_folder_contents(folder_id,false,cb); } diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h index 6bc6343f3f..cc715ae21d 100755 --- a/indra/newview/llviewerinventory.h +++ b/indra/newview/llviewerinventory.h @@ -351,14 +351,17 @@ void copy_inventory_item( const std::string& new_name, LLPointer<LLInventoryCallback> cb); -void link_inventory_item( - const LLUUID& agent_id, - const LLUUID& item_id, - const LLUUID& parent_id, - const std::string& new_name, - const std::string& new_description, - const LLAssetType::EType asset_type, - LLPointer<LLInventoryCallback> cb); +// utility functions for inventory linking. +void link_inventory_object(const LLUUID& category, + LLConstPointer<LLInventoryObject> baseobj, + LLPointer<LLInventoryCallback> cb); +void link_inventory_object(const LLUUID& category, + const LLUUID& id, + LLPointer<LLInventoryCallback> cb); +void link_inventory_array(const LLUUID& category, + LLInventoryObject::const_object_list_t& baseobj_array, + LLPointer<LLInventoryCallback> cb, + bool resolve_links = false); void move_inventory_item( const LLUUID& agent_id, @@ -382,6 +385,14 @@ void update_inventory_category( const LLSD& updates, LLPointer<LLInventoryCallback> cb); +void remove_inventory_items( + LLInventoryObject::object_list_t& items, + LLPointer<LLInventoryCallback> cb); + +void remove_inventory_item( + LLPointer<LLInventoryObject> obj, + LLPointer<LLInventoryCallback> cb); + void remove_inventory_item( const LLUUID& item_id, LLPointer<LLInventoryCallback> cb); -- cgit v1.2.3 From c1af1a692a6bd0f3cdfb3f49cc2451717481b685 Mon Sep 17 00:00:00 2001 From: Don Kjer <don@lindenlab.com> Date: Fri, 9 Aug 2013 14:52:54 -0700 Subject: Routing link creating through AISv3 when available. --- indra/newview/llaisapi.cpp | 37 ++++++++++++++------- indra/newview/llaisapi.h | 9 +++++ indra/newview/llviewerinventory.cpp | 65 +++++++++++++++++++++++++------------ 3 files changed, 79 insertions(+), 32 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp index f8c9447b17..73aaebc050 100755 --- a/indra/newview/llaisapi.cpp +++ b/indra/newview/llaisapi.cpp @@ -100,20 +100,9 @@ void AISCommand::httpSuccess() /*virtual*/ void AISCommand::httpFailure() { - const LLSD& content = getContent(); + LL_WARNS("Inventory") << dumpResponse() << LL_ENDL; S32 status = getStatus(); - const std::string& reason = getReason(); const LLSD& headers = getResponseHeaders(); - if (!content.isMap()) - { - LL_DEBUGS("Inventory") << "Malformed response contents " << content - << " status " << status << " reason " << reason << LL_ENDL; - } - else - { - LL_DEBUGS("Inventory") << "failed with content: " << ll_pretty_print_sd(content) - << " status " << status << " reason " << reason << LL_ENDL; - } mRetryPolicy->onFailure(status, headers); F32 seconds_to_wait; if (mRetryPolicy->shouldRetry(seconds_to_wait)) @@ -276,6 +265,30 @@ UpdateCategoryCommand::UpdateCategoryCommand(const LLUUID& item_id, setCommandFunc(cmd); } +CreateInventoryCommand::CreateInventoryCommand(const LLUUID& parent_id, + const LLSD& new_inventory, + LLPointer<LLInventoryCallback> callback): + mNewInventory(new_inventory), + AISCommand(callback) +{ + std::string cap; + if (!getInvCap(cap)) + { + llwarns << "No cap found" << llendl; + return; + } + LLUUID tid; + tid.generate(); + std::string url = cap + std::string("/category/") + parent_id.asString() + "?tid=" + tid.asString(); + LL_DEBUGS("Inventory") << "url: " << url << LL_ENDL; + LLCurl::ResponderPtr responder = this; + LLSD headers; + headers["Content-Type"] = "application/llsd+xml"; + F32 timeout = HTTP_REQUEST_EXPIRY_SECS; + command_func_type cmd = boost::bind(&LLHTTPClient::post, url, mNewInventory, responder, headers, timeout); + setCommandFunc(cmd); +} + SlamFolderCommand::SlamFolderCommand(const LLUUID& folder_id, const LLSD& contents, LLPointer<LLInventoryCallback> callback): mContents(contents), AISCommand(callback) diff --git a/indra/newview/llaisapi.h b/indra/newview/llaisapi.h index f4e219e9e6..5d31129a16 100755 --- a/indra/newview/llaisapi.h +++ b/indra/newview/llaisapi.h @@ -130,6 +130,15 @@ protected: /* virtual */ bool getResponseUUID(const LLSD& content, LLUUID& id); }; +class CreateInventoryCommand: public AISCommand +{ +public: + CreateInventoryCommand(const LLUUID& parent_id, const LLSD& new_inventory, LLPointer<LLInventoryCallback> callback); + +private: + LLSD mNewInventory; +}; + class AISUpdate { public: diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 33186a5a88..dc17da9009 100755 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -1110,6 +1110,7 @@ void link_inventory_array(const LLUUID& category, #endif LLInventoryObject::const_object_list_t::const_iterator it = baseobj_array.begin(); LLInventoryObject::const_object_list_t::const_iterator end = baseobj_array.end(); + LLSD links = LLSD::emptyArray(); for (; it != end; ++it) { const LLInventoryObject* baseobj = *it; @@ -1133,7 +1134,6 @@ void link_inventory_array(const LLUUID& category, continue; } - LLUUID transaction_id; LLInventoryType::EType inv_type = LLInventoryType::IT_NONE; LLAssetType::EType asset_type = LLAssetType::AT_NONE; std::string new_desc; @@ -1171,25 +1171,14 @@ void link_inventory_array(const LLUUID& category, } } - LLMessageSystem* msg = gMessageSystem; - msg->newMessageFast(_PREHASH_LinkInventoryItem); - msg->nextBlock(_PREHASH_AgentData); - { - msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - } - msg->nextBlock(_PREHASH_InventoryBlock); - { - msg->addU32Fast(_PREHASH_CallbackID, gInventoryCallbacks.registerCB(cb)); - msg->addUUIDFast(_PREHASH_FolderID, category); - msg->addUUIDFast(_PREHASH_TransactionID, transaction_id); - msg->addUUIDFast(_PREHASH_OldItemID, linkee_id); - msg->addS8Fast(_PREHASH_Type, (S8)asset_type); - msg->addS8Fast(_PREHASH_InvType, (S8)inv_type); - msg->addStringFast(_PREHASH_Name, baseobj->getName()); - msg->addStringFast(_PREHASH_Description, new_desc); - } - gAgent.sendReliableMessage(); + LLSD link = LLSD::emptyMap(); + link["linked_id"] = linkee_id; + link["type"] = (S8)asset_type; + link["inv_type"] = (S8)inv_type; + link["name"] = baseobj->getName(); + link["desc"] = new_desc; + links.append(link); + #ifndef LL_RELEASE_FOR_DOWNLOAD LL_DEBUGS("Inventory") << "Linking Object [ name:" << baseobj->getName() << " UUID:" << baseobj->getUUID() @@ -1197,6 +1186,42 @@ void link_inventory_array(const LLUUID& category, << " UUID:" << category << " ] " << LL_ENDL; #endif } + + bool ais_ran = false; + if (AISCommand::isAPIAvailable()) + { + LLSD new_inventory = LLSD::emptyMap(); + new_inventory["links"] = links; + LLPointer<AISCommand> cmd_ptr = new CreateInventoryCommand(category, new_inventory, cb); + ais_ran = cmd_ptr->run_command(); + } + + if (!ais_ran) + { + LLMessageSystem* msg = gMessageSystem; + for (LLSD::array_iterator iter = links.beginArray(); iter != links.endArray(); ++iter ) + { + msg->newMessageFast(_PREHASH_LinkInventoryItem); + msg->nextBlock(_PREHASH_AgentData); + { + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + } + msg->nextBlock(_PREHASH_InventoryBlock); + { + LLSD link = (*iter); + msg->addU32Fast(_PREHASH_CallbackID, gInventoryCallbacks.registerCB(cb)); + msg->addUUIDFast(_PREHASH_FolderID, category); + msg->addUUIDFast(_PREHASH_TransactionID, LLUUID::null); + msg->addUUIDFast(_PREHASH_OldItemID, link["linked_id"].asUUID()); + msg->addS8Fast(_PREHASH_Type, link["type"].asInteger()); + msg->addS8Fast(_PREHASH_InvType, link["inv_type"].asInteger()); + msg->addStringFast(_PREHASH_Name, link["name"].asString()); + msg->addStringFast(_PREHASH_Description, link["desc"].asString()); + } + gAgent.sendReliableMessage(); + } + } } -- cgit v1.2.3 From 6128cd9f705ca5565cafbe4b969c767b138cd1f6 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Mon, 12 Aug 2013 13:45:51 -0400 Subject: cat version debug statement --- indra/newview/llaisapi.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview') diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp index f8c9447b17..e710df4920 100755 --- a/indra/newview/llaisapi.cpp +++ b/indra/newview/llaisapi.cpp @@ -815,6 +815,7 @@ void AISUpdate::doUpdate() const LLUUID id = ucv_it->first; S32 version = ucv_it->second; LLViewerInventoryCategory *cat = gInventory.getCategory(id); + LL_DEBUGS("Inventory") << "cat version update " << cat->getName() << " to version " << cat->getVersion() << llendl; if (cat->getVersion() != version) { llwarns << "Possible version mismatch for category " << cat->getName() -- cgit v1.2.3 From 2157cf5e71f40ae4cc9eedaea6811a4c55718747 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Wed, 14 Aug 2013 14:25:22 -0400 Subject: SH-4422 FIX - fixed some recently introduced issues with link description fields, which among other things reduces the number of appearance requests sent. --- indra/newview/llappearancemgr.cpp | 14 +++++++------- indra/newview/llpaneleditwearable.cpp | 4 +--- indra/newview/llviewerinventory.cpp | 12 ++++-------- indra/newview/llviewerinventory.h | 5 ++--- 4 files changed, 14 insertions(+), 21 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index c4bc6f648f..939d817201 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1592,8 +1592,7 @@ void LLAppearanceMgr::shallowCopyCategoryContents(const LLUUID& src_id, const LL } if (!link_array.empty()) { - const bool resolve_links = true; - link_inventory_array(dst_id, link_array, cb, resolve_links); + link_inventory_array(dst_id, link_array, cb); } } @@ -2528,10 +2527,10 @@ void LLAppearanceMgr::addCOFItemLink(const LLInventoryItem *item, if (!linked_already) { - LLInventoryObject::const_object_list_t obj_array; - obj_array.push_back(LLConstPointer<LLInventoryObject>(vitem)); - const bool resolve_links = true; - link_inventory_array(getCOF(), obj_array, cb, resolve_links); + LLViewerInventoryItem *copy_item = new LLViewerInventoryItem; + copy_item->copyViewerItem(vitem); + copy_item->setDescription(description); + link_inventory_object(getCOF(), copy_item, cb); } } @@ -2735,7 +2734,8 @@ void LLAppearanceMgr::updateIsDirty() if (item1->getActualDescription() != item2->getActualDescription()) { LL_DEBUGS("Avatar") << "desc different " << item1->getActualDescription() - << " " << item2->getActualDescription() << llendl; + << " " << item2->getActualDescription() + << " names " << item1->getName() << " " << item2->getName() << llendl; } } mOutfitIsDirty = true; diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp index 0532370ff2..582998c973 100755 --- a/indra/newview/llpaneleditwearable.cpp +++ b/indra/newview/llpaneleditwearable.cpp @@ -1098,11 +1098,9 @@ void LLPanelEditWearable::saveChanges(bool force_save_as) LLInventoryObject::const_object_list_t obj_array; obj_array.push_back(LLConstPointer<LLInventoryObject>(link_item)); - const bool resolve_links = true; link_inventory_array(LLAppearanceMgr::instance().getCOF(), obj_array, - gAgentAvatarp->mEndCustomizeCallback, - resolve_links); + gAgentAvatarp->mEndCustomizeCallback); // Remove old link remove_inventory_item(link_item->getUUID(), gAgentAvatarp->mEndCustomizeCallback); } diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index dc17da9009..b623b23e1a 100755 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -1101,8 +1101,7 @@ void link_inventory_object(const LLUUID& category, // Create links to all listed inventory objects. void link_inventory_array(const LLUUID& category, LLInventoryObject::const_object_list_t& baseobj_array, - LLPointer<LLInventoryCallback> cb, - bool resolve_links /* = false */) + LLPointer<LLInventoryCallback> cb) { #ifndef LL_RELEASE_FOR_DOWNLOAD const LLViewerInventoryCategory *cat = gInventory.getCategory(category); @@ -1119,11 +1118,6 @@ void link_inventory_array(const LLUUID& category, llwarns << "attempt to link to unknown object" << llendl; continue; } - if (!resolve_links && baseobj->getIsLinkType()) - { - llwarns << "attempt to create a link to a link, linked-to-object's ID " << baseobj->getUUID() << llendl; - continue; - } if (!LLAssetType::lookupCanLink(baseobj->getType())) { @@ -1741,7 +1735,9 @@ void slam_inventory_folder(const LLUUID& folder_id, ++it) { const LLSD& item_contents = *it; - link_inventory_object(folder_id, item_contents["linked_id"].asUUID(), cb); + LLViewerInventoryItem *item = new LLViewerInventoryItem; + item->fromLLSD(item_contents); + link_inventory_object(folder_id, item, cb); } remove_folder_contents(folder_id,false,cb); } diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h index cc715ae21d..b647f4756a 100755 --- a/indra/newview/llviewerinventory.h +++ b/indra/newview/llviewerinventory.h @@ -359,9 +359,8 @@ void link_inventory_object(const LLUUID& category, const LLUUID& id, LLPointer<LLInventoryCallback> cb); void link_inventory_array(const LLUUID& category, - LLInventoryObject::const_object_list_t& baseobj_array, - LLPointer<LLInventoryCallback> cb, - bool resolve_links = false); + LLInventoryObject::const_object_list_t& baseobj_array, + LLPointer<LLInventoryCallback> cb); void move_inventory_item( const LLUUID& agent_id, -- cgit v1.2.3 From f669fdaf8128bb29c3aa372403ce3e276388b62e Mon Sep 17 00:00:00 2001 From: Nyx Linden <nyx@lindenlab.com> Date: Fri, 16 Aug 2013 19:47:58 -0400 Subject: merge cleanup - one file did not merge cleanly. --- indra/newview/llviewertexture.h | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index e99d52741d..b43243c3f2 100755 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -141,12 +141,15 @@ public: LLFrameTimer* getLastReferencedTimer() {return &mLastReferencedTimer ;} + S32 getFullWidth() const { return mFullWidth; } + S32 getFullHeight() const { return mFullHeight; } /*virtual*/ void setKnownDrawSize(S32 width, S32 height); - virtual void addFace(LLFace* facep) ; - virtual void removeFace(LLFace* facep) ; - S32 getNumFaces() const; - const ll_face_list_t* getFaceList() const {return &mFaceList;} + virtual void addFace(U32 channel, LLFace* facep) ; + virtual void removeFace(U32 channel, LLFace* facep) ; + S32 getTotalNumFaces() const; + S32 getNumFaces(U32 ch) const; + const ll_face_list_t* getFaceList(U32 channel) const {llassert(channel < LLRender::NUM_TEXTURE_CHANNELS); return &mFaceList[channel];} virtual void addVolume(LLVOVolume* volumep); virtual void removeVolume(LLVOVolume* volumep); @@ -183,8 +186,8 @@ protected: mutable F32 mAdditionalDecodePriority; // priority add to mDecodePriority. LLFrameTimer mLastReferencedTimer; - ll_face_list_t mFaceList ; //reverse pointer pointing to the faces using this image as texture - U32 mNumFaces ; + ll_face_list_t mFaceList[LLRender::NUM_TEXTURE_CHANNELS]; //reverse pointer pointing to the faces using this image as texture + U32 mNumFaces[LLRender::NUM_TEXTURE_CHANNELS]; LLFrameTimer mLastFaceListUpdateTimer ; ll_volume_list_t mVolumeList; @@ -453,7 +456,7 @@ protected: LLCore::HttpStatus mLastHttpGetStatus; // Result of the most recently completed http request for this texture. FTType mFTType; // What category of image is this - map tile, server bake, etc? - mutable BOOL mIsMissingAsset; // True if we know that there is no image asset with this image id in the database. + mutable S8 mIsMissingAsset; // True if we know that there is no image asset with this image id in the database. typedef std::list<LLLoadedCallbackEntry*> callback_list_t; S8 mLoadedCallbackDesiredDiscardLevel; @@ -500,6 +503,7 @@ public: static LLPointer<LLViewerFetchedTexture> sWhiteImagep; // Texture to show NOTHING (whiteness) static LLPointer<LLViewerFetchedTexture> sDefaultImagep; // "Default" texture for error cases, the only case of fetched texture which is generated in local. static LLPointer<LLViewerFetchedTexture> sSmokeImagep; // Old "Default" translucent texture + static LLPointer<LLViewerFetchedTexture> sFlatNormalImagep; // Flat normal map denoting no bumpiness on a surface }; // @@ -557,12 +561,12 @@ public: void addMediaToFace(LLFace* facep) ; void removeMediaFromFace(LLFace* facep) ; - /*virtual*/ void addFace(LLFace* facep) ; - /*virtual*/ void removeFace(LLFace* facep) ; + /*virtual*/ void addFace(U32 ch, LLFace* facep) ; + /*virtual*/ void removeFace(U32 ch, LLFace* facep) ; /*virtual*/ F32 getMaxVirtualSize() ; private: - void switchTexture(LLFace* facep) ; + void switchTexture(U32 ch, LLFace* facep) ; BOOL findFaces() ; void stopPlaying() ; -- cgit v1.2.3 From 0094c4299f6fb627c0a759374ede39450efdc8d0 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Mon, 19 Aug 2013 14:49:11 -0400 Subject: moved LLTrackPhaseWrapper to do its work in destructor --- indra/newview/llappearancemgr.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 939d817201..2e7ec0b2d5 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -467,13 +467,18 @@ public: // virtual void fire(const LLUUID& id) { - selfStopPhase(mTrackingPhase); if (mCB) { mCB->fire(id); } } + // virtual + ~LLTrackPhaseWrapper() + { + selfStopPhase(mTrackingPhase); + } + protected: std::string mTrackingPhase; LLPointer<LLInventoryCallback> mCB; -- cgit v1.2.3 From 3a0cd466f1182f5868dc21b951d78796542abd7d Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Thu, 29 Aug 2013 14:59:40 -0400 Subject: SH-4455 WIP - restrict use of LLWearableHoldingPattern metrics. When changing wearables, bail out if current wearables already match those requested. --- indra/newview/llagentwearables.cpp | 68 ++++++++++++++++++------ indra/newview/llagentwearables.h | 2 +- indra/newview/llappearancemgr.cpp | 106 +++++++++++++++++++++++-------------- indra/newview/llappearancemgr.h | 2 +- indra/newview/llwearablelist.cpp | 1 + 5 files changed, 121 insertions(+), 58 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index f3c9998a7d..326c584c32 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -1230,29 +1230,67 @@ void LLAgentWearables::removeWearableFinal(const LLWearableType::EType type, boo // Assumes existing wearables are not dirty. void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& items, - const LLDynamicArray< LLViewerWearable* >& wearables, - BOOL remove) + const LLDynamicArray< LLViewerWearable* >& wearables) { llinfos << "setWearableOutfit() start" << llendl; + S32 count = wearables.count(); + llassert(items.count() == count); + + // Check for whether outfit already matches the one requested (!) + S32 i; + + S32 matched = 0, mismatched = 0; + std::vector<S32> type_counts(LLWearableType::WT_COUNT,0); + for (i = 0; i < count; i++) + { + LLViewerWearable* new_wearable = wearables[i]; + LLPointer<LLInventoryItem> new_item = items[i]; + const LLWearableType::EType type = new_wearable->getType(); + S32 index = type_counts[type]; + LLViewerWearable *curr_wearable = dynamic_cast<LLViewerWearable*>(getWearable(type,index)); + if (new_wearable && curr_wearable && + new_wearable->getAssetID() == curr_wearable->getAssetID()) + { + matched++; + } + else + { + LL_DEBUGS("Avatar") << "mismatch, type " << type << " index " << index + << " names " << (curr_wearable ? curr_wearable->getName() : "NONE") << "," + << " names " << (new_wearable ? new_wearable->getName() : "NONE") << llendl; + mismatched++; + } + type_counts[type]++; + } + LL_DEBUGS("Avatar") << "matched " << matched << " mismatched " << mismatched << llendl; + for (S32 j=0; j<LLWearableType::WT_COUNT; j++) + { + LLWearableType::EType type = (LLWearableType::EType) j; + if (getWearableCount(type) != type_counts[j]) + { + LL_DEBUGS("Avatar") << "count mismatch for type " << j << " current " << getWearableCount(j) << " requested " << type_counts[j] << llendl; + mismatched++; + } + } + if (mismatched == 0) + { + LL_DEBUGS("Avatar") << "nothing to do" << llendl; + return; + } + + // TODO: Removed check for ensuring that teens don't remove undershirt and underwear. Handle later - if (remove) + // note: shirt is the first non-body part wearable item. Update if wearable order changes. + // This loop should remove all clothing, but not any body parts + for (S32 type = 0; type < (S32)LLWearableType::WT_COUNT; type++) { - // note: shirt is the first non-body part wearable item. Update if wearable order changes. - // This loop should remove all clothing, but not any body parts - for (S32 type = 0; type < (S32)LLWearableType::WT_COUNT; type++) + if (LLWearableType::getAssetType((LLWearableType::EType)type) == LLAssetType::AT_CLOTHING) { - if (LLWearableType::getAssetType((LLWearableType::EType)type) == LLAssetType::AT_CLOTHING) - { - removeWearable((LLWearableType::EType)type, true, 0); - } + removeWearable((LLWearableType::EType)type, true, 0); } } - S32 count = wearables.count(); - llassert(items.count() == count); - - S32 i; for (i = 0; i < count; i++) { LLViewerWearable* new_wearable = wearables[i]; @@ -1307,7 +1345,7 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it gAgentAvatarp->dumpAvatarTEs("setWearableOutfit"); - lldebugs << "setWearableOutfit() end" << llendl; + LL_DEBUGS("Avatar") << "setWearableOutfit() end" << llendl; } diff --git a/indra/newview/llagentwearables.h b/indra/newview/llagentwearables.h index 8a1b470e22..96fe4b80c0 100755 --- a/indra/newview/llagentwearables.h +++ b/indra/newview/llagentwearables.h @@ -108,7 +108,7 @@ private: /*virtual*/void wearableUpdated(LLWearable *wearable, BOOL removed); public: void setWearableItem(LLInventoryItem* new_item, LLViewerWearable* wearable, bool do_append = false); - void setWearableOutfit(const LLInventoryItem::item_array_t& items, const LLDynamicArray< LLViewerWearable* >& wearables, BOOL remove); + void setWearableOutfit(const LLInventoryItem::item_array_t& items, const LLDynamicArray< LLViewerWearable* >& wearables); void setWearableName(const LLUUID& item_id, const std::string& new_name); // *TODO: Move this into llappearance/LLWearableData ? void addLocalTextureObject(const LLWearableType::EType wearable_type, const LLAvatarAppearanceDefines::ETextureIndex texture_type, U32 wearable_index); diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 2e7ec0b2d5..eada358e8d 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -619,6 +619,7 @@ public: void handleLateArrivals(); void resetTime(F32 timeout); static S32 countActive() { return sActiveHoldingPatterns.size(); } + S32 index() { return mIndex; } private: found_list_t mFoundList; @@ -632,12 +633,15 @@ private: bool mFired; typedef std::set<LLWearableHoldingPattern*> type_set_hp; static type_set_hp sActiveHoldingPatterns; + static S32 sNextIndex; + S32 mIndex; bool mIsMostRecent; std::set<LLViewerWearable*> mLateArrivals; bool mIsAllComplete; }; LLWearableHoldingPattern::type_set_hp LLWearableHoldingPattern::sActiveHoldingPatterns; +S32 LLWearableHoldingPattern::sNextIndex = 0; LLWearableHoldingPattern::LLWearableHoldingPattern(): mResolved(0), @@ -645,10 +649,10 @@ LLWearableHoldingPattern::LLWearableHoldingPattern(): mIsMostRecent(true), mIsAllComplete(false) { - if (sActiveHoldingPatterns.size()>0) + if (countActive()>0) { llinfos << "Creating LLWearableHoldingPattern when " - << sActiveHoldingPatterns.size() + << countActive() << " other attempts are active." << " Flagging others as invalid." << llendl; @@ -660,7 +664,9 @@ LLWearableHoldingPattern::LLWearableHoldingPattern(): } } + mIndex = sNextIndex++; sActiveHoldingPatterns.insert(this); + LL_DEBUGS("Avatar") << "HP " << index() << " created" << llendl; selfStartPhase("holding_pattern"); } @@ -671,6 +677,7 @@ LLWearableHoldingPattern::~LLWearableHoldingPattern() { selfStopPhase("holding_pattern"); } + LL_DEBUGS("Avatar") << "HP " << index() << " deleted" << llendl; } bool LLWearableHoldingPattern::isMostRecent() @@ -718,7 +725,7 @@ void LLWearableHoldingPattern::checkMissingWearables() if (!isMostRecent()) { // runway why don't we actually skip here? - llwarns << self_av_string() << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; + llwarns << self_av_string() << "HP " << index() << " skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; } std::vector<S32> found_by_type(LLWearableType::WT_COUNT,0); @@ -736,7 +743,7 @@ void LLWearableHoldingPattern::checkMissingWearables() { if (requested_by_type[type] > found_by_type[type]) { - llwarns << self_av_string() << "got fewer wearables than requested, type " << type << ": requested " << requested_by_type[type] << ", found " << found_by_type[type] << llendl; + llwarns << self_av_string() << "HP " << index() << "got fewer wearables than requested, type " << type << ": requested " << requested_by_type[type] << ", found " << found_by_type[type] << llendl; } if (found_by_type[type] > 0) continue; @@ -753,13 +760,16 @@ void LLWearableHoldingPattern::checkMissingWearables() mTypesToRecover.insert(type); mTypesToLink.insert(type); recoverMissingWearable((LLWearableType::EType)type); - llwarns << self_av_string() << "need to replace " << type << llendl; + llwarns << self_av_string() << "HP " << index() << " need to replace wearable of type " << type << llendl; } } resetTime(60.0F); - selfStartPhase("get_missing_wearables"); + if (isMostRecent()) + { + selfStartPhase("get_missing_wearables"); + } if (!pollMissingWearables()) { doOnIdleRepeating(boost::bind(&LLWearableHoldingPattern::pollMissingWearables,this)); @@ -776,13 +786,13 @@ void LLWearableHoldingPattern::onAllComplete() if (!isMostRecent()) { // runway need to skip here? - llwarns << self_av_string() << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; + llwarns << self_av_string() << "HP " << index() << " skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; } // Activate all gestures in this folder if (mGestItems.count() > 0) { - LL_DEBUGS("Avatar") << self_av_string() << "Activating " << mGestItems.count() << " gestures" << LL_ENDL; + LL_DEBUGS("Avatar") << self_av_string() << "HP " << index() << " activating " << mGestItems.count() << " gestures" << LL_ENDL; LLGestureMgr::instance().activateGestures(mGestItems); @@ -799,13 +809,13 @@ void LLWearableHoldingPattern::onAllComplete() } // Update wearables. - LL_INFOS("Avatar") << self_av_string() << "Updating agent wearables with " << mResolved << " wearable items " << LL_ENDL; - LLAppearanceMgr::instance().updateAgentWearables(this, false); + LL_INFOS("Avatar") << self_av_string() << "HP " << index() << " updating agent wearables with " << mResolved << " wearable items " << LL_ENDL; + LLAppearanceMgr::instance().updateAgentWearables(this); // Update attachments to match those requested. if (isAgentAvatarValid()) { - LL_DEBUGS("Avatar") << self_av_string() << "Updating " << mObjItems.count() << " attachments" << LL_ENDL; + LL_DEBUGS("Avatar") << self_av_string() << "HP " << index() << " updating " << mObjItems.count() << " attachments" << LL_ENDL; LLAgentWearables::userUpdateAttachments(mObjItems); } @@ -823,12 +833,15 @@ void LLWearableHoldingPattern::onAllComplete() void LLWearableHoldingPattern::onFetchCompletion() { - selfStopPhase("get_wearables"); + if (isMostRecent()) + { + selfStopPhase("get_wearables"); + } if (!isMostRecent()) { // runway skip here? - llwarns << self_av_string() << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; + llwarns << self_av_string() << "HP " << index() << " skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; } checkMissingWearables(); @@ -840,7 +853,7 @@ bool LLWearableHoldingPattern::pollFetchCompletion() if (!isMostRecent()) { // runway skip here? - llwarns << self_av_string() << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; + llwarns << self_av_string() << "HP " << index() << " skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; } bool completed = isFetchCompleted(); @@ -849,14 +862,14 @@ bool LLWearableHoldingPattern::pollFetchCompletion() if (done) { - LL_INFOS("Avatar") << self_av_string() << "polling, done status: " << completed << " timed out " << timed_out + LL_INFOS("Avatar") << self_av_string() << "HP " << index() << " polling, done status: " << completed << " timed out " << timed_out << " elapsed " << mWaitTime.getElapsedTimeF32() << LL_ENDL; mFired = true; if (timed_out) { - llwarns << self_av_string() << "Exceeded max wait time for wearables, updating appearance based on what has arrived" << llendl; + llwarns << self_av_string() << "HP " << index() << " exceeded max wait time for wearables, updating appearance based on what has arrived" << llendl; } onFetchCompletion(); @@ -868,11 +881,11 @@ void recovered_item_link_cb(const LLUUID& item_id, LLWearableType::EType type, L { if (!holder->isMostRecent()) { - llwarns << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; + llwarns << "HP " << holder->index() << " skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; // runway skip here? } - llinfos << "Recovered item link for type " << type << llendl; + llinfos << "HP " << holder->index() << " recovered item link for type " << type << llendl; holder->eraseTypeToLink(type); // Add wearable to FoundData for actual wearing LLViewerInventoryItem *item = gInventory.getItem(item_id); @@ -896,12 +909,12 @@ void recovered_item_link_cb(const LLUUID& item_id, LLWearableType::EType type, L } else { - llwarns << self_av_string() << "inventory item not found for recovered wearable" << llendl; + llwarns << self_av_string() << "HP " << holder->index() << " inventory item not found for recovered wearable" << llendl; } } else { - llwarns << self_av_string() << "inventory link not found for recovered wearable" << llendl; + llwarns << self_av_string() << "HP " << holder->index() << " inventory link not found for recovered wearable" << llendl; } } @@ -910,10 +923,10 @@ void recovered_item_cb(const LLUUID& item_id, LLWearableType::EType type, LLView if (!holder->isMostRecent()) { // runway skip here? - llwarns << self_av_string() << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; + llwarns << self_av_string() << "HP " << holder->index() << " skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; } - LL_DEBUGS("Avatar") << self_av_string() << "Recovered item for type " << type << LL_ENDL; + LL_DEBUGS("Avatar") << self_av_string() << "HP " << holder->index() << " recovered item for type " << type << LL_ENDL; LLConstPointer<LLInventoryObject> itemp = gInventory.getItem(item_id); wearable->setItemID(item_id); holder->eraseTypeToRecover(type); @@ -931,13 +944,13 @@ void LLWearableHoldingPattern::recoverMissingWearable(LLWearableType::EType type if (!isMostRecent()) { // runway skip here? - llwarns << self_av_string() << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; + llwarns << self_av_string() << "HP " << index() << " skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; } // Try to recover by replacing missing wearable with a new one. LLNotificationsUtil::add("ReplacedMissingWearable"); - lldebugs << "Wearable " << LLWearableType::getTypeLabel(type) - << " could not be downloaded. Replaced inventory item with default wearable." << llendl; + LL_DEBUGS("Avatar") << "HP " << index() << " wearable " << LLWearableType::getTypeLabel(type) + << " could not be downloaded. Replaced inventory item with default wearable." << llendl; LLViewerWearable* wearable = LLWearableList::instance().createNewWearable(type, gAgentAvatarp); // Add a new one in the lost and found folder. @@ -970,7 +983,7 @@ void LLWearableHoldingPattern::clearCOFLinksForMissingWearables() if ((data.mWearableType < LLWearableType::WT_COUNT) && (!data.mWearable)) { // Wearable link that was never resolved; remove links to it from COF - LL_INFOS("Avatar") << self_av_string() << "removing link for unresolved item " << data.mItemID.asString() << LL_ENDL; + LL_INFOS("Avatar") << self_av_string() << "HP " << index() << " removing link for unresolved item " << data.mItemID.asString() << LL_ENDL; LLAppearanceMgr::instance().removeCOFItemLinks(data.mItemID); } } @@ -981,7 +994,7 @@ bool LLWearableHoldingPattern::pollMissingWearables() if (!isMostRecent()) { // runway skip here? - llwarns << self_av_string() << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; + llwarns << self_av_string() << "HP " << index() << " skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; } bool timed_out = isTimedOut(); @@ -990,7 +1003,7 @@ bool LLWearableHoldingPattern::pollMissingWearables() if (!done) { - LL_INFOS("Avatar") << self_av_string() << "polling missing wearables, waiting for items " << mTypesToRecover.size() + LL_INFOS("Avatar") << self_av_string() << "HP " << index() << " polling missing wearables, waiting for items " << mTypesToRecover.size() << " links " << mTypesToLink.size() << " wearables, timed out " << timed_out << " elapsed " << mWaitTime.getElapsedTimeF32() @@ -999,7 +1012,10 @@ bool LLWearableHoldingPattern::pollMissingWearables() if (done) { - selfStopPhase("get_missing_wearables"); + if (isMostRecent()) + { + selfStopPhase("get_missing_wearables"); + } gAgentAvatarp->debugWearablesLoaded(); @@ -1030,14 +1046,14 @@ void LLWearableHoldingPattern::handleLateArrivals() } if (!isMostRecent()) { - llwarns << self_av_string() << "Late arrivals not handled - outfit change no longer valid" << llendl; + llwarns << self_av_string() << "HP " << index() << " late arrivals not handled - outfit change no longer valid" << llendl; } if (!mIsAllComplete) { - llwarns << self_av_string() << "Late arrivals not handled - in middle of missing wearables processing" << llendl; + llwarns << self_av_string() << "HP " << index() << " late arrivals not handled - in middle of missing wearables processing" << llendl; } - LL_INFOS("Avatar") << self_av_string() << "Need to handle " << mLateArrivals.size() << " late arriving wearables" << LL_ENDL; + LL_INFOS("Avatar") << self_av_string() << "HP " << index() << " need to handle " << mLateArrivals.size() << " late arriving wearables" << LL_ENDL; // Update mFoundList using late-arriving wearables. std::set<LLWearableType::EType> replaced_types; @@ -1100,7 +1116,7 @@ void LLWearableHoldingPattern::handleLateArrivals() mLateArrivals.clear(); // Update appearance based on mFoundList - LLAppearanceMgr::instance().updateAgentWearables(this, false); + LLAppearanceMgr::instance().updateAgentWearables(this); } void LLWearableHoldingPattern::resetTime(F32 timeout) @@ -1113,19 +1129,19 @@ void LLWearableHoldingPattern::onWearableAssetFetch(LLViewerWearable *wearable) { if (!isMostRecent()) { - llwarns << self_av_string() << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; + llwarns << self_av_string() << "HP " << index() << " skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; } mResolved += 1; // just counting callbacks, not successes. - LL_DEBUGS("Avatar") << self_av_string() << "resolved " << mResolved << "/" << getFoundList().size() << LL_ENDL; + LL_DEBUGS("Avatar") << self_av_string() << "HP " << index() << " resolved " << mResolved << "/" << getFoundList().size() << LL_ENDL; if (!wearable) { - llwarns << self_av_string() << "no wearable found" << llendl; + llwarns << self_av_string() << "HP " << index() << " " << "no wearable found" << llendl; } if (mFired) { - llwarns << self_av_string() << "called after holder fired" << llendl; + llwarns << self_av_string() << "HP " << index() << " " << "called after holder fired" << llendl; if (wearable) { mLateArrivals.insert(wearable); @@ -1151,7 +1167,9 @@ void LLWearableHoldingPattern::onWearableAssetFetch(LLViewerWearable *wearable) // Failing this means inventory or asset server are corrupted in a way we don't handle. if ((data.mWearableType >= LLWearableType::WT_COUNT) || (wearable->getType() != data.mWearableType)) { - llwarns << self_av_string() << "recovered wearable but type invalid. inventory wearable type: " << data.mWearableType << " asset wearable type: " << wearable->getType() << llendl; + llwarns << self_av_string() << "HP " << index() << " " + << "recovered wearable but type invalid. inventory wearable type: " + << data.mWearableType << " asset wearable type: " << wearable->getType() << llendl; break; } @@ -1898,9 +1916,10 @@ void LLAppearanceMgr::createBaseOutfitLink(const LLUUID& category, LLPointer<LLI updatePanelOutfitName(new_outfit_name); } -void LLAppearanceMgr::updateAgentWearables(LLWearableHoldingPattern* holder, bool append) +void LLAppearanceMgr::updateAgentWearables(LLWearableHoldingPattern* holder) { - lldebugs << "updateAgentWearables()" << llendl; + LL_DEBUGS("Avatar") << "starts" << llendl; + LLTimer timer; LLInventoryItem::item_array_t items; LLDynamicArray< LLViewerWearable* > wearables; @@ -1926,8 +1945,9 @@ void LLAppearanceMgr::updateAgentWearables(LLWearableHoldingPattern* holder, boo if(wearables.count() > 0) { - gAgentWearables.setWearableOutfit(items, wearables, !append); + gAgentWearables.setWearableOutfit(items, wearables); } + LL_DEBUGS("Avatar") << "ends, elapsed " << timer.getElapsedTimeF32() << llendl; } S32 LLAppearanceMgr::countActiveHoldingPatterns() @@ -2114,6 +2134,8 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool enforce_item_restrictions, sortItemsByActualDescription(wear_items); + LL_DEBUGS("Avatar") << "HP block starts" << llendl; + LLTimer hp_block_timer; LLWearableHoldingPattern* holder = new LLWearableHoldingPattern; holder->setObjItems(obj_items); @@ -2188,6 +2210,8 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool enforce_item_restrictions, doOnIdleRepeating(boost::bind(&LLWearableHoldingPattern::pollFetchCompletion,holder)); } post_update_func(); + + LL_DEBUGS("Avatar") << "HP block ends, elapsed " << hp_block_timer.getElapsedTimeF32() << llendl; } void LLAppearanceMgr::getDescendentsOfAssetType(const LLUUID& category, diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index 346577ab9a..3a90c3840a 100755 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -126,7 +126,7 @@ public: void purgeBaseOutfitLink(const LLUUID& category, LLPointer<LLInventoryCallback> cb = NULL); void createBaseOutfitLink(const LLUUID& category, LLPointer<LLInventoryCallback> link_waiter); - void updateAgentWearables(LLWearableHoldingPattern* holder, bool append); + void updateAgentWearables(LLWearableHoldingPattern* holder); S32 countActiveHoldingPatterns(); diff --git a/indra/newview/llwearablelist.cpp b/indra/newview/llwearablelist.cpp index ef1a953f59..49b3c27ea0 100755 --- a/indra/newview/llwearablelist.cpp +++ b/indra/newview/llwearablelist.cpp @@ -81,6 +81,7 @@ void LLWearableList::getAsset(const LLAssetID& assetID, const std::string& weara LLViewerWearable* instance = get_if_there(mList, assetID, (LLViewerWearable*)NULL ); if( instance ) { + LL_DEBUGS("Avatar") << "wearable " << assetID << " found in LLWearableList" << llendl; asset_arrived_callback( instance, userdata ); } else -- cgit v1.2.3 From f426f8a694429209ca0eeea9156173e8a12ddc46 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Thu, 29 Aug 2013 17:08:30 -0400 Subject: SH-4455 WIP - versioned some metrics whose usage has changed, added name and item id checks in setWearableOutfit() --- indra/newview/llagentwearables.cpp | 52 +++++++++++++++++++++++++------------- indra/newview/llappearancemgr.cpp | 8 +++--- 2 files changed, 39 insertions(+), 21 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 326c584c32..8501436b5b 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -1237,31 +1237,49 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it S32 count = wearables.count(); llassert(items.count() == count); - // Check for whether outfit already matches the one requested (!) - S32 i; - + // Check for whether outfit already matches the one requested S32 matched = 0, mismatched = 0; - std::vector<S32> type_counts(LLWearableType::WT_COUNT,0); - for (i = 0; i < count; i++) + const S32 arr_size = LLWearableType::WT_COUNT; + S32 type_counts[arr_size]; + std::fill(type_counts,type_counts+arr_size,0); + for (S32 i = 0; i < count; i++) { LLViewerWearable* new_wearable = wearables[i]; LLPointer<LLInventoryItem> new_item = items[i]; + const LLWearableType::EType type = new_wearable->getType(); - S32 index = type_counts[type]; - LLViewerWearable *curr_wearable = dynamic_cast<LLViewerWearable*>(getWearable(type,index)); - if (new_wearable && curr_wearable && - new_wearable->getAssetID() == curr_wearable->getAssetID()) + if (type < 0 || type>=LLWearableType::WT_COUNT) { - matched++; + llwarns << "invalid type " << type << llendl; + mismatched++; + continue; } - else + S32 index = type_counts[type]; + type_counts[type]++; + + LLViewerWearable *curr_wearable = dynamic_cast<LLViewerWearable*>(getWearable(type,index)); + if (!new_wearable || !curr_wearable || + new_wearable->getAssetID() != curr_wearable->getAssetID()) { LL_DEBUGS("Avatar") << "mismatch, type " << type << " index " << index << " names " << (curr_wearable ? curr_wearable->getName() : "NONE") << "," << " names " << (new_wearable ? new_wearable->getName() : "NONE") << llendl; mismatched++; + continue; } - type_counts[type]++; + + if (curr_wearable->getName() != new_item->getName() || + curr_wearable->getItemID() != new_item->getUUID()) + { + LL_DEBUGS("Avatar") << "mismatch on name or inventory id, names " + << curr_wearable->getName() << " vs " << new_item->getName() + << " item ids " << curr_wearable->getItemID() << " vs " << new_item->getUUID() + << llendl; + mismatched++; + continue; + } + // If we got here, everything matches. + matched++; } LL_DEBUGS("Avatar") << "matched " << matched << " mismatched " << mismatched << llendl; for (S32 j=0; j<LLWearableType::WT_COUNT; j++) @@ -1275,7 +1293,7 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it } if (mismatched == 0) { - LL_DEBUGS("Avatar") << "nothing to do" << llendl; + LL_DEBUGS("Avatar") << "no changes, bailing out" << llendl; return; } @@ -1283,15 +1301,15 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it // TODO: Removed check for ensuring that teens don't remove undershirt and underwear. Handle later // note: shirt is the first non-body part wearable item. Update if wearable order changes. // This loop should remove all clothing, but not any body parts - for (S32 type = 0; type < (S32)LLWearableType::WT_COUNT; type++) + for (S32 j = 0; j < (S32)LLWearableType::WT_COUNT; j++) { - if (LLWearableType::getAssetType((LLWearableType::EType)type) == LLAssetType::AT_CLOTHING) + if (LLWearableType::getAssetType((LLWearableType::EType)j) == LLAssetType::AT_CLOTHING) { - removeWearable((LLWearableType::EType)type, true, 0); + removeWearable((LLWearableType::EType)j, true, 0); } } - for (i = 0; i < count; i++) + for (S32 i = 0; i < count; i++) { LLViewerWearable* new_wearable = wearables[i]; LLPointer<LLInventoryItem> new_item = items[i]; diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index eada358e8d..7fbe84312e 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -768,7 +768,7 @@ void LLWearableHoldingPattern::checkMissingWearables() if (isMostRecent()) { - selfStartPhase("get_missing_wearables"); + selfStartPhase("get_missing_wearables_2"); } if (!pollMissingWearables()) { @@ -835,7 +835,7 @@ void LLWearableHoldingPattern::onFetchCompletion() { if (isMostRecent()) { - selfStopPhase("get_wearables"); + selfStopPhase("get_wearables_2"); } if (!isMostRecent()) @@ -1014,7 +1014,7 @@ bool LLWearableHoldingPattern::pollMissingWearables() { if (isMostRecent()) { - selfStopPhase("get_missing_wearables"); + selfStopPhase("get_missing_wearables_2"); } gAgentAvatarp->debugWearablesLoaded(); @@ -2185,7 +2185,7 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool enforce_item_restrictions, } } - selfStartPhase("get_wearables"); + selfStartPhase("get_wearables_2"); for (LLWearableHoldingPattern::found_list_t::iterator it = holder->getFoundList().begin(); it != holder->getFoundList().end(); ++it) -- cgit v1.2.3 From 497e84202e169356e66fc91cd8f74b26b34b0c56 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Fri, 30 Aug 2013 11:14:17 -0400 Subject: SH-4456 FIX - added info to metrics for viewer version tags. --- indra/newview/llvoavatarself.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index a710c95233..ac59aa0907 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -63,6 +63,7 @@ #include "llsdutil.h" #include "llstartup.h" #include "llsdserialize.h" +#include "llversioninfo.h" #if LL_MSVC // disable boost::lexical_cast warning @@ -2373,11 +2374,29 @@ LLSD summarize_by_buckets(std::vector<LLSD> in_records, return result; } +// Valid characters for tsdb are alphanumeric, _-./. Others must be cleaned out. +void sanitize_for_tsdb_tag(std::string& s) +{ + for (std::string::iterator it = s.begin(); it != s.end(); ++it) + { + if (std::isalnum(*it) || *it == '.' || *it == '_' || *it == '-' || *it == '/') + { + continue; + } + *it = '_'; + } +} + void LLVOAvatarSelf::sendViewerAppearanceChangeMetrics() { static volatile bool reporting_started(false); static volatile S32 report_sequence(0); + std::string viewer_version_channel = LLVersionInfo::getChannel(); + sanitize_for_tsdb_tag(viewer_version_channel); + std::string viewer_version_short = LLVersionInfo::getShortVersion(); + std::string viewer_version_build = llformat("%d", LLVersionInfo::getBuild()); + LLSD msg; // = metricsData(); msg["message"] = "ViewerAppearanceChangeMetrics"; msg["session_id"] = gAgentSessionID; @@ -2386,6 +2405,9 @@ void LLVOAvatarSelf::sendViewerAppearanceChangeMetrics() msg["initial"] = !reporting_started; msg["break"] = false; msg["duration"] = mTimeSinceLastRezMessage.getElapsedTimeF32(); + msg["viewer_version_channel"] = viewer_version_channel; + msg["viewer_version_short"] = viewer_version_short; + msg["viewer_version_build"] = viewer_version_build; // Status of our own rezzing. msg["rez_status"] = LLVOAvatar::rezStatusToString(getRezzedStatus()); -- cgit v1.2.3 From 726a26d4bc3b66dafbc8bdfe238c52a0eff23a74 Mon Sep 17 00:00:00 2001 From: Nyx Linden <nyx@lindenlab.com> Date: Fri, 30 Aug 2013 19:05:23 -0400 Subject: SH-4458 FIX "Pant flares rendering as tights after SSA rollout" probably not related to SSA rollout, but we were not triggering the callbacks for baked texture loads, since the avatar object was adding paused callbacks to the callback list without properly setting the flag to indicate paused callbacks. --- indra/newview/llvoavatar.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 7909570883..0bd51d9c15 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -6328,6 +6328,9 @@ void LLVOAvatar::updateMeshTextures() } baked_img->setLoadedCallback(onBakedTextureLoaded, SWITCH_TO_BAKED_DISCARD, FALSE, FALSE, new LLUUID( mID ), src_callback_list, paused ); + + // this could add paused texture callbacks + mLoadedCallbacksPaused |= paused; } } else if (layerset && isUsingLocalAppearance()) @@ -6677,6 +6680,9 @@ void LLVOAvatar::onFirstTEMessageReceived() LL_DEBUGS("Avatar") << avString() << "layer_baked, setting onInitialBakedTextureLoaded as callback" << LL_ENDL; image->setLoadedCallback( onInitialBakedTextureLoaded, MAX_DISCARD_LEVEL, FALSE, FALSE, new LLUUID( mID ), src_callback_list, paused ); + + // this could add paused texture callbacks + mLoadedCallbacksPaused |= paused; } } -- cgit v1.2.3 From f878b032e8c96c4e4ae752864d7641bba2ea4102 Mon Sep 17 00:00:00 2001 From: Don Kjer <don@lindenlab.com> Date: Mon, 9 Sep 2013 13:13:22 -0700 Subject: Using transaction_id instead of raw asset_id during aisv3 patch --- indra/newview/llaisapi.cpp | 4 ++-- indra/newview/llaisapi.h | 2 +- indra/newview/llviewerinventory.cpp | 6 ++++++ 3 files changed, 9 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp index 85b304d90e..6f6e6ebb35 100755 --- a/indra/newview/llaisapi.cpp +++ b/indra/newview/llaisapi.cpp @@ -243,7 +243,7 @@ UpdateItemCommand::UpdateItemCommand(const LLUUID& item_id, setCommandFunc(cmd); } -UpdateCategoryCommand::UpdateCategoryCommand(const LLUUID& item_id, +UpdateCategoryCommand::UpdateCategoryCommand(const LLUUID& cat_id, const LLSD& updates, LLPointer<LLInventoryCallback> callback): mUpdates(updates), @@ -255,7 +255,7 @@ UpdateCategoryCommand::UpdateCategoryCommand(const LLUUID& item_id, llwarns << "No cap found" << llendl; return; } - std::string url = cap + std::string("/category/") + item_id.asString(); + std::string url = cap + std::string("/category/") + cat_id.asString(); LL_DEBUGS("Inventory") << "url: " << url << LL_ENDL; LLCurl::ResponderPtr responder = this; LLSD headers; diff --git a/indra/newview/llaisapi.h b/indra/newview/llaisapi.h index 5d31129a16..f3a662c280 100755 --- a/indra/newview/llaisapi.h +++ b/indra/newview/llaisapi.h @@ -105,7 +105,7 @@ private: class UpdateCategoryCommand: public AISCommand { public: - UpdateCategoryCommand(const LLUUID& item_id, + UpdateCategoryCommand(const LLUUID& cat_id, const LLSD& updates, LLPointer<LLInventoryCallback> callback); private: diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index b623b23e1a..ede6eb8490 100755 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -1253,6 +1253,12 @@ void update_inventory_item( if (AISCommand::isAPIAvailable()) { LLSD updates = update_item->asLLSD(); + // Replace asset_id with transaction_id (hash_id) + if (updates.has("asset_id")) + { + updates.erase("asset_id"); + updates["hash_id"] = update_item->getTransactionID(); + } LLPointer<AISCommand> cmd_ptr = new UpdateItemCommand(item_id, updates, cb); ais_ran = cmd_ptr->run_command(); } -- cgit v1.2.3 From 3a44c5c2a3e04ed8e7174bedb5753d29e6581019 Mon Sep 17 00:00:00 2001 From: Don Kjer <don@lindenlab.com> Date: Tue, 10 Sep 2013 14:58:40 -0700 Subject: Fix for SH-4470 when modifying (no copy) or (no transfer) wearables. --- indra/newview/llviewerinventory.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index ede6eb8490..b6a5534815 100755 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -1253,12 +1253,17 @@ void update_inventory_item( if (AISCommand::isAPIAvailable()) { LLSD updates = update_item->asLLSD(); - // Replace asset_id with transaction_id (hash_id) + // Replace asset_id and/or shadow_id with transaction_id (hash_id) if (updates.has("asset_id")) { updates.erase("asset_id"); updates["hash_id"] = update_item->getTransactionID(); } + if (updates.has("shadow_id")) + { + updates.erase("shadow_id"); + updates["hash_id"] = update_item->getTransactionID(); + } LLPointer<AISCommand> cmd_ptr = new UpdateItemCommand(item_id, updates, cb); ais_ran = cmd_ptr->run_command(); } -- cgit v1.2.3 From dad3090afcd56d1122ca5d6016001bc5226de4da Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Wed, 11 Sep 2013 10:45:14 -0400 Subject: SH-4422 WIP - avoid redundant calls to updateAppearanceFromCOF() if rezzing an attachment that's already linked in COF --- indra/newview/llappearancemgr.cpp | 13 +++++++++++-- indra/newview/llappearancemgr.h | 1 + 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 7fbe84312e..359d5aaa5c 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -2590,6 +2590,12 @@ LLInventoryModel::item_array_t LLAppearanceMgr::findCOFItemLinks(const LLUUID& i return result; } +bool LLAppearanceMgr::isLinkedInCOF(const LLUUID& item_id) +{ + LLInventoryModel::item_array_t links = LLAppearanceMgr::instance().findCOFItemLinks(item_id); + return links.size() > 0; +} + void LLAppearanceMgr::removeAllClothesFromAvatar() { // Fetch worn clothes (i.e. the ones in COF). @@ -3799,8 +3805,11 @@ void LLAppearanceMgr::registerAttachment(const LLUUID& item_id) // we have to pass do_update = true to call LLAppearanceMgr::updateAppearanceFromCOF. // it will trigger gAgentWariables.notifyLoadingFinished() // But it is not acceptable solution. See EXT-7777 - LLPointer<LLInventoryCallback> cb = new LLUpdateAppearanceOnDestroy(); - LLAppearanceMgr::addCOFItemLink(item_id, cb); // Add COF link for item. + if (!isLinkedInCOF(item_id)) + { + LLPointer<LLInventoryCallback> cb = new LLUpdateAppearanceOnDestroy(); + LLAppearanceMgr::addCOFItemLink(item_id, cb); // Add COF link for item. + } } else { diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index 3a90c3840a..2a882fd977 100755 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -145,6 +145,7 @@ public: // Find COF entries referencing the given item. LLInventoryModel::item_array_t findCOFItemLinks(const LLUUID& item_id); + bool isLinkedInCOF(const LLUUID& item_id); // Remove COF entries void removeCOFItemLinks(const LLUUID& item_id, LLPointer<LLInventoryCallback> cb = NULL); -- cgit v1.2.3 From 25b078f9688a42d3ef01c63ebb9d9dcc9844df21 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Fri, 13 Sep 2013 11:18:28 -0400 Subject: log spam cleanup --- indra/newview/llmeshrepository.cpp | 2 +- indra/newview/llviewerstats.cpp | 8 ++++---- indra/newview/llvoavatar.cpp | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index a888445060..6bdc99ad5e 100755 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -1930,8 +1930,8 @@ void LLMeshLODResponder::completedRaw(const LLChannelDescriptors& channels, } else { - llassert(status == HTTP_INTERNAL_ERROR || status == HTTP_SERVICE_UNAVAILABLE); //intentionally trigger a breakpoint llwarns << "Unhandled status " << dumpResponse() << llendl; + llassert(status == HTTP_INTERNAL_ERROR || status == HTTP_SERVICE_UNAVAILABLE); //intentionally trigger a breakpoint } return; } diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index 68633fba6e..f0c4d4ef3d 100755 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -750,12 +750,12 @@ void LLViewerStats::PhaseMap::startPhase(const std::string& phase_name) { LLTimer& timer = getPhaseTimer(phase_name); timer.start(); - LL_DEBUGS("Avatar") << "startPhase " << phase_name << llendl; + //LL_DEBUGS("Avatar") << "startPhase " << phase_name << llendl; } void LLViewerStats::PhaseMap::clearPhases() { - LL_DEBUGS("Avatar") << "clearPhases" << llendl; + //LL_DEBUGS("Avatar") << "clearPhases" << llendl; mPhaseMap.clear(); } @@ -822,11 +822,11 @@ bool LLViewerStats::PhaseMap::getPhaseValues(const std::string& phase_name, F32& found = true; elapsed = iter->second.getElapsedTimeF32(); completed = !iter->second.getStarted(); - LL_DEBUGS("Avatar") << " phase_name " << phase_name << " elapsed " << elapsed << " completed " << completed << " timer addr " << (S32)(&iter->second) << llendl; + //LL_DEBUGS("Avatar") << " phase_name " << phase_name << " elapsed " << elapsed << " completed " << completed << " timer addr " << (S32)(&iter->second) << llendl; } else { - LL_DEBUGS("Avatar") << " phase_name " << phase_name << " NOT FOUND" << llendl; + //LL_DEBUGS("Avatar") << " phase_name " << phase_name << " NOT FOUND" << llendl; } return found; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 0bd51d9c15..93247a3625 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -717,7 +717,7 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, const BOOL needsSendToSim = false; // currently, this HUD effect doesn't need to pack and unpack data to do its job mVoiceVisualizer = ( LLVoiceVisualizer *)LLHUDManager::getInstance()->createViewerEffect( LLHUDObject::LL_HUD_EFFECT_VOICE_VISUALIZER, needsSendToSim ); - lldebugs << "LLVOAvatar Constructor (0x" << this << ") id:" << mID << llendl; + LL_DEBUGS("Avatar") << "LLVOAvatar Constructor (0x" << this << ") id:" << mID << llendl; mPelvisp = NULL; @@ -813,7 +813,7 @@ LLVOAvatar::~LLVOAvatar() logPendingPhases(); - lldebugs << "LLVOAvatar Destructor (0x" << this << ") id:" << mID << llendl; + LL_DEBUGS("Avatar") << "LLVOAvatar Destructor (0x" << this << ") id:" << mID << llendl; std::for_each(mAttachmentPoints.begin(), mAttachmentPoints.end(), DeletePairedPointer()); mAttachmentPoints.clear(); @@ -825,7 +825,7 @@ LLVOAvatar::~LLVOAvatar() getPhases().clearPhases(); - lldebugs << "LLVOAvatar Destructor end" << llendl; + LL_DEBUGS("Avatar") << "LLVOAvatar Destructor end" << llendl; } void LLVOAvatar::markDead() -- cgit v1.2.3 From c2ddc68afe0d9f122ee846ec1de1b4394f04998f Mon Sep 17 00:00:00 2001 From: Don Kjer <don@lindenlab.com> Date: Tue, 17 Sep 2013 22:30:02 -0700 Subject: Updating AISv3 api to match recent changes --- indra/newview/llaisapi.cpp | 60 ++++++++++++++++++++++++++++++++-------------- indra/newview/llaisapi.h | 6 +++-- 2 files changed, 46 insertions(+), 20 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp index 6f6e6ebb35..14978662f6 100755 --- a/indra/newview/llaisapi.cpp +++ b/indra/newview/llaisapi.cpp @@ -602,29 +602,37 @@ void AISUpdate::parseCategory(const LLSD& category_map) void AISUpdate::parseDescendentCount(const LLUUID& category_id, const LLSD& embedded) { // We can only determine true descendent count if this contains all descendent types. - if (embedded.has("category") && - embedded.has("link") && - embedded.has("item")) + if (embedded.has("categories") && + embedded.has("links") && + embedded.has("items")) { - mCatDescendentsKnown[category_id] = embedded["category"].size(); - mCatDescendentsKnown[category_id] += embedded["link"].size(); - mCatDescendentsKnown[category_id] += embedded["item"].size(); + mCatDescendentsKnown[category_id] = embedded["categories"].size(); + mCatDescendentsKnown[category_id] += embedded["links"].size(); + mCatDescendentsKnown[category_id] += embedded["items"].size(); } } void AISUpdate::parseEmbedded(const LLSD& embedded) { - if (embedded.has("link")) + if (embedded.has("links")) // _embedded in a category { - parseEmbeddedLinks(embedded["link"]); + parseEmbeddedLinks(embedded["links"]); } - if (embedded.has("item")) + if (embedded.has("items")) // _embedded in a category { - parseEmbeddedItems(embedded["item"]); + parseEmbeddedItems(embedded["items"]); } - if (embedded.has("category")) + if (embedded.has("item")) // _embedded in a link { - parseEmbeddedCategories(embedded["category"]); + parseEmbeddedItem(embedded["item"]); + } + if (embedded.has("categories")) // _embedded in a category + { + parseEmbeddedCategories(embedded["categories"]); + } + if (embedded.has("category")) // _embedded in a link + { + parseEmbeddedCategory(embedded["category"]); } } @@ -660,18 +668,21 @@ void AISUpdate::parseEmbeddedLinks(const LLSD& links) } } -void AISUpdate::parseEmbeddedItems(const LLSD& items) +void AISUpdate::parseEmbeddedItem(const LLSD& item) { - // Special case: this may be a single item (_embedded in a link) - if (items.has("item_id")) + // a single item (_embedded in a link) + if (item.has("item_id")) { - if (mItemIds.end() != mItemIds.find(items["item_id"].asUUID())) + if (mItemIds.end() != mItemIds.find(item["item_id"].asUUID())) { - parseContent(items); + parseItem(item); } - return; } +} +void AISUpdate::parseEmbeddedItems(const LLSD& items) +{ + // a map of items (_embedded in a category) for(LLSD::map_const_iterator itemit = items.beginMap(), itemend = items.endMap(); itemit != itemend; ++itemit) @@ -689,8 +700,21 @@ void AISUpdate::parseEmbeddedItems(const LLSD& items) } } +void AISUpdate::parseEmbeddedCategory(const LLSD& category) +{ + // a single category (_embedded in a link) + if (category.has("category_id")) + { + if (mCategoryIds.end() != mCategoryIds.find(category["category_id"].asUUID())) + { + parseCategory(category); + } + } +} + void AISUpdate::parseEmbeddedCategories(const LLSD& categories) { + // a map of categories (_embedded in a category) for(LLSD::map_const_iterator categoryit = categories.beginMap(), categoryend = categories.endMap(); categoryit != categoryend; ++categoryit) diff --git a/indra/newview/llaisapi.h b/indra/newview/llaisapi.h index f3a662c280..5a2ec94af9 100755 --- a/indra/newview/llaisapi.h +++ b/indra/newview/llaisapi.h @@ -153,8 +153,10 @@ public: void parseDescendentCount(const LLUUID& category_id, const LLSD& embedded); void parseEmbedded(const LLSD& embedded); void parseEmbeddedLinks(const LLSD& links); - void parseEmbeddedItems(const LLSD& links); - void parseEmbeddedCategories(const LLSD& links); + void parseEmbeddedItems(const LLSD& items); + void parseEmbeddedCategories(const LLSD& categories); + void parseEmbeddedItem(const LLSD& item); + void parseEmbeddedCategory(const LLSD& category); void doUpdate(); private: void clearParseResults(); -- cgit v1.2.3 From 36bb33b12ab090e2acbc7e00039cdff682882fa4 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Wed, 18 Sep 2013 17:03:34 -0400 Subject: sunshine cleanup annotations --- indra/newview/llagent.cpp | 2 ++ indra/newview/llagent.h | 2 ++ indra/newview/llagentwearables.cpp | 1 + indra/newview/llagentwearables.h | 1 + indra/newview/llassetuploadresponders.h | 1 + indra/newview/llviewertexlayer.cpp | 1 + indra/newview/llviewertexlayer.h | 17 +++++++++++++++++ indra/newview/llviewertexture.cpp | 2 ++ indra/newview/llvoavatar.cpp | 6 ++++++ indra/newview/llvoavatar.h | 2 ++ indra/newview/llvoavatarself.cpp | 10 ++++++++++ indra/newview/llvoavatarself.h | 2 ++ 12 files changed, 47 insertions(+) mode change 100644 => 100755 indra/newview/llviewertexlayer.cpp mode change 100644 => 100755 indra/newview/llviewertexlayer.h (limited to 'indra/newview') 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) diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index f5f26f69d8..3681b81afa 100755 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -844,6 +844,7 @@ private: public: void sendMessage(); // Send message to this agent's region void sendReliableMessage(); + // SUNSHINE CLEANUP dead code void dumpSentAppearance(const std::string& dump_prefix); void sendAgentSetAppearance(); void sendAgentDataUpdateRequest(); @@ -859,6 +860,7 @@ public: static void processAgentGroupDataUpdate(LLMessageSystem *msg, void **); static void processAgentDropGroup(LLMessageSystem *msg, void **); static void processScriptControlChange(LLMessageSystem *msg, void **); + // SUNSHINE CLEANUP dead code? static void processAgentCachedTextureResponse(LLMessageSystem *mesgsys, void **user_data); /** Messaging diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 8501436b5b..0bb126ffd1 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -1488,6 +1488,7 @@ void LLAgentWearables::setWearableFinal(LLInventoryItem* new_item, LLViewerWeara updateServer(); } +// SUNSHINE CLEANUP dead? void LLAgentWearables::queryWearableCache() { if (!areWearablesLoaded() || (gAgent.getRegion() && gAgent.getRegion()->getCentralBakeVersion())) diff --git a/indra/newview/llagentwearables.h b/indra/newview/llagentwearables.h index 96fe4b80c0..fd9f6f74a1 100755 --- a/indra/newview/llagentwearables.h +++ b/indra/newview/llagentwearables.h @@ -158,6 +158,7 @@ protected: //-------------------------------------------------------------------- public: // Processes the initial wearables update message (if necessary, since the outfit folder makes it redundant) + // SUNSHINE CLEANUP - should be able to remove dependency on this. static void processAgentInitialWearablesUpdate(LLMessageSystem* mesgsys, void** user_data); protected: diff --git a/indra/newview/llassetuploadresponders.h b/indra/newview/llassetuploadresponders.h index abfdc4ca77..7c48f2f06b 100755 --- a/indra/newview/llassetuploadresponders.h +++ b/indra/newview/llassetuploadresponders.h @@ -116,6 +116,7 @@ private: Impl* mImpl; }; +// SUNSHINE CLEANUP no upload bakes, remove class. struct LLBakedUploadData; class LLSendTexLayerResponder : public LLAssetUploadResponder { diff --git a/indra/newview/llviewertexlayer.cpp b/indra/newview/llviewertexlayer.cpp old mode 100644 new mode 100755 index 777e1f9c76..c17e85f7a6 --- a/indra/newview/llviewertexlayer.cpp +++ b/indra/newview/llviewertexlayer.cpp @@ -272,6 +272,7 @@ BOOL LLViewerTexLayerSetBuffer::uploadPending() const return mUploadPending; } +// SUNSHINE CLEANUP no upload BOOL LLViewerTexLayerSetBuffer::uploadNeeded() const { return mNeedsUpload; diff --git a/indra/newview/llviewertexlayer.h b/indra/newview/llviewertexlayer.h old mode 100644 new mode 100755 index 959c883da8..aa4bad3422 --- a/indra/newview/llviewertexlayer.h +++ b/indra/newview/llviewertexlayer.h @@ -119,25 +119,41 @@ protected: // Uploads //-------------------------------------------------------------------- public: + // SUNSHINE CLEANUP no upload void requestUpload(); + // SUNSHINE CLEANUP no upload void cancelUpload(); + // SUNSHINE CLEANUP no upload BOOL uploadNeeded() const; // We need to upload a new texture + // SUNSHINE CLEANUP no upload BOOL uploadInProgress() const; // We have started uploading a new texture and are awaiting the result + // SUNSHINE CLEANUP no upload BOOL uploadPending() const; // We are expecting a new texture to be uploaded at some point + // SUNSHINE CLEANUP no upload static void onTextureUploadComplete(const LLUUID& uuid, void* userdata, S32 result, LLExtStat ext_status); protected: + // SUNSHINE CLEANUP no upload BOOL isReadyToUpload() const; + // SUNSHINE CLEANUP no upload void doUpload(); // Does a read back and upload. + // SUNSHINE CLEANUP no upload void conditionalRestartUploadTimer(); private: + // SUNSHINE CLEANUP no upload BOOL mNeedsUpload; // Whether we need to send our baked textures to the server + // SUNSHINE CLEANUP no upload U32 mNumLowresUploads; // Number of times we've sent a lowres version of our baked textures to the server + // SUNSHINE CLEANUP no upload BOOL mUploadPending; // Whether we have received back the new baked textures + // SUNSHINE CLEANUP no upload LLUUID mUploadID; // The current upload process (null if none). + // SUNSHINE CLEANUP no upload LLFrameTimer mNeedsUploadTimer; // Tracks time since upload was requested and performed. + // SUNSHINE CLEANUP no upload S32 mUploadFailCount; // Number of consecutive upload failures + // SUNSHINE CLEANUP no upload LLFrameTimer mUploadRetryTimer; // Tracks time since last upload failure. //-------------------------------------------------------------------- @@ -162,6 +178,7 @@ private: // // Used by LLTexLayerSetBuffer for a callback. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// SUNSHINE CLEANUP no upload struct LLBakedUploadData { LLBakedUploadData(const LLVOAvatarSelf* avatar, diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 7e35af7e63..80f25b7d4c 100755 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -964,6 +964,8 @@ LLViewerFetchedTexture::LLViewerFetchedTexture(const LLUUID& id, FTType f_type, mFTType = f_type; if (mFTType == FTT_HOST_BAKE) { + // SUNSHINE CLEANUP + llassert(false); mCanUseHTTP = false; } generateGLTexture() ; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 93247a3625..8e293d0c06 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1897,6 +1897,8 @@ LLViewerFetchedTexture *LLVOAvatar::getBakedTextureImage(const U8 te, const LLUU } else { + // SUNSHINE CLEANUP + llassert(false); LL_DEBUGS("Avatar") << avString() << "get old-bake image from host " << uuid << llendl; LLHost host = getObjectHost(); result = LLViewerTextureManager::getFetchedTexture( @@ -5345,6 +5347,7 @@ BOOL LLVOAvatar::updateGeometry(LLDrawable *drawable) //----------------------------------------------------------------------------- // updateSexDependentLayerSets() //----------------------------------------------------------------------------- +// SUNSHINE CLEANUP no upload_bake void LLVOAvatar::updateSexDependentLayerSets( BOOL upload_bake ) { invalidateComposite( mBakedTextureDatas[BAKED_HEAD].mTexLayerSet, upload_bake ); @@ -5829,6 +5832,7 @@ BOOL LLVOAvatar::isWearingWearableType(LLWearableType::EType type) const // virtual +// SUNSHINE CLEANUP no upload_result void LLVOAvatar::invalidateComposite( LLTexLayerSet* layerset, BOOL upload_result ) { } @@ -5838,6 +5842,7 @@ void LLVOAvatar::invalidateAll() } // virtual +// SUNSHINE CLEANUP no upload_bake void LLVOAvatar::onGlobalColorChanged(const LLTexGlobalColor* global_color, BOOL upload_bake ) { if (global_color == mTexSkinColor) @@ -7611,6 +7616,7 @@ void LLVOAvatar::startAppearanceAnimation() } //virtual +// SUNSHINE CLEANUP dead code void LLVOAvatar::bodySizeChanged() { if (isSelf() && !LLAppearanceMgr::instance().isInUpdateAppearanceFromCOF()) diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 8d047045cb..13c0332d35 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -402,6 +402,7 @@ public: // Global colors //-------------------------------------------------------------------- public: + // SUNSHINE CLEANUP no upload /*virtual*/void onGlobalColorChanged(const LLTexGlobalColor* global_color, BOOL upload_bake); //-------------------------------------------------------------------- @@ -562,6 +563,7 @@ protected: // Composites //-------------------------------------------------------------------- public: + // SUNSHINE CLEANUP no upload virtual void invalidateComposite(LLTexLayerSet* layerset, BOOL upload_result); virtual void invalidateAll(); virtual void setCompositeUpdatesEnabled(bool b) {} diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index ac59aa0907..f6b29f2eb4 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -673,6 +673,7 @@ LLJoint *LLVOAvatarSelf::getJoint(const std::string &name) return LLVOAvatar::getJoint(name); } // virtual +// SUNSHINE CLEANUP no upload_bake BOOL LLVOAvatarSelf::setVisualParamWeight(const LLVisualParam *which_param, F32 weight, BOOL upload_bake ) { if (!which_param) @@ -684,6 +685,7 @@ BOOL LLVOAvatarSelf::setVisualParamWeight(const LLVisualParam *which_param, F32 } // virtual +// SUNSHINE CLEANUP no upload_bake BOOL LLVOAvatarSelf::setVisualParamWeight(const char* param_name, F32 weight, BOOL upload_bake ) { if (!param_name) @@ -695,12 +697,14 @@ BOOL LLVOAvatarSelf::setVisualParamWeight(const char* param_name, F32 weight, BO } // virtual +// SUNSHINE CLEANUP no upload_bake BOOL LLVOAvatarSelf::setVisualParamWeight(S32 index, F32 weight, BOOL upload_bake ) { LLViewerVisualParam *param = (LLViewerVisualParam*) LLCharacter::getVisualParam(index); return setParamWeight(param,weight,upload_bake); } +// SUNSHINE CLEANUP no upload_bake BOOL LLVOAvatarSelf::setParamWeight(const LLViewerVisualParam *param, F32 weight, BOOL upload_bake ) { if (!param) @@ -794,6 +798,8 @@ U32 LLVOAvatarSelf::processUpdateMessage(LLMessageSystem *mesgsys, { U32 retval = LLVOAvatar::processUpdateMessage(mesgsys,user_data,block_num,update_type,dp); + // SUNSHINE CLEANUP - does this become relevant again if we don't have to wait for appearance message to tell us where bakes are coming from? + #if 0 // DRANO - it's not clear this does anything useful. If we wait // until an appearance message has been received, we already have @@ -1065,6 +1071,7 @@ void LLVOAvatarSelf::updateAttachmentVisibility(U32 camera_mode) // forces an update to any baked textures relevant to type. // will force an upload of the resulting bake if the second parameter is TRUE //----------------------------------------------------------------------------- +// SUNSHINE CLEANUP no upload_result void LLVOAvatarSelf::wearableUpdated( LLWearableType::EType type, BOOL upload_result ) { for (LLAvatarAppearanceDictionary::BakedTextures::const_iterator baked_iter = LLAvatarAppearanceDictionary::getInstance()->getBakedTextures().begin(); @@ -1620,6 +1627,7 @@ bool LLVOAvatarSelf::hasPendingBakedUploads() const return false; } +// SUNSHINE CLEANUP no upload_bake void LLVOAvatarSelf::invalidateComposite( LLTexLayerSet* layerset, BOOL upload_result ) { LLViewerTexLayerSet *layer_set = dynamic_cast<LLViewerTexLayerSet*>(layerset); @@ -2690,6 +2698,8 @@ void LLVOAvatarSelf::setNewBakedTexture(LLAvatarAppearanceDefines::EBakedTexture //----------------------------------------------------------------------------- void LLVOAvatarSelf::setNewBakedTexture( ETextureIndex te, const LLUUID& uuid ) { + // SUNSHINE CLEANUP + llassert(false); // Baked textures live on other sims. LLHost target_host = getObjectHost(); setTEImage( te, LLViewerTextureManager::getFetchedTextureFromHost( uuid, FTT_HOST_BAKE, target_host ) ); diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index 3cbf2b5cf5..7eeaaf5fe5 100755 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -248,6 +248,7 @@ protected: // Layers //-------------------------------------------------------------------- public: + // SUNSHINE CLEANUP void requestLayerSetUploads(); void requestLayerSetUpload(LLAvatarAppearanceDefines::EBakedTextureIndex i); void requestLayerSetUpdate(LLAvatarAppearanceDefines::ETextureIndex i); @@ -259,6 +260,7 @@ public: // Composites //-------------------------------------------------------------------- public: + // SUNSHINE CLEANUP no upload /* virtual */ void invalidateComposite(LLTexLayerSet* layerset, BOOL upload_result); /* virtual */ void invalidateAll(); /* virtual */ void setCompositeUpdatesEnabled(bool b); // only works for self -- cgit v1.2.3 From 497d3f4bfc2b6b45574ef871c11c6fb8e6145d63 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Wed, 18 Sep 2013 17:04:34 -0400 Subject: sunshine cleanup annotations --- indra/newview/llagent.cpp | 1 + indra/newview/llvoavatar.cpp | 2 ++ indra/newview/llvoavatar.h | 1 + indra/newview/llvoavatarself.h | 1 + 4 files changed, 5 insertions(+) (limited to 'indra/newview') 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; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 8e293d0c06..1d25bc1e29 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -6896,6 +6896,7 @@ void LLVOAvatar::parseAppearanceMessage(LLMessageSystem* mesgsys, LLAppearanceMe } } +// SUNSHINE CLEANUP - OK to remove the version = 0 case, assume we're at least 1? bool resolve_appearance_version(const LLAppearanceMessageContents& contents, S32& appearance_version) { appearance_version = -1; @@ -6926,6 +6927,7 @@ bool resolve_appearance_version(const LLAppearanceMessageContents& contents, S32 return true; } +// SUNSHINE CLEANUP - if we can assume server baking, we can simplify some code here. //----------------------------------------------------------------------------- // processAvatarAppearance() //----------------------------------------------------------------------------- diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 13c0332d35..9722b77956 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -649,6 +649,7 @@ public: // True if this avatar should fetch its baked textures via the new // appearance mechanism. + // SUNSHINE CLEANUP - always true, remove? BOOL isUsingServerBakes() const; void setIsUsingServerBakes(BOOL newval); diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index 7eeaaf5fe5..b4981e9823 100755 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -196,6 +196,7 @@ public: // Loading status //-------------------------------------------------------------------- public: + // SUNSHINE CLEANUP /*virtual*/ bool hasPendingBakedUploads() const; S32 getLocalDiscardLevel(LLAvatarAppearanceDefines::ETextureIndex type, U32 index) const; bool areTexturesCurrent() const; -- cgit v1.2.3 From 67193b259a5f4cae029b3e08aecf71c1a7041046 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Wed, 18 Sep 2013 17:27:40 -0400 Subject: sunshine cleanup annotations --- indra/newview/llagentwearables.cpp | 2 ++ indra/newview/llagentwearables.h | 2 ++ 2 files changed, 4 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 0bb126ffd1..5cc2435761 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -304,6 +304,7 @@ void LLAgentWearables::addWearabletoAgentInventoryDone(const LLWearableType::ETy gInventory.notifyObservers(); } +// SUNSHINE CLEANUP dead? void LLAgentWearables::sendAgentWearablesUpdate() { // First make sure that we have inventory items for each wearable @@ -1908,6 +1909,7 @@ void LLAgentWearables::editWearableIfRequested(const LLUUID& item_id) } } +// SUNSHINE CLEANUP - both of these funcs seem to be dead code, so this one should go too. void LLAgentWearables::updateServer() { sendAgentWearablesUpdate(); diff --git a/indra/newview/llagentwearables.h b/indra/newview/llagentwearables.h index fd9f6f74a1..8cab9f847b 100755 --- a/indra/newview/llagentwearables.h +++ b/indra/newview/llagentwearables.h @@ -163,6 +163,7 @@ public: protected: /*virtual*/ void invalidateBakedTextureHash(LLMD5& hash) const; + // SUNSHINE CLEANUP dead void sendAgentWearablesUpdate(); void sendAgentWearablesRequest(); void queryWearableCache(); @@ -244,6 +245,7 @@ private: protected: ~createStandardWearablesAllDoneCallback(); }; + // SUNSHINE CLEANUP - should be dead if sendAgentWearablesUpdate is no longer needed. class sendAgentWearablesUpdateCallback : public LLRefCount { protected: -- cgit v1.2.3 From 0bb3f482af4088cc145344689ff51ebfd59f0bac Mon Sep 17 00:00:00 2001 From: Logan Dethrow <log@lindenlab.com> Date: Wed, 18 Sep 2013 18:34:44 -0400 Subject: Backed out revision 9038e63bc38d, which added viewer version information to what is sent in an appearance metric message. We are taking another approach to get the same information in a more consistent, reliable way. --- indra/newview/llvoavatarself.cpp | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index ac59aa0907..a710c95233 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -63,7 +63,6 @@ #include "llsdutil.h" #include "llstartup.h" #include "llsdserialize.h" -#include "llversioninfo.h" #if LL_MSVC // disable boost::lexical_cast warning @@ -2374,29 +2373,11 @@ LLSD summarize_by_buckets(std::vector<LLSD> in_records, return result; } -// Valid characters for tsdb are alphanumeric, _-./. Others must be cleaned out. -void sanitize_for_tsdb_tag(std::string& s) -{ - for (std::string::iterator it = s.begin(); it != s.end(); ++it) - { - if (std::isalnum(*it) || *it == '.' || *it == '_' || *it == '-' || *it == '/') - { - continue; - } - *it = '_'; - } -} - void LLVOAvatarSelf::sendViewerAppearanceChangeMetrics() { static volatile bool reporting_started(false); static volatile S32 report_sequence(0); - std::string viewer_version_channel = LLVersionInfo::getChannel(); - sanitize_for_tsdb_tag(viewer_version_channel); - std::string viewer_version_short = LLVersionInfo::getShortVersion(); - std::string viewer_version_build = llformat("%d", LLVersionInfo::getBuild()); - LLSD msg; // = metricsData(); msg["message"] = "ViewerAppearanceChangeMetrics"; msg["session_id"] = gAgentSessionID; @@ -2405,9 +2386,6 @@ void LLVOAvatarSelf::sendViewerAppearanceChangeMetrics() msg["initial"] = !reporting_started; msg["break"] = false; msg["duration"] = mTimeSinceLastRezMessage.getElapsedTimeF32(); - msg["viewer_version_channel"] = viewer_version_channel; - msg["viewer_version_short"] = viewer_version_short; - msg["viewer_version_build"] = viewer_version_build; // Status of our own rezzing. msg["rez_status"] = LLVOAvatar::rezStatusToString(getRezzedStatus()); -- cgit v1.2.3 From 82f147367fb5e4ee4bbe53db01856ea375058825 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Thu, 19 Sep 2013 11:10:59 -0400 Subject: SH-3455 WIP - removing bake upload code --- indra/newview/llagent.cpp | 2 +- indra/newview/llagentwearables.cpp | 10 +++--- indra/newview/llagentwearables.h | 2 +- indra/newview/llbreastmotion.cpp | 3 +- indra/newview/llemote.cpp | 12 ++++---- indra/newview/llpaneleditwearable.cpp | 8 ++--- indra/newview/llphysicsmotion.cpp | 8 ++--- indra/newview/llscrollingpanelparam.cpp | 6 ++-- indra/newview/llscrollingpanelparambase.cpp | 2 +- indra/newview/lltoolmorph.cpp | 6 ++-- indra/newview/llviewerwearable.cpp | 8 ++--- indra/newview/llviewerwearable.h | 4 +-- indra/newview/llvoavatar.cpp | 48 ++++++++++++++--------------- indra/newview/llvoavatar.h | 6 ++-- indra/newview/llvoavatarself.cpp | 34 ++++++++++---------- indra/newview/llvoavatarself.h | 10 +++--- 16 files changed, 83 insertions(+), 86 deletions(-) mode change 100644 => 100755 indra/newview/llviewerwearable.cpp mode change 100644 => 100755 indra/newview/llviewerwearable.h (limited to 'indra/newview') 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)); } } } diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 5cc2435761..d59138c624 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -849,7 +849,7 @@ void LLAgentWearables::processAgentInitialWearablesUpdate(LLMessageSystem* mesgs gMessageSystem->getUUIDFast(_PREHASH_WearableData, _PREHASH_AssetID, asset_id, i); if (asset_id.isNull()) { - LLViewerWearable::removeFromAvatar(type, FALSE); + LLViewerWearable::removeFromAvatar(type); } else { @@ -1205,7 +1205,7 @@ void LLAgentWearables::removeWearableFinal(const LLWearableType::EType type, boo if (old_wearable) { popWearable(old_wearable); - old_wearable->removeFromAvatar(TRUE); + old_wearable->removeFromAvatar(); } } clearWearableType(type); @@ -1218,7 +1218,7 @@ void LLAgentWearables::removeWearableFinal(const LLWearableType::EType type, boo if (old_wearable) { popWearable(old_wearable); - old_wearable->removeFromAvatar(TRUE); + old_wearable->removeFromAvatar(); } } @@ -1776,7 +1776,7 @@ bool LLAgentWearables::canWearableBeRemoved(const LLViewerWearable* wearable) co return !(((type == LLWearableType::WT_SHAPE) || (type == LLWearableType::WT_SKIN) || (type == LLWearableType::WT_HAIR) || (type == LLWearableType::WT_EYES)) && (getWearableCount(type) <= 1) ); } -void LLAgentWearables::animateAllWearableParams(F32 delta, BOOL upload_bake) +void LLAgentWearables::animateAllWearableParams(F32 delta) { for( S32 type = 0; type < LLWearableType::WT_COUNT; ++type ) { @@ -1786,7 +1786,7 @@ void LLAgentWearables::animateAllWearableParams(F32 delta, BOOL upload_bake) llassert(wearable); if (wearable) { - wearable->animateParams(delta, upload_bake); + wearable->animateParams(delta); } } } diff --git a/indra/newview/llagentwearables.h b/indra/newview/llagentwearables.h index 8cab9f847b..af4b8cd2dd 100755 --- a/indra/newview/llagentwearables.h +++ b/indra/newview/llagentwearables.h @@ -85,7 +85,7 @@ public: // Note: False for shape, skin, eyes, and hair, unless you have MORE than 1. bool canWearableBeRemoved(const LLViewerWearable* wearable) const; - void animateAllWearableParams(F32 delta, BOOL upload_bake); + void animateAllWearableParams(F32 delta); //-------------------------------------------------------------------- // Accessors diff --git a/indra/newview/llbreastmotion.cpp b/indra/newview/llbreastmotion.cpp index 9a8cd5ceae..3a88bab3b3 100755 --- a/indra/newview/llbreastmotion.cpp +++ b/indra/newview/llbreastmotion.cpp @@ -340,8 +340,7 @@ BOOL LLBreastMotion::onUpdate(F32 time, U8* joint_mask) if (mBreastParamsDriven[i]) { mCharacter->setVisualParamWeight(mBreastParamsDriven[i], - new_local_pt[i], - FALSE); + new_local_pt[i]); } } diff --git a/indra/newview/llemote.cpp b/indra/newview/llemote.cpp index 510ff69acf..b9ef297c00 100755 --- a/indra/newview/llemote.cpp +++ b/indra/newview/llemote.cpp @@ -79,13 +79,13 @@ BOOL LLEmote::onActivate() LLVisualParam* default_param = mCharacter->getVisualParam( "Express_Closed_Mouth" ); if( default_param ) { - default_param->setWeight( default_param->getMaxWeight(), FALSE ); + default_param->setWeight( default_param->getMaxWeight()); } mParam = mCharacter->getVisualParam(mName.c_str()); if (mParam) { - mParam->setWeight(0.f, FALSE); + mParam->setWeight(0.f); mCharacter->updateVisualParams(); } @@ -101,7 +101,7 @@ BOOL LLEmote::onUpdate(F32 time, U8* joint_mask) if( mParam ) { F32 weight = mParam->getMinWeight() + mPose.getWeight() * (mParam->getMaxWeight() - mParam->getMinWeight()); - mParam->setWeight(weight, FALSE); + mParam->setWeight(weight); // Cross fade against the default parameter LLVisualParam* default_param = mCharacter->getVisualParam( "Express_Closed_Mouth" ); @@ -110,7 +110,7 @@ BOOL LLEmote::onUpdate(F32 time, U8* joint_mask) F32 default_param_weight = default_param->getMinWeight() + (1.f - mPose.getWeight()) * ( default_param->getMaxWeight() - default_param->getMinWeight() ); - default_param->setWeight( default_param_weight, FALSE ); + default_param->setWeight( default_param_weight); } mCharacter->updateVisualParams(); @@ -127,13 +127,13 @@ void LLEmote::onDeactivate() { if( mParam ) { - mParam->setWeight( mParam->getDefaultWeight(), FALSE ); + mParam->setWeight( mParam->getDefaultWeight()); } LLVisualParam* default_param = mCharacter->getVisualParam( "Express_Closed_Mouth" ); if( default_param ) { - default_param->setWeight( default_param->getMaxWeight(), FALSE ); + default_param->setWeight( default_param->getMaxWeight()); } mCharacter->updateVisualParams(); diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp index 582998c973..022fd6c062 100755 --- a/indra/newview/llpaneleditwearable.cpp +++ b/indra/newview/llpaneleditwearable.cpp @@ -943,11 +943,11 @@ void LLPanelEditWearable::onCommitSexChange() LLViewerWearable* wearable = gAgentWearables.getViewerWearable(type, index); if (wearable) { - wearable->setVisualParamWeight(param->getID(), is_new_sex_male, FALSE); + wearable->setVisualParamWeight(param->getID(), is_new_sex_male); } - param->setWeight( is_new_sex_male, FALSE ); + param->setWeight( is_new_sex_male); - gAgentAvatarp->updateSexDependentLayerSets( FALSE ); + gAgentAvatarp->updateSexDependentLayerSets(); gAgentAvatarp->updateVisualParams(); @@ -1006,7 +1006,7 @@ void LLPanelEditWearable::onColorSwatchCommit(const LLUICtrl* ctrl) const LLColor4& new_color = LLColor4(ctrl->getValue()); if( old_color != new_color ) { - getWearable()->setClothesColor(entry->mTextureIndex, new_color, TRUE); + getWearable()->setClothesColor(entry->mTextureIndex, new_color); LLVisualParamHint::requestHintUpdates(); gAgentAvatarp->wearableUpdated(getWearable()->getType(), FALSE); } diff --git a/indra/newview/llphysicsmotion.cpp b/indra/newview/llphysicsmotion.cpp index 18b85cc9c3..8746f58f55 100755 --- a/indra/newview/llphysicsmotion.cpp +++ b/indra/newview/llphysicsmotion.cpp @@ -668,9 +668,7 @@ BOOL LLPhysicsMotion::onUpdate(F32 time) if ((driver_param->getGroup() != VISUAL_PARAM_GROUP_TWEAKABLE) && (driver_param->getGroup() != VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT)) { - mCharacter->setVisualParamWeight(driver_param, - 0, - FALSE); + mCharacter->setVisualParamWeight(driver_param, 0); } S32 num_driven = driver_param->getDrivenParamsCount(); for (S32 i = 0; i < num_driven; ++i) @@ -770,7 +768,5 @@ void LLPhysicsMotion::setParamValue(const LLViewerVisualParam *param, // Scale from [0,1] to [value_min_local,value_max_local] const F32 new_value_local = value_min_local + (value_max_local-value_min_local) * new_value_rescaled; - mCharacter->setVisualParamWeight(param, - new_value_local, - FALSE); + mCharacter->setVisualParamWeight(param, new_value_local); } diff --git a/indra/newview/llscrollingpanelparam.cpp b/indra/newview/llscrollingpanelparam.cpp index a7e24b86b1..bfa453a0ae 100755 --- a/indra/newview/llscrollingpanelparam.cpp +++ b/indra/newview/llscrollingpanelparam.cpp @@ -266,7 +266,7 @@ void LLScrollingPanelParam::onHintHeldDown( LLVisualParamHint* hint ) if (slider->getMinValue() < new_percent && new_percent < slider->getMaxValue()) { - mWearable->setVisualParamWeight( hint->getVisualParam()->getID(), new_weight, FALSE); + mWearable->setVisualParamWeight( hint->getVisualParam()->getID(), new_weight); mWearable->writeToAvatar(gAgentAvatarp); gAgentAvatarp->updateVisualParams(); @@ -299,7 +299,7 @@ void LLScrollingPanelParam::onHintMinMouseUp( void* userdata ) if (slider->getMinValue() < new_percent && new_percent < slider->getMaxValue()) { - self->mWearable->setVisualParamWeight(hint->getVisualParam()->getID(), new_weight, FALSE); + self->mWearable->setVisualParamWeight(hint->getVisualParam()->getID(), new_weight); self->mWearable->writeToAvatar(gAgentAvatarp); slider->setValue( self->weightToPercent( new_weight ) ); } @@ -333,7 +333,7 @@ void LLScrollingPanelParam::onHintMaxMouseUp( void* userdata ) if (slider->getMinValue() < new_percent && new_percent < slider->getMaxValue()) { - self->mWearable->setVisualParamWeight(hint->getVisualParam()->getID(), new_weight, FALSE); + self->mWearable->setVisualParamWeight(hint->getVisualParam()->getID(), new_weight); self->mWearable->writeToAvatar(gAgentAvatarp); slider->setValue( self->weightToPercent( new_weight ) ); } diff --git a/indra/newview/llscrollingpanelparambase.cpp b/indra/newview/llscrollingpanelparambase.cpp index 8e083ddb6c..fe7a362723 100755 --- a/indra/newview/llscrollingpanelparambase.cpp +++ b/indra/newview/llscrollingpanelparambase.cpp @@ -93,7 +93,7 @@ void LLScrollingPanelParamBase::onSliderMoved(LLUICtrl* ctrl, void* userdata) F32 new_weight = self->percentToWeight( (F32)slider->getValue().asReal() ); if (current_weight != new_weight ) { - self->mWearable->setVisualParamWeight( param->getID(), new_weight, FALSE ); + self->mWearable->setVisualParamWeight( param->getID(), new_weight); self->mWearable->writeToAvatar(gAgentAvatarp); gAgentAvatarp->updateVisualParams(); } diff --git a/indra/newview/lltoolmorph.cpp b/indra/newview/lltoolmorph.cpp index 71e0509d03..2d458db36b 100755 --- a/indra/newview/lltoolmorph.cpp +++ b/indra/newview/lltoolmorph.cpp @@ -154,8 +154,8 @@ void LLVisualParamHint::preRender(BOOL clear_depth) wearable->setVolatile(TRUE); } mLastParamWeight = mVisualParam->getWeight(); - mWearablePtr->setVisualParamWeight(mVisualParam->getID(), mVisualParamWeight, FALSE); - gAgentAvatarp->setVisualParamWeight(mVisualParam->getID(), mVisualParamWeight, FALSE); + mWearablePtr->setVisualParamWeight(mVisualParam->getID(), mVisualParamWeight); + gAgentAvatarp->setVisualParamWeight(mVisualParam->getID(), mVisualParamWeight); gAgentAvatarp->setVisualParamWeight("Blink_Left", 0.f); gAgentAvatarp->setVisualParamWeight("Blink_Right", 0.f); gAgentAvatarp->updateComposites(); @@ -246,7 +246,7 @@ BOOL LLVisualParamHint::render() gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); } gAgentAvatarp->setVisualParamWeight(mVisualParam->getID(), mLastParamWeight); - mWearablePtr->setVisualParamWeight(mVisualParam->getID(), mLastParamWeight, FALSE); + mWearablePtr->setVisualParamWeight(mVisualParam->getID(), mLastParamWeight); LLViewerWearable* wearable = (LLViewerWearable*)mWearablePtr; if (wearable) { diff --git a/indra/newview/llviewerwearable.cpp b/indra/newview/llviewerwearable.cpp old mode 100644 new mode 100755 index 76f94935b8..770fc69969 --- a/indra/newview/llviewerwearable.cpp +++ b/indra/newview/llviewerwearable.cpp @@ -266,7 +266,7 @@ void LLViewerWearable::setParamsToDefaults() { if( (((LLViewerVisualParam*)param)->getWearableType() == mType ) && (param->isTweakable() ) ) { - setVisualParamWeight(param->getID(),param->getDefaultWeight(), FALSE); + setVisualParamWeight(param->getID(),param->getDefaultWeight()); } } } @@ -361,7 +361,7 @@ void LLViewerWearable::writeToAvatar(LLAvatarAppearance *avatarp) ESex new_sex = avatarp->getSex(); if( old_sex != new_sex ) { - viewer_avatar->updateSexDependentLayerSets( FALSE ); + viewer_avatar->updateSexDependentLayerSets(); } // if( upload_bake ) @@ -373,7 +373,7 @@ void LLViewerWearable::writeToAvatar(LLAvatarAppearance *avatarp) // Updates the user's avatar's appearance, replacing this wearables' parameters and textures with default values. // static -void LLViewerWearable::removeFromAvatar( LLWearableType::EType type, BOOL upload_bake ) +void LLViewerWearable::removeFromAvatar( LLWearableType::EType type) { if (!isAgentAvatarValid()) return; @@ -392,7 +392,7 @@ void LLViewerWearable::removeFromAvatar( LLWearableType::EType type, BOOL upload if( (((LLViewerVisualParam*)param)->getWearableType() == type) && (param->isTweakable() ) ) { S32 param_id = param->getID(); - gAgentAvatarp->setVisualParamWeight( param_id, param->getDefaultWeight(), upload_bake ); + gAgentAvatarp->setVisualParamWeight( param_id, param->getDefaultWeight()); } } diff --git a/indra/newview/llviewerwearable.h b/indra/newview/llviewerwearable.h old mode 100644 new mode 100755 index ef8c29323e..2e59596f12 --- a/indra/newview/llviewerwearable.h +++ b/indra/newview/llviewerwearable.h @@ -61,8 +61,8 @@ public: BOOL isOldVersion() const; /*virtual*/ void writeToAvatar(LLAvatarAppearance *avatarp); - void removeFromAvatar( BOOL upload_bake ) { LLViewerWearable::removeFromAvatar( mType, upload_bake ); } - static void removeFromAvatar( LLWearableType::EType type, BOOL upload_bake ); + void removeFromAvatar() { LLViewerWearable::removeFromAvatar( mType); } + static void removeFromAvatar( LLWearableType::EType type); /*virtual*/ EImportResult importStream( std::istream& input_stream, LLAvatarAppearance* avatarp ); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 1d25bc1e29..bb8682d1fd 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1067,7 +1067,7 @@ void LLVOAvatar::restoreGL() gAgentAvatarp->setCompositeUpdatesEnabled(TRUE); for (U32 i = 0; i < gAgentAvatarp->mBakedTextureDatas.size(); i++) { - gAgentAvatarp->invalidateComposite(gAgentAvatarp->getTexLayerSet(i), FALSE); + gAgentAvatarp->invalidateComposite(gAgentAvatarp->getTexLayerSet(i)); } gAgentAvatarp->updateMeshTextures(); } @@ -2132,8 +2132,8 @@ void LLVOAvatar::idleUpdateVoiceVisualizer(bool voice_enabled) if ( mLipSyncActive ) { - if( mOohMorph ) mOohMorph->setWeight(mOohMorph->getMinWeight(), FALSE); - if( mAahMorph ) mAahMorph->setWeight(mAahMorph->getMinWeight(), FALSE); + if( mOohMorph ) mOohMorph->setWeight(mOohMorph->getMinWeight()); + if( mAahMorph ) mAahMorph->setWeight(mAahMorph->getMinWeight()); mLipSyncActive = false; LLCharacter::updateVisualParams(); @@ -2296,7 +2296,7 @@ void LLVOAvatar::idleUpdateAppearanceAnimation() { if (param->isTweakable()) { - param->stopAnimating(FALSE); + param->stopAnimating(); } } updateVisualParams(); @@ -2319,7 +2319,7 @@ void LLVOAvatar::idleUpdateAppearanceAnimation() { if (param->isTweakable()) { - param->animate(morph_amt, FALSE); + param->animate(morph_amt); } } } @@ -2372,7 +2372,7 @@ void LLVOAvatar::idleUpdateLipSync(bool voice_enabled) F32 ooh_weight = mOohMorph->getMinWeight() + ooh_morph_amount * (mOohMorph->getMaxWeight() - mOohMorph->getMinWeight()); - mOohMorph->setWeight( ooh_weight, FALSE ); + mOohMorph->setWeight( ooh_weight); } if( mAahMorph ) @@ -2380,7 +2380,7 @@ void LLVOAvatar::idleUpdateLipSync(bool voice_enabled) F32 aah_weight = mAahMorph->getMinWeight() + aah_morph_amount * (mAahMorph->getMaxWeight() - mAahMorph->getMinWeight()); - mAahMorph->setWeight( aah_weight, FALSE ); + mAahMorph->setWeight( aah_weight); } mLipSyncActive = true; @@ -5348,11 +5348,11 @@ BOOL LLVOAvatar::updateGeometry(LLDrawable *drawable) // updateSexDependentLayerSets() //----------------------------------------------------------------------------- // SUNSHINE CLEANUP no upload_bake -void LLVOAvatar::updateSexDependentLayerSets( BOOL upload_bake ) +void LLVOAvatar::updateSexDependentLayerSets() { - invalidateComposite( mBakedTextureDatas[BAKED_HEAD].mTexLayerSet, upload_bake ); - invalidateComposite( mBakedTextureDatas[BAKED_UPPER].mTexLayerSet, upload_bake ); - invalidateComposite( mBakedTextureDatas[BAKED_LOWER].mTexLayerSet, upload_bake ); + invalidateComposite( mBakedTextureDatas[BAKED_HEAD].mTexLayerSet); + invalidateComposite( mBakedTextureDatas[BAKED_UPPER].mTexLayerSet); + invalidateComposite( mBakedTextureDatas[BAKED_LOWER].mTexLayerSet); } //----------------------------------------------------------------------------- @@ -5832,8 +5832,8 @@ BOOL LLVOAvatar::isWearingWearableType(LLWearableType::EType type) const // virtual -// SUNSHINE CLEANUP no upload_result -void LLVOAvatar::invalidateComposite( LLTexLayerSet* layerset, BOOL upload_result ) +// SUNSHINE CLEANUP no upload_result, no-op +void LLVOAvatar::invalidateComposite( LLTexLayerSet* layerset) { } @@ -5843,18 +5843,18 @@ void LLVOAvatar::invalidateAll() // virtual // SUNSHINE CLEANUP no upload_bake -void LLVOAvatar::onGlobalColorChanged(const LLTexGlobalColor* global_color, BOOL upload_bake ) +void LLVOAvatar::onGlobalColorChanged(const LLTexGlobalColor* global_color) { if (global_color == mTexSkinColor) { - invalidateComposite( mBakedTextureDatas[BAKED_HEAD].mTexLayerSet, upload_bake ); - invalidateComposite( mBakedTextureDatas[BAKED_UPPER].mTexLayerSet, upload_bake ); - invalidateComposite( mBakedTextureDatas[BAKED_LOWER].mTexLayerSet, upload_bake ); + invalidateComposite( mBakedTextureDatas[BAKED_HEAD].mTexLayerSet); + invalidateComposite( mBakedTextureDatas[BAKED_UPPER].mTexLayerSet); + invalidateComposite( mBakedTextureDatas[BAKED_LOWER].mTexLayerSet); } else if (global_color == mTexHairColor) { - invalidateComposite( mBakedTextureDatas[BAKED_HEAD].mTexLayerSet, upload_bake ); - invalidateComposite( mBakedTextureDatas[BAKED_HAIR].mTexLayerSet, upload_bake ); + invalidateComposite( mBakedTextureDatas[BAKED_HEAD].mTexLayerSet); + invalidateComposite( mBakedTextureDatas[BAKED_HAIR].mTexLayerSet); // ! BACKWARDS COMPATIBILITY ! // Fix for dealing with avatars from viewers that don't bake hair. @@ -5876,7 +5876,7 @@ void LLVOAvatar::onGlobalColorChanged(const LLTexGlobalColor* global_color, BOOL else if (global_color == mTexEyeColor) { // llinfos << "invalidateComposite cause: onGlobalColorChanged( eyecolor )" << llendl; - invalidateComposite( mBakedTextureDatas[BAKED_EYES].mTexLayerSet, upload_bake ); + invalidateComposite( mBakedTextureDatas[BAKED_EYES].mTexLayerSet); } updateMeshTextures(); } @@ -7078,13 +7078,13 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) if(is_first_appearance_message) { //LL_DEBUGS("Avatar") << "param slam " << i << " " << newWeight << llendl; - param->setWeight(newWeight, FALSE); + param->setWeight(newWeight); } else { //LL_DEBUGS("Avatar") << std::setprecision(5) << " param target " << i << " " << param->getWeight() << " -> " << newWeight << llendl; interp_params = TRUE; - param->setAnimationTarget(newWeight, FALSE); + param->setAnimationTarget(newWeight); } } } @@ -7107,7 +7107,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) ESex new_sex = getSex(); if( old_sex != new_sex ) { - updateSexDependentLayerSets( FALSE ); + updateSexDependentLayerSets(); } } @@ -7650,7 +7650,7 @@ void LLVOAvatar::setIsUsingServerBakes(BOOL newval) mUseServerBakes = newval; LLVisualParam* appearance_version_param = getVisualParam(11000); llassert(appearance_version_param); - appearance_version_param->setWeight(newval ? 1.0 : 0.0, false); + appearance_version_param->setWeight(newval ? 1.0 : 0.0); } // virtual diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 9722b77956..216ab730e7 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -403,7 +403,7 @@ public: //-------------------------------------------------------------------- public: // SUNSHINE CLEANUP no upload - /*virtual*/void onGlobalColorChanged(const LLTexGlobalColor* global_color, BOOL upload_bake); + /*virtual*/void onGlobalColorChanged(const LLTexGlobalColor* global_color); //-------------------------------------------------------------------- // Visibility @@ -564,7 +564,7 @@ protected: //-------------------------------------------------------------------- public: // SUNSHINE CLEANUP no upload - virtual void invalidateComposite(LLTexLayerSet* layerset, BOOL upload_result); + virtual void invalidateComposite(LLTexLayerSet* layerset); virtual void invalidateAll(); virtual void setCompositeUpdatesEnabled(bool b) {} virtual void setCompositeUpdatesEnabled(U32 index, bool b) {} @@ -601,7 +601,7 @@ private: public: void debugColorizeSubMeshes(U32 i, const LLColor4& color); virtual void updateMeshTextures(); - void updateSexDependentLayerSets(BOOL upload_bake); + void updateSexDependentLayerSets(); virtual void dirtyMesh(); // Dirty the avatar mesh void updateMeshData(); protected: diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index f6b29f2eb4..4f2af2c8ee 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -674,38 +674,38 @@ LLJoint *LLVOAvatarSelf::getJoint(const std::string &name) } // virtual // SUNSHINE CLEANUP no upload_bake -BOOL LLVOAvatarSelf::setVisualParamWeight(const LLVisualParam *which_param, F32 weight, BOOL upload_bake ) +BOOL LLVOAvatarSelf::setVisualParamWeight(const LLVisualParam *which_param, F32 weight) { if (!which_param) { return FALSE; } LLViewerVisualParam *param = (LLViewerVisualParam*) LLCharacter::getVisualParam(which_param->getID()); - return setParamWeight(param,weight,upload_bake); + return setParamWeight(param,weight); } // virtual // SUNSHINE CLEANUP no upload_bake -BOOL LLVOAvatarSelf::setVisualParamWeight(const char* param_name, F32 weight, BOOL upload_bake ) +BOOL LLVOAvatarSelf::setVisualParamWeight(const char* param_name, F32 weight) { if (!param_name) { return FALSE; } LLViewerVisualParam *param = (LLViewerVisualParam*) LLCharacter::getVisualParam(param_name); - return setParamWeight(param,weight,upload_bake); + return setParamWeight(param,weight); } // virtual // SUNSHINE CLEANUP no upload_bake -BOOL LLVOAvatarSelf::setVisualParamWeight(S32 index, F32 weight, BOOL upload_bake ) +BOOL LLVOAvatarSelf::setVisualParamWeight(S32 index, F32 weight) { LLViewerVisualParam *param = (LLViewerVisualParam*) LLCharacter::getVisualParam(index); - return setParamWeight(param,weight,upload_bake); + return setParamWeight(param,weight); } // SUNSHINE CLEANUP no upload_bake -BOOL LLVOAvatarSelf::setParamWeight(const LLViewerVisualParam *param, F32 weight, BOOL upload_bake ) +BOOL LLVOAvatarSelf::setParamWeight(const LLViewerVisualParam *param, F32 weight) { if (!param) { @@ -729,12 +729,12 @@ BOOL LLVOAvatarSelf::setParamWeight(const LLViewerVisualParam *param, F32 weight LLViewerWearable *wearable = gAgentWearables.getViewerWearable(type,count); if (wearable) { - wearable->setVisualParamWeight(param->getID(), weight, upload_bake); + wearable->setVisualParamWeight(param->getID(), weight); } } } - return LLCharacter::setVisualParamWeight(param,weight,upload_bake); + return LLCharacter::setVisualParamWeight(param,weight); } /*virtual*/ @@ -747,7 +747,7 @@ void LLVOAvatarSelf::updateVisualParams() void LLVOAvatarSelf::idleUpdateAppearanceAnimation() { // Animate all top-level wearable visual parameters - gAgentWearables.animateAllWearableParams(calcMorphAmount(), FALSE); + gAgentWearables.animateAllWearableParams(calcMorphAmount()); // apply wearable visual params to avatar for (U32 type = 0; type < LLWearableType::WT_COUNT; type++) @@ -890,7 +890,7 @@ void LLVOAvatarSelf::removeMissingBakedTextures() { LLViewerTexLayerSet *layerset = getTexLayerSet(i); layerset->setUpdatesEnabled(TRUE); - invalidateComposite(layerset, FALSE); + invalidateComposite(layerset); } updateMeshTextures(); if (getRegion() && !getRegion()->getCentralBakeVersion()) @@ -1094,7 +1094,7 @@ void LLVOAvatarSelf::wearableUpdated( LLWearableType::EType type, BOOL upload_re if (layerset) { layerset->setUpdatesEnabled(true); - invalidateComposite(layerset, upload_result); + invalidateComposite(layerset); } break; } @@ -1628,7 +1628,7 @@ bool LLVOAvatarSelf::hasPendingBakedUploads() const } // SUNSHINE CLEANUP no upload_bake -void LLVOAvatarSelf::invalidateComposite( LLTexLayerSet* layerset, BOOL upload_result ) +void LLVOAvatarSelf::invalidateComposite( LLTexLayerSet* layerset) { LLViewerTexLayerSet *layer_set = dynamic_cast<LLViewerTexLayerSet*>(layerset); if( !layer_set || !layer_set->getUpdatesEnabled() ) @@ -1640,6 +1640,7 @@ void LLVOAvatarSelf::invalidateComposite( LLTexLayerSet* layerset, BOOL upload_r layer_set->requestUpdate(); layer_set->invalidateMorphMasks(); +#if 0 // SUNSHINE CLEANUP if( upload_result && (getRegion() && !getRegion()->getCentralBakeVersion())) { llassert(isSelf()); @@ -1649,6 +1650,7 @@ void LLVOAvatarSelf::invalidateComposite( LLTexLayerSet* layerset, BOOL upload_r layer_set->requestUpload(); updateMeshTextures(); } +#endif } void LLVOAvatarSelf::invalidateAll() @@ -1656,7 +1658,7 @@ void LLVOAvatarSelf::invalidateAll() for (U32 i = 0; i < mBakedTextureDatas.size(); i++) { LLViewerTexLayerSet *layerset = getTexLayerSet(i); - invalidateComposite(layerset, TRUE); + invalidateComposite(layerset); } //mDebugSelfLoadTimer.reset(); } @@ -2899,7 +2901,7 @@ void LLVOAvatarSelf::processRebakeAvatarTextures(LLMessageSystem* msg, void**) if (layer_set) { llinfos << "TAT: rebake - matched entry " << (S32)index << llendl; - gAgentAvatarp->invalidateComposite(layer_set, TRUE); + gAgentAvatarp->invalidateComposite(layer_set); found = TRUE; LLViewerStats::getInstance()->incStat(LLViewerStats::ST_TEX_REBAKES); } @@ -2936,7 +2938,7 @@ void LLVOAvatarSelf::forceBakeAllTextures(bool slam_for_debug) layer_set->cancelUpload(); } - invalidateComposite(layer_set, TRUE); + invalidateComposite(layer_set); LLViewerStats::getInstance()->incStat(LLViewerStats::ST_TEX_REBAKES); } else diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index b4981e9823..32d9012862 100755 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -97,9 +97,9 @@ public: void resetJointPositions( void ); - /*virtual*/ BOOL setVisualParamWeight(const LLVisualParam *which_param, F32 weight, BOOL upload_bake = FALSE ); - /*virtual*/ BOOL setVisualParamWeight(const char* param_name, F32 weight, BOOL upload_bake = FALSE ); - /*virtual*/ BOOL setVisualParamWeight(S32 index, F32 weight, BOOL upload_bake = FALSE ); + /*virtual*/ BOOL setVisualParamWeight(const LLVisualParam *which_param, F32 weight); + /*virtual*/ BOOL setVisualParamWeight(const char* param_name, F32 weight); + /*virtual*/ BOOL setVisualParamWeight(S32 index, F32 weight); /*virtual*/ void updateVisualParams(); /*virtual*/ void idleUpdateAppearanceAnimation(); @@ -111,7 +111,7 @@ public: private: // helper function. Passed in param is assumed to be in avatar's parameter list. - BOOL setParamWeight(const LLViewerVisualParam *param, F32 weight, BOOL upload_bake = FALSE ); + BOOL setParamWeight(const LLViewerVisualParam *param, F32 weight); @@ -262,7 +262,7 @@ public: //-------------------------------------------------------------------- public: // SUNSHINE CLEANUP no upload - /* virtual */ void invalidateComposite(LLTexLayerSet* layerset, BOOL upload_result); + /* virtual */ void invalidateComposite(LLTexLayerSet* layerset); /* virtual */ void invalidateAll(); /* virtual */ void setCompositeUpdatesEnabled(bool b); // only works for self /* virtual */ void setCompositeUpdatesEnabled(U32 index, bool b); -- cgit v1.2.3 From d58e7cfbfcec163345e87c0c5e5f74d01075246b Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Thu, 19 Sep 2013 13:59:20 -0400 Subject: SH-3455 WIP - removing bake upload code --- indra/newview/llagent.cpp | 268 +------------------------------------ indra/newview/llagent.h | 5 - indra/newview/llagentwearables.cpp | 5 +- indra/newview/llstartup.cpp | 1 - indra/newview/llviewermessage.cpp | 4 - indra/newview/llviewerwearable.cpp | 10 -- indra/newview/llvoavatar.cpp | 16 +-- indra/newview/llvoavatar.h | 2 +- indra/newview/llvoavatarself.cpp | 9 -- 9 files changed, 4 insertions(+), 316 deletions(-) (limited to 'indra/newview') 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<texture te=\"%i\" uuid=\"%s\"/>\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; } } diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index 3681b81afa..eca9a3f229 100755 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -844,9 +844,6 @@ private: public: void sendMessage(); // Send message to this agent's region void sendReliableMessage(); - // SUNSHINE CLEANUP dead code - void dumpSentAppearance(const std::string& dump_prefix); - void sendAgentSetAppearance(); void sendAgentDataUpdateRequest(); void sendAgentUserInfoRequest(); // IM to Email and Online visibility @@ -860,8 +857,6 @@ public: static void processAgentGroupDataUpdate(LLMessageSystem *msg, void **); static void processAgentDropGroup(LLMessageSystem *msg, void **); static void processScriptControlChange(LLMessageSystem *msg, void **); - // SUNSHINE CLEANUP dead code? - static void processAgentCachedTextureResponse(LLMessageSystem *mesgsys, void **user_data); /** Messaging ** ** diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index d59138c624..96bfc43fb8 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -522,8 +522,6 @@ void LLAgentWearables::revertWearable(const LLWearableType::EType type, const U3 { wearable->revertValues(); } - - gAgent.sendAgentSetAppearance(); } void LLAgentWearables::saveAllWearables() @@ -921,7 +919,7 @@ void LLAgentWearables::recoverMissingWearableDone() if (areWearablesLoaded()) { // Make sure that the server's idea of the avatar's wearables actually match the wearables. - gAgent.sendAgentSetAppearance(); + //gAgent.sendAgentSetAppearance(); } else { @@ -1913,7 +1911,6 @@ void LLAgentWearables::editWearableIfRequested(const LLUUID& item_id) void LLAgentWearables::updateServer() { sendAgentWearablesUpdate(); - gAgent.sendAgentSetAppearance(); } boost::signals2::connection LLAgentWearables::addLoadingStartedCallback(loading_started_callback_t cb) diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 1c9276bab9..3abc08ec2d 100755 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -2370,7 +2370,6 @@ void register_viewer_callbacks(LLMessageSystem* msg) msg->setHandlerFuncFast(_PREHASH_RemoveNameValuePair, process_remove_name_value); msg->setHandlerFuncFast(_PREHASH_AvatarAnimation, process_avatar_animation); msg->setHandlerFuncFast(_PREHASH_AvatarAppearance, process_avatar_appearance); - msg->setHandlerFunc("AgentCachedTextureResponse", LLAgent::processAgentCachedTextureResponse); msg->setHandlerFunc("RebakeAvatarTextures", LLVOAvatarSelf::processRebakeAvatarTextures); msg->setHandlerFuncFast(_PREHASH_CameraConstraint, process_camera_constraint); msg->setHandlerFuncFast(_PREHASH_AvatarSitResponse, process_avatar_sit_response); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index aecffb4ff5..c7c0e26533 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -4087,10 +4087,6 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**) gAgent.setTeleportState( LLAgent::TELEPORT_START_ARRIVAL ); - // set the appearance on teleport since the new sim does not - // know what you look like. - gAgent.sendAgentSetAppearance(); - if (isAgentAvatarValid()) { // Chat the "back" SLURL. (DEV-4907) diff --git a/indra/newview/llviewerwearable.cpp b/indra/newview/llviewerwearable.cpp index 770fc69969..d56a7b5dc5 100755 --- a/indra/newview/llviewerwearable.cpp +++ b/indra/newview/llviewerwearable.cpp @@ -363,11 +363,6 @@ void LLViewerWearable::writeToAvatar(LLAvatarAppearance *avatarp) { viewer_avatar->updateSexDependentLayerSets(); } - -// if( upload_bake ) -// { -// gAgent.sendAgentSetAppearance(); -// } } @@ -403,11 +398,6 @@ void LLViewerWearable::removeFromAvatar( LLWearableType::EType type) gAgentAvatarp->updateVisualParams(); gAgentAvatarp->wearableUpdated(type, FALSE); - -// if( upload_bake ) -// { -// gAgent.sendAgentSetAppearance(); -// } } // Does not copy mAssetID. diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index bb8682d1fd..987beedd9e 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -2300,10 +2300,6 @@ void LLVOAvatar::idleUpdateAppearanceAnimation() } } updateVisualParams(); - if (isSelf()) - { - gAgent.sendAgentSetAppearance(); - } } else { @@ -4123,6 +4119,7 @@ bool LLVOAvatar::allBakedTexturesCompletelyDownloaded() const return allTexturesCompletelyDownloaded(baked_ids); } +// SUNSHINE CLEANUP void LLVOAvatar::bakedTextureOriginCounts(S32 &sb_count, // server-bake, has origin URL. S32 &host_count, // host-based bake, has host. S32 &both_count, // error - both host and URL set. @@ -7617,17 +7614,6 @@ void LLVOAvatar::startAppearanceAnimation() } } -//virtual -// SUNSHINE CLEANUP dead code -void LLVOAvatar::bodySizeChanged() -{ - if (isSelf() && !LLAppearanceMgr::instance().isInUpdateAppearanceFromCOF()) - { // notify simulator of change in size - // but not if we are in the middle of updating appearance - gAgent.sendAgentSetAppearance(); - } -} - BOOL LLVOAvatar::isUsingServerBakes() const { #if 1 diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 216ab730e7..c8f9f9bd8d 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -634,7 +634,6 @@ public: void processAvatarAppearance(LLMessageSystem* mesgsys); void hideSkirt(); void startAppearanceAnimation(); - /*virtual*/ void bodySizeChanged(); //-------------------------------------------------------------------- // Appearance morphing @@ -651,6 +650,7 @@ public: // appearance mechanism. // SUNSHINE CLEANUP - always true, remove? BOOL isUsingServerBakes() const; + // SUNSHINE CLEANUP - always true, remove? void setIsUsingServerBakes(BOOL newval); diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 4f2af2c8ee..4c568c9bed 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -1101,13 +1101,6 @@ void LLVOAvatarSelf::wearableUpdated( LLWearableType::EType type, BOOL upload_re } } } - - // Physics type has no associated baked textures, but change of params needs to be sent to - // other avatars. - if (type == LLWearableType::WT_PHYSICS) - { - gAgent.sendAgentSetAppearance(); - } } //----------------------------------------------------------------------------- @@ -2728,8 +2721,6 @@ void LLVOAvatarSelf::setNewBakedTexture( ETextureIndex te, const LLUUID& uuid ) // RN: throttle uploads if (!hasPendingBakedUploads()) { - gAgent.sendAgentSetAppearance(); - if (gSavedSettings.getBOOL("DebugAvatarRezTime")) { LLSD args; -- cgit v1.2.3 From 48bc05e93ffbd29b3e49c288577bda1712a88392 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Thu, 19 Sep 2013 16:14:59 -0400 Subject: SH-3455 WIP - removing bake upload code --- indra/newview/llagent.cpp | 18 -- indra/newview/llagent.h | 20 -- indra/newview/llagentwearables.cpp | 68 +---- indra/newview/llagentwearables.h | 1 - indra/newview/llassetuploadresponders.cpp | 51 ---- indra/newview/llassetuploadresponders.h | 22 -- indra/newview/lltextureview.cpp | 10 +- indra/newview/llviewertexlayer.cpp | 403 +----------------------------- indra/newview/llviewertexlayer.h | 64 ----- indra/newview/llvoavatarself.cpp | 153 +++--------- indra/newview/llvoavatarself.h | 7 +- 11 files changed, 43 insertions(+), 774 deletions(-) (limited to 'indra/newview') 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 //----------------------------------------------------------------------------- diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index eca9a3f229..a4385d33cb 100755 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -885,24 +885,4 @@ inline bool operator==(const LLGroupData &a, const LLGroupData &b) return (a.mID == b.mID); } -class LLAgentQueryManager -{ - friend class LLAgent; - friend class LLAgentWearables; - -public: - LLAgentQueryManager(); - virtual ~LLAgentQueryManager(); - - BOOL hasNoPendingQueries() const { return getNumPendingQueries() == 0; } - S32 getNumPendingQueries() const { return mNumPendingQueries; } -private: - S32 mNumPendingQueries; - S32 mWearablesCacheQueryID; - U32 mUpdateSerialNum; - S32 mActiveCacheQueries[LLAvatarAppearanceDefines::BAKED_NUM_INDICES]; -}; - -extern LLAgentQueryManager gAgentQueryManager; - #endif diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 96bfc43fb8..bffdb0a49b 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -807,7 +807,8 @@ void LLAgentWearables::processAgentInitialWearablesUpdate(LLMessageSystem* mesgs if (isAgentAvatarValid() && (agent_id == gAgentAvatarp->getID())) { - gMessageSystem->getU32Fast(_PREHASH_AgentData, _PREHASH_SerialNum, gAgentQueryManager.mUpdateSerialNum); + U32 unused_update_serial_num; + gMessageSystem->getU32Fast(_PREHASH_AgentData, _PREHASH_SerialNum, unused_update_serial_num); const S32 NUM_BODY_PARTS = 4; S32 num_wearables = gMessageSystem->getNumberOfBlocksFast(_PREHASH_WearableData); @@ -1199,7 +1200,6 @@ void LLAgentWearables::removeWearableFinal(const LLWearableType::EType type, boo for (S32 i=max_entry; i>=0; i--) { LLViewerWearable* old_wearable = getViewerWearable(type,i); - //queryWearableCache(); // moved below if (old_wearable) { popWearable(old_wearable); @@ -1211,7 +1211,6 @@ void LLAgentWearables::removeWearableFinal(const LLWearableType::EType type, boo else { LLViewerWearable* old_wearable = getViewerWearable(type, index); - //queryWearableCache(); // moved below if (old_wearable) { @@ -1220,8 +1219,6 @@ void LLAgentWearables::removeWearableFinal(const LLWearableType::EType type, boo } } - queryWearableCache(); - // Update the server updateServer(); gInventory.notifyObservers(); @@ -1357,7 +1354,6 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it mWearablesLoaded = TRUE; checkWearablesLoaded(); notifyLoadingFinished(); - queryWearableCache(); updateServer(); gAgentAvatarp->dumpAvatarTEs("setWearableOutfit"); @@ -1481,71 +1477,11 @@ void LLAgentWearables::setWearableFinal(LLInventoryItem* new_item, LLViewerWeara } //llinfos << "LLVOAvatar::setWearableItem()" << llendl; - queryWearableCache(); //new_wearable->writeToAvatar(TRUE); updateServer(); } -// SUNSHINE CLEANUP dead? -void LLAgentWearables::queryWearableCache() -{ - if (!areWearablesLoaded() || (gAgent.getRegion() && gAgent.getRegion()->getCentralBakeVersion())) - { - return; - } - gAgentAvatarp->setIsUsingServerBakes(false); - - // Look up affected baked textures. - // If they exist: - // disallow updates for affected layersets (until dataserver responds with cache request.) - // If cache miss, turn updates back on and invalidate composite. - // If cache hit, modify baked texture entries. - // - // Cache requests contain list of hashes for each baked texture entry. - // Response is list of valid baked texture assets. (same message) - - gMessageSystem->newMessageFast(_PREHASH_AgentCachedTexture); - gMessageSystem->nextBlockFast(_PREHASH_AgentData); - gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - gMessageSystem->addS32Fast(_PREHASH_SerialNum, gAgentQueryManager.mWearablesCacheQueryID); - - S32 num_queries = 0; - for (U8 baked_index = 0; baked_index < BAKED_NUM_INDICES; baked_index++) - { - LLUUID hash_id = computeBakedTextureHash((EBakedTextureIndex) baked_index); - if (hash_id.notNull()) - { - num_queries++; - // *NOTE: make sure at least one request gets packed - - ETextureIndex te_index = LLAvatarAppearanceDictionary::bakedToLocalTextureIndex((EBakedTextureIndex)baked_index); - - //llinfos << "Requesting texture for hash " << hash << " in baked texture slot " << baked_index << llendl; - gMessageSystem->nextBlockFast(_PREHASH_WearableData); - gMessageSystem->addUUIDFast(_PREHASH_ID, hash_id); - gMessageSystem->addU8Fast(_PREHASH_TextureIndex, (U8)te_index); - } - - gAgentQueryManager.mActiveCacheQueries[baked_index] = gAgentQueryManager.mWearablesCacheQueryID; - } - //VWR-22113: gAgent.getRegion() can return null if invalid, seen here on logout - if(gAgent.getRegion()) - { - if (isAgentAvatarValid()) - { - selfStartPhase("fetch_texture_cache_entries"); - gAgentAvatarp->outputRezTiming("Fetching textures from cache"); - } - - LL_DEBUGS("Avatar") << gAgentAvatarp->avString() << "Requesting texture cache entry for " << num_queries << " baked textures" << LL_ENDL; - gMessageSystem->sendReliable(gAgent.getRegion()->getHost()); - gAgentQueryManager.mNumPendingQueries++; - gAgentQueryManager.mWearablesCacheQueryID++; - } -} - // virtual void LLAgentWearables::invalidateBakedTextureHash(LLMD5& hash) const { diff --git a/indra/newview/llagentwearables.h b/indra/newview/llagentwearables.h index af4b8cd2dd..0583c76dc4 100755 --- a/indra/newview/llagentwearables.h +++ b/indra/newview/llagentwearables.h @@ -166,7 +166,6 @@ protected: // SUNSHINE CLEANUP dead void sendAgentWearablesUpdate(); void sendAgentWearablesRequest(); - void queryWearableCache(); void updateServer(); static void onInitialWearableAssetArrived(LLViewerWearable* wearable, void* userdata); diff --git a/indra/newview/llassetuploadresponders.cpp b/indra/newview/llassetuploadresponders.cpp index ea511b18e2..457ee6916d 100755 --- a/indra/newview/llassetuploadresponders.cpp +++ b/indra/newview/llassetuploadresponders.cpp @@ -450,57 +450,6 @@ void LLNewAgentInventoryResponder::uploadComplete(const LLSD& content) //LLImportColladaAssetCache::getInstance()->assetUploaded(mVFileID, content["new_asset"], TRUE); } -LLSendTexLayerResponder::LLSendTexLayerResponder(const LLSD& post_data, - const LLUUID& vfile_id, - LLAssetType::EType asset_type, - LLBakedUploadData * baked_upload_data) : - LLAssetUploadResponder(post_data, vfile_id, asset_type), - mBakedUploadData(baked_upload_data) -{ -} - -LLSendTexLayerResponder::~LLSendTexLayerResponder() -{ - // mBakedUploadData is normally deleted by calls to LLViewerTexLayerSetBuffer::onTextureUploadComplete() below - if (mBakedUploadData) - { // ...but delete it in the case where uploadComplete() is never called - delete mBakedUploadData; - mBakedUploadData = NULL; - } -} - - -// Baked texture upload completed -void LLSendTexLayerResponder::uploadComplete(const LLSD& content) -{ - LLUUID item_id = mPostData["item_id"]; - - std::string result = content["state"]; - LLUUID new_id = content["new_asset"]; - - llinfos << "result: " << result << " new_id: " << new_id << llendl; - if (result == "complete" - && mBakedUploadData != NULL) - { // Invoke - LLViewerTexLayerSetBuffer::onTextureUploadComplete(new_id, (void*) mBakedUploadData, 0, LL_EXSTAT_NONE); - mBakedUploadData = NULL; // deleted in onTextureUploadComplete() - } - else - { // Invoke the original callback with an error result - LLViewerTexLayerSetBuffer::onTextureUploadComplete(new_id, (void*) mBakedUploadData, -1, LL_EXSTAT_NONE); - mBakedUploadData = NULL; // deleted in onTextureUploadComplete() - } -} - -void LLSendTexLayerResponder::httpFailure() -{ - llwarns << dumpResponse() << llendl; - - // Invoke the original callback with an error result - LLViewerTexLayerSetBuffer::onTextureUploadComplete(LLUUID(), (void*) mBakedUploadData, -1, LL_EXSTAT_NONE); - mBakedUploadData = NULL; // deleted in onTextureUploadComplete() -} - LLUpdateAgentInventoryResponder::LLUpdateAgentInventoryResponder( const LLSD& post_data, const LLUUID& vfile_id, diff --git a/indra/newview/llassetuploadresponders.h b/indra/newview/llassetuploadresponders.h index 7c48f2f06b..7fbebc7481 100755 --- a/indra/newview/llassetuploadresponders.h +++ b/indra/newview/llassetuploadresponders.h @@ -116,28 +116,6 @@ private: Impl* mImpl; }; -// SUNSHINE CLEANUP no upload bakes, remove class. -struct LLBakedUploadData; -class LLSendTexLayerResponder : public LLAssetUploadResponder -{ - LOG_CLASS(LLSendTexLayerResponder); -public: - LLSendTexLayerResponder(const LLSD& post_data, - const LLUUID& vfile_id, - LLAssetType::EType asset_type, - LLBakedUploadData * baked_upload_data); - - ~LLSendTexLayerResponder(); - - virtual void uploadComplete(const LLSD& content); - -protected: - virtual void httpFailure(); - -private: - LLBakedUploadData * mBakedUploadData; -}; - class LLUpdateAgentInventoryResponder : public LLAssetUploadResponder { public: diff --git a/indra/newview/lltextureview.cpp b/indra/newview/lltextureview.cpp index e80136b286..dea1c6c1b2 100755 --- a/indra/newview/lltextureview.cpp +++ b/indra/newview/lltextureview.cpp @@ -431,15 +431,7 @@ void LLAvatarTexBar::draw() if (!layerset_buffer) continue; LLColor4 text_color = LLColor4::white; - - if (layerset_buffer->uploadNeeded()) - { - text_color = LLColor4::red; - } - if (layerset_buffer->uploadInProgress()) - { - text_color = LLColor4::magenta; - } + std::string text = layerset_buffer->dumpTextureInfo(); LLFontGL::getFontMonospace()->renderUTF8(text, 0, l_offset, v_offset + line_height*line_num, text_color, LLFontGL::LEFT, LLFontGL::TOP); //, LLFontGL::BOLD, LLFontGL::DROP_SHADOW_SOFT); diff --git a/indra/newview/llviewertexlayer.cpp b/indra/newview/llviewertexlayer.cpp index c17e85f7a6..67aa105863 100755 --- a/indra/newview/llviewertexlayer.cpp +++ b/indra/newview/llviewertexlayer.cpp @@ -37,7 +37,6 @@ #include "llglslshader.h" #include "llvoavatarself.h" #include "pipeline.h" -#include "llassetuploadresponders.h" #include "llviewercontrol.h" static const S32 BAKE_UPLOAD_ATTEMPTS = 7; @@ -46,22 +45,6 @@ static const F32 BAKE_UPLOAD_RETRY_DELAY = 2.f; // actual delay grows by power o // runway consolidate extern std::string self_av_string(); - -//----------------------------------------------------------------------------- -// LLBakedUploadData() -//----------------------------------------------------------------------------- -LLBakedUploadData::LLBakedUploadData(const LLVOAvatarSelf* avatar, - LLViewerTexLayerSet* layerset, - const LLUUID& id, - bool highest_res) : - mAvatar(avatar), - mTexLayerSet(layerset), - mID(id), - mStartTime(LLFrameTimer::getTotalTime()), // Record starting time - mIsHighestRes(highest_res) -{ -} - //----------------------------------------------------------------------------- // LLViewerTexLayerSetBuffer // The composite image that a LLViewerTexLayerSet writes to. Each LLViewerTexLayerSet has one. @@ -75,15 +58,10 @@ LLViewerTexLayerSetBuffer::LLViewerTexLayerSetBuffer(LLTexLayerSet* const owner, // ORDER_LAST => must render these after the hints are created. LLTexLayerSetBuffer(owner), LLViewerDynamicTexture( width, height, 4, LLViewerDynamicTexture::ORDER_LAST, TRUE ), - mUploadPending(FALSE), // Not used for any logic here, just to sync sending of updates - mNeedsUpload(FALSE), - mNumLowresUploads(0), - mUploadFailCount(0), mNeedsUpdate(TRUE), mNumLowresUpdates(0) { LLViewerTexLayerSetBuffer::sGLByteCount += getSize(); - mNeedsUploadTimer.start(); mNeedsUpdateTimer.start(); } @@ -126,33 +104,6 @@ void LLViewerTexLayerSetBuffer::requestUpdate() restartUpdateTimer(); mNeedsUpdate = TRUE; mNumLowresUpdates = 0; - // If we're in the middle of uploading a baked texture, we don't care about it any more. - // When it's downloaded, ignore it. - mUploadID.setNull(); -} - -void LLViewerTexLayerSetBuffer::requestUpload() -{ - conditionalRestartUploadTimer(); - mNeedsUpload = TRUE; - mNumLowresUploads = 0; - mUploadPending = TRUE; -} - -void LLViewerTexLayerSetBuffer::conditionalRestartUploadTimer() -{ - // If we requested a new upload but haven't even uploaded - // a low res version of our last upload request, then - // keep the timer ticking instead of resetting it. - if (mNeedsUpload && (mNumLowresUploads == 0)) - { - mNeedsUploadTimer.unpause(); - } - else - { - mNeedsUploadTimer.reset(); - mNeedsUploadTimer.start(); - } } void LLViewerTexLayerSetBuffer::restartUpdateTimer() @@ -161,25 +112,16 @@ void LLViewerTexLayerSetBuffer::restartUpdateTimer() mNeedsUpdateTimer.start(); } -void LLViewerTexLayerSetBuffer::cancelUpload() -{ - mNeedsUpload = FALSE; - mUploadPending = FALSE; - mNeedsUploadTimer.pause(); - mUploadRetryTimer.reset(); -} - // virtual BOOL LLViewerTexLayerSetBuffer::needsRender() { llassert(mTexLayerSet->getAvatarAppearance() == gAgentAvatarp); if (!isAgentAvatarValid()) return FALSE; - const BOOL upload_now = mNeedsUpload && isReadyToUpload(); const BOOL update_now = mNeedsUpdate && isReadyToUpdate(); - // Don't render if we don't want to (or aren't ready to) upload or update. - if (!(update_now || upload_now)) + // Don't render if we don't want to (or aren't ready to) update. + if (!update_now) { return FALSE; } @@ -190,11 +132,10 @@ BOOL LLViewerTexLayerSetBuffer::needsRender() return FALSE; } - // Don't render if we are trying to create a shirt texture but aren't wearing a skirt. + // Don't render if we are trying to create a skirt texture but aren't wearing a skirt. if (gAgentAvatarp->getBakedTE(getViewerTexLayerSet()) == LLAvatarAppearanceDefines::TEX_SKIRT_BAKED && !gAgentAvatarp->isWearingWearableType(LLWearableType::WT_SKIRT)) { - cancelUpload(); return FALSE; } @@ -222,36 +163,7 @@ void LLViewerTexLayerSetBuffer::postRenderTexLayerSet(BOOL success) // virtual void LLViewerTexLayerSetBuffer::midRenderTexLayerSet(BOOL success) { - // do we need to upload, and do we have sufficient data to create an uploadable composite? - // TODO: When do we upload the texture if gAgent.mNumPendingQueries is non-zero? - const BOOL upload_now = mNeedsUpload && isReadyToUpload(); const BOOL update_now = mNeedsUpdate && isReadyToUpdate(); - - if(upload_now) - { - if (!success) - { - llinfos << "Failed attempt to bake " << mTexLayerSet->getBodyRegionName() << llendl; - mUploadPending = FALSE; - } - else - { - LLViewerTexLayerSet* layer_set = getViewerTexLayerSet(); - if (layer_set->isVisible()) - { - layer_set->getAvatar()->debugBakedTextureUpload(layer_set->getBakedTexIndex(), FALSE); // FALSE for start of upload, TRUE for finish. - doUpload(); - } - else - { - mUploadPending = FALSE; - mNeedsUpload = FALSE; - mNeedsUploadTimer.pause(); - layer_set->getAvatar()->setNewBakedTexture(layer_set->getBakedTexIndex(),IMG_INVISIBLE); - } - } - } - if (update_now) { doUpdate(); @@ -267,61 +179,6 @@ BOOL LLViewerTexLayerSetBuffer::isInitialized(void) const return mGLTexturep.notNull() && mGLTexturep->isGLTextureCreated(); } -BOOL LLViewerTexLayerSetBuffer::uploadPending() const -{ - return mUploadPending; -} - -// SUNSHINE CLEANUP no upload -BOOL LLViewerTexLayerSetBuffer::uploadNeeded() const -{ - return mNeedsUpload; -} - -BOOL LLViewerTexLayerSetBuffer::uploadInProgress() const -{ - return !mUploadID.isNull(); -} - -BOOL LLViewerTexLayerSetBuffer::isReadyToUpload() const -{ - if (!gAgentQueryManager.hasNoPendingQueries()) return FALSE; // Can't upload if there are pending queries. - if (isAgentAvatarValid() && gAgentAvatarp->isEditingAppearance()) return FALSE; // Don't upload if avatar is being edited. - - BOOL ready = FALSE; - if (getViewerTexLayerSet()->isLocalTextureDataFinal()) - { - // If we requested an upload and have the final LOD ready, upload (or wait a while if this is a retry) - if (mUploadFailCount == 0) - { - ready = TRUE; - } - else - { - ready = mUploadRetryTimer.getElapsedTimeF32() >= BAKE_UPLOAD_RETRY_DELAY * (1 << (mUploadFailCount - 1)); - } - } - else - { - // Upload if we've hit a timeout. Upload is a pretty expensive process so we need to make sure - // we aren't doing uploads too frequently. - const U32 texture_timeout = gSavedSettings.getU32("AvatarBakedTextureUploadTimeout"); - if (texture_timeout != 0) - { - // The timeout period increases exponentially between every lowres upload in order to prevent - // spamming the server with frequent uploads. - const U32 texture_timeout_threshold = texture_timeout*(1 << mNumLowresUploads); - - // If we hit our timeout and have textures available at even lower resolution, then upload. - const BOOL is_upload_textures_timeout = mNeedsUploadTimer.getElapsedTimeF32() >= texture_timeout_threshold; - const BOOL has_lower_lod = getViewerTexLayerSet()->isLocalTextureDataAvailable(); - ready = has_lower_lod && is_upload_textures_timeout; - } - } - - return ready; -} - BOOL LLViewerTexLayerSetBuffer::isReadyToUpdate() const { // If we requested an update and have the final LOD ready, then update. @@ -359,159 +216,6 @@ BOOL LLViewerTexLayerSetBuffer::requestUpdateImmediate() return result; } -// Create the baked texture, send it out to the server, then wait for it to come -// back so we can switch to using it. -void LLViewerTexLayerSetBuffer::doUpload() -{ - LLViewerTexLayerSet* layer_set = getViewerTexLayerSet(); - LL_DEBUGS("Avatar") << "Uploading baked " << layer_set->getBodyRegionName() << llendl; - LLViewerStats::getInstance()->incStat(LLViewerStats::ST_TEX_BAKES); - - // Don't need caches since we're baked now. (note: we won't *really* be baked - // until this image is sent to the server and the Avatar Appearance message is received.) - layer_set->deleteCaches(); - - // Get the COLOR information from our texture - U8* baked_color_data = new U8[ mFullWidth * mFullHeight * 4 ]; - glReadPixels(mOrigin.mX, mOrigin.mY, mFullWidth, mFullHeight, GL_RGBA, GL_UNSIGNED_BYTE, baked_color_data ); - stop_glerror(); - - // Get the MASK information from our texture - LLGLSUIDefault gls_ui; - LLPointer<LLImageRaw> baked_mask_image = new LLImageRaw(mFullWidth, mFullHeight, 1 ); - U8* baked_mask_data = baked_mask_image->getData(); - layer_set->gatherMorphMaskAlpha(baked_mask_data, - mOrigin.mX, mOrigin.mY, - mFullWidth, mFullHeight); - - - // Create the baked image from our color and mask information - const S32 baked_image_components = 5; // red green blue [bump] clothing - LLPointer<LLImageRaw> baked_image = new LLImageRaw( mFullWidth, mFullHeight, baked_image_components ); - U8* baked_image_data = baked_image->getData(); - S32 i = 0; - for (S32 u=0; u < mFullWidth; u++) - { - for (S32 v=0; v < mFullHeight; v++) - { - baked_image_data[5*i + 0] = baked_color_data[4*i + 0]; - baked_image_data[5*i + 1] = baked_color_data[4*i + 1]; - baked_image_data[5*i + 2] = baked_color_data[4*i + 2]; - baked_image_data[5*i + 3] = baked_color_data[4*i + 3]; // alpha should be correct for eyelashes. - baked_image_data[5*i + 4] = baked_mask_data[i]; - i++; - } - } - - LLPointer<LLImageJ2C> compressedImage = new LLImageJ2C; - const char* comment_text = LINDEN_J2C_COMMENT_PREFIX "RGBHM"; // writes into baked_color_data. 5 channels (rgb, heightfield/alpha, mask) - if (compressedImage->encode(baked_image, comment_text)) - { - LLTransactionID tid; - tid.generate(); - const LLAssetID asset_id = tid.makeAssetID(gAgent.getSecureSessionID()); - if (LLVFile::writeFile(compressedImage->getData(), compressedImage->getDataSize(), - gVFS, asset_id, LLAssetType::AT_TEXTURE)) - { - // Read back the file and validate. - BOOL valid = FALSE; - LLPointer<LLImageJ2C> integrity_test = new LLImageJ2C; - S32 file_size = 0; - LLVFile file(gVFS, asset_id, LLAssetType::AT_TEXTURE); - file_size = file.getSize(); - U8* data = integrity_test->allocateData(file_size); - file.read(data, file_size); - if (data) - { - valid = integrity_test->validate(data, file_size); // integrity_test will delete 'data' - } - else - { - integrity_test->setLastError("Unable to read entire file"); - } - - if (valid) - { - const bool highest_lod = layer_set->isLocalTextureDataFinal(); - // Baked_upload_data is owned by the responder and deleted after the request completes. - LLBakedUploadData* baked_upload_data = new LLBakedUploadData(gAgentAvatarp, - layer_set, - asset_id, - highest_lod); - // upload ID is used to avoid overlaps, e.g. when the user rapidly makes two changes outside of Face Edit. - mUploadID = asset_id; - - // Upload the image - const std::string url = gAgent.getRegion()->getCapability("UploadBakedTexture"); - if(!url.empty() - && !LLPipeline::sForceOldBakedUpload // toggle debug setting UploadBakedTexOld to change between the new caps method and old method - && (mUploadFailCount < (BAKE_UPLOAD_ATTEMPTS - 1))) // Try last ditch attempt via asset store if cap upload is failing. - { - LLSD body = LLSD::emptyMap(); - // The responder will call LLViewerTexLayerSetBuffer::onTextureUploadComplete() - LLHTTPClient::post(url, body, new LLSendTexLayerResponder(body, mUploadID, LLAssetType::AT_TEXTURE, baked_upload_data)); - llinfos << "Baked texture upload via capability of " << mUploadID << " to " << url << llendl; - } - else - { - gAssetStorage->storeAssetData(tid, - LLAssetType::AT_TEXTURE, - LLViewerTexLayerSetBuffer::onTextureUploadComplete, - baked_upload_data, - TRUE, // temp_file - TRUE, // is_priority - TRUE); // store_local - llinfos << "Baked texture upload via Asset Store." << llendl; - } - - if (highest_lod) - { - // Sending the final LOD for the baked texture. All done, pause - // the upload timer so we know how long it took. - mNeedsUpload = FALSE; - mNeedsUploadTimer.pause(); - } - else - { - // Sending a lower level LOD for the baked texture. Restart the upload timer. - mNumLowresUploads++; - mNeedsUploadTimer.unpause(); - mNeedsUploadTimer.reset(); - } - - // Print out notification that we uploaded this texture. - if (gSavedSettings.getBOOL("DebugAvatarRezTime")) - { - const std::string lod_str = highest_lod ? "HighRes" : "LowRes"; - LLSD args; - args["EXISTENCE"] = llformat("%d",(U32)layer_set->getAvatar()->debugGetExistenceTimeElapsedF32()); - args["TIME"] = llformat("%d",(U32)mNeedsUploadTimer.getElapsedTimeF32()); - args["BODYREGION"] = layer_set->getBodyRegionName(); - args["RESOLUTION"] = lod_str; - LLNotificationsUtil::add("AvatarRezSelfBakedTextureUploadNotification",args); - LL_DEBUGS("Avatar") << self_av_string() << "Uploading [ name: " << layer_set->getBodyRegionName() << " res:" << lod_str << " time:" << (U32)mNeedsUploadTimer.getElapsedTimeF32() << " ]" << LL_ENDL; - } - } - else - { - // The read back and validate operation failed. Remove the uploaded file. - mUploadPending = FALSE; - LLVFile file(gVFS, asset_id, LLAssetType::AT_TEXTURE, LLVFile::WRITE); - file.remove(); - llinfos << "Unable to create baked upload file (reason: corrupted)." << llendl; - } - } - } - else - { - // The VFS write file operation failed. - mUploadPending = FALSE; - llinfos << "Unable to create baked upload file (reason: failed to write file)" << llendl; - } - - delete [] baked_color_data; -} - // Mostly bookkeeping; don't need to actually "do" anything since // render() will actually do the update. void LLViewerTexLayerSetBuffer::doUpdate() @@ -548,82 +252,6 @@ void LLViewerTexLayerSetBuffer::doUpdate() } } -// static -void LLViewerTexLayerSetBuffer::onTextureUploadComplete(const LLUUID& uuid, - void* userdata, - S32 result, - LLExtStat ext_status) // StoreAssetData callback (not fixed) -{ - LLBakedUploadData* baked_upload_data = (LLBakedUploadData*)userdata; - - if (isAgentAvatarValid() && - !gAgentAvatarp->isDead() && - (baked_upload_data->mAvatar == gAgentAvatarp) && // Sanity check: only the user's avatar should be uploading textures. - (baked_upload_data->mTexLayerSet->hasComposite())) - { - LLViewerTexLayerSetBuffer* layerset_buffer = baked_upload_data->mTexLayerSet->getViewerComposite(); - S32 failures = layerset_buffer->mUploadFailCount; - layerset_buffer->mUploadFailCount = 0; - - if (layerset_buffer->mUploadID.isNull()) - { - // The upload got canceled, we should be in the - // process of baking a new texture so request an - // upload with the new data - - // BAP: does this really belong in this callback, as - // opposed to where the cancellation takes place? - // suspect this does nothing. - layerset_buffer->requestUpload(); - } - else if (baked_upload_data->mID == layerset_buffer->mUploadID) - { - // This is the upload we're currently waiting for. - layerset_buffer->mUploadID.setNull(); - const std::string name(baked_upload_data->mTexLayerSet->getBodyRegionName()); - const std::string resolution = baked_upload_data->mIsHighestRes ? " full res " : " low res "; - if (result >= 0) - { - layerset_buffer->mUploadPending = FALSE; // Allows sending of AgentSetAppearance later - LLAvatarAppearanceDefines::ETextureIndex baked_te = gAgentAvatarp->getBakedTE(layerset_buffer->getViewerTexLayerSet()); - // Update baked texture info with the new UUID - U64 now = LLFrameTimer::getTotalTime(); // Record starting time - llinfos << "Baked" << resolution << "texture upload for " << name << " took " << (S32)((now - baked_upload_data->mStartTime) / 1000) << " ms" << llendl; - gAgentAvatarp->setNewBakedTexture(baked_te, uuid); - } - else - { - ++failures; - S32 max_attempts = baked_upload_data->mIsHighestRes ? BAKE_UPLOAD_ATTEMPTS : 1; // only retry final bakes - llwarns << "Baked" << resolution << "texture upload for " << name << " failed (attempt " << failures << "/" << max_attempts << ")" << llendl; - if (failures < max_attempts) - { - layerset_buffer->mUploadFailCount = failures; - layerset_buffer->mUploadRetryTimer.start(); - layerset_buffer->requestUpload(); - } - } - } - else - { - llinfos << "Received baked texture out of date, ignored." << llendl; - } - - gAgentAvatarp->dirtyMesh(); - } - else - { - // Baked texture failed to upload (in which case since we - // didn't set the new baked texture, it means that they'll try - // and rebake it at some point in the future (after login?)), - // or this response to upload is out of date, in which case a - // current response should be on the way or already processed. - llwarns << "Baked upload failed" << llendl; - } - - delete baked_upload_data; -} - //----------------------------------------------------------------------------- // LLViewerTexLayerSet // An ordered set of texture layers that get composited into a single texture. @@ -665,20 +293,6 @@ void LLViewerTexLayerSet::requestUpdate() } } -void LLViewerTexLayerSet::requestUpload() -{ - createComposite(); - getViewerComposite()->requestUpload(); -} - -void LLViewerTexLayerSet::cancelUpload() -{ - if(mComposite) - { - getViewerComposite()->cancelUpload(); - } -} - void LLViewerTexLayerSet::updateComposite() { createComposite(); @@ -727,18 +341,17 @@ const LLViewerTexLayerSetBuffer* LLViewerTexLayerSet::getViewerComposite() const } +// SUNSHINE CLEANUP - this used to have a bunch of upload related stuff, doesn't really serve a purpose now. const std::string LLViewerTexLayerSetBuffer::dumpTextureInfo() const { if (!isAgentAvatarValid()) return ""; - const BOOL is_high_res = !mNeedsUpload; - const U32 num_low_res = mNumLowresUploads; - const U32 upload_time = (U32)mNeedsUploadTimer.getElapsedTimeF32(); + const BOOL is_high_res = TRUE; + const U32 num_low_res = 0; + const U32 upload_time = 0; const std::string local_texture_info = gAgentAvatarp->debugDumpLocalTextureDataInfo(getViewerTexLayerSet()); - std::string status = "CREATING "; - if (!uploadNeeded()) status = "DONE "; - if (uploadInProgress()) status = "UPLOADING"; + std::string status = "DONE "; std::string text = llformat("[%s] [HiRes:%d LoRes:%d] [Elapsed:%d] %s", status.c_str(), diff --git a/indra/newview/llviewertexlayer.h b/indra/newview/llviewertexlayer.h index aa4bad3422..027ae255ec 100755 --- a/indra/newview/llviewertexlayer.h +++ b/indra/newview/llviewertexlayer.h @@ -47,8 +47,6 @@ public: virtual ~LLViewerTexLayerSet(); /*virtual*/void requestUpdate(); - void requestUpload(); - void cancelUpload(); BOOL isLocalTextureDataAvailable() const; BOOL isLocalTextureDataFinal() const; void updateComposite(); @@ -115,47 +113,6 @@ protected: virtual void postRender(BOOL success) { postRenderTexLayerSet(success); } virtual BOOL render() { return renderTexLayerSet(); } - //-------------------------------------------------------------------- - // Uploads - //-------------------------------------------------------------------- -public: - // SUNSHINE CLEANUP no upload - void requestUpload(); - // SUNSHINE CLEANUP no upload - void cancelUpload(); - // SUNSHINE CLEANUP no upload - BOOL uploadNeeded() const; // We need to upload a new texture - // SUNSHINE CLEANUP no upload - BOOL uploadInProgress() const; // We have started uploading a new texture and are awaiting the result - // SUNSHINE CLEANUP no upload - BOOL uploadPending() const; // We are expecting a new texture to be uploaded at some point - // SUNSHINE CLEANUP no upload - static void onTextureUploadComplete(const LLUUID& uuid, - void* userdata, - S32 result, LLExtStat ext_status); -protected: - // SUNSHINE CLEANUP no upload - BOOL isReadyToUpload() const; - // SUNSHINE CLEANUP no upload - void doUpload(); // Does a read back and upload. - // SUNSHINE CLEANUP no upload - void conditionalRestartUploadTimer(); -private: - // SUNSHINE CLEANUP no upload - BOOL mNeedsUpload; // Whether we need to send our baked textures to the server - // SUNSHINE CLEANUP no upload - U32 mNumLowresUploads; // Number of times we've sent a lowres version of our baked textures to the server - // SUNSHINE CLEANUP no upload - BOOL mUploadPending; // Whether we have received back the new baked textures - // SUNSHINE CLEANUP no upload - LLUUID mUploadID; // The current upload process (null if none). - // SUNSHINE CLEANUP no upload - LLFrameTimer mNeedsUploadTimer; // Tracks time since upload was requested and performed. - // SUNSHINE CLEANUP no upload - S32 mUploadFailCount; // Number of consecutive upload failures - // SUNSHINE CLEANUP no upload - LLFrameTimer mUploadRetryTimer; // Tracks time since last upload failure. - //-------------------------------------------------------------------- // Updates //-------------------------------------------------------------------- @@ -172,26 +129,5 @@ private: LLFrameTimer mNeedsUpdateTimer; // Tracks time since update was requested and performed. }; - -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// LLBakedUploadData -// -// Used by LLTexLayerSetBuffer for a callback. -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// SUNSHINE CLEANUP no upload -struct LLBakedUploadData -{ - LLBakedUploadData(const LLVOAvatarSelf* avatar, - LLViewerTexLayerSet* layerset, - const LLUUID& id, - bool highest_res); - ~LLBakedUploadData() {} - const LLUUID mID; - const LLVOAvatarSelf* mAvatar; // note: backlink only; don't LLPointer - LLViewerTexLayerSet* mTexLayerSet; - const U64 mStartTime; // for measuring baked texture upload time - const bool mIsHighestRes; // whether this is a "final" bake, or intermediate low res -}; - #endif // LL_VIEWER_TEXLAYER_H diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 4c568c9bed..4cea3d3f58 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -673,7 +673,6 @@ LLJoint *LLVOAvatarSelf::getJoint(const std::string &name) return LLVOAvatar::getJoint(name); } // virtual -// SUNSHINE CLEANUP no upload_bake BOOL LLVOAvatarSelf::setVisualParamWeight(const LLVisualParam *which_param, F32 weight) { if (!which_param) @@ -685,7 +684,6 @@ BOOL LLVOAvatarSelf::setVisualParamWeight(const LLVisualParam *which_param, F32 } // virtual -// SUNSHINE CLEANUP no upload_bake BOOL LLVOAvatarSelf::setVisualParamWeight(const char* param_name, F32 weight) { if (!param_name) @@ -697,14 +695,12 @@ BOOL LLVOAvatarSelf::setVisualParamWeight(const char* param_name, F32 weight) } // virtual -// SUNSHINE CLEANUP no upload_bake BOOL LLVOAvatarSelf::setVisualParamWeight(S32 index, F32 weight) { LLViewerVisualParam *param = (LLViewerVisualParam*) LLCharacter::getVisualParam(index); return setParamWeight(param,weight); } -// SUNSHINE CLEANUP no upload_bake BOOL LLVOAvatarSelf::setParamWeight(const LLViewerVisualParam *param, F32 weight) { if (!param) @@ -893,10 +889,6 @@ void LLVOAvatarSelf::removeMissingBakedTextures() invalidateComposite(layerset); } updateMeshTextures(); - if (getRegion() && !getRegion()->getCentralBakeVersion()) - { - requestLayerSetUploads(); - } } } @@ -1512,15 +1504,6 @@ BOOL LLVOAvatarSelf::isAllLocalTextureDataFinal() const return TRUE; } -BOOL LLVOAvatarSelf::isBakedTextureFinal(const LLAvatarAppearanceDefines::EBakedTextureIndex index) const -{ - const LLViewerTexLayerSet *layerset = getLayerSet(index); - if (!layerset) return FALSE; - const LLViewerTexLayerSetBuffer *layerset_buffer = layerset->getViewerComposite(); - if (!layerset_buffer) return FALSE; - return !layerset_buffer->uploadNeeded(); -} - BOOL LLVOAvatarSelf::isTextureDefined(LLAvatarAppearanceDefines::ETextureIndex type, U32 index) const { LLUUID id; @@ -1578,49 +1561,11 @@ BOOL LLVOAvatarSelf::isTextureVisible(LLAvatarAppearanceDefines::ETextureIndex t return isTextureVisible(type,index); } - -//----------------------------------------------------------------------------- -// requestLayerSetUploads() -//----------------------------------------------------------------------------- -void LLVOAvatarSelf::requestLayerSetUploads() -{ - for (U32 i = 0; i < mBakedTextureDatas.size(); i++) - { - requestLayerSetUpload((EBakedTextureIndex)i); - } -} - -void LLVOAvatarSelf::requestLayerSetUpload(LLAvatarAppearanceDefines::EBakedTextureIndex i) -{ - ETextureIndex tex_index = mBakedTextureDatas[i].mTextureIndex; - const BOOL layer_baked = isTextureDefined(tex_index, gAgentWearables.getWearableCount(tex_index)); - LLViewerTexLayerSet *layerset = getLayerSet(i); - if (!layer_baked && layerset) - { - layerset->requestUpload(); - } -} - bool LLVOAvatarSelf::areTexturesCurrent() const { - return !hasPendingBakedUploads() && gAgentWearables.areWearablesLoaded(); -} - -// virtual -bool LLVOAvatarSelf::hasPendingBakedUploads() const -{ - for (U32 i = 0; i < mBakedTextureDatas.size(); i++) - { - LLViewerTexLayerSet* layerset = getTexLayerSet(i); - if (layerset && layerset->getViewerComposite() && layerset->getViewerComposite()->uploadPending()) - { - return true; - } - } - return false; + return gAgentWearables.areWearablesLoaded(); } -// SUNSHINE CLEANUP no upload_bake void LLVOAvatarSelf::invalidateComposite( LLTexLayerSet* layerset) { LLViewerTexLayerSet *layer_set = dynamic_cast<LLViewerTexLayerSet*>(layerset); @@ -2694,7 +2639,9 @@ void LLVOAvatarSelf::setNewBakedTexture(LLAvatarAppearanceDefines::EBakedTexture void LLVOAvatarSelf::setNewBakedTexture( ETextureIndex te, const LLUUID& uuid ) { // SUNSHINE CLEANUP + // If we reinstate processUpdateMessage(), this needs to be updated for server-bake textures. llassert(false); + // Baked textures live on other sims. LLHost target_host = getObjectHost(); setTEImage( te, LLViewerTextureManager::getFetchedTextureFromHost( uuid, FTT_HOST_BAKE, target_host ) ); @@ -2719,40 +2666,37 @@ void LLVOAvatarSelf::setNewBakedTexture( ETextureIndex te, const LLUUID& uuid ) // dumpAvatarTEs( "setNewBakedTexture() send" ); // RN: throttle uploads - if (!hasPendingBakedUploads()) - { - if (gSavedSettings.getBOOL("DebugAvatarRezTime")) + if (gSavedSettings.getBOOL("DebugAvatarRezTime")) + { + LLSD args; + args["EXISTENCE"] = llformat("%d",(U32)mDebugExistenceTimer.getElapsedTimeF32()); + args["TIME"] = llformat("%d",(U32)mDebugSelfLoadTimer.getElapsedTimeF32()); + if (isAllLocalTextureDataFinal()) + { + LLNotificationsUtil::add("AvatarRezSelfBakedDoneNotification",args); + LL_DEBUGS("Avatar") << "REZTIME: [ " << (U32)mDebugExistenceTimer.getElapsedTimeF32() + << "sec ]" + << avString() + << "RuthTimer " << (U32)mRuthDebugTimer.getElapsedTimeF32() + << " SelfLoadTimer " << (U32)mDebugSelfLoadTimer.getElapsedTimeF32() + << " Notification " << "AvatarRezSelfBakedDoneNotification" + << llendl; + } + else { - LLSD args; - args["EXISTENCE"] = llformat("%d",(U32)mDebugExistenceTimer.getElapsedTimeF32()); - args["TIME"] = llformat("%d",(U32)mDebugSelfLoadTimer.getElapsedTimeF32()); - if (isAllLocalTextureDataFinal()) - { - LLNotificationsUtil::add("AvatarRezSelfBakedDoneNotification",args); - LL_DEBUGS("Avatar") << "REZTIME: [ " << (U32)mDebugExistenceTimer.getElapsedTimeF32() - << "sec ]" - << avString() - << "RuthTimer " << (U32)mRuthDebugTimer.getElapsedTimeF32() - << " SelfLoadTimer " << (U32)mDebugSelfLoadTimer.getElapsedTimeF32() - << " Notification " << "AvatarRezSelfBakedDoneNotification" - << llendl; - } - else - { - args["STATUS"] = debugDumpAllLocalTextureDataInfo(); - LLNotificationsUtil::add("AvatarRezSelfBakedUpdateNotification",args); - LL_DEBUGS("Avatar") << "REZTIME: [ " << (U32)mDebugExistenceTimer.getElapsedTimeF32() - << "sec ]" - << avString() - << "RuthTimer " << (U32)mRuthDebugTimer.getElapsedTimeF32() - << " SelfLoadTimer " << (U32)mDebugSelfLoadTimer.getElapsedTimeF32() - << " Notification " << "AvatarRezSelfBakedUpdateNotification" - << llendl; - } + args["STATUS"] = debugDumpAllLocalTextureDataInfo(); + LLNotificationsUtil::add("AvatarRezSelfBakedUpdateNotification",args); + LL_DEBUGS("Avatar") << "REZTIME: [ " << (U32)mDebugExistenceTimer.getElapsedTimeF32() + << "sec ]" + << avString() + << "RuthTimer " << (U32)mRuthDebugTimer.getElapsedTimeF32() + << " SelfLoadTimer " << (U32)mDebugSelfLoadTimer.getElapsedTimeF32() + << " Notification " << "AvatarRezSelfBakedUpdateNotification" + << llendl; } - - outputRezDiagnostics(); } + + outputRezDiagnostics(); } // FIXME: This is not called consistently. Something may be broken. @@ -2830,40 +2774,6 @@ void LLVOAvatarSelf::reportAvatarRezTime() const // TODO: report mDebugSelfLoadTimer.getElapsedTimeF32() somehow. } -//----------------------------------------------------------------------------- -// setCachedBakedTexture() -// A baked texture id was received from a cache query, make it active -//----------------------------------------------------------------------------- -void LLVOAvatarSelf::setCachedBakedTexture( ETextureIndex te, const LLUUID& uuid ) -{ - setTETexture( te, uuid ); - - /* switch(te) - case TEX_HEAD_BAKED: - if( mHeadLayerSet ) - mHeadLayerSet->cancelUpload(); */ - for (U32 i = 0; i < mBakedTextureDatas.size(); i++) - { - LLViewerTexLayerSet *layerset = getTexLayerSet(i); - if ( mBakedTextureDatas[i].mTextureIndex == te && layerset) - { - if (mInitialBakeIDs[i] != LLUUID::null) - { - if (mInitialBakeIDs[i] == uuid) - { - llinfos << "baked texture correctly loaded at login! " << i << llendl; - } - else - { - llwarns << "baked texture does not match id loaded at login!" << i << llendl; - } - mInitialBakeIDs[i] = LLUUID::null; - } - layerset->cancelUpload(); - } - } -} - // static void LLVOAvatarSelf::processRebakeAvatarTextures(LLMessageSystem* msg, void**) { @@ -2926,7 +2836,6 @@ void LLVOAvatarSelf::forceBakeAllTextures(bool slam_for_debug) if (slam_for_debug) { layer_set->setUpdatesEnabled(TRUE); - layer_set->cancelUpload(); } invalidateComposite(layer_set); diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index 32d9012862..6ed3640e9e 100755 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -197,12 +197,10 @@ public: //-------------------------------------------------------------------- public: // SUNSHINE CLEANUP - /*virtual*/ bool hasPendingBakedUploads() const; S32 getLocalDiscardLevel(LLAvatarAppearanceDefines::ETextureIndex type, U32 index) const; bool areTexturesCurrent() const; BOOL isLocalTextureDataAvailable(const LLViewerTexLayerSet* layerset) const; BOOL isLocalTextureDataFinal(const LLViewerTexLayerSet* layerset) const; - BOOL isBakedTextureFinal(const LLAvatarAppearanceDefines::EBakedTextureIndex index) const; // If you want to check all textures of a given type, pass gAgentWearables.getWearableCount() for index /*virtual*/ BOOL isTextureDefined(LLAvatarAppearanceDefines::ETextureIndex type, U32 index) const; /*virtual*/ BOOL isTextureVisible(LLAvatarAppearanceDefines::ETextureIndex type, U32 index = 0) const; @@ -237,9 +235,9 @@ private: //-------------------------------------------------------------------- public: LLAvatarAppearanceDefines::ETextureIndex getBakedTE(const LLViewerTexLayerSet* layerset ) const; + // SUNSHINE CLEANUP - dead? void setNewBakedTexture(LLAvatarAppearanceDefines::EBakedTextureIndex i, const LLUUID &uuid); void setNewBakedTexture(LLAvatarAppearanceDefines::ETextureIndex i, const LLUUID& uuid); - void setCachedBakedTexture(LLAvatarAppearanceDefines::ETextureIndex i, const LLUUID& uuid); void forceBakeAllTextures(bool slam_for_debug = false); static void processRebakeAvatarTextures(LLMessageSystem* msg, void**); protected: @@ -249,9 +247,6 @@ protected: // Layers //-------------------------------------------------------------------- public: - // SUNSHINE CLEANUP - void requestLayerSetUploads(); - void requestLayerSetUpload(LLAvatarAppearanceDefines::EBakedTextureIndex i); void requestLayerSetUpdate(LLAvatarAppearanceDefines::ETextureIndex i); LLViewerTexLayerSet* getLayerSet(LLAvatarAppearanceDefines::EBakedTextureIndex baked_index) const; LLViewerTexLayerSet* getLayerSet(LLAvatarAppearanceDefines::ETextureIndex index) const; -- cgit v1.2.3 From 9a8afee83f40e7239d98e6cc8cf3297408f51920 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Thu, 19 Sep 2013 17:52:58 -0400 Subject: SH-3455 WIP - removing bake upload code --- indra/newview/llagentwearables.cpp | 5 ++--- indra/newview/llappearancemgr.cpp | 2 +- indra/newview/lllocalbitmaps.cpp | 2 +- indra/newview/llpaneleditwearable.cpp | 10 +++++----- indra/newview/llviewerwearable.cpp | 2 +- indra/newview/llvoavatar.cpp | 3 --- indra/newview/llvoavatar.h | 3 +-- indra/newview/llvoavatarself.cpp | 15 +-------------- indra/newview/llvoavatarself.h | 4 +--- 9 files changed, 13 insertions(+), 33 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index bffdb0a49b..2d3823a6e2 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -441,7 +441,7 @@ void LLAgentWearables::saveWearable(const LLWearableType::EType type, const U32 return; } - gAgentAvatarp->wearableUpdated( type, TRUE ); + gAgentAvatarp->wearableUpdated(type); if (send_update) { @@ -716,8 +716,7 @@ void LLAgentWearables::wearableUpdated(LLWearable *wearable, BOOL removed) { if (isAgentAvatarValid()) { - const BOOL upload_result = removed; - gAgentAvatarp->wearableUpdated(wearable->getType(), upload_result); + gAgentAvatarp->wearableUpdated(wearable->getType()); } LLWearableData::wearableUpdated(wearable, removed); diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 359d5aaa5c..0bf2527195 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -3692,7 +3692,7 @@ bool LLAppearanceMgr::moveWearable(LLViewerInventoryItem* item, bool closer_to_b bool result = false; if (result = gAgentWearables.moveWearable(item, closer_to_body)) { - gAgentAvatarp->wearableUpdated(item->getWearableType(), FALSE); + gAgentAvatarp->wearableUpdated(item->getWearableType()); } setOutfitDirty(true); diff --git a/indra/newview/lllocalbitmaps.cpp b/indra/newview/lllocalbitmaps.cpp index 2d9385390b..88fe389c55 100755 --- a/indra/newview/lllocalbitmaps.cpp +++ b/indra/newview/lllocalbitmaps.cpp @@ -540,7 +540,7 @@ void LLLocalBitmap::updateUserLayers(LLUUID old_id, LLUUID new_id, LLWearableTyp { U32 index = gAgentWearables.getWearableIndex(wearable); gAgentAvatarp->setLocalTexture(reg_texind, gTextureList.getImage(new_id), FALSE, index); - gAgentAvatarp->wearableUpdated(type, FALSE); + gAgentAvatarp->wearableUpdated(type); /* telling the manager to rebake once update cycle is fully done */ LLLocalBitmapMgr::setNeedsRebake(); diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp index 022fd6c062..0be5c19387 100755 --- a/indra/newview/llpaneleditwearable.cpp +++ b/indra/newview/llpaneleditwearable.cpp @@ -982,7 +982,7 @@ void LLPanelEditWearable::onTexturePickerCommit(const LLUICtrl* ctrl) U32 index = gAgentWearables.getWearableIndex(getWearable()); gAgentAvatarp->setLocalTexture(entry->mTextureIndex, image, FALSE, index); LLVisualParamHint::requestHintUpdates(); - gAgentAvatarp->wearableUpdated(type, FALSE); + gAgentAvatarp->wearableUpdated(type); } } else @@ -1008,7 +1008,7 @@ void LLPanelEditWearable::onColorSwatchCommit(const LLUICtrl* ctrl) { getWearable()->setClothesColor(entry->mTextureIndex, new_color); LLVisualParamHint::requestHintUpdates(); - gAgentAvatarp->wearableUpdated(getWearable()->getType(), FALSE); + gAgentAvatarp->wearableUpdated(getWearable()->getType()); } } else @@ -1122,7 +1122,7 @@ void LLPanelEditWearable::revertChanges() mNameEditor->setText(mWearableItem->getName()); updatePanelPickerControls(mWearablePtr->getType()); updateTypeSpecificControls(mWearablePtr->getType()); - gAgentAvatarp->wearableUpdated(mWearablePtr->getType(), FALSE); + gAgentAvatarp->wearableUpdated(mWearablePtr->getType()); } void LLPanelEditWearable::showWearable(LLViewerWearable* wearable, BOOL show, BOOL disable_camera_switch) @@ -1584,7 +1584,7 @@ void LLPanelEditWearable::onInvisibilityCommit(LLCheckBoxCtrl* checkbox_ctrl, LL LLViewerFetchedTexture* image = LLViewerTextureManager::getFetchedTexture( IMG_INVISIBLE ); U32 index = gAgentWearables.getWearableIndex(getWearable()); gAgentAvatarp->setLocalTexture(te, image, FALSE, index); - gAgentAvatarp->wearableUpdated(getWearable()->getType(), FALSE); + gAgentAvatarp->wearableUpdated(getWearable()->getType()); } else { @@ -1601,7 +1601,7 @@ void LLPanelEditWearable::onInvisibilityCommit(LLCheckBoxCtrl* checkbox_ctrl, LL U32 index = gAgentWearables.getWearableIndex(getWearable()); gAgentAvatarp->setLocalTexture(te, image, FALSE, index); - gAgentAvatarp->wearableUpdated(getWearable()->getType(), FALSE); + gAgentAvatarp->wearableUpdated(getWearable()->getType()); } updatePanelPickerControls(getWearable()->getType()); diff --git a/indra/newview/llviewerwearable.cpp b/indra/newview/llviewerwearable.cpp index d56a7b5dc5..e7fb6aec98 100755 --- a/indra/newview/llviewerwearable.cpp +++ b/indra/newview/llviewerwearable.cpp @@ -397,7 +397,7 @@ void LLViewerWearable::removeFromAvatar( LLWearableType::EType type) } gAgentAvatarp->updateVisualParams(); - gAgentAvatarp->wearableUpdated(type, FALSE); + gAgentAvatarp->wearableUpdated(type); } // Does not copy mAssetID. diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 987beedd9e..63fdff2320 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5344,7 +5344,6 @@ BOOL LLVOAvatar::updateGeometry(LLDrawable *drawable) //----------------------------------------------------------------------------- // updateSexDependentLayerSets() //----------------------------------------------------------------------------- -// SUNSHINE CLEANUP no upload_bake void LLVOAvatar::updateSexDependentLayerSets() { invalidateComposite( mBakedTextureDatas[BAKED_HEAD].mTexLayerSet); @@ -5829,7 +5828,6 @@ BOOL LLVOAvatar::isWearingWearableType(LLWearableType::EType type) const // virtual -// SUNSHINE CLEANUP no upload_result, no-op void LLVOAvatar::invalidateComposite( LLTexLayerSet* layerset) { } @@ -5839,7 +5837,6 @@ void LLVOAvatar::invalidateAll() } // virtual -// SUNSHINE CLEANUP no upload_bake void LLVOAvatar::onGlobalColorChanged(const LLTexGlobalColor* global_color) { if (global_color == mTexSkinColor) diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index c8f9f9bd8d..a4b5db3034 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -402,7 +402,6 @@ public: // Global colors //-------------------------------------------------------------------- public: - // SUNSHINE CLEANUP no upload /*virtual*/void onGlobalColorChanged(const LLTexGlobalColor* global_color); //-------------------------------------------------------------------- @@ -563,7 +562,6 @@ protected: // Composites //-------------------------------------------------------------------- public: - // SUNSHINE CLEANUP no upload virtual void invalidateComposite(LLTexLayerSet* layerset); virtual void invalidateAll(); virtual void setCompositeUpdatesEnabled(bool b) {} @@ -666,6 +664,7 @@ private: F32 mLastAppearanceBlendTime; BOOL mIsEditingAppearance; // flag for if we're actively in appearance editing mode BOOL mUseLocalAppearance; // flag for if we're using a local composite + // SUNSHINE CLEANUP - always true, remove? BOOL mUseServerBakes; // flag for if baked textures should be fetched from baking service (false if they're temporary uploads) //-------------------------------------------------------------------- diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 4cea3d3f58..17e6f4e53e 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -1063,8 +1063,7 @@ void LLVOAvatarSelf::updateAttachmentVisibility(U32 camera_mode) // forces an update to any baked textures relevant to type. // will force an upload of the resulting bake if the second parameter is TRUE //----------------------------------------------------------------------------- -// SUNSHINE CLEANUP no upload_result -void LLVOAvatarSelf::wearableUpdated( LLWearableType::EType type, BOOL upload_result ) +void LLVOAvatarSelf::wearableUpdated(LLWearableType::EType type) { for (LLAvatarAppearanceDictionary::BakedTextures::const_iterator baked_iter = LLAvatarAppearanceDictionary::getInstance()->getBakedTextures().begin(); baked_iter != LLAvatarAppearanceDictionary::getInstance()->getBakedTextures().end(); @@ -1577,18 +1576,6 @@ void LLVOAvatarSelf::invalidateComposite( LLTexLayerSet* layerset) layer_set->requestUpdate(); layer_set->invalidateMorphMasks(); - -#if 0 // SUNSHINE CLEANUP - if( upload_result && (getRegion() && !getRegion()->getCentralBakeVersion())) - { - llassert(isSelf()); - - ETextureIndex baked_te = getBakedTE( layer_set ); - setTEImage( baked_te, LLViewerTextureManager::getFetchedTexture(IMG_DEFAULT_AVATAR) ); - layer_set->requestUpload(); - updateMeshTextures(); - } -#endif } void LLVOAvatarSelf::invalidateAll() diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index 6ed3640e9e..1f0fdd101a 100755 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -196,7 +196,6 @@ public: // Loading status //-------------------------------------------------------------------- public: - // SUNSHINE CLEANUP S32 getLocalDiscardLevel(LLAvatarAppearanceDefines::ETextureIndex type, U32 index) const; bool areTexturesCurrent() const; BOOL isLocalTextureDataAvailable(const LLViewerTexLayerSet* layerset) const; @@ -256,7 +255,6 @@ public: // Composites //-------------------------------------------------------------------- public: - // SUNSHINE CLEANUP no upload /* virtual */ void invalidateComposite(LLTexLayerSet* layerset); /* virtual */ void invalidateAll(); /* virtual */ void setCompositeUpdatesEnabled(bool b); // only works for self @@ -300,7 +298,7 @@ protected: **/ public: - void wearableUpdated(LLWearableType::EType type, BOOL upload_result); + void wearableUpdated(LLWearableType::EType type); protected: U32 getNumWearables(LLAvatarAppearanceDefines::ETextureIndex i) const; -- cgit v1.2.3 From a91b7353b67d3076c87b41097335848364906f7b Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Mon, 23 Sep 2013 14:54:44 -0400 Subject: SH-3455 WIP - post-SSA cleanup --- indra/newview/llagentwearables.cpp | 7 ++----- indra/newview/llagentwearables.h | 8 ++------ indra/newview/llagentwearablesfetch.cpp | 3 +++ indra/newview/llvoavatarself.cpp | 21 +-------------------- 4 files changed, 8 insertions(+), 31 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 2d3823a6e2..e8d5f9bee5 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -194,11 +194,6 @@ LLAgentWearables::createStandardWearablesAllDoneCallback::~createStandardWearabl gAgentWearables.createStandardWearablesAllDone(); } -LLAgentWearables::sendAgentWearablesUpdateCallback::~sendAgentWearablesUpdateCallback() -{ - gAgentWearables.sendAgentWearablesUpdate(); -} - /** * @brief Construct a callback for dealing with the wearables. * @@ -776,6 +771,8 @@ BOOL LLAgentWearables::isWearingItem(const LLUUID& item_id) const return getWearableFromItemID(item_id) != NULL; } +// SUNSHINE CLEANUP ? + // MULTI-WEARABLE: DEPRECATED (see backwards compatibility) // static // ! BACKWARDS COMPATIBILITY ! When we stop supporting viewer1.23, we can assume diff --git a/indra/newview/llagentwearables.h b/indra/newview/llagentwearables.h index 0583c76dc4..81bfef0f8e 100755 --- a/indra/newview/llagentwearables.h +++ b/indra/newview/llagentwearables.h @@ -165,7 +165,9 @@ protected: /*virtual*/ void invalidateBakedTextureHash(LLMD5& hash) const; // SUNSHINE CLEANUP dead void sendAgentWearablesUpdate(); + // SUNSHINE CLEANUP remove? void sendAgentWearablesRequest(); + // SUNSHINE CLEANUP dead void updateServer(); static void onInitialWearableAssetArrived(LLViewerWearable* wearable, void* userdata); @@ -244,12 +246,6 @@ private: protected: ~createStandardWearablesAllDoneCallback(); }; - // SUNSHINE CLEANUP - should be dead if sendAgentWearablesUpdate is no longer needed. - class sendAgentWearablesUpdateCallback : public LLRefCount - { - protected: - ~sendAgentWearablesUpdateCallback(); - }; class AddWearableToAgentInventoryCallback : public LLInventoryCallback { diff --git a/indra/newview/llagentwearablesfetch.cpp b/indra/newview/llagentwearablesfetch.cpp index a2a667e660..a10382b830 100755 --- a/indra/newview/llagentwearablesfetch.cpp +++ b/indra/newview/llagentwearablesfetch.cpp @@ -70,6 +70,7 @@ void LLInitialWearablesFetch::add(InitialWearableData &data) mAgentInitialWearables.push_back(data); } +// SUNSHINE CLEANUP - should not have to wait for this message to start resolving appearance. Where to hook in instead? void LLInitialWearablesFetch::processContents() { if(!gAgentAvatarp) //no need to process wearables if the agent avatar is deleted. @@ -94,6 +95,7 @@ void LLInitialWearablesFetch::processContents() } else { + // SUNSHINE CLEANUP - remove? // if we're constructing the COF from the wearables message, we don't have a proper outfit link LLAppearanceMgr::instance().setOutfitDirty(true); processWearablesMessage(); @@ -135,6 +137,7 @@ public: } }; +// SUNSHINE CLEANUP - remove dependency on this? void LLInitialWearablesFetch::processWearablesMessage() { if (!mAgentInitialWearables.empty()) // We have an empty current outfit folder, use the message data instead. diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 17e6f4e53e..569a2a04cc 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2178,25 +2178,6 @@ const std::string LLVOAvatarSelf::debugDumpAllLocalTextureDataInfo() const return text; } - -#if 0 -// Dump avatar metrics data. -LLSD LLVOAvatarSelf::metricsData() -{ - // runway - add region info - LLSD result; - result["rez_status"] = LLVOAvatar::rezStatusToString(getRezzedStatus()); - result["timers"]["debug_existence"] = mDebugExistenceTimer.getElapsedTimeF32(); - result["timers"]["ruth_debug"] = mRuthDebugTimer.getElapsedTimeF32(); - result["timers"]["ruth"] = mRuthTimer.getElapsedTimeF32(); - result["timers"]["invisible"] = mInvisibleTimer.getElapsedTimeF32(); - result["timers"]["fully_loaded"] = mFullyLoadedTimer.getElapsedTimeF32(); - result["startup"] = LLStartUp::getPhases().dumpPhases(); - - return result; -} -#endif - class ViewerAppearanceChangeMetricsResponder: public LLCurl::Responder { LOG_CLASS(ViewerAppearanceChangeMetricsResponder); @@ -2332,7 +2313,7 @@ void LLVOAvatarSelf::sendViewerAppearanceChangeMetrics() std::string viewer_version_short = LLVersionInfo::getShortVersion(); std::string viewer_version_build = llformat("%d", LLVersionInfo::getBuild()); - LLSD msg; // = metricsData(); + LLSD msg; msg["message"] = "ViewerAppearanceChangeMetrics"; msg["session_id"] = gAgentSessionID; msg["agent_id"] = gAgentID; -- cgit v1.2.3 From 029642b2bc3a0bc0bec45af5df5d1e0b1b928b91 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> 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 ----------------- indra/newview/llagent.h | 1 - indra/newview/llagentwearables.cpp | 5 +-- indra/newview/llviewertexlayer.cpp | 6 +-- indra/newview/llviewerwearable.cpp | 17 -------- indra/newview/llvoavatar.cpp | 74 +++++++--------------------------- indra/newview/llvoavatar.h | 10 ----- indra/newview/llvoavatarself.cpp | 82 ++------------------------------------ indra/newview/llvoavatarself.h | 1 - 9 files changed, 22 insertions(+), 211 deletions(-) (limited to 'indra/newview') 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)); - } } diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index a4385d33cb..d0a48207b5 100755 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -609,7 +609,6 @@ private: void handleTeleportFinished(); void handleTeleportFailed(); - void handleServerBakeRegionTransition(const LLUUID& region_id); //-------------------------------------------------------------------- // Teleport State diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index e8d5f9bee5..0ec0fa632d 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -771,13 +771,12 @@ BOOL LLAgentWearables::isWearingItem(const LLUUID& item_id) const return getWearableFromItemID(item_id) != NULL; } -// SUNSHINE CLEANUP ? - // MULTI-WEARABLE: DEPRECATED (see backwards compatibility) -// static // ! BACKWARDS COMPATIBILITY ! When we stop supporting viewer1.23, we can assume // that viewers have a Current Outfit Folder and won't need this message, and thus // we can remove/ignore this whole function. EXCEPT gAgentWearables.notifyLoadingStarted + +// static void LLAgentWearables::processAgentInitialWearablesUpdate(LLMessageSystem* mesgsys, void** user_data) { // We should only receive this message a single time. Ignore subsequent AgentWearablesUpdates diff --git a/indra/newview/llviewertexlayer.cpp b/indra/newview/llviewertexlayer.cpp index 67aa105863..ad29a6bd8e 100755 --- a/indra/newview/llviewertexlayer.cpp +++ b/indra/newview/llviewertexlayer.cpp @@ -341,22 +341,20 @@ const LLViewerTexLayerSetBuffer* LLViewerTexLayerSet::getViewerComposite() const } -// SUNSHINE CLEANUP - this used to have a bunch of upload related stuff, doesn't really serve a purpose now. +// SUNSHINE CLEANUP - this used to have a bunch of upload related stuff, doesn't really serve much purpose now. const std::string LLViewerTexLayerSetBuffer::dumpTextureInfo() const { if (!isAgentAvatarValid()) return ""; const BOOL is_high_res = TRUE; const U32 num_low_res = 0; - const U32 upload_time = 0; const std::string local_texture_info = gAgentAvatarp->debugDumpLocalTextureDataInfo(getViewerTexLayerSet()); std::string status = "DONE "; - std::string text = llformat("[%s] [HiRes:%d LoRes:%d] [Elapsed:%d] %s", + std::string text = llformat("[%s] [HiRes:%d LoRes:%d] %s", status.c_str(), is_high_res, num_low_res, - upload_time, local_texture_info.c_str()); return text; } diff --git a/indra/newview/llviewerwearable.cpp b/indra/newview/llviewerwearable.cpp index e7fb6aec98..d6036dbecb 100755 --- a/indra/newview/llviewerwearable.cpp +++ b/indra/newview/llviewerwearable.cpp @@ -322,16 +322,6 @@ void LLViewerWearable::writeToAvatar(LLAvatarAppearance *avatarp) if (!viewer_avatar->isValid()) return; -#if 0 - // FIXME DRANO - kludgy way to avoid overwriting avatar state from wearables. - // Ideally would avoid calling this func in the first place. - if (viewer_avatar->isUsingServerBakes() && - !viewer_avatar->isUsingLocalAppearance()) - { - return; - } -#endif - ESex old_sex = avatarp->getSex(); LLWearable::writeToAvatar(avatarp); @@ -470,13 +460,6 @@ void LLViewerWearable::setItemID(const LLUUID& item_id) void LLViewerWearable::revertValues() { -#if 0 - // DRANO avoid overwrite when not in local appearance - if (isAgentAvatarValid() && gAgentAvatarp->isUsingServerBakes() && !gAgentAvatarp->isUsingLocalAppearance()) - { - return; - } -#endif LLWearable::revertValues(); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 63fdff2320..34ca8199be 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -707,7 +707,6 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mLastRezzedStatus(-1), mIsEditingAppearance(FALSE), mUseLocalAppearance(FALSE), - mUseServerBakes(FALSE), // FIXME DRANO consider using boost::optional, defaulting to unknown. mLastUpdateRequestCOFVersion(-1), mLastUpdateReceivedCOFVersion(-1) { @@ -3013,7 +3012,7 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) isSelf() ? (all_local_downloaded ? "L" : "l") : "-", all_baked_downloaded ? "B" : "b", mUseLocalAppearance, mIsEditingAppearance, - mUseServerBakes, central_bake_version); + 1, central_bake_version); std::string origin_string = bakedTextureOriginInfo(); debug_line += " [" + origin_string + "]"; S32 curr_cof_version = LLAppearanceMgr::instance().getCOFVersion(); @@ -4388,19 +4387,6 @@ void LLVOAvatar::updateTextures() { const S32 boost_level = getAvatarBakedBoostLevel(); imagep = LLViewerTextureManager::staticCastToFetchedTexture(getImage(texture_index,0), TRUE); - // Spam if this is a baked texture, not set to default image, without valid host info - if (isIndexBakedTexture((ETextureIndex)texture_index) - && imagep->getID() != IMG_DEFAULT_AVATAR - && imagep->getID() != IMG_INVISIBLE - && !isUsingServerBakes() - && !imagep->getTargetHost().isOk()) - { - LL_WARNS_ONCE("Texture") << "LLVOAvatar::updateTextures No host for texture " - << imagep->getID() << " for avatar " - << (isSelf() ? "<myself>" : getID().asString()) - << " on host " << getRegion()->getHost() << llendl; - } - addBakedTextureStats( imagep, mPixelArea, texel_area_ratio, boost_level ); } } @@ -4532,22 +4518,19 @@ const std::string LLVOAvatar::getImageURL(const U8 te, const LLUUID &uuid) { llassert(isIndexBakedTexture(ETextureIndex(te))); std::string url = ""; - if (isUsingServerBakes()) + const std::string& appearance_service_url = LLAppearanceMgr::instance().getAppearanceServiceURL(); + if (appearance_service_url.empty()) { - const std::string& appearance_service_url = LLAppearanceMgr::instance().getAppearanceServiceURL(); - if (appearance_service_url.empty()) - { - // Probably a server-side issue if we get here: - llwarns << "AgentAppearanceServiceURL not set - Baked texture requests will fail" << llendl; - return url; - } + // Probably a server-side issue if we get here: + llwarns << "AgentAppearanceServiceURL not set - Baked texture requests will fail" << llendl; + return url; + } - const LLAvatarAppearanceDictionary::TextureEntry* texture_entry = LLAvatarAppearanceDictionary::getInstance()->getTexture((ETextureIndex)te); - if (texture_entry != NULL) - { - url = appearance_service_url + "texture/" + getID().asString() + "/" + texture_entry->mDefaultImageName + "/" + uuid.asString(); - //llinfos << "baked texture url: " << url << llendl; - } + const LLAvatarAppearanceDictionary::TextureEntry* texture_entry = LLAvatarAppearanceDictionary::getInstance()->getTexture((ETextureIndex)te); + if (texture_entry != NULL) + { + url = appearance_service_url + "texture/" + getID().asString() + "/" + texture_entry->mDefaultImageName + "/" + uuid.asString(); + //llinfos << "baked texture url: " << url << llendl; } return url; } @@ -6070,7 +6053,7 @@ void LLVOAvatar::logMetricsTimerRecord(const std::string& phase_name, F32 elapse } record["grid_x"] = LLSD::Integer(grid_x); record["grid_y"] = LLSD::Integer(grid_y); - record["is_using_server_bakes"] = ((bool) isUsingServerBakes()); + record["is_using_server_bakes"] = true; record["is_self"] = isSelf(); if (isAgentAvatarValid()) @@ -7013,8 +6996,6 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) mLastUpdateReceivedCOFVersion = this_update_cof_version; } - setIsUsingServerBakes(appearance_version > 0); - applyParsedTEMessage(contents.mTEContents); // prevent the overwriting of valid baked textures with invalid baked textures @@ -7024,13 +7005,13 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) && mBakedTextureDatas[baked_index].mLastTextureID != IMG_DEFAULT && baked_index != BAKED_SKIRT) { - LL_DEBUGS("Avatar") << avString() << "sb " << (S32) isUsingServerBakes() << " baked_index " << (S32) baked_index << " using mLastTextureID " << mBakedTextureDatas[baked_index].mLastTextureID << llendl; + LL_DEBUGS("Avatar") << avString() << " baked_index " << (S32) baked_index << " using mLastTextureID " << mBakedTextureDatas[baked_index].mLastTextureID << llendl; setTEImage(mBakedTextureDatas[baked_index].mTextureIndex, LLViewerTextureManager::getFetchedTexture(mBakedTextureDatas[baked_index].mLastTextureID, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE)); } else { - LL_DEBUGS("Avatar") << avString() << "sb " << (S32) isUsingServerBakes() << " baked_index " << (S32) baked_index << " using texture id " + LL_DEBUGS("Avatar") << avString() << " baked_index " << (S32) baked_index << " using texture id " << getTE(mBakedTextureDatas[baked_index].mTextureIndex)->getID() << llendl; } } @@ -7611,31 +7592,6 @@ void LLVOAvatar::startAppearanceAnimation() } } -BOOL LLVOAvatar::isUsingServerBakes() const -{ -#if 1 - // Sanity check - visual param for appearance version should match mUseServerBakes - LLVisualParam* appearance_version_param = getVisualParam(11000); - llassert(appearance_version_param); - F32 wt = appearance_version_param->getWeight(); - F32 expect_wt = mUseServerBakes ? 1.0 : 0.0; - if (!is_approx_equal(wt,expect_wt)) - { - llwarns << "wt " << wt << " differs from expected " << expect_wt << llendl; - } -#endif - - return mUseServerBakes; -} - -void LLVOAvatar::setIsUsingServerBakes(BOOL newval) -{ - mUseServerBakes = newval; - LLVisualParam* appearance_version_param = getVisualParam(11000); - llassert(appearance_version_param); - appearance_version_param->setWeight(newval ? 1.0 : 0.0); -} - // virtual void LLVOAvatar::removeMissingBakedTextures() { diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index a4b5db3034..c7f80a1017 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -644,14 +644,6 @@ public: // editing or when waiting for a subsequent server rebake. /*virtual*/ BOOL isUsingLocalAppearance() const { return mUseLocalAppearance; } - // True if this avatar should fetch its baked textures via the new - // appearance mechanism. - // SUNSHINE CLEANUP - always true, remove? - BOOL isUsingServerBakes() const; - // SUNSHINE CLEANUP - always true, remove? - void setIsUsingServerBakes(BOOL newval); - - // True if we are currently in appearance editing mode. Often but // not always the same as isUsingLocalAppearance(). /*virtual*/ BOOL isEditingAppearance() const { return mIsEditingAppearance; } @@ -664,8 +656,6 @@ private: F32 mLastAppearanceBlendTime; BOOL mIsEditingAppearance; // flag for if we're actively in appearance editing mode BOOL mUseLocalAppearance; // flag for if we're using a local composite - // SUNSHINE CLEANUP - always true, remove? - BOOL mUseServerBakes; // flag for if baked textures should be fetched from baking service (false if they're temporary uploads) //-------------------------------------------------------------------- // Visibility diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 569a2a04cc..88241304cd 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -189,15 +189,6 @@ bool update_avatar_rez_metrics() return false; } -bool check_for_unsupported_baked_appearance() -{ - if (!isAgentAvatarValid()) - return true; - - gAgentAvatarp->checkForUnsupportedServerBakeAppearance(); - return false; -} - void LLVOAvatarSelf::initInstance() { BOOL status = TRUE; @@ -234,7 +225,6 @@ void LLVOAvatarSelf::initInstance() //doPeriodically(output_self_av_texture_diagnostics, 30.0); doPeriodically(update_avatar_rez_metrics, 5.0); - doPeriodically(check_for_unsupported_baked_appearance, 120.0); doPeriodically(boost::bind(&LLVOAvatarSelf::checkStuckAppearance, this), 30.0); } @@ -708,14 +698,6 @@ BOOL LLVOAvatarSelf::setParamWeight(const LLViewerVisualParam *param, F32 weight return FALSE; } -#if 0 - // FIXME DRANO - kludgy way to avoid overwriting avatar state from wearables. - if (isUsingServerBakes() && !isUsingLocalAppearance()) - { - return FALSE; - } -#endif - if (param->getCrossWearable()) { LLWearableType::EType type = (LLWearableType::EType)param->getWearableType(); @@ -794,7 +776,9 @@ U32 LLVOAvatarSelf::processUpdateMessage(LLMessageSystem *mesgsys, { U32 retval = LLVOAvatar::processUpdateMessage(mesgsys,user_data,block_num,update_type,dp); - // SUNSHINE CLEANUP - does this become relevant again if we don't have to wait for appearance message to tell us where bakes are coming from? + // SUNSHINE CLEANUP - does this become relevant again if we don't + // have to wait for appearance message to tell us where bakes are + // coming from? #if 0 // DRANO - it's not clear this does anything useful. If we wait @@ -2376,66 +2360,6 @@ void LLVOAvatarSelf::sendViewerAppearanceChangeMetrics() } } -class CheckAgentAppearanceServiceResponder: public LLHTTPClient::Responder -{ - LOG_CLASS(CheckAgentAppearanceServiceResponder); -public: - CheckAgentAppearanceServiceResponder() - { - } - - virtual ~CheckAgentAppearanceServiceResponder() - { - } - -private: - /* virtual */ void httpSuccess() - { - LL_DEBUGS("Avatar") << "OK" << llendl; - } - - // Error - /*virtual*/ void httpFailure() - { - if (isAgentAvatarValid()) - { - LL_DEBUGS("Avatar") << "failed, will rebake " - << dumpResponse() << LL_ENDL; - forceAppearanceUpdate(); - } - } - -public: - static void forceAppearanceUpdate() - { - // Trying to rebake immediately after crossing region boundary - // seems to be failure prone; adding a delay factor. Yes, this - // fix is ad-hoc and not guaranteed to work in all cases. - doAfterInterval(boost::bind(&LLVOAvatarSelf::forceBakeAllTextures, - gAgentAvatarp.get(), true), 5.0); - } -}; - -void LLVOAvatarSelf::checkForUnsupportedServerBakeAppearance() -{ - // Need to check only if we have a server baked appearance and are - // in a non-baking region. - if (!gAgentAvatarp->isUsingServerBakes()) - return; - if (!gAgent.getRegion() || gAgent.getRegion()->getCentralBakeVersion()!=0) - return; - - // if baked image service is unknown, need to refresh. - if (LLAppearanceMgr::instance().getAppearanceServiceURL().empty()) - { - CheckAgentAppearanceServiceResponder::forceAppearanceUpdate(); - } - // query baked image service to check status. - std::string image_url = gAgentAvatarp->getImageURL(TEX_HEAD_BAKED, - getTE(TEX_HEAD_BAKED)->getID()); - LLHTTPClient::head(image_url, new CheckAgentAppearanceServiceResponder); -} - const LLUUID& LLVOAvatarSelf::grabBakedTexture(EBakedTextureIndex baked_index) const { if (canGrabBakedTexture(baked_index)) diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index 1f0fdd101a..7eaa239890 100755 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -401,7 +401,6 @@ public: const std::string debugDumpLocalTextureDataInfo(const LLViewerTexLayerSet* layerset) const; // Lists out state of this particular baked texture layer const std::string debugDumpAllLocalTextureDataInfo() const; // Lists out which baked textures are at highest LOD void sendViewerAppearanceChangeMetrics(); // send data associated with completing a change. - void checkForUnsupportedServerBakeAppearance(); private: LLFrameTimer mDebugSelfLoadTimer; F32 mDebugTimeWearablesLoaded; -- cgit v1.2.3 From d50be6a8a959b8d7b0f5c8a68b99d3929c17dced Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Mon, 23 Sep 2013 17:17:29 -0400 Subject: SH-3455 WIP - post-SSA cleanup --- indra/newview/llagentwearables.cpp | 10 ---------- indra/newview/llagentwearables.h | 1 - indra/newview/llviewerwearable.cpp | 7 ------- indra/newview/llviewerwearable.h | 4 +--- 4 files changed, 1 insertion(+), 21 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 0ec0fa632d..77fd66e4ba 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -1477,16 +1477,6 @@ void LLAgentWearables::setWearableFinal(LLInventoryItem* new_item, LLViewerWeara updateServer(); } -// virtual -void LLAgentWearables::invalidateBakedTextureHash(LLMD5& hash) const -{ - // Add some garbage into the hash so that it becomes invalid. - if (isAgentAvatarValid()) - { - hash.update((const unsigned char*)gAgentAvatarp->getID().mData, UUID_BYTES); - } -} - // User has picked "remove from avatar" from a menu. // static void LLAgentWearables::userRemoveWearable(const LLWearableType::EType &type, const U32 &index) diff --git a/indra/newview/llagentwearables.h b/indra/newview/llagentwearables.h index 81bfef0f8e..96c7d890b4 100755 --- a/indra/newview/llagentwearables.h +++ b/indra/newview/llagentwearables.h @@ -162,7 +162,6 @@ public: static void processAgentInitialWearablesUpdate(LLMessageSystem* mesgsys, void** user_data); protected: - /*virtual*/ void invalidateBakedTextureHash(LLMD5& hash) const; // SUNSHINE CLEANUP dead void sendAgentWearablesUpdate(); // SUNSHINE CLEANUP remove? diff --git a/indra/newview/llviewerwearable.cpp b/indra/newview/llviewerwearable.cpp index d6036dbecb..143eab133d 100755 --- a/indra/newview/llviewerwearable.cpp +++ b/indra/newview/llviewerwearable.cpp @@ -497,13 +497,6 @@ void LLViewerWearable::refreshName() } } -// virtual -void LLViewerWearable::addToBakedTextureHash(LLMD5& hash) const -{ - LLUUID asset_id = getAssetID(); - hash.update((const unsigned char*)asset_id.mData, UUID_BYTES); -} - struct LLWearableSaveData { LLWearableType::EType mType; diff --git a/indra/newview/llviewerwearable.h b/indra/newview/llviewerwearable.h index 2e59596f12..fb92bca5cc 100755 --- a/indra/newview/llviewerwearable.h +++ b/indra/newview/llviewerwearable.h @@ -90,9 +90,7 @@ public: // the wearable was worn. make sure the name of the wearable object matches the LLViewerInventoryItem, // not the wearable asset itself. void refreshName(); - - // Update the baked texture hash. - /*virtual*/void addToBakedTextureHash(LLMD5& hash) const; + /*virtual*/void addToBakedTextureHash(LLMD5& hash) const {} protected: LLAssetID mAssetID; -- cgit v1.2.3 From da398cb12f05f32441e4ca843448ea8f4e2acc95 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Mon, 23 Sep 2013 18:15:25 -0400 Subject: SH-3455 WIP - post-SSA cleanup --- indra/newview/llviewertexlayer.cpp | 6 +---- indra/newview/llviewertexture.cpp | 4 +-- indra/newview/llvoavatar.cpp | 52 ++++++-------------------------------- indra/newview/llvoavatar.h | 2 -- 4 files changed, 10 insertions(+), 54 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewertexlayer.cpp b/indra/newview/llviewertexlayer.cpp index ad29a6bd8e..f20ab48fab 100755 --- a/indra/newview/llviewertexlayer.cpp +++ b/indra/newview/llviewertexlayer.cpp @@ -341,7 +341,6 @@ const LLViewerTexLayerSetBuffer* LLViewerTexLayerSet::getViewerComposite() const } -// SUNSHINE CLEANUP - this used to have a bunch of upload related stuff, doesn't really serve much purpose now. const std::string LLViewerTexLayerSetBuffer::dumpTextureInfo() const { if (!isAgentAvatarValid()) return ""; @@ -350,10 +349,7 @@ const std::string LLViewerTexLayerSetBuffer::dumpTextureInfo() const const U32 num_low_res = 0; const std::string local_texture_info = gAgentAvatarp->debugDumpLocalTextureDataInfo(getViewerTexLayerSet()); - std::string status = "DONE "; - - std::string text = llformat("[%s] [HiRes:%d LoRes:%d] %s", - status.c_str(), + std::string text = llformat("[HiRes:%d LoRes:%d] %s", is_high_res, num_low_res, local_texture_info.c_str()); return text; diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 80f25b7d4c..18cfa82421 100755 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -964,9 +964,7 @@ LLViewerFetchedTexture::LLViewerFetchedTexture(const LLUUID& id, FTType f_type, mFTType = f_type; if (mFTType == FTT_HOST_BAKE) { - // SUNSHINE CLEANUP - llassert(false); - mCanUseHTTP = false; + llwarns << "Unsupported fetch type " << mFTType << llendl; } generateGLTexture() ; } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 34ca8199be..68ab25abca 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1884,24 +1884,17 @@ LLViewerFetchedTexture *LLVOAvatar::getBakedTextureImage(const U8 te, const LLUU if (!result) { const std::string url = getImageURL(te,uuid); - if (!url.empty()) + if (url.empty()) { - LL_DEBUGS("Avatar") << avString() << "get server-bake image from URL " << url << llendl; - result = LLViewerTextureManager::getFetchedTextureFromUrl( - url, FTT_SERVER_BAKE, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE, 0, 0, uuid); - if (result->isMissingAsset()) - { - result->setIsMissingAsset(false); - } + llwarns << "unable to determine URL for te " << te << " uuid " << uuid << llendl; + return NULL; } - else + LL_DEBUGS("Avatar") << avString() << "get server-bake image from URL " << url << llendl; + result = LLViewerTextureManager::getFetchedTextureFromUrl( + url, FTT_SERVER_BAKE, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE, 0, 0, uuid); + if (result->isMissingAsset()) { - // SUNSHINE CLEANUP - llassert(false); - LL_DEBUGS("Avatar") << avString() << "get old-bake image from host " << uuid << llendl; - LLHost host = getObjectHost(); - result = LLViewerTextureManager::getFetchedTexture( - uuid, FTT_HOST_BAKE, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE, 0, 0, host); + result->setIsMissingAsset(false); } } return result; @@ -4118,35 +4111,6 @@ bool LLVOAvatar::allBakedTexturesCompletelyDownloaded() const return allTexturesCompletelyDownloaded(baked_ids); } -// SUNSHINE CLEANUP -void LLVOAvatar::bakedTextureOriginCounts(S32 &sb_count, // server-bake, has origin URL. - S32 &host_count, // host-based bake, has host. - S32 &both_count, // error - both host and URL set. - S32 &neither_count) // error - neither set. -{ - sb_count = host_count = both_count = neither_count = 0; - - std::set<LLUUID> baked_ids; - collectBakedTextureUUIDs(baked_ids); - for (std::set<LLUUID>::const_iterator it = baked_ids.begin(); it != baked_ids.end(); ++it) - { - LLViewerFetchedTexture *imagep = gTextureList.findImage(*it); - bool has_url = false, has_host = false; - if (!imagep->getUrl().empty()) - { - has_url = true; - } - if (imagep->getTargetHost().isOk()) - { - has_host = true; - } - if (has_url && !has_host) sb_count++; - else if (has_host && !has_url) host_count++; - else if (has_host && has_url) both_count++; - else if (!has_host && !has_url) neither_count++; - } -} - std::string LLVOAvatar::bakedTextureOriginInfo() { std::string result; diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index c7f80a1017..d297ce2b91 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -142,8 +142,6 @@ public: bool allTexturesCompletelyDownloaded(std::set<LLUUID>& ids) const; bool allLocalTexturesCompletelyDownloaded() const; bool allBakedTexturesCompletelyDownloaded() const; - void bakedTextureOriginCounts(S32 &sb_count, S32 &host_count, - S32 &both_count, S32 &neither_count); std::string bakedTextureOriginInfo(); void collectLocalTextureUUIDs(std::set<LLUUID>& ids) const; void collectBakedTextureUUIDs(std::set<LLUUID>& ids) const; -- cgit v1.2.3 From 259394b541b43c6f4fcba2417009dd0447a17def Mon Sep 17 00:00:00 2001 From: Xiaohong Bao <bao@lindenlab.com> Date: Mon, 23 Sep 2013 17:03:19 -0600 Subject: fix the bug that texture aux channel data can not be reloaded. --- indra/newview/llviewertexture.cpp | 46 +++++++++++++++++++++++++++++++++++---- indra/newview/llviewertexture.h | 2 ++ 2 files changed, 44 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 7e35af7e63..831551a0a7 100755 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -989,6 +989,7 @@ void LLViewerFetchedTexture::init(bool firstinit) { mOrigWidth = 0; mOrigHeight = 0; + mHasAux = FALSE; mNeedsAux = FALSE; mRequestedDiscardLevel = -1; mRequestedDownloadPriority = 0.f; @@ -1823,7 +1824,11 @@ bool LLViewerFetchedTexture::updateFetch() bool finished = LLAppViewer::getTextureFetch()->getRequestFinished(getID(), fetch_discard, mRawImage, mAuxRawImage, mLastHttpGetStatus); if (mRawImage.notNull()) sRawCount++; - if (mAuxRawImage.notNull()) sAuxCount++; + if (mAuxRawImage.notNull()) + { + mHasAux = TRUE; + sAuxCount++; + } if (finished) { mIsFetching = FALSE; @@ -2152,8 +2157,16 @@ void LLViewerFetchedTexture::setLoadedCallback( loaded_callback_func loaded_call } if (mNeedsAux && mAuxRawImage.isNull() && getDiscardLevel() >= 0) { - // We need aux data, but we've already loaded the image, and it didn't have any - llwarns << "No aux data available for callback for image:" << getID() << llendl; + if(mHasAux) + { + //trigger a refetch + forceToRefetchTexture(); + } + else + { + // We need aux data, but we've already loaded the image, and it didn't have any + llwarns << "No aux data available for callback for image:" << getID() << llendl; + } } mLastCallBackActiveTime = sCurrentTime ; } @@ -2604,7 +2617,7 @@ bool LLViewerFetchedTexture::needsToSaveRawImage() void LLViewerFetchedTexture::destroyRawImage() { - if (mAuxRawImage.notNull()) + if (mAuxRawImage.notNull() && !needsToSaveRawImage()) { sAuxCount--; mAuxRawImage = NULL; @@ -2760,6 +2773,25 @@ void LLViewerFetchedTexture::saveRawImage() mLastReferencedSavedRawImageTime = sCurrentTime ; } +//force to refetch the texture to the discard level +void LLViewerFetchedTexture::forceToRefetchTexture(S32 desired_discard) +{ + F32 kept_time = 60.0; //seconds + if(mForceToSaveRawImage) + { + desired_discard = llmin(desired_discard, mDesiredSavedRawDiscardLevel); + kept_time = llmax(kept_time, mKeptSavedRawImageTime); + } + + //trigger a new fetch. + mForceToSaveRawImage = TRUE ; + mDesiredSavedRawDiscardLevel = desired_discard ; + mKeptSavedRawImageTime = kept_time ; + mLastReferencedSavedRawImageTime = sCurrentTime ; + mSavedRawImage = NULL ; + mSavedRawDiscardLevel = -1 ; +} + void LLViewerFetchedTexture::forceToSaveRawImage(S32 desired_discard, F32 kept_time) { mKeptSavedRawImageTime = kept_time ; @@ -2807,6 +2839,12 @@ void LLViewerFetchedTexture::destroySavedRawImage() mDesiredSavedRawDiscardLevel = -1 ; mLastReferencedSavedRawImageTime = 0.0f ; mKeptSavedRawImageTime = 0.f ; + + if(mAuxRawImage.notNull()) + { + sAuxCount--; + mAuxRawImage = NULL; + } } LLImageRaw* LLViewerFetchedTexture::getSavedRawImage() diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index d9a537d304..31430c31e0 100755 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -388,6 +388,7 @@ public: BOOL isCachedRawImageReady() const {return mCachedRawImageReady ;} BOOL isRawImageValid()const { return mIsRawImageValid ; } void forceToSaveRawImage(S32 desired_discard = 0, F32 kept_time = 0.f) ; + void forceToRefetchTexture(S32 desired_discard = 0); /*virtual*/ void setCachedRawImage(S32 discard_level, LLImageRaw* imageraw) ; void destroySavedRawImage() ; LLImageRaw* getSavedRawImage() ; @@ -449,6 +450,7 @@ protected: S8 mMinDesiredDiscardLevel; // The minimum discard level we'd like to have S8 mNeedsAux; // We need to decode the auxiliary channels + S8 mHasAux; // We have aux channels S8 mDecodingAux; // Are we decoding high components S8 mIsRawImageValid; S8 mHasFetcher; // We've made a fecth request -- cgit v1.2.3 From 3bf07ac65f046ef53db7b3eb6312f837ac92219b Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Tue, 24 Sep 2013 09:35:46 -0400 Subject: merge fix --- indra/newview/llvoavatarself.cpp | 5 ----- 1 file changed, 5 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 6f238571a4..992ebdb1b4 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2278,11 +2278,6 @@ void LLVOAvatarSelf::sendViewerAppearanceChangeMetrics() static volatile bool reporting_started(false); static volatile S32 report_sequence(0); - std::string viewer_version_channel = LLVersionInfo::getChannel(); - sanitize_for_tsdb_tag(viewer_version_channel); - std::string viewer_version_short = LLVersionInfo::getShortVersion(); - std::string viewer_version_build = llformat("%d", LLVersionInfo::getBuild()); - LLSD msg; msg["message"] = "ViewerAppearanceChangeMetrics"; msg["session_id"] = gAgentSessionID; -- cgit v1.2.3 From 19ba8d8413c4541da2d76656776545334a09a38f Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Tue, 24 Sep 2013 15:39:43 -0400 Subject: SH-3455 WIP - removed some handling for appearance version < 1 --- indra/newview/llviewerregion.cpp | 2 +- indra/newview/llvoavatar.cpp | 39 ++++++++++++++------------------------- indra/newview/llvoavatarself.cpp | 1 + 3 files changed, 16 insertions(+), 26 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 7150089380..814b5e2265 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -387,7 +387,7 @@ LLViewerRegion::LLViewerRegion(const U64 &handle, mSimAccess( SIM_ACCESS_MIN ), mBillableFactor(1.0), mMaxTasks(DEFAULT_MAX_REGION_WIDE_PRIM_COUNT), - mCentralBakeVersion(0), + mCentralBakeVersion(1), mClassID(0), mCPURatio(0), mColoName("unknown"), diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 68ab25abca..49bbf97a23 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -6837,7 +6837,6 @@ void LLVOAvatar::parseAppearanceMessage(LLMessageSystem* mesgsys, LLAppearanceMe } } -// SUNSHINE CLEANUP - OK to remove the version = 0 case, assume we're at least 1? bool resolve_appearance_version(const LLAppearanceMessageContents& contents, S32& appearance_version) { appearance_version = -1; @@ -6848,19 +6847,18 @@ bool resolve_appearance_version(const LLAppearanceMessageContents& contents, S32 { llwarns << "inconsistent appearance_version settings - field: " << contents.mAppearanceVersion << ", param: " << contents.mParamAppearanceVersion << llendl; - return false; } - if (contents.mParamAppearanceVersion >= 0) // use visual param if available. + if (contents.mParamAppearanceVersion > 0) // use visual param if available. { appearance_version = contents.mParamAppearanceVersion; } - if (contents.mAppearanceVersion >= 0) + else if (contents.mAppearanceVersion > 0) { appearance_version = contents.mAppearanceVersion; } - if (appearance_version < 0) // still not set, go with 0. + else // still not set, go with 0. { - appearance_version = 0; + appearance_version = 1; } LL_DEBUGS("Avatar") << "appearance version info - field " << contents.mAppearanceVersion << " param: " << contents.mParamAppearanceVersion @@ -6899,6 +6897,8 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) llwarns << "bad appearance version info, discarding" << llendl; return; } + llassert(appearance_version > 0); + S32 this_update_cof_version = contents.mCOFVersion; S32 last_update_request_cof_version = mLastUpdateRequestCOFVersion; @@ -6908,15 +6908,6 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) LL_DEBUGS("Avatar") << "this_update_cof_version " << this_update_cof_version << " last_update_request_cof_version " << last_update_request_cof_version << " my_cof_version " << LLAppearanceMgr::instance().getCOFVersion() << llendl; - - if (getRegion() && (getRegion()->getCentralBakeVersion()==0)) - { - llwarns << avString() << "Received AvatarAppearance message for self in non-server-bake region" << llendl; - } - if( mFirstTEMessageReceived && (appearance_version == 0)) - { - return; - } } else { @@ -6925,7 +6916,6 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) // Check for stale update. if (isSelf() - && (appearance_version>0) && (this_update_cof_version < last_update_request_cof_version)) { llwarns << "Stale appearance update, wanted version " << last_update_request_cof_version @@ -6939,6 +6929,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) return; } + // SUNSHINE CLEANUP - is this case OK now? S32 num_params = contents.mParamWeights.size(); if (num_params <= 1) { @@ -6950,15 +6941,13 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) return; } - // No backsies zone - if we get here, the message should be valid and usable. - if (appearance_version > 0) - { - // Note: - // RequestAgentUpdateAppearanceResponder::onRequestRequested() - // assumes that cof version is only updated with server-bake - // appearance messages. - mLastUpdateReceivedCOFVersion = this_update_cof_version; - } + // No backsies zone - if we get here, the message should be valid and usable, will process. + + // Note: + // RequestAgentUpdateAppearanceResponder::onRequestRequested() + // assumes that cof version is only updated with server-bake + // appearance messages. + mLastUpdateReceivedCOFVersion = this_update_cof_version; applyParsedTEMessage(contents.mTEContents); diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 992ebdb1b4..97429329a8 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2808,6 +2808,7 @@ void LLVOAvatarSelf::onCustomizeEnd(bool disable_camera_switch) if (isAgentAvatarValid()) { gAgentAvatarp->mIsEditingAppearance = false; + // SUNSHINE CLEANUP - should no longer happen if (gAgentAvatarp->getRegion() && !gAgentAvatarp->getRegion()->getCentralBakeVersion()) { // FIXME DRANO - move to sendAgentSetAppearance, make conditional on upload complete. -- cgit v1.2.3 From ac6797c71ad2f75f9f34b3d6b8da4948825e6d57 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Wed, 25 Sep 2013 13:01:55 -0400 Subject: SH-3455 WIP - moved setAvatarObject() to run after the self av constructor. Disabled sendAgentWearablesUpdate. --- indra/newview/llagentwearables.cpp | 9 +++++++-- indra/newview/llviewerobject.cpp | 2 ++ indra/newview/llvoavatarself.cpp | 2 -- 3 files changed, 9 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 77fd66e4ba..5a059008c4 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -182,9 +182,11 @@ void LLAgentWearables::initClass() void LLAgentWearables::setAvatarObject(LLVOAvatarSelf *avatar) { llassert(avatar); - avatar->outputRezTiming("Sending wearables request"); - sendAgentWearablesRequest(); setAvatarAppearance(avatar); + gAgentWearables.notifyLoadingStarted(); + callAfterCategoryFetch(LLAppearanceMgr::instance().getCOF(), + boost::bind(&LLAppearanceMgr::updateAppearanceFromCOF, + LLAppearanceMgr::getInstance(), true, true, no_op)); } // wearables @@ -302,6 +304,8 @@ void LLAgentWearables::addWearabletoAgentInventoryDone(const LLWearableType::ETy // SUNSHINE CLEANUP dead? void LLAgentWearables::sendAgentWearablesUpdate() { + return; // try as NO_OP // SUNSHINE CLEANUP +#if 0 // First make sure that we have inventory items for each wearable for (S32 type=0; type < LLWearableType::WT_COUNT; ++type) { @@ -372,6 +376,7 @@ void LLAgentWearables::sendAgentWearablesUpdate() lldebugs << " " << LLWearableType::getTypeLabel((LLWearableType::EType)type) << ": " << (wearable ? wearable->getAssetID() : LLUUID::null) << llendl; } gAgent.sendReliableMessage(); +#endif } void LLAgentWearables::saveWearable(const LLWearableType::EType type, const U32 index, BOOL send_update, diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 91efed1508..dc8acc91a9 100755 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -57,6 +57,7 @@ #include "llaudiosourcevo.h" #include "llagent.h" #include "llagentcamera.h" +#include "llagentwearables.h" #include "llbbox.h" #include "llbox.h" #include "llcylinder.h" @@ -140,6 +141,7 @@ LLViewerObject *LLViewerObject::createObject(const LLUUID &id, const LLPCode pco { gAgentAvatarp = new LLVOAvatarSelf(id, pcode, regionp); gAgentAvatarp->initInstance(); + gAgentWearables.setAvatarObject(gAgentAvatarp); } else { diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 97429329a8..498f8c8277 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -161,8 +161,6 @@ LLVOAvatarSelf::LLVOAvatarSelf(const LLUUID& id, mRegionCrossingCount(0), mInitialBakesLoaded(false) { - gAgentWearables.setAvatarObject(this); - mMotionController.mIsSelf = TRUE; lldebugs << "Marking avatar as self " << id << llendl; -- cgit v1.2.3 From 39900843c99dbfc01f8a28fb071edc9a77c471be Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Thu, 26 Sep 2013 16:24:25 -0400 Subject: SH-3455 WIP --- indra/newview/llagentwearables.cpp | 203 +++++----------------------------- indra/newview/llagentwearables.h | 18 +-- indra/newview/llpaneleditwearable.cpp | 2 +- indra/newview/llstartup.cpp | 4 +- 4 files changed, 34 insertions(+), 193 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 5a059008c4..a97396ae1c 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -126,13 +126,6 @@ void LLAgentWearables::dump() } } - llinfos << "Total items awaiting wearable update " << mItemsAwaitingWearableUpdate.size() << llendl; - for (std::set<LLUUID>::iterator it = mItemsAwaitingWearableUpdate.begin(); - it != mItemsAwaitingWearableUpdate.end(); - ++it) - { - llinfos << (*it).asString() << llendl; - } } struct LLAgentDumper @@ -189,12 +182,6 @@ void LLAgentWearables::setAvatarObject(LLVOAvatarSelf *avatar) LLAppearanceMgr::getInstance(), true, true, no_op)); } -// wearables -LLAgentWearables::createStandardWearablesAllDoneCallback::~createStandardWearablesAllDoneCallback() -{ - llinfos << "destructor - all done?" << llendl; - gAgentWearables.createStandardWearablesAllDone(); -} /** * @brief Construct a callback for dealing with the wearables. @@ -222,6 +209,8 @@ void LLAgentWearables::AddWearableToAgentInventoryCallback::fire(const LLUUID& i { if (mTodo & CALL_CREATESTANDARDDONE) { + // SUNSHINE CLEANUP + llassert(false); // does not appear to ever be used. llinfos << "callback fired, inv_item " << inv_item.asString() << llendl; } @@ -230,10 +219,6 @@ void LLAgentWearables::AddWearableToAgentInventoryCallback::fire(const LLUUID& i gAgentWearables.addWearabletoAgentInventoryDone(mType, mIndex, inv_item, mWearable); - if (mTodo & CALL_UPDATE) - { - gAgentWearables.sendAgentWearablesUpdate(); - } if (mTodo & CALL_RECOVERDONE) { LLAppearanceMgr::instance().addCOFItemLink(inv_item); @@ -244,8 +229,10 @@ void LLAgentWearables::AddWearableToAgentInventoryCallback::fire(const LLUUID& i */ if (mTodo & CALL_CREATESTANDARDDONE) { - LLAppearanceMgr::instance().addCOFItemLink(inv_item); - gAgentWearables.createStandardWearablesDone(mType, mIndex); + // SUNSHINE CLEANUP + llassert(false); // does not appear to ever be used. + //LLAppearanceMgr::instance().addCOFItemLink(inv_item); + //gAgentWearables.createStandardWearablesDone(mType, mIndex); } if (mTodo & CALL_MAKENEWOUTFITDONE) { @@ -379,7 +366,7 @@ void LLAgentWearables::sendAgentWearablesUpdate() #endif } -void LLAgentWearables::saveWearable(const LLWearableType::EType type, const U32 index, BOOL send_update, +void LLAgentWearables::saveWearable(const LLWearableType::EType type, const U32 index, const std::string new_name) { LLViewerWearable* old_wearable = getViewerWearable(type, index); @@ -426,10 +413,6 @@ void LLAgentWearables::saveWearable(const LLWearableType::EType type, const U32 { // Add a new inventory item (shouldn't ever happen here) U32 todo = AddWearableToAgentInventoryCallback::CALL_NONE; - if (send_update) - { - todo |= AddWearableToAgentInventoryCallback::CALL_UPDATE; - } LLPointer<LLInventoryCallback> cb = new AddWearableToAgentInventoryCallback( LLPointer<LLRefCount>(NULL), @@ -442,11 +425,6 @@ void LLAgentWearables::saveWearable(const LLWearableType::EType type, const U32 } gAgentAvatarp->wearableUpdated(type); - - if (send_update) - { - sendAgentWearablesUpdate(); - } } } @@ -534,9 +512,10 @@ void LLAgentWearables::saveAllWearables() for (S32 i=0; i < LLWearableType::WT_COUNT; i++) { for (U32 j=0; j < getWearableCount((LLWearableType::EType)i); j++) - saveWearable((LLWearableType::EType)i, j, FALSE); + saveWearable((LLWearableType::EType)i, j); } - sendAgentWearablesUpdate(); + // SUNSHINE CLEANUP - check ok + //sendAgentWearablesUpdate(); } // Called when the user changes the name of a wearable inventory item that is currently being worn. @@ -565,7 +544,8 @@ void LLAgentWearables::setWearableName(const LLUUID& item_id, const std::string& old_wearable->setName(old_name); setWearable((LLWearableType::EType)i,j,new_wearable); - sendAgentWearablesUpdate(); + // SUNSHINE CLEANUP - verify ok + //sendAgentWearablesUpdate(); break; } } @@ -736,23 +716,13 @@ void LLAgentWearables::wearableUpdated(LLWearable *wearable, BOOL removed) wearable->setDefinitionVersion(22); U32 index = getWearableIndex(wearable); llinfos << "forcing wearable type " << wearable->getType() << " to version 22 from 24" << llendl; - saveWearable(wearable->getType(),index,TRUE); + saveWearable(wearable->getType(),index); } checkWearableAgainstInventory(viewer_wearable); } } -BOOL LLAgentWearables::itemUpdatePending(const LLUUID& item_id) const -{ - return mItemsAwaitingWearableUpdate.find(item_id) != mItemsAwaitingWearableUpdate.end(); -} - -U32 LLAgentWearables::itemUpdatePendingCount() const -{ - return mItemsAwaitingWearableUpdate.size(); -} - const LLUUID LLAgentWearables::getWearableItemID(LLWearableType::EType type, U32 index) const { const LLViewerWearable *wearable = getViewerWearable(type,index); @@ -776,116 +746,6 @@ BOOL LLAgentWearables::isWearingItem(const LLUUID& item_id) const return getWearableFromItemID(item_id) != NULL; } -// MULTI-WEARABLE: DEPRECATED (see backwards compatibility) -// ! BACKWARDS COMPATIBILITY ! When we stop supporting viewer1.23, we can assume -// that viewers have a Current Outfit Folder and won't need this message, and thus -// we can remove/ignore this whole function. EXCEPT gAgentWearables.notifyLoadingStarted - -// static -void LLAgentWearables::processAgentInitialWearablesUpdate(LLMessageSystem* mesgsys, void** user_data) -{ - // We should only receive this message a single time. Ignore subsequent AgentWearablesUpdates - // that may result from AgentWearablesRequest having been sent more than once. - if (mInitialWearablesUpdateReceived) - return; - - if (isAgentAvatarValid()) - { - gAgentAvatarp->startPhase("process_initial_wearables_update"); - gAgentAvatarp->outputRezTiming("Received initial wearables update"); - } - - // notify subscribers that wearables started loading. See EXT-7777 - // *TODO: find more proper place to not be called from deprecated method. - // Seems such place is found: LLInitialWearablesFetch::processContents() - gAgentWearables.notifyLoadingStarted(); - - mInitialWearablesUpdateReceived = true; - - LLUUID agent_id; - gMessageSystem->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id); - - if (isAgentAvatarValid() && (agent_id == gAgentAvatarp->getID())) - { - U32 unused_update_serial_num; - gMessageSystem->getU32Fast(_PREHASH_AgentData, _PREHASH_SerialNum, unused_update_serial_num); - - const S32 NUM_BODY_PARTS = 4; - S32 num_wearables = gMessageSystem->getNumberOfBlocksFast(_PREHASH_WearableData); - if (num_wearables < NUM_BODY_PARTS) - { - // Transitional state. Avatars should always have at least their body parts (hair, eyes, shape and skin). - // The fact that they don't have any here (only a dummy is sent) implies that either: - // 1. This account existed before we had wearables - // 2. The database has gotten messed up - // 3. This is the account's first login (i.e. the wearables haven't been generated yet). - return; - } - - // Get the UUID of the current outfit folder (will be created if it doesn't exist) - const LLUUID current_outfit_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT); - LLInitialWearablesFetch* outfit = new LLInitialWearablesFetch(current_outfit_id); - - //lldebugs << "processAgentInitialWearablesUpdate()" << llendl; - // Add wearables - // MULTI-WEARABLE: DEPRECATED: Message only supports one wearable per type, will be ignored in future. - gAgentWearables.mItemsAwaitingWearableUpdate.clear(); - for (S32 i=0; i < num_wearables; i++) - { - // Parse initial wearables data from message system - U8 type_u8 = 0; - gMessageSystem->getU8Fast(_PREHASH_WearableData, _PREHASH_WearableType, type_u8, i); - if (type_u8 >= LLWearableType::WT_COUNT) - { - continue; - } - const LLWearableType::EType type = (LLWearableType::EType) type_u8; - - LLUUID item_id; - gMessageSystem->getUUIDFast(_PREHASH_WearableData, _PREHASH_ItemID, item_id, i); - - LLUUID asset_id; - gMessageSystem->getUUIDFast(_PREHASH_WearableData, _PREHASH_AssetID, asset_id, i); - if (asset_id.isNull()) - { - LLViewerWearable::removeFromAvatar(type); - } - else - { - LLAssetType::EType asset_type = LLWearableType::getAssetType(type); - if (asset_type == LLAssetType::AT_NONE) - { - continue; - } - - // MULTI-WEARABLE: DEPRECATED: this message only supports one wearable per type. Should be ignored in future versions - - // Store initial wearables data until we know whether we have the current outfit folder or need to use the data. - LLInitialWearablesFetch::InitialWearableData wearable_data(type, item_id, asset_id); - outfit->add(wearable_data); - } - - lldebugs << " " << LLWearableType::getTypeLabel(type) << llendl; - } - - // Get the complete information on the items in the inventory and set up an observer - // that will trigger when the complete information is fetched. - outfit->startFetch(); - if(outfit->isFinished()) - { - // everything is already here - call done. - outfit->done(); - } - else - { - // it's all on it's way - add an observer, and the inventory - // will call done for us when everything is here. - gInventory.addObserver(outfit); - } - - } -} - // Normally, all wearables referred to "AgentWearablesUpdate" will correspond to actual assets in the // database. If for some reason, we can't load one of those assets, we can try to reconstruct it so that // the user isn't left without a shape, for example. (We can do that only after the inventory has loaded.) @@ -1063,6 +923,8 @@ void LLAgentWearables::createStandardWearables() } } +// SUNSHINE CLEANUP apparently unused. +#if 0 void LLAgentWearables::createStandardWearablesDone(S32 type, U32 index) { llinfos << "type " << type << " index " << index << llendl; @@ -1070,22 +932,7 @@ void LLAgentWearables::createStandardWearablesDone(S32 type, U32 index) if (!isAgentAvatarValid()) return; gAgentAvatarp->updateVisualParams(); } - -void LLAgentWearables::createStandardWearablesAllDone() -{ - // ... because sendAgentWearablesUpdate will notify inventory - // observers. - llinfos << "all done?" << llendl; - - mWearablesLoaded = TRUE; - checkWearablesLoaded(); - notifyLoadingFinished(); - - updateServer(); - - // Treat this as the first texture entry message, if none received yet - gAgentAvatarp->onFirstTEMessageReceived(); -} +#endif void LLAgentWearables::makeNewOutfitDone(S32 type, U32 index) { @@ -1220,7 +1067,8 @@ void LLAgentWearables::removeWearableFinal(const LLWearableType::EType type, boo } // Update the server - updateServer(); + // SUNSHINE CLEANUP + // updateServer(); gInventory.notifyObservers(); } @@ -1354,7 +1202,8 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it mWearablesLoaded = TRUE; checkWearablesLoaded(); notifyLoadingFinished(); - updateServer(); + // SUNSHINE CLEANUP + //updateServer(); gAgentAvatarp->dumpAvatarTEs("setWearableOutfit"); @@ -1479,7 +1328,8 @@ void LLAgentWearables::setWearableFinal(LLInventoryItem* new_item, LLViewerWeara //llinfos << "LLVOAvatar::setWearableItem()" << llendl; //new_wearable->writeToAvatar(TRUE); - updateServer(); + // SUNSHINE CLEANUP + //updateServer(); } // User has picked "remove from avatar" from a menu. @@ -1650,10 +1500,11 @@ void LLAgentWearables::userAttachMultipleAttachments(LLInventoryModel::item_arra } } +// SUNSHINE CLEANUP - itemUpdatePendingCount() was always 0, so this should be removed as useless. void LLAgentWearables::checkWearablesLoaded() const { #ifdef SHOW_ASSERT - U32 item_pend_count = itemUpdatePendingCount(); + U32 item_pend_count = 0; //itemUpdatePendingCount(); if (mWearablesLoaded) { llassert(item_pend_count==0); @@ -1677,14 +1528,14 @@ bool LLAgentWearables::canMoveWearable(const LLUUID& item_id, bool closer_to_bod BOOL LLAgentWearables::areWearablesLoaded() const { - checkWearablesLoaded(); return mWearablesLoaded; } // MULTI-WEARABLE: DEPRECATED: item pending count relies on old messages that don't support multi-wearables. do not trust to be accurate +// SUNSHINE CLEANUP - itemUpdatePendingCount was always 0 due to longstanding bug, might as well remove (or fix) this. void LLAgentWearables::updateWearablesLoaded() { - mWearablesLoaded = (itemUpdatePendingCount()==0); + mWearablesLoaded = true; //(itemUpdatePendingCount()==0); if (mWearablesLoaded) { notifyLoadingFinished(); @@ -1834,10 +1685,12 @@ void LLAgentWearables::editWearableIfRequested(const LLUUID& item_id) } // SUNSHINE CLEANUP - both of these funcs seem to be dead code, so this one should go too. +#if 0 void LLAgentWearables::updateServer() { sendAgentWearablesUpdate(); } +#endif boost::signals2::connection LLAgentWearables::addLoadingStartedCallback(loading_started_callback_t cb) { diff --git a/indra/newview/llagentwearables.h b/indra/newview/llagentwearables.h index 96c7d890b4..87170eeb72 100755 --- a/indra/newview/llagentwearables.h +++ b/indra/newview/llagentwearables.h @@ -62,9 +62,6 @@ public: // LLInitClass interface static void initClass(); -protected: - void createStandardWearablesDone(S32 type, U32 index/* = 0*/); - void createStandardWearablesAllDone(); //-------------------------------------------------------------------- // Queries @@ -156,18 +153,13 @@ protected: //-------------------------------------------------------------------- // Server Communication //-------------------------------------------------------------------- -public: - // Processes the initial wearables update message (if necessary, since the outfit folder makes it redundant) - // SUNSHINE CLEANUP - should be able to remove dependency on this. - static void processAgentInitialWearablesUpdate(LLMessageSystem* mesgsys, void** user_data); - protected: // SUNSHINE CLEANUP dead void sendAgentWearablesUpdate(); // SUNSHINE CLEANUP remove? void sendAgentWearablesRequest(); - // SUNSHINE CLEANUP dead - void updateServer(); + // SUNSHINE CLEANUP dead? + //void updateServer(); static void onInitialWearableAssetArrived(LLViewerWearable* wearable, void* userdata); //-------------------------------------------------------------------- @@ -181,7 +173,7 @@ private: //-------------------------------------------------------------------- public: void saveWearableAs(const LLWearableType::EType type, const U32 index, const std::string& new_name, const std::string& description, BOOL save_in_lost_and_found); - void saveWearable(const LLWearableType::EType type, const U32 index, BOOL send_update = TRUE, + void saveWearable(const LLWearableType::EType type, const U32 index, const std::string new_name = ""); void saveAllWearables(); void revertWearable(const LLWearableType::EType type, const U32 index); @@ -199,9 +191,6 @@ public: static void userRemoveMultipleAttachments(llvo_vec_t& llvo_array); static void userAttachMultipleAttachments(LLInventoryModel::item_array_t& obj_item_array); - BOOL itemUpdatePending(const LLUUID& item_id) const; - U32 itemUpdatePendingCount() const; - //-------------------------------------------------------------------- // Signals //-------------------------------------------------------------------- @@ -228,7 +217,6 @@ private: private: static BOOL mInitialWearablesUpdateReceived; BOOL mWearablesLoaded; - std::set<LLUUID> mItemsAwaitingWearableUpdate; /** * True if agent's outfit is being changed now. diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp index 0be5c19387..d1864c2c4b 100755 --- a/indra/newview/llpaneleditwearable.cpp +++ b/indra/newview/llpaneleditwearable.cpp @@ -1104,7 +1104,7 @@ void LLPanelEditWearable::saveChanges(bool force_save_as) // Remove old link remove_inventory_item(link_item->getUUID(), gAgentAvatarp->mEndCustomizeCallback); } - gAgentWearables.saveWearable(mWearablePtr->getType(), index, TRUE, new_name); + gAgentWearables.saveWearable(mWearablePtr->getType(), index, new_name); } diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 3abc08ec2d..4be0f6b40b 100755 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -2444,8 +2444,8 @@ void register_viewer_callbacks(LLMessageSystem* msg) // msg->setHandlerFuncFast(_PREHASH_ReputationIndividualReply, // LLFloaterRate::processReputationIndividualReply); - msg->setHandlerFuncFast(_PREHASH_AgentWearablesUpdate, - LLAgentWearables::processAgentInitialWearablesUpdate ); + //msg->setHandlerFuncFast(_PREHASH_AgentWearablesUpdate, + // LLAgentWearables::processAgentInitialWearablesUpdate ); msg->setHandlerFunc("ScriptControlChange", LLAgent::processScriptControlChange ); -- cgit v1.2.3 From 2248cbf2b873d3bf264ddbec22ea731bee9a9b96 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Thu, 26 Sep 2013 17:27:01 -0400 Subject: SH-3455 WIP - removed llagentwearablesfetch files, among other changes --- indra/newview/CMakeLists.txt | 2 - indra/newview/llagentwearables.cpp | 177 +-------------------------- indra/newview/llagentwearables.h | 14 --- indra/newview/llagentwearablesfetch.cpp | 204 -------------------------------- indra/newview/llagentwearablesfetch.h | 73 ------------ 5 files changed, 5 insertions(+), 465 deletions(-) delete mode 100755 indra/newview/llagentwearablesfetch.cpp delete mode 100755 indra/newview/llagentwearablesfetch.h (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 7e50e761ae..9f9b9c68a3 100755 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -110,7 +110,6 @@ set(viewer_SOURCE_FILES llagentpilot.cpp llagentui.cpp llagentwearables.cpp - llagentwearablesfetch.cpp llanimstatelabels.cpp llappcorehttp.cpp llappearancemgr.cpp @@ -695,7 +694,6 @@ set(viewer_HEADER_FILES llagentpilot.h llagentui.h llagentwearables.h - llagentwearablesfetch.h llanimstatelabels.h llappcorehttp.h llappearance.h diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index a97396ae1c..5b18a45431 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -30,7 +30,6 @@ #include "llaccordionctrltab.h" #include "llagent.h" #include "llagentcamera.h" -#include "llagentwearablesfetch.h" #include "llappearancemgr.h" #include "llcallbacklist.h" #include "llfloatersidepanelcontainer.h" @@ -207,13 +206,6 @@ LLAgentWearables::AddWearableToAgentInventoryCallback::AddWearableToAgentInvento void LLAgentWearables::AddWearableToAgentInventoryCallback::fire(const LLUUID& inv_item) { - if (mTodo & CALL_CREATESTANDARDDONE) - { - // SUNSHINE CLEANUP - llassert(false); // does not appear to ever be used. - llinfos << "callback fired, inv_item " << inv_item.asString() << llendl; - } - if (inv_item.isNull()) return; @@ -227,13 +219,6 @@ void LLAgentWearables::AddWearableToAgentInventoryCallback::fire(const LLUUID& i /* * Do this for every one in the loop */ - if (mTodo & CALL_CREATESTANDARDDONE) - { - // SUNSHINE CLEANUP - llassert(false); // does not appear to ever be used. - //LLAppearanceMgr::instance().addCOFItemLink(inv_item); - //gAgentWearables.createStandardWearablesDone(mType, mIndex); - } if (mTodo & CALL_MAKENEWOUTFITDONE) { gAgentWearables.makeNewOutfitDone(mType, mIndex); @@ -288,84 +273,6 @@ void LLAgentWearables::addWearabletoAgentInventoryDone(const LLWearableType::ETy gInventory.notifyObservers(); } -// SUNSHINE CLEANUP dead? -void LLAgentWearables::sendAgentWearablesUpdate() -{ - return; // try as NO_OP // SUNSHINE CLEANUP -#if 0 - // First make sure that we have inventory items for each wearable - for (S32 type=0; type < LLWearableType::WT_COUNT; ++type) - { - for (U32 index=0; index < getWearableCount((LLWearableType::EType)type); ++index) - { - LLViewerWearable* wearable = getViewerWearable((LLWearableType::EType)type,index); - if (wearable) - { - if (wearable->getItemID().isNull()) - { - LLPointer<LLInventoryCallback> cb = - new AddWearableToAgentInventoryCallback( - LLPointer<LLRefCount>(NULL), - (LLWearableType::EType)type, - index, - wearable, - AddWearableToAgentInventoryCallback::CALL_NONE); - addWearableToAgentInventory(cb, wearable); - } - else - { - gInventory.addChangedMask(LLInventoryObserver::LABEL, - wearable->getItemID()); - } - } - } - } - - // Then make sure the inventory is in sync with the avatar. - gInventory.notifyObservers(); - - // Send the AgentIsNowWearing - gMessageSystem->newMessageFast(_PREHASH_AgentIsNowWearing); - - gMessageSystem->nextBlockFast(_PREHASH_AgentData); - gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - - lldebugs << "sendAgentWearablesUpdate()" << llendl; - // MULTI-WEARABLE: DEPRECATED: HACK: index to 0- server database tables don't support concept of multiwearables. - for (S32 type=0; type < LLWearableType::WT_COUNT; ++type) - { - gMessageSystem->nextBlockFast(_PREHASH_WearableData); - - U8 type_u8 = (U8)type; - gMessageSystem->addU8Fast(_PREHASH_WearableType, type_u8); - - LLViewerWearable* wearable = getViewerWearable((LLWearableType::EType)type, 0); - if (wearable) - { - //llinfos << "Sending wearable " << wearable->getName() << llendl; - LLUUID item_id = wearable->getItemID(); - const LLViewerInventoryItem *item = gInventory.getItem(item_id); - if (item && item->getIsLinkType()) - { - // Get the itemID that this item points to. i.e. make sure - // we are storing baseitems, not their links, in the database. - item_id = item->getLinkedUUID(); - } - gMessageSystem->addUUIDFast(_PREHASH_ItemID, item_id); - } - else - { - //llinfos << "Not wearing wearable type " << LLWearableType::getTypeName((LLWearableType::EType)i) << llendl; - gMessageSystem->addUUIDFast(_PREHASH_ItemID, LLUUID::null); - } - - lldebugs << " " << LLWearableType::getTypeLabel((LLWearableType::EType)type) << ": " << (wearable ? wearable->getAssetID() : LLUUID::null) << llendl; - } - gAgent.sendReliableMessage(); -#endif -} - void LLAgentWearables::saveWearable(const LLWearableType::EType type, const U32 index, const std::string new_name) { @@ -514,8 +421,6 @@ void LLAgentWearables::saveAllWearables() for (U32 j=0; j < getWearableCount((LLWearableType::EType)i); j++) saveWearable((LLWearableType::EType)i, j); } - // SUNSHINE CLEANUP - check ok - //sendAgentWearablesUpdate(); } // Called when the user changes the name of a wearable inventory item that is currently being worn. @@ -544,8 +449,6 @@ void LLAgentWearables::setWearableName(const LLUUID& item_id, const std::string& old_wearable->setName(old_name); setWearable((LLWearableType::EType)i,j,new_wearable); - // SUNSHINE CLEANUP - verify ok - //sendAgentWearablesUpdate(); break; } } @@ -666,15 +569,6 @@ LLViewerWearable* LLAgentWearables::getWearableFromAssetID(const LLUUID& asset_i return NULL; } -void LLAgentWearables::sendAgentWearablesRequest() -{ - gMessageSystem->newMessageFast(_PREHASH_AgentWearablesRequest); - gMessageSystem->nextBlockFast(_PREHASH_AgentData); - gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - gAgent.sendReliableMessage(); -} - LLViewerWearable* LLAgentWearables::getViewerWearable(const LLWearableType::EType type, U32 index /*= 0*/) { return dynamic_cast<LLViewerWearable*> (getWearable(type, index)); @@ -775,18 +669,8 @@ void LLAgentWearables::recoverMissingWearable(const LLWearableType::EType type, void LLAgentWearables::recoverMissingWearableDone() { - // Have all the wearables that the avatar was wearing at log-in arrived or been fabricated? - updateWearablesLoaded(); - if (areWearablesLoaded()) - { - // Make sure that the server's idea of the avatar's wearables actually match the wearables. - //gAgent.sendAgentSetAppearance(); - } - else - { - gInventory.addChangedMask(LLInventoryObserver::LABEL, LLUUID::null); - gInventory.notifyObservers(); - } + gInventory.addChangedMask(LLInventoryObserver::LABEL, LLUUID::null); + gInventory.notifyObservers(); } void LLAgentWearables::addLocalTextureObject(const LLWearableType::EType wearable_type, const LLAvatarAppearanceDefines::ETextureIndex texture_type, U32 wearable_index) @@ -923,17 +807,6 @@ void LLAgentWearables::createStandardWearables() } } -// SUNSHINE CLEANUP apparently unused. -#if 0 -void LLAgentWearables::createStandardWearablesDone(S32 type, U32 index) -{ - llinfos << "type " << type << " index " << index << llendl; - - if (!isAgentAvatarValid()) return; - gAgentAvatarp->updateVisualParams(); -} -#endif - void LLAgentWearables::makeNewOutfitDone(S32 type, U32 index) { LLUUID first_item_id = getWearableItemID((LLWearableType::EType)type, index); @@ -1066,9 +939,6 @@ void LLAgentWearables::removeWearableFinal(const LLWearableType::EType type, boo } } - // Update the server - // SUNSHINE CLEANUP - // updateServer(); gInventory.notifyObservers(); } @@ -1200,10 +1070,10 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it // Start rendering & update the server mWearablesLoaded = TRUE; - checkWearablesLoaded(); + + // SUNSHINE CLEANUP - these checks for done never worked. Should they be modified? + //checkWearablesLoaded(); notifyLoadingFinished(); - // SUNSHINE CLEANUP - //updateServer(); gAgentAvatarp->dumpAvatarTEs("setWearableOutfit"); @@ -1324,12 +1194,6 @@ void LLAgentWearables::setWearableFinal(LLInventoryItem* new_item, LLViewerWeara llinfos << "Replaced current element 0 for type " << type << " size is now " << getWearableCount(type) << llendl; } - - //llinfos << "LLVOAvatar::setWearableItem()" << llendl; - //new_wearable->writeToAvatar(TRUE); - - // SUNSHINE CLEANUP - //updateServer(); } // User has picked "remove from avatar" from a menu. @@ -1500,18 +1364,6 @@ void LLAgentWearables::userAttachMultipleAttachments(LLInventoryModel::item_arra } } -// SUNSHINE CLEANUP - itemUpdatePendingCount() was always 0, so this should be removed as useless. -void LLAgentWearables::checkWearablesLoaded() const -{ -#ifdef SHOW_ASSERT - U32 item_pend_count = 0; //itemUpdatePendingCount(); - if (mWearablesLoaded) - { - llassert(item_pend_count==0); - } -#endif -} - // Returns false if the given wearable is already topmost/bottommost // (depending on closer_to_body parameter). bool LLAgentWearables::canMoveWearable(const LLUUID& item_id, bool closer_to_body) const @@ -1531,17 +1383,6 @@ BOOL LLAgentWearables::areWearablesLoaded() const return mWearablesLoaded; } -// MULTI-WEARABLE: DEPRECATED: item pending count relies on old messages that don't support multi-wearables. do not trust to be accurate -// SUNSHINE CLEANUP - itemUpdatePendingCount was always 0 due to longstanding bug, might as well remove (or fix) this. -void LLAgentWearables::updateWearablesLoaded() -{ - mWearablesLoaded = true; //(itemUpdatePendingCount()==0); - if (mWearablesLoaded) - { - notifyLoadingFinished(); - } -} - bool LLAgentWearables::canWearableBeRemoved(const LLViewerWearable* wearable) const { if (!wearable) return false; @@ -1684,14 +1525,6 @@ void LLAgentWearables::editWearableIfRequested(const LLUUID& item_id) } } -// SUNSHINE CLEANUP - both of these funcs seem to be dead code, so this one should go too. -#if 0 -void LLAgentWearables::updateServer() -{ - sendAgentWearablesUpdate(); -} -#endif - boost::signals2::connection LLAgentWearables::addLoadingStartedCallback(loading_started_callback_t cb) { return mLoadingStartedSignal.connect(cb); diff --git a/indra/newview/llagentwearables.h b/indra/newview/llagentwearables.h index 87170eeb72..a7b033a37d 100755 --- a/indra/newview/llagentwearables.h +++ b/indra/newview/llagentwearables.h @@ -42,7 +42,6 @@ class LLInventoryItem; class LLVOAvatarSelf; class LLViewerWearable; -class LLInitialWearablesFetch; class LLViewerObject; class LLAgentWearables : public LLInitClass<LLAgentWearables>, public LLWearableData @@ -51,7 +50,6 @@ class LLAgentWearables : public LLInitClass<LLAgentWearables>, public LLWearable // Constructors / destructors / Initializers //-------------------------------------------------------------------- public: - friend class LLInitialWearablesFetch; LLAgentWearables(); virtual ~LLAgentWearables(); @@ -149,18 +147,6 @@ private: void removeWearableFinal(const LLWearableType::EType type, bool do_remove_all /*= false*/, U32 index /*= 0*/); protected: static bool onRemoveWearableDialog(const LLSD& notification, const LLSD& response); - - //-------------------------------------------------------------------- - // Server Communication - //-------------------------------------------------------------------- -protected: - // SUNSHINE CLEANUP dead - void sendAgentWearablesUpdate(); - // SUNSHINE CLEANUP remove? - void sendAgentWearablesRequest(); - // SUNSHINE CLEANUP dead? - //void updateServer(); - static void onInitialWearableAssetArrived(LLViewerWearable* wearable, void* userdata); //-------------------------------------------------------------------- // Outfits diff --git a/indra/newview/llagentwearablesfetch.cpp b/indra/newview/llagentwearablesfetch.cpp deleted file mode 100755 index a10382b830..0000000000 --- a/indra/newview/llagentwearablesfetch.cpp +++ /dev/null @@ -1,204 +0,0 @@ -/** - * @file llagentwearablesfetch.cpp - * @brief LLAgentWearblesFetch class implementation - * - * $LicenseInfo:firstyear=2001&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#include "llviewerprecompiledheaders.h" -#include "llagentwearablesfetch.h" - -#include "llagent.h" -#include "llagentwearables.h" -#include "llappearancemgr.h" -#include "llinventoryfunctions.h" -#include "llstartup.h" -#include "llvoavatarself.h" - - -LLInitialWearablesFetch::LLInitialWearablesFetch(const LLUUID& cof_id) : - LLInventoryFetchDescendentsObserver(cof_id) -{ - if (isAgentAvatarValid()) - { - gAgentAvatarp->startPhase("initial_wearables_fetch"); - gAgentAvatarp->outputRezTiming("Initial wearables fetch started"); - } -} - -LLInitialWearablesFetch::~LLInitialWearablesFetch() -{ -} - -// virtual -void LLInitialWearablesFetch::done() -{ - // Delay processing the actual results of this so it's not handled within - // gInventory.notifyObservers. The results will be handled in the next - // idle tick instead. - gInventory.removeObserver(this); - doOnIdleOneTime(boost::bind(&LLInitialWearablesFetch::processContents,this)); - if (isAgentAvatarValid()) - { - gAgentAvatarp->stopPhase("initial_wearables_fetch"); - gAgentAvatarp->outputRezTiming("Initial wearables fetch done"); - } -} - -void LLInitialWearablesFetch::add(InitialWearableData &data) - -{ - mAgentInitialWearables.push_back(data); -} - -// SUNSHINE CLEANUP - should not have to wait for this message to start resolving appearance. Where to hook in instead? -void LLInitialWearablesFetch::processContents() -{ - if(!gAgentAvatarp) //no need to process wearables if the agent avatar is deleted. - { - delete this; - return ; - } - - // Fetch the wearable items from the Current Outfit Folder - LLInventoryModel::cat_array_t cat_array; - LLInventoryModel::item_array_t wearable_array; - LLFindWearables is_wearable; - llassert_always(mComplete.size() != 0); - gInventory.collectDescendentsIf(mComplete.front(), cat_array, wearable_array, - LLInventoryModel::EXCLUDE_TRASH, is_wearable); - - LLAppearanceMgr::instance().setAttachmentInvLinkEnable(true); - if (wearable_array.count() > 0) - { - gAgentWearables.notifyLoadingStarted(); - LLAppearanceMgr::instance().updateAppearanceFromCOF(); - } - else - { - // SUNSHINE CLEANUP - remove? - // if we're constructing the COF from the wearables message, we don't have a proper outfit link - LLAppearanceMgr::instance().setOutfitDirty(true); - processWearablesMessage(); - } - delete this; -} - -class LLFetchAndLinkObserver: public LLInventoryFetchItemsObserver -{ -public: - LLFetchAndLinkObserver(uuid_vec_t& ids): - LLInventoryFetchItemsObserver(ids) - { - } - ~LLFetchAndLinkObserver() - { - } - virtual void done() - { - gInventory.removeObserver(this); - - // Link to all fetched items in COF. - LLPointer<LLInventoryCallback> link_waiter = new LLUpdateAppearanceOnDestroy; - LLInventoryObject::const_object_list_t item_array; - for (uuid_vec_t::iterator it = mIDs.begin(); - it != mIDs.end(); - ++it) - { - LLUUID id = *it; - LLConstPointer<LLInventoryObject> item = gInventory.getItem(*it); - if (!item) - { - llwarns << "fetch failed for item " << (*it) << "!" << llendl; - continue; - } - item_array.push_back(item); - } - link_inventory_array(LLAppearanceMgr::instance().getCOF(), item_array, link_waiter); - } -}; - -// SUNSHINE CLEANUP - remove dependency on this? -void LLInitialWearablesFetch::processWearablesMessage() -{ - if (!mAgentInitialWearables.empty()) // We have an empty current outfit folder, use the message data instead. - { - const LLUUID current_outfit_id = LLAppearanceMgr::instance().getCOF(); - uuid_vec_t ids; - for (U8 i = 0; i < mAgentInitialWearables.size(); ++i) - { - // Populate the current outfit folder with links to the wearables passed in the message - InitialWearableData *wearable_data = new InitialWearableData(mAgentInitialWearables[i]); // This will be deleted in the callback. - - if (wearable_data->mAssetID.notNull()) - { - ids.push_back(wearable_data->mItemID); - } - else - { - llinfos << "Invalid wearable, type " << wearable_data->mType << " itemID " - << wearable_data->mItemID << " assetID " << wearable_data->mAssetID << llendl; - delete wearable_data; - } - } - - // Add all current attachments to the requested items as well. - if (isAgentAvatarValid()) - { - for (LLVOAvatar::attachment_map_t::const_iterator iter = gAgentAvatarp->mAttachmentPoints.begin(); - iter != gAgentAvatarp->mAttachmentPoints.end(); ++iter) - { - LLViewerJointAttachment* attachment = iter->second; - if (!attachment) continue; - for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin(); - attachment_iter != attachment->mAttachedObjects.end(); - ++attachment_iter) - { - LLViewerObject* attached_object = (*attachment_iter); - if (!attached_object) continue; - const LLUUID& item_id = attached_object->getAttachmentItemID(); - if (item_id.isNull()) continue; - ids.push_back(item_id); - } - } - } - - // Need to fetch the inventory items for ids, then create links to them after they arrive. - LLFetchAndLinkObserver *fetcher = new LLFetchAndLinkObserver(ids); - fetcher->startFetch(); - // If no items to be fetched, done will never be triggered. - // TODO: Change LLInventoryFetchItemsObserver::fetchItems to trigger done() on this condition. - if (fetcher->isFinished()) - { - fetcher->done(); - } - else - { - gInventory.addObserver(fetcher); - } - } - else - { - LL_WARNS("Wearables") << "No current outfit folder items found and no initial wearables fallback message received." << LL_ENDL; - } -} - diff --git a/indra/newview/llagentwearablesfetch.h b/indra/newview/llagentwearablesfetch.h deleted file mode 100755 index 81b03110ae..0000000000 --- a/indra/newview/llagentwearablesfetch.h +++ /dev/null @@ -1,73 +0,0 @@ -/** - * @file llagentwearablesinitialfetch.h - * @brief LLAgentWearablesInitialFetch class header file - * - * $LicenseInfo:firstyear=2000&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifndef LL_LLAGENTWEARABLESINITIALFETCH_H -#define LL_LLAGENTWEARABLESINITIALFETCH_H - -#include "llinventoryobserver.h" -#include "llwearabletype.h" -#include "lluuid.h" - -//-------------------------------------------------------------------- -// InitialWearablesFetch -// -// This grabs contents from the COF and processes them. -// The processing is handled in idle(), i.e. outside of done(), -// to avoid gInventory.notifyObservers recursion. -//-------------------------------------------------------------------- -class LLInitialWearablesFetch : public LLInventoryFetchDescendentsObserver -{ - LOG_CLASS(LLInitialWearablesFetch); - -public: - LLInitialWearablesFetch(const LLUUID& cof_id); - ~LLInitialWearablesFetch(); - virtual void done(); - - struct InitialWearableData - { - LLWearableType::EType mType; - LLUUID mItemID; - LLUUID mAssetID; - InitialWearableData(LLWearableType::EType type, LLUUID& itemID, LLUUID& assetID) : - mType(type), - mItemID(itemID), - mAssetID(assetID) - {} - }; - - void add(InitialWearableData &data); - -protected: - void processWearablesMessage(); - void processContents(); - -private: - typedef std::vector<InitialWearableData> initial_wearable_data_vec_t; - initial_wearable_data_vec_t mAgentInitialWearables; // Wearables from the old agent wearables msg -}; - -#endif // LL_AGENTWEARABLESINITIALFETCH_H -- cgit v1.2.3 From 2d7dd7db24fefe9dcd8bde83a92304936a5f77ed Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Tue, 1 Oct 2013 07:54:30 -0400 Subject: SH-3455 WIP - dead code removal --- indra/newview/llagentwearables.cpp | 2 +- indra/newview/llagentwearables.h | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 5b18a45431..eda0ff71ba 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -655,7 +655,7 @@ void LLAgentWearables::recoverMissingWearable(const LLWearableType::EType type, // Add a new one in the lost and found folder. // (We used to overwrite the "not found" one, but that could potentially - // destory content.) JC + // destroy content.) JC const LLUUID lost_and_found_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND); LLPointer<LLInventoryCallback> cb = new AddWearableToAgentInventoryCallback( diff --git a/indra/newview/llagentwearables.h b/indra/newview/llagentwearables.h index a7b033a37d..8fb2783fff 100755 --- a/indra/newview/llagentwearables.h +++ b/indra/newview/llagentwearables.h @@ -214,12 +214,6 @@ private: // Support classes //-------------------------------------------------------------------------------- private: - class createStandardWearablesAllDoneCallback : public LLRefCount - { - protected: - ~createStandardWearablesAllDoneCallback(); - }; - class AddWearableToAgentInventoryCallback : public LLInventoryCallback { public: -- cgit v1.2.3 From 230db3e83b4c018d381ad5f4fe77e7f7f384f397 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Fri, 4 Oct 2013 12:08:15 -0400 Subject: SH-3455 WIP --- indra/newview/llagentwearables.cpp | 40 -------- indra/newview/llstartup.cpp | 6 +- indra/newview/llviewermenu.cpp | 1 + indra/newview/llvoavatar.cpp | 11 ++- indra/newview/llvoavatarself.cpp | 184 +------------------------------------ indra/newview/llvoavatarself.h | 11 +-- 6 files changed, 12 insertions(+), 241 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index eda0ff71ba..798b733efb 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -211,11 +211,6 @@ void LLAgentWearables::AddWearableToAgentInventoryCallback::fire(const LLUUID& i gAgentWearables.addWearabletoAgentInventoryDone(mType, mIndex, inv_item, mWearable); - if (mTodo & CALL_RECOVERDONE) - { - LLAppearanceMgr::instance().addCOFItemLink(inv_item); - gAgentWearables.recoverMissingWearableDone(); - } /* * Do this for every one in the loop */ @@ -640,39 +635,6 @@ BOOL LLAgentWearables::isWearingItem(const LLUUID& item_id) const return getWearableFromItemID(item_id) != NULL; } -// Normally, all wearables referred to "AgentWearablesUpdate" will correspond to actual assets in the -// database. If for some reason, we can't load one of those assets, we can try to reconstruct it so that -// the user isn't left without a shape, for example. (We can do that only after the inventory has loaded.) -void LLAgentWearables::recoverMissingWearable(const LLWearableType::EType type, U32 index) -{ - // Try to recover by replacing missing wearable with a new one. - LLNotificationsUtil::add("ReplacedMissingWearable"); - lldebugs << "Wearable " << LLWearableType::getTypeLabel(type) << " could not be downloaded. Replaced inventory item with default wearable." << llendl; - LLViewerWearable* new_wearable = LLWearableList::instance().createNewWearable(type, gAgentAvatarp); - - setWearable(type,index,new_wearable); - //new_wearable->writeToAvatar(TRUE); - - // Add a new one in the lost and found folder. - // (We used to overwrite the "not found" one, but that could potentially - // destroy content.) JC - const LLUUID lost_and_found_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND); - LLPointer<LLInventoryCallback> cb = - new AddWearableToAgentInventoryCallback( - LLPointer<LLRefCount>(NULL), - type, - index, - new_wearable, - AddWearableToAgentInventoryCallback::CALL_RECOVERDONE); - addWearableToAgentInventory(cb, new_wearable, lost_and_found_id, TRUE); -} - -void LLAgentWearables::recoverMissingWearableDone() -{ - gInventory.addChangedMask(LLInventoryObserver::LABEL, LLUUID::null); - gInventory.notifyObservers(); -} - void LLAgentWearables::addLocalTextureObject(const LLWearableType::EType wearable_type, const LLAvatarAppearanceDefines::ETextureIndex texture_type, U32 wearable_index) { LLViewerWearable* wearable = getViewerWearable((LLWearableType::EType)wearable_type, wearable_index); @@ -1071,8 +1033,6 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it // Start rendering & update the server mWearablesLoaded = TRUE; - // SUNSHINE CLEANUP - these checks for done never worked. Should they be modified? - //checkWearablesLoaded(); notifyLoadingFinished(); gAgentAvatarp->dumpAvatarTEs("setWearableOutfit"); diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 4be0f6b40b..239227b904 100755 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -2062,6 +2062,7 @@ bool idle_startup() const F32 wearables_time = wearables_timer.getElapsedTimeF32(); const F32 MAX_WEARABLES_TIME = 10.f; +#if 0 if (!gAgent.isGenderChosen() && isAgentAvatarValid()) { // No point in waiting for clothing, we don't even @@ -2077,6 +2078,7 @@ bool idle_startup() LLStartUp::setStartupState( STATE_CLEANUP ); return TRUE; } +#endif display_startup(); @@ -2370,7 +2372,6 @@ void register_viewer_callbacks(LLMessageSystem* msg) msg->setHandlerFuncFast(_PREHASH_RemoveNameValuePair, process_remove_name_value); msg->setHandlerFuncFast(_PREHASH_AvatarAnimation, process_avatar_animation); msg->setHandlerFuncFast(_PREHASH_AvatarAppearance, process_avatar_appearance); - msg->setHandlerFunc("RebakeAvatarTextures", LLVOAvatarSelf::processRebakeAvatarTextures); msg->setHandlerFuncFast(_PREHASH_CameraConstraint, process_camera_constraint); msg->setHandlerFuncFast(_PREHASH_AvatarSitResponse, process_avatar_sit_response); msg->setHandlerFunc("SetFollowCamProperties", process_set_follow_cam_properties); @@ -2444,9 +2445,6 @@ void register_viewer_callbacks(LLMessageSystem* msg) // msg->setHandlerFuncFast(_PREHASH_ReputationIndividualReply, // LLFloaterRate::processReputationIndividualReply); - //msg->setHandlerFuncFast(_PREHASH_AgentWearablesUpdate, - // LLAgentWearables::processAgentInitialWearablesUpdate ); - msg->setHandlerFunc("ScriptControlChange", LLAgent::processScriptControlChange ); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 49eb7dc94a..e1faf3b29b 100755 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -7719,6 +7719,7 @@ void handle_buy_currency_test(void*) LLFloaterReg::showInstance("buy_currency_html", LLSD(url)); } +// SUNSHINE CLEANUP - is only the request update at the end needed now? void handle_rebake_textures(void*) { if (!isAgentAvatarValid()) return; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 49bbf97a23..df54f26ae7 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -6856,7 +6856,7 @@ bool resolve_appearance_version(const LLAppearanceMessageContents& contents, S32 { appearance_version = contents.mAppearanceVersion; } - else // still not set, go with 0. + else // still not set, go with 1. { appearance_version = 1; } @@ -6866,7 +6866,6 @@ bool resolve_appearance_version(const LLAppearanceMessageContents& contents, S32 return true; } -// SUNSHINE CLEANUP - if we can assume server baking, we can simplify some code here. //----------------------------------------------------------------------------- // processAvatarAppearance() //----------------------------------------------------------------------------- @@ -6898,11 +6897,15 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) return; } llassert(appearance_version > 0); + if (appearance_version > 1) + { + llwarns << "unsupported appearance version " << appearance_version << ", discarding appearance message" << llendl; + return; + } S32 this_update_cof_version = contents.mCOFVersion; S32 last_update_request_cof_version = mLastUpdateRequestCOFVersion; - // Only now that we have result of appearance_version can we decide whether to bail out. if( isSelf() ) { LL_DEBUGS("Avatar") << "this_update_cof_version " << this_update_cof_version @@ -6941,7 +6944,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) return; } - // No backsies zone - if we get here, the message should be valid and usable, will process. + // No backsies zone - if we get here, the message should be valid and usable, will be processed. // Note: // RequestAgentUpdateAppearanceResponder::onRequestRequested() diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 498f8c8277..d7ff78d2a6 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -764,58 +764,6 @@ void LLVOAvatarSelf::stopMotionFromSource(const LLUUID& source_id) } } -//virtual -U32 LLVOAvatarSelf::processUpdateMessage(LLMessageSystem *mesgsys, - void **user_data, - U32 block_num, - const EObjectUpdateType update_type, - LLDataPacker *dp) -{ - U32 retval = LLVOAvatar::processUpdateMessage(mesgsys,user_data,block_num,update_type,dp); - - // SUNSHINE CLEANUP - does this become relevant again if we don't - // have to wait for appearance message to tell us where bakes are - // coming from? - -#if 0 - // DRANO - it's not clear this does anything useful. If we wait - // until an appearance message has been received, we already have - // the texture ids. If we don't wait, we don't yet know where to - // look for baked textures, because we haven't received the - // appearance version data from the appearance message. This looks - // like an old optimization that's incompatible with server-side - // texture baking. - - // FIXME DRANO - skipping in the case of !mFirstAppearanceMessageReceived prevents us from trying to - // load textures before we know where they come from (ie, from baking service or not); - // unknown impact on performance. - if (mInitialBakesLoaded == false && retval == 0x0 && mFirstAppearanceMessageReceived) - { - // call update textures to force the images to be created - updateMeshTextures(); - - // unpack the texture UUIDs to the texture slots - retval = unpackTEMessage(mesgsys, _PREHASH_ObjectData, (S32) block_num); - - // need to trigger a few operations to get the avatar to use the new bakes - for (U32 i = 0; i < mBakedTextureDatas.size(); i++) - { - const LLAvatarAppearanceDefines::ETextureIndex te = mBakedTextureDatas[i].mTextureIndex; - LLUUID texture_id = getTEImage(te)->getID(); - setNewBakedTexture(te, texture_id); - mInitialBakeIDs[i] = texture_id; - } - - onFirstTEMessageReceived(); - - mInitialBakesLoaded = true; - } -#endif - - return retval; -} - - void LLVOAvatarSelf::setLocalTextureTE(U8 te, LLViewerTexture* image, U32 index) { if (te >= TEX_NUM_INDICES) @@ -2492,81 +2440,6 @@ ETextureIndex LLVOAvatarSelf::getBakedTE( const LLViewerTexLayerSet* layerset ) return TEX_HEAD_BAKED; } - -void LLVOAvatarSelf::setNewBakedTexture(LLAvatarAppearanceDefines::EBakedTextureIndex i, const LLUUID &uuid) -{ - ETextureIndex index = LLAvatarAppearanceDictionary::bakedToLocalTextureIndex(i); - setNewBakedTexture(index, uuid); -} - - -//----------------------------------------------------------------------------- -// setNewBakedTexture() -// A new baked texture has been successfully uploaded and we can start using it now. -//----------------------------------------------------------------------------- -void LLVOAvatarSelf::setNewBakedTexture( ETextureIndex te, const LLUUID& uuid ) -{ - // SUNSHINE CLEANUP - // If we reinstate processUpdateMessage(), this needs to be updated for server-bake textures. - llassert(false); - - // Baked textures live on other sims. - LLHost target_host = getObjectHost(); - setTEImage( te, LLViewerTextureManager::getFetchedTextureFromHost( uuid, FTT_HOST_BAKE, target_host ) ); - updateMeshTextures(); - dirtyMesh(); - - LLVOAvatar::cullAvatarsByPixelArea(); - - /* switch(te) - case TEX_HEAD_BAKED: - llinfos << "New baked texture: HEAD" << llendl; */ - const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = LLAvatarAppearanceDictionary::getInstance()->getTexture(te); - if (texture_dict->mIsBakedTexture) - { - debugBakedTextureUpload(texture_dict->mBakedTextureIndex, TRUE); // FALSE for start of upload, TRUE for finish. - llinfos << "New baked texture: " << texture_dict->mName << " UUID: " << uuid <<llendl; - } - else - { - llwarns << "New baked texture: unknown te " << te << llendl; - } - - // dumpAvatarTEs( "setNewBakedTexture() send" ); - // RN: throttle uploads - if (gSavedSettings.getBOOL("DebugAvatarRezTime")) - { - LLSD args; - args["EXISTENCE"] = llformat("%d",(U32)mDebugExistenceTimer.getElapsedTimeF32()); - args["TIME"] = llformat("%d",(U32)mDebugSelfLoadTimer.getElapsedTimeF32()); - if (isAllLocalTextureDataFinal()) - { - LLNotificationsUtil::add("AvatarRezSelfBakedDoneNotification",args); - LL_DEBUGS("Avatar") << "REZTIME: [ " << (U32)mDebugExistenceTimer.getElapsedTimeF32() - << "sec ]" - << avString() - << "RuthTimer " << (U32)mRuthDebugTimer.getElapsedTimeF32() - << " SelfLoadTimer " << (U32)mDebugSelfLoadTimer.getElapsedTimeF32() - << " Notification " << "AvatarRezSelfBakedDoneNotification" - << llendl; - } - else - { - args["STATUS"] = debugDumpAllLocalTextureDataInfo(); - LLNotificationsUtil::add("AvatarRezSelfBakedUpdateNotification",args); - LL_DEBUGS("Avatar") << "REZTIME: [ " << (U32)mDebugExistenceTimer.getElapsedTimeF32() - << "sec ]" - << avString() - << "RuthTimer " << (U32)mRuthDebugTimer.getElapsedTimeF32() - << " SelfLoadTimer " << (U32)mDebugSelfLoadTimer.getElapsedTimeF32() - << " Notification " << "AvatarRezSelfBakedUpdateNotification" - << llendl; - } - } - - outputRezDiagnostics(); -} - // FIXME: This is not called consistently. Something may be broken. void LLVOAvatarSelf::outputRezDiagnostics() const { @@ -2642,55 +2515,7 @@ void LLVOAvatarSelf::reportAvatarRezTime() const // TODO: report mDebugSelfLoadTimer.getElapsedTimeF32() somehow. } -// static -void LLVOAvatarSelf::processRebakeAvatarTextures(LLMessageSystem* msg, void**) -{ - LLUUID texture_id; - msg->getUUID("TextureData", "TextureID", texture_id); - if (!isAgentAvatarValid()) return; - - // If this is a texture corresponding to one of our baked entries, - // just rebake that layer set. - BOOL found = FALSE; - - /* ETextureIndex baked_texture_indices[BAKED_NUM_INDICES] = - TEX_HEAD_BAKED, - TEX_UPPER_BAKED, */ - 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) - { - if (texture_id == gAgentAvatarp->getTEImage(index)->getID()) - { - LLViewerTexLayerSet* layer_set = gAgentAvatarp->getLayerSet(index); - if (layer_set) - { - llinfos << "TAT: rebake - matched entry " << (S32)index << llendl; - gAgentAvatarp->invalidateComposite(layer_set); - found = TRUE; - LLViewerStats::getInstance()->incStat(LLViewerStats::ST_TEX_REBAKES); - } - } - } - } - - // If texture not found, rebake all entries. - if (!found) - { - gAgentAvatarp->forceBakeAllTextures(); - } - else - { - // Not sure if this is necessary, but forceBakeAllTextures() does it. - gAgentAvatarp->updateMeshTextures(); - } -} - - +// SUNSHINE CLEANUP - not clear we need any of this, may be sufficient to request server appearance in llviewermenu.cpp:handle_rebake_textures() void LLVOAvatarSelf::forceBakeAllTextures(bool slam_for_debug) { llinfos << "TAT: forced full rebake. " << llendl; @@ -2806,13 +2631,6 @@ void LLVOAvatarSelf::onCustomizeEnd(bool disable_camera_switch) if (isAgentAvatarValid()) { gAgentAvatarp->mIsEditingAppearance = false; - // SUNSHINE CLEANUP - should no longer happen - if (gAgentAvatarp->getRegion() && !gAgentAvatarp->getRegion()->getCentralBakeVersion()) - { - // FIXME DRANO - move to sendAgentSetAppearance, make conditional on upload complete. - gAgentAvatarp->mUseLocalAppearance = false; - } - gAgentAvatarp->invalidateAll(); if (gSavedSettings.getBOOL("AppearanceCameraMovement") && !disable_camera_switch) diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index 7eaa239890..0eb80d1fad 100755 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -103,12 +103,6 @@ public: /*virtual*/ void updateVisualParams(); /*virtual*/ void idleUpdateAppearanceAnimation(); - /*virtual*/ U32 processUpdateMessage(LLMessageSystem *mesgsys, - void **user_data, - U32 block_num, - const EObjectUpdateType update_type, - LLDataPacker *dp); - private: // helper function. Passed in param is assumed to be in avatar's parameter list. BOOL setParamWeight(const LLViewerVisualParam *param, F32 weight); @@ -234,11 +228,8 @@ private: //-------------------------------------------------------------------- public: LLAvatarAppearanceDefines::ETextureIndex getBakedTE(const LLViewerTexLayerSet* layerset ) const; - // SUNSHINE CLEANUP - dead? - void setNewBakedTexture(LLAvatarAppearanceDefines::EBakedTextureIndex i, const LLUUID &uuid); - void setNewBakedTexture(LLAvatarAppearanceDefines::ETextureIndex i, const LLUUID& uuid); + // SUNSHINE CLEANUP - dead? or update to just call request appearance update? void forceBakeAllTextures(bool slam_for_debug = false); - static void processRebakeAvatarTextures(LLMessageSystem* msg, void**); protected: /*virtual*/ void removeMissingBakedTextures(); -- cgit v1.2.3 From f20fadeafab79b940da7addecd21de2f0962ced5 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao <bao@lindenlab.com> Date: Tue, 8 Oct 2013 15:23:47 -0600 Subject: fix a texture issue that unpaused callbacks never get fired. --- indra/newview/llviewertexture.cpp | 19 +++++++++++++------ indra/newview/llviewertexture.h | 3 ++- 2 files changed, 15 insertions(+), 7 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 831551a0a7..5330c4da86 100755 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -1046,7 +1046,7 @@ void LLViewerFetchedTexture::init(bool firstinit) mLastReferencedSavedRawImageTime = 0.0f ; mKeptSavedRawImageTime = 0.f ; mLastCallBackActiveTime = 0.f; - + mForceCallbackFetch = FALSE; mInDebug = FALSE; mFTType = FTT_UNKNOWN; @@ -2281,6 +2281,7 @@ void LLViewerFetchedTexture::unpauseLoadedCallbacks(const LLLoadedCallbackEntry: } mPauseLoadedCallBacks = FALSE ; mLastCallBackActiveTime = sCurrentTime ; + mForceCallbackFetch = TRUE; if(need_raw) { mSaveRawImage = TRUE ; @@ -2321,6 +2322,7 @@ void LLViewerFetchedTexture::pauseLoadedCallbacks(const LLLoadedCallbackEntry::s bool LLViewerFetchedTexture::doLoadedCallbacks() { static const F32 MAX_INACTIVE_TIME = 900.f ; //seconds + static const F32 MAX_IDLE_WAIT_TIME = 5.f ; //seconds if (mNeedsCreateTexture) { @@ -2525,6 +2527,9 @@ bool LLViewerFetchedTexture::doLoadedCallbacks() } } + // Done with any raw image data at this point (will be re-created if we still have callbacks) + destroyRawImage(); + // // If we have no callbacks, take us off of the image callback list. // @@ -2532,10 +2537,13 @@ bool LLViewerFetchedTexture::doLoadedCallbacks() { gTextureList.mCallbackList.erase(this); } + else if(!res && mForceCallbackFetch && sCurrentTime - mLastCallBackActiveTime > MAX_IDLE_WAIT_TIME && !mIsFetching) + { + //wait for long enough but no fetching request issued, force one. + forceToRefetchTexture(mLoadedCallbackDesiredDiscardLevel, 5.f); + mForceCallbackFetch = FALSE; //fire once. + } - // Done with any raw image data at this point (will be re-created if we still have callbacks) - destroyRawImage(); - return res; } @@ -2774,9 +2782,8 @@ void LLViewerFetchedTexture::saveRawImage() } //force to refetch the texture to the discard level -void LLViewerFetchedTexture::forceToRefetchTexture(S32 desired_discard) +void LLViewerFetchedTexture::forceToRefetchTexture(S32 desired_discard, F32 kept_time) { - F32 kept_time = 60.0; //seconds if(mForceToSaveRawImage) { desired_discard = llmin(desired_discard, mDesiredSavedRawDiscardLevel); diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index 31430c31e0..7e45fcaf4b 100755 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -388,7 +388,7 @@ public: BOOL isCachedRawImageReady() const {return mCachedRawImageReady ;} BOOL isRawImageValid()const { return mIsRawImageValid ; } void forceToSaveRawImage(S32 desired_discard = 0, F32 kept_time = 0.f) ; - void forceToRefetchTexture(S32 desired_discard = 0); + void forceToRefetchTexture(S32 desired_discard = 0, F32 kept_time = 60.f); /*virtual*/ void setCachedRawImage(S32 discard_level, LLImageRaw* imageraw) ; void destroySavedRawImage() ; LLImageRaw* getSavedRawImage() ; @@ -423,6 +423,7 @@ private: BOOL mFullyLoaded; BOOL mInDebug; BOOL mInFastCacheList; + BOOL mForceCallbackFetch; protected: std::string mLocalFileName; -- cgit v1.2.3 From b486f6a72c94468f4667d364636d56ea545be188 Mon Sep 17 00:00:00 2001 From: Nyx Linden <nyx@lindenlab.com> Date: Fri, 11 Oct 2013 16:52:45 -0400 Subject: SH-4458 SH-3652 FIX Pants flare does not load properly upon an avatar returning Viewer added a new callback when the avatar returned without resetting the timer for last reference to the saved raw image. This created a time window in which new callbacks could get cleared out due to the raw image getting destroyed. Since the callback was removed, pants flare was not properly applied. Appears to be working now. --- indra/newview/llviewertexture.cpp | 1 + indra/newview/llvoavatar.cpp | 3 +++ 2 files changed, 4 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 5330c4da86..5ab628ab2c 100755 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -2169,6 +2169,7 @@ void LLViewerFetchedTexture::setLoadedCallback( loaded_callback_func loaded_call } } mLastCallBackActiveTime = sCurrentTime ; + mLastReferencedSavedRawImageTime = sCurrentTime; } void LLViewerFetchedTexture::clearCallbackEntryList() diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 93247a3625..110f571397 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -6316,6 +6316,8 @@ void LLVOAvatar::updateMeshTextures() // we'll consider it loaded and use it (rather than // doing compositing). useBakedTexture( baked_img->getID() ); + mLoadedCallbacksPaused |= !isVisible(); + checkTextureLoading(); } else { @@ -6331,6 +6333,7 @@ void LLVOAvatar::updateMeshTextures() // this could add paused texture callbacks mLoadedCallbacksPaused |= paused; + checkTextureLoading(); } } else if (layerset && isUsingLocalAppearance()) -- cgit v1.2.3 From 20af6640d4077725034bd7e9d0e8982778cea09a Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Tue, 15 Oct 2013 11:17:20 -0400 Subject: SH-3455 WIP - llstartup cleanup --- indra/newview/llagent.cpp | 4 +-- indra/newview/llagent.h | 11 ++++---- indra/newview/llagentwearables.cpp | 4 --- indra/newview/llappearancemgr.cpp | 2 +- indra/newview/llstartup.cpp | 58 ++++++++++++++++++++++++++------------ 5 files changed, 49 insertions(+), 30 deletions(-) (limited to 'indra/newview') 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. diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index d0a48207b5..f2a42347b7 100755 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -161,12 +161,13 @@ public: // Gender //-------------------------------------------------------------------- public: - // On the very first login, gender isn't chosen until the user clicks - // in a dialog. We don't render the avatar until they choose. - BOOL isGenderChosen() const { return mGenderChosen; } - void setGenderChosen(BOOL b) { mGenderChosen = b; } + // On the very first login, outfit needs to be chosen by some + // mechanism, usually by loading the requested initial outfit. We + // don't render the avatar until the choice is made. + BOOL isOutfitChosen() const { return mOutfitChosen; } + void setOutfitChosen(BOOL b) { mOutfitChosen = b; } private: - BOOL mGenderChosen; + BOOL mOutfitChosen; /** Identity ** ** diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 798b733efb..96ce8d1f6d 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -175,10 +175,6 @@ void LLAgentWearables::setAvatarObject(LLVOAvatarSelf *avatar) { llassert(avatar); setAvatarAppearance(avatar); - gAgentWearables.notifyLoadingStarted(); - callAfterCategoryFetch(LLAppearanceMgr::instance().getCOF(), - boost::bind(&LLAppearanceMgr::updateAppearanceFromCOF, - LLAppearanceMgr::getInstance(), true, true, no_op)); } diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 0bf2527195..43ba66f8c5 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -4004,7 +4004,7 @@ public: LLAppearanceMgr::getInstance()->wearInventoryCategory(category, true, false); // *TODOw: This may not be necessary if initial outfit is chosen already -- josh - gAgent.setGenderChosen(TRUE); + gAgent.setOutfitChosen(TRUE); } // release avatar picker keyboard focus diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 239227b904..09147afb23 100755 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -2020,7 +2020,7 @@ bool idle_startup() { display_startup(); F32 timeout_frac = timeout.getElapsedTimeF32()/PRECACHING_DELAY; - + // We now have an inventory skeleton, so if this is a user's first // login, we can start setting up their clothing and avatar // appearance. This helps to avoid the generic "Ruth" avatar in @@ -2029,20 +2029,42 @@ bool idle_startup() && !sInitialOutfit.empty() // registration set up an outfit && !sInitialOutfitGender.empty() // and a gender && isAgentAvatarValid() // can't wear clothes without object - && !gAgent.isGenderChosen() ) // nothing already loading + && !gAgent.isOutfitChosen()) // nothing already loading { // Start loading the wearables, textures, gestures LLStartUp::loadInitialOutfit( sInitialOutfit, sInitialOutfitGender ); } + // If not first login, we need to fetch COF contents and + // compute appearance from that. + if (isAgentAvatarValid() && !gAgent.isFirstLogin() && !gAgent.isOutfitChosen()) + { + gAgentWearables.notifyLoadingStarted(); + callAfterCategoryFetch(LLAppearanceMgr::instance().getCOF(), + boost::bind(&LLAppearanceMgr::updateAppearanceFromCOF, + LLAppearanceMgr::getInstance(), true, true, no_op)); + LLAppearanceMgr::instance().setAttachmentInvLinkEnable(true); + gAgent.setOutfitChosen(TRUE); + } display_startup(); // wait precache-delay and for agent's avatar or a lot longer. - if(((timeout_frac > 1.f) && isAgentAvatarValid()) - || (timeout_frac > 3.f)) + if ((timeout_frac > 1.f) && isAgentAvatarValid()) { LLStartUp::setStartupState( STATE_WEARABLES_WAIT ); } + else if (timeout_frac > 10.f) + { + // If we exceed the wait above while isAgentAvatarValid is + // not true yet, we will change startup state and + // eventually (once avatar does get created) wind up at + // the gender chooser. This should occur only in very + // unusual circumstances, so set the timeout fairly high + // to minimize mistaken hits here. + llwarns << "Wait for valid avatar state exceeded " + << timeout.getElapsedTimeF32() << " will invoke gender chooser" << llendl; + LLStartUp::setStartupState( STATE_WEARABLES_WAIT ); + } else { update_texture_fetch(); @@ -2062,12 +2084,11 @@ bool idle_startup() const F32 wearables_time = wearables_timer.getElapsedTimeF32(); const F32 MAX_WEARABLES_TIME = 10.f; -#if 0 - if (!gAgent.isGenderChosen() && isAgentAvatarValid()) + if (!gAgent.isOutfitChosen() && isAgentAvatarValid()) { - // No point in waiting for clothing, we don't even - // know what gender we are. Pop a dialog to ask and - // proceed to draw the world. JC + // No point in waiting for clothing, we don't even know + // what outfit we want. Pop up a gender chooser dialog to + // ask and proceed to draw the world. JC // // *NOTE: We might hit this case even if we have an // initial outfit, but if the load hasn't started @@ -2078,13 +2099,12 @@ bool idle_startup() LLStartUp::setStartupState( STATE_CLEANUP ); return TRUE; } -#endif display_startup(); - if (wearables_time > MAX_WEARABLES_TIME) + if (gAgent.isOutfitChosen() && (wearables_time > MAX_WEARABLES_TIME)) { - LLNotificationsUtil::add("ClothingLoading"); + llwarns << "wearables_time " << wearables_time << "exceeded max wait of " << MAX_WEARABLES_TIME << llendl; LLViewerStats::getInstance()->incStat(LLViewerStats::ST_WEARABLES_TOO_LONG); LLStartUp::setStartupState( STATE_CLEANUP ); return TRUE; @@ -2096,7 +2116,7 @@ bool idle_startup() if (isAgentAvatarValid() && gAgentAvatarp->isFullyLoaded()) { - //llinfos << "avatar fully loaded" << llendl; + LL_DEBUGS("Avatar") << "avatar fully loaded" << llendl; LLStartUp::setStartupState( STATE_CLEANUP ); return TRUE; } @@ -2107,7 +2127,7 @@ bool idle_startup() if ( gAgentWearables.areWearablesLoaded() ) { // We have our clothing, proceed. - //llinfos << "wearables loaded" << llendl; + LL_DEBUGS("Avatar") << "wearables loaded" << llendl; LLStartUp::setStartupState( STATE_CLEANUP ); return TRUE; } @@ -2601,9 +2621,7 @@ void LLStartUp::loadInitialOutfit( const std::string& outfit_folder_name, lldebugs << "initial outfit category id: " << cat_id << llendl; } - // This is really misnamed -- it means we have started loading - // an outfit/shape that will give the avatar a gender eventually. JC - gAgent.setGenderChosen(TRUE); + gAgent.setOutfitChosen(TRUE); } //static @@ -3364,7 +3382,11 @@ bool process_login_success_response() flag = login_flags["gendered"].asString(); if(flag == "Y") { - gAgent.setGenderChosen(TRUE); + // We don't care about this flag anymore; now base whether + // outfit is chosen on COF contents, initial outfit + // requested and available, etc. + + //gAgent.setGenderChosen(TRUE); } bool pacific_daylight_time = false; -- cgit v1.2.3 From dba221e0ac89b1505ddd3b896946286d5d1cf3d8 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Thu, 17 Oct 2013 16:12:37 -0400 Subject: SH-4160 WIP, build fix --- indra/newview/llinventoryobserver.cpp | 84 ----------------------------------- indra/newview/llinventoryobserver.h | 38 ---------------- 2 files changed, 122 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llinventoryobserver.cpp b/indra/newview/llinventoryobserver.cpp index 9db175ec2e..6042ab996d 100755 --- a/indra/newview/llinventoryobserver.cpp +++ b/indra/newview/llinventoryobserver.cpp @@ -465,38 +465,6 @@ void LLInventoryFetchComboObserver::startFetch() mFetchDescendents->startFetch(); } -void LLInventoryExistenceObserver::watchItem(const LLUUID& id) -{ - if (id.notNull()) - { - mMIA.push_back(id); - } -} - -void LLInventoryExistenceObserver::changed(U32 mask) -{ - // scan through the incomplete items and move or erase them as - // appropriate. - if (!mMIA.empty()) - { - for (uuid_vec_t::iterator it = mMIA.begin(); it < mMIA.end(); ) - { - LLViewerInventoryItem* item = gInventory.getItem(*it); - if (!item) - { - ++it; - continue; - } - mExist.push_back(*it); - it = mMIA.erase(it); - } - if (mMIA.empty()) - { - done(); - } - } -} - void LLInventoryAddItemByAssetObserver::changed(U32 mask) { if(!(mask & LLInventoryObserver::ADD)) @@ -633,58 +601,6 @@ void LLInventoryCategoryAddedObserver::changed(U32 mask) } } - -LLInventoryTransactionObserver::LLInventoryTransactionObserver(const LLTransactionID& transaction_id) : - mTransactionID(transaction_id) -{ -} - -void LLInventoryTransactionObserver::changed(U32 mask) -{ - if (mask & LLInventoryObserver::ADD) - { - // This could be it - see if we are processing a bulk update - LLMessageSystem* msg = gMessageSystem; - if (msg->getMessageName() - && (0 == strcmp(msg->getMessageName(), "BulkUpdateInventory"))) - { - // we have a match for the message - now check the - // transaction id. - LLUUID id; - msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_TransactionID, id); - if (id == mTransactionID) - { - // woo hoo, we found it - uuid_vec_t folders; - uuid_vec_t items; - S32 count; - count = msg->getNumberOfBlocksFast(_PREHASH_FolderData); - S32 i; - for (i = 0; i < count; ++i) - { - msg->getUUIDFast(_PREHASH_FolderData, _PREHASH_FolderID, id, i); - if (id.notNull()) - { - folders.push_back(id); - } - } - count = msg->getNumberOfBlocksFast(_PREHASH_ItemData); - for (i = 0; i < count; ++i) - { - msg->getUUIDFast(_PREHASH_ItemData, _PREHASH_ItemID, id, i); - if (id.notNull()) - { - items.push_back(id); - } - } - - // call the derived class the implements this method. - done(folders, items); - } - } - } -} - void LLInventoryCategoriesObserver::changed(U32 mask) { if (!mCategoryMap.size()) diff --git a/indra/newview/llinventoryobserver.h b/indra/newview/llinventoryobserver.h index aa1eae84d7..73288242eb 100755 --- a/indra/newview/llinventoryobserver.h +++ b/indra/newview/llinventoryobserver.h @@ -151,25 +151,6 @@ protected: LLInventoryFetchDescendentsObserver *mFetchDescendents; }; -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// Class LLInventoryExistenceObserver -// -// Used as a base class for doing something when all the -// observed item ids exist in the inventory somewhere. -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -class LLInventoryExistenceObserver : public LLInventoryObserver -{ -public: - LLInventoryExistenceObserver() {} - /*virtual*/ void changed(U32 mask); - - void watchItem(const LLUUID& id); -protected: - virtual void done() = 0; - uuid_vec_t mExist; - uuid_vec_t mMIA; -}; - //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLInventoryMovedObserver // @@ -240,25 +221,6 @@ protected: cat_vec_t mAddedCategories; }; -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// Class LLInventoryTransactionObserver -// -// Base class for doing something when an inventory transaction completes. -// NOTE: This class is not quite complete. Avoid using unless you fix up its -// functionality gaps. -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -class LLInventoryTransactionObserver : public LLInventoryObserver -{ -public: - LLInventoryTransactionObserver(const LLTransactionID& transaction_id); - /*virtual*/ void changed(U32 mask); - -protected: - virtual void done(const uuid_vec_t& folders, const uuid_vec_t& items) = 0; - - LLTransactionID mTransactionID; -}; - //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLInventoryCompletionObserver // -- cgit v1.2.3 From d560427a773625297ba351ca248aa73a9adb18ca Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Fri, 25 Oct 2013 14:47:04 -0400 Subject: SH-4571 WIP - send dummy wearables data on login, to help earlier release viewers that still rely on the presence of the message --- indra/newview/llagentwearables.cpp | 34 ++++++++++++++++++++++++++++++++++ indra/newview/llagentwearables.h | 5 +++++ indra/newview/llstartup.cpp | 2 ++ 3 files changed, 41 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 96ce8d1f6d..e4004f108c 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -765,6 +765,40 @@ void LLAgentWearables::createStandardWearables() } } +// We no longer need this message in the current viewer, but send +// it for now to maintain compatibility with release viewers. Can +// remove this function once the SH-3455 changesets are universally deployed. +void LLAgentWearables::sendDummyAgentWearablesUpdate() +{ + LL_DEBUGS("Avatar") << "sendAgentWearablesUpdate()" << llendl; + + // Send the AgentIsNowWearing + gMessageSystem->newMessageFast(_PREHASH_AgentIsNowWearing); + + gMessageSystem->nextBlockFast(_PREHASH_AgentData); + gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + + // Send 4 standardized nonsense item ids (same as returned by the modified sim, not that it especially matters). + gMessageSystem->nextBlockFast(_PREHASH_WearableData); + gMessageSystem->addU8Fast(_PREHASH_WearableType, U8(1)); + gMessageSystem->addUUIDFast(_PREHASH_ItemID, LLUUID("db5a4e5f-9da3-44c8-992d-1181c5795498")); + + gMessageSystem->nextBlockFast(_PREHASH_WearableData); + gMessageSystem->addU8Fast(_PREHASH_WearableType, U8(2)); + gMessageSystem->addUUIDFast(_PREHASH_ItemID, LLUUID("6969c7cc-f72f-4a76-a19b-c293cce8ce4f")); + + gMessageSystem->nextBlockFast(_PREHASH_WearableData); + gMessageSystem->addU8Fast(_PREHASH_WearableType, U8(3)); + gMessageSystem->addUUIDFast(_PREHASH_ItemID, LLUUID("7999702b-b291-48f9-8903-c91dfb828408")); + + gMessageSystem->nextBlockFast(_PREHASH_WearableData); + gMessageSystem->addU8Fast(_PREHASH_WearableType, U8(4)); + gMessageSystem->addUUIDFast(_PREHASH_ItemID, LLUUID("566cb59e-ef60-41d7-bfa6-e0f293fbea40")); + + gAgent.sendReliableMessage(); +} + void LLAgentWearables::makeNewOutfitDone(S32 type, U32 index) { LLUUID first_item_id = getWearableItemID((LLWearableType::EType)type, index); diff --git a/indra/newview/llagentwearables.h b/indra/newview/llagentwearables.h index 8fb2783fff..a93b6d9241 100755 --- a/indra/newview/llagentwearables.h +++ b/indra/newview/llagentwearables.h @@ -164,6 +164,11 @@ public: void saveAllWearables(); void revertWearable(const LLWearableType::EType type, const U32 index); + // We no longer need this message in the current viewer, but send + // it for now to maintain compatibility with release viewers. Can + // remove this function once the SH-3455 changesets are universally deployed. + void sendDummyAgentWearablesUpdate(); + //-------------------------------------------------------------------- // Static UI hooks //-------------------------------------------------------------------- diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 09147afb23..61d0855119 100755 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -2044,6 +2044,7 @@ bool idle_startup() LLAppearanceMgr::getInstance(), true, true, no_op)); LLAppearanceMgr::instance().setAttachmentInvLinkEnable(true); gAgent.setOutfitChosen(TRUE); + gAgentWearables.sendDummyAgentWearablesUpdate(); } display_startup(); @@ -2622,6 +2623,7 @@ void LLStartUp::loadInitialOutfit( const std::string& outfit_folder_name, } gAgent.setOutfitChosen(TRUE); + gAgentWearables.sendDummyAgentWearablesUpdate(); } //static -- cgit v1.2.3 From 854aec1231ff3bd579ae6aec2302c8f9e1d7d958 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao <bao@lindenlab.com> Date: Mon, 28 Oct 2013 11:02:33 -0600 Subject: a try to fix the blurry texture problem. --- indra/newview/llviewertexture.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 1f42590884..f22074a8d6 100755 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -1889,7 +1889,7 @@ bool LLViewerFetchedTexture::updateFetch() if ((decode_priority > 0) && (mRawDiscardLevel < 0 || mRawDiscardLevel == INVALID_DISCARD_LEVEL)) { // We finished but received no data - if (current_discard < 0) + if (getDiscardLevel() < 0) { if (getFTType() != FTT_MAP_TILE) { @@ -1906,8 +1906,17 @@ bool LLViewerFetchedTexture::updateFetch() else { //llwarns << mID << ": Setting min discard to " << current_discard << llendl; - mMinDiscardLevel = current_discard; - desired_discard = current_discard; + if(current_discard >= 0) + { + mMinDiscardLevel = current_discard; + desired_discard = current_discard; + } + else + { + S32 dis_level = getDiscardLevel(); + mMinDiscardLevel = dis_level; + desired_discard = dis_level; + } } destroyRawImage(); } -- cgit v1.2.3 From 2dbf6569a77c37d7c7ecc684dd417ddbbb7c6bab Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Tue, 29 Oct 2013 15:50:22 -0400 Subject: SH-4586 WIP - possible fix for some COF mismatches --- indra/newview/llstartup.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 61d0855119..d440ba246a 100755 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -313,6 +313,12 @@ void update_texture_fetch() gTextureList.updateImages(0.10f); } +void set_flags_and_update_appearance() +{ + LLAppearanceMgr::instance().setAttachmentInvLinkEnable(true); + LLAppearanceMgr::instance().updateAppearanceFromCOF(true, true, no_op); +} + // Returns false to skip other idle processing. Should only return // true when all initialization done. bool idle_startup() @@ -2039,12 +2045,9 @@ bool idle_startup() if (isAgentAvatarValid() && !gAgent.isFirstLogin() && !gAgent.isOutfitChosen()) { gAgentWearables.notifyLoadingStarted(); - callAfterCategoryFetch(LLAppearanceMgr::instance().getCOF(), - boost::bind(&LLAppearanceMgr::updateAppearanceFromCOF, - LLAppearanceMgr::getInstance(), true, true, no_op)); - LLAppearanceMgr::instance().setAttachmentInvLinkEnable(true); gAgent.setOutfitChosen(TRUE); gAgentWearables.sendDummyAgentWearablesUpdate(); + callAfterCategoryFetch(LLAppearanceMgr::instance().getCOF(), set_flags_and_update_appearance); } display_startup(); -- cgit v1.2.3 From 6ed4c84a30e8f4044ccaedba114e13e07ae5c46d Mon Sep 17 00:00:00 2001 From: Nyx Linden <nyx@lindenlab.com> Date: Wed, 30 Oct 2013 15:12:38 -0400 Subject: SH-4548 WIP Changes to avatar physics are propogated to observers There was a broken linkage between the chest driver & driven parameters. Fixed some cross-wearable flags to make sure the params are stored & linked properly. Will test to make sure params get properly transmitted next. --- indra/newview/character/avatar_lad.xml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/character/avatar_lad.xml b/indra/newview/character/avatar_lad.xml index e28bb6969a..594880a831 100755 --- a/indra/newview/character/avatar_lad.xml +++ b/indra/newview/character/avatar_lad.xml @@ -4371,7 +4371,7 @@ group="1" sex="female" name="Breast_Physics_UpDown_Driven" - wearable="shape" + wearable="physics" edit_group="driven" value_default="0" value_min="-3" @@ -4384,7 +4384,7 @@ group="1" sex="female" name="Breast_Physics_InOut_Driven" - wearable="shape" + wearable="physics" edit_group="driven" value_default="0" value_min="-1.25" @@ -4397,7 +4397,6 @@ group="1" name="Belly_Physics_Torso_UpDown_Driven" wearable="physics" - cross_wearable="true" edit_group="driven" value_default="0" value_min="-1" @@ -4410,7 +4409,6 @@ group="1" name="Breast_Physics_LeftRight_Driven" wearable="physics" - cross_wearable="true" edit_group="driven" value_default="0" value_min="-2" -- cgit v1.2.3 From e26268add0d10cb7609afd9070f00d0331b78c4e Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Fri, 1 Nov 2013 11:02:51 -0400 Subject: SH-4595 WIP - reworked descendents of LLInventoryAddedObserver to use gInventory.getAddedIDs(). LLInventoryAddedObserver isn't really needed anymore, but leaving it in as a debugging point at least for now. --- indra/newview/llinventorymodel.cpp | 18 ++++++++++++------ indra/newview/llinventorymodel.h | 5 ++++- indra/newview/llinventoryobserver.cpp | 33 +++------------------------------ indra/newview/llinventoryobserver.h | 4 +--- indra/newview/lllocationinputctrl.cpp | 6 ++---- indra/newview/llpanelplaces.cpp | 7 +++---- indra/newview/llpanelplaces.h | 2 +- indra/newview/llviewermessage.cpp | 20 ++++++++++++++------ 8 files changed, 40 insertions(+), 55 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index be1a396fff..e9bbf3a7cd 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1454,6 +1454,7 @@ void LLInventoryModel::notifyObservers() mModifyMask = LLInventoryObserver::NONE; mChangedItemIDs.clear(); + mAddedItemIDs.clear(); mIsNotifyObservers = FALSE; } @@ -1473,13 +1474,18 @@ void LLInventoryModel::addChangedMask(U32 mask, const LLUUID& referent) if (referent.notNull()) { mChangedItemIDs.insert(referent); - } + + if (mask & LLInventoryObserver::ADD) + { + mAddedItemIDs.insert(referent); + } - // Update all linked items. Starting with just LABEL because I'm - // not sure what else might need to be accounted for this. - if (mModifyMask & LLInventoryObserver::LABEL) - { - addChangedMaskForLinks(referent, LLInventoryObserver::LABEL); + // Update all linked items. Starting with just LABEL because I'm + // not sure what else might need to be accounted for this. + if (mask & LLInventoryObserver::LABEL) + { + addChangedMaskForLinks(referent, LLInventoryObserver::LABEL); + } } } diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index 7afe1dea35..339740870d 100755 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -73,7 +73,6 @@ public: typedef LLDynamicArray<LLPointer<LLViewerInventoryCategory> > cat_array_t; typedef LLDynamicArray<LLPointer<LLViewerInventoryItem> > item_array_t; - typedef std::set<LLUUID> changed_items_t; class fetchInventoryResponder : public LLHTTPClient::Responder { @@ -472,7 +471,9 @@ public: // been changed 'under the hood', but outside the control of the // inventory. The next notify will include that notification. void addChangedMask(U32 mask, const LLUUID& referent); + typedef uuid_set_t changed_items_t; const changed_items_t& getChangedIDs() const { return mChangedItemIDs; } + const changed_items_t& getAddedIDs() const { return mAddedItemIDs; } protected: // Updates all linked items pointing to this id. void addChangedMaskForLinks(const LLUUID& object_id, U32 mask); @@ -483,6 +484,8 @@ private: // Variables used to track what has changed since the last notify. U32 mModifyMask; changed_items_t mChangedItemIDs; + changed_items_t mAddedItemIDs; + //-------------------------------------------------------------------- // Observers diff --git a/indra/newview/llinventoryobserver.cpp b/indra/newview/llinventoryobserver.cpp index 6042ab996d..6181474e5b 100755 --- a/indra/newview/llinventoryobserver.cpp +++ b/indra/newview/llinventoryobserver.cpp @@ -541,34 +541,7 @@ void LLInventoryAddedObserver::changed(U32 mask) return; } - // *HACK: If this was in response to a packet off - // the network, figure out which item was updated. - LLMessageSystem* msg = gMessageSystem; - - std::string msg_name = msg->getMessageName(); - if (msg_name.empty()) - { - return; - } - - // We only want newly created inventory items. JC - if ( msg_name != "UpdateCreateInventoryItem") - { - return; - } - - LLPointer<LLViewerInventoryItem> titem = new LLViewerInventoryItem; - S32 num_blocks = msg->getNumberOfBlocksFast(_PREHASH_InventoryData); - for (S32 i = 0; i < num_blocks; ++i) - { - titem->unpackMessage(msg, _PREHASH_InventoryData, i); - if (!(titem->getUUID().isNull())) - { - //we don't do anything with null keys - mAdded.push_back(titem->getUUID()); - } - } - if (!mAdded.empty()) + if (!gInventory.getAddedIDs().empty()) { done(); } @@ -581,9 +554,9 @@ void LLInventoryCategoryAddedObserver::changed(U32 mask) return; } - const LLInventoryModel::changed_items_t& changed_ids = gInventory.getChangedIDs(); + const LLInventoryModel::changed_items_t& added_ids = gInventory.getAddedIDs(); - for (LLInventoryModel::changed_items_t::const_iterator cit = changed_ids.begin(); cit != changed_ids.end(); ++cit) + for (LLInventoryModel::changed_items_t::const_iterator cit = added_ids.begin(); cit != added_ids.end(); ++cit) { LLViewerInventoryCategory* cat = gInventory.getCategory(*cit); diff --git a/indra/newview/llinventoryobserver.h b/indra/newview/llinventoryobserver.h index 73288242eb..c3cd0d761e 100755 --- a/indra/newview/llinventoryobserver.h +++ b/indra/newview/llinventoryobserver.h @@ -190,13 +190,11 @@ private: class LLInventoryAddedObserver : public LLInventoryObserver { public: - LLInventoryAddedObserver() : mAdded() {} + LLInventoryAddedObserver() {} /*virtual*/ void changed(U32 mask); protected: virtual void done() = 0; - - uuid_vec_t mAdded; }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/indra/newview/lllocationinputctrl.cpp b/indra/newview/lllocationinputctrl.cpp index 5022dba934..0d5ecc4059 100755 --- a/indra/newview/lllocationinputctrl.cpp +++ b/indra/newview/lllocationinputctrl.cpp @@ -107,8 +107,8 @@ public: private: /*virtual*/ void done() { - uuid_vec_t::const_iterator it = mAdded.begin(), end = mAdded.end(); - for(; it != end; ++it) + const uuid_set_t& added = gInventory.getAddedIDs(); + for (uuid_set_t::const_iterator it = added.begin(); it != added.end(); ++it) { LLInventoryItem* item = gInventory.getItem(*it); if (!item || item->getType() != LLAssetType::AT_LANDMARK) @@ -124,8 +124,6 @@ private: mInput->onLandmarkLoaded(lm); } } - - mAdded.clear(); } LLLocationInputCtrl* mInput; diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index 730df2ea23..8cd54204e8 100755 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -168,8 +168,7 @@ public: protected: /*virtual*/ void done() { - mPlaces->showAddedLandmarkInfo(mAdded); - mAdded.clear(); + mPlaces->showAddedLandmarkInfo(gInventory.getAddedIDs()); } private: @@ -1100,9 +1099,9 @@ void LLPanelPlaces::changedGlobalPos(const LLVector3d &global_pos) updateVerbs(); } -void LLPanelPlaces::showAddedLandmarkInfo(const uuid_vec_t& items) +void LLPanelPlaces::showAddedLandmarkInfo(const uuid_set_t& items) { - for (uuid_vec_t::const_iterator item_iter = items.begin(); + for (uuid_set_t::const_iterator item_iter = items.begin(); item_iter != items.end(); ++item_iter) { diff --git a/indra/newview/llpanelplaces.h b/indra/newview/llpanelplaces.h index 85bdc2c4e1..b3bc248bd9 100755 --- a/indra/newview/llpanelplaces.h +++ b/indra/newview/llpanelplaces.h @@ -69,7 +69,7 @@ public: void changedGlobalPos(const LLVector3d &global_pos); // Opens landmark info panel when agent creates or receives landmark. - void showAddedLandmarkInfo(const uuid_vec_t& items); + void showAddedLandmarkInfo(const uuid_set_t& items); void setItem(LLInventoryItem* item); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 167c33f3ff..64cbc82578 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1001,7 +1001,12 @@ class LLOpenTaskOffer : public LLInventoryAddedObserver protected: /*virtual*/ void done() { - for (uuid_vec_t::iterator it = mAdded.begin(); it != mAdded.end();) + uuid_vec_t added; + for(uuid_set_t::const_iterator it = gInventory.getAddedIDs().begin(); it != gInventory.getAddedIDs().end(); ++it) + { + added.push_back(*it); + } + for (uuid_vec_t::iterator it = added.begin(); it != added.end();) { const LLUUID& item_uuid = *it; bool was_moved = false; @@ -1023,13 +1028,12 @@ protected: if (was_moved) { - it = mAdded.erase(it); + it = added.erase(it); } else ++it; } - open_inventory_offer(mAdded, ""); - mAdded.clear(); + open_inventory_offer(added, ""); } }; @@ -1038,8 +1042,12 @@ class LLOpenTaskGroupOffer : public LLInventoryAddedObserver protected: /*virtual*/ void done() { - open_inventory_offer(mAdded, "group_offer"); - mAdded.clear(); + uuid_vec_t added; + for(uuid_set_t::const_iterator it = gInventory.getAddedIDs().begin(); it != gInventory.getAddedIDs().end(); ++it) + { + added.push_back(*it); + } + open_inventory_offer(added, "group_offer"); gInventory.removeObserver(this); delete this; } -- cgit v1.2.3 From 49956093db3ada36c04d01b905883067301a449a Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Fri, 1 Nov 2013 14:37:38 -0400 Subject: SH-4595 WIP - removed UDP hooks from LLInventoryAddItemByAssetObserver --- indra/newview/llinventoryobserver.cpp | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llinventoryobserver.cpp b/indra/newview/llinventoryobserver.cpp index 6181474e5b..b025c0786e 100755 --- a/indra/newview/llinventoryobserver.cpp +++ b/indra/newview/llinventoryobserver.cpp @@ -478,20 +478,12 @@ void LLInventoryAddItemByAssetObserver::changed(U32 mask) return; } - LLMessageSystem* msg = gMessageSystem; - if (!(msg->getMessageName() && (0 == strcmp(msg->getMessageName(), "UpdateCreateInventoryItem")))) + const uuid_set_t& added = gInventory.getAddedIDs(); + for (uuid_set_t::iterator it = added.begin(); it != added.end(); ++it) { - // this is not our message - return; // to prevent a crash. EXT-7921; - } - - LLPointer<LLViewerInventoryItem> item = new LLViewerInventoryItem; - S32 num_blocks = msg->getNumberOfBlocksFast(_PREHASH_InventoryData); - for(S32 i = 0; i < num_blocks; ++i) - { - item->unpackMessage(msg, _PREHASH_InventoryData, i); + LLInventoryItem *item = gInventory.getItem(*it); const LLUUID& asset_uuid = item->getAssetUUID(); - if (item->getUUID().notNull() && asset_uuid.notNull()) + if (item && item->getUUID().notNull() && asset_uuid.notNull()) { if (isAssetWatched(asset_uuid)) { @@ -500,11 +492,11 @@ void LLInventoryAddItemByAssetObserver::changed(U32 mask) } } } - + if (mAddedItems.size() == mWatchedAssets.size()) { - done(); LL_DEBUGS("Inventory_Move") << "All watched items are added & processed." << LL_ENDL; + done(); mAddedItems.clear(); // Unable to clean watched items here due to somebody can require to check them in current frame. -- cgit v1.2.3 From 6ea320198afcd3080fd7fcdfcb5829b5e8ef2c31 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Mon, 4 Nov 2013 15:55:04 -0500 Subject: SH-4595 WIP - use new LLInventoryObserver::CREATE flag to distinguish newly created items from existing ones being added to inventory. --- indra/newview/llinventorymodel.cpp | 6 +++--- indra/newview/llinventorymodel.h | 2 +- indra/newview/llinventoryobserver.cpp | 4 ++-- indra/newview/llinventoryobserver.h | 1 + 4 files changed, 7 insertions(+), 6 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index e9bbf3a7cd..1ad70492ca 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -774,9 +774,8 @@ bool LLInventoryModel::isInventoryUsable() const // Calling this method with an inventory item will either change an // existing item with a matching item_id, or will add the item to the // current inventory. -U32 LLInventoryModel::updateItem(const LLViewerInventoryItem* item) +U32 LLInventoryModel::updateItem(const LLViewerInventoryItem* item, U32 mask) { - U32 mask = LLInventoryObserver::NONE; if(item->getUUID().isNull()) { return mask; @@ -2652,10 +2651,11 @@ bool LLInventoryModel::messageUpdateCore(LLMessageSystem* msg, bool account) } U32 changes = 0x0; + U32 mask = account ? LLInventoryObserver::CREATE : 0x0; //as above, this loop never seems to loop more than once per call for (item_array_t::iterator it = items.begin(); it != items.end(); ++it) { - changes |= gInventory.updateItem(*it); + changes |= gInventory.updateItem(*it, mask); } gInventory.notifyObservers(); gViewerWindow->getWindow()->decBusyCount(); diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index 339740870d..779319fa67 100755 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -298,7 +298,7 @@ public: // NOTE: In usage, you will want to perform cache accounting // operations in LLInventoryModel::accountForUpdate() or // LLViewerInventoryItem::updateServer() before calling this method. - U32 updateItem(const LLViewerInventoryItem* item); + U32 updateItem(const LLViewerInventoryItem* item, U32 mask = 0); // Change an existing item with the matching id or add // the category. No notifcation will be sent to observers. This diff --git a/indra/newview/llinventoryobserver.cpp b/indra/newview/llinventoryobserver.cpp index b025c0786e..011686bfdd 100755 --- a/indra/newview/llinventoryobserver.cpp +++ b/indra/newview/llinventoryobserver.cpp @@ -467,7 +467,7 @@ void LLInventoryFetchComboObserver::startFetch() void LLInventoryAddItemByAssetObserver::changed(U32 mask) { - if(!(mask & LLInventoryObserver::ADD)) + if(!(mask & LLInventoryObserver::ADD) || !(mask & LLInventoryObserver::CREATE)) { return; } @@ -528,7 +528,7 @@ bool LLInventoryAddItemByAssetObserver::isAssetWatched( const LLUUID& asset_id ) void LLInventoryAddedObserver::changed(U32 mask) { - if (!(mask & LLInventoryObserver::ADD)) + if (!(mask & LLInventoryObserver::ADD) || !(mask & LLInventoryObserver::CREATE)) { return; } diff --git a/indra/newview/llinventoryobserver.h b/indra/newview/llinventoryobserver.h index c3cd0d761e..dd30513844 100755 --- a/indra/newview/llinventoryobserver.h +++ b/indra/newview/llinventoryobserver.h @@ -58,6 +58,7 @@ public: GESTURE = 64, REBUILD = 128, // Item UI changed (e.g. item type different) SORT = 256, // Folder needs to be resorted. + CREATE = 512, // With ADD, item has just been created. ALL = 0xffffffff }; LLInventoryObserver(); -- cgit v1.2.3 From 19cebb8a2998026766171c08849f0018b846742f Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Wed, 6 Nov 2013 17:21:11 -0500 Subject: SH-4595 WIP --- indra/newview/lllocationinputctrl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/lllocationinputctrl.cpp b/indra/newview/lllocationinputctrl.cpp index 0d5ecc4059..7b97b26a37 100755 --- a/indra/newview/lllocationinputctrl.cpp +++ b/indra/newview/lllocationinputctrl.cpp @@ -140,7 +140,7 @@ public: private: /*virtual*/ void changed(U32 mask) { - if (mask & (~(LLInventoryObserver::LABEL|LLInventoryObserver::INTERNAL|LLInventoryObserver::ADD))) + if (mask & (~(LLInventoryObserver::LABEL|LLInventoryObserver::INTERNAL|LLInventoryObserver::ADD|LLInventoryObserver::CREATE))) { mInput->updateAddLandmarkButton(); } -- cgit v1.2.3 From 2b8dc4d80c973770256d0d765f5d8f4f51cf9d57 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao <bao@lindenlab.com> Date: Thu, 7 Nov 2013 10:18:50 -0700 Subject: fix for SH-3959: Make sure baked textures cache and load from cache correctly. --- indra/newview/lltexturefetch.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 70e2c0f2dc..7d17aacfe7 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -1205,9 +1205,7 @@ bool LLTextureFetchWorker::doWork(S32 param) offset, size, responder); mCacheReadTimer.reset(); } -/* SH-3980 - disabling caching of server bakes until we can fix the blurring problems */ -/* else if ((mUrl.empty()||mFTType==FTT_SERVER_BAKE) && mFetcher->canLoadFromCache()) */ - else if (mUrl.empty() && mFetcher->canLoadFromCache()) + else if ((mUrl.empty() || mFTType==FTT_SERVER_BAKE) && mFetcher->canLoadFromCache()) { setPriority(LLWorkerThread::PRIORITY_LOW | mWorkPriority); // Set priority first since Responder may change it @@ -1343,12 +1341,11 @@ bool LLTextureFetchWorker::doWork(S32 param) mCanUseHTTP = false; } } -#if 0 /* SH-3980 - disabling caching of server bakes until we can fix the blurring problems */ - if (mFTType == FTT_SERVER_BAKE) + else if (mFTType == FTT_SERVER_BAKE) { mWriteToCacheState = CAN_WRITE; } -#endif + if (mCanUseHTTP && !mUrl.empty()) { setState(WAIT_HTTP_RESOURCE); -- cgit v1.2.3 From 5fc3066bdb3921203dfdb085b2690fd2d79cf350 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao <bao@lindenlab.com> Date: Thu, 7 Nov 2013 15:36:45 -0700 Subject: add some debug code for possible gray baked avatar textures --- indra/newview/llviewertexture.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index f22074a8d6..fdbf2b015d 100755 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -2345,6 +2345,15 @@ bool LLViewerFetchedTexture::doLoadedCallbacks() } if(sCurrentTime - mLastCallBackActiveTime > MAX_INACTIVE_TIME && !mIsFetching) { + if (mFTType == FTT_SERVER_BAKE) + { + //output some debug info + llinfos << "baked texture: " << mID << "clears all call backs due to inactivity." << llendl; + llinfos << mUrl << llendl; + llinfos << "current discard: " << getDiscardLevel() << " current discard for fetch: " << getCurrentDiscardLevelForFetching() << + " Desired discard: " << getDesiredDiscardLevel() << "decode Pri: " << getDecodePriority() << llendl; + } + clearCallbackEntryList() ; //remove all callbacks. return false ; } @@ -2353,6 +2362,13 @@ bool LLViewerFetchedTexture::doLoadedCallbacks() if (isMissingAsset()) { + if (mFTType == FTT_SERVER_BAKE) + { + //output some debug info + llinfos << "baked texture: " << mID << "is missing." << llendl; + llinfos << mUrl << llendl; + } + for(callback_list_t::iterator iter = mLoadedCallbackList.begin(); iter != mLoadedCallbackList.end(); ) { -- cgit v1.2.3 From 9fe7ec50e0cf4d743b05e335ee27d6fb7fbe37b7 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Tue, 12 Nov 2013 12:49:51 -0500 Subject: SH-4030 FIX --- indra/newview/lltexturefetch.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) mode change 100644 => 100755 indra/newview/lltexturefetch.cpp (limited to 'indra/newview') diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp old mode 100644 new mode 100755 index 7d17aacfe7..4b9db53bc8 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -2582,7 +2582,18 @@ bool LLTextureFetch::createRequest(FTType f_type, const std::string& url, const S32 desired_size; std::string exten = gDirUtilp->getExtension(url); - if (!url.empty() && (!exten.empty() && LLImageBase::getCodecFromExtension(exten) != IMG_CODEC_J2C)) + if (f_type == FTT_SERVER_BAKE) + { + // SH-4030: This case should be redundant with the following one, just + // breaking it out here to clarify that it's intended behavior. + llassert(!url.empty() && (!exten.empty() && LLImageBase::getCodecFromExtension(exten) != IMG_CODEC_J2C)); + + // Do full requests for baked textures to reduce interim blurring. + LL_DEBUGS("Texture") << "full request for " << id << " texture is FTT_SERVER_BAKE" << llendl; + desired_size = MAX_IMAGE_DATA_SIZE; + desired_discard = 0; + } + else if (!url.empty() && (!exten.empty() && LLImageBase::getCodecFromExtension(exten) != IMG_CODEC_J2C)) { LL_DEBUGS("Texture") << "full request for " << id << " exten is not J2C: " << exten << llendl; // Only do partial requests for J2C at the moment -- cgit v1.2.3 From c1f60e7f2fe1775d8ca5f79af23579ac8a1fd851 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Fri, 15 Nov 2013 13:33:31 -0500 Subject: SH-4621 WIP --- indra/newview/llfriendcard.cpp | 3 ++- indra/newview/llinventorymodel.cpp | 28 +++++++++++++++++++++++++--- indra/newview/llinventorymodel.h | 2 ++ indra/newview/llstartup.cpp | 9 +++++++++ 4 files changed, 38 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfriendcard.cpp b/indra/newview/llfriendcard.cpp index a6be604222..01f70d4b57 100755 --- a/indra/newview/llfriendcard.cpp +++ b/indra/newview/llfriendcard.cpp @@ -38,6 +38,7 @@ #include "llcallingcard.h" // for LLAvatarTracker #include "llviewerinventory.h" #include "llinventorymodel.h" +#include "llcallbacklist.h" // Constants; @@ -154,7 +155,7 @@ void LLInitialFriendCardsFetch::done() // This observer is no longer needed. gInventory.removeObserver(this); - mCheckFolderCallback(); + doOnIdleOneTime(mCheckFolderCallback); delete this; } diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 1ad70492ca..3dbc1ae288 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1467,6 +1467,19 @@ void LLInventoryModel::addChangedMask(U32 mask, const LLUUID& referent) // (which is in the process of processing the list of items marked for change). // This means the change may fail to be processed. llwarns << "Adding changed mask within notify observers! Change will likely be lost." << llendl; + LLViewerInventoryItem *item = getItem(referent); + if (item) + { + llwarns << "Item " << item->getName() << llendl; + } + else + { + LLViewerInventoryCategory *cat = getCategory(referent); + if (cat) + { + llwarns << "Category " << cat->getName() << llendl; + } + } } mModifyMask |= mask; @@ -2344,9 +2357,10 @@ void LLInventoryModel::buildParentChildMap() // The inv tree is built. mIsAgentInvUsable = true; - llinfos << "Inventory initialized, notifying observers" << llendl; - addChangedMask(LLInventoryObserver::ALL, LLUUID::null); - notifyObservers(); + // notifyObservers() has been moved to + // llstartup/idle_startup() after this func completes. + // Allows some system categories to be created before + // observers start firing. } } @@ -2356,6 +2370,14 @@ void LLInventoryModel::buildParentChildMap() } } +void LLInventoryModel::createCommonSystemCategories() +{ + gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH,true); + gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE,true); + gInventory.findCategoryUUIDForType(LLFolderType::FT_CALLINGCARD,true); + gInventory.findCategoryUUIDForType(LLFolderType::FT_MY_OUTFITS,true); +} + struct LLUUIDAndName { LLUUIDAndName() {} diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index 779319fa67..ab8bbac6d8 100755 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -134,6 +134,8 @@ public: // during authentication. Returns true if everything parsed. bool loadSkeleton(const LLSD& options, const LLUUID& owner_id); void buildParentChildMap(); // brute force method to rebuild the entire parent-child relations + void createCommonSystemCategories(); + // Call on logout to save a terse representation. void cache(const LLUUID& parent_folder_id, const LLUUID& agent_id); private: diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index d440ba246a..9f0abd858e 100755 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -1779,6 +1779,15 @@ bool idle_startup() // This method MUST be called before gInventory.findCategoryUUIDForType because of // gInventory.mIsAgentInvUsable is set to true in the gInventory.buildParentChildMap. gInventory.buildParentChildMap(); + gInventory.createCommonSystemCategories(); + + // It's debatable whether this flag is a good idea - sets all + // bits, and in general it isn't true that inventory + // initialization generates all types of changes. Maybe add an + // INITIALIZE mask bit instead? + gInventory.addChangedMask(LLInventoryObserver::ALL, LLUUID::null); + gInventory.notifyObservers(); + display_startup(); //all categories loaded. lets create "My Favorites" category -- cgit v1.2.3 From 8179175e6e6078fab9dc16cf02b5ee744955cd7d Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Mon, 18 Nov 2013 13:19:43 -0500 Subject: SH-4578 WIP - cleaner folder version accounting --- indra/newview/llappearancemgr.cpp | 7 +++++++ indra/newview/llinventorymodel.cpp | 30 +++--------------------------- indra/newview/llviewerinventory.cpp | 13 +++++++++++++ indra/newview/llviewerinventory.h | 2 ++ 4 files changed, 25 insertions(+), 27 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 43ba66f8c5..f6c9bf6953 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -2124,6 +2124,13 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool enforce_item_restrictions, dumpItemArray(wear_items,"asset_dump: wear_item"); dumpItemArray(obj_items,"asset_dump: obj_item"); + LLViewerInventoryCategory *cof = gInventory.getCategory(current_outfit_id); + if (!gInventory.isCategoryComplete(current_outfit_id)) + { + llwarns << "COF info is not complete. Version " << cof->getVersion() + << " descendent_count " << cof->getDescendentCount() + << " viewer desc count " << cof->getViewerDescendentCount() << llendl; + } if(!wear_items.count()) { LLNotificationsUtil::add("CouldNotPutOnOutfit"); diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 3dbc1ae288..52b6e4bf3b 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -105,17 +105,7 @@ bool LLCanCache::operator()(LLInventoryCategory* cat, LLInventoryItem* item) if(c->getVersion() != LLViewerInventoryCategory::VERSION_UNKNOWN) { S32 descendents_server = c->getDescendentCount(); - LLInventoryModel::cat_array_t* cats; - LLInventoryModel::item_array_t* items; - mModel->getDirectDescendentsOf( - c->getUUID(), - cats, - items); - S32 descendents_actual = 0; - if(cats && items) - { - descendents_actual = cats->count() + items->count(); - } + S32 descendents_actual = c->getViewerDescendentCount(); if(descendents_server == descendents_actual) { mCachedCatIDs.insert(c->getUUID()); @@ -1717,14 +1707,7 @@ void LLInventoryModel::accountForUpdate(const LLCategoryUpdate& update) const if(version != LLViewerInventoryCategory::VERSION_UNKNOWN) { S32 descendents_server = cat->getDescendentCount(); - LLInventoryModel::cat_array_t* cats; - LLInventoryModel::item_array_t* items; - getDirectDescendentsOf(update.mCategoryID, cats, items); - S32 descendents_actual = 0; - if(cats && items) - { - descendents_actual = cats->count() + items->count(); - } + S32 descendents_actual = cat->getViewerDescendentCount(); if(descendents_server == descendents_actual) { descendents_actual += update.mDescendentDelta; @@ -1821,14 +1804,7 @@ bool LLInventoryModel::isCategoryComplete(const LLUUID& cat_id) const if(cat && (cat->getVersion()!=LLViewerInventoryCategory::VERSION_UNKNOWN)) { S32 descendents_server = cat->getDescendentCount(); - LLInventoryModel::cat_array_t* cats; - LLInventoryModel::item_array_t* items; - getDirectDescendentsOf(cat_id, cats, items); - S32 descendents_actual = 0; - if(cats && items) - { - descendents_actual = cats->count() + items->count(); - } + S32 descendents_actual = cat->getViewerDescendentCount(); if(descendents_server == descendents_actual) { return true; diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index b6a5534815..2d9fb7d773 100755 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -701,6 +701,19 @@ bool LLViewerInventoryCategory::fetch() return false; } +S32 LLViewerInventoryCategory::getViewerDescendentCount() const +{ + LLInventoryModel::cat_array_t* cats; + LLInventoryModel::item_array_t* items; + gInventory.getDirectDescendentsOf(getUUID(), cats, items); + S32 descendents_actual = 0; + if(cats && items) + { + descendents_actual = cats->count() + items->count(); + } + return descendents_actual; +} + bool LLViewerInventoryCategory::importFileLocal(LLFILE* fp) { // *NOTE: This buffer size is hard coded into scanf() below. diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h index c82c2b6fbe..2e662d1730 100755 --- a/indra/newview/llviewerinventory.h +++ b/indra/newview/llviewerinventory.h @@ -217,6 +217,8 @@ public: enum { DESCENDENT_COUNT_UNKNOWN = -1 }; S32 getDescendentCount() const { return mDescendentCount; } void setDescendentCount(S32 descendents) { mDescendentCount = descendents; } + // How many descendents do we currently have information for in the InventoryModel? + S32 getViewerDescendentCount() const; // file handling on the viewer. These are not meant for anything // other than caching. -- cgit v1.2.3 From d26ea73ce8e6c76517e836316150ca76f5f925d9 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Mon, 18 Nov 2013 16:03:30 -0500 Subject: SH-4625 FIX - changed a warning that didn't really indicate a problem to an info statement --- indra/newview/llinventorymodel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 52b6e4bf3b..6b1bf69b5e 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -3704,7 +3704,7 @@ bool LLInventoryModel::validate() const if (cat_lock > 0 || item_lock > 0) { - llwarns << "Found locks on some categories: sub-cat arrays " + llinfos << "Found locks on some categories: sub-cat arrays " << cat_lock << ", item arrays " << item_lock << llendl; } if (desc_unknown_count != 0) -- cgit v1.2.3 From 0384d579726e61b4239880df9fddb502afe65f5a Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Wed, 20 Nov 2013 16:21:34 -0500 Subject: SH-4611 WIP --- indra/newview/lltexturefetch.cpp | 78 +++++++++++++++++++++------------------- indra/newview/lltexturefetch.h | 7 ++-- 2 files changed, 45 insertions(+), 40 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 4b9db53bc8..a86cf1fd4b 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -1326,6 +1326,10 @@ bool LLTextureFetchWorker::doWork(S32 param) std::string http_url = region->getHttpUrl() ; if (!http_url.empty()) { + if (mFTType != FTT_DEFAULT) + { + llwarns << "trying to seek a non-default texture on the sim. Bad!" << llendl; + } setUrl(http_url + "/?texture_id=" + mID.asString().c_str()); mWriteToCacheState = CAN_WRITE ; //because this texture has a fixed texture id. } @@ -1814,7 +1818,7 @@ bool LLTextureFetchWorker::doWork(S32 param) if (mCachedSize > 0 && !mInLocalCache && mRetryAttempt == 0) { // Cache file should be deleted, try again -// llwarns << mID << ": Decode of cached file failed (removed), retrying" << llendl; + llwarns << mID << ": Decode of cached file failed (removed), retrying" << llendl; llassert_always(mDecodeHandle == 0); mFormattedImage = NULL; ++mRetryAttempt; @@ -2565,7 +2569,7 @@ bool LLTextureFetch::createRequest(FTType f_type, const std::string& url, const if (f_type == FTT_SERVER_BAKE) { - LL_DEBUGS("Avatar") << " requesting " << id << " " << w << "x" << h << " discard " << desired_discard << llendl; + LL_DEBUGS("Avatar") << " requesting " << id << " " << w << "x" << h << " discard " << desired_discard << " type " << f_type << llendl; } LLTextureFetchWorker* worker = getWorker(id) ; if (worker) @@ -4105,7 +4109,7 @@ LLTextureFetchDebugger::~LLTextureFetchDebugger() void LLTextureFetchDebugger::init() { - mState = IDLE; + setDebuggerState(IDLE); mCacheReadTime = -1.f; mCacheWriteTime = -1.f; @@ -4203,7 +4207,7 @@ void LLTextureFetchDebugger::startDebug() //clear the current fetching queue gTextureList.clearFetchingRequests(); - mState = START_DEBUG; + setDebuggerState(START_DEBUG); } bool LLTextureFetchDebugger::processStartDebug(F32 max_time) @@ -4278,7 +4282,7 @@ void LLTextureFetchDebugger::tryToStopDebug() //clear the current debug work S32 size = mFetchingHistory.size(); - switch(mState) + switch(mDebuggerState) { case READ_CACHE: for(S32 i = 0 ; i < size; i++) @@ -4351,7 +4355,7 @@ void LLTextureFetchDebugger::addHistoryEntry(LLTextureFetchWorker* worker) if(mFreezeHistory) { - if(mState == REFETCH_VIS_CACHE || mState == REFETCH_VIS_HTTP) + if(mDebuggerState == REFETCH_VIS_CACHE || mDebuggerState == REFETCH_VIS_HTTP) { mRefetchedVisPixels += worker->mRawImage->getWidth() * worker->mRawImage->getHeight(); mRefetchedVisData += worker->mFormattedImage->getDataSize(); @@ -4396,9 +4400,9 @@ void LLTextureFetchDebugger::unlockCache() void LLTextureFetchDebugger::debugCacheRead() { lockCache(); - llassert_always(mState == IDLE); + llassert_always(mDebuggerState == IDLE); mTimer.reset(); - mState = READ_CACHE; + setDebuggerState(READ_CACHE); mCacheReadTime = -1.f; S32 size = mFetchingHistory.size(); @@ -4432,9 +4436,9 @@ void LLTextureFetchDebugger::debugCacheWrite() clearCache(); lockCache(); - llassert_always(mState == IDLE); + llassert_always(mDebuggerState == IDLE); mTimer.reset(); - mState = WRITE_CACHE; + setDebuggerState(WRITE_CACHE); mCacheWriteTime = -1.f; S32 size = mFetchingHistory.size(); @@ -4461,9 +4465,9 @@ void LLTextureFetchDebugger::unlockDecoder() void LLTextureFetchDebugger::debugDecoder() { lockDecoder(); - llassert_always(mState == IDLE); + llassert_always(mDebuggerState == IDLE); mTimer.reset(); - mState = DECODING; + setDebuggerState(DECODING); mDecodingTime = -1.f; S32 size = mFetchingHistory.size(); @@ -4482,7 +4486,7 @@ void LLTextureFetchDebugger::debugDecoder() void LLTextureFetchDebugger::debugHTTP() { - llassert_always(mState == IDLE); + llassert_always(mDebuggerState == IDLE); LLViewerRegion* region = gAgent.getRegion(); if (!region) @@ -4499,7 +4503,7 @@ void LLTextureFetchDebugger::debugHTTP() } mTimer.reset(); - mState = HTTP_FETCHING; + setDebuggerState(HTTP_FETCHING); mHTTPTime = -1.f; S32 size = mFetchingHistory.size(); @@ -4579,8 +4583,8 @@ S32 LLTextureFetchDebugger::fillCurlQueue() void LLTextureFetchDebugger::debugGLTextureCreation() { - llassert_always(mState == IDLE); - mState = GL_TEX; + llassert_always(mDebuggerState == IDLE); + setDebuggerState(GL_TEX); mTempTexList.clear(); S32 size = mFetchingHistory.size(); @@ -4701,8 +4705,8 @@ void LLTextureFetchDebugger::scanRefetchList() void LLTextureFetchDebugger::debugRefetchVisibleFromCache() { - llassert_always(mState == IDLE); - mState = REFETCH_VIS_CACHE; + llassert_always(mDebuggerState == IDLE); + setDebuggerState(REFETCH_VIS_CACHE); clearTextures(); mFetcher->setLoadSource(LLTextureFetch::FROM_ALL); @@ -4716,8 +4720,8 @@ void LLTextureFetchDebugger::debugRefetchVisibleFromCache() void LLTextureFetchDebugger::debugRefetchVisibleFromHTTP() { - llassert_always(mState == IDLE); - mState = REFETCH_VIS_HTTP; + llassert_always(mDebuggerState == IDLE); + setDebuggerState(REFETCH_VIS_HTTP); clearTextures(); mFetcher->setLoadSource(LLTextureFetch::FROM_HTTP_ONLY); @@ -4731,8 +4735,8 @@ void LLTextureFetchDebugger::debugRefetchVisibleFromHTTP() void LLTextureFetchDebugger::debugRefetchAllFromCache() { - llassert_always(mState == IDLE); - mState = REFETCH_ALL_CACHE; + llassert_always(mDebuggerState == IDLE); + setDebuggerState(REFETCH_ALL_CACHE); clearTextures(); makeRefetchList(); @@ -4748,8 +4752,8 @@ void LLTextureFetchDebugger::debugRefetchAllFromCache() void LLTextureFetchDebugger::debugRefetchAllFromHTTP() { - llassert_always(mState == IDLE); - mState = REFETCH_ALL_HTTP; + llassert_always(mDebuggerState == IDLE); + setDebuggerState(REFETCH_ALL_HTTP); clearTextures(); makeRefetchList(); @@ -4765,19 +4769,19 @@ void LLTextureFetchDebugger::debugRefetchAllFromHTTP() bool LLTextureFetchDebugger::update(F32 max_time) { - switch(mState) + switch(mDebuggerState) { case START_DEBUG: if(processStartDebug(max_time)) { - mState = IDLE; + setDebuggerState(IDLE); } break; case READ_CACHE: if(!mTextureCache->update(1)) { mCacheReadTime = mTimer.getElapsedTimeF32() ; - mState = IDLE; + setDebuggerState(IDLE); unlockCache(); } break; @@ -4785,7 +4789,7 @@ bool LLTextureFetchDebugger::update(F32 max_time) if(!mTextureCache->update(1)) { mCacheWriteTime = mTimer.getElapsedTimeF32() ; - mState = IDLE; + setDebuggerState(IDLE); unlockCache(); } break; @@ -4793,7 +4797,7 @@ bool LLTextureFetchDebugger::update(F32 max_time) if(!mImageDecodeThread->update(1)) { mDecodingTime = mTimer.getElapsedTimeF32() ; - mState = IDLE; + setDebuggerState(IDLE); unlockDecoder(); } break; @@ -4803,13 +4807,13 @@ bool LLTextureFetchDebugger::update(F32 max_time) if (!fillCurlQueue() && mNbCurlCompleted == mFetchingHistory.size()) { mHTTPTime = mTimer.getElapsedTimeF32() ; - mState = IDLE; + setDebuggerState(IDLE); } break; case GL_TEX: if(processGLCreation(max_time)) { - mState = IDLE; + setDebuggerState(IDLE); mTempTexList.clear(); } break; @@ -4817,7 +4821,7 @@ bool LLTextureFetchDebugger::update(F32 max_time) if (LLAppViewer::getTextureFetch()->getNumRequests() == 0) { mRefetchVisCacheTime = mTimer.getElapsedTimeF32() ; - mState = IDLE; + setDebuggerState(IDLE); mFetcher->lockFetcher(true); mFetcher->resetLoadSource(); } @@ -4826,7 +4830,7 @@ bool LLTextureFetchDebugger::update(F32 max_time) if (LLAppViewer::getTextureFetch()->getNumRequests() == 0) { mRefetchVisHTTPTime = mTimer.getElapsedTimeF32() ; - mState = IDLE; + setDebuggerState(IDLE); mFetcher->lockFetcher(true); mFetcher->resetLoadSource(); } @@ -4843,7 +4847,7 @@ bool LLTextureFetchDebugger::update(F32 max_time) } mRefetchAllCacheTime = mTimer.getElapsedTimeF32() ; - mState = IDLE; + setDebuggerState(IDLE); mFetcher->lockFetcher(true); mFetcher->resetLoadSource(); mRefetchList.clear(); @@ -4855,7 +4859,7 @@ bool LLTextureFetchDebugger::update(F32 max_time) if (LLAppViewer::getTextureFetch()->getNumRequests() == 0) { mRefetchAllHTTPTime = mTimer.getElapsedTimeF32() ; - mState = IDLE; + setDebuggerState(IDLE); mFetcher->lockFetcher(true); mFetcher->resetLoadSource(); mRefetchList.clear(); @@ -4863,11 +4867,11 @@ bool LLTextureFetchDebugger::update(F32 max_time) } break; default: - mState = IDLE; + setDebuggerState(IDLE); break; } - return mState == IDLE; + return mDebuggerState == IDLE; } void LLTextureFetchDebugger::onCompleted(LLCore::HttpHandle handle, LLCore::HttpResponse * response) diff --git a/indra/newview/lltexturefetch.h b/indra/newview/lltexturefetch.h index 237912cde7..5c23f3bbc0 100755 --- a/indra/newview/lltexturefetch.h +++ b/indra/newview/lltexturefetch.h @@ -479,8 +479,9 @@ private: typedef std::map<LLCore::HttpHandle, S32> handle_fetch_map_t; handle_fetch_map_t mHandleToFetchIndex; - - e_debug_state mState; + + void setDebuggerState(e_debug_state new_state) { mDebuggerState = new_state; } + e_debug_state mDebuggerState; F32 mCacheReadTime; F32 mCacheWriteTime; @@ -553,7 +554,7 @@ public: void callbackDecoded(S32 id, bool success, LLImageRaw* raw, LLImageRaw* aux); void callbackHTTP(FetchEntry & fetch, LLCore::HttpResponse * response); - e_debug_state getState() {return mState;} + e_debug_state getState() {return mDebuggerState;} S32 getNumFetchedTextures() {return mNumFetchedTextures;} S32 getNumFetchingRequests() {return mFetchingHistory.size();} S32 getNumCacheHits() {return mNumCacheHits;} -- cgit v1.2.3 From 8f4c4db90fdafc86efb64318e611d00aae662ab1 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Sat, 23 Nov 2013 09:37:09 -0500 Subject: SH-4611 FIX - use an observer to scroll after category rename completes --- indra/newview/llinventorybridge.cpp | 37 +++++++++++++++++++++++++++++++++++ indra/newview/llinventoryobserver.cpp | 21 ++++++++++++++++++++ indra/newview/llinventoryobserver.h | 18 +++++++++++++++++ 3 files changed, 76 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 3877f9f040..74837bac37 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2984,8 +2984,45 @@ std::string LLFolderBridge::getLabelSuffix() const : LLStringUtil::null; } +class ScrollOnRenameObserver: public LLInventoryObserver +{ +public: + LLFolderView *mView; + LLUUID mUUID; + + ScrollOnRenameObserver(const LLUUID& uuid, LLFolderView *view): + mUUID(uuid), + mView(view) + { + } + void changed(U32 mask) + { + if (mask & LLInventoryObserver::LABEL) + { + // TODO - check for whether this is the item we're waiting for a rename of + const uuid_set_t& changed_item_ids = gInventory.getChangedIDs(); + for (uuid_set_t::const_iterator it = changed_item_ids.begin(); it != changed_item_ids.end(); ++it) + { + const LLUUID& id = *it; + if (id == mUUID) + { + mView->scrollToShowSelection(); + + gInventory.removeObserver(this); + delete this; + return; + } + } + } + } +}; + BOOL LLFolderBridge::renameItem(const std::string& new_name) { + + LLScrollOnRenameObserver *observer = new LLScrollOnRenameObserver(mUUID, mRoot); + gInventory.addObserver(observer); + rename_category(getInventoryModel(), mUUID, new_name); // return FALSE because we either notified observers (& therefore diff --git a/indra/newview/llinventoryobserver.cpp b/indra/newview/llinventoryobserver.cpp index 011686bfdd..ae59b44184 100755 --- a/indra/newview/llinventoryobserver.cpp +++ b/indra/newview/llinventoryobserver.cpp @@ -701,3 +701,24 @@ LLInventoryCategoriesObserver::LLCategoryData::LLCategoryData( { mItemNameHash.finalize(); } + +void LLScrollOnRenameObserver::changed(U32 mask) +{ + if (mask & LLInventoryObserver::LABEL) + { + // TODO - check for whether this is the item we're waiting for a rename of + const uuid_set_t& changed_item_ids = gInventory.getChangedIDs(); + for (uuid_set_t::const_iterator it = changed_item_ids.begin(); it != changed_item_ids.end(); ++it) + { + const LLUUID& id = *it; + if (id == mUUID) + { + mView->scrollToShowSelection(); + + gInventory.removeObserver(this); + delete this; + return; + } + } + } +} diff --git a/indra/newview/llinventoryobserver.h b/indra/newview/llinventoryobserver.h index dd30513844..2436930ef6 100755 --- a/indra/newview/llinventoryobserver.h +++ b/indra/newview/llinventoryobserver.h @@ -287,4 +287,22 @@ protected: category_map_t mCategoryMap; }; +class LLFolderView; + +// Force a FolderView to scroll after an item in the corresponding view has been renamed. +class LLScrollOnRenameObserver: public LLInventoryObserver +{ +public: + LLFolderView *mView; + LLUUID mUUID; + + LLScrollOnRenameObserver(const LLUUID& uuid, LLFolderView *view): + mUUID(uuid), + mView(view) + { + } + /* virtual */ void changed(U32 mask); +}; + + #endif // LL_LLINVENTORYOBSERVERS_H -- cgit v1.2.3 From fd2d81223697bad850b979f308c271ca370eccd3 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Mon, 25 Nov 2013 16:03:52 -0500 Subject: SH-4549 FIX - code cleanup --- indra/newview/llinventorybridge.cpp | 33 --------------------------------- indra/newview/llinventoryobserver.cpp | 1 - 2 files changed, 34 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 74837bac37..1f942f5f4b 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2984,39 +2984,6 @@ std::string LLFolderBridge::getLabelSuffix() const : LLStringUtil::null; } -class ScrollOnRenameObserver: public LLInventoryObserver -{ -public: - LLFolderView *mView; - LLUUID mUUID; - - ScrollOnRenameObserver(const LLUUID& uuid, LLFolderView *view): - mUUID(uuid), - mView(view) - { - } - void changed(U32 mask) - { - if (mask & LLInventoryObserver::LABEL) - { - // TODO - check for whether this is the item we're waiting for a rename of - const uuid_set_t& changed_item_ids = gInventory.getChangedIDs(); - for (uuid_set_t::const_iterator it = changed_item_ids.begin(); it != changed_item_ids.end(); ++it) - { - const LLUUID& id = *it; - if (id == mUUID) - { - mView->scrollToShowSelection(); - - gInventory.removeObserver(this); - delete this; - return; - } - } - } - } -}; - BOOL LLFolderBridge::renameItem(const std::string& new_name) { diff --git a/indra/newview/llinventoryobserver.cpp b/indra/newview/llinventoryobserver.cpp index ae59b44184..f71cf26b30 100755 --- a/indra/newview/llinventoryobserver.cpp +++ b/indra/newview/llinventoryobserver.cpp @@ -706,7 +706,6 @@ void LLScrollOnRenameObserver::changed(U32 mask) { if (mask & LLInventoryObserver::LABEL) { - // TODO - check for whether this is the item we're waiting for a rename of const uuid_set_t& changed_item_ids = gInventory.getChangedIDs(); for (uuid_set_t::const_iterator it = changed_item_ids.begin(); it != changed_item_ids.end(); ++it) { -- cgit v1.2.3 From c0d780cb4473c02e885c67fbc1bc30e87536d1b8 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Mon, 25 Nov 2013 16:52:58 -0500 Subject: SH-4613 WIP - add CREATE mask bit for newly created items in AISUpdate::doUpdate() - needed for some inventory observers. --- indra/newview/llaisapi.cpp | 5 +++-- indra/newview/llinventorymodel.cpp | 5 +++-- indra/newview/llinventorymodel.h | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp index 14978662f6..38eb34676e 100755 --- a/indra/newview/llaisapi.cpp +++ b/indra/newview/llaisapi.cpp @@ -33,6 +33,7 @@ #include "llinventorymodel.h" #include "llsdutil.h" #include "llviewerregion.h" +#include "llinventoryobserver.h" ///---------------------------------------------------------------------------- /// Classes for AISv3 support. @@ -781,7 +782,7 @@ void AISUpdate::doUpdate() LLUUID category_id(create_it->first); LLPointer<LLViewerInventoryCategory> new_category = create_it->second; - gInventory.updateCategory(new_category); + gInventory.updateCategory(new_category, LLInventoryObserver::CREATE); LL_DEBUGS("Inventory") << "created category " << category_id << LL_ENDL; } @@ -818,7 +819,7 @@ void AISUpdate::doUpdate() // cases. Maybe break out the update/create cases, in which // case this is create. LL_DEBUGS("Inventory") << "created item " << item_id << LL_ENDL; - gInventory.updateItem(new_item); + gInventory.updateItem(new_item, LLInventoryObserver::CREATE); } // UPDATE ITEMS diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 6b1bf69b5e..891d7c821c 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -944,7 +944,7 @@ LLInventoryModel::item_array_t* LLInventoryModel::getUnlockedItemArray(const LLU // Calling this method with an inventory category will either change // an existing item with the matching id, or it will add the category. -void LLInventoryModel::updateCategory(const LLViewerInventoryCategory* cat) +void LLInventoryModel::updateCategory(const LLViewerInventoryCategory* cat, U32 mask) { if(cat->getUUID().isNull()) { @@ -961,7 +961,6 @@ void LLInventoryModel::updateCategory(const LLViewerInventoryCategory* cat) if(old_cat) { // We already have an old category, modify it's values - U32 mask = LLInventoryObserver::NONE; LLUUID old_parent_id = old_cat->getParentUUID(); LLUUID new_parent_id = cat->getParentUUID(); if(old_parent_id != new_parent_id) @@ -1128,6 +1127,7 @@ void LLInventoryModel::onAISUpdateReceived(const std::string& context, const LLS llinfos << "elapsed: " << timer.getElapsedTimeF32() << llendl; } +// Does not appear to be used currently. void LLInventoryModel::onItemUpdated(const LLUUID& item_id, const LLSD& updates, bool update_parent_version) { U32 mask = LLInventoryObserver::NONE; @@ -1168,6 +1168,7 @@ void LLInventoryModel::onItemUpdated(const LLUUID& item_id, const LLSD& updates, } } +// Not used? void LLInventoryModel::onCategoryUpdated(const LLUUID& cat_id, const LLSD& updates) { U32 mask = LLInventoryObserver::NONE; diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index ab8bbac6d8..6b6d077a4b 100755 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -309,7 +309,7 @@ public: // NOTE: In usage, you will want to perform cache accounting // operations in accountForUpdate() or LLViewerInventoryCategory:: // updateServer() before calling this method. - void updateCategory(const LLViewerInventoryCategory* cat); + void updateCategory(const LLViewerInventoryCategory* cat, U32 mask = 0); // Move the specified object id to the specified category and // update the internal structures. No cache accounting, -- cgit v1.2.3 From 02453cacd03818848862391d75e6225ba90e97a7 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine <mnikolenko@productengine.com> Date: Wed, 27 Nov 2013 13:03:14 +0200 Subject: MAINT-3496 FIXED Disable "Allow group access" option if "Sell passes to: group" is selected(and vice versa). --- indra/newview/llfloaterland.cpp | 43 ++++++++++++++++++++++++++++++++--------- indra/newview/llfloaterland.h | 1 + 2 files changed, 35 insertions(+), 9 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 2b9c216e54..74592dbdde 100755 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -2331,7 +2331,7 @@ BOOL LLPanelLandAccess::postBuild() childSetCommitCallback("public_access", onCommitPublicAccess, this); childSetCommitCallback("limit_payment", onCommitAny, this); childSetCommitCallback("limit_age_verified", onCommitAny, this); - childSetCommitCallback("GroupCheck", onCommitAny, this); + childSetCommitCallback("GroupCheck", onCommitGroupCheck, this); childSetCommitCallback("PassCheck", onCommitAny, this); childSetCommitCallback("pass_combo", onCommitAny, this); childSetCommitCallback("PriceSpin", onCommitAny, this); @@ -2496,11 +2496,11 @@ void LLPanelLandAccess::refresh() } BOOL use_pass = parcel->getParcelFlag(PF_USE_PASS_LIST); - getChild<LLUICtrl>("PassCheck")->setValue(use_pass ); + getChild<LLUICtrl>("PassCheck")->setValue(use_pass); LLCtrlSelectionInterface* passcombo = childGetSelectionInterface("pass_combo"); if (passcombo) { - if (public_access || !use_pass || !use_group) + if (public_access || !use_pass) { passcombo->selectByValue("anyone"); } @@ -2593,12 +2593,11 @@ void LLPanelLandAccess::refresh_ui() getChildView("limit_age_verified")->setEnabled(FALSE); - BOOL group_access = getChild<LLUICtrl>("GroupCheck")->getValue().asBoolean(); BOOL sell_passes = getChild<LLUICtrl>("PassCheck")->getValue().asBoolean(); getChildView("PassCheck")->setEnabled(can_manage_allowed); if (sell_passes) { - getChildView("pass_combo")->setEnabled(group_access && can_manage_allowed); + getChildView("pass_combo")->setEnabled(can_manage_allowed); getChildView("PriceSpin")->setEnabled(can_manage_allowed); getChildView("HoursSpin")->setEnabled(can_manage_allowed); } @@ -2657,6 +2656,32 @@ void LLPanelLandAccess::onCommitPublicAccess(LLUICtrl *ctrl, void *userdata) onCommitAny(ctrl, userdata); } +void LLPanelLandAccess::onCommitGroupCheck(LLUICtrl *ctrl, void *userdata) +{ + LLPanelLandAccess *self = (LLPanelLandAccess *)userdata; + LLParcel* parcel = self->mParcel->getParcel(); + if (!parcel) + { + return; + } + + BOOL use_pass_list = !self->getChild<LLUICtrl>("public_access")->getValue().asBoolean(); + BOOL use_access_group = self->getChild<LLUICtrl>("GroupCheck")->getValue().asBoolean(); + LLCtrlSelectionInterface* passcombo = self->childGetSelectionInterface("pass_combo"); + if (passcombo) + { + if (use_access_group && use_pass_list) + { + if (passcombo->getSelectedValue().asString() == "group") + { + passcombo->selectByValue("anyone"); + } + } + } + + onCommitAny(ctrl, userdata); +} + // static void LLPanelLandAccess::onCommitAny(LLUICtrl *ctrl, void *userdata) { @@ -2694,14 +2719,14 @@ void LLPanelLandAccess::onCommitAny(LLUICtrl *ctrl, void *userdata) { use_access_list = TRUE; use_pass_list = self->getChild<LLUICtrl>("PassCheck")->getValue().asBoolean(); - if (use_access_group && use_pass_list) + LLCtrlSelectionInterface* passcombo = self->childGetSelectionInterface("pass_combo"); + if (passcombo) { - LLCtrlSelectionInterface* passcombo = self->childGetSelectionInterface("pass_combo"); - if (passcombo) + if (use_access_group && use_pass_list) { if (passcombo->getSelectedValue().asString() == "group") { - use_access_list = FALSE; + use_access_group = FALSE; } } } diff --git a/indra/newview/llfloaterland.h b/indra/newview/llfloaterland.h index 4f1c10274a..95612fcb4a 100755 --- a/indra/newview/llfloaterland.h +++ b/indra/newview/llfloaterland.h @@ -366,6 +366,7 @@ public: static void onCommitPublicAccess(LLUICtrl* ctrl, void *userdata); static void onCommitAny(LLUICtrl* ctrl, void *userdata); + static void onCommitGroupCheck(LLUICtrl* ctrl, void *userdata); static void onClickRemoveAccess(void*); static void onClickRemoveBanned(void*); -- cgit v1.2.3 From d3e2573ebd60c67c99644fdcf471c6b8102c302d Mon Sep 17 00:00:00 2001 From: maksymsproductengine <maksymsproductengine@lindenlab.com> Date: Wed, 27 Nov 2013 20:25:41 +0200 Subject: MAINT-3495 FIXED Improve discoverability of Region Debug floater --- indra/newview/llfloaterregioninfo.cpp | 7 +++++++ indra/newview/llfloaterregioninfo.h | 1 + indra/newview/skins/default/xui/en/menu_viewer.xml | 12 ------------ indra/newview/skins/default/xui/en/panel_region_debug.xml | 10 ++++++++++ 4 files changed, 18 insertions(+), 12 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 66bf49331b..d826e56e2c 100755 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -890,6 +890,7 @@ BOOL LLPanelRegionDebugInfo::postBuild() childSetAction("top_scripts_btn", onClickTopScripts, this); childSetAction("restart_btn", onClickRestart, this); childSetAction("cancel_restart_btn", onClickCancelRestart, this); + childSetAction("region_debug_console_btn", onClickDebugConsole, this); return TRUE; } @@ -911,6 +912,7 @@ bool LLPanelRegionDebugInfo::refreshFromRegion(LLViewerRegion* region) getChildView("top_scripts_btn")->setEnabled(allow_modify); getChildView("restart_btn")->setEnabled(allow_modify); getChildView("cancel_restart_btn")->setEnabled(allow_modify); + getChildView("region_debug_console_btn")->setEnabled(allow_modify); return LLPanelRegionInfo::refreshFromRegion(region); } @@ -1073,6 +1075,11 @@ void LLPanelRegionDebugInfo::onClickCancelRestart(void* data) self->sendEstateOwnerMessage(gMessageSystem, "restart", invoice, strings); } +// static +void LLPanelRegionDebugInfo::onClickDebugConsole(void* data) +{ + LLFloaterReg::showInstance("region_debug_console"); +} BOOL LLPanelRegionTerrainInfo::validateTextureSizes() { diff --git a/indra/newview/llfloaterregioninfo.h b/indra/newview/llfloaterregioninfo.h index f0499f1903..bf174f3700 100755 --- a/indra/newview/llfloaterregioninfo.h +++ b/indra/newview/llfloaterregioninfo.h @@ -209,6 +209,7 @@ protected: static void onClickRestart(void* data); bool callbackRestart(const LLSD& notification, const LLSD& response); static void onClickCancelRestart(void* data); + static void onClickDebugConsole(void* data); private: LLUUID mTargetAvatar; diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 6354006b87..7fab89b693 100755 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -3126,18 +3126,6 @@ <menu_item_call.on_click function="Advanced.PrintAgentInfo" /> </menu_item_call> - <menu_item_check - label="Region Debug Console" - name="Region Debug Console" - shortcut="control|shift|`" - use_mac_ctrl="true"> - <menu_item_check.on_check - function="Floater.Visible" - parameter="region_debug_console" /> - <menu_item_check.on_click - function="Floater.Toggle" - parameter="region_debug_console" /> - </menu_item_check> <menu_item_separator /> <menu_item_check diff --git a/indra/newview/skins/default/xui/en/panel_region_debug.xml b/indra/newview/skins/default/xui/en/panel_region_debug.xml index 81b2281adb..fea5f1b19f 100755 --- a/indra/newview/skins/default/xui/en/panel_region_debug.xml +++ b/indra/newview/skins/default/xui/en/panel_region_debug.xml @@ -201,4 +201,14 @@ tool_tip="Cancel region restart" top_delta="0" width="150" /> + <button + follows="left|top" + height="20" + label="Region Debug Console" + layout="topleft" + left="10" + name="region_debug_console_btn" + tool_tip="Open Region Debug Console" + top_pad="5" + width="150" /> </panel> -- cgit v1.2.3 From b93374e0702b5e69fa8200590da274c49f931fcf Mon Sep 17 00:00:00 2001 From: MaximB ProductEngine <mberezhnoy@productengine.com> Date: Thu, 28 Nov 2013 14:16:35 +0200 Subject: MAINT-3334 (If a chat tab is in focus when you enter mouselook, chat that occurs while in mouselook does not display after exiting mouselook) --- indra/newview/llfloaterimsession.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloaterimsession.cpp b/indra/newview/llfloaterimsession.cpp index 14e1a486d3..9a21c59c9d 100755 --- a/indra/newview/llfloaterimsession.cpp +++ b/indra/newview/llfloaterimsession.cpp @@ -690,7 +690,7 @@ void LLFloaterIMSession::setVisible(BOOL visible) if (visible && isInVisibleChain()) { sIMFloaterShowedSignal(mSessionID); - + updateMessages(); } } -- cgit v1.2.3 From 6989a45747fbd88762bce2e6de47db982e1810e9 Mon Sep 17 00:00:00 2001 From: MaximB ProductEngine <mberezhnoy@productengine.com> Date: Tue, 3 Dec 2013 11:11:44 +0200 Subject: MAINT-1769 (URL-like resident display name is shown as hyperlink in Share confirmation window) --- indra/newview/skins/default/xui/en/notifications.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index b3fd1fa818..2cb8f788d4 100755 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -7634,7 +7634,7 @@ Are you sure you want to share the following items: With the following Residents: -[RESIDENTS] +<nolink>[RESIDENTS]</nolink> <tag>confirm</tag> <usetemplate name="okcancelbuttons" @@ -7654,7 +7654,7 @@ Are you sure you want to share the following items: With the following Residents: -[RESIDENTS] +<nolink>[RESIDENTS]</nolink> <tag>confirm</tag> <usetemplate name="okcancelbuttons" -- cgit v1.2.3 From 940cde3938217daf348bd62f719cae262bad86b0 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Tue, 3 Dec 2013 11:49:29 -0500 Subject: SH-4640 WIP --- indra/newview/llinventorybridge.cpp | 13 +-- indra/newview/llinventorymodel.cpp | 174 ++++++++++++++++++++++++++++++------ indra/newview/llinventorymodel.h | 13 ++- 3 files changed, 162 insertions(+), 38 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 1f942f5f4b..4bce25c8b5 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1730,16 +1730,9 @@ BOOL LLItemBridge::removeItem() { if (!item->getIsLinkType()) { - LLInventoryModel::cat_array_t cat_array; - LLInventoryModel::item_array_t item_array; - LLLinkedItemIDMatches is_linked_item_match(mUUID); - gInventory.collectDescendentsIf(gInventory.getRootFolderID(), - cat_array, - item_array, - LLInventoryModel::INCLUDE_TRASH, - is_linked_item_match); - - const U32 num_links = cat_array.size() + item_array.size(); + LLInventoryModel::item_array_t item_array = + gInventory.collectLinksTo(mUUID, gInventory.getRootFolderID()); + const U32 num_links = item_array.size(); if (num_links > 0) { // Warn if the user is will break any links when deleting this item. diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 891d7c821c..2c63203773 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -127,6 +127,7 @@ LLInventoryModel gInventory; LLInventoryModel::LLInventoryModel() : mModifyMask(LLInventoryObserver::ALL), mChangedItemIDs(), + mBacklinkMMap(), mCategoryMap(), mItemMap(), mCategoryLock(), @@ -686,26 +687,8 @@ void LLInventoryModel::addChangedMaskForLinks(const LLUUID& object_id, U32 mask) if (!obj || obj->getIsLinkType()) return; - LLInventoryModel::cat_array_t cat_array; - LLInventoryModel::item_array_t item_array; - LLLinkedItemIDMatches is_linked_item_match(object_id); - collectDescendentsIf(gInventory.getRootFolderID(), - cat_array, - item_array, - LLInventoryModel::INCLUDE_TRASH, - is_linked_item_match); - if (cat_array.empty() && item_array.empty()) - { - return; - } - for (LLInventoryModel::cat_array_t::iterator cat_iter = cat_array.begin(); - cat_iter != cat_array.end(); - cat_iter++) - { - LLViewerInventoryCategory *linked_cat = (*cat_iter); - addChangedMask(mask, linked_cat->getUUID()); - }; - + LLInventoryModel::item_array_t item_array = + collectLinksTo(object_id,gInventory.getRootFolderID()); for (LLInventoryModel::item_array_t::iterator iter = item_array.begin(); iter != item_array.end(); iter++) @@ -733,11 +716,14 @@ LLViewerInventoryItem* LLInventoryModel::getLinkedItem(const LLUUID& object_id) return object_id.notNull() ? getItem(getLinkedItemID(object_id)) : NULL; } -LLInventoryModel::item_array_t LLInventoryModel::collectLinkedItems(const LLUUID& id, - const LLUUID& start_folder_id) +LLInventoryModel::item_array_t LLInventoryModel::collectLinksTo(const LLUUID& id, + const LLUUID& start_folder_id) { + // Get item list via collectDescendents (slow!) item_array_t items; const LLInventoryObject *obj = getObject(id); + // FIXME - should be as below, but this is causing a stack-smashing crash of cause TBD... check in the REBUILD code. + //if (obj && obj->getIsLinkType()) if (!obj || obj->getIsLinkType()) return items; @@ -748,6 +734,38 @@ LLInventoryModel::item_array_t LLInventoryModel::collectLinkedItems(const LLUUID items, LLInventoryModel::INCLUDE_TRASH, is_linked_item_match); + + // Get via backlinks - fast. + item_array_t fast_items; + std::pair<backlink_mmap_t::iterator, backlink_mmap_t::iterator> range = mBacklinkMMap.equal_range(id); + for (backlink_mmap_t::iterator it = range.first; it != range.second; ++it) + { + LLViewerInventoryItem *item = getItem(it->second); + if (item) + { + fast_items.put(item); + } + } + + // Validate equivalence. + if (items.size() != fast_items.size()) + { + llwarns << "size mismatch, " << items.size() << " != " << fast_items.size() << llendl; + } + for (item_array_t::iterator ita = items.begin(); ita != items.end(); ++ita) + { + if (fast_items.find(*ita) == item_array_t::FAIL) + { + llwarns << "in descendents search but not fast search " << (*ita)->getUUID() << llendl; + } + } + for (item_array_t::iterator itb = fast_items.begin(); itb != fast_items.end(); ++itb) + { + if (items.find(*itb) == item_array_t::FAIL) + { + llwarns << "in fast search but not descendents search " << (*itb)->getUUID() << llendl; + } + } return items; } @@ -1355,11 +1373,16 @@ void LLInventoryModel::deleteObject(const LLUUID& id, bool fix_broken_links, boo mParentChildCategoryTree.erase(id); } addChangedMask(LLInventoryObserver::REMOVE, id); - + + bool is_link_type = obj->getIsLinkType(); + if (is_link_type) + { + removeBacklinkInfo(obj->getUUID(), obj->getLinkedUUID()); + } + // Can't have links to links, so there's no need for this update // if the item removed is a link. Can also skip if source of the // update is getting broken link info separately. - bool is_link_type = obj->getIsLinkType(); obj = NULL; // delete obj if (fix_broken_links && !is_link_type) { @@ -1373,7 +1396,7 @@ void LLInventoryModel::deleteObject(const LLUUID& id, bool fix_broken_links, boo void LLInventoryModel::updateLinkedObjectsFromPurge(const LLUUID &baseobj_id) { - LLInventoryModel::item_array_t item_array = collectLinkedItems(baseobj_id); + LLInventoryModel::item_array_t item_array = collectLinksTo(baseobj_id); // REBUILD is expensive, so clear the current change list first else // everything else on the changelist will also get rebuilt. @@ -1653,6 +1676,47 @@ void LLInventoryModel::addCategory(LLViewerInventoryCategory* category) } } +bool LLInventoryModel::hasBacklinkInfo(const LLUUID& link_id, const LLUUID& target_id) const +{ + std::pair <backlink_mmap_t::const_iterator, backlink_mmap_t::const_iterator> range; + range = mBacklinkMMap.equal_range(target_id); + for (backlink_mmap_t::const_iterator it = range.first; it != range.second; ++it) + { + if (it->second == link_id) + { + return true; + } + } + return false; +} + +void LLInventoryModel::addBacklinkInfo(const LLUUID& link_id, const LLUUID& target_id) +{ + if (!hasBacklinkInfo(link_id, target_id)) + { + mBacklinkMMap.insert(std::make_pair(target_id, link_id)); + } +} + +void LLInventoryModel::removeBacklinkInfo(const LLUUID& link_id, const LLUUID& target_id) +{ + std::pair <backlink_mmap_t::iterator, backlink_mmap_t::iterator> range; + range = mBacklinkMMap.equal_range(target_id); + for (backlink_mmap_t::iterator it = range.first; it != range.second; ) + { + if (it->second == link_id) + { + backlink_mmap_t::iterator delete_it = it; // iterator will be invalidated by erase. + ++it; + mBacklinkMMap.erase(delete_it); + } + else + { + ++it; + } + } +} + void LLInventoryModel::addItem(LLViewerInventoryItem* item) { llassert(item); @@ -1674,7 +1738,13 @@ void LLInventoryModel::addItem(LLViewerInventoryItem* item) { llinfos << "Adding broken link [ name: " << item->getName() << " itemID: " << item->getUUID() << " assetID: " << item->getAssetUUID() << " ) parent: " << item->getParentUUID() << llendl; } - + if (item->getIsLinkType()) + { + // Add back-link from linked-to UUID. + const LLUUID& link_id = item->getUUID(); + const LLUUID& target_id = item->getLinkedUUID(); + addBacklinkInfo(link_id, target_id); + } mItemMap[item->getUUID()] = item; } } @@ -1693,6 +1763,7 @@ void LLInventoryModel::empty() mParentChildItemTree.end(), DeletePairedPointer()); mParentChildItemTree.clear(); + mBacklinkMMap.clear(); // forget all backlink information. mCategoryMap.clear(); // remove all references (should delete entries) mItemMap.clear(); // remove all references (should delete entries) mLastItem = NULL; @@ -3701,6 +3772,57 @@ bool LLInventoryModel::validate() const } } + // Link checking + if (item->getIsLinkType()) + { + const LLUUID& link_id = item->getUUID(); + const LLUUID& target_id = item->getLinkedUUID(); + LLViewerInventoryItem *target_item = getItem(target_id); + LLViewerInventoryCategory *target_cat = getCategory(target_id); + // Linked-to UUID should have back reference to this link. + if (!hasBacklinkInfo(link_id, target_id)) + { + llwarns << "link " << item->getUUID() << " type " << item->getActualType() + << " missing backlink info at target_id " << target_id + << llendl; + } + // Links should have referents. + if (item->getActualType() == LLAssetType::AT_LINK && !target_item) + { + llwarns << "broken item link " << item->getName() << " id " << item->getUUID() << llendl; + } + else if (item->getActualType() == LLAssetType::AT_LINK_FOLDER && !target_cat) + { + llwarns << "broken folder link " << item->getName() << " id " << item->getUUID() << llendl; + } + if (target_item && target_item->getIsLinkType()) + { + llwarns << "link " << item->getName() << " references a link item " + << target_item->getName() << " " << target_item->getUUID() << llendl; + } + + // Links should not have backlinks. + std::pair<backlink_mmap_t::const_iterator, backlink_mmap_t::const_iterator> range = mBacklinkMMap.equal_range(link_id); + if (range.first != range.second) + { + llwarns << "Link item " << item->getName() << " has backlinks!" << llendl; + } + } + else + { + // Check the backlinks of a non-link item. + const LLUUID& target_id = item->getUUID(); + std::pair<backlink_mmap_t::const_iterator, backlink_mmap_t::const_iterator> range = mBacklinkMMap.equal_range(target_id); + for (backlink_mmap_t::const_iterator it = range.first; it != range.second; ++it) + { + const LLUUID& link_id = it->second; + LLViewerInventoryItem *link_item = getItem(link_id); + if (!link_item || !link_item->getIsLinkType()) + { + llwarns << "invalid backlink from target " << item->getName() << " to " << link_id << llendl; + } + } + } } if (cat_lock > 0 || item_lock > 0) diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index 6b6d077a4b..0bb89bc5d4 100755 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -154,6 +154,15 @@ private: parent_cat_map_t mParentChildCategoryTree; parent_item_map_t mParentChildItemTree; + // Track links to items and categories. We do not store item or + // category pointers here, because broken links are also supported. + typedef std::multimap<LLUUID, LLUUID> backlink_mmap_t; + backlink_mmap_t mBacklinkMMap; // key = target_id: ID of item, values = link_ids: IDs of item or folder links referencing it. + // For internal use only + bool hasBacklinkInfo(const LLUUID& link_id, const LLUUID& target_id) const; + void addBacklinkInfo(const LLUUID& link_id, const LLUUID& target_id); + void removeBacklinkInfo(const LLUUID& link_id, const LLUUID& target_id); + //-------------------------------------------------------------------- // Login //-------------------------------------------------------------------- @@ -217,8 +226,8 @@ public: // Collect all items in inventory that are linked to item_id. // Assumes item_id is itself not a linked item. - item_array_t collectLinkedItems(const LLUUID& item_id, - const LLUUID& start_folder_id = LLUUID::null); + item_array_t collectLinksTo(const LLUUID& item_id, + const LLUUID& start_folder_id = LLUUID::null); // Check if one object has a parent chain up to the category specified by UUID. -- cgit v1.2.3 From 69569df61c9e59eb50415a4ac7695426613afdc4 Mon Sep 17 00:00:00 2001 From: maksymsproductengine <maksymsproductengine@lindenlab.com> Date: Wed, 4 Dec 2013 20:28:10 +0200 Subject: MAINT-3351 FIXED Misleading failure message when user is successfully removed from a group's Owners role --- indra/newview/llgroupmgr.cpp | 5 +++++ indra/newview/llgroupmgr.h | 2 ++ indra/newview/llpanelgroup.cpp | 18 ++++++++++++++++++ 3 files changed, 25 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp index cbd844cdac..3dcf7cd8aa 100755 --- a/indra/newview/llgroupmgr.cpp +++ b/indra/newview/llgroupmgr.cpp @@ -608,6 +608,11 @@ void LLGroupMgrGroupData::recalcAgentPowers(const LLUUID& agent_id) } } +bool LLGroupMgrGroupData::isSingleMemberNotOwner() +{ + return mMembers.size() == 1 && !mMembers.begin()->second->isOwner(); +} + bool packRoleUpdateMessageBlock(LLMessageSystem* msg, const LLUUID& group_id, const LLUUID& role_id, diff --git a/indra/newview/llgroupmgr.h b/indra/newview/llgroupmgr.h index d8c1ab7ef5..1750551395 100755 --- a/indra/newview/llgroupmgr.h +++ b/indra/newview/llgroupmgr.h @@ -232,6 +232,8 @@ public: BOOL isRoleDataComplete() { return mRoleDataComplete; } BOOL isRoleMemberDataComplete() { return mRoleMemberDataComplete; } BOOL isGroupPropertiesDataComplete() { return mGroupPropertiesDataComplete; } + + bool isSingleMemberNotOwner(); F32 getAccessTime() const { return mAccessTime; } void setAccessed(); diff --git a/indra/newview/llpanelgroup.cpp b/indra/newview/llpanelgroup.cpp index ae217958f0..a0ca82da46 100755 --- a/indra/newview/llpanelgroup.cpp +++ b/indra/newview/llpanelgroup.cpp @@ -49,6 +49,7 @@ #include "llpanelgroupnotices.h" #include "llpanelgroupgeneral.h" +#include "llpanelgrouproles.h" #include "llaccordionctrltab.h" #include "llaccordionctrl.h" @@ -275,6 +276,7 @@ void LLPanelGroup::onBtnApply(void* user_data) { LLPanelGroup* self = static_cast<LLPanelGroup*>(user_data); self->apply(); + self->refreshData(); } void LLPanelGroup::onBtnGroupCallClicked(void* user_data) @@ -495,6 +497,22 @@ bool LLPanelGroup::apply(LLPanelGroupTab* tab) { //we skip refreshing group after ew manually apply changes since its very annoying //for those who are editing group + + LLPanelGroupRoles * roles_tab = dynamic_cast<LLPanelGroupRoles*>(tab); + if (roles_tab) + { + LLGroupMgr* gmgrp = LLGroupMgr::getInstance(); + LLGroupMgrGroupData* gdatap = gmgrp->getGroupData(roles_tab->getGroupID()); + + // allow refresh only for one specific case: + // there is only one member in group and it is not owner + // it's a wrong situation and need refresh panels from server + if (gdatap && gdatap->isSingleMemberNotOwner()) + { + return true; + } + } + mSkipRefresh = TRUE; return true; } -- cgit v1.2.3 From 21d9e524f64637cba6f96c21ff8a4bcf30afc961 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine <mnikolenko@productengine.com> Date: Thu, 5 Dec 2013 12:51:36 +0200 Subject: MAINT-3262 FIXED Cannot select image to upload to Web profile --- indra/newview/llfilepicker.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp index 16eacc9392..7fa3e176b0 100755 --- a/indra/newview/llfilepicker.cpp +++ b/indra/newview/llfilepicker.cpp @@ -779,7 +779,7 @@ BOOL LLFilePicker::getOpenFile(ELoadFilter filter, bool blocking) if(filter == FFLOAD_ALL) // allow application bundles etc. to be traversed; important for DEV-16869, but generally useful { - mPickOptions &= F_NAV_SUPPORT; + mPickOptions |= F_NAV_SUPPORT; } if (blocking) -- cgit v1.2.3 From 443c502ccc3abe50b7747fb2ba4d3b6bd74c1dc6 Mon Sep 17 00:00:00 2001 From: PavelK ProductEngine <pkrivich@productengine.com> Date: Tue, 3 Dec 2013 19:32:56 +0200 Subject: MAINT-3476 FIX Opening large chat histories from conversation log eats up huge amounts of memory, leading to viewer crash. --- indra/newview/llfloaterconversationpreview.cpp | 106 ++++- indra/newview/llfloaterconversationpreview.h | 11 +- indra/newview/lllogchat.cpp | 481 ++++++++++++++------- indra/newview/lllogchat.h | 64 ++- .../newview/skins/default/xui/en/notifications.xml | 10 + 5 files changed, 480 insertions(+), 192 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloaterconversationpreview.cpp b/indra/newview/llfloaterconversationpreview.cpp index 5041f4689d..a358b7c10b 100755 --- a/indra/newview/llfloaterconversationpreview.cpp +++ b/indra/newview/llfloaterconversationpreview.cpp @@ -32,6 +32,7 @@ #include "llfloaterimnearbychat.h" #include "llspinctrl.h" #include "lltrans.h" +#include "llnotificationsutil.h" const std::string LL_FCP_COMPLETE_NAME("complete_name"); const std::string LL_FCP_ACCOUNT_NAME("user_name"); @@ -45,14 +46,20 @@ LLFloaterConversationPreview::LLFloaterConversationPreview(const LLSD& session_i mAccountName(session_id[LL_FCP_ACCOUNT_NAME]), mCompleteName(session_id[LL_FCP_COMPLETE_NAME]), mMutex(NULL), - mShowHistory(false) + mShowHistory(false), + mMessages(NULL), + mHistoryThreadsBusy(false), + mOpened(false) +{ +} + +LLFloaterConversationPreview::~LLFloaterConversationPreview() { } BOOL LLFloaterConversationPreview::postBuild() { mChatHistory = getChild<LLChatHistory>("chat_history"); - LLLoadHistoryThread::setLoadEndSignal(boost::bind(&LLFloaterConversationPreview::setPages, this, _1, _2)); const LLConversation* conv = LLConversationLog::instance().getConversation(mSessionID); std::string name; @@ -79,31 +86,21 @@ BOOL LLFloaterConversationPreview::postBuild() std::string title = getString("Title", args); setTitle(title); - LLSD load_params; - load_params["load_all_history"] = true; - load_params["cut_off_todays_date"] = false; - - - LLSD loading; - loading[LL_IM_TEXT] = LLTrans::getString("loading_chat_logs"); - mMessages.push_back(loading); - mPageSpinner = getChild<LLSpinCtrl>("history_page_spin"); - mPageSpinner->setCommitCallback(boost::bind(&LLFloaterConversationPreview::onMoreHistoryBtnClick, this)); - mPageSpinner->setMinValue(1); - mPageSpinner->set(1); - mPageSpinner->setEnabled(false); - LLLogChat::startChatHistoryThread(file, load_params); return LLFloater::postBuild(); } -void LLFloaterConversationPreview::setPages(std::list<LLSD>& messages, const std::string& file_name) +void LLFloaterConversationPreview::setPages(std::list<LLSD>* messages, const std::string& file_name) { - if(file_name == mChatHistoryFileName) + if(file_name == mChatHistoryFileName && messages) { // additional protection to avoid changes of mMessages in setPages() LLMutexLock lock(&mMutex); + if (mMessages) + { + delete mMessages; // Clean up temporary message list with "Loading..." text + } mMessages = messages; - mCurrentPage = (mMessages.size() ? (mMessages.size() - 1) / mPageSize : 0); + mCurrentPage = (mMessages->size() ? (mMessages->size() - 1) / mPageSize : 0); mPageSpinner->setEnabled(true); mPageSpinner->setMaxValue(mCurrentPage+1); @@ -113,6 +110,11 @@ void LLFloaterConversationPreview::setPages(std::list<LLSD>& messages, const std getChild<LLTextBox>("page_num_label")->setValue(total_page_num); mShowHistory = true; } + LLLoadHistoryThread* loadThread = LLLogChat::getLoadHistoryThread(mSessionID); + if (loadThread) + { + loadThread->removeLoadEndSignal(boost::bind(&LLFloaterConversationPreview::setPages, this, _1, _2)); + } } void LLFloaterConversationPreview::draw() @@ -127,24 +129,82 @@ void LLFloaterConversationPreview::draw() void LLFloaterConversationPreview::onOpen(const LLSD& key) { + if (mOpened) + { + return; + } + mOpened = true; + if (!LLLogChat::historyThreadsFinished(mSessionID)) + { + LLNotificationsUtil::add("ChatHistoryIsBusyAlert"); + mHistoryThreadsBusy = true; + closeFloater(); + return; + } + LLSD load_params; + load_params["load_all_history"] = true; + load_params["cut_off_todays_date"] = false; + + // The temporary message list with "Loading..." text + // Will be deleted upon loading completion in setPages() method + mMessages = new std::list<LLSD>(); + + + LLSD loading; + loading[LL_IM_TEXT] = LLTrans::getString("loading_chat_logs"); + mMessages->push_back(loading); + mPageSpinner = getChild<LLSpinCtrl>("history_page_spin"); + mPageSpinner->setCommitCallback(boost::bind(&LLFloaterConversationPreview::onMoreHistoryBtnClick, this)); + mPageSpinner->setMinValue(1); + mPageSpinner->set(1); + mPageSpinner->setEnabled(false); + + // The actual message list to load from file + // Will be deleted in a separate thread LLDeleteHistoryThread not to freeze UI + // LLDeleteHistoryThread is started in destructor + std::list<LLSD>* messages = new std::list<LLSD>(); + + LLLogChat::cleanupHistoryThreads(); + + LLLoadHistoryThread* loadThread = new LLLoadHistoryThread(mChatHistoryFileName, messages, load_params); + loadThread->setLoadEndSignal(boost::bind(&LLFloaterConversationPreview::setPages, this, _1, _2)); + loadThread->start(); + LLLogChat::addLoadHistoryThread(mSessionID, loadThread); + + LLDeleteHistoryThread* deleteThread = new LLDeleteHistoryThread(messages, loadThread); + LLLogChat::addDeleteHistoryThread(mSessionID, deleteThread); + mShowHistory = true; } +void LLFloaterConversationPreview::onClose(bool app_quitting) +{ + mOpened = false; + if (!mHistoryThreadsBusy) + { + LLDeleteHistoryThread* deleteThread = LLLogChat::getDeleteHistoryThread(mSessionID); + if (deleteThread) + { + deleteThread->start(); + } + } +} + void LLFloaterConversationPreview::showHistory() { // additional protection to avoid changes of mMessages in setPages LLMutexLock lock(&mMutex); - if(!mMessages.size() || mCurrentPage * mPageSize >= mMessages.size()) + if(mMessages == NULL || !mMessages->size() || mCurrentPage * mPageSize >= mMessages->size()) { return; } mChatHistory->clear(); std::ostringstream message; - std::list<LLSD>::const_iterator iter = mMessages.begin(); + std::list<LLSD>::const_iterator iter = mMessages->begin(); std::advance(iter, mCurrentPage * mPageSize); - - for (int msg_num = 0; iter != mMessages.end() && msg_num < mPageSize; ++iter, ++msg_num) + + for (int msg_num = 0; iter != mMessages->end() && msg_num < mPageSize; ++iter, ++msg_num) { LLSD msg = *iter; diff --git a/indra/newview/llfloaterconversationpreview.h b/indra/newview/llfloaterconversationpreview.h index b0488f4ff1..a8dbbc9ffe 100755 --- a/indra/newview/llfloaterconversationpreview.h +++ b/indra/newview/llfloaterconversationpreview.h @@ -39,13 +39,14 @@ class LLFloaterConversationPreview : public LLFloater public: LLFloaterConversationPreview(const LLSD& session_id); - virtual ~LLFloaterConversationPreview(){}; + virtual ~LLFloaterConversationPreview(); virtual BOOL postBuild(); - void setPages(std::list<LLSD>& messages,const std::string& file_name); + void setPages(std::list<LLSD>* messages,const std::string& file_name); virtual void draw(); virtual void onOpen(const LLSD& key); + virtual void onClose(bool app_quitting); private: void onMoreHistoryBtnClick(); @@ -58,11 +59,13 @@ private: int mCurrentPage; int mPageSize; - std::list<LLSD> mMessages; + std::list<LLSD>* mMessages; std::string mAccountName; std::string mCompleteName; - std::string mChatHistoryFileName; + std::string mChatHistoryFileName; bool mShowHistory; + bool mHistoryThreadsBusy; + bool mOpened; }; #endif /* LLFLOATERCONVERSATIONPREVIEW_H_ */ diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp index 90b169ecd3..09eb40d830 100755 --- a/indra/newview/lllogchat.cpp +++ b/indra/newview/lllogchat.cpp @@ -206,7 +206,11 @@ private: }; LLLogChat::save_history_signal_t * LLLogChat::sSaveHistorySignal = NULL; -LLLoadHistoryThread::load_end_signal_t * LLLoadHistoryThread::mLoadEndSignal = NULL; + +std::map<LLUUID,LLLoadHistoryThread *> LLLogChat::sLoadHistoryThreads; +std::map<LLUUID,LLDeleteHistoryThread *> LLLogChat::sDeleteHistoryThreads; +LLMutex* LLLogChat::sHistoryThreadsMutex = NULL; + //static std::string LLLogChat::makeLogFileName(std::string filename) @@ -337,83 +341,179 @@ void LLLogChat::saveHistory(const std::string& filename, void LLLogChat::loadChatHistory(const std::string& file_name, std::list<LLSD>& messages, const LLSD& load_params) { if (file_name.empty()) - { - LL_WARNS("LLLogChat::loadChatHistory") << "Session name is Empty!" << LL_ENDL; - return ; - } + { + LL_WARNS("LLLogChat::loadChatHistory") << "Session name is Empty!" << LL_ENDL; + return ; + } - bool load_all_history = load_params.has("load_all_history") ? load_params["load_all_history"].asBoolean() : false; + bool load_all_history = load_params.has("load_all_history") ? load_params["load_all_history"].asBoolean() : false; - LLFILE* fptr = LLFile::fopen(LLLogChat::makeLogFileName(file_name), "r");/*Flawfinder: ignore*/ - if (!fptr) - { - fptr = LLFile::fopen(LLLogChat::oldLogFileName(file_name), "r");/*Flawfinder: ignore*/ - if (!fptr) - { - return; //No previous conversation with this name. - } - } + LLFILE* fptr = LLFile::fopen(LLLogChat::makeLogFileName(file_name), "r");/*Flawfinder: ignore*/ + if (!fptr) + { + fptr = LLFile::fopen(LLLogChat::oldLogFileName(file_name), "r");/*Flawfinder: ignore*/ + if (!fptr) + { + return; //No previous conversation with this name. + } + } - char buffer[LOG_RECALL_SIZE]; /*Flawfinder: ignore*/ - char *bptr; - S32 len; - bool firstline = TRUE; - - if (load_all_history || fseek(fptr, (LOG_RECALL_SIZE - 1) * -1 , SEEK_END)) - { //We need to load the whole historyFile or it's smaller than recall size, so get it all. - firstline = FALSE; - if (fseek(fptr, 0, SEEK_SET)) - { - fclose(fptr); - return; - } - } - while (fgets(buffer, LOG_RECALL_SIZE, fptr) && !feof(fptr)) - { - len = strlen(buffer) - 1; /*Flawfinder: ignore*/ - for (bptr = (buffer + len); (*bptr == '\n' || *bptr == '\r') && bptr>buffer; bptr--) *bptr='\0'; - - if (firstline) - { - firstline = FALSE; - continue; - } - - std::string line(buffer); - - //updated 1.23 plain text log format requires a space added before subsequent lines in a multilined message - if (' ' == line[0]) - { - line.erase(0, MULTI_LINE_PREFIX.length()); - append_to_last_message(messages, '\n' + line); - } - else if (0 == len && ('\n' == line[0] || '\r' == line[0])) - { - //to support old format's multilined messages with new lines used to divide paragraphs - append_to_last_message(messages, line); - } - else - { - LLSD item; - if (!LLChatLogParser::parse(line, item, load_params)) - { - item[LL_IM_TEXT] = line; - } - messages.push_back(item); - } - } - fclose(fptr); + char buffer[LOG_RECALL_SIZE]; /*Flawfinder: ignore*/ + char *bptr; + S32 len; + bool firstline = TRUE; + + if (load_all_history || fseek(fptr, (LOG_RECALL_SIZE - 1) * -1 , SEEK_END)) + { //We need to load the whole historyFile or it's smaller than recall size, so get it all. + firstline = FALSE; + if (fseek(fptr, 0, SEEK_SET)) + { + fclose(fptr); + return; + } + } + while (fgets(buffer, LOG_RECALL_SIZE, fptr) && !feof(fptr)) + { + len = strlen(buffer) - 1; /*Flawfinder: ignore*/ + for (bptr = (buffer + len); (*bptr == '\n' || *bptr == '\r') && bptr>buffer; bptr--) *bptr='\0'; + + if (firstline) + { + firstline = FALSE; + continue; + } + std::string line(buffer); + //updated 1.23 plain text log format requires a space added before subsequent lines in a multilined message + if (' ' == line[0]) + { + line.erase(0, MULTI_LINE_PREFIX.length()); + append_to_last_message(messages, '\n' + line); + } + else if (0 == len && ('\n' == line[0] || '\r' == line[0])) + { + //to support old format's multilined messages with new lines used to divide paragraphs + append_to_last_message(messages, line); + } + else + { + LLSD item; + if (!LLChatLogParser::parse(line, item, load_params)) + { + item[LL_IM_TEXT] = line; + } + messages.push_back(item); + } + } + fclose(fptr); } -void LLLogChat::startChatHistoryThread(const std::string& file_name, const LLSD& load_params) +// static +bool LLLogChat::historyThreadsFinished(LLUUID session_id) { + LLMutexLock lock(historyThreadsMutex()); + bool finished = true; + std::map<LLUUID,LLLoadHistoryThread *>::iterator it = sLoadHistoryThreads.find(session_id); + if (it != sLoadHistoryThreads.end()) + { + finished = it->second->isFinished(); + } + if (!finished) + { + return false; + } + std::map<LLUUID,LLDeleteHistoryThread *>::iterator dit = sDeleteHistoryThreads.find(session_id); + if (dit != sDeleteHistoryThreads.end()) + { + finished = finished && dit->second->isFinished(); + } + return finished; +} - LLLoadHistoryThread* mThread = new LLLoadHistoryThread(); - mThread->start(); - mThread->setHistoryParams(file_name, load_params); +// static +LLLoadHistoryThread* LLLogChat::getLoadHistoryThread(LLUUID session_id) +{ + LLMutexLock lock(historyThreadsMutex()); + std::map<LLUUID,LLLoadHistoryThread *>::iterator it = sLoadHistoryThreads.find(session_id); + if (it != sLoadHistoryThreads.end()) + { + return it->second; + } + return NULL; +} + +// static +LLDeleteHistoryThread* LLLogChat::getDeleteHistoryThread(LLUUID session_id) +{ + LLMutexLock lock(historyThreadsMutex()); + std::map<LLUUID,LLDeleteHistoryThread *>::iterator it = sDeleteHistoryThreads.find(session_id); + if (it != sDeleteHistoryThreads.end()) + { + return it->second; + } + return NULL; +} + +// static +bool LLLogChat::addLoadHistoryThread(LLUUID& session_id, LLLoadHistoryThread* lthread) +{ + LLMutexLock lock(historyThreadsMutex()); + std::map<LLUUID,LLLoadHistoryThread *>::const_iterator it = sLoadHistoryThreads.find(session_id); + if (it != sLoadHistoryThreads.end()) + { + return false; + } + sLoadHistoryThreads[session_id] = lthread; + return true; } + +// static +bool LLLogChat::addDeleteHistoryThread(LLUUID& session_id, LLDeleteHistoryThread* dthread) +{ + LLMutexLock lock(historyThreadsMutex()); + std::map<LLUUID,LLDeleteHistoryThread *>::const_iterator it = sDeleteHistoryThreads.find(session_id); + if (it != sDeleteHistoryThreads.end()) + { + return false; + } + sDeleteHistoryThreads[session_id] = dthread; + return true; +} + +// static +void LLLogChat::cleanupHistoryThreads() +{ + LLMutexLock lock(historyThreadsMutex()); + std::vector<LLUUID> uuids; + std::map<LLUUID,LLLoadHistoryThread *>::iterator lit = sLoadHistoryThreads.begin(); + for (; lit != sLoadHistoryThreads.end(); lit++) + { + if (lit->second->isFinished() && sDeleteHistoryThreads[lit->first]->isFinished()) + { + delete lit->second; + delete sDeleteHistoryThreads[lit->first]; + uuids.push_back(lit->first); + } + } + std::vector<LLUUID>::iterator uuid_it = uuids.begin(); + for ( ;uuid_it != uuids.end(); uuid_it++) + { + sLoadHistoryThreads.erase(*uuid_it); + sDeleteHistoryThreads.erase(*uuid_it); + } +} + +//static +LLMutex* LLLogChat::historyThreadsMutex() +{ + if (sHistoryThreadsMutex == NULL) + { + sHistoryThreadsMutex = new LLMutex(NULL); + } + return sHistoryThreadsMutex; +} + // static std::string LLLogChat::oldLogFileName(std::string filename) { @@ -845,115 +945,188 @@ bool LLChatLogParser::parse(std::string& raw, LLSD& im, const LLSD& parse_params return true; //parsed name and message text, maybe have a timestamp too } +LLDeleteHistoryThread::LLDeleteHistoryThread(std::list<LLSD>* messages, LLLoadHistoryThread* loadThread) + : LLActionThread("delete chat history"), + mMessages(messages), + mLoadThread(loadThread) +{ +} +LLDeleteHistoryThread::~LLDeleteHistoryThread() +{ +} - LLLoadHistoryThread::LLLoadHistoryThread() : LLThread("load chat history") - { - mNewLoad = false; +void LLDeleteHistoryThread::run() +{ + if (mLoadThread != NULL) + { + mLoadThread->waitFinished(); } - - void LLLoadHistoryThread::run() + if (NULL != mMessages) { - while (!LLApp::isQuitting()) - { - if(mNewLoad) - { - loadHistory(mFileName,mMessages,mLoadParams); - shutdown(); - } - } + delete mMessages; } - void LLLoadHistoryThread::setHistoryParams(const std::string& file_name, const LLSD& load_params) + mMessages = NULL; + setFinished(); +} + +LLActionThread::LLActionThread(const std::string& name) + : LLThread(name), + mMutex(NULL), + mRunCondition(NULL), + mFinished(false) +{ +} + +LLActionThread::~LLActionThread() +{ +} + +void LLActionThread::waitFinished() +{ + mMutex.lock(); + if (!mFinished) { - mFileName = file_name; - mLoadParams = load_params; - mNewLoad = true; + mMutex.unlock(); + mRunCondition.wait(); } - void LLLoadHistoryThread::loadHistory(const std::string& file_name, std::list<LLSD>& messages, const LLSD& load_params) + else { + mMutex.unlock(); + } +} - if (file_name.empty()) - { - LL_WARNS("LLLogChat::loadHistory") << "Session name is Empty!" << LL_ENDL; - return ; - } +void LLActionThread::setFinished() +{ + mMutex.lock(); + mFinished = true; + mMutex.unlock(); + mRunCondition.signal(); +} - bool load_all_history = load_params.has("load_all_history") ? load_params["load_all_history"].asBoolean() : false; +LLLoadHistoryThread::LLLoadHistoryThread(const std::string& file_name, std::list<LLSD>* messages, const LLSD& load_params) + : LLActionThread("load chat history"), + mMessages(messages), + mFileName(file_name), + mLoadParams(load_params), + mNewLoad(true), + mLoadEndSignal(NULL) +{ +} - LLFILE* fptr = LLFile::fopen(LLLogChat::makeLogFileName(file_name), "r");/*Flawfinder: ignore*/ - if (!fptr) - { - fptr = LLFile::fopen(LLLogChat::oldLogFileName(file_name), "r");/*Flawfinder: ignore*/ - if (!fptr) - { - mNewLoad = false; - (*mLoadEndSignal)(messages, file_name); - return; //No previous conversation with this name. - } - } +LLLoadHistoryThread::~LLLoadHistoryThread() +{ +} - char buffer[LOG_RECALL_SIZE]; /*Flawfinder: ignore*/ - char *bptr; - S32 len; - bool firstline = TRUE; +void LLLoadHistoryThread::run() +{ + if(mNewLoad) + { + loadHistory(mFileName, mMessages, mLoadParams); + int count = mMessages->size(); + llinfos << "mMessages->size(): " << count << llendl; + setFinished(); + } +} - if (load_all_history || fseek(fptr, (LOG_RECALL_SIZE - 1) * -1 , SEEK_END)) - { //We need to load the whole historyFile or it's smaller than recall size, so get it all. - firstline = FALSE; - if (fseek(fptr, 0, SEEK_SET)) - { - fclose(fptr); - mNewLoad = false; - (*mLoadEndSignal)(messages, file_name); - return; - } - } - while (fgets(buffer, LOG_RECALL_SIZE, fptr) && !feof(fptr)) - { - len = strlen(buffer) - 1; /*Flawfinder: ignore*/ - for (bptr = (buffer + len); (*bptr == '\n' || *bptr == '\r') && bptr>buffer; bptr--) *bptr='\0'; +void LLLoadHistoryThread::loadHistory(const std::string& file_name, std::list<LLSD>* messages, const LLSD& load_params) +{ + if (file_name.empty()) + { + LL_WARNS("LLLogChat::loadHistory") << "Session name is Empty!" << LL_ENDL; + return ; + } - if (firstline) - { - firstline = FALSE; - continue; - } + bool load_all_history = load_params.has("load_all_history") ? load_params["load_all_history"].asBoolean() : false; + LLFILE* fptr = LLFile::fopen(LLLogChat::makeLogFileName(file_name), "r");/*Flawfinder: ignore*/ - std::string line(buffer); + if (!fptr) + { + fptr = LLFile::fopen(LLLogChat::oldLogFileName(file_name), "r");/*Flawfinder: ignore*/ + if (!fptr) + { + mNewLoad = false; + (*mLoadEndSignal)(messages, file_name); + return; //No previous conversation with this name. + } + } - //updated 1.23 plaint text log format requires a space added before subsequent lines in a multilined message - if (' ' == line[0]) - { - line.erase(0, MULTI_LINE_PREFIX.length()); - append_to_last_message(messages, '\n' + line); - } - else if (0 == len && ('\n' == line[0] || '\r' == line[0])) - { - //to support old format's multilined messages with new lines used to divide paragraphs - append_to_last_message(messages, line); - } - else - { - LLSD item; - if (!LLChatLogParser::parse(line, item, load_params)) - { - item[LL_IM_TEXT] = line; - } - messages.push_back(item); - } - } + char buffer[LOG_RECALL_SIZE]; /*Flawfinder: ignore*/ + + char *bptr; + S32 len; + bool firstline = TRUE; + + if (load_all_history || fseek(fptr, (LOG_RECALL_SIZE - 1) * -1 , SEEK_END)) + { //We need to load the whole historyFile or it's smaller than recall size, so get it all. + firstline = FALSE; + if (fseek(fptr, 0, SEEK_SET)) + { fclose(fptr); mNewLoad = false; (*mLoadEndSignal)(messages, file_name); + return; + } } - //static - boost::signals2::connection LLLoadHistoryThread::setLoadEndSignal(const load_end_signal_t::slot_type& cb) + + while (fgets(buffer, LOG_RECALL_SIZE, fptr) && !feof(fptr)) { - if (NULL == mLoadEndSignal) + len = strlen(buffer) - 1; /*Flawfinder: ignore*/ + + for (bptr = (buffer + len); (*bptr == '\n' || *bptr == '\r') && bptr>buffer; bptr--) *bptr='\0'; + + + if (firstline) { - mLoadEndSignal = new load_end_signal_t(); + firstline = FALSE; + continue; } + std::string line(buffer); - return mLoadEndSignal->connect(cb); + //updated 1.23 plaint text log format requires a space added before subsequent lines in a multilined message + if (' ' == line[0]) + { + line.erase(0, MULTI_LINE_PREFIX.length()); + append_to_last_message(*messages, '\n' + line); + } + else if (0 == len && ('\n' == line[0] || '\r' == line[0])) + { + //to support old format's multilined messages with new lines used to divide paragraphs + append_to_last_message(*messages, line); + } + else + { + LLSD item; + if (!LLChatLogParser::parse(line, item, load_params)) + { + item[LL_IM_TEXT] = line; + } + messages->push_back(item); + } } + + fclose(fptr); + mNewLoad = false; + (*mLoadEndSignal)(messages, file_name); +} + +boost::signals2::connection LLLoadHistoryThread::setLoadEndSignal(const load_end_signal_t::slot_type& cb) +{ + if (NULL == mLoadEndSignal) + { + mLoadEndSignal = new load_end_signal_t(); + } + + return mLoadEndSignal->connect(cb); +} + +void LLLoadHistoryThread::removeLoadEndSignal(const load_end_signal_t::slot_type& cb) +{ + if (NULL != mLoadEndSignal) + { + mLoadEndSignal->disconnect_all_slots(); + delete mLoadEndSignal; + } + mLoadEndSignal = NULL; +} diff --git a/indra/newview/lllogchat.h b/indra/newview/lllogchat.h index acee99afa2..81f75ef626 100755 --- a/indra/newview/lllogchat.h +++ b/indra/newview/lllogchat.h @@ -28,23 +28,54 @@ #define LL_LLLOGCHAT_H class LLChat; -class LLLoadHistoryThread : public LLThread + +class LLActionThread : public LLThread { +public: + LLActionThread(const std::string& name); + ~LLActionThread(); + + void waitFinished(); + bool isFinished() { return mFinished; } +protected: + void setFinished(); private: - std::string mFileName; - std::list<LLSD> mMessages; + bool mFinished; + LLMutex mMutex; + LLCondition mRunCondition; +}; + +class LLLoadHistoryThread : public LLActionThread +{ +private: + const std::string& mFileName; + std::list<LLSD>* mMessages; LLSD mLoadParams; bool mNewLoad; public: - LLLoadHistoryThread(); - - void setHistoryParams(const std::string& file_name, const LLSD& load_params); - virtual void loadHistory(const std::string& file_name, std::list<LLSD>& messages, const LLSD& load_params); + LLLoadHistoryThread(const std::string& file_name, std::list<LLSD>* messages, const LLSD& load_params); + ~LLLoadHistoryThread(); + //void setHistoryParams(const std::string& file_name, const LLSD& load_params); + virtual void loadHistory(const std::string& file_name, std::list<LLSD>* messages, const LLSD& load_params); virtual void run(); - typedef boost::signals2::signal<void (std::list<LLSD>& messages,const std::string& file_name)> load_end_signal_t; - static load_end_signal_t * mLoadEndSignal; - static boost::signals2::connection setLoadEndSignal(const load_end_signal_t::slot_type& cb); + typedef boost::signals2::signal<void (std::list<LLSD>* messages,const std::string& file_name)> load_end_signal_t; + load_end_signal_t * mLoadEndSignal; + boost::signals2::connection setLoadEndSignal(const load_end_signal_t::slot_type& cb); + void removeLoadEndSignal(const load_end_signal_t::slot_type& cb); +}; + +class LLDeleteHistoryThread : public LLActionThread +{ +private: + std::list<LLSD>* mMessages; + LLLoadHistoryThread* mLoadThread; +public: + LLDeleteHistoryThread(std::list<LLSD>* messages, LLLoadHistoryThread* loadThread); + ~LLDeleteHistoryThread(); + + virtual void run(); + static void deleteHistory(); }; class LLLogChat @@ -73,7 +104,6 @@ public: static void getListOfTranscriptBackupFiles(std::vector<std::string>& list_of_transcriptions); static void loadChatHistory(const std::string& file_name, std::list<LLSD>& messages, const LLSD& load_params = LLSD()); - static void startChatHistoryThread(const std::string& file_name, const LLSD& load_params); typedef boost::signals2::signal<void ()> save_history_signal_t; static boost::signals2::connection setSaveHistorySignal(const save_history_signal_t::slot_type& cb); @@ -90,9 +120,21 @@ public: static bool isTranscriptExist(const LLUUID& avatar_id, bool is_group=false); static bool isNearbyTranscriptExist(); + static bool historyThreadsFinished(LLUUID session_id); + static LLLoadHistoryThread* getLoadHistoryThread(LLUUID session_id); + static LLDeleteHistoryThread* getDeleteHistoryThread(LLUUID session_id); + static bool addLoadHistoryThread(LLUUID& session_id, LLLoadHistoryThread* lthread); + static bool addDeleteHistoryThread(LLUUID& session_id, LLDeleteHistoryThread* dthread); + static void cleanupHistoryThreads(); + private: static std::string cleanFileName(std::string filename); static save_history_signal_t * sSaveHistorySignal; + + static std::map<LLUUID,LLLoadHistoryThread *> sLoadHistoryThreads; + static std::map<LLUUID,LLDeleteHistoryThread *> sDeleteHistoryThreads; + static LLMutex* sHistoryThreadsMutex; + static LLMutex* historyThreadsMutex(); }; /** diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 2cb8f788d4..4dcc1950ca 100755 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -10224,4 +10224,14 @@ Cannot create large prims that intersect other players. Please re-try when othe yestext="OK"/> </notification> + <notification + icon="alert.tga" + name="ChatHistoryIsBusyAlert" + type="alertmodal"> + Chat history file is busy with previous operation. Please try again in a few minutes or choose chat with another person. + <usetemplate + name="okbutton" + yestext="OK"/> + </notification> + </notifications> -- cgit v1.2.3 From 1320e5ddcd9fc3be526dcacbf4710f8bcf878665 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Tue, 3 Dec 2013 16:35:07 -0500 Subject: SH-4640 WIP - use backlinks in inventory --- indra/newview/llinventorybridge.cpp | 3 +-- indra/newview/llinventorymodel.cpp | 40 +++++-------------------------------- indra/newview/llinventorymodel.h | 4 +--- 3 files changed, 7 insertions(+), 40 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 4bce25c8b5..fbb276efd6 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1730,8 +1730,7 @@ BOOL LLItemBridge::removeItem() { if (!item->getIsLinkType()) { - LLInventoryModel::item_array_t item_array = - gInventory.collectLinksTo(mUUID, gInventory.getRootFolderID()); + LLInventoryModel::item_array_t item_array = gInventory.collectLinksTo(mUUID); const U32 num_links = item_array.size(); if (num_links > 0) { diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 2c63203773..268cb7d8b2 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -687,8 +687,7 @@ void LLInventoryModel::addChangedMaskForLinks(const LLUUID& object_id, U32 mask) if (!obj || obj->getIsLinkType()) return; - LLInventoryModel::item_array_t item_array = - collectLinksTo(object_id,gInventory.getRootFolderID()); + LLInventoryModel::item_array_t item_array = collectLinksTo(object_id); for (LLInventoryModel::item_array_t::iterator iter = item_array.begin(); iter != item_array.end(); iter++) @@ -716,56 +715,27 @@ LLViewerInventoryItem* LLInventoryModel::getLinkedItem(const LLUUID& object_id) return object_id.notNull() ? getItem(getLinkedItemID(object_id)) : NULL; } -LLInventoryModel::item_array_t LLInventoryModel::collectLinksTo(const LLUUID& id, - const LLUUID& start_folder_id) +LLInventoryModel::item_array_t LLInventoryModel::collectLinksTo(const LLUUID& id) { // Get item list via collectDescendents (slow!) item_array_t items; const LLInventoryObject *obj = getObject(id); - // FIXME - should be as below, but this is causing a stack-smashing crash of cause TBD... check in the REBUILD code. + // FIXME - should be as in next line, but this is causing a + // stack-smashing crash of cause TBD... check in the REBUILD code. //if (obj && obj->getIsLinkType()) if (!obj || obj->getIsLinkType()) return items; - LLInventoryModel::cat_array_t cat_array; - LLLinkedItemIDMatches is_linked_item_match(id); - collectDescendentsIf((start_folder_id == LLUUID::null ? gInventory.getRootFolderID() : start_folder_id), - cat_array, - items, - LLInventoryModel::INCLUDE_TRASH, - is_linked_item_match); - - // Get via backlinks - fast. - item_array_t fast_items; std::pair<backlink_mmap_t::iterator, backlink_mmap_t::iterator> range = mBacklinkMMap.equal_range(id); for (backlink_mmap_t::iterator it = range.first; it != range.second; ++it) { LLViewerInventoryItem *item = getItem(it->second); if (item) { - fast_items.put(item); + items.put(item); } } - // Validate equivalence. - if (items.size() != fast_items.size()) - { - llwarns << "size mismatch, " << items.size() << " != " << fast_items.size() << llendl; - } - for (item_array_t::iterator ita = items.begin(); ita != items.end(); ++ita) - { - if (fast_items.find(*ita) == item_array_t::FAIL) - { - llwarns << "in descendents search but not fast search " << (*ita)->getUUID() << llendl; - } - } - for (item_array_t::iterator itb = fast_items.begin(); itb != fast_items.end(); ++itb) - { - if (items.find(*itb) == item_array_t::FAIL) - { - llwarns << "in fast search but not descendents search " << (*itb)->getUUID() << llendl; - } - } return items; } diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index 0bb89bc5d4..1e18adf8d6 100755 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -226,9 +226,7 @@ public: // Collect all items in inventory that are linked to item_id. // Assumes item_id is itself not a linked item. - item_array_t collectLinksTo(const LLUUID& item_id, - const LLUUID& start_folder_id = LLUUID::null); - + item_array_t collectLinksTo(const LLUUID& item_id); // Check if one object has a parent chain up to the category specified by UUID. BOOL isObjectDescendentOf(const LLUUID& obj_id, const LLUUID& cat_id) const; -- cgit v1.2.3 From 4724232abd2aa88cdd592be6f5aa287ed70af1aa Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Thu, 5 Dec 2013 13:24:38 -0500 Subject: SH-4611 WIP - this should prevent the case logged, which I believe is caused when cache loading fails. Can not repro so somewhat speculative. --- indra/newview/lltexturefetch.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index d9c2c7d279..12c83ce28f 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -1612,7 +1612,10 @@ bool LLTextureFetchWorker::doWork(S32 param) << llendl; } - mUrl.clear(); + if (mFTType != FTT_SERVER_BAKE) + { + mUrl.clear(); + } if (cur_size > 0) { // Use available data @@ -1639,7 +1642,7 @@ bool LLTextureFetchWorker::doWork(S32 param) // Clear the url since we're done with the fetch // Note: mUrl is used to check is fetching is required so failure to clear it will force an http fetch // next time the texture is requested, even if the data have already been fetched. - if(mWriteToCacheState != NOT_WRITE) + if(mWriteToCacheState != NOT_WRITE && mFTType != FTT_SERVER_BAKE) { // Why do we want to keep url if NOT_WRITE - is this a proxy for map tiles? mUrl.clear(); -- cgit v1.2.3 From 5bef9571599bdeff5061046902b6afb174c6a3e2 Mon Sep 17 00:00:00 2001 From: simon <none@none> Date: Fri, 6 Dec 2013 15:44:18 -0800 Subject: MAINT-3530 : Add viewer checkbox to extend parcel entry limits to a higher ceiling --- indra/newview/app_settings/keywords.ini | 1 + indra/newview/llfloaterregioninfo.cpp | 3 +++ indra/newview/llglsandbox.cpp | 3 ++- indra/newview/llviewerregion.h | 2 +- .../skins/default/xui/en/panel_region_general.xml | 27 ++++++++++++++-------- 5 files changed, 25 insertions(+), 11 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/keywords.ini b/indra/newview/app_settings/keywords.ini index ad843bca14..17c70ef1c5 100755 --- a/indra/newview/app_settings/keywords.ini +++ b/indra/newview/app_settings/keywords.ini @@ -526,6 +526,7 @@ REGION_FLAG_SANDBOX Used with llGetRegionFlags to find if a region is a sand REGION_FLAG_DISABLE_COLLISIONS Used with llGetRegionFlags to find if a region has disabled collisions REGION_FLAG_DISABLE_PHYSICS Used with llGetRegionFlags to find if a region has disabled physics REGION_FLAG_BLOCK_FLY Used with llGetRegionFlags to find if a region blocks flying +REGION_FLAG_BLOCK_FLYOVER Used with llGetRegionFlags to find if a region enforces higher altitude parcel access rules REGION_FLAG_ALLOW_DIRECT_TELEPORT Used with llGetRegionFlags to find if a region allows direct teleports REGION_FLAG_RESTRICT_PUSHOBJECT Used with llGetRegionFlags to find if a region restricts llPushObject() calls diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index d826e56e2c..98ec0d489a 100755 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -365,6 +365,7 @@ void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg) panel->getChild<LLUICtrl>("block_terraform_check")->setValue((region_flags & REGION_FLAGS_BLOCK_TERRAFORM) ? TRUE : FALSE ); panel->getChild<LLUICtrl>("block_fly_check")->setValue((region_flags & REGION_FLAGS_BLOCK_FLY) ? TRUE : FALSE ); + panel->getChild<LLUICtrl>("block_fly_over_check")->setValue((region_flags & REGION_FLAGS_BLOCK_FLYOVER) ? TRUE : FALSE ); panel->getChild<LLUICtrl>("allow_damage_check")->setValue((region_flags & REGION_FLAGS_ALLOW_DAMAGE) ? TRUE : FALSE ); panel->getChild<LLUICtrl>("restrict_pushobject")->setValue((region_flags & REGION_FLAGS_RESTRICT_PUSHOBJECT) ? TRUE : FALSE ); panel->getChild<LLUICtrl>("allow_land_resell_check")->setValue((region_flags & REGION_FLAGS_BLOCK_LAND_RESELL) ? FALSE : TRUE ); @@ -634,6 +635,7 @@ BOOL LLPanelRegionGeneralInfo::postBuild() // Enable the "Apply" button if something is changed. JC initCtrl("block_terraform_check"); initCtrl("block_fly_check"); + initCtrl("block_fly_over_check"); initCtrl("allow_damage_check"); initCtrl("allow_land_resell_check"); initCtrl("allow_parcel_changes_check"); @@ -815,6 +817,7 @@ BOOL LLPanelRegionGeneralInfo::sendUpdate() { body["block_terraform"] = getChild<LLUICtrl>("block_terraform_check")->getValue(); body["block_fly"] = getChild<LLUICtrl>("block_fly_check")->getValue(); + body["block_fly_over"] = getChild<LLUICtrl>("block_fly_over_check")->getValue(); body["allow_damage"] = getChild<LLUICtrl>("allow_damage_check")->getValue(); body["allow_land_resell"] = getChild<LLUICtrl>("allow_land_resell_check")->getValue(); body["agent_limit"] = getChild<LLUICtrl>("agent_limit_spin")->getValue(); diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp index c4c1827266..cf550e5eff 100755 --- a/indra/newview/llglsandbox.cpp +++ b/indra/newview/llglsandbox.cpp @@ -624,7 +624,8 @@ void LLViewerParcelMgr::renderCollisionSegments(U8* segments, BOOL use_pass, LLV LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE); LLGLDisable cull(GL_CULL_FACE); - if (mCollisionBanned == BA_BANNED) + if (mCollisionBanned == BA_BANNED || + regionp->getRegionFlag(REGION_FLAGS_BLOCK_FLYOVER)) { collision_height = BAN_HEIGHT; } diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index 8f8bfa23c1..a8716985cb 100755 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -115,7 +115,7 @@ public: void setAllowSetHome(BOOL b) { setRegionFlag(REGION_FLAGS_ALLOW_SET_HOME, b); } void setResetHomeOnTeleport(BOOL b) { setRegionFlag(REGION_FLAGS_RESET_HOME_ON_TELEPORT, b); } void setSunFixed(BOOL b) { setRegionFlag(REGION_FLAGS_SUN_FIXED, b); } - void setBlockFly(BOOL b) { setRegionFlag(REGION_FLAGS_BLOCK_FLY, b); } + //void setBlockFly(BOOL b) { setRegionFlag(REGION_FLAGS_BLOCK_FLY, b); } Never used void setAllowDirectTeleport(BOOL b) { setRegionFlag(REGION_FLAGS_ALLOW_DIRECT_TELEPORT, b); } diff --git a/indra/newview/skins/default/xui/en/panel_region_general.xml b/indra/newview/skins/default/xui/en/panel_region_general.xml index 44c84e69a1..489d286e67 100755 --- a/indra/newview/skins/default/xui/en/panel_region_general.xml +++ b/indra/newview/skins/default/xui/en/panel_region_general.xml @@ -93,12 +93,21 @@ top="90" width="80" /> <check_box + height="20" + label="Block Parcel Fly Over" + layout="topleft" + left="10" + name="block_fly_over_check" + tool_tip="Extend access checks upwards to prevent flying over a parcel" + top="110" + width="90" /> + <check_box height="20" label="Allow Damage" layout="topleft" left="10" name="allow_damage_check" - top="110" + top="130" width="80" /> <check_box height="20" @@ -106,7 +115,7 @@ layout="topleft" left="10" name="restrict_pushobject" - top="130" + top="150" width="80" /> <check_box height="20" @@ -114,7 +123,7 @@ layout="topleft" left="10" name="allow_land_resell_check" - top="150" + top="170" width="80" /> <check_box height="20" @@ -122,7 +131,7 @@ layout="topleft" left="10" name="allow_parcel_changes_check" - top="170" + top="190" width="80" /> <check_box height="20" @@ -131,7 +140,7 @@ left="10" name="block_parcel_search_check" tool_tip="Let people see this region and its parcels in search results" - top="190" + top="210" width="80" /> <spinner decimal_digits="0" @@ -145,7 +154,7 @@ max_val="100" min_val="1" name="agent_limit_spin" - top="240" + top="260" width="170" /> <spinner follows="left|top" @@ -158,7 +167,7 @@ max_val="10" min_val="1" name="object_bonus_spin" - top="260" + top="280" width="170" /> <text follows="left|top" @@ -167,7 +176,7 @@ layout="topleft" left="10" name="access_text" - top="290" + top="310" width="100"> Rating: </text> @@ -224,7 +233,7 @@ layout="topleft" left="108" name="apply_btn" - top="320" + top="340" width="100"/> <button follows="left|top" -- cgit v1.2.3 From 6212cd2950e334aff93ac577a68627d5801ca646 Mon Sep 17 00:00:00 2001 From: simon <none@none> Date: Fri, 6 Dec 2013 17:13:30 -0800 Subject: MAINT-3552: crash in LLPanel::getString: Failed to find string ErrorFetchingServerReleaseNotesURL in panel floater_about --- indra/newview/llfloaterabout.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp index 06a97c9214..4331a63346 100755 --- a/indra/newview/llfloaterabout.cpp +++ b/indra/newview/llfloaterabout.cpp @@ -316,7 +316,7 @@ void LLServerReleaseNotesURLFetcher::completedHeader(U32 status, const std::stri std::string location = content["location"].asString(); if (location.empty()) { - location = floater_about->getString("ErrorFetchingServerReleaseNotesURL"); + location = LLTrans::getString("ErrorFetchingServerReleaseNotesURL"); } LLAppViewer::instance()->setServerReleaseNotesURL(location); } -- cgit v1.2.3 From 813bc232e7175ba3e20a70f16427d12c7681a996 Mon Sep 17 00:00:00 2001 From: Richard Linden <none@none> Date: Mon, 9 Dec 2013 15:42:51 -0800 Subject: MAINT-3017 FIX Inventory filter for Recent tab does not persist between sessions as it used to. added names back to inventory filters, so they can be deserialized --- indra/newview/llconversationmodel.h | 3 +++ indra/newview/llfolderviewmodelinventory.h | 4 ++++ indra/newview/llinventorypanel.cpp | 3 ++- indra/newview/llpanelobjectinventory.cpp | 3 ++- 4 files changed, 11 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llconversationmodel.h b/indra/newview/llconversationmodel.h index d8cdcdfc97..dc74506c53 100644 --- a/indra/newview/llconversationmodel.h +++ b/indra/newview/llconversationmodel.h @@ -291,6 +291,9 @@ class LLConversationViewModel { public: typedef LLFolderViewModel<LLConversationSort, LLConversationItem, LLConversationItem, LLConversationFilter> base_t; + LLConversationViewModel() + : base_t(new LLConversationSort(), new LLConversationFilter()) + {} void sort(LLFolderViewFolder* folder); bool contentsReady() { return true; } // *TODO : we need to check that participants names are available somewhat diff --git a/indra/newview/llfolderviewmodelinventory.h b/indra/newview/llfolderviewmodelinventory.h index 9dcfdfa185..8772185ad0 100755 --- a/indra/newview/llfolderviewmodelinventory.h +++ b/indra/newview/llfolderviewmodelinventory.h @@ -105,6 +105,10 @@ class LLFolderViewModelInventory public: typedef LLFolderViewModel<LLInventorySort, LLFolderViewModelItemInventory, LLFolderViewModelItemInventory, LLInventoryFilter> base_t; + LLFolderViewModelInventory(const std::string& name) + : base_t(new LLInventorySort(), new LLInventoryFilter(LLInventoryFilter::Params().name(name))) + {} + void setTaskID(const LLUUID& id) {mTaskID = id;} void sort(LLFolderViewFolder* folder); diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index e5b9e11d48..d27f7d2527 100755 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -146,7 +146,8 @@ LLInventoryPanel::LLInventoryPanel(const LLInventoryPanel::Params& p) : mShowItemLinkOverlays(p.show_item_link_overlays), mShowEmptyMessage(p.show_empty_message), mViewsInitialized(false), - mInvFVBridgeBuilder(NULL) + mInvFVBridgeBuilder(NULL), + mInventoryViewModel(p.name) { mInvFVBridgeBuilder = &INVENTORY_BRIDGE_BUILDER; diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index d7130820ab..bb063f48a5 100755 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -1491,7 +1491,8 @@ LLPanelObjectInventory::LLPanelObjectInventory(const LLPanelObjectInventory::Par mFolders(NULL), mHaveInventory(FALSE), mIsInventoryEmpty(TRUE), - mInventoryNeedsUpdate(FALSE) + mInventoryNeedsUpdate(FALSE), + mInventoryViewModel(p.name) { // Setup context menu callbacks mCommitCallbackRegistrar.add("Inventory.DoToSelected", boost::bind(&LLPanelObjectInventory::doToSelected, this, _2)); -- cgit v1.2.3 From 72d2d1a975bb971fcb9c65b8e12d6f55b6c0c17d Mon Sep 17 00:00:00 2001 From: MaximB ProductEngine <mberezhnoy@productengine.com> Date: Thu, 12 Dec 2013 09:38:02 +0200 Subject: MAINT-3519 (Resident is able to share worn clothes.) --- indra/newview/llgiveinventory.cpp | 2 +- indra/newview/lltooldraganddrop.cpp | 23 +++++++++++++---------- 2 files changed, 14 insertions(+), 11 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llgiveinventory.cpp b/indra/newview/llgiveinventory.cpp index 72bea8db10..0dd84b6073 100755 --- a/indra/newview/llgiveinventory.cpp +++ b/indra/newview/llgiveinventory.cpp @@ -139,7 +139,7 @@ bool LLGiveInventory::isInventoryGiveAcceptable(const LLInventoryItem* item) BOOL copyable = false; if (item->getPermissions().allowCopyBy(gAgentID)) copyable = true; - if (!copyable && get_is_item_worn(item->getUUID())) + if (!copyable || get_is_item_worn(item->getUUID())) { acceptable = false; } diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp index 1a137f7129..7314ab60c1 100755 --- a/indra/newview/lltooldraganddrop.cpp +++ b/indra/newview/lltooldraganddrop.cpp @@ -1611,16 +1611,19 @@ static void show_item_sharing_confirmation(const std::string name, llassert(NULL != inv_item); return; } - - LLSD substitutions; - substitutions["RESIDENTS"] = name; - substitutions["ITEMS"] = inv_item->getName(); - LLSD payload; - payload["agent_id"] = dest_agent; - payload["item_id"] = inv_item->getUUID(); - payload["session_id"] = session_id; - payload["d&d_dest"] = dest.asString(); - LLNotificationsUtil::add("ShareItemsConfirmation", substitutions, payload, &give_inventory_cb); + if(gInventory.getItem(inv_item->getUUID()) + && LLGiveInventory::isInventoryGiveAcceptable(inv_item)) + { + LLSD substitutions; + substitutions["RESIDENTS"] = name; + substitutions["ITEMS"] = inv_item->getName(); + LLSD payload; + payload["agent_id"] = dest_agent; + payload["item_id"] = inv_item->getUUID(); + payload["session_id"] = session_id; + payload["d&d_dest"] = dest.asString(); + LLNotificationsUtil::add("ShareItemsConfirmation", substitutions, payload, &give_inventory_cb); + } } static void get_name_cb(const LLUUID& id, -- cgit v1.2.3 From 99de75c225b5c74478e7a1b5a761924ef2e51f66 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine <mnikolenko@productengine.com> Date: Fri, 13 Dec 2013 16:48:28 +0200 Subject: MAINT-3522 FIXED Continue loop after adding Nearby chat history to the list. --- indra/newview/lllogchat.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp index 09eb40d830..d0ecf80706 100755 --- a/indra/newview/lllogchat.cpp +++ b/indra/newview/lllogchat.cpp @@ -575,7 +575,7 @@ void LLLogChat::findTranscriptFiles(std::string pattern, std::vector<std::string //Add Nearby chat history to the list of transcriptions list_of_transcriptions.push_back(gDirUtilp->add(dirname, filename)); LLFile::close(filep); - return; + continue; } char buffer[LOG_RECALL_SIZE]; -- cgit v1.2.3 From ddd6b8f91baa4ce408682925e12c4a58b8139b78 Mon Sep 17 00:00:00 2001 From: Aura Linden <aura@lindenlab.com> Date: Tue, 17 Dec 2013 00:12:26 -0800 Subject: Mac Fullscreen fix for MAINT-3288 and MAINT-3135 --- indra/newview/llappviewer.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index e3c89f1a5f..b7a8194b4d 100755 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -3190,6 +3190,13 @@ bool LLAppViewer::initWindow() LLNotificationsUI::LLNotificationManager::getInstance(); + +#ifdef LL_DARWIN + //Satisfy both MAINT-3135 (OSX 10.6 and earlier) MAINT-3288 (OSX 10.7 and later) + if (getOSInfo().mMajorVer == 10 && getOSInfo().mMinorVer < 7) + gViewerWindow->getWindow()->setOldResize(true); +#endif + if (gSavedSettings.getBOOL("WindowMaximized")) { gViewerWindow->getWindow()->maximize(); -- cgit v1.2.3 From cc9a7a70b1971def1c53c70c96e8ce88fc5a7b86 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Tue, 17 Dec 2013 14:14:03 -0500 Subject: merge fix --- indra/newview/llinventorybridge.cpp | 2 +- indra/newview/lltexturefetch.cpp | 2 +- indra/newview/llviewerregion.cpp | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 32164f3a72..1a98f293d1 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2970,7 +2970,7 @@ LLUIImagePtr LLFolderBridge::getIconOverlay() const std::string LLFolderBridge::getLabelSuffix() const { - static LLCachedControl<F32> folder_loading_message_delay(gSavedSettings, "FolderLoadingMessageWaitTime", 0.5); + static LLCachedControl<F32> folder_loading_message_delay(gSavedSettings, "FolderLoadingMessageWaitTime", 0.5f); return mIsLoading && mTimeSinceRequestStart.getElapsedTimeF32() >= folder_loading_message_delay() ? llformat(" ( %s ) ", LLTrans::getString("LoadingData").c_str()) : LLStringUtil::null; diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 12c83ce28f..d0ab9f55ff 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -1949,7 +1949,7 @@ void LLTextureFetchWorker::onCompleted(LLCore::HttpHandle handle, LLCore::HttpRe mFetcher->mTextureInfo.setRequestCompleteTimeAndLog(mID, timeNow); } - static LLCachedControl<F32> fake_failure_rate(gSavedSettings, "TextureFetchFakeFailureRate", 0.0); + static LLCachedControl<F32> fake_failure_rate(gSavedSettings, "TextureFetchFakeFailureRate", 0.0f); F32 rand_val = ll_frand(); F32 rate = fake_failure_rate; if (mFTType == FTT_SERVER_BAKE && (fake_failure_rate > 0.0) && (rand_val < fake_failure_rate)) diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index fa7af4f48e..e6cc75f1ce 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -1673,6 +1673,7 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames) capabilityNames.append("ProductInfoRequest"); capabilityNames.append("ProvisionVoiceAccountRequest"); capabilityNames.append("RemoteParcelRequest"); + capabilityNames.append("RenderMaterials"); capabilityNames.append("RequestTextureDownload"); capabilityNames.append("ResourceCostSelected"); capabilityNames.append("RetrieveNavMeshSrc"); -- cgit v1.2.3 From f6947e9ce5a5225c30dd347ee2e16392411c6d2f Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Thu, 19 Dec 2013 15:39:21 -0500 Subject: SH-4664 WIP - updated from from UpdateCreateInventoryItem to inventory observers. --- indra/newview/llinventorymodel.cpp | 11 +++++++---- indra/newview/llinventorymodel.h | 2 +- indra/newview/llinventoryobserver.cpp | 22 ++++++++++++++++++++-- indra/newview/llinventoryobserver.h | 2 ++ indra/newview/lllocationinputctrl.cpp | 6 +++++- 5 files changed, 35 insertions(+), 8 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 268cb7d8b2..1699088b99 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1514,7 +1514,7 @@ void LLInventoryModel::fetchInventoryResponder::httpSuccess() LLPointer<LLViewerInventoryItem> titem = new LLViewerInventoryItem; titem->unpackMessage(content["items"][i]); - lldebugs << "LLInventoryModel::messageUpdateCore() item id:" + lldebugs << "LLInventoryModel::fetchInventoryResponder item id: " << titem->getUUID() << llendl; items.push_back(titem); // examine update for changes. @@ -2617,7 +2617,7 @@ void LLInventoryModel::registerCallbacks(LLMessageSystem* msg) void LLInventoryModel::processUpdateCreateInventoryItem(LLMessageSystem* msg, void**) { // do accounting and highlight new items if they arrive - if (gInventory.messageUpdateCore(msg, true)) + if (gInventory.messageUpdateCore(msg, true, LLInventoryObserver::UPDATE_CREATE)) { U32 callback_id; LLUUID item_id; @@ -2637,7 +2637,7 @@ void LLInventoryModel::processFetchInventoryReply(LLMessageSystem* msg, void**) } -bool LLInventoryModel::messageUpdateCore(LLMessageSystem* msg, bool account) +bool LLInventoryModel::messageUpdateCore(LLMessageSystem* msg, bool account, U32 mask) { //make sure our added inventory observer is active start_new_inventory_observer(); @@ -2691,7 +2691,10 @@ bool LLInventoryModel::messageUpdateCore(LLMessageSystem* msg, bool account) } U32 changes = 0x0; - U32 mask = account ? LLInventoryObserver::CREATE : 0x0; + if (account) + { + mask |= LLInventoryObserver::CREATE; + } //as above, this loop never seems to loop more than once per call for (item_array_t::iterator it = items.begin(); it != items.end(); ++it) { diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index 1e18adf8d6..41ab895e84 100755 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -556,7 +556,7 @@ public: static void processMoveInventoryItem(LLMessageSystem* msg, void**); static void processFetchInventoryReply(LLMessageSystem* msg, void**); protected: - bool messageUpdateCore(LLMessageSystem* msg, bool do_accounting); + bool messageUpdateCore(LLMessageSystem* msg, bool do_accounting, U32 mask = 0x0); //-------------------------------------------------------------------- // Locks diff --git a/indra/newview/llinventoryobserver.cpp b/indra/newview/llinventoryobserver.cpp index f71cf26b30..996decde8c 100755 --- a/indra/newview/llinventoryobserver.cpp +++ b/indra/newview/llinventoryobserver.cpp @@ -465,9 +465,13 @@ void LLInventoryFetchComboObserver::startFetch() mFetchDescendents->startFetch(); } +// See comment preceding LLInventoryAddedObserver::changed() for some +// concerns that also apply to this observer. void LLInventoryAddItemByAssetObserver::changed(U32 mask) { - if(!(mask & LLInventoryObserver::ADD) || !(mask & LLInventoryObserver::CREATE)) + if(!(mask & LLInventoryObserver::ADD) || + !(mask & LLInventoryObserver::CREATE) || + !(mask & LLInventoryObserver::UPDATE_CREATE)) { return; } @@ -526,9 +530,23 @@ bool LLInventoryAddItemByAssetObserver::isAssetWatched( const LLUUID& asset_id ) return std::find(mWatchedAssets.begin(), mWatchedAssets.end(), asset_id) != mWatchedAssets.end(); } +// This observer used to explicitly check for whether it was being +// called as a result of an UpdateCreateInventoryItem message. It has +// now been decoupled enough that it's not actually checking the +// message system, but now we have the special UPDATE_CREATE flag +// being used for the same purpose. Fixing this, as we would need to +// do to get rid of the message, is somewhat subtle because there's no +// particular obvious criterion for when creating a new item should +// trigger this observer and when it shouldn't. For example, creating +// a new notecard with new->notecard causes a preview window to pop up +// via the derived class LLOpenTaskOffer, but creating a new notecard +// by copy and paste does not, solely because one goes through +// UpdateCreateInventoryItem and the other doesn't. void LLInventoryAddedObserver::changed(U32 mask) { - if (!(mask & LLInventoryObserver::ADD) || !(mask & LLInventoryObserver::CREATE)) + if (!(mask & LLInventoryObserver::ADD) || + !(mask & LLInventoryObserver::CREATE) || + !(mask & LLInventoryObserver::UPDATE_CREATE)) { return; } diff --git a/indra/newview/llinventoryobserver.h b/indra/newview/llinventoryobserver.h index 2436930ef6..8cf6a6bdab 100755 --- a/indra/newview/llinventoryobserver.h +++ b/indra/newview/llinventoryobserver.h @@ -59,6 +59,8 @@ public: REBUILD = 128, // Item UI changed (e.g. item type different) SORT = 256, // Folder needs to be resorted. CREATE = 512, // With ADD, item has just been created. + // unfortunately a particular message is still associated with some unique semantics. + UPDATE_CREATE = 1024, // With ADD, item added via UpdateCreateInventoryItem ALL = 0xffffffff }; LLInventoryObserver(); diff --git a/indra/newview/lllocationinputctrl.cpp b/indra/newview/lllocationinputctrl.cpp index 7b97b26a37..dcfe3cc9a7 100755 --- a/indra/newview/lllocationinputctrl.cpp +++ b/indra/newview/lllocationinputctrl.cpp @@ -140,7 +140,11 @@ public: private: /*virtual*/ void changed(U32 mask) { - if (mask & (~(LLInventoryObserver::LABEL|LLInventoryObserver::INTERNAL|LLInventoryObserver::ADD|LLInventoryObserver::CREATE))) + if (mask & (~(LLInventoryObserver::LABEL| + LLInventoryObserver::INTERNAL| + LLInventoryObserver::ADD| + LLInventoryObserver::CREATE| + LLInventoryObserver::UPDATE_CREATE))) { mInput->updateAddLandmarkButton(); } -- cgit v1.2.3 From 9af766f582953587ebbfe309eb8d0e6ed0b93493 Mon Sep 17 00:00:00 2001 From: maksymsproductengine <maksymsproductengine@lindenlab.com> Date: Sat, 21 Dec 2013 00:15:08 +0200 Subject: MAINT-3587 FIXED settings.xml still references avatarsunited.com for snapshot upload --- indra/newview/CMakeLists.txt | 2 - indra/newview/app_settings/settings.xml | 22 -- indra/newview/llfloatersnapshot.cpp | 11 - indra/newview/llsnapshotlivepreview.cpp | 28 -- indra/newview/llsnapshotlivepreview.h | 4 - indra/newview/llviewermedia.cpp | 4 - indra/newview/llwebsharing.cpp | 603 -------------------------------- indra/newview/llwebsharing.h | 224 ------------ 8 files changed, 898 deletions(-) delete mode 100755 indra/newview/llwebsharing.cpp delete mode 100755 indra/newview/llwebsharing.h (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index c5e1cde4e6..e044524131 100755 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -659,7 +659,6 @@ set(viewer_SOURCE_FILES llwearablelist.cpp llweb.cpp llwebprofile.cpp - llwebsharing.cpp llwind.cpp llwindowlistener.cpp llwlanimator.cpp @@ -1238,7 +1237,6 @@ set(viewer_HEADER_FILES llwearablelist.h llweb.h llwebprofile.h - llwebsharing.h llwind.h llwindowlistener.h llwlanimator.h diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index fe6622f1e3..a220e810c4 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -11301,28 +11301,6 @@ <key>Value</key> <integer>75</integer> </map> - <key>SnapshotSharingEnabled</key> - <map> - <key>Comment</key> - <string>Enable uploading of snapshots to a web service.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>SnapshotConfigURL</key> - <map> - <key>Comment</key> - <string>URL to fetch Snapshot Sharing configuration data from.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>String</string> - <key>Value</key> - <string>http://photos.apps.staging.avatarsunited.com/viewer_config</string> - </map> <key>SpeedTest</key> <map> <key>Comment</key> diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index ea385d7baf..a416765157 100755 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -44,7 +44,6 @@ #include "lltoolfocus.h" #include "lltoolmgr.h" #include "llwebprofile.h" -#include "llwebsharing.h" ///---------------------------------------------------------------------------- /// Local function declarations, constants, enums, and typedefs @@ -360,10 +359,6 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater) ESnapshotFormat shot_format = (ESnapshotFormat)gSavedSettings.getS32("SnapshotFormat"); LLViewerWindow::ESnapshotType layer_type = getLayerType(floater); -#if 0 - floater->getChildView("share_to_web")->setVisible( gSavedSettings.getBOOL("SnapshotSharingEnabled")); -#endif - floater->getChild<LLComboBox>("local_format_combo")->selectNthItem(gSavedSettings.getS32("SnapshotFormat")); enableAspectRatioCheckbox(floater, !floater->impl.mAspectRatioCheckOff); setAspectRatioCheckboxValue(floater, gSavedSettings.getBOOL("KeepAspectForSnapshot")); @@ -1032,12 +1027,6 @@ LLFloaterSnapshot::~LLFloaterSnapshot() BOOL LLFloaterSnapshot::postBuild() { - // Kick start Web Sharing, to fetch its config data if it needs to. - if (gSavedSettings.getBOOL("SnapshotSharingEnabled")) - { - LLWebSharing::instance().init(); - } - mRefreshBtn = getChild<LLUICtrl>("new_snapshot_btn"); childSetAction("new_snapshot_btn", Impl::onClickNewSnapshot, this); mRefreshLabel = getChild<LLUICtrl>("refresh_lbl"); diff --git a/indra/newview/llsnapshotlivepreview.cpp b/indra/newview/llsnapshotlivepreview.cpp index 7532ebfc57..ea8225a3ac 100644 --- a/indra/newview/llsnapshotlivepreview.cpp +++ b/indra/newview/llsnapshotlivepreview.cpp @@ -50,7 +50,6 @@ #include "llviewerstats.h" #include "llvfile.h" #include "llvfs.h" -#include "llwebsharing.h" #include "llwindow.h" #include "llworld.h" @@ -845,30 +844,3 @@ BOOL LLSnapshotLivePreview::saveLocal() } return success; } - -void LLSnapshotLivePreview::saveWeb() -{ - // *FIX: Will break if the window closes because of CloseSnapshotOnKeep! - // Needs to pass on ownership of the image. - LLImageJPEG* jpg = dynamic_cast<LLImageJPEG*>(mFormattedImage.get()); - if(!jpg) - { - llwarns << "Formatted image not a JPEG" << llendl; - return; - } - - LLSD metadata; - metadata["description"] = getChild<LLLineEditor>("description")->getText(); - - LLLandmarkActions::getRegionNameAndCoordsFromPosGlobal(gAgentCamera.getCameraPositionGlobal(), - boost::bind(&LLSnapshotLivePreview::regionNameCallback, this, jpg, metadata, _1, _2, _3, _4)); - - gViewerWindow->playSnapshotAnimAndSound(); -} - -void LLSnapshotLivePreview::regionNameCallback(LLImageJPEG* snapshot, LLSD& metadata, const std::string& name, S32 x, S32 y, S32 z) -{ - metadata["slurl"] = LLSLURL(name, LLVector3d(x, y, z)).getSLURLString(); - - LLWebSharing::instance().shareSnapshot(snapshot, metadata); -} diff --git a/indra/newview/llsnapshotlivepreview.h b/indra/newview/llsnapshotlivepreview.h index fe3d257b02..0f09ef214a 100644 --- a/indra/newview/llsnapshotlivepreview.h +++ b/indra/newview/llsnapshotlivepreview.h @@ -96,7 +96,6 @@ public: void setSnapshotQuality(S32 quality); void setSnapshotBufferType(LLViewerWindow::ESnapshotType type) { mSnapshotBufferType = type; } void updateSnapshot(BOOL new_snapshot, BOOL new_thumbnail = FALSE, F32 delay = 0.f); - void saveWeb(); void saveTexture(); BOOL saveLocal(); @@ -113,9 +112,6 @@ public: // Returns TRUE when snapshot generated, FALSE otherwise. static BOOL onIdle( void* snapshot_preview ); - // callback for region name resolve - void regionNameCallback(LLImageJPEG* snapshot, LLSD& metadata, const std::string& name, S32 x, S32 y, S32 z); - private: LLColor4 mColor; LLPointer<LLViewerTexture> mViewerImage[2]; //used to represent the scene when the frame is frozen. diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 21fb8d519b..2c132740fe 100755 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -67,7 +67,6 @@ #include "llvoavatarself.h" #include "llvovolume.h" #include "llwebprofile.h" -#include "llwebsharing.h" // For LLWebSharing::setOpenIDCookie(), *TODO: find a better way to do this! #include "llwindow.h" #include "llvieweraudio.h" @@ -1426,9 +1425,6 @@ void LLViewerMedia::setOpenIDCookie() getCookieStore()->setCookiesFromHost(sOpenIDCookie, authority.substr(host_start, host_end - host_start)); - // *HACK: Doing this here is nasty, find a better way. - LLWebSharing::instance().setOpenIDCookie(sOpenIDCookie); - // Do a web profile get so we can store the cookie LLSD headers = LLSD::emptyMap(); headers["Accept"] = "*/*"; diff --git a/indra/newview/llwebsharing.cpp b/indra/newview/llwebsharing.cpp deleted file mode 100755 index 3a80051b9b..0000000000 --- a/indra/newview/llwebsharing.cpp +++ /dev/null @@ -1,603 +0,0 @@ -/** - * @file llwebsharing.cpp - * @author Aimee - * @brief Web Snapshot Sharing - * - * $LicenseInfo:firstyear=2010&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#include "llviewerprecompiledheaders.h" - -#include "llwebsharing.h" - -#include "llagentui.h" -#include "llbufferstream.h" -#include "llhttpclient.h" -#include "llhttpstatuscodes.h" -#include "llsdserialize.h" -#include "llsdutil.h" -#include "llurl.h" -#include "llviewercontrol.h" - -#include <boost/regex.hpp> -#include <boost/algorithm/string/replace.hpp> - - - -/////////////////////////////////////////////////////////////////////////////// -// -class LLWebSharingConfigResponder : public LLHTTPClient::Responder -{ - LOG_CLASS(LLWebSharingConfigResponder); -public: - /// Overrides the default LLSD parsing behaviour, to allow parsing a JSON response. - virtual void completedRaw(U32 status, const std::string& reason, - const LLChannelDescriptors& channels, - const LLIOPipe::buffer_ptr_t& buffer) - { - LLSD content; - LLBufferStream istr(channels, buffer.get()); - LLPointer<LLSDParser> parser = new LLSDNotationParser(); - - if (parser->parse(istr, content, LLSDSerialize::SIZE_UNLIMITED) == LLSDParser::PARSE_FAILURE) - { - LL_WARNS("WebSharing") << "Failed to deserialize LLSD from JSON response. " << " [" << status << "]: " << reason << LL_ENDL; - } - else - { - completed(status, reason, content); - } - } - - virtual void errorWithContent(U32 status, const std::string& reason, const LLSD& content) - { - LL_WARNS("WebSharing") << "Error [status:" << status << "]: " << content << LL_ENDL; - } - - virtual void result(const LLSD& content) - { - LLWebSharing::instance().receiveConfig(content); - } -}; - - - -/////////////////////////////////////////////////////////////////////////////// -// -class LLWebSharingOpenIDAuthResponder : public LLHTTPClient::Responder -{ - LOG_CLASS(LLWebSharingOpenIDAuthResponder); -public: - /* virtual */ void completedHeader(U32 status, const std::string& reason, const LLSD& content) - { - completed(status, reason, content); - } - - /* virtual */ void completedRaw(U32 status, const std::string& reason, - const LLChannelDescriptors& channels, - const LLIOPipe::buffer_ptr_t& buffer) - { - /// Left empty to override the default LLSD parsing behaviour. - } - - virtual void errorWithContent(U32 status, const std::string& reason, const LLSD& content) - { - if (HTTP_UNAUTHORIZED == status) - { - LL_WARNS("WebSharing") << "AU account not authenticated." << LL_ENDL; - // *TODO: No account found on AU, so start the account creation process here. - } - else - { - LL_WARNS("WebSharing") << "Error [status:" << status << "]: " << content << LL_ENDL; - LLWebSharing::instance().retryOpenIDAuth(); - } - - } - - virtual void result(const LLSD& content) - { - if (content.has("set-cookie")) - { - // OpenID request succeeded and returned a session cookie. - LLWebSharing::instance().receiveSessionCookie(content["set-cookie"].asString()); - } - } -}; - - - -/////////////////////////////////////////////////////////////////////////////// -// -class LLWebSharingSecurityTokenResponder : public LLHTTPClient::Responder -{ - LOG_CLASS(LLWebSharingSecurityTokenResponder); -public: - /// Overrides the default LLSD parsing behaviour, to allow parsing a JSON response. - virtual void completedRaw(U32 status, const std::string& reason, - const LLChannelDescriptors& channels, - const LLIOPipe::buffer_ptr_t& buffer) - { - LLSD content; - LLBufferStream istr(channels, buffer.get()); - LLPointer<LLSDParser> parser = new LLSDNotationParser(); - - if (parser->parse(istr, content, LLSDSerialize::SIZE_UNLIMITED) == LLSDParser::PARSE_FAILURE) - { - LL_WARNS("WebSharing") << "Failed to deserialize LLSD from JSON response. " << " [" << status << "]: " << reason << LL_ENDL; - LLWebSharing::instance().retryOpenIDAuth(); - } - else - { - completed(status, reason, content); - } - } - - virtual void errorWithContent(U32 status, const std::string& reason, const LLSD& content) - { - LL_WARNS("WebSharing") << "Error [status:" << status << "]: " << content << LL_ENDL; - LLWebSharing::instance().retryOpenIDAuth(); - } - - virtual void result(const LLSD& content) - { - if (content[0].has("st") && content[0].has("expires")) - { - const std::string& token = content[0]["st"].asString(); - const std::string& expires = content[0]["expires"].asString(); - if (LLWebSharing::instance().receiveSecurityToken(token, expires)) - { - // Sucessfully received a valid security token. - return; - } - } - else - { - LL_WARNS("WebSharing") << "No security token received." << LL_ENDL; - } - - LLWebSharing::instance().retryOpenIDAuth(); - } -}; - - - -/////////////////////////////////////////////////////////////////////////////// -// -class LLWebSharingUploadResponder : public LLHTTPClient::Responder -{ - LOG_CLASS(LLWebSharingUploadResponder); -public: - /// Overrides the default LLSD parsing behaviour, to allow parsing a JSON response. - virtual void completedRaw(U32 status, const std::string& reason, - const LLChannelDescriptors& channels, - const LLIOPipe::buffer_ptr_t& buffer) - { -/* - // Dump the body, for debugging. - - LLBufferStream istr1(channels, buffer.get()); - std::ostringstream ostr; - std::string body; - - while (istr1.good()) - { - char buf[1024]; - istr1.read(buf, sizeof(buf)); - body.append(buf, istr1.gcount()); - } - LL_DEBUGS("WebSharing") << body << LL_ENDL; -*/ - LLSD content; - LLBufferStream istr(channels, buffer.get()); - LLPointer<LLSDParser> parser = new LLSDNotationParser(); - - if (parser->parse(istr, content, LLSDSerialize::SIZE_UNLIMITED) == LLSDParser::PARSE_FAILURE) - { - LL_WARNS("WebSharing") << "Failed to deserialize LLSD from JSON response. " << " [" << status << "]: " << reason << LL_ENDL; - } - else - { - completed(status, reason, content); - } - } - - virtual void errorWithContent(U32 status, const std::string& reason, const LLSD& content) - { - LL_WARNS("WebSharing") << "Error [status:" << status << "]: " << content << LL_ENDL; - } - - virtual void result(const LLSD& content) - { - if (content[0].has("result") && content[0].has("id") && - content[0]["id"].asString() == "newMediaItem") - { - // *TODO: Upload successful, continue from here to post metadata and create AU activity. - } - else - { - LL_WARNS("WebSharing") << "Error [" << content[0]["code"].asString() - << "]: " << content[0]["message"].asString() << LL_ENDL; - } - } -}; - - - -/////////////////////////////////////////////////////////////////////////////// -// -LLWebSharing::LLWebSharing() -: mConfig(), - mSecurityToken(LLSD::emptyMap()), - mEnabled(false), - mRetries(0), - mImage(NULL), - mMetadata(LLSD::emptyMap()) -{ -} - -void LLWebSharing::init() -{ - if (!mEnabled) - { - sendConfigRequest(); - } -} - -bool LLWebSharing::shareSnapshot(LLImageJPEG* snapshot, LLSD& metadata) -{ - LL_INFOS("WebSharing") << metadata << LL_ENDL; - - if (mImage) - { - // *TODO: Handle this possibility properly, queue them up? - LL_WARNS("WebSharing") << "Snapshot upload already in progress." << LL_ENDL; - return false; - } - - mImage = snapshot; - mMetadata = metadata; - - // *TODO: Check whether we have a valid security token already and re-use it. - sendOpenIDAuthRequest(); - return true; -} - -bool LLWebSharing::setOpenIDCookie(const std::string& cookie) -{ - LL_DEBUGS("WebSharing") << "Setting OpenID cookie " << cookie << LL_ENDL; - mOpenIDCookie = cookie; - return validateConfig(); -} - -bool LLWebSharing::receiveConfig(const LLSD& config) -{ - LL_DEBUGS("WebSharing") << "Received config data: " << config << LL_ENDL; - mConfig = config; - return validateConfig(); -} - -bool LLWebSharing::receiveSessionCookie(const std::string& cookie) -{ - LL_DEBUGS("WebSharing") << "Received AU session cookie: " << cookie << LL_ENDL; - mSessionCookie = cookie; - - // Fetch a security token using the new session cookie. - LLWebSharing::instance().sendSecurityTokenRequest(); - - return (!mSessionCookie.empty()); -} - -bool LLWebSharing::receiveSecurityToken(const std::string& token, const std::string& expires) -{ - mSecurityToken["st"] = token; - mSecurityToken["expires"] = LLDate(expires); - - if (!securityTokenIsValid(mSecurityToken)) - { - LL_WARNS("WebSharing") << "Invalid security token received: \"" << token << "\" Expires: " << expires << LL_ENDL; - return false; - } - - LL_DEBUGS("WebSharing") << "Received security token: \"" << token << "\" Expires: " << expires << LL_ENDL; - mRetries = 0; - - // Continue the upload process now that we have a security token. - sendUploadRequest(); - - return true; -} - -void LLWebSharing::sendConfigRequest() -{ - std::string config_url = gSavedSettings.getString("SnapshotConfigURL"); - LL_DEBUGS("WebSharing") << "Requesting Snapshot Sharing config data from: " << config_url << LL_ENDL; - - LLSD headers = LLSD::emptyMap(); - headers["Accept"] = "application/json"; - - LLHTTPClient::get(config_url, new LLWebSharingConfigResponder(), headers); -} - -void LLWebSharing::sendOpenIDAuthRequest() -{ - std::string auth_url = mConfig["openIdAuthUrl"]; - LL_DEBUGS("WebSharing") << "Starting OpenID Auth: " << auth_url << LL_ENDL; - - LLSD headers = LLSD::emptyMap(); - headers["Cookie"] = mOpenIDCookie; - headers["Accept"] = "*/*"; - - // Send request, successful login will trigger fetching a security token. - LLHTTPClient::get(auth_url, new LLWebSharingOpenIDAuthResponder(), headers); -} - -bool LLWebSharing::retryOpenIDAuth() -{ - if (mRetries++ >= MAX_AUTH_RETRIES) - { - LL_WARNS("WebSharing") << "Exceeded maximum number of authorization attempts, aborting." << LL_ENDL; - mRetries = 0; - return false; - } - - LL_WARNS("WebSharing") << "Authorization failed, retrying (" << mRetries << "/" << MAX_AUTH_RETRIES << ")" << LL_ENDL; - sendOpenIDAuthRequest(); - return true; -} - -void LLWebSharing::sendSecurityTokenRequest() -{ - std::string token_url = mConfig["securityTokenUrl"]; - LL_DEBUGS("WebSharing") << "Fetching security token from: " << token_url << LL_ENDL; - - LLSD headers = LLSD::emptyMap(); - headers["Cookie"] = mSessionCookie; - - headers["Accept"] = "application/json"; - headers["Content-Type"] = "application/json"; - - std::ostringstream body; - body << "{ \"gadgets\": [{ \"url\":\"" - << mConfig["gadgetSpecUrl"].asString() - << "\" }] }"; - - // postRaw() takes ownership of the buffer and releases it later. - size_t size = body.str().size(); - U8 *data = new U8[size]; - memcpy(data, body.str().data(), size); - - // Send request, receiving a valid token will trigger snapshot upload. - LLHTTPClient::postRaw(token_url, data, size, new LLWebSharingSecurityTokenResponder(), headers); -} - -void LLWebSharing::sendUploadRequest() -{ - LLUriTemplate upload_template(mConfig["openSocialRpcUrlTemplate"].asString()); - std::string upload_url(upload_template.buildURI(mSecurityToken)); - - LL_DEBUGS("WebSharing") << "Posting upload to: " << upload_url << LL_ENDL; - - static const std::string BOUNDARY("------------abcdef012345xyZ"); - - LLSD headers = LLSD::emptyMap(); - headers["Cookie"] = mSessionCookie; - - headers["Accept"] = "application/json"; - headers["Content-Type"] = "multipart/form-data; boundary=" + BOUNDARY; - - std::ostringstream body; - body << "--" << BOUNDARY << "\r\n" - << "Content-Disposition: form-data; name=\"request\"\r\n\r\n" - << "[{" - << "\"method\":\"mediaItems.create\"," - << "\"params\": {" - << "\"userId\":[\"@me\"]," - << "\"groupId\":\"@self\"," - << "\"mediaItem\": {" - << "\"mimeType\":\"image/jpeg\"," - << "\"type\":\"image\"," - << "\"url\":\"@field:image1\"" - << "}" - << "}," - << "\"id\":\"newMediaItem\"" - << "}]" - << "--" << BOUNDARY << "\r\n" - << "Content-Disposition: form-data; name=\"image1\"\r\n\r\n"; - - // Insert the image data. - // *FIX: Treating this as a string will probably screw it up ... - U8* image_data = mImage->getData(); - for (S32 i = 0; i < mImage->getDataSize(); ++i) - { - body << image_data[i]; - } - - body << "\r\n--" << BOUNDARY << "--\r\n"; - - // postRaw() takes ownership of the buffer and releases it later. - size_t size = body.str().size(); - U8 *data = new U8[size]; - memcpy(data, body.str().data(), size); - - // Send request, successful upload will trigger posting metadata. - LLHTTPClient::postRaw(upload_url, data, size, new LLWebSharingUploadResponder(), headers); -} - -bool LLWebSharing::validateConfig() -{ - // Check the OpenID Cookie has been set. - if (mOpenIDCookie.empty()) - { - mEnabled = false; - return mEnabled; - } - - if (!mConfig.isMap()) - { - mEnabled = false; - return mEnabled; - } - - // Template to match the received config against. - LLSD required(LLSD::emptyMap()); - required["gadgetSpecUrl"] = ""; - required["loginTokenUrl"] = ""; - required["openIdAuthUrl"] = ""; - required["photoPageUrlTemplate"] = ""; - required["openSocialRpcUrlTemplate"] = ""; - required["securityTokenUrl"] = ""; - required["tokenBasedLoginUrlTemplate"] = ""; - required["viewerIdUrl"] = ""; - - std::string mismatch(llsd_matches(required, mConfig)); - if (!mismatch.empty()) - { - LL_WARNS("WebSharing") << "Malformed config data response: " << mismatch << LL_ENDL; - mEnabled = false; - return mEnabled; - } - - mEnabled = true; - return mEnabled; -} - -// static -bool LLWebSharing::securityTokenIsValid(LLSD& token) -{ - return (token.has("st") && - token.has("expires") && - (token["st"].asString() != "") && - (token["expires"].asDate() > LLDate::now())); -} - - - -/////////////////////////////////////////////////////////////////////////////// -// -LLUriTemplate::LLUriTemplate(const std::string& uri_template) - : - mTemplate(uri_template) -{ -} - -std::string LLUriTemplate::buildURI(const LLSD& vars) -{ - // *TODO: Separate parsing the template from building the URI. - // Parsing only needs to happen on construction/assignnment. - - static const std::string VAR_NAME_REGEX("[[:alpha:]][[:alnum:]\\._-]*"); - // Capture var name with and without surrounding {} - static const std::string VAR_REGEX("\\{(" + VAR_NAME_REGEX + ")\\}"); - // Capture delimiter and comma separated list of var names. - static const std::string JOIN_REGEX("\\{-join\\|(&)\\|(" + VAR_NAME_REGEX + "(?:," + VAR_NAME_REGEX + ")*)\\}"); - - std::string uri = mTemplate; - boost::smatch results; - - // Validate and expand join operators : {-join|&|var1,var2,...} - - boost::regex join_regex(JOIN_REGEX); - - while (boost::regex_search(uri, results, join_regex)) - { - // Extract the list of var names from the results. - std::string delim = results[1].str(); - std::string var_list = results[2].str(); - - // Expand the list of vars into a query string with their values - std::string query = expandJoin(delim, var_list, vars); - - // Substitute the query string into the template. - uri = boost::regex_replace(uri, join_regex, query, boost::format_first_only); - } - - // Expand vars : {var1} - - boost::regex var_regex(VAR_REGEX); - - std::set<std::string> var_names; - std::string::const_iterator start = uri.begin(); - std::string::const_iterator end = uri.end(); - - // Extract the var names used. - while (boost::regex_search(start, end, results, var_regex)) - { - var_names.insert(results[1].str()); - start = results[0].second; - } - - // Replace each var with its value. - for (std::set<std::string>::const_iterator it = var_names.begin(); it != var_names.end(); ++it) - { - std::string var = *it; - if (vars.has(var)) - { - boost::replace_all(uri, "{" + var + "}", vars[var].asString()); - } - } - - return uri; -} - -std::string LLUriTemplate::expandJoin(const std::string& delim, const std::string& var_list, const LLSD& vars) -{ - std::ostringstream query; - - typedef boost::tokenizer<boost::char_separator<char> > tokenizer; - boost::char_separator<char> sep(","); - tokenizer var_names(var_list, sep); - tokenizer::const_iterator it = var_names.begin(); - - // First var does not need a delimiter - if (it != var_names.end()) - { - const std::string& name = *it; - if (vars.has(name)) - { - // URL encode the value before appending the name=value pair. - query << name << "=" << escapeURL(vars[name].asString()); - } - } - - for (++it; it != var_names.end(); ++it) - { - const std::string& name = *it; - if (vars.has(name)) - { - // URL encode the value before appending the name=value pair. - query << delim << name << "=" << escapeURL(vars[name].asString()); - } - } - - return query.str(); -} - -// static -std::string LLUriTemplate::escapeURL(const std::string& unescaped) -{ - char* escaped = curl_escape(unescaped.c_str(), unescaped.size()); - std::string result = escaped; - curl_free(escaped); - return result; -} - diff --git a/indra/newview/llwebsharing.h b/indra/newview/llwebsharing.h deleted file mode 100755 index ad9c99c224..0000000000 --- a/indra/newview/llwebsharing.h +++ /dev/null @@ -1,224 +0,0 @@ -/** - * @file llwebsharing.h - * @author Aimee - * @brief Web Snapshot Sharing - * - * $LicenseInfo:firstyear=2010&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifndef LL_LLWEBSHARING_H -#define LL_LLWEBSHARING_H - -#include "llimagejpeg.h" -#include "llsingleton.h" - - - -/** - * @class LLWebSharing - * - * Manages authentication to, and interaction with, a web service allowing the - * upload of snapshot images taken within the viewer, using OpenID and the - * OpenSocial APIs. - * http://www.opensocial.org/Technical-Resources/opensocial-spec-v09/RPC-Protocol.html - */ -class LLWebSharing : public LLSingleton<LLWebSharing> -{ - LOG_CLASS(LLWebSharing); -public: - /* - * Performs initial setup, by requesting config data from the web service if - * it has not already been received. - */ - void init(); - - /* - * @return true if both the OpenID cookie and config data have been received. - */ - bool enabled() const { return mEnabled; }; - - /* - * Sets the OpenID cookie to use for login to the web service. - * - * @param cookie a string containing the OpenID cookie. - * - * @return true if both the OpenID cookie and config data have been received. - */ - bool setOpenIDCookie(const std::string& cookie); - - /* - * Receive config data used to connect to the web service. - * - * @param config an LLSD map of URL templates for the web service end-points. - * - * @return true if both the OpenID cookie and config data have been received. - * - * @see sendConfigRequest() - */ - bool receiveConfig(const LLSD& config); - - /* - * Receive the session cookie from the web service, which is the result of - * the OpenID login process. - * - * @see sendOpenIDAuthRequest() - */ - bool receiveSessionCookie(const std::string& cookie); - - /* - * Receive a security token for the upload service. - * - * @see sendSecurityTokenRequest() - */ - bool receiveSecurityToken(const std::string& token, const std::string& expires); - - /* - * Restarts the authentication process if the maximum number of retries has - * not been exceeded. - * - * @return true if retrying, false if LLWebSharing::MAX_AUTH_RETRIES has been exceeded. - */ - bool retryOpenIDAuth(); - - /* - * Post a snapshot to the upload service. - * - * @return true if accepted for upload, false if already uploading another image. - */ - bool shareSnapshot(LLImageJPEG* snapshot, LLSD& metadata); - -private: - static const S32 MAX_AUTH_RETRIES = 4; - - friend class LLSingleton<LLWebSharing>; - - LLWebSharing(); - ~LLWebSharing() {}; - - /* - * Request a map of URLs and URL templates to the web service end-points. - * - * @see receiveConfig() - */ - void sendConfigRequest(); - - /* - * Initiate the OpenID login process. - * - * @see receiveSessionCookie() - */ - void sendOpenIDAuthRequest(); - - /* - * Request a security token for the upload service. - * - * @see receiveSecurityToken() - */ - void sendSecurityTokenRequest(); - - /* - * Request a security token for the upload service. - * - * @see receiveSecurityToken() - */ - void sendUploadRequest(); - - /* - * Checks all necessary config information has been received, and sets mEnabled. - * - * @return true if both the OpenID cookie and config data have been received. - */ - bool validateConfig(); - - /* - * Checks the security token is present and has not expired. - * - * @param token an LLSD map containing the token string and the time it expires. - * - * @return true if the token is not empty and has not expired. - */ - static bool securityTokenIsValid(LLSD& token); - - std::string mOpenIDCookie; - std::string mSessionCookie; - LLSD mSecurityToken; - - LLSD mConfig; - bool mEnabled; - - LLPointer<LLImageJPEG> mImage; - LLSD mMetadata; - - S32 mRetries; -}; - -/** - * @class LLUriTemplate - * - * @brief Builds complete URIs, given URI template and a map of keys and values - * to use for substition. - * Note: This is only a partial implementation of a draft standard required - * by the web API used by LLWebSharing. - * See: http://tools.ietf.org/html/draft-gregorio-uritemplate-03 - * - * @see LLWebSharing - */ -class LLUriTemplate -{ - LOG_CLASS(LLUriTemplate); -public: - LLUriTemplate(const std::string& uri_template); - ~LLUriTemplate() {}; - - /* - * Builds a complete URI from the template. - * - * @param vars an LLSD map of keys and values for substitution. - * - * @return a string containing the complete URI. - */ - std::string buildURI(const LLSD& vars); - -private: - /* - * Builds a URL query string. - * - * @param delim a string containing the separator to use between name=value pairs. - * @param var_list a string containing a comma separated list of variable names. - * @param vars an LLSD map of keys and values for substitution. - * - * @return a URL query string. - */ - std::string expandJoin(const std::string& delim, const std::string& var_list, const LLSD& vars); - - /* - * URL escape the given string. - * LLWeb::escapeURL() only does a partial escape, so this uses curl_escape() instead. - */ - static std::string escapeURL(const std::string& unescaped); - - std::string mTemplate; -}; - - - -#endif // LL_LLWEBSHARING_H -- cgit v1.2.3 From ab71e294e00270aada33b283bdae7566ef93f6e2 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine <mnikolenko@productengine.com> Date: Thu, 26 Dec 2013 12:34:50 +0200 Subject: MAINT-3570 FIXED Callbacks for menu item are added. --- indra/newview/llpreviewscript.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index e533be7f24..f6f9dc90a9 100755 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -518,6 +518,10 @@ void LLScriptEdCore::initMenu() menuItem->setClickCallback(boost::bind(&LLTextEditor::selectAll, mEditor)); menuItem->setEnableCallback(boost::bind(&LLTextEditor::canSelectAll, mEditor)); + menuItem = getChild<LLMenuItemCallGL>("Deselect"); + menuItem->setClickCallback(boost::bind(&LLTextEditor::deselect, mEditor)); + menuItem->setEnableCallback(boost::bind(&LLTextEditor::canDeselect, mEditor)); + menuItem = getChild<LLMenuItemCallGL>("Search / Replace..."); menuItem->setClickCallback(boost::bind(&LLFloaterScriptSearch::show, this)); -- cgit v1.2.3 From 39e76aaea873094114471ff80203f941d108f7b8 Mon Sep 17 00:00:00 2001 From: MaximB ProductEngine <mberezhnoy@productengine.com> Date: Wed, 1 Jan 2014 03:43:56 +0200 Subject: MAINT-3592 (Viewer opening square textures should set the 1:1 size constraint) --- indra/newview/llpreviewtexture.cpp | 69 +++++++++++++++++++++- indra/newview/llpreviewtexture.h | 2 + .../default/xui/en/floater_preview_texture.xml | 24 -------- 3 files changed, 69 insertions(+), 26 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpreviewtexture.cpp b/indra/newview/llpreviewtexture.cpp index 1ed48a978f..0ef7326678 100755 --- a/indra/newview/llpreviewtexture.cpp +++ b/indra/newview/llpreviewtexture.cpp @@ -71,7 +71,8 @@ LLPreviewTexture::LLPreviewTexture(const LLSD& key) mAspectRatio(0.f), mPreviewToSave(FALSE), mImage(NULL), - mImageOldBoostLevel(LLGLTexture::BOOST_NONE) + mImageOldBoostLevel(LLGLTexture::BOOST_NONE), + mRatiosList(NULL) { updateImageID(); if (key.has("save_as")) @@ -127,9 +128,27 @@ BOOL LLPreviewTexture::postBuild() getChild<LLLineEditor>("desc")->setPrevalidate(&LLTextValidate::validateASCIIPrintableNoPipe); } } + + // Fill in ratios list with common aspect ratio values + mRatiosList.clear(); + mRatiosList.push_back("Unconstrained"); + mRatiosList.push_back("1:1"); + mRatiosList.push_back("4:3"); + mRatiosList.push_back("10:7"); + mRatiosList.push_back("3:2"); + mRatiosList.push_back("16:10"); + mRatiosList.push_back("16:9"); + mRatiosList.push_back("2:1"); - childSetCommitCallback("combo_aspect_ratio", onAspectRatioCommit, this); + // Now fill combo box with provided list LLComboBox* combo = getChild<LLComboBox>("combo_aspect_ratio"); + + for (std::vector<std::string>::const_iterator it = mRatiosList.begin(); it != mRatiosList.end(); ++it) + { + combo->add(*it); + } + + childSetCommitCallback("combo_aspect_ratio", onAspectRatioCommit, this); combo->setCurrentByIndex(0); return LLPreview::postBuild(); @@ -414,6 +433,13 @@ void LLPreviewTexture::updateDimensions() { return; } + + if (mAssetStatus != PREVIEW_ASSET_LOADED) + { + mAssetStatus = PREVIEW_ASSET_LOADED; + // Asset has been fully loaded, adjust aspect ratio + adjustAspectRatio(); + } // Update the width/height display every time getChild<LLUICtrl>("dimensions")->setTextArg("[WIDTH]", llformat("%d", mImage->getFullWidth())); @@ -501,6 +527,45 @@ LLPreview::EAssetStatus LLPreviewTexture::getAssetStatus() return mAssetStatus; } +void LLPreviewTexture::adjustAspectRatio() +{ + S32 w = mImage->getFullWidth(); + S32 h = mImage->getFullHeight(); + + // Determine aspect ratio of the image + S32 tmp; + while (h != 0) + { + tmp = w % h; + w = h; + h = tmp; + } + S32 divisor = w; + S32 num = mImage->getFullWidth() / divisor; + S32 denom = mImage->getFullHeight() / divisor; + + if (setAspectRatio(num, denom)) + { + // Select corresponding ratio entry in the combo list + LLComboBox* combo = getChild<LLComboBox>("combo_aspect_ratio"); + if (combo) + { + std::string ratio = std::to_string((ULONGLONG)num) + ":" + std::to_string((ULONGLONG)denom); + std::vector<std::string>::const_iterator found = std::find(mRatiosList.begin(), mRatiosList.end(), ratio); + if (found == mRatiosList.end()) + { + combo->setCurrentByIndex(0); + } + else + { + combo->setCurrentByIndex(found - mRatiosList.begin()); + } + } + } + + mUpdateDimensions = TRUE; +} + void LLPreviewTexture::updateImageID() { const LLViewerInventoryItem *item = static_cast<const LLViewerInventoryItem*>(getItem()); diff --git a/indra/newview/llpreviewtexture.h b/indra/newview/llpreviewtexture.h index cd16bacde2..97e74706cc 100755 --- a/indra/newview/llpreviewtexture.h +++ b/indra/newview/llpreviewtexture.h @@ -70,6 +70,7 @@ protected: /* virtual */ BOOL postBuild(); bool setAspectRatio(const F32 width, const F32 height); static void onAspectRatioCommit(LLUICtrl*,void* userdata); + void adjustAspectRatio(); private: void updateImageID(); // set what image is being uploaded. @@ -95,5 +96,6 @@ private: F32 mAspectRatio; LLLoadedCallbackEntry::source_callback_list_t mCallbackTextureList ; + std::vector<std::string> mRatiosList; }; #endif // LL_LLPREVIEWTEXTURE_H diff --git a/indra/newview/skins/default/xui/en/floater_preview_texture.xml b/indra/newview/skins/default/xui/en/floater_preview_texture.xml index 137e278ddc..e1e7e1c8c8 100755 --- a/indra/newview/skins/default/xui/en/floater_preview_texture.xml +++ b/indra/newview/skins/default/xui/en/floater_preview_texture.xml @@ -79,30 +79,6 @@ width="108" name="combo_aspect_ratio" tool_tip="Preview at a fixed aspect ratio"> - <combo_item name="Unconstrained" value="Unconstrained"> - Unconstrained - </combo_item> - <combo_item name="1:1" value="1:1" tool_tip="Group insignia or Real World profile"> - 1:1 - </combo_item> - <combo_item name="4:3" value="4:3" tool_tip="[SECOND_LIFE] profile"> - 4:3 - </combo_item> - <combo_item name="10:7" value="10:7" tool_tip="Classifieds and search listings, landmarks"> - 10:7 - </combo_item> - <combo_item name="3:2" value="3:2" tool_tip="About land"> - 3:2 - </combo_item> - <combo_item name="16:10" value="16:10"> - 16:10 - </combo_item> - <combo_item name="16:9" value="16:9" tool_tip="Profile picks"> - 16:9 - </combo_item> - <combo_item name="2:1" value="2:1"> - 2:1 - </combo_item> </combo_box> <button follows="right|bottom" -- cgit v1.2.3 From dd1bd943b9b0a91ccd4d7676bba5eb5277bf0fbe Mon Sep 17 00:00:00 2001 From: MaximB ProductEngine <mberezhnoy@productengine.com> Date: Thu, 2 Jan 2014 22:29:46 +0200 Subject: MAINT-3592 (Viewer opening square textures should set the 1:1 size constraint) --- indra/newview/llpreviewtexture.cpp | 3 ++- indra/newview/skins/default/xui/da/strings.xml | 3 ++- indra/newview/skins/default/xui/de/strings.xml | 3 ++- indra/newview/skins/default/xui/en/strings.xml | 1 + indra/newview/skins/default/xui/es/strings.xml | 3 ++- indra/newview/skins/default/xui/fr/strings.xml | 3 ++- indra/newview/skins/default/xui/it/strings.xml | 3 ++- indra/newview/skins/default/xui/ja/strings.xml | 3 ++- indra/newview/skins/default/xui/pl/strings.xml | 1 + indra/newview/skins/default/xui/pt/strings.xml | 3 ++- indra/newview/skins/default/xui/ru/strings.xml | 3 ++- indra/newview/skins/default/xui/tr/strings.xml | 3 ++- 12 files changed, 22 insertions(+), 10 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpreviewtexture.cpp b/indra/newview/llpreviewtexture.cpp index 0ef7326678..50af5aea1f 100755 --- a/indra/newview/llpreviewtexture.cpp +++ b/indra/newview/llpreviewtexture.cpp @@ -131,7 +131,7 @@ BOOL LLPreviewTexture::postBuild() // Fill in ratios list with common aspect ratio values mRatiosList.clear(); - mRatiosList.push_back("Unconstrained"); + mRatiosList.push_back(LLTrans::getString("Unconstrained")); mRatiosList.push_back("1:1"); mRatiosList.push_back("4:3"); mRatiosList.push_back("10:7"); @@ -142,6 +142,7 @@ BOOL LLPreviewTexture::postBuild() // Now fill combo box with provided list LLComboBox* combo = getChild<LLComboBox>("combo_aspect_ratio"); + combo->removeall(); for (std::vector<std::string>::const_iterator it = mRatiosList.begin(); it != mRatiosList.end(); ++it) { diff --git a/indra/newview/skins/default/xui/da/strings.xml b/indra/newview/skins/default/xui/da/strings.xml index 11d100eeff..74d160dfae 100755 --- a/indra/newview/skins/default/xui/da/strings.xml +++ b/indra/newview/skins/default/xui/da/strings.xml @@ -1172,7 +1172,8 @@ Prøv venligst om lidt igen. <string name="InventoryNoTexture"> Du har ikke en kopi af denne tekstur i din beholdning </string> - <string name="no_transfer" value=" (ikke overdragbar)"/> + <string name="Unconstrained">Ikke låst</string> + <string name="no_transfer" value=" (ikke overdragbar)"/> <string name="no_modify" value=" (ikke redigere)"/> <string name="no_copy" value=" (ikke kopiere)"/> <string name="worn" value=" (båret)"/> diff --git a/indra/newview/skins/default/xui/de/strings.xml b/indra/newview/skins/default/xui/de/strings.xml index 4268b95370..082febd709 100755 --- a/indra/newview/skins/default/xui/de/strings.xml +++ b/indra/newview/skins/default/xui/de/strings.xml @@ -1267,7 +1267,8 @@ Warten Sie kurz und versuchen Sie dann noch einmal, sich anzumelden. <string name="InventoryNoTexture"> Sie haben keine Kopie dieser Textur in Ihrem Inventar. </string> - <string name="InventoryInboxNoItems"> + <string name="Unconstrained">keines</string> + <string name="InventoryInboxNoItems"> Einkäufe aus dem Marktplatz erscheinen hier. Sie können diese dann zur Verwendung in Ihr Inventar ziehen. </string> <string name="MarketplaceURL"> diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 67f75fe1d2..f0ff6d5b88 100755 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -2257,6 +2257,7 @@ Drag folders to this area and click "Send to Marketplace" to list them for sale <string name="Marketplace Error Internal Import">Error: There was a problem with this item. Try again later.</string> <string name="Open landmarks">Open landmarks</string> + <string name="Unconstrained">Unconstrained</string> <!-- use value="" because they have preceding spaces --> <string name="no_transfer" value=" (no transfer)" /> diff --git a/indra/newview/skins/default/xui/es/strings.xml b/indra/newview/skins/default/xui/es/strings.xml index 484511a08b..2b91c542ad 100755 --- a/indra/newview/skins/default/xui/es/strings.xml +++ b/indra/newview/skins/default/xui/es/strings.xml @@ -1252,7 +1252,8 @@ Intenta iniciar sesión de nuevo en unos instantes. <string name="InventoryInboxNoItems"> Aquí aparecerán algunos de los objetos que recibas, como los regalos Premium. Después puedes arrastrarlos a tu inventario. </string> - <string name="MarketplaceURL"> + <string name="Unconstrained">Sin restricciones</string> + <string name="MarketplaceURL"> https://marketplace.[MARKETPLACE_DOMAIN_NAME]/ </string> <string name="MarketplaceURL_CreateStore"> diff --git a/indra/newview/skins/default/xui/fr/strings.xml b/indra/newview/skins/default/xui/fr/strings.xml index 78d846ff4f..b8721420cb 100755 --- a/indra/newview/skins/default/xui/fr/strings.xml +++ b/indra/newview/skins/default/xui/fr/strings.xml @@ -1270,7 +1270,8 @@ Veuillez réessayer de vous connecter dans une minute. <string name="InventoryInboxNoItems"> Les achats que vous avez effectués sur la Place du marché s'affichent ici. Vous pouvez alors les faire glisser vers votre inventaire afin de les utiliser. </string> - <string name="MarketplaceURL"> + <string name="Unconstrained">Sans contraintes</string> + <string name="MarketplaceURL"> https://marketplace.[MARKETPLACE_DOMAIN_NAME]/ </string> <string name="MarketplaceURL_CreateStore"> diff --git a/indra/newview/skins/default/xui/it/strings.xml b/indra/newview/skins/default/xui/it/strings.xml index 60ed2b0929..86d7f75b83 100755 --- a/indra/newview/skins/default/xui/it/strings.xml +++ b/indra/newview/skins/default/xui/it/strings.xml @@ -1261,7 +1261,8 @@ Prova ad accedere nuovamente tra un minuto. <string name="InventoryInboxNoItems"> Gli acquissti dal mercato verranno mostrati qui. Potrai quindi trascinarli nel tuo inventario per usarli. </string> - <string name="MarketplaceURL"> + <string name="Unconstrained">Libero</string> + <string name="MarketplaceURL"> https://marketplace.[MARKETPLACE_DOMAIN_NAME]/ </string> <string name="MarketplaceURL_CreateStore"> diff --git a/indra/newview/skins/default/xui/ja/strings.xml b/indra/newview/skins/default/xui/ja/strings.xml index a0f45e5a55..36966d6825 100755 --- a/indra/newview/skins/default/xui/ja/strings.xml +++ b/indra/newview/skins/default/xui/ja/strings.xml @@ -1270,7 +1270,8 @@ support@secondlife.com にお問い合わせください。 <string name="InventoryInboxNoItems"> マーケットプレイスで購入した商品はここに表示されます。その後、アイテムをインベントリにドラッグすれば、それらのアイテムを使用できます。 </string> - <string name="MarketplaceURL"> + <string name="Unconstrained">非拘束</string> + <string name="MarketplaceURL"> https://marketplace.[MARKETPLACE_DOMAIN_NAME]/ </string> <string name="MarketplaceURL_CreateStore"> diff --git a/indra/newview/skins/default/xui/pl/strings.xml b/indra/newview/skins/default/xui/pl/strings.xml index f6dec8536b..f86e393646 100755 --- a/indra/newview/skins/default/xui/pl/strings.xml +++ b/indra/newview/skins/default/xui/pl/strings.xml @@ -1035,6 +1035,7 @@ <string name="InventoryNoTexture"> Nie posiadasz kopii tej tekstury w Twojej Szafie. </string> + <string name="Unconstrained">Swobodny</string> <string name="no_transfer" value=" (brak oddawania)"/> <string name="no_modify" value=" (brak modyfikowania)"/> <string name="no_copy" value=" (brak kopiowania)"/> diff --git a/indra/newview/skins/default/xui/pt/strings.xml b/indra/newview/skins/default/xui/pt/strings.xml index 2eb4c0a02e..8436452228 100755 --- a/indra/newview/skins/default/xui/pt/strings.xml +++ b/indra/newview/skins/default/xui/pt/strings.xml @@ -1216,7 +1216,8 @@ Pessoas com contas gratuitas não poderão acessar o Second Life no momento para <string name="InventoryInboxNoItems"> Suas compras do Marketplace aparecerão aqui. Depois, você poderá arrastá-las para seu inventário para usá-las. </string> - <string name="MarketplaceURL"> + <string name="Unconstrained">Sem limites</string> + <string name="MarketplaceURL"> https://marketplace.[MARKETPLACE_DOMAIN_NAME]/ </string> <string name="MarketplaceURL_CreateStore"> diff --git a/indra/newview/skins/default/xui/ru/strings.xml b/indra/newview/skins/default/xui/ru/strings.xml index 0f71edcee0..8faf834f8f 100755 --- a/indra/newview/skins/default/xui/ru/strings.xml +++ b/indra/newview/skins/default/xui/ru/strings.xml @@ -1267,7 +1267,8 @@ support@secondlife.com. <string name="InventoryInboxNoItems"> Здесь будут показаны ваши покупки из торгового центра. Их можно будет перетащить в ваш инвентарь для использования. </string> - <string name="MarketplaceURL"> + <string name="Unconstrained">Без ограничения</string> + <string name="MarketplaceURL"> https://marketplace.[MARKETPLACE_DOMAIN_NAME]/ </string> <string name="MarketplaceURL_CreateStore"> diff --git a/indra/newview/skins/default/xui/tr/strings.xml b/indra/newview/skins/default/xui/tr/strings.xml index c4b1530b2b..31c5d2d310 100755 --- a/indra/newview/skins/default/xui/tr/strings.xml +++ b/indra/newview/skins/default/xui/tr/strings.xml @@ -1267,7 +1267,8 @@ Lütfen bir dakika içerisinde tekrar oturum açmayı deneyin. <string name="InventoryInboxNoItems"> Pazaryerinda satın aldıklarınız burada görünecektir. Bunları kullanmak için envanterinize sürükleyebilirsiniz. </string> - <string name="MarketplaceURL"> + <string name="Unconstrained">Kısıtsız</string> + <string name="MarketplaceURL"> https://marketplace.[MARKETPLACE_DOMAIN_NAME]/ </string> <string name="MarketplaceURL_CreateStore"> -- cgit v1.2.3 From 87fc26e0c6d8b09bc3747922fb1c1b9a2d757e98 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Mon, 6 Jan 2014 17:29:39 -0500 Subject: SH-4666 WIP - modified LLMaterialsResponder to use httpSuccess()/httpFailure() --- indra/newview/llmaterialmgr.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) mode change 100644 => 100755 indra/newview/llmaterialmgr.cpp (limited to 'indra/newview') diff --git a/indra/newview/llmaterialmgr.cpp b/indra/newview/llmaterialmgr.cpp old mode 100644 new mode 100755 index 14d3d4e7a8..2e569543bd --- a/indra/newview/llmaterialmgr.cpp +++ b/indra/newview/llmaterialmgr.cpp @@ -71,8 +71,8 @@ public: LLMaterialsResponder(const std::string& pMethod, const std::string& pCapabilityURL, CallbackFunction pCallback); virtual ~LLMaterialsResponder(); - virtual void result(const LLSD& pContent); - virtual void error(U32 pStatus, const std::string& pReason); + virtual void httpSuccess(); + virtual void httpFailure(); private: std::string mMethod; @@ -92,14 +92,19 @@ LLMaterialsResponder::~LLMaterialsResponder() { } -void LLMaterialsResponder::result(const LLSD& pContent) +void LLMaterialsResponder::httpSuccess() { + const LLSD& pContent = getContent(); + LL_DEBUGS("Materials") << LL_ENDL; mCallback(true, pContent); } -void LLMaterialsResponder::error(U32 pStatus, const std::string& pReason) +void LLMaterialsResponder::httpFailure() { + U32 pStatus = (U32) getStatus(); + const std::string& pReason = getReason(); + LL_WARNS("Materials") << "\n--------------------------------------------------------------------------\n" << mMethod << " Error[" << pStatus << "] cannot access cap '" << MATERIALS_CAPABILITY_NAME -- cgit v1.2.3 From a773cdd6f7e95c44c2fc11e020addf60a970cb8f Mon Sep 17 00:00:00 2001 From: Simon Linden <simon@lindenlab.com> Date: Wed, 8 Jan 2014 02:36:12 +0000 Subject: Fix linux build --- indra/newview/llpreviewtexture.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpreviewtexture.cpp b/indra/newview/llpreviewtexture.cpp index 50af5aea1f..5c41c5ad97 100755 --- a/indra/newview/llpreviewtexture.cpp +++ b/indra/newview/llpreviewtexture.cpp @@ -71,8 +71,7 @@ LLPreviewTexture::LLPreviewTexture(const LLSD& key) mAspectRatio(0.f), mPreviewToSave(FALSE), mImage(NULL), - mImageOldBoostLevel(LLGLTexture::BOOST_NONE), - mRatiosList(NULL) + mImageOldBoostLevel(LLGLTexture::BOOST_NONE) { updateImageID(); if (key.has("save_as")) @@ -551,8 +550,9 @@ void LLPreviewTexture::adjustAspectRatio() LLComboBox* combo = getChild<LLComboBox>("combo_aspect_ratio"); if (combo) { - std::string ratio = std::to_string((ULONGLONG)num) + ":" + std::to_string((ULONGLONG)denom); - std::vector<std::string>::const_iterator found = std::find(mRatiosList.begin(), mRatiosList.end(), ratio); + std::ostringstream ratio; + ratio << num << ":" << denom; + std::vector<std::string>::const_iterator found = std::find(mRatiosList.begin(), mRatiosList.end(), ratio.str()); if (found == mRatiosList.end()) { combo->setCurrentByIndex(0); -- cgit v1.2.3 From a1e986e2b0fefa2b8ecc995c5449c0a1b8556675 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine <mnikolenko@productengine.com> Date: Fri, 10 Jan 2014 12:37:01 +0200 Subject: MAINT-3364 FIXED Call clearSelection() from root_folder --- indra/newview/lltexturectrl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index ea837c9127..99e41cf39a 100755 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -242,7 +242,7 @@ void LLFloaterTexturePicker::setImageID(const LLUUID& image_id) LLUUID item_id = findItemID(mImageAssetID, FALSE); if (item_id.isNull()) { - mInventoryPanel->clearSelection(); + mInventoryPanel->getRootFolder()->clearSelection(); } else { -- cgit v1.2.3 From c934710f766223e56c892b3ab7acd02321a8b47e Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine <mnikolenko@productengine.com> Date: Mon, 13 Jan 2014 12:08:00 +0200 Subject: MAINT-3621 FIXED Set name to "Unnamed" if object's name consists of whitespaces. --- indra/newview/llviewermessage.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index dd744be4eb..c532134763 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -3521,6 +3521,12 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) } else { + // make sure that we don't have an empty or all-whitespace name + LLStringUtil::trim(from_name); + if (from_name.empty()) + { + from_name = LLTrans::getString("Unnamed"); + } chat.mFromName = from_name; } -- cgit v1.2.3 From 4d81b1d967fbfa68f97f37d8d162b1ac9900a4b0 Mon Sep 17 00:00:00 2001 From: MaximB ProductEngine <mberezhnoy@productengine.com> Date: Tue, 14 Jan 2014 10:00:30 +0200 Subject: MAINT-3510 (Incorrect context menu entry in Places floater) --- indra/newview/llpanellandmarks.cpp | 5 +++++ indra/newview/llpanellandmarks.h | 2 ++ indra/newview/llplacesfolderview.cpp | 11 +++++++++++ indra/newview/llplacesfolderview.h | 2 ++ 4 files changed, 20 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index 88400e4ef2..a22d9c06fa 100755 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -716,6 +716,11 @@ void LLLandmarksPanel::updateListCommands() mListCommands->getChildView(TRASH_BUTTON_NAME)->setEnabled(trash_enabled); } +void LLLandmarksPanel::updateMenuVisibility(LLUICtrl* menu) +{ + onMenuVisibilityChange(menu, LLSD().with("visibility", true)); +} + void LLLandmarksPanel::onActionsButtonClick() { LLToggleableMenu* menu = mGearFolderMenu; diff --git a/indra/newview/llpanellandmarks.h b/indra/newview/llpanellandmarks.h index 8fae0f0b67..80310d1524 100755 --- a/indra/newview/llpanellandmarks.h +++ b/indra/newview/llpanellandmarks.h @@ -80,6 +80,8 @@ public: LLPlacesInventoryPanel* getLibraryInventoryPanel() { return mLibraryInventoryPanel; } + void updateMenuVisibility(LLUICtrl* menu); + protected: /** * @return true - if current selected panel is not null and selected item is a landmark diff --git a/indra/newview/llplacesfolderview.cpp b/indra/newview/llplacesfolderview.cpp index 3caa93ae71..1cb013adc6 100755 --- a/indra/newview/llplacesfolderview.cpp +++ b/indra/newview/llplacesfolderview.cpp @@ -31,6 +31,7 @@ #include "llplacesinventorypanel.h" #include "llpanellandmarks.h" +#include "llmenugl.h" LLPlacesFolderView::LLPlacesFolderView(const LLFolderView::Params& p) : LLFolderView(p) @@ -67,6 +68,16 @@ BOOL LLPlacesFolderView::handleRightMouseDown(S32 x, S32 y, MASK mask) return LLFolderView::handleRightMouseDown(x, y, mask); } +void LLPlacesFolderView::updateMenu() +{ + LLFolderView::updateMenu(); + LLMenuGL* menu = (LLMenuGL*)mPopupMenuHandle.get(); + if (menu && menu->getVisible()) + { + mParentLandmarksPanel->updateMenuVisibility(menu); + } +} + void LLPlacesFolderView::setupMenuHandle(LLInventoryType::EType asset_type, LLHandle<LLView> menu_handle) { mMenuHandlesByInventoryType[asset_type] = menu_handle; diff --git a/indra/newview/llplacesfolderview.h b/indra/newview/llplacesfolderview.h index 8c5be39b5e..65fe76007a 100755 --- a/indra/newview/llplacesfolderview.h +++ b/indra/newview/llplacesfolderview.h @@ -51,6 +51,8 @@ public: */ /*virtual*/ BOOL handleRightMouseDown( S32 x, S32 y, MASK mask ); + /*virtual*/ void updateMenu(); + void setupMenuHandle(LLInventoryType::EType asset_type, LLHandle<LLView> menu_handle); void setParentLandmarksPanel(LLLandmarksPanel* panel) -- cgit v1.2.3 From a462c5f14b14ede2f159b872366dd577531c58f2 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine <mnikolenko@productengine.com> Date: Tue, 14 Jan 2014 11:47:40 +0200 Subject: MAINT-3262 FIXED Allow uploading gif-images --- indra/newview/llfilepicker.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview') diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp index 7fa3e176b0..3064d96434 100755 --- a/indra/newview/llfilepicker.cpp +++ b/indra/newview/llfilepicker.cpp @@ -570,6 +570,7 @@ std::vector<std::string>* LLFilePicker::navOpenFilterProc(ELoadFilter filter) // allowedv->push_back("lsl"); allowedv->push_back("dic"); allowedv->push_back("xcu"); + allowedv->push_back("gif"); case FFLOAD_IMAGE: allowedv->push_back("jpg"); allowedv->push_back("jpeg"); -- cgit v1.2.3 From ae57f0ed1adc635ab4c7211988621caf2e4eaad2 Mon Sep 17 00:00:00 2001 From: Graham Linden <graham@lindenlab.com> Date: Tue, 14 Jan 2014 14:22:14 -0800 Subject: MAINT-3412 add gpu_table line with distinct Intel Iris Pro OpenGL regex to match new MBP with forced Intel graphics --- indra/newview/gpu_table.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/gpu_table.txt b/indra/newview/gpu_table.txt index 8efc4ee87d..badbe486b9 100755 --- a/indra/newview/gpu_table.txt +++ b/indra/newview/gpu_table.txt @@ -327,7 +327,8 @@ Intel HD Graphics 4600 .*Intel.*HD Graphics 46.* 3 1 0 4.2 Intel HD Graphics 4000 .*Intel.*HD Graphics 4.* 3 1 1 4.2 Intel Intel Iris Pro Graphics 5200 .*Intel.*Iris Pro Graphics 52.* 4 1 0 4 Intel Intel Iris Graphics 5100 .*Intel.*Iris Graphics 51.* 4 1 0 4 -Intel Intel Iris OpenGL Engine .*Intel.*Iris (Pro )*OpenGL.* 4 1 0 4 +Intel Intel Iris OpenGL Engine .*Intel.*Iris OpenGL.* 4 1 0 4 +Intel Intel Iris Pro OpenGL Engine .*Intel.*Iris Pro OpenGL.* 5 1 0 4 Intel HD Graphics 5000 .*Intel.*HD Graphics 5.* 4 1 0 4 Intel HD Graphics .*Intel.*HD Graphics.* 2 1 1 4 Intel Mobile 4 Series .*Intel.*Mobile.* 4 Series.* 0 1 1 2.1 -- cgit v1.2.3 From 9489dbe2c16720c26f8854b50d30103ec12d190d Mon Sep 17 00:00:00 2001 From: maksymsproductengine <maksymsproductengine@lindenlab.com> Date: Wed, 8 Jan 2014 20:25:40 +0200 Subject: MAINT-3591 FIXED Remove "Start Second LIfe now?" dialogue in the installer --- indra/newview/installers/windows/installer_template.nsi | 16 ---------------- 1 file changed, 16 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi index c4f503ef4e..4ece83d85a 100755 --- a/indra/newview/installers/windows/installer_template.nsi +++ b/indra/newview/installers/windows/installer_template.nsi @@ -122,24 +122,8 @@ Var DO_UNINSTALL_V2 ; If non-null, path to a previous Viewer 2 installation ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Function .onInstSuccess Push $R0 # Option value, unused - - StrCmp $SKIP_DIALOGS "true" label_launch - - ${GetOptions} $COMMANDLINE "/AUTOSTART" $R0 - # If parameter was there (no error) just launch - # Otherwise ask - IfErrors label_ask_launch label_launch - -label_ask_launch: - # Don't launch by default when silent - IfSilent label_no_launch - MessageBox MB_YESNO $(InstSuccesssQuestion) \ - IDYES label_launch IDNO label_no_launch - -label_launch: # Assumes SetOutPath $INSTDIR Exec '"$INSTDIR\$INSTEXE" $SHORTCUT_LANG_PARAM' -label_no_launch: Pop $R0 FunctionEnd -- cgit v1.2.3 From ec8bac9c2616e3612d2dffe4d90fef308934347e Mon Sep 17 00:00:00 2001 From: "maxim@mnikolenko" <maxim@mnikolenko> Date: Thu, 23 Jan 2014 12:01:16 +0200 Subject: MAINT-3119 FIXED Return common chars for triggers that matches the prefix. --- indra/newview/llgesturemgr.cpp | 62 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 59 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llgesturemgr.cpp b/indra/newview/llgesturemgr.cpp index b56c34573d..2ae13b1b2f 100755 --- a/indra/newview/llgesturemgr.cpp +++ b/indra/newview/llgesturemgr.cpp @@ -1339,6 +1339,7 @@ BOOL LLGestureMgr::matchPrefix(const std::string& in_str, std::string* out_str) { S32 in_len = in_str.length(); + //return whole trigger, if received text equals to it item_map_t::iterator it; for (it = mActive.begin(); it != mActive.end(); ++it) { @@ -1346,7 +1347,24 @@ BOOL LLGestureMgr::matchPrefix(const std::string& in_str, std::string* out_str) if (gesture) { const std::string& trigger = gesture->getTrigger(); - + if (!LLStringUtil::compareInsensitive(in_str, trigger)) + { + *out_str = trigger; + return TRUE; + } + } + } + + //return common chars, if more than one trigger matches the prefix + std::string rest_of_match = ""; + std::string buf = ""; + for (it = mActive.begin(); it != mActive.end(); ++it) + { + LLMultiGesture* gesture = (*it).second; + if (gesture) + { + const std::string& trigger = gesture->getTrigger(); + if (in_len > (S32)trigger.length()) { // too short, bail out @@ -1357,11 +1375,49 @@ BOOL LLGestureMgr::matchPrefix(const std::string& in_str, std::string* out_str) LLStringUtil::truncate(trigger_trunc, in_len); if (!LLStringUtil::compareInsensitive(in_str, trigger_trunc)) { - *out_str = trigger; - return TRUE; + if (rest_of_match.compare("") == 0) + { + rest_of_match = trigger.substr(in_str.size()); + } + std::string cur_rest_of_match = trigger.substr(in_str.size()); + buf = ""; + S32 i=0; + + while (i<rest_of_match.length() && i<cur_rest_of_match.length()) + { + if (rest_of_match[i]==cur_rest_of_match[i]) + { + buf.push_back(rest_of_match[i]); + } + else + { + if(i==0) + { + rest_of_match = ""; + } + break; + } + i++; + } + if (rest_of_match.compare("") == 0) + { + return FALSE; + } + if (buf.compare("") != 0) + { + rest_of_match = buf; + } + } } } + + if (rest_of_match.compare("") != 0) + { + *out_str = in_str+rest_of_match; + return TRUE; + } + return FALSE; } -- cgit v1.2.3 From 930f407a1c5f3ef573001cefaa5a85d1bb7376b8 Mon Sep 17 00:00:00 2001 From: "maxim@mnikolenko" <maxim@mnikolenko> Date: Fri, 24 Jan 2014 12:12:43 +0200 Subject: =?UTF-8?q?MAINT-3642=20FIXED=20Allow=20saving=20textures=20with?= =?UTF-8?q?=20extension=20=E2=80=9C.tga=E2=80=9D=20at=20the=20end=20of=20t?= =?UTF-8?q?he=20name.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- indra/newview/llfilepicker.cpp | 2 +- indra/newview/llfilepicker_mac.mm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp index 3064d96434..057acf69b9 100755 --- a/indra/newview/llfilepicker.cpp +++ b/indra/newview/llfilepicker.cpp @@ -662,7 +662,7 @@ bool LLFilePicker::doNavSaveDialog(ESaveFilter filter, const std::string& filena case FFSAVE_TGAPNG: type = "PNG"; creator = "prvw"; - extension = "png"; + extension = "png,tga"; break; case FFSAVE_BMP: type = "BMPf"; diff --git a/indra/newview/llfilepicker_mac.mm b/indra/newview/llfilepicker_mac.mm index 13757904e3..1438e4dc0a 100644 --- a/indra/newview/llfilepicker_mac.mm +++ b/indra/newview/llfilepicker_mac.mm @@ -107,7 +107,7 @@ std::string* doSaveDialog(const std::string* file, NSSavePanel *panel = [NSSavePanel savePanel]; NSString *extensionns = [NSString stringWithCString:extension->c_str() encoding:[NSString defaultCStringEncoding]]; - NSArray *fileType = [[NSArray alloc] initWithObjects:extensionns,nil]; + NSArray *fileType = [extensionns componentsSeparatedByString:@","]; //[panel setMessage:@"Save Image File"]; [panel setTreatsFilePackagesAsDirectories: ( flags & F_NAV_SUPPORT ) ]; -- cgit v1.2.3 From da4ef4214247fba1f14d8d30f8b34c108a8f2eb0 Mon Sep 17 00:00:00 2001 From: "maxim@mnikolenko" <maxim@mnikolenko> Date: Tue, 28 Jan 2014 12:20:41 +0200 Subject: MAINT-3643 FIXED Copy previous search / replace strings in LSL editor --- indra/newview/llpreviewscript.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index f6f9dc90a9..53a5ed1476 100755 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -192,11 +192,11 @@ public: private: LLScriptEdCore* mEditorCore; - static LLFloaterScriptSearch* sInstance; protected: LLLineEditor* mSearchBox; + LLLineEditor* mReplaceBox; void onSearchBoxCommit(); }; @@ -205,6 +205,7 @@ LLFloaterScriptSearch* LLFloaterScriptSearch::sInstance = NULL; LLFloaterScriptSearch::LLFloaterScriptSearch(LLScriptEdCore* editor_core) : LLFloater(LLSD()), mSearchBox(NULL), + mReplaceBox(NULL), mEditorCore(editor_core) { buildFromFile("floater_script_search.xml"); @@ -227,6 +228,7 @@ LLFloaterScriptSearch::LLFloaterScriptSearch(LLScriptEdCore* editor_core) BOOL LLFloaterScriptSearch::postBuild() { + mReplaceBox = getChild<LLLineEditor>("replace_text"); mSearchBox = getChild<LLLineEditor>("search_text"); mSearchBox->setCommitCallback(boost::bind(&LLFloaterScriptSearch::onSearchBoxCommit, this)); mSearchBox->setCommitOnFocusLost(FALSE); @@ -242,8 +244,12 @@ BOOL LLFloaterScriptSearch::postBuild() //static void LLFloaterScriptSearch::show(LLScriptEdCore* editor_core) { + LLSD::String search_text; + LLSD::String replace_text; if (sInstance && sInstance->mEditorCore && sInstance->mEditorCore != editor_core) { + search_text=sInstance->mSearchBox->getValue().asString(); + replace_text=sInstance->mReplaceBox->getValue().asString(); sInstance->closeFloater(); delete sInstance; } @@ -252,6 +258,8 @@ void LLFloaterScriptSearch::show(LLScriptEdCore* editor_core) { // sInstance will be assigned in the constructor. new LLFloaterScriptSearch(editor_core); + sInstance->mSearchBox->setValue(search_text); + sInstance->mReplaceBox->setValue(replace_text); } sInstance->openFloater(); @@ -272,7 +280,7 @@ void LLFloaterScriptSearch::onBtnSearch(void *userdata) void LLFloaterScriptSearch::handleBtnSearch() { LLCheckBoxCtrl* caseChk = getChild<LLCheckBoxCtrl>("case_text"); - mEditorCore->mEditor->selectNext(getChild<LLUICtrl>("search_text")->getValue().asString(), caseChk->get()); + mEditorCore->mEditor->selectNext(mSearchBox->getValue().asString(), caseChk->get()); } // static @@ -285,7 +293,7 @@ void LLFloaterScriptSearch::onBtnReplace(void *userdata) void LLFloaterScriptSearch::handleBtnReplace() { LLCheckBoxCtrl* caseChk = getChild<LLCheckBoxCtrl>("case_text"); - mEditorCore->mEditor->replaceText(getChild<LLUICtrl>("search_text")->getValue().asString(), getChild<LLUICtrl>("replace_text")->getValue().asString(), caseChk->get()); + mEditorCore->mEditor->replaceText(mSearchBox->getValue().asString(), mReplaceBox->getValue().asString(), caseChk->get()); } // static @@ -298,7 +306,7 @@ void LLFloaterScriptSearch::onBtnReplaceAll(void *userdata) void LLFloaterScriptSearch::handleBtnReplaceAll() { LLCheckBoxCtrl* caseChk = getChild<LLCheckBoxCtrl>("case_text"); - mEditorCore->mEditor->replaceTextAll(getChild<LLUICtrl>("search_text")->getValue().asString(), getChild<LLUICtrl>("replace_text")->getValue().asString(), caseChk->get()); + mEditorCore->mEditor->replaceTextAll(mSearchBox->getValue().asString(), mReplaceBox->getValue().asString(), caseChk->get()); } bool LLFloaterScriptSearch::hasAccelerators() const @@ -329,7 +337,7 @@ void LLFloaterScriptSearch::onSearchBoxCommit() if (mEditorCore && mEditorCore->mEditor) { LLCheckBoxCtrl* caseChk = getChild<LLCheckBoxCtrl>("case_text"); - mEditorCore->mEditor->selectNext(getChild<LLUICtrl>("search_text")->getValue().asString(), caseChk->get()); + mEditorCore->mEditor->selectNext(mSearchBox->getValue().asString(), caseChk->get()); } } -- cgit v1.2.3 From 31c9be174fe24580cfdb6841fcbe6e45c43e5abd Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine <mnikolenko@productengine.com> Date: Tue, 28 Jan 2014 16:47:43 +0200 Subject: MAINT-3664 FIXED Focus filter field in Places floater by default --- indra/newview/skins/default/xui/en/floater_places.xml | 2 ++ indra/newview/skins/default/xui/en/panel_places.xml | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/floater_places.xml b/indra/newview/skins/default/xui/en/floater_places.xml index b241e265a9..31dd6d2c64 100755 --- a/indra/newview/skins/default/xui/en/floater_places.xml +++ b/indra/newview/skins/default/xui/en/floater_places.xml @@ -2,6 +2,7 @@ <floater positioning="cascading" + default_tab_group="1" legacy_header_height="18" can_resize="true" height="588" @@ -16,6 +17,7 @@ width="333"> <panel top="18" + tab_group="1" class="panel_places" name="main_panel" filename="panel_places.xml" diff --git a/indra/newview/skins/default/xui/en/panel_places.xml b/indra/newview/skins/default/xui/en/panel_places.xml index f169dbb702..7d171490e8 100755 --- a/indra/newview/skins/default/xui/en/panel_places.xml +++ b/indra/newview/skins/default/xui/en/panel_places.xml @@ -27,6 +27,7 @@ background_visible="true" label="Filter My Places" max_length_chars="300" name="Filter" + tab_group="1" top="3" width="303" /> <tab_container @@ -39,7 +40,7 @@ background_visible="true" tab_min_width="80" tab_max_width="157" tab_height="30" - tab_group="1" + tab_group="2" tab_position="top" top_pad="10" width="315" /> -- cgit v1.2.3 From 31cc47f9d6e5af04eb39944a41f7ce74a5b7c6f2 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine <mnikolenko@productengine.com> Date: Thu, 30 Jan 2014 12:17:59 +0200 Subject: MAINT-3593 FIXED Clear previous selection properly when selecting new item in another panel(Inventory/Inbox). --- indra/newview/llsidepanelinventory.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index cbf43dbb93..fe844ce5e4 100755 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -710,13 +710,13 @@ void LLSidepanelInventory::clearSelections(bool clearMain, bool clearInbox) if (inv_panel) { - inv_panel->clearSelection(); + inv_panel->getRootFolder()->clearSelection(); } } if (clearInbox && mInboxEnabled && (mInventoryPanelInbox != NULL)) { - mInventoryPanelInbox->clearSelection(); + mInventoryPanelInbox->getRootFolder()->clearSelection(); } updateVerbs(); -- cgit v1.2.3 From 877f7ca131e652fa7644d118d08ab9e181d33d35 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine <mnikolenko@productengine.com> Date: Thu, 30 Jan 2014 14:12:32 +0200 Subject: MAINT-3674 FIXED Menu item text is changed --- indra/newview/SecondLife.nib | Bin 12348 -> 12345 bytes indra/newview/SecondLife.xib | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/SecondLife.nib b/indra/newview/SecondLife.nib index 8b99b5a770..c4ddca50dc 100644 Binary files a/indra/newview/SecondLife.nib and b/indra/newview/SecondLife.nib differ diff --git a/indra/newview/SecondLife.xib b/indra/newview/SecondLife.xib index 370df6bf5f..ef25c648a7 100644 --- a/indra/newview/SecondLife.xib +++ b/indra/newview/SecondLife.xib @@ -120,7 +120,7 @@ </object> <object class="NSMenuItem" id="755159360"> <reference key="NSMenu" ref="110575045"/> - <string key="NSTitle">Hide NewApplication</string> + <string key="NSTitle">Hide Second Life</string> <string key="NSKeyEquiv">h</string> <int key="NSKeyEquivModMask">1048576</int> <int key="NSMnemonicLoc">2147483647</int> -- cgit v1.2.3 From 294d6777bf79bd843fc652f0b4fb4cd51cc2c0c1 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine <mnikolenko@productengine.com> Date: Mon, 3 Feb 2014 11:53:39 +0200 Subject: MAINT-3671 FIXED Rename title when new tab is added. --- indra/newview/llpreviewscript.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index 53a5ed1476..26c46d543c 100755 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -1879,7 +1879,7 @@ void LLLiveLSLEditor::loadAsset() mIsModifiable = item && gAgent.allowOperation(PERM_MODIFY, item->getPermissions(), GP_OBJECT_MANIPULATE); - + refreshFromItem(); // This is commented out, because we don't completely // handle script exports yet. /* -- cgit v1.2.3 From 01535d08087e18e18bf7a3cf83687eb3afc365ff Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine <mnikolenko@productengine.com> Date: Mon, 3 Feb 2014 13:33:54 +0200 Subject: MAINT-2613 FIXED Remove duplicate entry for "DisablePrecacheDelayAfterTeleporting" --- indra/newview/app_settings/settings.xml | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index a220e810c4..318b123f50 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -14904,18 +14904,6 @@ <key>Value</key> <integer>7000</integer> </map> - <key>DisablePrecacheDelayAfterTeleporting</key> - <map> - <key>Comment</key> - <string>Disables the artificial delay in the viewer that precaches some incoming assets</string> - <key>Persist</key> - <integer>0</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>VersionChannelName</key> <map> <key>Comment</key> -- cgit v1.2.3 From 3cb2dc62753931d8e7488ad2f6a3c7ebca76ab08 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine <mnikolenko@productengine.com> Date: Wed, 5 Feb 2014 11:43:09 +0200 Subject: MAINT-3484 FIXED Disable menu item if transcript doesn't exist. --- indra/newview/llfloaterimcontainer.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index b5aa309066..444d3d1f08 100755 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -1320,7 +1320,12 @@ bool LLFloaterIMContainer::enableContextMenuItem(const std::string& item, uuid_v // Extract the single select info bool is_single_select = (uuids.size() == 1); const LLUUID& single_id = uuids.front(); - + + if ("can_chat_history" == item && is_single_select) + { + return LLLogChat::isTranscriptExist(uuids.front(),false); + } + // Handle options that are applicable to all including the user agent if ("can_view_profile" == item) { -- cgit v1.2.3 From 16ebc7d133ef16833f43aedac1f7f91865ba6e27 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine <mnikolenko@productengine.com> Date: Wed, 5 Feb 2014 12:08:36 +0200 Subject: MAINT-3697 FIXED Login screen help menu is updated --- indra/newview/skins/default/xui/en/menu_login.xml | 68 +++++++++++++++++++++-- 1 file changed, 63 insertions(+), 5 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/menu_login.xml b/indra/newview/skins/default/xui/en/menu_login.xml index 52c4fb1613..e91eea04d1 100755 --- a/indra/newview/skins/default/xui/en/menu_login.xml +++ b/indra/newview/skins/default/xui/en/menu_login.xml @@ -35,14 +35,72 @@ tear_off="true" name="Help"> <menu_item_call - label="[SECOND_LIFE] Help" - name="Second Life Help" + label="How to..." + name="How To" shortcut="F1"> <menu_item_call.on_click - function="ShowHelp" - parameter="f1_help" /> + function="Help.ToggleHowTo" + parameter="" /> </menu_item_call> - <menu_item_separator /> + <menu_item_call + label="Quickstart" + name="Quickstart"> + <menu_item_call.on_click + function="Advanced.ShowURL" + parameter="http://community.secondlife.com/t5/English-Knowledge-Base/Second-Life-Quickstart/ta-p/1087919"/> + </menu_item_call> + <menu_item_separator/> + <menu_item_call + label="Knowledge Base" + name="Knowledge Base"> + <menu_item_call.on_click + function="Advanced.ShowURL" + parameter="http://community.secondlife.com/t5/English-Knowledge-Base/Second-Life-User-s-Guide/ta-p/1244857"/> + </menu_item_call> + <menu_item_call + label="Wiki" + name="Wiki"> + <menu_item_call.on_click + function="Advanced.ShowURL" + parameter="http://wiki.secondlife.com"/> + </menu_item_call> + <menu_item_call + label="Community Forums" + name="Community Forums"> + <menu_item_call.on_click + function="Advanced.ShowURL" + parameter="http://community.secondlife.com/t5/Forums/ct-p/Forums"/> + </menu_item_call> + <menu_item_call + label="Support portal" + name="Support portal"> + <menu_item_call.on_click + function="Advanced.ShowURL" + parameter="https://support.secondlife.com/"/> + </menu_item_call> + <menu_item_separator/> + <menu_item_call + label="[SECOND_LIFE] News" + name="Second Life News"> + <menu_item_call.on_click + function="Advanced.ShowURL" + parameter="http://community.secondlife.com/t5/Featured-News/bg-p/blog_feature_news"/> + </menu_item_call> + <menu_item_call + label="[SECOND_LIFE] Blogs" + name="Second Life Blogs"> + <menu_item_call.on_click + function="Advanced.ShowURL" + parameter="http://community.secondlife.com/t5/Blogs/ct-p/Blogs"/> + </menu_item_call> + <menu_item_separator/> + <menu_item_call + label="Report Bug" + name="Report Bug"> + <menu_item_call.on_click + function="Advanced.ReportBug"/> + </menu_item_call> + <menu_item_separator/> <menu_item_call label="About [APP_NAME]" name="About Second Life"> -- cgit v1.2.3 From c938d156aa85a631a88fd90f34871eac27dd3a38 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine <mnikolenko@productengine.com> Date: Thu, 6 Feb 2014 12:32:33 +0200 Subject: MAINT-3411 FIXED Sound type is changed. --- indra/newview/llpreviewsound.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llpreviewsound.cpp b/indra/newview/llpreviewsound.cpp index 33d2d015ad..39ec6def91 100755 --- a/indra/newview/llpreviewsound.cpp +++ b/indra/newview/llpreviewsound.cpp @@ -94,6 +94,6 @@ void LLPreviewSound::auditionSound( void *userdata ) if(item && gAudiop) { LLVector3d lpos_global = gAgent.getPositionGlobal(); - gAudiop->triggerSound(item->getAssetUUID(), gAgent.getID(), SOUND_GAIN, LLAudioEngine::AUDIO_TYPE_UI, lpos_global); + gAudiop->triggerSound(item->getAssetUUID(), gAgent.getID(), SOUND_GAIN, LLAudioEngine::AUDIO_TYPE_SFX, lpos_global); } } -- cgit v1.2.3 From 1d9dec5bde0f1564a6681b5037f46b0294333612 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine <mnikolenko@productengine.com> Date: Thu, 6 Feb 2014 12:43:58 +0200 Subject: MAINT-3657 FIXED Don't change state when other user declines call. --- indra/newview/llvoicechannel.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llvoicechannel.cpp b/indra/newview/llvoicechannel.cpp index 665892a615..ac2a34ba1e 100755 --- a/indra/newview/llvoicechannel.cpp +++ b/indra/newview/llvoicechannel.cpp @@ -790,7 +790,6 @@ void LLVoiceChannelP2P::handleStatusChange(EStatusType type) { // other user declined call LLNotificationsUtil::add("P2PCallDeclined", mNotifyArgs); - setState(STATE_ERROR); } else { -- cgit v1.2.3 From ab0fe81dc0da3cc03d2246d21983e52ddbccc0b2 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine <mnikolenko@productengine.com> Date: Thu, 6 Feb 2014 15:34:49 +0200 Subject: MAINT-3692 FIXED Bindings are added to keys.xml --- indra/newview/app_settings/keys.xml | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/keys.xml b/indra/newview/app_settings/keys.xml index 6e3673e7d9..a8037fec05 100755 --- a/indra/newview/app_settings/keys.xml +++ b/indra/newview/app_settings/keys.xml @@ -293,11 +293,24 @@ <!--these are for passing controls when sitting on vehicles--> <binding key="A" mask="SHIFT" command="slide_left"/> <binding key="D" mask="SHIFT" command="slide_right"/> + <binding key="W" mask="SHIFT" command="move_forward_sitting"/> + <binding key="S" mask="SHIFT" command="move_backward_sitting"/> + <binding key="E" mask="SHIFT" command="spin_over_sitting"/> + <binding key="C" mask="SHIFT" command="spin_under_sitting"/> + <binding key="LEFT" mask="SHIFT" command="slide_left"/> <binding key="RIGHT" mask="SHIFT" command="slide_right"/> + <binding key="UP" mask="SHIFT" command="move_forward_sitting"/> + <binding key="DOWN" mask="SHIFT" command="move_backward_sitting"/> + <binding key="PGUP" mask="SHIFT" command="spin_over_sitting"/> + <binding key="PGDN" mask="SHIFT" command="spin_under_sitting"/> <binding key="PAD_LEFT" mask="SHIFT" command="slide_left"/> <binding key="PAD_RIGHT" mask="SHIFT" command="slide_right"/> + <binding key="PAD_UP" mask="SHIFT" command="move_forward_sitting"/> + <binding key="PAD_DOWN" mask="SHIFT" command="move_backward_sitting"/> + <binding key="PAD_PGUP" mask="SHIFT" command="spin_over_sitting"/> + <binding key="PAD_PGDN" mask="SHIFT" command="spin_under_sitting"/> <binding key="PAD_ENTER" mask="SHIFT" command="start_chat"/> <binding key="PAD_DIVIDE" mask="SHIFT" command="start_gesture"/> -- cgit v1.2.3 From 18deff07238a4d655aa748b7f60360d7453e41c9 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine <mnikolenko@productengine.com> Date: Thu, 6 Feb 2014 17:15:53 +0200 Subject: MAINT-3696 FIXED Show correct tooltip for Highlight Transparent --- indra/newview/skins/default/xui/en/menu_viewer.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 2aa6206a13..94fbb6e8a0 100755 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -1542,7 +1542,8 @@ <menu_item_check label="Highlight Transparent" name="Highlight Transparent" - shortcut="control|alt|T"> + shortcut="control|alt|T" + use_mac_ctrl="true"> <menu_item_check.on_check function="View.CheckHighlightTransparent" /> <menu_item_check.on_click -- cgit v1.2.3 From 8e5da5125de2bc9f8ce5ed2677556953e008c59d Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine <mnikolenko@productengine.com> Date: Mon, 10 Feb 2014 12:09:32 +0200 Subject: MAINT-3710 FIXED List of members is removed from General tab. Title column is added to the list in Members tab. Roles tab is renamed to Roles & Members and Roles sub-tab is default now. --- indra/newview/llpanelgroupgeneral.cpp | 192 +-------------------- indra/newview/llpanelgroupgeneral.h | 13 -- indra/newview/llpanelgrouproles.cpp | 5 +- .../skins/default/xui/en/panel_group_general.xml | 28 +-- .../default/xui/en/panel_group_info_sidetray.xml | 2 +- .../skins/default/xui/en/panel_group_roles.xml | 8 +- 6 files changed, 14 insertions(+), 234 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelgroupgeneral.cpp b/indra/newview/llpanelgroupgeneral.cpp index 0cd93b330a..68835ec5b8 100755 --- a/indra/newview/llpanelgroupgeneral.cpp +++ b/indra/newview/llpanelgroupgeneral.cpp @@ -63,14 +63,12 @@ const S32 DECLINE_TO_STATE = 0; LLPanelGroupGeneral::LLPanelGroupGeneral() : LLPanelGroupTab(), - mPendingMemberUpdate(FALSE), mChanged(FALSE), mFirstUse(TRUE), mGroupNameEditor(NULL), mFounderName(NULL), mInsignia(NULL), mEditCharter(NULL), - mListVisibleMembers(NULL), mCtrlShowInGroupList(NULL), mComboMature(NULL), mCtrlOpenEnrollment(NULL), @@ -79,18 +77,13 @@ LLPanelGroupGeneral::LLPanelGroupGeneral() mCtrlReceiveNotices(NULL), mCtrlListGroup(NULL), mActiveTitleLabel(NULL), - mComboActiveTitle(NULL), - mAvatarNameCacheConnection() + mComboActiveTitle(NULL) { } LLPanelGroupGeneral::~LLPanelGroupGeneral() { - if (mAvatarNameCacheConnection.connected()) - { - mAvatarNameCacheConnection.disconnect(); - } } BOOL LLPanelGroupGeneral::postBuild() @@ -105,17 +98,6 @@ BOOL LLPanelGroupGeneral::postBuild() mEditCharter->setFocusChangedCallback(boost::bind(onFocusEdit, _1, this)); } - - - mListVisibleMembers = getChild<LLNameListCtrl>("visible_members", recurse); - if (mListVisibleMembers) - { - mListVisibleMembers->setDoubleClickCallback(openProfile, this); - mListVisibleMembers->setContextMenu(LLScrollListCtrl::MENU_AVATAR); - - mListVisibleMembers->setSortCallback(boost::bind(&LLPanelGroupGeneral::sortMembersList,this,_1,_2,_3)); - } - // Options mCtrlShowInGroupList = getChild<LLCheckBoxCtrl>("show_in_group_list", recurse); if (mCtrlShowInGroupList) @@ -290,21 +272,6 @@ void LLPanelGroupGeneral::onClickInfo(void *userdata) } -// static -void LLPanelGroupGeneral::openProfile(void* data) -{ - LLPanelGroupGeneral* self = (LLPanelGroupGeneral*)data; - - if (self && self->mListVisibleMembers) - { - LLScrollListItem* selected = self->mListVisibleMembers->getFirstSelected(); - if (selected) - { - LLAvatarActions::showProfile(selected->getUUID()); - } - } -} - bool LLPanelGroupGeneral::needsApply(std::string& mesg) { updateChanged(); @@ -336,11 +303,6 @@ void LLPanelGroupGeneral::activate() void LLPanelGroupGeneral::draw() { LLPanelGroupTab::draw(); - - if (mPendingMemberUpdate) - { - updateMembers(); - } } bool LLPanelGroupGeneral::apply(std::string& mesg) @@ -522,10 +484,6 @@ bool LLPanelGroupGeneral::createGroupCallback(const LLSD& notification, const LL return false; } -static F32 sSDTime = 0.0f; -static F32 sElementTime = 0.0f; -static F32 sAllTime = 0.0f; - // virtual void LLPanelGroupGeneral::update(LLGroupChange gc) { @@ -666,132 +624,10 @@ void LLPanelGroupGeneral::update(LLGroupChange gc) { mEditCharter->setText(gdatap->mCharter); } - - if (mListVisibleMembers) - { - mListVisibleMembers->deleteAllItems(); - - if (gdatap->isMemberDataComplete()) - { - mMemberProgress = gdatap->mMembers.begin(); - mPendingMemberUpdate = TRUE; - - sSDTime = 0.0f; - sElementTime = 0.0f; - sAllTime = 0.0f; - } - else - { - std::stringstream pending; - pending << "Retrieving member list (" << gdatap->mMembers.size() << "\\" << gdatap->mMemberCount << ")"; - - LLSD row; - row["columns"][0]["value"] = pending.str(); - row["columns"][0]["column"] = "name"; - - mListVisibleMembers->setEnabled(FALSE); - mListVisibleMembers->addElement(row); - } - } resetDirty(); } -void LLPanelGroupGeneral::updateMembers() -{ - mPendingMemberUpdate = FALSE; - - LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID); - - if (!mListVisibleMembers - || !gdatap - || !gdatap->isMemberDataComplete() - || gdatap->mMembers.empty()) - { - return; - } - - LLTimer update_time; - update_time.setTimerExpirySec(UPDATE_MEMBERS_SECONDS_PER_FRAME); - - LLAvatarName av_name; - - for( ; mMemberProgress != gdatap->mMembers.end() && !update_time.hasExpired(); - ++mMemberProgress) - { - LLGroupMemberData* member = mMemberProgress->second; - if (!member) - { - continue; - } - - if (LLAvatarNameCache::get(mMemberProgress->first, &av_name)) - { - addMember(mMemberProgress->second); - } - else - { - // If name is not cached, onNameCache() should be called when it is cached and add this member to list. - // *TODO : Use a callback per member, not for the panel group. - if (mAvatarNameCacheConnection.connected()) - { - mAvatarNameCacheConnection.disconnect(); - } - mAvatarNameCacheConnection = LLAvatarNameCache::get(mMemberProgress->first, boost::bind(&LLPanelGroupGeneral::onNameCache, this, gdatap->getMemberVersion(), member, _2)); - } - } - - if (mMemberProgress == gdatap->mMembers.end()) - { - lldebugs << " member list completed." << llendl; - mListVisibleMembers->setEnabled(TRUE); - } - else - { - mPendingMemberUpdate = TRUE; - mListVisibleMembers->setEnabled(FALSE); - } -} - -void LLPanelGroupGeneral::addMember(LLGroupMemberData* member) -{ - LLNameListCtrl::NameItem item_params; - item_params.value = member->getID(); - - LLScrollListCell::Params column; - item_params.columns.add().column("name").font.name("SANSSERIF_SMALL"); - - item_params.columns.add().column("title").value(member->getTitle()).font.name("SANSSERIF_SMALL"); - - item_params.columns.add().column("status").value(member->getOnlineStatus()).font.name("SANSSERIF_SMALL"); - - LLScrollListItem* member_row = mListVisibleMembers->addNameItemRow(item_params); - - if ( member->isOwner() ) - { - LLScrollListText* name_textp = dynamic_cast<LLScrollListText*>(member_row->getColumn(0)); - if (name_textp) - name_textp->setFontStyle(LLFontGL::BOLD); - } -} - -void LLPanelGroupGeneral::onNameCache(const LLUUID& update_id, LLGroupMemberData* member, const LLAvatarName& av_name) -{ - mAvatarNameCacheConnection.disconnect(); - - LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID); - - if (!gdatap - || !gdatap->isMemberDataComplete() - || gdatap->getMemberVersion() != update_id) - { - // Stale data - return; - } - - addMember(member); -} - void LLPanelGroupGeneral::updateChanged() { // List all the controls we want to check for changes... @@ -867,17 +703,6 @@ void LLPanelGroupGeneral::reset() mEditCharter->setText(empty_str); mGroupNameEditor->setText(empty_str); } - - { - LLSD row; - row["columns"][0]["value"] = "no members yet"; - row["columns"][0]["column"] = "name"; - - mListVisibleMembers->deleteAllItems(); - mListVisibleMembers->setEnabled(FALSE); - mListVisibleMembers->addElement(row); - } - { mComboMature->setEnabled(true); @@ -964,18 +789,3 @@ void LLPanelGroupGeneral::setGroupID(const LLUUID& id) activate(); } -S32 LLPanelGroupGeneral::sortMembersList(S32 col_idx,const LLScrollListItem* i1,const LLScrollListItem* i2) -{ - const LLScrollListCell *cell1 = i1->getColumn(col_idx); - const LLScrollListCell *cell2 = i2->getColumn(col_idx); - - if(col_idx == 2) - { - if(LLStringUtil::compareDict(cell1->getValue().asString(),"Online") == 0 ) - return 1; - if(LLStringUtil::compareDict(cell2->getValue().asString(),"Online") == 0 ) - return -1; - } - - return LLStringUtil::compareDict(cell1->getValue().asString(), cell2->getValue().asString()); -} diff --git a/indra/newview/llpanelgroupgeneral.h b/indra/newview/llpanelgroupgeneral.h index b7f4a01139..11972bafa9 100755 --- a/indra/newview/llpanelgroupgeneral.h +++ b/indra/newview/llpanelgroupgeneral.h @@ -62,8 +62,6 @@ public: virtual void setGroupID(const LLUUID& id); virtual void setupCtrls (LLPanel* parent); - - void onNameCache(const LLUUID& update_id, LLGroupMemberData* member, const LLAvatarName& av_name); private: void reset(); @@ -75,18 +73,12 @@ private: static void onCommitEnrollment(LLUICtrl* ctrl, void* data); static void onClickInfo(void* userdata); static void onReceiveNotices(LLUICtrl* ctrl, void* data); - static void openProfile(void* data); - - S32 sortMembersList(S32,const LLScrollListItem*,const LLScrollListItem*); - void addMember(LLGroupMemberData* member); static bool joinDlgCB(const LLSD& notification, const LLSD& response); - void updateMembers(); void updateChanged(); bool confirmMatureApply(const LLSD& notification, const LLSD& response); - BOOL mPendingMemberUpdate; BOOL mChanged; BOOL mFirstUse; std::string mIncompleteMemberDataStr; @@ -97,8 +89,6 @@ private: LLTextureCtrl *mInsignia; LLTextEditor *mEditCharter; - LLNameListCtrl *mListVisibleMembers; - // Options (include any updates in updateChanged) LLCheckBoxCtrl *mCtrlShowInGroupList; LLCheckBoxCtrl *mCtrlOpenEnrollment; @@ -109,9 +99,6 @@ private: LLTextBox *mActiveTitleLabel; LLComboBox *mComboActiveTitle; LLComboBox *mComboMature; - - LLGroupMgrGroupData::member_list_t::iterator mMemberProgress; - boost::signals2::connection mAvatarNameCacheConnection; }; #endif diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp index fdcd1f5ebb..b89e7b8b73 100755 --- a/indra/newview/llpanelgrouproles.cpp +++ b/indra/newview/llpanelgrouproles.cpp @@ -1636,6 +1636,9 @@ void LLPanelGroupMembersSubTab::addMemberToList(LLGroupMemberData* data) item_params.columns.add().column("online").value(data->getOnlineStatus()) .font.name("SANSSERIF_SMALL").style("NORMAL"); + + item_params.columns.add().column("title").value(data->getTitle()).font.name("SANSSERIF_SMALL").style("NORMAL");; + mMembersList->addNameItemRow(item_params); mHasMatch = TRUE; @@ -2658,7 +2661,7 @@ void LLPanelGroupRoles::setGroupID(const LLUUID& id) button->setEnabled(gAgent.hasPowerInGroup(mGroupID, GP_MEMBER_INVITE)); if(mSubTabContainer) - mSubTabContainer->selectTab(0); + mSubTabContainer->selectTab(1); activate(); } diff --git a/indra/newview/skins/default/xui/en/panel_group_general.xml b/indra/newview/skins/default/xui/en/panel_group_general.xml index 38b680ba86..26f54bacbc 100755 --- a/indra/newview/skins/default/xui/en/panel_group_general.xml +++ b/indra/newview/skins/default/xui/en/panel_group_general.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <panel label="General" - height="604" + height="420" width="304" class="panel_group_general" name="general_tab"> @@ -101,31 +101,7 @@ Hover your mouse over the options for more help. text_readonly_color="White" word_wrap="true"> Group Charter - </text_editor> - <name_list - column_padding="0" - draw_heading="true" - follows="left|top|right" - heading_height="23" - height="160" - layout="topleft" - left="0" - name="visible_members" - short_names="false" - top_pad="2"> - <name_list.columns - label="Member" - name="name" - relative_width="0.4" /> - <name_list.columns - label="Title" - name="title" - relative_width="0.4" /> - <name_list.columns - label="Status" - name="status" - relative_width="0.2" /> - </name_list> + </text_editor> <text follows="left|top|right" type="string" diff --git a/indra/newview/skins/default/xui/en/panel_group_info_sidetray.xml b/indra/newview/skins/default/xui/en/panel_group_info_sidetray.xml index 206496cc0e..b3326d8da6 100755 --- a/indra/newview/skins/default/xui/en/panel_group_info_sidetray.xml +++ b/indra/newview/skins/default/xui/en/panel_group_info_sidetray.xml @@ -131,7 +131,7 @@ background_visible="true" expanded="false" layout="topleft" name="group_roles_tab" - title="Roles" + title="Roles & Members" fit_panel="false"> <panel border="false" diff --git a/indra/newview/skins/default/xui/en/panel_group_roles.xml b/indra/newview/skins/default/xui/en/panel_group_roles.xml index df91ad8b5e..9ac5b8800e 100755 --- a/indra/newview/skins/default/xui/en/panel_group_roles.xml +++ b/indra/newview/skins/default/xui/en/panel_group_roles.xml @@ -94,11 +94,15 @@ clicking on their names. <name_list.columns label="Donation" name="donated" - relative_width="0.25" /> + relative_width="0.2" /> <name_list.columns label="Status" name="online" - relative_width="0.14" /> + relative_width="0.18" /> + <name_list.columns + label="Title" + name="title" + relative_width="0.18" /> </name_list> <button height="23" -- cgit v1.2.3 From 52fe6676716daab90b00f4d3696b081608f07f6c Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine <mnikolenko@productengine.com> Date: Tue, 11 Feb 2014 13:58:44 +0200 Subject: MAINT-2754 FIXED Call findInstance() instead of getInstance(). --- indra/newview/llfloatersnapshot.cpp | 24 +++++++++++++++--------- indra/newview/llfloatersnapshot.h | 1 + indra/newview/llviewermenufile.cpp | 4 +++- 3 files changed, 19 insertions(+), 10 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index a416765157..d9835292a1 100755 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -1252,7 +1252,7 @@ S32 LLFloaterSnapshot::notify(const LLSD& info) //static void LLFloaterSnapshot::update() { - LLFloaterSnapshot* inst = LLFloaterReg::findTypedInstance<LLFloaterSnapshot>("snapshot"); + LLFloaterSnapshot* inst = findInstance(); LLFloaterSocial* floater_social = LLFloaterReg::findTypedInstance<LLFloaterSocial>("social"); if (!inst && !floater_social) @@ -1279,13 +1279,19 @@ LLFloaterSnapshot* LLFloaterSnapshot::getInstance() return LLFloaterReg::getTypedInstance<LLFloaterSnapshot>("snapshot"); } +// static +LLFloaterSnapshot* LLFloaterSnapshot::findInstance() +{ + return LLFloaterReg::findTypedInstance<LLFloaterSnapshot>("snapshot"); +} + // static void LLFloaterSnapshot::saveTexture() { lldebugs << "saveTexture" << llendl; // FIXME: duplicated code - LLFloaterSnapshot* instance = LLFloaterReg::findTypedInstance<LLFloaterSnapshot>("snapshot"); + LLFloaterSnapshot* instance = findInstance(); if (!instance) { llassert(instance != NULL); @@ -1306,7 +1312,7 @@ BOOL LLFloaterSnapshot::saveLocal() { lldebugs << "saveLocal" << llendl; // FIXME: duplicated code - LLFloaterSnapshot* instance = LLFloaterReg::findTypedInstance<LLFloaterSnapshot>("snapshot"); + LLFloaterSnapshot* instance = findInstance(); if (!instance) { llassert(instance != NULL); @@ -1326,7 +1332,7 @@ BOOL LLFloaterSnapshot::saveLocal() void LLFloaterSnapshot::preUpdate() { // FIXME: duplicated code - LLFloaterSnapshot* instance = LLFloaterReg::findTypedInstance<LLFloaterSnapshot>("snapshot"); + LLFloaterSnapshot* instance = findInstance(); if (instance) { // Disable the send/post/save buttons until snapshot is ready. @@ -1341,7 +1347,7 @@ void LLFloaterSnapshot::preUpdate() void LLFloaterSnapshot::postUpdate() { // FIXME: duplicated code - LLFloaterSnapshot* instance = LLFloaterReg::findTypedInstance<LLFloaterSnapshot>("snapshot"); + LLFloaterSnapshot* instance = findInstance(); if (instance) { // Enable the send/post/save buttons. @@ -1362,7 +1368,7 @@ void LLFloaterSnapshot::postUpdate() // static void LLFloaterSnapshot::postSave() { - LLFloaterSnapshot* instance = LLFloaterReg::findTypedInstance<LLFloaterSnapshot>("snapshot"); + LLFloaterSnapshot* instance = findInstance(); if (!instance) { llassert(instance != NULL); @@ -1388,7 +1394,7 @@ LLPointer<LLImageFormatted> LLFloaterSnapshot::getImageData() { // FIXME: May not work for textures. - LLFloaterSnapshot* instance = LLFloaterReg::findTypedInstance<LLFloaterSnapshot>("snapshot"); + LLFloaterSnapshot* instance = findInstance(); if (!instance) { llassert(instance != NULL); @@ -1415,7 +1421,7 @@ LLPointer<LLImageFormatted> LLFloaterSnapshot::getImageData() // static const LLVector3d& LLFloaterSnapshot::getPosTakenGlobal() { - LLFloaterSnapshot* instance = LLFloaterReg::findTypedInstance<LLFloaterSnapshot>("snapshot"); + LLFloaterSnapshot* instance = findInstance(); if (!instance) { llassert(instance != NULL); @@ -1435,7 +1441,7 @@ const LLVector3d& LLFloaterSnapshot::getPosTakenGlobal() // static void LLFloaterSnapshot::setAgentEmail(const std::string& email) { - LLFloaterSnapshot* instance = LLFloaterReg::findTypedInstance<LLFloaterSnapshot>("snapshot"); + LLFloaterSnapshot* instance = findInstance(); if (instance) { LLSideTrayPanelContainer* panel_container = instance->getChild<LLSideTrayPanelContainer>("panel_container"); diff --git a/indra/newview/llfloatersnapshot.h b/indra/newview/llfloatersnapshot.h index 82af8c7a9d..c757bf21c2 100755 --- a/indra/newview/llfloatersnapshot.h +++ b/indra/newview/llfloatersnapshot.h @@ -56,6 +56,7 @@ public: // TODO: create a snapshot model instead static LLFloaterSnapshot* getInstance(); + static LLFloaterSnapshot* findInstance(); static void saveTexture(); static BOOL saveLocal(); static void preUpdate(); diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index be78603e2d..4c95dcd6a2 100755 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -494,7 +494,9 @@ class LLFileEnableCloseAllWindows : public view_listener_t { bool handleEvent(const LLSD& userdata) { - bool open_children = gFloaterView->allChildrenClosed() && !LLFloaterSnapshot::getInstance()->isInVisibleChain(); + LLFloaterSnapshot* floater_snapshot = LLFloaterSnapshot::findInstance(); + bool is_floater_snapshot_opened = floater_snapshot && floater_snapshot->isInVisibleChain(); + bool open_children = gFloaterView->allChildrenClosed() && !is_floater_snapshot_opened; return !open_children; } }; -- cgit v1.2.3 From 7e291bb4689c45d6f470d2a1958339728c52d8ce Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine <mnikolenko@productengine.com> Date: Wed, 12 Feb 2014 12:34:41 +0200 Subject: MAINT-3465 FIXED Add check mark to selected entry. --- indra/newview/llviewermenu.cpp | 40 +++++++++++++++++++ indra/newview/skins/default/xui/en/menu_viewer.xml | 45 ++++++++++++++-------- 2 files changed, 70 insertions(+), 15 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index c7c8da27f3..59e98fc882 100755 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -8235,6 +8235,45 @@ class LLWorldEnvSettings : public view_listener_t } }; +class LLWorldEnableEnvSettings : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + bool result = false; + std::string tod = userdata.asString(); + + if (tod == "region") + { + return LLEnvManagerNew::instance().getUseRegionSettings(); + } + + if (LLEnvManagerNew::instance().getUseFixedSky()) + { + if (tod == "sunrise") + { + result = (LLEnvManagerNew::instance().getSkyPresetName() == "Sunrise"); + } + else if (tod == "noon") + { + result = (LLEnvManagerNew::instance().getSkyPresetName() == "Midday"); + } + else if (tod == "sunset") + { + result = (LLEnvManagerNew::instance().getSkyPresetName() == "Sunset"); + } + else if (tod == "midnight") + { + result = (LLEnvManagerNew::instance().getSkyPresetName() == "Midnight"); + } + else + { + llwarns << "Unknown item" << llendl; + } + } + return result; + } +}; + class LLWorldEnvPreset : public view_listener_t { bool handleEvent(const LLSD& userdata) @@ -8573,6 +8612,7 @@ void initialize_menus() view_listener_t::addMenu(new LLWorldCheckAlwaysRun(), "World.CheckAlwaysRun"); view_listener_t::addMenu(new LLWorldEnvSettings(), "World.EnvSettings"); + view_listener_t::addMenu(new LLWorldEnableEnvSettings(), "World.EnableEnvSettings"); view_listener_t::addMenu(new LLWorldEnvPreset(), "World.EnvPreset"); view_listener_t::addMenu(new LLWorldEnableEnvPreset(), "World.EnableEnvPreset"); view_listener_t::addMenu(new LLWorldPostProcess(), "World.PostProcess"); diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 636096f54b..d91b4243b2 100755 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -606,44 +606,59 @@ label="Sun" name="Sun" tear_off="true"> - <menu_item_call + <menu_item_check label="Sunrise" name="Sunrise"> - <menu_item_call.on_click + <menu_item_check.on_click function="World.EnvSettings" parameter="sunrise" /> - </menu_item_call> - <menu_item_call + <menu_item_check.on_check + function="World.EnableEnvSettings" + parameter="sunrise" /> + </menu_item_check> + <menu_item_check label="Midday" name="Noon" shortcut="control|shift|Y"> - <menu_item_call.on_click + <menu_item_check.on_click function="World.EnvSettings" parameter="noon" /> - </menu_item_call> - <menu_item_call + <menu_item_check.on_check + function="World.EnableEnvSettings" + parameter="noon" /> + </menu_item_check> + <menu_item_check label="Sunset" name="Sunset" shortcut="control|shift|N"> - <menu_item_call.on_click + <menu_item_check.on_click function="World.EnvSettings" parameter="sunset" /> - </menu_item_call> - <menu_item_call + <menu_item_check.on_check + function="World.EnableEnvSettings" + parameter="sunset" /> + </menu_item_check> + <menu_item_check label="Midnight" name="Midnight"> - <menu_item_call.on_click + <menu_item_check.on_click function="World.EnvSettings" parameter="midnight" /> - </menu_item_call> + <menu_item_check.on_check + function="World.EnableEnvSettings" + parameter="midnight" /> + </menu_item_check> <menu_item_separator/> - <menu_item_call + <menu_item_check label="Use Region Settings" name="Use Region Settings"> - <menu_item_call.on_click + <menu_item_check.on_click function="World.EnvSettings" parameter="region" /> - </menu_item_call> + <menu_item_check.on_check + function="World.EnableEnvSettings" + parameter="region" /> + </menu_item_check> </menu> -- cgit v1.2.3 From a347267cf1c55a3bd57d30117b8aa834623e1d61 Mon Sep 17 00:00:00 2001 From: Richard Linden <none@none> Date: Thu, 13 Feb 2014 15:35:21 -0800 Subject: cleaned up llmanipscale logic for readability...no change in functionality --- indra/newview/llmanipscale.cpp | 111 +++++++++++++++-------------------------- 1 file changed, 39 insertions(+), 72 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llmanipscale.cpp b/indra/newview/llmanipscale.cpp index ae0884ac5d..087f617bbb 100755 --- a/indra/newview/llmanipscale.cpp +++ b/indra/newview/llmanipscale.cpp @@ -843,121 +843,85 @@ void LLManipScale::drag( S32 x, S32 y ) // Scale around the void LLManipScale::dragCorner( S32 x, S32 y ) { - LLBBox bbox = LLSelectMgr::getInstance()->getBBoxOfSelection(); - // Suppress scale if mouse hasn't moved. if (x == mLastMouseX && y == mLastMouseY) { - // sendUpdates(TRUE,TRUE,TRUE); return; } - mLastMouseX = x; mLastMouseY = y; - LLVector3d drag_start_point_global = mDragStartPointGlobal; - LLVector3d drag_start_center_global = mDragStartCenterGlobal; - LLVector3 drag_start_point_agent = gAgent.getPosAgentFromGlobal(drag_start_point_global); - LLVector3 drag_start_center_agent = gAgent.getPosAgentFromGlobal(drag_start_center_global); + LLVector3 drag_start_point_agent = gAgent.getPosAgentFromGlobal(mDragStartPointGlobal); + LLVector3 drag_start_center_agent = gAgent.getPosAgentFromGlobal(mDragStartCenterGlobal); LLVector3d drag_start_dir_d; - drag_start_dir_d.setVec(drag_start_point_global - drag_start_center_global); - LLVector3 drag_start_dir_f; - drag_start_dir_f.setVec(drag_start_dir_d); + drag_start_dir_d.setVec(mDragStartPointGlobal - mDragStartCenterGlobal); F32 s = 0; F32 t = 0; - nearestPointOnLineFromMouse(x, y, - drag_start_center_agent, - drag_start_point_agent, - s, t ); - - F32 drag_start_dist = dist_vec(drag_start_point_agent, drag_start_center_agent); + drag_start_center_agent, + drag_start_point_agent, + s, t ); if( s <= 0 ) // we only care about intersections in front of the camera { return; } + mDragPointGlobal = lerp(mDragStartCenterGlobal, mDragStartPointGlobal, t); - LLVector3d drag_point_global = drag_start_center_global + t * drag_start_dir_d; - - F32 scale_factor = t; - - BOOL uniform = LLManipScale::getUniform(); - - if( !uniform ) - { - scale_factor = 0.5f + (scale_factor * 0.5f); - } + LLBBox bbox = LLSelectMgr::getInstance()->getBBoxOfSelection(); + F32 scale_factor = 1.f; + F32 max_scale = partToMaxScale(mManipPart, bbox); + F32 min_scale = partToMinScale(mManipPart, bbox); + BOOL uniform = LLManipScale::getUniform(); // check for snapping - LLVector3 drag_center_agent = gAgent.getPosAgentFromGlobal(drag_point_global); LLVector3 mouse_on_plane1; - getMousePointOnPlaneAgent(mouse_on_plane1, x, y, drag_center_agent, mScalePlaneNormal1); - LLVector3 mouse_on_plane2; - getMousePointOnPlaneAgent(mouse_on_plane2, x, y, drag_center_agent, mScalePlaneNormal2); - LLVector3 mouse_dir_1 = mouse_on_plane1 - mScaleCenter; - LLVector3 mouse_dir_2 = mouse_on_plane2 - mScaleCenter; - LLVector3 mouse_to_scale_line_1 = mouse_dir_1 - projected_vec(mouse_dir_1, mScaleDir); - LLVector3 mouse_to_scale_line_2 = mouse_dir_2 - projected_vec(mouse_dir_2, mScaleDir); - LLVector3 mouse_to_scale_line_dir_1 = mouse_to_scale_line_1; - mouse_to_scale_line_dir_1.normVec(); - if (mouse_to_scale_line_dir_1 * mSnapGuideDir1 < 0.f) - { - // need to keep sign of mouse offset wrt to snap guide direction - mouse_to_scale_line_dir_1 *= -1.f; - } - LLVector3 mouse_to_scale_line_dir_2 = mouse_to_scale_line_2; - mouse_to_scale_line_dir_2.normVec(); - if (mouse_to_scale_line_dir_2 * mSnapGuideDir2 < 0.f) - { - // need to keep sign of mouse offset wrt to snap guide direction - mouse_to_scale_line_dir_2 *= -1.f; - } + getMousePointOnPlaneAgent(mouse_on_plane1, x, y, mScaleCenter, mScalePlaneNormal1); + mouse_on_plane1 -= mScaleCenter; - F32 snap_dir_dot_mouse_offset1 = mSnapGuideDir1 * mouse_to_scale_line_dir_1; - F32 snap_dir_dot_mouse_offset2 = mSnapGuideDir2 * mouse_to_scale_line_dir_2; + LLVector3 mouse_on_plane2; + getMousePointOnPlaneAgent(mouse_on_plane2, x, y, mScaleCenter, mScalePlaneNormal2); + mouse_on_plane2 -= mScaleCenter; - F32 dist_from_scale_line_1 = mouse_to_scale_line_1 * mouse_to_scale_line_dir_1; - F32 dist_from_scale_line_2 = mouse_to_scale_line_2 * mouse_to_scale_line_dir_2; + LLVector3 projected_drag_pos1 = inverse_projected_vec(mScaleDir, orthogonal_component(mouse_on_plane1, mSnapGuideDir1)); + LLVector3 projected_drag_pos2 = inverse_projected_vec(mScaleDir, orthogonal_component(mouse_on_plane2, mSnapGuideDir2)); - F32 max_scale = partToMaxScale(mManipPart, bbox); - F32 min_scale = partToMinScale(mManipPart, bbox); + LLVector3 mouse_offset_from_scale_line_1 = orthogonal_component(mouse_on_plane1, mScaleDir); + LLVector3 mouse_offset_from_scale_line_2 = orthogonal_component(mouse_on_plane2, mScaleDir); BOOL snap_enabled = gSavedSettings.getBOOL("SnapEnabled"); - if (snap_enabled && dist_from_scale_line_1 > mSnapRegimeOffset * snap_dir_dot_mouse_offset1) + if (snap_enabled && (mouse_on_plane1 - projected_drag_pos1) * mSnapGuideDir1 > mSnapRegimeOffset) { - mInSnapRegime = TRUE; - LLVector3 projected_drag_pos = mouse_on_plane1 - (dist_from_scale_line_1 / snap_dir_dot_mouse_offset1) * mSnapGuideDir1; - F32 drag_dist = (projected_drag_pos - mScaleCenter) * mScaleDir; + F32 drag_dist = projected_drag_pos1.length(); - F32 cur_subdivisions = llclamp(getSubdivisionLevel(projected_drag_pos, mScaleDir, mScaleSnapUnit1), sGridMinSubdivisionLevel, sGridMaxSubdivisionLevel); + F32 cur_subdivisions = llclamp(getSubdivisionLevel(projected_drag_pos1, mScaleDir, mScaleSnapUnit1), sGridMinSubdivisionLevel, sGridMaxSubdivisionLevel); F32 snap_dist = mScaleSnapUnit1 / (2.f * cur_subdivisions); F32 relative_snap_dist = fmodf(drag_dist + snap_dist, mScaleSnapUnit1 / cur_subdivisions); mScaleSnapValue = llclamp((drag_dist - (relative_snap_dist - snap_dist)), min_scale, max_scale); - scale_factor = mScaleSnapValue / drag_start_dist; - if( !uniform ) + mInSnapRegime = TRUE; + scale_factor = mScaleSnapValue / dist_vec(drag_start_point_agent, drag_start_center_agent); + if (!uniform) { scale_factor *= 0.5f; } } - else if (snap_enabled && dist_from_scale_line_2 > mSnapRegimeOffset * snap_dir_dot_mouse_offset2) + else if (snap_enabled && (mouse_on_plane2 - projected_drag_pos2) * mSnapGuideDir2 > mSnapRegimeOffset ) { - mInSnapRegime = TRUE; - LLVector3 projected_drag_pos = mouse_on_plane2 - (dist_from_scale_line_2 / snap_dir_dot_mouse_offset2) * mSnapGuideDir2; - F32 drag_dist = (projected_drag_pos - mScaleCenter) * mScaleDir; + F32 drag_dist = projected_drag_pos2.length(); - F32 cur_subdivisions = llclamp(getSubdivisionLevel(projected_drag_pos, mScaleDir, mScaleSnapUnit2), sGridMinSubdivisionLevel, sGridMaxSubdivisionLevel); + F32 cur_subdivisions = llclamp(getSubdivisionLevel(projected_drag_pos2, mScaleDir, mScaleSnapUnit2), sGridMinSubdivisionLevel, sGridMaxSubdivisionLevel); F32 snap_dist = mScaleSnapUnit2 / (2.f * cur_subdivisions); F32 relative_snap_dist = fmodf(drag_dist + snap_dist, mScaleSnapUnit2 / cur_subdivisions); mScaleSnapValue = llclamp((drag_dist - (relative_snap_dist - snap_dist)), min_scale, max_scale); - scale_factor = mScaleSnapValue / drag_start_dist; - if( !uniform ) + mInSnapRegime = TRUE; + scale_factor = mScaleSnapValue / dist_vec(drag_start_point_agent, drag_start_center_agent); + if (!uniform) { scale_factor *= 0.5f; } @@ -965,8 +929,14 @@ void LLManipScale::dragCorner( S32 x, S32 y ) else { mInSnapRegime = FALSE; + scale_factor = t; + if (!uniform) + { + scale_factor = 0.5f + (scale_factor * 0.5f); + } } + F32 max_scale_factor = get_default_max_prim_scale() / MIN_PRIM_SCALE; F32 min_scale_factor = MIN_PRIM_SCALE / get_default_max_prim_scale(); @@ -1069,9 +1039,6 @@ void LLManipScale::dragCorner( S32 x, S32 y ) } } - - - mDragPointGlobal = drag_point_global; } -- cgit v1.2.3 From 1033c9d67f6bf3fd317bc2e6a6990e2b7e5d80c8 Mon Sep 17 00:00:00 2001 From: maksymsproductengine <maksymsproductengine@lindenlab.com> Date: Wed, 5 Feb 2014 20:45:09 +0200 Subject: MAINT-3555 crash in LLPanel::~LLPanel() on shutdown: - memory leaks fixing; --- indra/newview/llappviewerwin32.cpp | 8 -------- indra/newview/llcofwearables.cpp | 2 +- indra/newview/llfloatercamera.cpp | 2 +- indra/newview/llfloaterpreference.cpp | 6 +++--- indra/newview/llfloatersocial.cpp | 8 ++++---- indra/newview/lloutfitslist.cpp | 2 +- indra/newview/llpanelblockedlist.cpp | 2 +- indra/newview/llpaneleditwearable.cpp | 2 +- indra/newview/llpanelgroup.cpp | 2 +- indra/newview/llpanelgroupgeneral.cpp | 2 +- indra/newview/llpanelgrouplandmoney.cpp | 2 +- indra/newview/llpanelgroupnotices.cpp | 2 +- indra/newview/llpanelgrouproles.cpp | 8 ++++---- indra/newview/llpanelhome.cpp | 2 +- indra/newview/llpanellandmarkinfo.cpp | 2 +- indra/newview/llpanelmaininventory.cpp | 2 +- indra/newview/llpanelmarketplaceinbox.cpp | 2 +- indra/newview/llpanelme.cpp | 2 +- indra/newview/llpaneloutfitedit.cpp | 2 +- indra/newview/llpaneloutfitsinventory.cpp | 2 +- indra/newview/llpanelpeople.cpp | 2 +- indra/newview/llpanelpicks.cpp | 2 +- indra/newview/llpanelplaceprofile.cpp | 2 +- indra/newview/llpanelplaces.cpp | 2 +- indra/newview/llpanelsnapshotinventory.cpp | 2 +- indra/newview/llpanelsnapshotlocal.cpp | 2 +- indra/newview/llpanelsnapshotoptions.cpp | 2 +- indra/newview/llpanelsnapshotpostcard.cpp | 2 +- indra/newview/llpanelsnapshotprofile.cpp | 2 +- indra/newview/llpanelvoicedevicesettings.cpp | 2 +- indra/newview/llpanelvoiceeffect.cpp | 2 +- indra/newview/llpanelwearing.cpp | 2 +- indra/newview/llpopupview.cpp | 2 +- indra/newview/llprogressview.cpp | 2 +- indra/newview/llsidepanelappearance.cpp | 2 +- indra/newview/llsidepanelinventory.cpp | 2 +- indra/newview/llsidepaneliteminfo.cpp | 2 +- indra/newview/llsidepaneltaskinfo.cpp | 2 +- indra/newview/lltool.h | 2 +- indra/newview/lltoolcomp.cpp | 2 +- 40 files changed, 47 insertions(+), 55 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index 80a80f4298..2764025d75 100755 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -200,14 +200,6 @@ int APIENTRY WINMAIN(HINSTANCE hInstance, LPSTR lpCmdLine, int nCmdShow) { -#ifdef INCLUDE_VLD - // only works for debug builds (hard coded into vld.h) - #ifdef _DEBUG - // start with Visual Leak Detector turned off - VLDGlobalDisable(); - #endif // _DEBUG -#endif // INCLUDE_VLD - const S32 MAX_HEAPS = 255; DWORD heap_enable_lfh_error[MAX_HEAPS]; S32 num_heaps = 0; diff --git a/indra/newview/llcofwearables.cpp b/indra/newview/llcofwearables.cpp index e86d6930e8..e200e0ee9e 100755 --- a/indra/newview/llcofwearables.cpp +++ b/indra/newview/llcofwearables.cpp @@ -43,7 +43,7 @@ #include "llpaneloutfitedit.h" #include "lltrans.h" -static LLRegisterPanelClassWrapper<LLCOFWearables> t_cof_wearables("cof_wearables"); +static LLPanelInjector<LLCOFWearables> t_cof_wearables("cof_wearables"); const LLSD REARRANGE = LLSD().with("rearrange", LLSD()); diff --git a/indra/newview/llfloatercamera.cpp b/indra/newview/llfloatercamera.cpp index c85d048c5a..d0939b3eee 100755 --- a/indra/newview/llfloatercamera.cpp +++ b/indra/newview/llfloatercamera.cpp @@ -151,7 +151,7 @@ void LLPanelCameraItem::setValue(const LLSD& value) getChildView("selected_picture")->setVisible( value["selected"]); } -static LLRegisterPanelClassWrapper<LLPanelCameraZoom> t_camera_zoom_panel("camera_zoom_panel"); +static LLPanelInjector<LLPanelCameraZoom> t_camera_zoom_panel("camera_zoom_panel"); //------------------------------------------------------------------------------- // LLPanelCameraZoom diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index c339ee3beb..b50a2e6f85 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -1823,7 +1823,7 @@ private: callback_t mCallback; }; //---------------------------------------------------------------------------- -static LLRegisterPanelClassWrapper<LLPanelPreference> t_places("panel_preference"); +static LLPanelInjector<LLPanelPreference> t_places("panel_preference"); LLPanelPreference::LLPanelPreference() : LLPanel(), mBandWidthUpdater(NULL) @@ -2063,8 +2063,8 @@ private: std::list<std::string> mAccountIndependentSettings; }; -static LLRegisterPanelClassWrapper<LLPanelPreferenceGraphics> t_pref_graph("panel_preference_graphics"); -static LLRegisterPanelClassWrapper<LLPanelPreferencePrivacy> t_pref_privacy("panel_preference_privacy"); +static LLPanelInjector<LLPanelPreferenceGraphics> t_pref_graph("panel_preference_graphics"); +static LLPanelInjector<LLPanelPreferencePrivacy> t_pref_privacy("panel_preference_privacy"); BOOL LLPanelPreferenceGraphics::postBuild() { diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp index 2a74c8e3ea..9490769d8c 100644 --- a/indra/newview/llfloatersocial.cpp +++ b/indra/newview/llfloatersocial.cpp @@ -47,10 +47,10 @@ #include "llviewercontrol.h" #include "llviewermedia.h" -static LLRegisterPanelClassWrapper<LLSocialStatusPanel> t_panel_status("llsocialstatuspanel"); -static LLRegisterPanelClassWrapper<LLSocialPhotoPanel> t_panel_photo("llsocialphotopanel"); -static LLRegisterPanelClassWrapper<LLSocialCheckinPanel> t_panel_checkin("llsocialcheckinpanel"); -static LLRegisterPanelClassWrapper<LLSocialAccountPanel> t_panel_account("llsocialaccountpanel"); +static LLPanelInjector<LLSocialStatusPanel> t_panel_status("llsocialstatuspanel"); +static LLPanelInjector<LLSocialPhotoPanel> t_panel_photo("llsocialphotopanel"); +static LLPanelInjector<LLSocialCheckinPanel> t_panel_checkin("llsocialcheckinpanel"); +static LLPanelInjector<LLSocialAccountPanel> t_panel_account("llsocialaccountpanel"); const S32 MAX_POSTCARD_DATASIZE = 1024 * 1024; // one megabyte const std::string DEFAULT_CHECKIN_LOCATION_URL = "http://maps.secondlife.com/"; diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp index c15b6bd0d3..ff8bfafb79 100755 --- a/indra/newview/lloutfitslist.cpp +++ b/indra/newview/lloutfitslist.cpp @@ -343,7 +343,7 @@ private: ////////////////////////////////////////////////////////////////////////// -static LLRegisterPanelClassWrapper<LLOutfitsList> t_outfits_list("outfits_list"); +static LLPanelInjector<LLOutfitsList> t_outfits_list("outfits_list"); LLOutfitsList::LLOutfitsList() : LLPanelAppearanceTab() diff --git a/indra/newview/llpanelblockedlist.cpp b/indra/newview/llpanelblockedlist.cpp index 115114bb53..9665314e75 100755 --- a/indra/newview/llpanelblockedlist.cpp +++ b/indra/newview/llpanelblockedlist.cpp @@ -48,7 +48,7 @@ #include "llsidetraypanelcontainer.h" #include "llviewercontrol.h" -static LLRegisterPanelClassWrapper<LLPanelBlockedList> t_panel_blocked_list("panel_block_list_sidetray"); +static LLPanelInjector<LLPanelBlockedList> t_panel_blocked_list("panel_block_list_sidetray"); // // Constants diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp index e71dba5cae..0621cc8fad 100755 --- a/indra/newview/llpaneleditwearable.cpp +++ b/indra/newview/llpaneleditwearable.cpp @@ -62,7 +62,7 @@ #include "llappearancemgr.h" // register panel with appropriate XML -static LLRegisterPanelClassWrapper<LLPanelEditWearable> t_edit_wearable("panel_edit_wearable"); +static LLPanelInjector<LLPanelEditWearable> t_edit_wearable("panel_edit_wearable"); // subparts of the UI for focus, camera position, etc. enum ESubpart { diff --git a/indra/newview/llpanelgroup.cpp b/indra/newview/llpanelgroup.cpp index a0ca82da46..c872a15af7 100755 --- a/indra/newview/llpanelgroup.cpp +++ b/indra/newview/llpanelgroup.cpp @@ -56,7 +56,7 @@ #include "lltrans.h" -static LLRegisterPanelClassWrapper<LLPanelGroup> t_panel_group("panel_group_info_sidetray"); +static LLPanelInjector<LLPanelGroup> t_panel_group("panel_group_info_sidetray"); diff --git a/indra/newview/llpanelgroupgeneral.cpp b/indra/newview/llpanelgroupgeneral.cpp index 68835ec5b8..eaf33c7108 100755 --- a/indra/newview/llpanelgroupgeneral.cpp +++ b/indra/newview/llpanelgroupgeneral.cpp @@ -53,7 +53,7 @@ #include "lltrans.h" #include "llviewerwindow.h" -static LLRegisterPanelClassWrapper<LLPanelGroupGeneral> t_panel_group_general("panel_group_general"); +static LLPanelInjector<LLPanelGroupGeneral> t_panel_group_general("panel_group_general"); // consts const S32 MATURE_CONTENT = 1; diff --git a/indra/newview/llpanelgrouplandmoney.cpp b/indra/newview/llpanelgrouplandmoney.cpp index c927aeacb3..17707557bb 100755 --- a/indra/newview/llpanelgrouplandmoney.cpp +++ b/indra/newview/llpanelgrouplandmoney.cpp @@ -55,7 +55,7 @@ #include "llfloaterworldmap.h" #include "llviewermessage.h" -static LLRegisterPanelClassWrapper<LLPanelGroupLandMoney> t_panel_group_money("panel_group_land_money"); +static LLPanelInjector<LLPanelGroupLandMoney> t_panel_group_money("panel_group_land_money"); diff --git a/indra/newview/llpanelgroupnotices.cpp b/indra/newview/llpanelgroupnotices.cpp index 522ba5afae..0dfb8fef53 100755 --- a/indra/newview/llpanelgroupnotices.cpp +++ b/indra/newview/llpanelgroupnotices.cpp @@ -57,7 +57,7 @@ #include "llnotificationsutil.h" #include "llgiveinventory.h" -static LLRegisterPanelClassWrapper<LLPanelGroupNotices> t_panel_group_notices("panel_group_notices"); +static LLPanelInjector<LLPanelGroupNotices> t_panel_group_notices("panel_group_notices"); ///////////////////////// diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp index b89e7b8b73..c30c932c41 100755 --- a/indra/newview/llpanelgrouproles.cpp +++ b/indra/newview/llpanelgrouproles.cpp @@ -55,7 +55,7 @@ #include "roles_constants.h" -static LLRegisterPanelClassWrapper<LLPanelGroupRoles> t_panel_group_roles("panel_group_roles"); +static LLPanelInjector<LLPanelGroupRoles> t_panel_group_roles("panel_group_roles"); bool agentCanRemoveFromRole(const LLUUID& group_id, const LLUUID& role_id) @@ -733,7 +733,7 @@ void LLPanelGroupSubTab::setFooterEnabled(BOOL enable) //////////////////////////// -static LLRegisterPanelClassWrapper<LLPanelGroupMembersSubTab> t_panel_group_members_subtab("panel_group_members_subtab"); +static LLPanelInjector<LLPanelGroupMembersSubTab> t_panel_group_members_subtab("panel_group_members_subtab"); LLPanelGroupMembersSubTab::LLPanelGroupMembersSubTab() : LLPanelGroupSubTab(), @@ -1755,7 +1755,7 @@ void LLPanelGroupMembersSubTab::updateMembers() // LLPanelGroupRolesSubTab //////////////////////////// -static LLRegisterPanelClassWrapper<LLPanelGroupRolesSubTab> t_panel_group_roles_subtab("panel_group_roles_subtab"); +static LLPanelInjector<LLPanelGroupRolesSubTab> t_panel_group_roles_subtab("panel_group_roles_subtab"); LLPanelGroupRolesSubTab::LLPanelGroupRolesSubTab() : LLPanelGroupSubTab(), @@ -2469,7 +2469,7 @@ void LLPanelGroupRolesSubTab::saveRoleChanges(bool select_saved_role) // LLPanelGroupActionsSubTab //////////////////////////// -static LLRegisterPanelClassWrapper<LLPanelGroupActionsSubTab> t_panel_group_actions_subtab("panel_group_actions_subtab"); +static LLPanelInjector<LLPanelGroupActionsSubTab> t_panel_group_actions_subtab("panel_group_actions_subtab"); LLPanelGroupActionsSubTab::LLPanelGroupActionsSubTab() diff --git a/indra/newview/llpanelhome.cpp b/indra/newview/llpanelhome.cpp index b03bab3127..ab0ccffae4 100755 --- a/indra/newview/llpanelhome.cpp +++ b/indra/newview/llpanelhome.cpp @@ -31,7 +31,7 @@ #include "llmediactrl.h" #include "llviewerhome.h" -static LLRegisterPanelClassWrapper<LLPanelHome> t_home("panel_sidetray_home"); +static LLPanelInjector<LLPanelHome> t_home("panel_sidetray_home"); LLPanelHome::LLPanelHome() : LLPanel(), diff --git a/indra/newview/llpanellandmarkinfo.cpp b/indra/newview/llpanellandmarkinfo.cpp index 5c9b968ac9..934f8ed8c7 100755 --- a/indra/newview/llpanellandmarkinfo.cpp +++ b/indra/newview/llpanellandmarkinfo.cpp @@ -53,7 +53,7 @@ typedef std::pair<LLUUID, std::string> folder_pair_t; static bool cmp_folders(const folder_pair_t& left, const folder_pair_t& right); static void collectLandmarkFolders(LLInventoryModel::cat_array_t& cats); -static LLRegisterPanelClassWrapper<LLPanelLandmarkInfo> t_landmark_info("panel_landmark_info"); +static LLPanelInjector<LLPanelLandmarkInfo> t_landmark_info("panel_landmark_info"); // Statics for textures filenames static std::string icon_pg; diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index bd173fadc7..68c22c12fd 100755 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -58,7 +58,7 @@ const std::string FILTERS_FILENAME("filters.xml"); -static LLRegisterPanelClassWrapper<LLPanelMainInventory> t_inventory("panel_main_inventory"); +static LLPanelInjector<LLPanelMainInventory> t_inventory("panel_main_inventory"); void on_file_loaded_for_save(BOOL success, LLViewerFetchedTexture *src_vi, diff --git a/indra/newview/llpanelmarketplaceinbox.cpp b/indra/newview/llpanelmarketplaceinbox.cpp index dcecce6fe4..79e079f6bd 100755 --- a/indra/newview/llpanelmarketplaceinbox.cpp +++ b/indra/newview/llpanelmarketplaceinbox.cpp @@ -38,7 +38,7 @@ #include "llviewercontrol.h" -static LLRegisterPanelClassWrapper<LLPanelMarketplaceInbox> t_panel_marketplace_inbox("panel_marketplace_inbox"); +static LLPanelInjector<LLPanelMarketplaceInbox> t_panel_marketplace_inbox("panel_marketplace_inbox"); const LLPanelMarketplaceInbox::Params& LLPanelMarketplaceInbox::getDefaultParams() { diff --git a/indra/newview/llpanelme.cpp b/indra/newview/llpanelme.cpp index a9af56f750..7a408e736f 100755 --- a/indra/newview/llpanelme.cpp +++ b/indra/newview/llpanelme.cpp @@ -48,7 +48,7 @@ #include "lltabcontainer.h" #include "lltexturectrl.h" -static LLRegisterPanelClassWrapper<LLPanelMe> t_panel_me_profile("panel_me"); +static LLPanelInjector<LLPanelMe> t_panel_me_profile("panel_me"); LLPanelMe::LLPanelMe(void) : LLPanelProfile() diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index c09d4393c8..f75d76da94 100755 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -74,7 +74,7 @@ #include "llwearabletype.h" #include "llweb.h" -static LLRegisterPanelClassWrapper<LLPanelOutfitEdit> t_outfit_edit("panel_outfit_edit"); +static LLPanelInjector<LLPanelOutfitEdit> t_outfit_edit("panel_outfit_edit"); const U64 WEARABLE_MASK = (1LL << LLInventoryType::IT_WEARABLE); const U64 ATTACHMENT_MASK = (1LL << LLInventoryType::IT_ATTACHMENT) | (1LL << LLInventoryType::IT_OBJECT); diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index f90236f6f2..e0132d20fb 100755 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -46,7 +46,7 @@ static const std::string OUTFITS_TAB_NAME = "outfitslist_tab"; static const std::string COF_TAB_NAME = "cof_tab"; -static LLRegisterPanelClassWrapper<LLPanelOutfitsInventory> t_inventory("panel_outfits_inventory"); +static LLPanelInjector<LLPanelOutfitsInventory> t_inventory("panel_outfits_inventory"); LLPanelOutfitsInventory::LLPanelOutfitsInventory() : mMyOutfitsPanel(NULL), diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index f551fc96ee..f5542ee7a6 100755 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -216,7 +216,7 @@ static const LLAvatarItemStatusComparator STATUS_COMPARATOR; static LLAvatarItemDistanceComparator DISTANCE_COMPARATOR; static const LLAvatarItemRecentSpeakerComparator RECENT_SPEAKER_COMPARATOR; -static LLRegisterPanelClassWrapper<LLPanelPeople> t_people("panel_people"); +static LLPanelInjector<LLPanelPeople> t_people("panel_people"); //============================================================================= diff --git a/indra/newview/llpanelpicks.cpp b/indra/newview/llpanelpicks.cpp index cfbc8f1a94..f0617266db 100755 --- a/indra/newview/llpanelpicks.cpp +++ b/indra/newview/llpanelpicks.cpp @@ -69,7 +69,7 @@ static const std::string CLASSIFIED_ID("classified_id"); static const std::string CLASSIFIED_NAME("classified_name"); -static LLRegisterPanelClassWrapper<LLPanelPicks> t_panel_picks("panel_picks"); +static LLPanelInjector<LLPanelPicks> t_panel_picks("panel_picks"); class LLPickHandler : public LLCommandHandler, diff --git a/indra/newview/llpanelplaceprofile.cpp b/indra/newview/llpanelplaceprofile.cpp index 5d9971c16c..14b5d9af47 100755 --- a/indra/newview/llpanelplaceprofile.cpp +++ b/indra/newview/llpanelplaceprofile.cpp @@ -53,7 +53,7 @@ #include "llviewerparcelmgr.h" #include "llviewerregion.h" -static LLRegisterPanelClassWrapper<LLPanelPlaceProfile> t_place_profile("panel_place_profile"); +static LLPanelInjector<LLPanelPlaceProfile> t_place_profile("panel_place_profile"); // Statics for textures filenames static std::string icon_pg; diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index 8bb3ace2d9..499b9ab62e 100755 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -229,7 +229,7 @@ private: }; -static LLRegisterPanelClassWrapper<LLPanelPlaces> t_places("panel_places"); +static LLPanelInjector<LLPanelPlaces> t_places("panel_places"); LLPanelPlaces::LLPanelPlaces() : LLPanel(), diff --git a/indra/newview/llpanelsnapshotinventory.cpp b/indra/newview/llpanelsnapshotinventory.cpp index 381c11348d..47e46a968f 100755 --- a/indra/newview/llpanelsnapshotinventory.cpp +++ b/indra/newview/llpanelsnapshotinventory.cpp @@ -60,7 +60,7 @@ private: void onSend(); }; -static LLRegisterPanelClassWrapper<LLPanelSnapshotInventory> panel_class("llpanelsnapshotinventory"); +static LLPanelInjector<LLPanelSnapshotInventory> panel_class("llpanelsnapshotinventory"); LLPanelSnapshotInventory::LLPanelSnapshotInventory() { diff --git a/indra/newview/llpanelsnapshotlocal.cpp b/indra/newview/llpanelsnapshotlocal.cpp index d153ff598d..43e38b95e2 100755 --- a/indra/newview/llpanelsnapshotlocal.cpp +++ b/indra/newview/llpanelsnapshotlocal.cpp @@ -63,7 +63,7 @@ private: void onSaveFlyoutCommit(LLUICtrl* ctrl); }; -static LLRegisterPanelClassWrapper<LLPanelSnapshotLocal> panel_class("llpanelsnapshotlocal"); +static LLPanelInjector<LLPanelSnapshotLocal> panel_class("llpanelsnapshotlocal"); LLPanelSnapshotLocal::LLPanelSnapshotLocal() { diff --git a/indra/newview/llpanelsnapshotoptions.cpp b/indra/newview/llpanelsnapshotoptions.cpp index 554fabe5b3..455c1c9e5f 100755 --- a/indra/newview/llpanelsnapshotoptions.cpp +++ b/indra/newview/llpanelsnapshotoptions.cpp @@ -56,7 +56,7 @@ private: void onSaveToComputer(); }; -static LLRegisterPanelClassWrapper<LLPanelSnapshotOptions> panel_class("llpanelsnapshotoptions"); +static LLPanelInjector<LLPanelSnapshotOptions> panel_class("llpanelsnapshotoptions"); LLPanelSnapshotOptions::LLPanelSnapshotOptions() { diff --git a/indra/newview/llpanelsnapshotpostcard.cpp b/indra/newview/llpanelsnapshotpostcard.cpp index f2bb8f530b..aa109e9a51 100755 --- a/indra/newview/llpanelsnapshotpostcard.cpp +++ b/indra/newview/llpanelsnapshotpostcard.cpp @@ -79,7 +79,7 @@ private: std::string mAgentEmail; }; -static LLRegisterPanelClassWrapper<LLPanelSnapshotPostcard> panel_class("llpanelsnapshotpostcard"); +static LLPanelInjector<LLPanelSnapshotPostcard> panel_class("llpanelsnapshotpostcard"); LLPanelSnapshotPostcard::LLPanelSnapshotPostcard() : mHasFirstMsgFocus(false) diff --git a/indra/newview/llpanelsnapshotprofile.cpp b/indra/newview/llpanelsnapshotprofile.cpp index a706318369..8949eb73eb 100755 --- a/indra/newview/llpanelsnapshotprofile.cpp +++ b/indra/newview/llpanelsnapshotprofile.cpp @@ -64,7 +64,7 @@ private: void onSend(); }; -static LLRegisterPanelClassWrapper<LLPanelSnapshotProfile> panel_class("llpanelsnapshotprofile"); +static LLPanelInjector<LLPanelSnapshotProfile> panel_class("llpanelsnapshotprofile"); LLPanelSnapshotProfile::LLPanelSnapshotProfile() { diff --git a/indra/newview/llpanelvoicedevicesettings.cpp b/indra/newview/llpanelvoicedevicesettings.cpp index 6be2ea6481..6f0a1624a7 100755 --- a/indra/newview/llpanelvoicedevicesettings.cpp +++ b/indra/newview/llpanelvoicedevicesettings.cpp @@ -40,7 +40,7 @@ #include "lluictrlfactory.h" -static LLRegisterPanelClassWrapper<LLPanelVoiceDeviceSettings> t_panel_group_general("panel_voice_device_settings"); +static LLPanelInjector<LLPanelVoiceDeviceSettings> t_panel_group_general("panel_voice_device_settings"); static const std::string DEFAULT_DEVICE("Default"); diff --git a/indra/newview/llpanelvoiceeffect.cpp b/indra/newview/llpanelvoiceeffect.cpp index 5fec6d967d..7da553801a 100755 --- a/indra/newview/llpanelvoiceeffect.cpp +++ b/indra/newview/llpanelvoiceeffect.cpp @@ -36,7 +36,7 @@ #include "lltransientfloatermgr.h" #include "llvoiceclient.h" -static LLRegisterPanelClassWrapper<LLPanelVoiceEffect> t_panel_voice_effect("panel_voice_effect"); +static LLPanelInjector<LLPanelVoiceEffect> t_panel_voice_effect("panel_voice_effect"); LLPanelVoiceEffect::LLPanelVoiceEffect() : mVoiceEffectCombo(NULL) diff --git a/indra/newview/llpanelwearing.cpp b/indra/newview/llpanelwearing.cpp index aa3ed22bee..edb624e3aa 100755 --- a/indra/newview/llpanelwearing.cpp +++ b/indra/newview/llpanelwearing.cpp @@ -151,7 +151,7 @@ protected: std::string LLPanelAppearanceTab::sFilterSubString = LLStringUtil::null; -static LLRegisterPanelClassWrapper<LLPanelWearing> t_panel_wearing("panel_wearing"); +static LLPanelInjector<LLPanelWearing> t_panel_wearing("panel_wearing"); LLPanelWearing::LLPanelWearing() : LLPanelAppearanceTab() diff --git a/indra/newview/llpopupview.cpp b/indra/newview/llpopupview.cpp index 08829c1184..153f0930c2 100755 --- a/indra/newview/llpopupview.cpp +++ b/indra/newview/llpopupview.cpp @@ -27,7 +27,7 @@ #include "llpopupview.h" -static LLRegisterPanelClassWrapper<LLPopupView> r("popup_holder"); +static LLPanelInjector<LLPopupView> r("popup_holder"); bool view_visible_and_enabled(LLView* viewp) { diff --git a/indra/newview/llprogressview.cpp b/indra/newview/llprogressview.cpp index 989f0b0e60..1257ee7f94 100755 --- a/indra/newview/llprogressview.cpp +++ b/indra/newview/llprogressview.cpp @@ -59,7 +59,7 @@ S32 gStartImageWidth = 1; S32 gStartImageHeight = 1; const F32 FADE_TO_WORLD_TIME = 1.0f; -static LLRegisterPanelClassWrapper<LLProgressView> r("progress_view"); +static LLPanelInjector<LLProgressView> r("progress_view"); // XUI: Translate LLProgressView::LLProgressView() diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp index df413ab849..ec6a1d9bdc 100755 --- a/indra/newview/llsidepanelappearance.cpp +++ b/indra/newview/llsidepanelappearance.cpp @@ -49,7 +49,7 @@ #include "llvoavatarself.h" #include "llviewerwearable.h" -static LLRegisterPanelClassWrapper<LLSidepanelAppearance> t_appearance("sidepanel_appearance"); +static LLPanelInjector<LLSidepanelAppearance> t_appearance("sidepanel_appearance"); class LLCurrentlyWornFetchObserver : public LLInventoryFetchItemsObserver { diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index fe844ce5e4..1ce691f696 100755 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -59,7 +59,7 @@ #include "llviewernetwork.h" #include "llweb.h" -static LLRegisterPanelClassWrapper<LLSidepanelInventory> t_inventory("sidepanel_inventory"); +static LLPanelInjector<LLSidepanelInventory> t_inventory("sidepanel_inventory"); // // Constants diff --git a/indra/newview/llsidepaneliteminfo.cpp b/indra/newview/llsidepaneliteminfo.cpp index 92c2863ffd..e52b2f2559 100755 --- a/indra/newview/llsidepaneliteminfo.cpp +++ b/indra/newview/llsidepaneliteminfo.cpp @@ -127,7 +127,7 @@ void LLObjectInventoryObserver::inventoryChanged(LLViewerObject* object, /// Class LLSidepanelItemInfo ///---------------------------------------------------------------------------- -static LLRegisterPanelClassWrapper<LLSidepanelItemInfo> t_item_info("sidepanel_item_info"); +static LLPanelInjector<LLSidepanelItemInfo> t_item_info("sidepanel_item_info"); // Default constructor LLSidepanelItemInfo::LLSidepanelItemInfo(const LLPanel::Params& p) diff --git a/indra/newview/llsidepaneltaskinfo.cpp b/indra/newview/llsidepaneltaskinfo.cpp index 9be6d0c5f1..4428098929 100755 --- a/indra/newview/llsidepaneltaskinfo.cpp +++ b/indra/newview/llsidepaneltaskinfo.cpp @@ -71,7 +71,7 @@ LLSidepanelTaskInfo* LLSidepanelTaskInfo::sActivePanel = NULL; -static LLRegisterPanelClassWrapper<LLSidepanelTaskInfo> t_task_info("sidepanel_task_info"); +static LLPanelInjector<LLSidepanelTaskInfo> t_task_info("sidepanel_task_info"); // Default constructor LLSidepanelTaskInfo::LLSidepanelTaskInfo() diff --git a/indra/newview/lltool.h b/indra/newview/lltool.h index ecc435d844..c5bad9d532 100755 --- a/indra/newview/lltool.h +++ b/indra/newview/lltool.h @@ -39,7 +39,7 @@ class LLView; class LLPanel; class LLTool -: public LLMouseHandler +: public LLMouseHandler, public LLThreadSafeRefCount { public: LLTool( const std::string& name, LLToolComposite* composite = NULL ); diff --git a/indra/newview/lltoolcomp.cpp b/indra/newview/lltoolcomp.cpp index 5270c3d33f..b75d6b3dcb 100755 --- a/indra/newview/lltoolcomp.cpp +++ b/indra/newview/lltoolcomp.cpp @@ -61,7 +61,7 @@ extern LLControlGroup gSavedSettings; // we use this in various places instead of NULL -static LLTool* sNullTool = new LLTool(std::string("null"), NULL); +static LLPointer<LLTool> sNullTool(new LLTool(std::string("null"), NULL)); //----------------------------------------------------------------------- // LLToolComposite -- cgit v1.2.3 From 16aec9dca7836505b58f5d4306ccf64b096c9fcd Mon Sep 17 00:00:00 2001 From: akl <none@none> Date: Mon, 24 Feb 2014 19:30:30 +0200 Subject: MAINT-2588 FIXED User cannot delete items from content of other object, using 'Delete' button on keyboard. --- indra/newview/llpanelobjectinventory.cpp | 43 ++++++++++++++++++++++++++++++++ indra/newview/llpanelobjectinventory.h | 3 +++ 2 files changed, 46 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index bb063f48a5..6c9616511f 100755 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -2011,3 +2011,46 @@ void LLPanelObjectInventory::clearItemIDs() mItemMap.clear(); } +BOOL LLPanelObjectInventory::handleKeyHere( KEY key, MASK mask ) +{ + BOOL handled = FALSE; + switch (key) + { + case KEY_DELETE: + case KEY_BACKSPACE: + // Delete selected items if delete or backspace key hit on the inventory panel + // Note: on Mac laptop keyboards, backspace and delete are one and the same + if (isSelectionRemovable() && mask == MASK_NONE) + { + LLInventoryAction::doToSelected(&gInventory, mFolders, "delete"); + handled = TRUE; + } + break; + } + return handled; +} + +BOOL LLPanelObjectInventory::isSelectionRemovable() +{ + if (!mFolders || !mFolders->getRoot()) + { + return FALSE; + } + std::set<LLFolderViewItem*> selection_set = mFolders->getRoot()->getSelectionList(); + if (selection_set.empty()) + { + return FALSE; + } + for (std::set<LLFolderViewItem*>::iterator iter = selection_set.begin(); + iter != selection_set.end(); + ++iter) + { + LLFolderViewItem *item = *iter; + const LLFolderViewModelItemInventory *listener = dynamic_cast<const LLFolderViewModelItemInventory*>(item->getViewModelItem()); + if (!listener || !listener->isItemRemovable() || listener->isItemInTrash()) + { + return FALSE; + } + } + return TRUE; +} diff --git a/indra/newview/llpanelobjectinventory.h b/indra/newview/llpanelobjectinventory.h index f497c695b3..9559f7e886 100755 --- a/indra/newview/llpanelobjectinventory.h +++ b/indra/newview/llpanelobjectinventory.h @@ -94,6 +94,9 @@ protected: void removeItemID(const LLUUID& id); void clearItemIDs(); + BOOL handleKeyHere( KEY key, MASK mask ); + BOOL isSelectionRemovable(); + private: std::map<LLUUID, LLFolderViewItem*> mItemMap; -- cgit v1.2.3 From 36c8c92098004c4f2eb80114a49f3660a2d3dcbb Mon Sep 17 00:00:00 2001 From: maksymsproductengine <maksymsproductengine@lindenlab.com> Date: Fri, 14 Mar 2014 06:39:09 +0200 Subject: MAINT-3804 FIXED Crash in LLAudioEngine::getAudioData when playing gestures with audio device disabled. --- indra/newview/lldeferredsounds.cpp | 5 ++- indra/newview/llpanelnearbymedia.cpp | 9 +++++ indra/newview/llpreviewsound.cpp | 2 + indra/newview/llstartup.cpp | 9 ++--- indra/newview/llvieweraudio.cpp | 76 +++++++++++++++++++++++------------- indra/newview/llviewermessage.cpp | 13 ++++-- indra/newview/llviewerobject.cpp | 10 ++--- indra/newview/llviewerwindow.cpp | 5 +-- 8 files changed, 81 insertions(+), 48 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/lldeferredsounds.cpp b/indra/newview/lldeferredsounds.cpp index 9416e7cd29..e1613e4719 100755 --- a/indra/newview/lldeferredsounds.cpp +++ b/indra/newview/lldeferredsounds.cpp @@ -39,7 +39,10 @@ void LLDeferredSounds::playdeferredSounds() { while(soundVector.size()) { - gAudiop->triggerSound(soundVector.back()); + if (gAudiop) + { + gAudiop->triggerSound(soundVector.back()); + } soundVector.pop_back(); } } diff --git a/indra/newview/llpanelnearbymedia.cpp b/indra/newview/llpanelnearbymedia.cpp index a50d9074f7..edcf0d0452 100755 --- a/indra/newview/llpanelnearbymedia.cpp +++ b/indra/newview/llpanelnearbymedia.cpp @@ -876,7 +876,10 @@ void LLPanelNearByMedia::onClickParcelAudioPlay() // playing and updated as they cross to other parcels etc. mParcelAudioAutoStart = true; if (!gAudiop) + { + LL_WARNS("AudioEngine") << "LLAudioEngine instance doesn't exist!" << LL_ENDL; return; + } if (LLAudioEngine::AUDIO_PAUSED == gAudiop->isInternetStreamPlaying()) { @@ -896,7 +899,10 @@ void LLPanelNearByMedia::onClickParcelAudioStop() // they explicitly start it again. mParcelAudioAutoStart = false; if (!gAudiop) + { + LL_WARNS("AudioEngine") << "LLAudioEngine instance doesn't exist!" << LL_ENDL; return; + } LLViewerAudio::getInstance()->stopInternetStreamWithAutoFade(); } @@ -904,7 +910,10 @@ void LLPanelNearByMedia::onClickParcelAudioStop() void LLPanelNearByMedia::onClickParcelAudioPause() { if (!gAudiop) + { + LL_WARNS("AudioEngine") << "LLAudioEngine instance doesn't exist!" << LL_ENDL; return; + } // 'true' means pause gAudiop->pauseInternetStream(true); diff --git a/indra/newview/llpreviewsound.cpp b/indra/newview/llpreviewsound.cpp index 39ec6def91..11b81a58fc 100755 --- a/indra/newview/llpreviewsound.cpp +++ b/indra/newview/llpreviewsound.cpp @@ -55,7 +55,9 @@ BOOL LLPreviewSound::postBuild() { getChild<LLUICtrl>("desc")->setValue(item->getDescription()); if (gAudiop) + { gAudiop->preloadSound(item->getAssetUUID()); // preload the sound + } } childSetAction("Sound play btn",&LLPreviewSound::playSound,this); diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index d5f8a1e46e..635776713d 100755 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -624,25 +624,22 @@ bool idle_startup() if (FALSE == gSavedSettings.getBOOL("NoAudio")) { + delete gAudiop; gAudiop = NULL; #ifdef LL_FMODEX - if (!gAudiop #if !LL_WINDOWS - && NULL == getenv("LL_BAD_FMODEX_DRIVER") + if (NULL == getenv("LL_BAD_FMODEX_DRIVER") #endif // !LL_WINDOWS - ) { gAudiop = (LLAudioEngine *) new LLAudioEngine_FMODEX(gSavedSettings.getBOOL("FMODExProfilerEnable")); } #endif #ifdef LL_OPENAL - if (!gAudiop #if !LL_WINDOWS - && NULL == getenv("LL_BAD_OPENAL_DRIVER") + if (NULL == getenv("LL_BAD_OPENAL_DRIVER") #endif // !LL_WINDOWS - ) { gAudiop = (LLAudioEngine *) new LLAudioEngine_OpenAL(); } diff --git a/indra/newview/llvieweraudio.cpp b/indra/newview/llvieweraudio.cpp index 826d296117..fce42a1587 100755 --- a/indra/newview/llvieweraudio.cpp +++ b/indra/newview/llvieweraudio.cpp @@ -93,7 +93,12 @@ void LLViewerAudio::startInternetStreamWithAutoFade(std::string streamURI) switch (mFadeState) { - case FADE_IDLE: + case FADE_IDLE: + if (!gAudiop) + { + LL_WARNS("AudioEngine") << "LLAudioEngine instance doesn't exist!" << LL_ENDL; + break; + } // If a stream is playing fade it out first if (!gAudiop->getInternetStreamURL().empty()) { @@ -115,18 +120,18 @@ void LLViewerAudio::startInternetStreamWithAutoFade(std::string streamURI) break; } - case FADE_OUT: - startFading(); - registerIdleListener(); - break; + case FADE_OUT: + startFading(); + registerIdleListener(); + break; - case FADE_IN: - registerIdleListener(); - break; + case FADE_IN: + registerIdleListener(); + break; - default: - llwarns << "Unknown fading state: " << mFadeState << llendl; - break; + default: + llwarns << "Unknown fading state: " << mFadeState << llendl; + break; } } @@ -157,19 +162,26 @@ bool LLViewerAudio::onIdleUpdate() // we have finished the current fade operation if (mFadeState == FADE_OUT) { - // Clear URI - gAudiop->startInternetStream(LLStringUtil::null); - gAudiop->stopInternetStream(); + if (gAudiop) + { + // Clear URI + gAudiop->startInternetStream(LLStringUtil::null); + gAudiop->stopInternetStream(); + } if (!mNextStreamURI.empty()) { mFadeState = FADE_IN; - LLStreamingAudioInterface *stream = gAudiop->getStreamingAudioImpl(); - if(stream && stream->supportsAdjustableBufferSizes()) - stream->setBufferSizes(gSavedSettings.getU32("FMODExStreamBufferSize"),gSavedSettings.getU32("FMODExDecodeBufferSize")); + if (gAudiop) + { + LLStreamingAudioInterface *stream = gAudiop->getStreamingAudioImpl(); + if(stream && stream->supportsAdjustableBufferSizes()) + stream->setBufferSizes(gSavedSettings.getU32("FMODExStreamBufferSize"),gSavedSettings.getU32("FMODExDecodeBufferSize")); + + gAudiop->startInternetStream(mNextStreamURI); + } - gAudiop->startInternetStream(mNextStreamURI); startFading(); } else @@ -181,7 +193,7 @@ bool LLViewerAudio::onIdleUpdate() } else if (mFadeState == FADE_IN) { - if (mNextStreamURI != gAudiop->getInternetStreamURL()) + if (gAudiop && mNextStreamURI != gAudiop->getInternetStreamURL()) { mFadeState = FADE_OUT; startFading(); @@ -203,9 +215,12 @@ void LLViewerAudio::stopInternetStreamWithAutoFade() mFadeState = FADE_IDLE; mNextStreamURI = LLStringUtil::null; mDone = true; - - gAudiop->startInternetStream(LLStringUtil::null); - gAudiop->stopInternetStream(); + + if (gAudiop) + { + gAudiop->startInternetStream(LLStringUtil::null); + gAudiop->stopInternetStream(); + } } void LLViewerAudio::startFading() @@ -267,7 +282,7 @@ F32 LLViewerAudio::getFadeVolume() void LLViewerAudio::onTeleportStarted() { - if (!LLViewerAudio::getInstance()->getForcedTeleportFade()) + if (gAudiop && !LLViewerAudio::getInstance()->getForcedTeleportFade()) { // Even though the music was turned off it was starting up (with autoplay disabled) occasionally // after a failed teleport or after an intra-parcel teleport. Also, the music sometimes was not @@ -393,9 +408,10 @@ void audio_update_volume(bool force_update) } F32 mute_volume = mute_audio ? 0.0f : 1.0f; - // Sound Effects if (gAudiop) { + // Sound Effects + gAudiop->setMasterGain ( master_volume ); gAudiop->setDopplerFactor(gSavedSettings.getF32("AudioLevelDoppler")); @@ -425,11 +441,9 @@ void audio_update_volume(bool force_update) gSavedSettings.getBOOL("MuteUI") ? 0.f : gSavedSettings.getF32("AudioLevelUI")); gAudiop->setSecondaryGain(LLAudioEngine::AUDIO_TYPE_AMBIENT, gSavedSettings.getBOOL("MuteAmbient") ? 0.f : gSavedSettings.getF32("AudioLevelAmbient")); - } - // Streaming Music - if (gAudiop) - { + // Streaming Music + if (!progress_view_visible && LLViewerAudio::getInstance()->getForcedTeleportFade()) { LLViewerAudio::getInstance()->setWasPlaying(!gAudiop->getInternetStreamURL().empty()); @@ -527,6 +541,12 @@ void audio_update_wind(bool force_update) volume_delta = 1.f; } + if (!gAudiop) + { + LL_WARNS("AudioEngine") << "LLAudioEngine instance doesn't exist!" << LL_ENDL; + return; + } + // mute wind when not flying if (gAgent.getFlying()) { diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 2dbdceed66..9d12587801 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -4652,7 +4652,11 @@ void process_time_synch(LLMessageSystem *mesgsys, void **user_data) void process_sound_trigger(LLMessageSystem *msg, void **) { - if (!gAudiop) return; + if (!gAudiop) + { + LL_WARNS("AudioEngine") << "LLAudioEngine instance doesn't exist!" << LL_ENDL; + return; + } U64 region_handle = 0; F32 gain = 0; @@ -4712,6 +4716,7 @@ void process_preload_sound(LLMessageSystem *msg, void **user_data) { if (!gAudiop) { + LL_WARNS("AudioEngine") << "LLAudioEngine instance doesn't exist!" << LL_ENDL; return; } @@ -4742,9 +4747,9 @@ void process_preload_sound(LLMessageSystem *msg, void **user_data) LLVector3d pos_global = objectp->getPositionGlobal(); if (gAgent.canAccessMaturityAtGlobal(pos_global)) { - // Add audioData starts a transfer internally. - sourcep->addAudioData(datap, FALSE); -} + // Add audioData starts a transfer internally. + sourcep->addAudioData(datap, FALSE); + } } void process_attached_sound(LLMessageSystem *msg, void **user_data) diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index e62998db70..c789719291 100755 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -4950,6 +4950,7 @@ void LLViewerObject::setAttachedSound(const LLUUID &audio_uuid, const LLUUID& ow { if (!gAudiop) { + LL_WARNS("AudioEngine") << "LLAudioEngine instance doesn't exist!" << LL_ENDL; return; } @@ -5032,7 +5033,10 @@ LLAudioSource *LLViewerObject::getAudioSource(const LLUUID& owner_id) LLAudioSourceVO *asvop = new LLAudioSourceVO(mID, owner_id, 0.01f, this); mAudioSourcep = asvop; - if(gAudiop) gAudiop->addAudioSource(asvop); + if(gAudiop) + { + gAudiop->addAudioSource(asvop); + } } return mAudioSourcep; @@ -5040,10 +5044,6 @@ LLAudioSource *LLViewerObject::getAudioSource(const LLUUID& owner_id) void LLViewerObject::adjustAudioGain(const F32 gain) { - if (!gAudiop) - { - return; - } if (mAudioSourcep) { mAudioGain = gain; diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 3193a2955b..f2b5ef54fd 100755 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -438,10 +438,7 @@ public: } if (gDisplayWindInfo) { - if (gAudiop) - { - audio_text= llformat("Audio for wind: %d", gAudiop->isWindEnabled()); - } + audio_text = llformat("Audio for wind: %d", gAudiop ? gAudiop->isWindEnabled() : -1); addText(xpos, ypos, audio_text); ypos += y_inc; } if (gDisplayFOV) -- cgit v1.2.3 From 2f606a36f63979af73bad76d883646b2d3f8a727 Mon Sep 17 00:00:00 2001 From: maksymsproductengine <maksymsproductengine@lindenlab.com> Date: Fri, 14 Mar 2014 21:05:57 +0200 Subject: Fix linux build --- indra/newview/llstartup.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 635776713d..c86e8df4b6 100755 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -629,7 +629,7 @@ bool idle_startup() #ifdef LL_FMODEX #if !LL_WINDOWS - if (NULL == getenv("LL_BAD_FMODEX_DRIVER") + if (NULL == getenv("LL_BAD_FMODEX_DRIVER")) #endif // !LL_WINDOWS { gAudiop = (LLAudioEngine *) new LLAudioEngine_FMODEX(gSavedSettings.getBOOL("FMODExProfilerEnable")); @@ -638,7 +638,7 @@ bool idle_startup() #ifdef LL_OPENAL #if !LL_WINDOWS - if (NULL == getenv("LL_BAD_OPENAL_DRIVER") + if (NULL == getenv("LL_BAD_OPENAL_DRIVER")) #endif // !LL_WINDOWS { gAudiop = (LLAudioEngine *) new LLAudioEngine_OpenAL(); -- cgit v1.2.3 From 6f33f9090b554a32f039e46d8177650ccbf94536 Mon Sep 17 00:00:00 2001 From: maksymsproductengine <maksymsproductengine@lindenlab.com> Date: Thu, 20 Mar 2014 19:21:52 +0200 Subject: MAINT-3827 FIXED crash in KDU texture decoding, likely out of memory --- indra/newview/lldrawpoolbump.cpp | 1 + indra/newview/lldrawpoolterrain.cpp | 18 +++++++++++---- indra/newview/llnetmap.cpp | 5 +++- indra/newview/llstartup.cpp | 2 +- indra/newview/llsurface.cpp | 12 ++++++++++ indra/newview/lltexturecache.cpp | 2 +- indra/newview/llviewerparceloverlay.cpp | 20 ++++++++++------ indra/newview/llviewertexture.cpp | 15 +++++++++--- indra/newview/llvoavatarself.cpp | 9 ++++++-- indra/newview/llvosky.cpp | 41 +++++++++++++++++++-------------- indra/newview/llworld.cpp | 22 +++++++++++------- indra/newview/pipeline.cpp | 8 ++++--- 12 files changed, 108 insertions(+), 47 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp index 6b4c5cfca1..49ac82e786 100755 --- a/indra/newview/lldrawpoolbump.cpp +++ b/indra/newview/lldrawpoolbump.cpp @@ -1232,6 +1232,7 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLI //if (iter->second->getWidth() != src->getWidth() || // iter->second->getHeight() != src->getHeight()) // bump not cached yet or has changed resolution + if (src->getData()) { LLPointer<LLImageRaw> dst_image = new LLImageRaw(src->getWidth(), src->getHeight(), 1); U8* dst_data = dst_image->getData(); diff --git a/indra/newview/lldrawpoolterrain.cpp b/indra/newview/lldrawpoolterrain.cpp index c3ec234223..d7ecacf2e6 100755 --- a/indra/newview/lldrawpoolterrain.cpp +++ b/indra/newview/lldrawpoolterrain.cpp @@ -88,8 +88,11 @@ LLDrawPoolTerrain::LLDrawPoolTerrain(LLViewerTexture *texturep) : //gGL.getTexUnit(0)->bind(m2DAlphaRampImagep.get()); m2DAlphaRampImagep->setAddressMode(LLTexUnit::TAM_CLAMP); - mTexturep->setBoostLevel(LLGLTexture::BOOST_TERRAIN); - + if (mTexturep) + { + mTexturep->setBoostLevel(LLGLTexture::BOOST_TERRAIN); + } + //gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); } @@ -851,11 +854,18 @@ void LLDrawPoolTerrain::renderSimple() // Pass 1/1 // Stage 0: Base terrain texture pass - mTexturep->addTextureStats(1024.f*1024.f); + if (mTexturep) + { + mTexturep->addTextureStats(1024.f*1024.f); + } gGL.getTexUnit(0)->activate(); gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE); - gGL.getTexUnit(0)->bind(mTexturep); + + if (mTexturep) + { + gGL.getTexUnit(0)->bind(mTexturep); + } LLVector3 origin_agent = mDrawFace[0]->getDrawable()->getVObj()->getRegion()->getOriginAgent(); F32 tscale = 1.f/256.f; diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index 08b5eaedbb..193e2ea678 100755 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -798,7 +798,10 @@ void LLNetMap::createObjectImage() { mObjectRawImagep = new LLImageRaw(img_size, img_size, 4); U8* data = mObjectRawImagep->getData(); - memset( data, 0, img_size * img_size * 4 ); + if (data) + { + memset( data, 0, img_size * img_size * 4 ); + } mObjectImagep = LLViewerTextureManager::getLocalTexture( mObjectRawImagep.get(), FALSE); } setScale(mScale); diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index c86e8df4b6..6361c18c9f 100755 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -2684,7 +2684,7 @@ void init_start_screen(S32 location_id) } } - if(gStartTexture.isNull()) + if(gStartTexture && gStartTexture.isNull()) { gStartTexture = LLViewerTexture::sBlackImagep ; gStartImageWidth = gStartTexture->getWidth() ; diff --git a/indra/newview/llsurface.cpp b/indra/newview/llsurface.cpp index 93c7f54101..f1b27279e3 100755 --- a/indra/newview/llsurface.cpp +++ b/indra/newview/llsurface.cpp @@ -233,6 +233,12 @@ void LLSurface::createSTexture() // GL NOT ACTIVE HERE LLPointer<LLImageRaw> raw = new LLImageRaw(sTextureSize, sTextureSize, 3); U8 *default_texture = raw->getData(); + + if (!default_texture) + { + return; + } + for (S32 i = 0; i < sTextureSize; i++) { for (S32 j = 0; j < sTextureSize; j++) @@ -257,6 +263,12 @@ void LLSurface::createWaterTexture() // Create the water texture LLPointer<LLImageRaw> raw = new LLImageRaw(sTextureSize/2, sTextureSize/2, 4); U8 *default_texture = raw->getData(); + + if (!default_texture) + { + return; + } + for (S32 i = 0; i < sTextureSize/2; i++) { for (S32 j = 0; j < sTextureSize/2; j++) diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp index 5bc2e971eb..8d9d2421da 100755 --- a/indra/newview/lltexturecache.cpp +++ b/indra/newview/lltexturecache.cpp @@ -1937,7 +1937,7 @@ bool LLTextureCache::writeToFastCache(S32 id, LLPointer<LLImageRaw> raw, S32 dis memcpy(mFastCachePadBuffer + sizeof(S32) * 3, &discardlevel, sizeof(S32)); S32 copy_size = w * h * c; - if(copy_size > 0) //valid + if(copy_size > 0 && raw->getData()) //valid { copy_size = llmin(copy_size, TEXTURE_FAST_CACHE_ENTRY_SIZE - TEXTURE_FAST_CACHE_ENTRY_OVERHEAD); memcpy(mFastCachePadBuffer + TEXTURE_FAST_CACHE_ENTRY_OVERHEAD, raw->getData(), copy_size); diff --git a/indra/newview/llviewerparceloverlay.cpp b/indra/newview/llviewerparceloverlay.cpp index a1c12c5cd6..fad77bce25 100755 --- a/indra/newview/llviewerparceloverlay.cpp +++ b/indra/newview/llviewerparceloverlay.cpp @@ -76,10 +76,13 @@ LLViewerParcelOverlay::LLViewerParcelOverlay(LLViewerRegion* region, F32 region_ // // Create the base texture. U8 *raw = mImageRaw->getData(); - const S32 COUNT = mParcelGridsPerEdge * mParcelGridsPerEdge * OVERLAY_IMG_COMPONENTS; - for (S32 i = 0; i < COUNT; i++) + if (raw) { - raw[i] = 0; + const S32 COUNT = mParcelGridsPerEdge * mParcelGridsPerEdge * OVERLAY_IMG_COMPONENTS; + for (S32 i = 0; i < COUNT; i++) + { + raw[i] = 0; + } } //mTexture->setSubImage(mImageRaw, 0, 0, mParcelGridsPerEdge, mParcelGridsPerEdge); @@ -380,10 +383,13 @@ void LLViewerParcelOverlay::updateOverlayTexture() break; } - raw[pixel_index + 0] = (U8)r; - raw[pixel_index + 1] = (U8)g; - raw[pixel_index + 2] = (U8)b; - raw[pixel_index + 3] = (U8)a; + if (raw) + { + raw[pixel_index + 0] = (U8)r; + raw[pixel_index + 1] = (U8)g; + raw[pixel_index + 2] = (U8)b; + raw[pixel_index + 3] = (U8)a; + } pixel_index += OVERLAY_IMG_COMPONENTS; } diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 3da6d33d72..6364eee3ec 100755 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -337,6 +337,11 @@ void LLViewerTextureManager::init() const S32 dim = 128; LLPointer<LLImageRaw> image_raw = new LLImageRaw(dim,dim,3); U8* data = image_raw->getData(); + + if (!data) + { + return; + } memset(data, 0, dim * dim * 3) ; LLViewerTexture::sBlackImagep = LLViewerTextureManager::getLocalTexture(image_raw.get(), TRUE) ; @@ -373,8 +378,12 @@ void LLViewerTextureManager::init() #else LLViewerFetchedTexture::sDefaultImagep = LLViewerTextureManager::getFetchedTexture(IMG_DEFAULT, TRUE, LLGLTexture::BOOST_UI); #endif - LLViewerFetchedTexture::sDefaultImagep->dontDiscard(); - LLViewerFetchedTexture::sDefaultImagep->setCategory(LLGLTexture::OTHER) ; + + if (LLViewerFetchedTexture::sDefaultImagep) + { + LLViewerFetchedTexture::sDefaultImagep->dontDiscard(); + LLViewerFetchedTexture::sDefaultImagep->setCategory(LLGLTexture::OTHER) ; + } LLViewerFetchedTexture::sSmokeImagep = LLViewerTextureManager::getFetchedTexture(IMG_SMOKE, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_UI); LLViewerFetchedTexture::sSmokeImagep->setNoDelete() ; @@ -690,7 +699,7 @@ bool LLViewerTexture::bindDefaultImage(S32 stage) if (stage < 0) return false; bool res = true; - if (LLViewerFetchedTexture::sDefaultImagep.notNull() && (this != LLViewerFetchedTexture::sDefaultImagep.get())) + if (LLViewerFetchedTexture::sDefaultImagep && LLViewerFetchedTexture::sDefaultImagep.notNull() && (this != LLViewerFetchedTexture::sDefaultImagep.get())) { // use default if we've got it res = gGL.getTexUnit(stage)->bind(LLViewerFetchedTexture::sDefaultImagep); diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 082a85e217..ca004962d5 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -818,7 +818,8 @@ void LLVOAvatarSelf::setLocalTextureTE(U8 te, LLViewerTexture* image, U32 index) return; } - if (getTEImage(te)->getID() == image->getID()) + LLViewerTexture * tx = getTEImage(te); + if (!tx || tx->getID() == image->getID()) { return; } @@ -1698,6 +1699,7 @@ S32 LLVOAvatarSelf::getLocalDiscardLevel(ETextureIndex type, U32 wearable_index) const LLViewerFetchedTexture* image = dynamic_cast<LLViewerFetchedTexture*>( local_tex_obj->getImage() ); if (type >= 0 && local_tex_obj->getID() != IMG_DEFAULT_AVATAR + && image && !image->isMissingAsset()) { return image->getDiscardLevel(); @@ -2036,7 +2038,10 @@ BOOL LLVOAvatarSelf::getIsCloud() const /*static*/ void LLVOAvatarSelf::debugOnTimingLocalTexLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata) { - gAgentAvatarp->debugTimingLocalTexLoaded(success, src_vi, src, aux_src, discard_level, final, userdata); + if (gAgentAvatarp) + { + gAgentAvatarp->debugTimingLocalTexLoaded(success, src_vi, src, aux_src, discard_level, final, userdata); + } } void LLVOAvatarSelf::debugTimingLocalTexLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata) diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp index 93f0e50336..467152881e 100755 --- a/indra/newview/llvosky.cpp +++ b/indra/newview/llvosky.cpp @@ -257,18 +257,21 @@ LLSkyTex::~LLSkyTex() void LLSkyTex::initEmpty(const S32 tex) { U8* data = mImageRaw[tex]->getData(); - for (S32 i = 0; i < sResolution; ++i) + if (data) { - for (S32 j = 0; j < sResolution; ++j) + for (S32 i = 0; i < sResolution; ++i) { - const S32 basic_offset = (i * sResolution + j); - S32 offset = basic_offset * sComponents; - data[offset] = 0; - data[offset+1] = 0; - data[offset+2] = 0; - data[offset+3] = 255; - - mSkyData[basic_offset].setToBlack(); + for (S32 j = 0; j < sResolution; ++j) + { + const S32 basic_offset = (i * sResolution + j); + S32 offset = basic_offset * sComponents; + data[offset] = 0; + data[offset+1] = 0; + data[offset+2] = 0; + data[offset+3] = 255; + + mSkyData[basic_offset].setToBlack(); + } } } @@ -279,17 +282,21 @@ void LLSkyTex::create(const F32 brightness) { /// Brightness ignored for now. U8* data = mImageRaw[sCurrent]->getData(); - for (S32 i = 0; i < sResolution; ++i) + if (data) { - for (S32 j = 0; j < sResolution; ++j) + for (S32 i = 0; i < sResolution; ++i) { - const S32 basic_offset = (i * sResolution + j); - S32 offset = basic_offset * sComponents; - U32* pix = (U32*)(data + offset); - LLColor4U temp = LLColor4U(mSkyData[basic_offset]); - *pix = temp.mAll; + for (S32 j = 0; j < sResolution; ++j) + { + const S32 basic_offset = (i * sResolution + j); + S32 offset = basic_offset * sComponents; + U32* pix = (U32*)(data + offset); + LLColor4U temp = LLColor4U(mSkyData[basic_offset]); + *pix = temp.mAll; + } } } + createGLImage(sCurrent); } diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index 85614f397c..27256af97a 100755 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -101,15 +101,21 @@ LLWorld::LLWorld() : LLPointer<LLImageRaw> raw = new LLImageRaw(1,1,4); U8 *default_texture = raw->getData(); - *(default_texture++) = MAX_WATER_COLOR.mV[0]; - *(default_texture++) = MAX_WATER_COLOR.mV[1]; - *(default_texture++) = MAX_WATER_COLOR.mV[2]; - *(default_texture++) = MAX_WATER_COLOR.mV[3]; - - mDefaultWaterTexturep = LLViewerTextureManager::getLocalTexture(raw.get(), FALSE); - gGL.getTexUnit(0)->bind(mDefaultWaterTexturep); - mDefaultWaterTexturep->setAddressMode(LLTexUnit::TAM_CLAMP); + if (default_texture) + { + *(default_texture++) = MAX_WATER_COLOR.mV[0]; + *(default_texture++) = MAX_WATER_COLOR.mV[1]; + *(default_texture++) = MAX_WATER_COLOR.mV[2]; + *(default_texture++) = MAX_WATER_COLOR.mV[3]; + } + + if (mDefaultWaterTexturep) + { + mDefaultWaterTexturep = LLViewerTextureManager::getLocalTexture(raw.get(), FALSE); + gGL.getTexUnit(0)->bind(mDefaultWaterTexturep); + mDefaultWaterTexturep->setAddressMode(LLTexUnit::TAM_CLAMP); + } } diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 5da8a78b1b..0af1143ae8 100755 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -4410,9 +4410,11 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate) sUnderWaterRender = FALSE; } - gGL.getTexUnit(0)->bind(LLViewerFetchedTexture::sDefaultImagep); - LLViewerFetchedTexture::sDefaultImagep->setAddressMode(LLTexUnit::TAM_WRAP); - + if (LLViewerFetchedTexture::sDefaultImagep) + { + gGL.getTexUnit(0)->bind(LLViewerFetchedTexture::sDefaultImagep); + LLViewerFetchedTexture::sDefaultImagep->setAddressMode(LLTexUnit::TAM_WRAP); + } ////////////////////////////////////////////// // -- cgit v1.2.3 From 6a50342c6a4b6f65659719af7580a8cb34e28bf7 Mon Sep 17 00:00:00 2001 From: maksymsproductengine <maksymsproductengine@lindenlab.com> Date: Wed, 9 Apr 2014 04:51:42 +0300 Subject: MAINT-3903 FIXED Instant message toasts and certain kinds of popups (ex. group invites) fail to display if an offline inventory offer was received before logging in: Backed out changeset: f7234f8fdce8: MAINT-3536 new crash in XML_ParserFree. --- indra/newview/llchannelmanager.cpp | 50 ++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 27 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llchannelmanager.cpp b/indra/newview/llchannelmanager.cpp index fa23251d95..8b2d9e639f 100755 --- a/indra/newview/llchannelmanager.cpp +++ b/indra/newview/llchannelmanager.cpp @@ -113,33 +113,29 @@ void LLChannelManager::onLoginCompleted() } else { - // TODO: Seems this code leads to MAINT-3536 new crash in XML_ParserFree. - // Need to investigate this and fix possible problems with notifications in startup time - // Viewer can normally receive and show of postponed notifications about purchasing in marketplace on startup time. - // Other types of postponed notifications did not tested. - //// create a channel for the StartUp Toast - //LLScreenChannelBase::Params p; - //p.id = LLUUID(gSavedSettings.getString("StartUpChannelUUID")); - //p.channel_align = CA_RIGHT; - //mStartUpChannel = createChannel(p); - - //if(!mStartUpChannel) - //{ - // onStartUpToastClose(); - //} - //else - //{ - // gViewerWindow->getRootView()->addChild(mStartUpChannel); - - // // init channel's position and size - // S32 channel_right_bound = gViewerWindow->getWorldViewRectScaled().mRight - gSavedSettings.getS32("NotificationChannelRightMargin"); - // S32 channel_width = gSavedSettings.getS32("NotifyBoxWidth"); - // mStartUpChannel->init(channel_right_bound - channel_width, channel_right_bound); - // mStartUpChannel->setMouseDownCallback(boost::bind(&LLNotificationWellWindow::onStartUpToastClick, LLNotificationWellWindow::getInstance(), _2, _3, _4)); - - // mStartUpChannel->setCommitCallback(boost::bind(&LLChannelManager::onStartUpToastClose, this)); - // mStartUpChannel->createStartUpToast(away_notifications, gSavedSettings.getS32("StartUpToastLifeTime")); - //} + // create a channel for the StartUp Toast + LLScreenChannelBase::Params p; + p.id = LLUUID(gSavedSettings.getString("StartUpChannelUUID")); + p.channel_align = CA_RIGHT; + mStartUpChannel = createChannel(p); + + if(!mStartUpChannel) + { + onStartUpToastClose(); + } + else + { + gViewerWindow->getRootView()->addChild(mStartUpChannel); + + // init channel's position and size + S32 channel_right_bound = gViewerWindow->getWorldViewRectScaled().mRight - gSavedSettings.getS32("NotificationChannelRightMargin"); + S32 channel_width = gSavedSettings.getS32("NotifyBoxWidth"); + mStartUpChannel->init(channel_right_bound - channel_width, channel_right_bound); + mStartUpChannel->setMouseDownCallback(boost::bind(&LLNotificationWellWindow::onStartUpToastClick, LLNotificationWellWindow::getInstance(), _2, _3, _4)); + + mStartUpChannel->setCommitCallback(boost::bind(&LLChannelManager::onStartUpToastClose, this)); + mStartUpChannel->createStartUpToast(away_notifications, gSavedSettings.getS32("StartUpToastLifeTime")); + } } LLPersistentNotificationStorage::getInstance()->loadNotifications(); -- cgit v1.2.3 From 816e8578f9b63640afde942df282ccf5ed1385a5 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Wed, 16 Apr 2014 13:21:06 -0500 Subject: Backed out changeset: d0dfe3cda5b1 --- indra/newview/lldrawpoolbump.cpp | 1 - indra/newview/lldrawpoolterrain.cpp | 18 ++++----------- indra/newview/llnetmap.cpp | 5 +--- indra/newview/llstartup.cpp | 2 +- indra/newview/llsurface.cpp | 12 ---------- indra/newview/lltexturecache.cpp | 2 +- indra/newview/llviewerparceloverlay.cpp | 20 ++++++---------- indra/newview/llviewertexture.cpp | 15 +++--------- indra/newview/llvoavatarself.cpp | 9 ++------ indra/newview/llvosky.cpp | 41 ++++++++++++++------------------- indra/newview/llworld.cpp | 22 +++++++----------- indra/newview/pipeline.cpp | 8 +++---- 12 files changed, 47 insertions(+), 108 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp index 49ac82e786..6b4c5cfca1 100755 --- a/indra/newview/lldrawpoolbump.cpp +++ b/indra/newview/lldrawpoolbump.cpp @@ -1232,7 +1232,6 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLI //if (iter->second->getWidth() != src->getWidth() || // iter->second->getHeight() != src->getHeight()) // bump not cached yet or has changed resolution - if (src->getData()) { LLPointer<LLImageRaw> dst_image = new LLImageRaw(src->getWidth(), src->getHeight(), 1); U8* dst_data = dst_image->getData(); diff --git a/indra/newview/lldrawpoolterrain.cpp b/indra/newview/lldrawpoolterrain.cpp index d7ecacf2e6..c3ec234223 100755 --- a/indra/newview/lldrawpoolterrain.cpp +++ b/indra/newview/lldrawpoolterrain.cpp @@ -88,11 +88,8 @@ LLDrawPoolTerrain::LLDrawPoolTerrain(LLViewerTexture *texturep) : //gGL.getTexUnit(0)->bind(m2DAlphaRampImagep.get()); m2DAlphaRampImagep->setAddressMode(LLTexUnit::TAM_CLAMP); - if (mTexturep) - { - mTexturep->setBoostLevel(LLGLTexture::BOOST_TERRAIN); - } - + mTexturep->setBoostLevel(LLGLTexture::BOOST_TERRAIN); + //gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); } @@ -854,18 +851,11 @@ void LLDrawPoolTerrain::renderSimple() // Pass 1/1 // Stage 0: Base terrain texture pass - if (mTexturep) - { - mTexturep->addTextureStats(1024.f*1024.f); - } + mTexturep->addTextureStats(1024.f*1024.f); gGL.getTexUnit(0)->activate(); gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE); - - if (mTexturep) - { - gGL.getTexUnit(0)->bind(mTexturep); - } + gGL.getTexUnit(0)->bind(mTexturep); LLVector3 origin_agent = mDrawFace[0]->getDrawable()->getVObj()->getRegion()->getOriginAgent(); F32 tscale = 1.f/256.f; diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index 193e2ea678..08b5eaedbb 100755 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -798,10 +798,7 @@ void LLNetMap::createObjectImage() { mObjectRawImagep = new LLImageRaw(img_size, img_size, 4); U8* data = mObjectRawImagep->getData(); - if (data) - { - memset( data, 0, img_size * img_size * 4 ); - } + memset( data, 0, img_size * img_size * 4 ); mObjectImagep = LLViewerTextureManager::getLocalTexture( mObjectRawImagep.get(), FALSE); } setScale(mScale); diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 924ba0559c..3b52025a23 100755 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -2684,7 +2684,7 @@ void init_start_screen(S32 location_id) } } - if(gStartTexture && gStartTexture.isNull()) + if(gStartTexture.isNull()) { gStartTexture = LLViewerTexture::sBlackImagep ; gStartImageWidth = gStartTexture->getWidth() ; diff --git a/indra/newview/llsurface.cpp b/indra/newview/llsurface.cpp index f1b27279e3..93c7f54101 100755 --- a/indra/newview/llsurface.cpp +++ b/indra/newview/llsurface.cpp @@ -233,12 +233,6 @@ void LLSurface::createSTexture() // GL NOT ACTIVE HERE LLPointer<LLImageRaw> raw = new LLImageRaw(sTextureSize, sTextureSize, 3); U8 *default_texture = raw->getData(); - - if (!default_texture) - { - return; - } - for (S32 i = 0; i < sTextureSize; i++) { for (S32 j = 0; j < sTextureSize; j++) @@ -263,12 +257,6 @@ void LLSurface::createWaterTexture() // Create the water texture LLPointer<LLImageRaw> raw = new LLImageRaw(sTextureSize/2, sTextureSize/2, 4); U8 *default_texture = raw->getData(); - - if (!default_texture) - { - return; - } - for (S32 i = 0; i < sTextureSize/2; i++) { for (S32 j = 0; j < sTextureSize/2; j++) diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp index 8d9d2421da..5bc2e971eb 100755 --- a/indra/newview/lltexturecache.cpp +++ b/indra/newview/lltexturecache.cpp @@ -1937,7 +1937,7 @@ bool LLTextureCache::writeToFastCache(S32 id, LLPointer<LLImageRaw> raw, S32 dis memcpy(mFastCachePadBuffer + sizeof(S32) * 3, &discardlevel, sizeof(S32)); S32 copy_size = w * h * c; - if(copy_size > 0 && raw->getData()) //valid + if(copy_size > 0) //valid { copy_size = llmin(copy_size, TEXTURE_FAST_CACHE_ENTRY_SIZE - TEXTURE_FAST_CACHE_ENTRY_OVERHEAD); memcpy(mFastCachePadBuffer + TEXTURE_FAST_CACHE_ENTRY_OVERHEAD, raw->getData(), copy_size); diff --git a/indra/newview/llviewerparceloverlay.cpp b/indra/newview/llviewerparceloverlay.cpp index fad77bce25..a1c12c5cd6 100755 --- a/indra/newview/llviewerparceloverlay.cpp +++ b/indra/newview/llviewerparceloverlay.cpp @@ -76,13 +76,10 @@ LLViewerParcelOverlay::LLViewerParcelOverlay(LLViewerRegion* region, F32 region_ // // Create the base texture. U8 *raw = mImageRaw->getData(); - if (raw) + const S32 COUNT = mParcelGridsPerEdge * mParcelGridsPerEdge * OVERLAY_IMG_COMPONENTS; + for (S32 i = 0; i < COUNT; i++) { - const S32 COUNT = mParcelGridsPerEdge * mParcelGridsPerEdge * OVERLAY_IMG_COMPONENTS; - for (S32 i = 0; i < COUNT; i++) - { - raw[i] = 0; - } + raw[i] = 0; } //mTexture->setSubImage(mImageRaw, 0, 0, mParcelGridsPerEdge, mParcelGridsPerEdge); @@ -383,13 +380,10 @@ void LLViewerParcelOverlay::updateOverlayTexture() break; } - if (raw) - { - raw[pixel_index + 0] = (U8)r; - raw[pixel_index + 1] = (U8)g; - raw[pixel_index + 2] = (U8)b; - raw[pixel_index + 3] = (U8)a; - } + raw[pixel_index + 0] = (U8)r; + raw[pixel_index + 1] = (U8)g; + raw[pixel_index + 2] = (U8)b; + raw[pixel_index + 3] = (U8)a; pixel_index += OVERLAY_IMG_COMPONENTS; } diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 6364eee3ec..3da6d33d72 100755 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -337,11 +337,6 @@ void LLViewerTextureManager::init() const S32 dim = 128; LLPointer<LLImageRaw> image_raw = new LLImageRaw(dim,dim,3); U8* data = image_raw->getData(); - - if (!data) - { - return; - } memset(data, 0, dim * dim * 3) ; LLViewerTexture::sBlackImagep = LLViewerTextureManager::getLocalTexture(image_raw.get(), TRUE) ; @@ -378,12 +373,8 @@ void LLViewerTextureManager::init() #else LLViewerFetchedTexture::sDefaultImagep = LLViewerTextureManager::getFetchedTexture(IMG_DEFAULT, TRUE, LLGLTexture::BOOST_UI); #endif - - if (LLViewerFetchedTexture::sDefaultImagep) - { - LLViewerFetchedTexture::sDefaultImagep->dontDiscard(); - LLViewerFetchedTexture::sDefaultImagep->setCategory(LLGLTexture::OTHER) ; - } + LLViewerFetchedTexture::sDefaultImagep->dontDiscard(); + LLViewerFetchedTexture::sDefaultImagep->setCategory(LLGLTexture::OTHER) ; LLViewerFetchedTexture::sSmokeImagep = LLViewerTextureManager::getFetchedTexture(IMG_SMOKE, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_UI); LLViewerFetchedTexture::sSmokeImagep->setNoDelete() ; @@ -699,7 +690,7 @@ bool LLViewerTexture::bindDefaultImage(S32 stage) if (stage < 0) return false; bool res = true; - if (LLViewerFetchedTexture::sDefaultImagep && LLViewerFetchedTexture::sDefaultImagep.notNull() && (this != LLViewerFetchedTexture::sDefaultImagep.get())) + if (LLViewerFetchedTexture::sDefaultImagep.notNull() && (this != LLViewerFetchedTexture::sDefaultImagep.get())) { // use default if we've got it res = gGL.getTexUnit(stage)->bind(LLViewerFetchedTexture::sDefaultImagep); diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index ca004962d5..082a85e217 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -818,8 +818,7 @@ void LLVOAvatarSelf::setLocalTextureTE(U8 te, LLViewerTexture* image, U32 index) return; } - LLViewerTexture * tx = getTEImage(te); - if (!tx || tx->getID() == image->getID()) + if (getTEImage(te)->getID() == image->getID()) { return; } @@ -1699,7 +1698,6 @@ S32 LLVOAvatarSelf::getLocalDiscardLevel(ETextureIndex type, U32 wearable_index) const LLViewerFetchedTexture* image = dynamic_cast<LLViewerFetchedTexture*>( local_tex_obj->getImage() ); if (type >= 0 && local_tex_obj->getID() != IMG_DEFAULT_AVATAR - && image && !image->isMissingAsset()) { return image->getDiscardLevel(); @@ -2038,10 +2036,7 @@ BOOL LLVOAvatarSelf::getIsCloud() const /*static*/ void LLVOAvatarSelf::debugOnTimingLocalTexLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata) { - if (gAgentAvatarp) - { - gAgentAvatarp->debugTimingLocalTexLoaded(success, src_vi, src, aux_src, discard_level, final, userdata); - } + gAgentAvatarp->debugTimingLocalTexLoaded(success, src_vi, src, aux_src, discard_level, final, userdata); } void LLVOAvatarSelf::debugTimingLocalTexLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata) diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp index 467152881e..93f0e50336 100755 --- a/indra/newview/llvosky.cpp +++ b/indra/newview/llvosky.cpp @@ -257,21 +257,18 @@ LLSkyTex::~LLSkyTex() void LLSkyTex::initEmpty(const S32 tex) { U8* data = mImageRaw[tex]->getData(); - if (data) + for (S32 i = 0; i < sResolution; ++i) { - for (S32 i = 0; i < sResolution; ++i) + for (S32 j = 0; j < sResolution; ++j) { - for (S32 j = 0; j < sResolution; ++j) - { - const S32 basic_offset = (i * sResolution + j); - S32 offset = basic_offset * sComponents; - data[offset] = 0; - data[offset+1] = 0; - data[offset+2] = 0; - data[offset+3] = 255; - - mSkyData[basic_offset].setToBlack(); - } + const S32 basic_offset = (i * sResolution + j); + S32 offset = basic_offset * sComponents; + data[offset] = 0; + data[offset+1] = 0; + data[offset+2] = 0; + data[offset+3] = 255; + + mSkyData[basic_offset].setToBlack(); } } @@ -282,21 +279,17 @@ void LLSkyTex::create(const F32 brightness) { /// Brightness ignored for now. U8* data = mImageRaw[sCurrent]->getData(); - if (data) + for (S32 i = 0; i < sResolution; ++i) { - for (S32 i = 0; i < sResolution; ++i) + for (S32 j = 0; j < sResolution; ++j) { - for (S32 j = 0; j < sResolution; ++j) - { - const S32 basic_offset = (i * sResolution + j); - S32 offset = basic_offset * sComponents; - U32* pix = (U32*)(data + offset); - LLColor4U temp = LLColor4U(mSkyData[basic_offset]); - *pix = temp.mAll; - } + const S32 basic_offset = (i * sResolution + j); + S32 offset = basic_offset * sComponents; + U32* pix = (U32*)(data + offset); + LLColor4U temp = LLColor4U(mSkyData[basic_offset]); + *pix = temp.mAll; } } - createGLImage(sCurrent); } diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index 27256af97a..85614f397c 100755 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -101,21 +101,15 @@ LLWorld::LLWorld() : LLPointer<LLImageRaw> raw = new LLImageRaw(1,1,4); U8 *default_texture = raw->getData(); + *(default_texture++) = MAX_WATER_COLOR.mV[0]; + *(default_texture++) = MAX_WATER_COLOR.mV[1]; + *(default_texture++) = MAX_WATER_COLOR.mV[2]; + *(default_texture++) = MAX_WATER_COLOR.mV[3]; + + mDefaultWaterTexturep = LLViewerTextureManager::getLocalTexture(raw.get(), FALSE); + gGL.getTexUnit(0)->bind(mDefaultWaterTexturep); + mDefaultWaterTexturep->setAddressMode(LLTexUnit::TAM_CLAMP); - if (default_texture) - { - *(default_texture++) = MAX_WATER_COLOR.mV[0]; - *(default_texture++) = MAX_WATER_COLOR.mV[1]; - *(default_texture++) = MAX_WATER_COLOR.mV[2]; - *(default_texture++) = MAX_WATER_COLOR.mV[3]; - } - - if (mDefaultWaterTexturep) - { - mDefaultWaterTexturep = LLViewerTextureManager::getLocalTexture(raw.get(), FALSE); - gGL.getTexUnit(0)->bind(mDefaultWaterTexturep); - mDefaultWaterTexturep->setAddressMode(LLTexUnit::TAM_CLAMP); - } } diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 0af1143ae8..5da8a78b1b 100755 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -4410,11 +4410,9 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate) sUnderWaterRender = FALSE; } - if (LLViewerFetchedTexture::sDefaultImagep) - { - gGL.getTexUnit(0)->bind(LLViewerFetchedTexture::sDefaultImagep); - LLViewerFetchedTexture::sDefaultImagep->setAddressMode(LLTexUnit::TAM_WRAP); - } + gGL.getTexUnit(0)->bind(LLViewerFetchedTexture::sDefaultImagep); + LLViewerFetchedTexture::sDefaultImagep->setAddressMode(LLTexUnit::TAM_WRAP); + ////////////////////////////////////////////// // -- cgit v1.2.3 From e606b7918dc6dbe2a4048f4bbd8590bfc3eca90e Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Mon, 24 Mar 2014 14:04:40 -0500 Subject: MAINT-3211 Fix for texture animations not working properly on rigged attachments when worn from inventory. --- .../app_settings/shaders/class1/deferred/diffuseSkinnedV.glsl | 2 +- indra/newview/lldrawpoolavatar.cpp | 11 +++++++++++ indra/newview/llface.cpp | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseSkinnedV.glsl index a74290bfcd..2487110624 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/diffuseSkinnedV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseSkinnedV.glsl @@ -40,7 +40,7 @@ mat4 getObjectSkinnedTransform(); void main() { vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; - + mat4 mat = getObjectSkinnedTransform(); mat = modelview_matrix * mat; diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index 24f467f954..716243b381 100755 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -1517,6 +1517,17 @@ void LLDrawPoolAvatar::getRiggedGeometry(LLFace* face, LLPointer<LLVertexBuffer> face->setPoolType(LLDrawPool::POOL_AVATAR); } + //let getGeometryVolume know if a texture matrix is in play + if (face->mTextureMatrix) + { + face->setState(LLFace::TEXTURE_ANIM); + } + else + { + face->clearState(LLFace::TEXTURE_ANIM); + } + + //llinfos << "Rebuilt face " << face->getTEOffset() << " of " << face->getDrawable() << " at " << gFrameTimeSeconds << llendl; face->getGeometryVolume(*volume, face->getTEOffset(), mat_vert, mat_normal, offset, true); diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index ae62be0ad0..d69c185a2b 100755 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -1638,7 +1638,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, do_xform = false; } - if (getVirtualSize() >= MIN_TEX_ANIM_SIZE) + if (getVirtualSize() >= MIN_TEX_ANIM_SIZE || isState(LLFace::RIGGED)) { //don't override texture transform during tc bake tex_mode = 0; } -- cgit v1.2.3 From 09fa98656247fdc7f0f1c6b9da891f8cbb7cb20f Mon Sep 17 00:00:00 2001 From: Nyx Linden <nyx@lindenlab.com> Date: Tue, 1 Apr 2014 16:54:07 -0400 Subject: BUG-5537 FIX reverting breaking changes to pectorals and belly. Fitted mesh introduced a couple of changes to the avatar_lad.xml file that cause the avatar definition to change in ways that are not backwards- compatible. Reverted the change in the range of pectoral size for male avatars, and the change in the position of the belly morph position (the later being a copy/paste error). --- indra/newview/character/avatar_lad.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/character/avatar_lad.xml b/indra/newview/character/avatar_lad.xml index 5268498d56..6de5b18c3c 100755 --- a/indra/newview/character/avatar_lad.xml +++ b/indra/newview/character/avatar_lad.xml @@ -3825,7 +3825,7 @@ <volume_morph name="BELLY" scale="0.075 0.04 0.03" - pos="0.07 0 -0.02"/> + pos="0.07 0 -0.07"/> <volume_morph name="PELVIS" scale="0.075 0.04 0.03" @@ -4269,7 +4269,7 @@ label_min="Big Pectorals" label_max="Sunken Chest" value_default="0" - value_min="-1.0" + value_min="-0.5" value_max="1.1" camera_elevation=".3" camera_distance="1.2"> -- cgit v1.2.3 From 93f7ac98b640c3bff13a87992f928122ee69201c Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine <mnikolenko@productengine.com> Date: Mon, 31 Mar 2014 10:54:59 +0300 Subject: MAINT-535 FIXED The teleport SLAPP is changed to UNTRUSTED_THROTTLE. Confirmation dialog for teleporting via slapp is added. --- indra/newview/llurldispatcher.cpp | 43 ++++++++++++++++++++-- .../newview/skins/default/xui/en/notifications.xml | 13 +++++++ 2 files changed, 52 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llurldispatcher.cpp b/indra/newview/llurldispatcher.cpp index 0c34db39b5..ca593c80bc 100755 --- a/indra/newview/llurldispatcher.cpp +++ b/indra/newview/llurldispatcher.cpp @@ -34,6 +34,7 @@ #include "llfloaterreg.h" #include "llfloatersidepanelcontainer.h" #include "llfloaterworldmap.h" +#include "llnotifications.h" #include "llpanellogin.h" #include "llregionhandle.h" #include "llslurl.h" @@ -253,13 +254,15 @@ void LLURLDispatcherImpl::regionHandleCallback(U64 region_handle, const LLSLURL& //--------------------------------------------------------------------------- // Teleportation links are handled here because they are tightly coupled // to SLURL parsing and sim-fragment parsing + class LLTeleportHandler : public LLCommandHandler { public: // Teleport requests *must* come from a trusted browser // inside the app, otherwise a malicious web page could // cause a constant teleport loop. JC - LLTeleportHandler() : LLCommandHandler("teleport", UNTRUSTED_BLOCK) { } + LLTeleportHandler() : LLCommandHandler("teleport", UNTRUSTED_THROTTLE) { } + bool handle(const LLSD& tokens, const LLSD& query_map, LLMediaCtrl* web) @@ -276,18 +279,50 @@ public: tokens[3].asReal()); } + LLSD args; + args["LOCATION"] = tokens[0]; + // Region names may be %20 escaped. - std::string region_name = LLURI::unescape(tokens[0]); + LLSD payload; + payload["region_name"] = region_name; + payload["callback_url"] = LLSLURL(region_name, coords).getSLURLString(); + + LLNotificationsUtil::add("TeleportViaSLAPP", args, payload); + return true; + } + + static void teleport_via_slapp(std::string region_name, std::string callback_url) + { + LLWorldMapMessage::getInstance()->sendNamedRegionRequest(region_name, LLURLDispatcherImpl::regionHandleCallback, - LLSLURL(region_name, coords).getSLURLString(), + callback_url, true); // teleport - return true; } + + static bool teleport_via_slapp_callback(const LLSD& notification, const LLSD& response) + { + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + + std::string region_name = notification["payload"]["region_name"].asString(); + std::string callback_url = notification["payload"]["callback_url"].asString(); + + if (option == 0) + { + teleport_via_slapp(region_name, callback_url); + return true; + } + + return false; + } + }; LLTeleportHandler gTeleportHandler; +static LLNotificationFunctorRegistration open_landmark_callback_reg("TeleportViaSLAPP", LLTeleportHandler::teleport_via_slapp_callback); + + //--------------------------------------------------------------------------- diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index ce34c3f7a1..07531e0d56 100755 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -4137,6 +4137,19 @@ Are you sure you want to teleport to <nolink>[LOCATION]</nolink>? notext="Cancel" yestext="Teleport"/> </notification> + + <notification + icon="alertmodal.tga" + name="TeleportViaSLAPP" + type="alertmodal"> +Are you sure you want to teleport to <nolink>[LOCATION]</nolink>? + <tag>confirm</tag> + <usetemplate + ignoretext="Confirm that I want to teleport via SLAPP" + name="okcancelignore" + notext="Cancel" + yestext="Teleport"/> + </notification> <notification icon="alertmodal.tga" -- cgit v1.2.3 From 41d8db0d3e0c519fd59719894592f57b8594bf15 Mon Sep 17 00:00:00 2001 From: andreylproductengine <andreylproductengine@lindenlab.com> Date: Thu, 3 Apr 2014 19:37:52 +0300 Subject: MAINT-3870 FIXED The freelook animation never ends so the avatar never gets to the idle status... --- indra/newview/llviewerwindow.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index f2b5ef54fd..609d2b47f2 100755 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -3241,6 +3241,8 @@ void LLViewerWindow::updateUI() updateLayout(); + saveLastMouse(mCurrentMousePoint); + // cleanup unused selections when no modal dialogs are open if (LLModalDialog::activeCount() == 0) { -- cgit v1.2.3 From c9c782b5963f2f63e5a01ecebeb01cbef08c09aa Mon Sep 17 00:00:00 2001 From: Richard Linden <none@none> Date: Mon, 7 Apr 2014 14:17:15 -0700 Subject: MAINT-3915 FIX Recent Inventory Tab not showing Recent activity old logic would interpret "don't care whether or not I am showing wearables" as "filter for just wearables, of any type" --- indra/newview/llinventoryfilter.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index 15463e0d33..b666331a2c 100755 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -938,7 +938,10 @@ void LLInventoryFilter::toParams(Params& params) const { params.filter_ops.types = getFilterObjectTypes(); params.filter_ops.category_types = getFilterCategoryTypes(); - params.filter_ops.wearable_types = getFilterWearableTypes(); + if (getFilterObjectTypes() & FILTERTYPE_WEARABLE) + { + params.filter_ops.wearable_types = getFilterWearableTypes(); + } params.filter_ops.date_range.min_date = getMinDate(); params.filter_ops.date_range.max_date = getMaxDate(); params.filter_ops.hours_ago = getHoursAgo(); @@ -957,7 +960,10 @@ void LLInventoryFilter::fromParams(const Params& params) setFilterObjectTypes(params.filter_ops.types); setFilterCategoryTypes(params.filter_ops.category_types); - setFilterWearableTypes(params.filter_ops.wearable_types); + if (params.filter_ops.wearable_types.isProvided()) + { + setFilterWearableTypes(params.filter_ops.wearable_types); + } setDateRange(params.filter_ops.date_range.min_date, params.filter_ops.date_range.max_date); setHoursAgo(params.filter_ops.hours_ago); setShowFolderState(params.filter_ops.show_folder_state); -- cgit v1.2.3 From 1be53b869a4430533e82600af60a82f316f2f6d7 Mon Sep 17 00:00:00 2001 From: Richard Linden <none@none> Date: Tue, 8 Apr 2014 16:01:46 -0700 Subject: added SKIP_AUTORUN command line flag to disable automatically running viewer after install --- indra/newview/installers/windows/installer_template.nsi | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi index 4ece83d85a..ad5ab22640 100755 --- a/indra/newview/installers/windows/installer_template.nsi +++ b/indra/newview/installers/windows/installer_template.nsi @@ -106,6 +106,7 @@ Var COMMANDLINE ; command line passed to this installer, set in .onInit Var SHORTCUT_LANG_PARAM ; "--set InstallLanguage de", passes language to viewer Var SKIP_DIALOGS ; set from command line in .onInit. autoinstall ; GUI and the defaults. +Var SKIP_AUTORUN ; skip automatic launch of viewer after install Var DO_UNINSTALL_V2 ; If non-null, path to a previous Viewer 2 installation that will be uninstalled. ;;; Function definitions should go before file includes, because calls to @@ -122,6 +123,7 @@ Var DO_UNINSTALL_V2 ; If non-null, path to a previous Viewer 2 installation ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Function .onInstSuccess Push $R0 # Option value, unused + StrCmp $SKIP_AUTORUN "true" +2; # Assumes SetOutPath $INSTDIR Exec '"$INSTDIR\$INSTEXE" $SHORTCUT_LANG_PARAM' Pop $R0 @@ -856,7 +858,12 @@ Function .onInit IfErrors +2 0 ; If error jump past setting SKIP_DIALOGS StrCpy $SKIP_DIALOGS "true" + ${GetOptions} $COMMANDLINE "/SKIP_AUTORUN" $0 + IfErrors +2 0 ; If error jump past setting SKIP_AUTORUN + StrCpy $SKIP_AUTORUN "true" + ${GetOptions} $COMMANDLINE "/LANGID=" $0 ; /LANGID=1033 implies US English + ; If no language (error), then proceed IfErrors lbl_configure_default_lang ; No error means we got a language, so use it -- cgit v1.2.3 From 041f267d6a5a4c6251a113accdf0003301beb6a9 Mon Sep 17 00:00:00 2001 From: Stinson Linden <stinson@lindenlab.com> Date: Wed, 23 Apr 2014 01:57:24 +0100 Subject: MAINT-4009: Adding LLWinDebug::cleanup() to ensure memory is freed at app end. --- indra/newview/llappviewerwin32.cpp | 4 ++++ indra/newview/llwindebug.cpp | 20 +++++++++++++++----- indra/newview/llwindebug.h | 1 + 3 files changed, 20 insertions(+), 5 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index 06f081e920..a1b4fd1035 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -542,6 +542,10 @@ bool LLAppViewerWin32::cleanup() gDXHardware.cleanup(); +#ifndef LL_RELEASE_FOR_DOWNLOAD + LLWinDebug::instance().cleanup(); +#endif + return result; } diff --git a/indra/newview/llwindebug.cpp b/indra/newview/llwindebug.cpp index 551d0be8d7..eff70ca0b2 100755 --- a/indra/newview/llwindebug.cpp +++ b/indra/newview/llwindebug.cpp @@ -45,7 +45,7 @@ public: ~LLMemoryReserve(); void reserve(); void release(); -protected: +private: unsigned char *mReserve; static const size_t MEMORY_RESERVATION_SIZE; }; @@ -53,7 +53,7 @@ protected: LLMemoryReserve::LLMemoryReserve() : mReserve(NULL) { -}; +} LLMemoryReserve::~LLMemoryReserve() { @@ -66,14 +66,19 @@ const size_t LLMemoryReserve::MEMORY_RESERVATION_SIZE = 5 * 1024 * 1024; void LLMemoryReserve::reserve() { if(NULL == mReserve) + { mReserve = new unsigned char[MEMORY_RESERVATION_SIZE]; -}; + } +} void LLMemoryReserve::release() { - delete [] mReserve; + if (NULL != mReserve) + { + delete [] mReserve; + } mReserve = NULL; -}; +} static LLMemoryReserve gEmergencyMemoryReserve; @@ -130,6 +135,11 @@ void LLWinDebug::init() } } +void LLWinDebug::cleanup () +{ + gEmergencyMemoryReserve.release(); +} + void LLWinDebug::writeDumpToFile(MINIDUMP_TYPE type, MINIDUMP_EXCEPTION_INFORMATION *ExInfop, const std::string& filename) { // Temporary fix to switch out the code that writes the DMP file. diff --git a/indra/newview/llwindebug.h b/indra/newview/llwindebug.h index 6f274c6f16..a3cbf6dc03 100755 --- a/indra/newview/llwindebug.h +++ b/indra/newview/llwindebug.h @@ -37,6 +37,7 @@ class LLWinDebug: public: static void init(); static void generateMinidump(struct _EXCEPTION_POINTERS *pExceptionInfo = NULL); + static void cleanup(); private: static void writeDumpToFile(MINIDUMP_TYPE type, MINIDUMP_EXCEPTION_INFORMATION *ExInfop, const std::string& filename); }; -- cgit v1.2.3 From 5e225213f6bdb7b4ca97abfef99b2249a1f88638 Mon Sep 17 00:00:00 2001 From: Stinson Linden <stinson@lindenlab.com> Date: Wed, 23 Apr 2014 17:57:23 +0100 Subject: MAINT-4009: Adding an ares cleanup call to free the allocated memory. --- indra/newview/llappviewer.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 3b9259a966..2b634074d5 100755 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2019,6 +2019,9 @@ bool LLAppViewer::cleanup() // Non-LLCurl libcurl library mAppCoreHttp.cleanup(); + // NOTE The following call is not thread safe. + ll_cleanup_ares(); + LLFilePickerThread::cleanupClass(); //MUST happen AFTER LLCurl::cleanupClass -- cgit v1.2.3 From 5969c3d04f501d1c330674153702d32051daaf67 Mon Sep 17 00:00:00 2001 From: Stinson Linden <stinson@lindenlab.com> Date: Wed, 23 Apr 2014 18:13:12 +0100 Subject: MAINT-4009: Freeing the allocated console during shutdown. --- indra/newview/llappviewerwin32.cpp | 17 +++++++++++++---- indra/newview/llappviewerwin32.h | 3 ++- 2 files changed, 15 insertions(+), 5 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index a1b4fd1035..57fb84bbf1 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -438,7 +438,7 @@ void LLAppViewerWin32::disableWinErrorReporting() const S32 MAX_CONSOLE_LINES = 500; -void create_console() +static bool create_console() { int h_con_handle; long l_std_handle; @@ -447,7 +447,7 @@ void create_console() FILE *fp; // allocate a console for this app - AllocConsole(); + const bool isConsoleAllocated = AllocConsole(); // set the screen buffer to be big enough to let us scroll text GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &coninfo); @@ -495,10 +495,13 @@ void create_console() *stderr = *fp; setvbuf( stderr, NULL, _IONBF, 0 ); } + + return isConsoleAllocated; } LLAppViewerWin32::LLAppViewerWin32(const char* cmd_line) : - mCmdLine(cmd_line) + mCmdLine(cmd_line), + mIsConsoleAllocated(false) { } @@ -546,6 +549,12 @@ bool LLAppViewerWin32::cleanup() LLWinDebug::instance().cleanup(); #endif + if (mIsConsoleAllocated) + { + FreeConsole(); + mIsConsoleAllocated = false; + } + return result; } @@ -557,7 +566,7 @@ void LLAppViewerWin32::initLoggingAndGetLastDuration() void LLAppViewerWin32::initConsole() { // pop up debug console - create_console(); + mIsConsoleAllocated = create_console(); return LLAppViewer::initConsole(); } diff --git a/indra/newview/llappviewerwin32.h b/indra/newview/llappviewerwin32.h index fb37df1a2f..59d1ddaa3d 100644 --- a/indra/newview/llappviewerwin32.h +++ b/indra/newview/llappviewerwin32.h @@ -61,7 +61,8 @@ protected: private: void disableWinErrorReporting(); - std::string mCmdLine; + std::string mCmdLine; + bool mIsConsoleAllocated; }; #endif // LL_LLAPPVIEWERWIN32_H -- cgit v1.2.3 From b24552e313dc971d7750025c4b6f953ee3155ea9 Mon Sep 17 00:00:00 2001 From: Stinson Linden <stinson@lindenlab.com> Date: Thu, 24 Apr 2014 01:50:17 +0100 Subject: MAINT-4009: Ensuring that the shader manager instance is released during cleanup. --- indra/newview/llviewershadermgr.cpp | 10 ++++++++++ indra/newview/llviewershadermgr.h | 1 + indra/newview/llviewerwindow.cpp | 6 ++++++ 3 files changed, 17 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 9d2a4a50e1..dafe2cafec 100755 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -355,6 +355,16 @@ LLViewerShaderMgr * LLViewerShaderMgr::instance() return static_cast<LLViewerShaderMgr*>(sInstance); } +// static +void LLViewerShaderMgr::releaseInstance() +{ + if (sInstance != NULL) + { + delete sInstance; + sInstance = NULL; + } +} + void LLViewerShaderMgr::initAttribsAndUniforms(void) { if (mReservedAttribs.empty()) diff --git a/indra/newview/llviewershadermgr.h b/indra/newview/llviewershadermgr.h index 42147fdd29..923aa522ad 100755 --- a/indra/newview/llviewershadermgr.h +++ b/indra/newview/llviewershadermgr.h @@ -43,6 +43,7 @@ public: // singleton pattern implementation static LLViewerShaderMgr * instance(); + static void releaseInstance(); void initAttribsAndUniforms(void); void setShaders(); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index aa75bae712..3dad782715 100755 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -2153,6 +2153,12 @@ LLViewerWindow::~LLViewerWindow() delete mDebugText; mDebugText = NULL; + + if (LLViewerShaderMgr::sInitialized) + { + LLViewerShaderMgr::releaseInstance(); + LLViewerShaderMgr::sInitialized = FALSE; + } } -- cgit v1.2.3 From 721ccc41bb6fca559146098a8cfdf02c785e6618 Mon Sep 17 00:00:00 2001 From: Stinson Linden <stinson@lindenlab.com> Date: Thu, 24 Apr 2014 21:55:35 +0100 Subject: MAINT-4009: Cleaning up some statically allocated memory in a LLVolumeGeometryManager method that was never freed. --- indra/newview/llspatialpartition.h | 16 ++++- indra/newview/llvovolume.cpp | 118 +++++++++++++++++++++++++++---------- 2 files changed, 102 insertions(+), 32 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llspatialpartition.h b/indra/newview/llspatialpartition.h index a7b99a0f6b..08a4d00d0f 100755 --- a/indra/newview/llspatialpartition.h +++ b/indra/newview/llspatialpartition.h @@ -640,12 +640,26 @@ class LLVolumeGeometryManager: public LLGeometryManager DISTANCE_SORT } eSortType; - virtual ~LLVolumeGeometryManager() { } + LLVolumeGeometryManager(); + virtual ~LLVolumeGeometryManager(); virtual void rebuildGeom(LLSpatialGroup* group); virtual void rebuildMesh(LLSpatialGroup* group); virtual void getGeometry(LLSpatialGroup* group); void genDrawInfo(LLSpatialGroup* group, U32 mask, LLFace** faces, U32 face_count, BOOL distance_sort = FALSE, BOOL batch_textures = FALSE, BOOL no_materials = FALSE); void registerFace(LLSpatialGroup* group, LLFace* facep, U32 type); + +private: + void allocateFaces(U32 pMaxFaceCount); + void freeFaces(); + + static int32_t sInstanceCount; + static LLFace** sFullbrightFaces; + static LLFace** sBumpFaces; + static LLFace** sSimpleFaces; + static LLFace** sNormFaces; + static LLFace** sSpecFaces; + static LLFace** sNormSpecFaces; + static LLFace** sAlphaFaces; }; //spatial partition that uses volume geometry manager (implemented in LLVOVolume.cpp) diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index d1108020ff..1fa14cf003 100755 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4059,7 +4059,8 @@ U32 LLVOVolume::getPartitionType() const } LLVolumePartition::LLVolumePartition(LLViewerRegion* regionp) -: LLSpatialPartition(LLVOVolume::VERTEX_DATA_MASK, TRUE, GL_DYNAMIC_DRAW_ARB, regionp) +: LLSpatialPartition(LLVOVolume::VERTEX_DATA_MASK, TRUE, GL_DYNAMIC_DRAW_ARB, regionp), +LLVolumeGeometryManager() { mLODPeriod = 32; mDepthMask = FALSE; @@ -4070,7 +4071,8 @@ LLVolumePartition::LLVolumePartition(LLViewerRegion* regionp) } LLVolumeBridge::LLVolumeBridge(LLDrawable* drawablep, LLViewerRegion* regionp) -: LLSpatialBridge(drawablep, TRUE, LLVOVolume::VERTEX_DATA_MASK, regionp) +: LLSpatialBridge(drawablep, TRUE, LLVOVolume::VERTEX_DATA_MASK, regionp), +LLVolumeGeometryManager() { mDepthMask = FALSE; mLODPeriod = 32; @@ -4107,6 +4109,70 @@ bool can_batch_texture(LLFace* facep) return true; } +const static U32 MAX_FACE_COUNT = 4096U; +int32_t LLVolumeGeometryManager::sInstanceCount = 0; +LLFace** LLVolumeGeometryManager::sFullbrightFaces = NULL; +LLFace** LLVolumeGeometryManager::sBumpFaces = NULL; +LLFace** LLVolumeGeometryManager::sSimpleFaces = NULL; +LLFace** LLVolumeGeometryManager::sNormFaces = NULL; +LLFace** LLVolumeGeometryManager::sSpecFaces = NULL; +LLFace** LLVolumeGeometryManager::sNormSpecFaces = NULL; +LLFace** LLVolumeGeometryManager::sAlphaFaces = NULL; + +LLVolumeGeometryManager::LLVolumeGeometryManager() + : LLGeometryManager() +{ + llassert(sInstanceCount >= 0); + if (sInstanceCount == 0) + { + allocateFaces(MAX_FACE_COUNT); + } + + ++sInstanceCount; +} + +LLVolumeGeometryManager::~LLVolumeGeometryManager() +{ + llassert(sInstanceCount > 0); + --sInstanceCount; + + if (sInstanceCount <= 0) + { + freeFaces(); + sInstanceCount = 0; + } +} + +void LLVolumeGeometryManager::allocateFaces(U32 pMaxFaceCount) +{ + sFullbrightFaces = static_cast<LLFace**>(ll_aligned_malloc<64>(pMaxFaceCount*sizeof(LLFace*))); + sBumpFaces = static_cast<LLFace**>(ll_aligned_malloc<64>(pMaxFaceCount*sizeof(LLFace*))); + sSimpleFaces = static_cast<LLFace**>(ll_aligned_malloc<64>(pMaxFaceCount*sizeof(LLFace*))); + sNormFaces = static_cast<LLFace**>(ll_aligned_malloc<64>(pMaxFaceCount*sizeof(LLFace*))); + sSpecFaces = static_cast<LLFace**>(ll_aligned_malloc<64>(pMaxFaceCount*sizeof(LLFace*))); + sNormSpecFaces = static_cast<LLFace**>(ll_aligned_malloc<64>(pMaxFaceCount*sizeof(LLFace*))); + sAlphaFaces = static_cast<LLFace**>(ll_aligned_malloc<64>(pMaxFaceCount*sizeof(LLFace*))); +} + +void LLVolumeGeometryManager::freeFaces() +{ + ll_aligned_free<64>(sFullbrightFaces); + ll_aligned_free<64>(sBumpFaces); + ll_aligned_free<64>(sSimpleFaces); + ll_aligned_free<64>(sNormFaces); + ll_aligned_free<64>(sSpecFaces); + ll_aligned_free<64>(sNormSpecFaces); + ll_aligned_free<64>(sAlphaFaces); + + sFullbrightFaces = NULL; + sBumpFaces = NULL; + sSimpleFaces = NULL; + sNormFaces = NULL; + sSpecFaces = NULL; + sNormSpecFaces = NULL; + sAlphaFaces = NULL; +} + static LLTrace::BlockTimerStatHandle FTM_REGISTER_FACE("Register Face"); void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, U32 type) @@ -4429,16 +4495,6 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) mFaceList.clear(); - const U32 MAX_FACE_COUNT = 4096; - - static LLFace** fullbright_faces = (LLFace**) ll_aligned_malloc<64>(MAX_FACE_COUNT*sizeof(LLFace*)); - static LLFace** bump_faces = (LLFace**) ll_aligned_malloc<64>(MAX_FACE_COUNT*sizeof(LLFace*)); - static LLFace** simple_faces = (LLFace**) ll_aligned_malloc<64>(MAX_FACE_COUNT*sizeof(LLFace*)); - static LLFace** norm_faces = (LLFace**) ll_aligned_malloc<64>(MAX_FACE_COUNT*sizeof(LLFace*)); - static LLFace** spec_faces = (LLFace**) ll_aligned_malloc<64>(MAX_FACE_COUNT*sizeof(LLFace*)); - static LLFace** normspec_faces = (LLFace**) ll_aligned_malloc<64>(MAX_FACE_COUNT*sizeof(LLFace*)); - static LLFace** alpha_faces = (LLFace**) ll_aligned_malloc<64>(MAX_FACE_COUNT*sizeof(LLFace*)); - U32 fullbright_count = 0; U32 bump_count = 0; U32 simple_count = 0; @@ -4820,7 +4876,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) { //can be treated as alpha mask if (simple_count < MAX_FACE_COUNT) { - simple_faces[simple_count++] = facep; + sSimpleFaces[simple_count++] = facep; } } else @@ -4831,7 +4887,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) } if (alpha_count < MAX_FACE_COUNT) { - alpha_faces[alpha_count++] = facep; + sAlphaFaces[alpha_count++] = facep; } } } @@ -4854,14 +4910,14 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) { //has normal and specular maps (needs texcoord1, texcoord2, and tangent) if (normspec_count < MAX_FACE_COUNT) { - normspec_faces[normspec_count++] = facep; + sNormSpecFaces[normspec_count++] = facep; } } else { //has normal map (needs texcoord1 and tangent) if (norm_count < MAX_FACE_COUNT) { - norm_faces[norm_count++] = facep; + sNormFaces[norm_count++] = facep; } } } @@ -4869,14 +4925,14 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) { //has specular map but no normal map, needs texcoord2 if (spec_count < MAX_FACE_COUNT) { - spec_faces[spec_count++] = facep; + sSpecFaces[spec_count++] = facep; } } else { //has neither specular map nor normal map, only needs texcoord0 if (simple_count < MAX_FACE_COUNT) { - simple_faces[simple_count++] = facep; + sSimpleFaces[simple_count++] = facep; } } } @@ -4884,14 +4940,14 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) { //needs normal + tangent if (bump_count < MAX_FACE_COUNT) { - bump_faces[bump_count++] = facep; + sBumpFaces[bump_count++] = facep; } } else if (te->getShiny() || !te->getFullbright()) { //needs normal if (simple_count < MAX_FACE_COUNT) { - simple_faces[simple_count++] = facep; + sSimpleFaces[simple_count++] = facep; } } else @@ -4899,7 +4955,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) facep->setState(LLFace::FULLBRIGHT); if (fullbright_count < MAX_FACE_COUNT) { - fullbright_faces[fullbright_count++] = facep; + sFullbrightFaces[fullbright_count++] = facep; } } } @@ -4909,7 +4965,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) { //needs normal + tangent if (bump_count < MAX_FACE_COUNT) { - bump_faces[bump_count++] = facep; + sBumpFaces[bump_count++] = facep; } } else if ((te->getShiny() && LLPipeline::sRenderBump) || @@ -4917,7 +4973,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) { //needs normal if (simple_count < MAX_FACE_COUNT) { - simple_faces[simple_count++] = facep; + sSimpleFaces[simple_count++] = facep; } } else @@ -4925,7 +4981,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) facep->setState(LLFace::FULLBRIGHT); if (fullbright_count < MAX_FACE_COUNT) { - fullbright_faces[fullbright_count++] = facep; + sFullbrightFaces[fullbright_count++] = facep; } } } @@ -4988,13 +5044,13 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) fullbright_mask = fullbright_mask | LLVertexBuffer::MAP_TEXTURE_INDEX; } - genDrawInfo(group, simple_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, simple_faces, simple_count, FALSE, batch_textures, FALSE); - genDrawInfo(group, fullbright_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, fullbright_faces, fullbright_count, FALSE, batch_textures); - genDrawInfo(group, alpha_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, alpha_faces, alpha_count, TRUE, batch_textures); - genDrawInfo(group, bump_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, bump_faces, bump_count, FALSE, FALSE); - genDrawInfo(group, norm_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, norm_faces, norm_count, FALSE, FALSE); - genDrawInfo(group, spec_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, spec_faces, spec_count, FALSE, FALSE); - genDrawInfo(group, normspec_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, normspec_faces, normspec_count, FALSE, FALSE); + genDrawInfo(group, simple_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, sSimpleFaces, simple_count, FALSE, batch_textures, FALSE); + genDrawInfo(group, fullbright_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, sFullbrightFaces, fullbright_count, FALSE, batch_textures); + genDrawInfo(group, alpha_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, sAlphaFaces, alpha_count, TRUE, batch_textures); + genDrawInfo(group, bump_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, sBumpFaces, bump_count, FALSE, FALSE); + genDrawInfo(group, norm_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, sNormFaces, norm_count, FALSE, FALSE); + genDrawInfo(group, spec_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, sSpecFaces, spec_count, FALSE, FALSE); + genDrawInfo(group, normspec_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, sNormSpecFaces, normspec_count, FALSE, FALSE); if (!LLPipeline::sDelayVBUpdate) { -- cgit v1.2.3 From 37d620463b6f6d0ec932f1660f314268bafa229a Mon Sep 17 00:00:00 2001 From: Stinson Linden <stinson@lindenlab.com> Date: Mon, 28 Apr 2014 19:18:47 +0100 Subject: MAINT-4009: Cleaning up the error callstacks memory before app quit. --- indra/newview/llappviewer.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 2b634074d5..f92467a562 100755 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2117,6 +2117,8 @@ bool LLAppViewer::cleanup() ll_close_fail_log(); + LLError::LLCallStacks::cleanup(); + removeMarkerFiles(); LL_INFOS() << "Goodbye!" << LL_ENDL; -- cgit v1.2.3 From 827a9f7c2d98a10d09ab87b16c92a22295f21cde Mon Sep 17 00:00:00 2001 From: Stinson Linden <stinson@lindenlab.com> Date: Fri, 2 May 2014 00:28:22 +0100 Subject: MAINT-4009: Patching the memory leak occurring in the scenario where toast panels were being created, but the screen channel were deciding not to display the given toasts. --- indra/newview/llscreenchannel.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp index 6a840f3f40..8708fb87ee 100755 --- a/indra/newview/llscreenchannel.cpp +++ b/indra/newview/llscreenchannel.cpp @@ -273,6 +273,14 @@ void LLScreenChannel::addToast(const LLToast::Params& p) // only cancel notification if it isn't being used in IM session LLNotifications::instance().cancel(notification); } + + // It was assumed that the toast would take ownership of the panel pointer. + // But since we have decided not to display the toast, kill the panel to + // prevent the memory leak. + if (p.panel != NULL) + { + p.panel()->die(); + } return; } -- cgit v1.2.3 From 205503dd84479be4989e5f5567a1d187cc0e71eb Mon Sep 17 00:00:00 2001 From: Stinson Linden <stinson@lindenlab.com> Date: Fri, 2 May 2014 23:04:06 +0100 Subject: MAINT-4009: Patching the memory leak occurring from the info icons that appear when hovering over a chat history item. --- indra/newview/llchathistory.cpp | 47 ++++++++++++----------------------------- indra/newview/llchathistory.h | 7 +++--- 2 files changed, 18 insertions(+), 36 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 05c4181714..84b9ac756a 100755 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -107,6 +107,7 @@ class LLChatHistoryHeader: public LLPanel public: LLChatHistoryHeader() : LLPanel(), + mInfoCtrl(NULL), mPopupMenuHandleAvatar(), mPopupMenuHandleObject(), mAvatarID(), @@ -129,9 +130,6 @@ public: ~LLChatHistoryHeader() { - // Detach the info button so that it doesn't get destroyed (EXT-8463). - hideInfoCtrl(); - if (mAvatarNameCacheConnection.connected()) { mAvatarNameCacheConnection.disconnect(); @@ -292,6 +290,11 @@ public: mUserNameTextBox = getChild<LLTextBox>("user_name"); mTimeBoxTextBox = getChild<LLTextBox>("time_box"); + mInfoCtrl = LLUICtrlFactory::getInstance()->createFromFile<LLUICtrl>("inspector_info_ctrl.xml", this, LLPanel::child_registry_t::instance()); + llassert(mInfoCtrl != NULL); + mInfoCtrl->setCommitCallback(boost::bind(&LLChatHistoryHeader::onClickInfoCtrl, mInfoCtrl)); + mInfoCtrl->setVisible(FALSE); + return LLPanel::postBuild(); } @@ -589,39 +592,19 @@ protected: void showInfoCtrl() { - if (mAvatarID.isNull() || mFrom.empty() || CHAT_SOURCE_SYSTEM == mSourceType) return; - - if (!sInfoCtrl) - { - // *TODO: Delete the button at exit. - sInfoCtrl = LLUICtrlFactory::createFromFile<LLUICtrl>("inspector_info_ctrl.xml", NULL, LLPanel::child_registry_t::instance()); - if (sInfoCtrl) - { - sInfoCtrl->setCommitCallback(boost::bind(&LLChatHistoryHeader::onClickInfoCtrl, sInfoCtrl)); - } - } - - if (!sInfoCtrl) + const bool isVisible = !mAvatarID.isNull() && !mFrom.empty() && CHAT_SOURCE_SYSTEM != mSourceType; + if (isVisible) { - llassert(sInfoCtrl != NULL); - return; + const LLRect sticky_rect = mUserNameTextBox->getRect(); + S32 icon_x = llmin(sticky_rect.mLeft + mUserNameTextBox->getTextBoundingRect().getWidth() + 7, sticky_rect.mRight - 3); + mInfoCtrl->setOrigin(icon_x, sticky_rect.getCenterY() - mInfoCtrl->getRect().getHeight() / 2 ) ; } - - LLTextBox* name = getChild<LLTextBox>("user_name"); - LLRect sticky_rect = name->getRect(); - S32 icon_x = llmin(sticky_rect.mLeft + name->getTextBoundingRect().getWidth() + 7, sticky_rect.mRight - 3); - sInfoCtrl->setOrigin(icon_x, sticky_rect.getCenterY() - sInfoCtrl->getRect().getHeight() / 2 ) ; - addChild(sInfoCtrl); + mInfoCtrl->setVisible(isVisible); } void hideInfoCtrl() { - if (!sInfoCtrl) return; - - if (sInfoCtrl->getParent() == this) - { - removeChild(sInfoCtrl); - } + mInfoCtrl->setVisible(FALSE); } private: @@ -692,7 +675,7 @@ protected: LLHandle<LLView> mPopupMenuHandleAvatar; LLHandle<LLView> mPopupMenuHandleObject; - static LLUICtrl* sInfoCtrl; + LLUICtrl* mInfoCtrl; LLUUID mAvatarID; LLSD mObjectData; @@ -709,8 +692,6 @@ private: boost::signals2::connection mAvatarNameCacheConnection; }; -LLUICtrl* LLChatHistoryHeader::sInfoCtrl = NULL; - LLChatHistory::LLChatHistory(const LLChatHistory::Params& p) : LLUICtrl(p), mMessageHeaderFilename(p.message_header), diff --git a/indra/newview/llchathistory.h b/indra/newview/llchathistory.h index bb6d4fb59c..44736a0489 100755 --- a/indra/newview/llchathistory.h +++ b/indra/newview/llchathistory.h @@ -93,14 +93,15 @@ class LLChatHistory : public LLUICtrl * @return pointer to LLView separator object. */ LLView* getSeparator(); + + void onClickMoreText(); + + private: /** * Builds a message header. * @return pointer to LLView header object. */ LLView* getHeader(const LLChat& chat,const LLStyle::Params& style_params, const LLSD& args); - - void onClickMoreText(); - public: ~LLChatHistory(); LLSD getValue() const; -- cgit v1.2.3 From 001621dfc21942a6ae0075ca3eef31720f42477b Mon Sep 17 00:00:00 2001 From: Stinson Linden <stinson@lindenlab.com> Date: Mon, 5 May 2014 23:24:34 +0100 Subject: MAINT-4009: Patching a small memory leak for when menu items were being created before the viewer window initialization had created the menu holder. Also, added llasserts in other cases when referencing the menu holder to ensure the holder is non-null. --- indra/newview/llchiclet.cpp | 1 + indra/newview/lllistcontextmenu.cpp | 1 + indra/newview/llmediactrl.cpp | 7 +++++++ indra/newview/llmediactrl.h | 2 ++ indra/newview/llpaneloutfitedit.cpp | 2 ++ indra/newview/llpanelteleporthistory.cpp | 2 ++ indra/newview/llviewerwindow.cpp | 6 +++++- 7 files changed, 20 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index b1dce42dfd..c0823182c0 100755 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -204,6 +204,7 @@ void LLNotificationChiclet::createMenu() enable_registrar.add("NotificationWellChicletMenu.EnableItem", boost::bind(&LLNotificationChiclet::enableMenuItem, this, _2)); + llassert(LLMenuGL::sMenuContainer != NULL); mContextMenu = LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu> ("menu_notification_well_button.xml", LLMenuGL::sMenuContainer, diff --git a/indra/newview/lllistcontextmenu.cpp b/indra/newview/lllistcontextmenu.cpp index a624c9fb87..6bda8b1d0d 100755 --- a/indra/newview/lllistcontextmenu.cpp +++ b/indra/newview/lllistcontextmenu.cpp @@ -110,6 +110,7 @@ void LLListContextMenu::handleMultiple(functor_t functor, const uuid_vec_t& ids) // static LLContextMenu* LLListContextMenu::createFromFile(const std::string& filename) { + llassert(LLMenuGL::sMenuContainer != NULL); return LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu>( filename, LLContextMenu::sMenuContainer, LLViewerMenuHolderGL::child_registry_t::instance()); } diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index 323445afa6..90d4dd093b 100755 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -390,6 +390,8 @@ BOOL LLMediaCtrl::postBuild () LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registar; registar.add("Open.WebInspector", boost::bind(&LLMediaCtrl::onOpenWebInspector, this)); + // stinson 05/05/2014 : cannot assert on the menu container being NULL because it will be during the processing of main_view.xml + // llassert(LLMenuGL::sMenuContainer != NULL); mContextMenu = LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu>( "menu_media_ctrl.xml", LLMenuGL::sMenuContainer, LLViewerMenuHolderGL::child_registry_t::instance()); setVisibleCallback(boost::bind(&LLMediaCtrl::onVisibilityChanged, this, _2)); @@ -1117,3 +1119,8 @@ void LLMediaCtrl::setTrustedContent(bool trusted) mMediaSource->setTrustedBrowser(trusted); } } + +void LLMediaCtrl::updateContextMenuParent(LLView* pNewParent) +{ + mContextMenu->updateParent(pNewParent); +} diff --git a/indra/newview/llmediactrl.h b/indra/newview/llmediactrl.h index 5978a7a344..b07eb356ae 100755 --- a/indra/newview/llmediactrl.h +++ b/indra/newview/llmediactrl.h @@ -168,6 +168,8 @@ public: LLUUID getTextureID() {return mMediaTextureID;} + void updateContextMenuParent(LLView* pNewParent); + protected: void convertInputCoords(S32& x, S32& y); diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index e48aa88937..158038c4f7 100755 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -159,6 +159,7 @@ public: registrar.add("Wearable.Create", boost::bind(onCreate, _2)); + llassert(LLMenuGL::sMenuContainer != NULL); LLToggleableMenu* menu = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>( "menu_cof_gear.xml", LLMenuGL::sMenuContainer, LLViewerMenuHolderGL::child_registry_t::instance()); llassert(menu); @@ -228,6 +229,7 @@ public: enable_registrar.add("AddWearable.Gear.Check", boost::bind(onCheck, flat_list_handle, inventory_panel_handle, _2)); enable_registrar.add("AddWearable.Gear.Visible", boost::bind(onVisible, inventory_panel_handle, _2)); + llassert(LLMenuGL::sMenuContainer != NULL); LLToggleableMenu* menu = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>( "menu_add_wearable_gear.xml", LLMenuGL::sMenuContainer, LLViewerMenuHolderGL::child_registry_t::instance()); diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp index 8fddd9523f..652d2be6f6 100755 --- a/indra/newview/llpanelteleporthistory.cpp +++ b/indra/newview/llpanelteleporthistory.cpp @@ -341,6 +341,7 @@ LLContextMenu* LLTeleportHistoryPanel::ContextMenu::createMenu() registrar.add("TeleportHistory.CopyToClipboard",boost::bind(&LLTeleportHistoryPanel::ContextMenu::onCopyToClipboard, this)); // create the context menu from the XUI + llassert(LLMenuGL::sMenuContainer != NULL); return LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu>( "menu_teleport_history_item.xml", LLMenuGL::sMenuContainer, LLViewerMenuHolderGL::child_registry_t::instance()); } @@ -935,6 +936,7 @@ void LLTeleportHistoryPanel::onAccordionTabRightClick(LLView *view, S32 x, S32 y registrar.add("TeleportHistory.TabClose", boost::bind(&LLTeleportHistoryPanel::onAccordionTabClose, this, tab)); // create the context menu from the XUI + llassert(LLMenuGL::sMenuContainer != NULL); mAccordionTabMenu = LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu>( "menu_teleport_history_tab.xml", LLMenuGL::sMenuContainer, LLViewerMenuHolderGL::child_registry_t::instance()); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 3dad782715..621baee0e6 100755 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1910,9 +1910,13 @@ void LLViewerWindow::initBase() setProgressCancelButtonVisible(FALSE); gMenuHolder = getRootView()->getChild<LLViewerMenuHolderGL>("Menu Holder"); - LLMenuGL::sMenuContainer = gMenuHolder; + // stinson 05/05/2014 : the panel_progress.xml references a LLMediaCtrl(<web_browser></web_browser>) class + // which creates some menu items. However, because the Menu Holder is not initialized then, we need to + // update the parent for the menu items so they will be properly cleaned up. + LLMediaCtrl* mediaCtrl = getRootView()->findChild<LLMediaCtrl>("login_media_panel"); + mediaCtrl->updateContextMenuParent(LLMenuGL::sMenuContainer); } void LLViewerWindow::initWorldUI() -- cgit v1.2.3 From 12d44073c8399bb29588f252b95d19f0d379998d Mon Sep 17 00:00:00 2001 From: Stinson Linden <stinson@lindenlab.com> Date: Tue, 6 May 2014 01:11:46 +0100 Subject: MAINT-4009: Ensuring that the spare browser media source is cleaned up with the LLViewerMedia class. --- indra/newview/llviewermedia.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 7958537856..0967ca23c0 100755 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -1603,6 +1603,11 @@ void LLViewerMedia::cleanupClass() { gIdleCallbacks.deleteFunction(LLViewerMedia::updateMedia, NULL); sTeleportFinishConnection.disconnect(); + if (sSpareBrowserMediaSource != NULL) + { + delete sSpareBrowserMediaSource; + sSpareBrowserMediaSource = NULL; + } } ////////////////////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3 From 403d569adc676e3a0af96175c77e07d0631f9aae Mon Sep 17 00:00:00 2001 From: AndreyL ProductEngine <andreylproductengine@lindenlab.com> Date: Fri, 9 May 2014 05:15:54 +0300 Subject: MAINT-3981 FIXED [SECURITY] Notecard being passed around that crashes any V3 based viewer when opened. Correct fix after testing. --- indra/newview/llviewertexteditor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp index 69f9bbdff8..0c4f55d704 100755 --- a/indra/newview/llviewertexteditor.cpp +++ b/indra/newview/llviewertexteditor.cpp @@ -542,8 +542,8 @@ LLUIImagePtr LLEmbeddedItems::getItemImage(llwchar ext_char) const case LLAssetType::AT_BODYPART: img_name = "Inv_Skin"; break; case LLAssetType::AT_ANIMATION: img_name = "Inv_Animation"; break; case LLAssetType::AT_GESTURE: img_name = "Inv_Gesture"; break; - case LLAssetType::AT_MESH: img_name = "Inv_Mesh"; break; - default: llassert(0); + case LLAssetType::AT_MESH: img_name = "Inv_Mesh"; break; + default: img_name = "Inv_Invalid"; break; // use the Inv_Invalid icon for undefined object types (see MAINT-3981) } return LLUI::getUIImage(img_name); -- cgit v1.2.3 From 8e7912f3821b3e20b528239b7ebfe0c6a9bffc71 Mon Sep 17 00:00:00 2001 From: Stinson Linden <stinson@lindenlab.com> Date: Fri, 9 May 2014 23:06:53 +0100 Subject: MAINT-4009: Improved patching of a memory leak for when menu items are created before the viewer window initialization has created the menu holder. See also changeset bc0743639926a84b38b4907d252eff1cc0498c7d. --- indra/newview/llmediactrl.cpp | 8 +++++--- indra/newview/llviewerwindow.cpp | 6 ------ 2 files changed, 5 insertions(+), 9 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index 90d4dd093b..c4b68bb7e1 100755 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -390,10 +390,12 @@ BOOL LLMediaCtrl::postBuild () LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registar; registar.add("Open.WebInspector", boost::bind(&LLMediaCtrl::onOpenWebInspector, this)); - // stinson 05/05/2014 : cannot assert on the menu container being NULL because it will be during the processing of main_view.xml - // llassert(LLMenuGL::sMenuContainer != NULL); + // stinson 05/05/2014 : use this as the parent of the context menu if the static menu + // container has yet to be created + LLPanel* menuParent = (LLMenuGL::sMenuContainer != NULL) ? dynamic_cast<LLPanel*>(LLMenuGL::sMenuContainer) : dynamic_cast<LLPanel*>(this); + llassert(menuParent != NULL); mContextMenu = LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu>( - "menu_media_ctrl.xml", LLMenuGL::sMenuContainer, LLViewerMenuHolderGL::child_registry_t::instance()); + "menu_media_ctrl.xml", menuParent, LLViewerMenuHolderGL::child_registry_t::instance()); setVisibleCallback(boost::bind(&LLMediaCtrl::onVisibilityChanged, this, _2)); return TRUE; diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 621baee0e6..2cb8e6a3ab 100755 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1911,12 +1911,6 @@ void LLViewerWindow::initBase() gMenuHolder = getRootView()->getChild<LLViewerMenuHolderGL>("Menu Holder"); LLMenuGL::sMenuContainer = gMenuHolder; - - // stinson 05/05/2014 : the panel_progress.xml references a LLMediaCtrl(<web_browser></web_browser>) class - // which creates some menu items. However, because the Menu Holder is not initialized then, we need to - // update the parent for the menu items so they will be properly cleaned up. - LLMediaCtrl* mediaCtrl = getRootView()->findChild<LLMediaCtrl>("login_media_panel"); - mediaCtrl->updateContextMenuParent(LLMenuGL::sMenuContainer); } void LLViewerWindow::initWorldUI() -- cgit v1.2.3 From 487ca1bad37883be0325b564ab557a8f77575388 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Wed, 14 May 2014 17:50:59 -0400 Subject: v-r -> s-e merge WIP --- indra/newview/llagentwearables.cpp | 21 ++-- indra/newview/llagentwearables.h | 2 +- indra/newview/llaisapi.cpp | 34 ++--- indra/newview/llappearancemgr.cpp | 115 +++++++++-------- indra/newview/llassetuploadqueue.cpp | 2 +- indra/newview/llassetuploadresponders.cpp | 2 +- indra/newview/lleventpoll.cpp | 2 +- indra/newview/llfacebookconnect.cpp | 4 +- indra/newview/llfeaturemanager.cpp | 2 +- indra/newview/llhomelocationresponder.cpp | 6 +- indra/newview/llhttpretrypolicy.cpp | 8 +- indra/newview/llinventorymodel.cpp | 144 +++++++++++----------- indra/newview/llinventorymodelbackgroundfetch.cpp | 4 +- indra/newview/llinventoryobserver.cpp | 2 +- indra/newview/llmeshrepository.cpp | 1 - indra/newview/llpaneleditwearable.cpp | 2 +- indra/newview/llpathfindingmanager.cpp | 14 +-- indra/newview/llpathfindingnavmesh.cpp | 2 - indra/newview/llstartup.cpp | 8 +- indra/newview/lltexturefetch.cpp | 36 +++--- indra/newview/llviewerinventory.cpp | 42 +++---- indra/newview/llviewermedia.cpp | 8 +- indra/newview/llviewerregion.cpp | 23 ++-- indra/newview/llviewerstats.cpp | 6 +- indra/newview/llviewertexture.cpp | 28 ++--- indra/newview/llvoavatar.cpp | 24 ++-- indra/newview/llvoavatarself.cpp | 9 +- indra/newview/llwearablelist.cpp | 2 +- indra/newview/llwebprofile.cpp | 4 +- indra/newview/llwebsharing.cpp | 4 +- 30 files changed, 274 insertions(+), 287 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 6ce6b33790..11666f6c8f 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -770,7 +770,7 @@ void LLAgentWearables::createStandardWearables() // remove this function once the SH-3455 changesets are universally deployed. void LLAgentWearables::sendDummyAgentWearablesUpdate() { - LL_DEBUGS("Avatar") << "sendAgentWearablesUpdate()" << llendl; + LL_DEBUGS("Avatar") << "sendAgentWearablesUpdate()" << LL_ENDL; // Send the AgentIsNowWearing gMessageSystem->newMessageFast(_PREHASH_AgentIsNowWearing); @@ -936,13 +936,12 @@ void LLAgentWearables::removeWearableFinal(const LLWearableType::EType type, boo // Assumes existing wearables are not dirty. void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& items, - const std::vector< LLViewerWearable* >& wearables, - BOOL remove) + const std::vector< LLViewerWearable* >& wearables) { LL_INFOS() << "setWearableOutfit() start" << LL_ENDL; - S32 count = wearables.count(); - llassert(items.count() == count); + S32 count = wearables.size(); + llassert(items.size() == count); // Check for whether outfit already matches the one requested S32 matched = 0, mismatched = 0; @@ -957,7 +956,7 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it const LLWearableType::EType type = new_wearable->getType(); if (type < 0 || type>=LLWearableType::WT_COUNT) { - llwarns << "invalid type " << type << llendl; + LL_WARNS() << "invalid type " << type << LL_ENDL; mismatched++; continue; } @@ -970,7 +969,7 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it { LL_DEBUGS("Avatar") << "mismatch, type " << type << " index " << index << " names " << (curr_wearable ? curr_wearable->getName() : "NONE") << "," - << " names " << (new_wearable ? new_wearable->getName() : "NONE") << llendl; + << " names " << (new_wearable ? new_wearable->getName() : "NONE") << LL_ENDL; mismatched++; continue; } @@ -981,26 +980,26 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it LL_DEBUGS("Avatar") << "mismatch on name or inventory id, names " << curr_wearable->getName() << " vs " << new_item->getName() << " item ids " << curr_wearable->getItemID() << " vs " << new_item->getUUID() - << llendl; + << LL_ENDL; mismatched++; continue; } // If we got here, everything matches. matched++; } - LL_DEBUGS("Avatar") << "matched " << matched << " mismatched " << mismatched << llendl; + LL_DEBUGS("Avatar") << "matched " << matched << " mismatched " << mismatched << LL_ENDL; for (S32 j=0; j<LLWearableType::WT_COUNT; j++) { LLWearableType::EType type = (LLWearableType::EType) j; if (getWearableCount(type) != type_counts[j]) { - LL_DEBUGS("Avatar") << "count mismatch for type " << j << " current " << getWearableCount(j) << " requested " << type_counts[j] << llendl; + LL_DEBUGS("Avatar") << "count mismatch for type " << j << " current " << getWearableCount(j) << " requested " << type_counts[j] << LL_ENDL; mismatched++; } } if (mismatched == 0) { - LL_DEBUGS("Avatar") << "no changes, bailing out" << llendl; + LL_DEBUGS("Avatar") << "no changes, bailing out" << LL_ENDL; return; } diff --git a/indra/newview/llagentwearables.h b/indra/newview/llagentwearables.h index 08d7de8a4c..cdb1bdbe05 100755 --- a/indra/newview/llagentwearables.h +++ b/indra/newview/llagentwearables.h @@ -103,7 +103,7 @@ private: /*virtual*/void wearableUpdated(LLWearable *wearable, BOOL removed); public: void setWearableItem(LLInventoryItem* new_item, LLViewerWearable* wearable, bool do_append = false); - void setWearableOutfit(const LLInventoryItem::item_array_t& items, const std::vector< LLViewerWearable* >& wearables, BOOL remove); + void setWearableOutfit(const LLInventoryItem::item_array_t& items, const std::vector< LLViewerWearable* >& wearables); void setWearableName(const LLUUID& item_id, const std::string& new_name); // *TODO: Move this into llappearance/LLWearableData ? void addLocalTextureObject(const LLWearableType::EType wearable_type, const LLAvatarAppearanceDefines::ETextureIndex texture_type, U32 wearable_index); diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp index 38eb34676e..da66ea357a 100755 --- a/indra/newview/llaisapi.cpp +++ b/indra/newview/llaisapi.cpp @@ -171,7 +171,7 @@ RemoveItemCommand::RemoveItemCommand(const LLUUID& item_id, std::string cap; if (!getInvCap(cap)) { - llwarns << "No cap found" << llendl; + LL_WARNS() << "No cap found" << LL_ENDL; return; } std::string url = cap + std::string("/item/") + item_id.asString(); @@ -190,7 +190,7 @@ RemoveCategoryCommand::RemoveCategoryCommand(const LLUUID& item_id, std::string cap; if (!getInvCap(cap)) { - llwarns << "No cap found" << llendl; + LL_WARNS() << "No cap found" << LL_ENDL; return; } std::string url = cap + std::string("/category/") + item_id.asString(); @@ -209,7 +209,7 @@ PurgeDescendentsCommand::PurgeDescendentsCommand(const LLUUID& item_id, std::string cap; if (!getInvCap(cap)) { - llwarns << "No cap found" << llendl; + LL_WARNS() << "No cap found" << LL_ENDL; return; } std::string url = cap + std::string("/category/") + item_id.asString() + "/children"; @@ -230,7 +230,7 @@ UpdateItemCommand::UpdateItemCommand(const LLUUID& item_id, std::string cap; if (!getInvCap(cap)) { - llwarns << "No cap found" << llendl; + LL_WARNS() << "No cap found" << LL_ENDL; return; } std::string url = cap + std::string("/item/") + item_id.asString(); @@ -253,7 +253,7 @@ UpdateCategoryCommand::UpdateCategoryCommand(const LLUUID& cat_id, std::string cap; if (!getInvCap(cap)) { - llwarns << "No cap found" << llendl; + LL_WARNS() << "No cap found" << LL_ENDL; return; } std::string url = cap + std::string("/category/") + cat_id.asString(); @@ -275,7 +275,7 @@ CreateInventoryCommand::CreateInventoryCommand(const LLUUID& parent_id, std::string cap; if (!getInvCap(cap)) { - llwarns << "No cap found" << llendl; + LL_WARNS() << "No cap found" << LL_ENDL; return; } LLUUID tid; @@ -297,13 +297,13 @@ SlamFolderCommand::SlamFolderCommand(const LLUUID& folder_id, const LLSD& conten std::string cap; if (!getInvCap(cap)) { - llwarns << "No cap found" << llendl; + LL_WARNS() << "No cap found" << LL_ENDL; return; } LLUUID tid; tid.generate(); std::string url = cap + std::string("/category/") + folder_id.asString() + "/links?tid=" + tid.asString(); - llinfos << url << llendl; + LL_INFOS() << url << LL_ENDL; LLCurl::ResponderPtr responder = this; LLSD headers; headers["Content-Type"] = "application/llsd+xml"; @@ -320,14 +320,14 @@ CopyLibraryCategoryCommand::CopyLibraryCategoryCommand(const LLUUID& source_id, std::string cap; if (!getLibCap(cap)) { - llwarns << "No cap found" << llendl; + LL_WARNS() << "No cap found" << LL_ENDL; return; } LL_DEBUGS("Inventory") << "Copying library category: " << source_id << " => " << dest_id << LL_ENDL; LLUUID tid; tid.generate(); std::string url = cap + std::string("/category/") + source_id.asString() + "?tid=" + tid.asString(); - llinfos << url << llendl; + LL_INFOS() << url << LL_ENDL; LLCurl::ResponderPtr responder = this; LLSD headers; F32 timeout = HTTP_REQUEST_EXPIRY_SECS; @@ -482,7 +482,7 @@ void AISUpdate::parseItem(const LLSD& item_map) else { // *TODO: Wow, harsh. Should we just complain and get out? - llerrs << "unpack failed" << llendl; + LL_ERRS() << "unpack failed" << LL_ENDL; } } @@ -524,7 +524,7 @@ void AISUpdate::parseLink(const LLSD& link_map) else { // *TODO: Wow, harsh. Should we just complain and get out? - llerrs << "unpack failed" << llendl; + LL_ERRS() << "unpack failed" << LL_ENDL; } } @@ -590,7 +590,7 @@ void AISUpdate::parseCategory(const LLSD& category_map) else { // *TODO: Wow, harsh. Should we just complain and get out? - llerrs << "unpack failed" << llendl; + LL_ERRS() << "unpack failed" << LL_ENDL; } // Check for more embedded content. @@ -739,7 +739,7 @@ void AISUpdate::doUpdate() for (std::map<LLUUID,S32>::const_iterator catit = mCatDescendentDeltas.begin(); catit != mCatDescendentDeltas.end(); ++catit) { - LL_DEBUGS("Inventory") << "descendent accounting for " << catit->first << llendl; + LL_DEBUGS("Inventory") << "descendent accounting for " << catit->first << LL_ENDL; const LLUUID cat_id(catit->first); // Don't account for update if we just created this category. @@ -853,12 +853,12 @@ void AISUpdate::doUpdate() const LLUUID id = ucv_it->first; S32 version = ucv_it->second; LLViewerInventoryCategory *cat = gInventory.getCategory(id); - LL_DEBUGS("Inventory") << "cat version update " << cat->getName() << " to version " << cat->getVersion() << llendl; + LL_DEBUGS("Inventory") << "cat version update " << cat->getName() << " to version " << cat->getVersion() << LL_ENDL; if (cat->getVersion() != version) { - llwarns << "Possible version mismatch for category " << cat->getName() + LL_WARNS() << "Possible version mismatch for category " << cat->getName() << ", viewer version " << cat->getVersion() - << " server version " << version << llendl; + << " server version " << version << LL_ENDL; } } diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 5e3753a476..dc503dc50e 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -665,7 +665,7 @@ LLWearableHoldingPattern::LLWearableHoldingPattern(): } mIndex = sNextIndex++; sActiveHoldingPatterns.insert(this); - LL_DEBUGS("Avatar") << "HP " << index() << " created" << llendl; + LL_DEBUGS("Avatar") << "HP " << index() << " created" << LL_ENDL; selfStartPhase("holding_pattern"); } @@ -676,7 +676,7 @@ LLWearableHoldingPattern::~LLWearableHoldingPattern() { selfStopPhase("holding_pattern"); } - LL_DEBUGS("Avatar") << "HP " << index() << " deleted" << llendl; + LL_DEBUGS("Avatar") << "HP " << index() << " deleted" << LL_ENDL; } bool LLWearableHoldingPattern::isMostRecent() @@ -880,11 +880,11 @@ void recovered_item_link_cb(const LLUUID& item_id, LLWearableType::EType type, L { if (!holder->isMostRecent()) { - llwarns << "HP " << holder->index() << " skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; + LL_WARNS() << "HP " << holder->index() << " skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << LL_ENDL; // runway skip here? } - llinfos << "HP " << holder->index() << " recovered item link for type " << type << llendl; + LL_INFOS() << "HP " << holder->index() << " recovered item link for type " << type << LL_ENDL; holder->eraseTypeToLink(type); // Add wearable to FoundData for actual wearing LLViewerInventoryItem *item = gInventory.getItem(item_id); @@ -913,7 +913,7 @@ void recovered_item_link_cb(const LLUUID& item_id, LLWearableType::EType type, L } else { - llwarns << self_av_string() << "HP " << holder->index() << " inventory link not found for recovered wearable" << llendl; + LL_WARNS() << self_av_string() << "HP " << holder->index() << " inventory link not found for recovered wearable" << LL_ENDL; } } @@ -1523,7 +1523,7 @@ void LLAppearanceMgr::slamCategoryLinks(const LLUUID& src_id, const LLUUID& dst_ { case LLAssetType::AT_LINK: { - LL_DEBUGS("Avatar") << "linking inventory item " << item->getName() << llendl; + LL_DEBUGS("Avatar") << "linking inventory item " << item->getName() << LL_ENDL; //getActualDescription() is used for a new description //to propagate ordering information saved in descriptions of links LLSD item_contents; @@ -1539,7 +1539,7 @@ void LLAppearanceMgr::slamCategoryLinks(const LLUUID& src_id, const LLUUID& dst_ LLViewerInventoryCategory *catp = item->getLinkedCategory(); if (catp && include_folder_links) { - LL_DEBUGS("Avatar") << "linking inventory folder " << item->getName() << llendl; + LL_DEBUGS("Avatar") << "linking inventory folder " << item->getName() << LL_ENDL; LLSD base_contents; base_contents["name"] = catp->getName(); base_contents["desc"] = ""; // categories don't have descriptions. @@ -1565,7 +1565,7 @@ void LLAppearanceMgr::shallowCopyCategoryContents(const LLUUID& src_id, const LL LLInventoryModel::cat_array_t* cats; LLInventoryModel::item_array_t* items; gInventory.getDirectDescendentsOf(src_id, cats, items); - llinfos << "copying " << items->count() << " items" << llendl; + LL_INFOS() << "copying " << items->size() << " items" << LL_ENDL; LLInventoryObject::const_object_list_t link_array; for (LLInventoryModel::item_array_t::const_iterator iter = items->begin(); iter != items->end(); @@ -1576,7 +1576,7 @@ void LLAppearanceMgr::shallowCopyCategoryContents(const LLUUID& src_id, const LL { case LLAssetType::AT_LINK: { - LL_DEBUGS("Avatar") << "linking inventory item " << item->getName() << llendl; + LL_DEBUGS("Avatar") << "linking inventory item " << item->getName() << LL_ENDL; link_array.push_back(LLConstPointer<LLInventoryObject>(item)); break; } @@ -1586,7 +1586,7 @@ void LLAppearanceMgr::shallowCopyCategoryContents(const LLUUID& src_id, const LL // Skip copying outfit links. if (catp && catp->getPreferredType() != LLFolderType::FT_OUTFIT) { - LL_DEBUGS("Avatar") << "linking inventory folder " << item->getName() << llendl; + LL_DEBUGS("Avatar") << "linking inventory folder " << item->getName() << LL_ENDL; link_array.push_back(LLConstPointer<LLInventoryObject>(item)); } break; @@ -1766,7 +1766,7 @@ void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append) LLViewerInventoryCategory *pcat = gInventory.getCategory(category); if (!pcat) { - llwarns << "no category found for id " << category << llendl; + LL_WARNS() << "no category found for id " << category << LL_ENDL; return; } LL_INFOS("Avatar") << self_av_string() << "starting, cat '" << (pcat ? pcat->getName() : "[UNKNOWN]") << "'" << LL_ENDL; @@ -1778,7 +1778,7 @@ void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append) { LLInventoryModel::item_array_t gest_items; getDescendentsOfAssetType(cof, gest_items, LLAssetType::AT_GESTURE); - for(S32 i = 0; i < gest_items.count(); ++i) + for(S32 i = 0; i < gest_items.size(); ++i) { LLViewerInventoryItem *gest_item = gest_items.at(i); if ( LLGestureMgr::instance().isGestureActive( gest_item->getLinkedUUID()) ) @@ -1853,7 +1853,7 @@ void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append) { desc = desc_iter->second; LL_DEBUGS("Avatar") << item->getName() << " overriding desc to: " << desc - << " (was: " << item->getActualDescription() << ")" << llendl; + << " (was: " << item->getActualDescription() << ")" << LL_ENDL; } else { @@ -1944,7 +1944,6 @@ void LLAppearanceMgr::updateAgentWearables(LLWearableHoldingPattern* holder) { gAgentWearables.setWearableOutfit(items, wearables); } - LL_DEBUGS("Avatar") << "ends, elapsed " << timer.getElapsedTimeF32() << llendl; } S32 LLAppearanceMgr::countActiveHoldingPatterns() @@ -2089,7 +2088,7 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool enforce_item_restrictions, if (!validateClothingOrderingInfo()) { - llwarns << "Clothing ordering error" << llendl; + LL_WARNS() << "Clothing ordering error" << LL_ENDL; } BoolSetter setIsInUpdateAppearanceFromCOF(mIsInUpdateAppearanceFromCOF); @@ -2124,9 +2123,9 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool enforce_item_restrictions, LLViewerInventoryCategory *cof = gInventory.getCategory(current_outfit_id); if (!gInventory.isCategoryComplete(current_outfit_id)) { - llwarns << "COF info is not complete. Version " << cof->getVersion() + LL_WARNS() << "COF info is not complete. Version " << cof->getVersion() << " descendent_count " << cof->getDescendentCount() - << " viewer desc count " << cof->getViewerDescendentCount() << llendl; + << " viewer desc count " << cof->getViewerDescendentCount() << LL_ENDL; } if(!wear_items.size()) { @@ -2138,7 +2137,7 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool enforce_item_restrictions, sortItemsByActualDescription(wear_items); - LL_DEBUGS("Avatar") << "HP block starts" << llendl; + LL_DEBUGS("Avatar") << "HP block starts" << LL_ENDL; LLTimer hp_block_timer; LLWearableHoldingPattern* holder = new LLWearableHoldingPattern; @@ -2215,7 +2214,7 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool enforce_item_restrictions, } post_update_func(); - LL_DEBUGS("Avatar") << "HP block ends, elapsed " << hp_block_timer.getElapsedTimeF32() << llendl; + LL_DEBUGS("Avatar") << "HP block ends, elapsed " << hp_block_timer.getElapsedTimeF32() << LL_ENDL; } void LLAppearanceMgr::getDescendentsOfAssetType(const LLUUID& category, @@ -2740,7 +2739,7 @@ void LLAppearanceMgr::updateIsDirty() if(outfit_items.size() != cof_items.size()) { - LL_DEBUGS("Avatar") << "item count different - base " << outfit_items.count() << " cof " << cof_items.count() << llendl; + LL_DEBUGS("Avatar") << "item count different - base " << outfit_items.size() << " cof " << cof_items.size() << LL_ENDL; // Current outfit folder should have one more item than the outfit folder. // this one item is the link back to the outfit folder itself. mOutfitIsDirty = true; @@ -2762,19 +2761,19 @@ void LLAppearanceMgr::updateIsDirty() { if (item1->getLinkedUUID() != item2->getLinkedUUID()) { - LL_DEBUGS("Avatar") << "link id different " << llendl; + LL_DEBUGS("Avatar") << "link id different " << LL_ENDL; } else { if (item1->getName() != item2->getName()) { - LL_DEBUGS("Avatar") << "name different " << item1->getName() << " " << item2->getName() << llendl; + LL_DEBUGS("Avatar") << "name different " << item1->getName() << " " << item2->getName() << LL_ENDL; } if (item1->getActualDescription() != item2->getActualDescription()) { LL_DEBUGS("Avatar") << "desc different " << item1->getActualDescription() << " " << item2->getActualDescription() - << " names " << item1->getName() << " " << item2->getName() << llendl; + << " names " << item1->getName() << " " << item2->getName() << LL_ENDL; } } mOutfitIsDirty = true; @@ -2783,7 +2782,7 @@ void LLAppearanceMgr::updateIsDirty() } } llassert(!mOutfitIsDirty); - LL_DEBUGS("Avatar") << "clean" << llendl; + LL_DEBUGS("Avatar") << "clean" << LL_ENDL; } // *HACK: Must match name in Library or agent inventory @@ -2922,7 +2921,7 @@ bool LLAppearanceMgr::updateBaseOutfit() const LLUUID base_outfit_id = getBaseOutfitUUID(); if (base_outfit_id.isNull()) return false; - LL_DEBUGS("Avatar") << "saving cof to base outfit " << base_outfit_id << llendl; + LL_DEBUGS("Avatar") << "saving cof to base outfit " << base_outfit_id << LL_ENDL; LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(no_op_inventory_func, update_base_outfit_after_ordering); @@ -3053,9 +3052,9 @@ bool LLAppearanceMgr::validateClothingOrderingInfo(LLUUID cat_id) const LLUUID& item_id = it->first; const std::string& new_order_str = it->second; LLViewerInventoryItem *item = gInventory.getItem(item_id); - llwarns << "Order validation fails: " << item->getName() + LL_WARNS() << "Order validation fails: " << item->getName() << " needs to update desc to: " << new_order_str - << " (from: " << item->getActualDescription() << ")" << llendl; + << " (from: " << item->getActualDescription() << ")" << LL_ENDL; } return desc_map.size() == 0; @@ -3085,7 +3084,7 @@ void LLAppearanceMgr::updateClothingOrderingInfo(LLUUID cat_id, const std::string& new_order_str = it->second; LLViewerInventoryItem *item = gInventory.getItem(item_id); LL_DEBUGS("Avatar") << item->getName() << " updating desc to: " << new_order_str - << " (was: " << item->getActualDescription() << ")" << llendl; + << " (was: " << item->getActualDescription() << ")" << LL_ENDL; updates["desc"] = new_order_str; update_inventory_item(item_id,updates,cb); } @@ -3148,27 +3147,27 @@ void RequestAgentUpdateAppearanceResponder::onRequestRequested() LL_DEBUGS("Avatar") << "cof_version " << cof_version << " last_rcv " << last_rcv << " last_req " << last_req - << " in flight " << mInFlightCounter << llendl; + << " in flight " << mInFlightCounter << LL_ENDL; if ((mInFlightCounter>0) && (mInFlightTimer.hasExpired())) { - LL_WARNS("Avatar") << "in flight timer expired, resetting " << llendl; + LL_WARNS("Avatar") << "in flight timer expired, resetting " << LL_ENDL; mInFlightCounter = 0; } if (cof_version < last_rcv) { LL_DEBUGS("Avatar") << "Have already received update for cof version " << last_rcv - << " will not request for " << cof_version << llendl; + << " will not request for " << cof_version << LL_ENDL; return; } if (mInFlightCounter>0 && last_req >= cof_version) { LL_DEBUGS("Avatar") << "Request already in flight for cof version " << last_req - << " will not request for " << cof_version << llendl; + << " will not request for " << cof_version << LL_ENDL; return; } // Actually send the request. - LL_DEBUGS("Avatar") << "Will send request for cof_version " << cof_version << llendl; + LL_DEBUGS("Avatar") << "Will send request for cof_version " << cof_version << LL_ENDL; mRetryPolicy->reset(); sendRequest(); } @@ -3183,17 +3182,17 @@ void RequestAgentUpdateAppearanceResponder::sendRequest() if (!gAgent.getRegion()) { - llwarns << "Region not set, cannot request server appearance update" << llendl; + LL_WARNS() << "Region not set, cannot request server appearance update" << LL_ENDL; return; } if (gAgent.getRegion()->getCentralBakeVersion()==0) { - llwarns << "Region does not support baking" << llendl; + LL_WARNS() << "Region does not support baking" << LL_ENDL; } std::string url = gAgent.getRegion()->getCapability("UpdateAvatarAppearance"); if (url.empty()) { - llwarns << "No cap for UpdateAvatarAppearance." << llendl; + LL_WARNS() << "No cap for UpdateAvatarAppearance." << LL_ENDL; return; } @@ -3211,7 +3210,7 @@ void RequestAgentUpdateAppearanceResponder::sendRequest() body["cof_version"] = cof_version+999; } } - LL_DEBUGS("Avatar") << "request url " << url << " my_cof_version " << cof_version << llendl; + LL_DEBUGS("Avatar") << "request url " << url << " my_cof_version " << cof_version << LL_ENDL; mInFlightCounter++; mInFlightTimer.setTimerExpirySec(60.0); @@ -3223,7 +3222,7 @@ void RequestAgentUpdateAppearanceResponder::sendRequest() void RequestAgentUpdateAppearanceResponder::debugCOF(const LLSD& content) { LL_INFOS("Avatar") << "AIS COF, version received: " << content["expected"].asInteger() - << " ================================= " << llendl; + << " ================================= " << LL_ENDL; std::set<LLUUID> ais_items, local_items; const LLSD& cof_raw = content["cof_raw"]; for (LLSD::array_const_iterator it = cof_raw.beginArray(); @@ -3238,14 +3237,14 @@ void RequestAgentUpdateAppearanceResponder::debugCOF(const LLSD& content) LL_INFOS("Avatar") << "AIS Link: item_id: " << item["item_id"].asUUID() << " linked_item_id: " << item["asset_id"].asUUID() << " name: " << item["name"].asString() - << llendl; + << LL_ENDL; } else if (item["type"].asInteger() == 25) // folder link { LL_INFOS("Avatar") << "AIS Folder link: item_id: " << item["item_id"].asUUID() << " linked_item_id: " << item["asset_id"].asUUID() << " name: " << item["name"].asString() - << llendl; + << LL_ENDL; } else { @@ -3253,34 +3252,34 @@ void RequestAgentUpdateAppearanceResponder::debugCOF(const LLSD& content) << " linked_item_id: " << item["asset_id"].asUUID() << " name: " << item["name"].asString() << " type: " << item["type"].asInteger() - << llendl; + << LL_ENDL; } } } - LL_INFOS("Avatar") << llendl; + LL_INFOS("Avatar") << LL_ENDL; LL_INFOS("Avatar") << "Local COF, version requested: " << content["observed"].asInteger() - << " ================================= " << llendl; + << " ================================= " << LL_ENDL; LLInventoryModel::cat_array_t cat_array; LLInventoryModel::item_array_t item_array; gInventory.collectDescendents(LLAppearanceMgr::instance().getCOF(), cat_array,item_array,LLInventoryModel::EXCLUDE_TRASH); - for (S32 i=0; i<item_array.count(); i++) + for (S32 i=0; i<item_array.size(); i++) { - const LLViewerInventoryItem* inv_item = item_array.get(i).get(); + const LLViewerInventoryItem* inv_item = item_array.at(i).get(); local_items.insert(inv_item->getUUID()); LL_INFOS("Avatar") << "LOCAL: item_id: " << inv_item->getUUID() << " linked_item_id: " << inv_item->getLinkedUUID() << " name: " << inv_item->getName() << " parent: " << inv_item->getParentUUID() - << llendl; + << LL_ENDL; } - LL_INFOS("Avatar") << " ================================= " << llendl; + LL_INFOS("Avatar") << " ================================= " << LL_ENDL; S32 local_only = 0, ais_only = 0; for (std::set<LLUUID>::iterator it = local_items.begin(); it != local_items.end(); ++it) { if (ais_items.find(*it) == ais_items.end()) { - LL_INFOS("Avatar") << "LOCAL ONLY: " << *it << llendl; + LL_INFOS("Avatar") << "LOCAL ONLY: " << *it << LL_ENDL; local_only++; } } @@ -3288,7 +3287,7 @@ void RequestAgentUpdateAppearanceResponder::debugCOF(const LLSD& content) { if (local_items.find(*it) == local_items.end()) { - LL_INFOS("Avatar") << "AIS ONLY: " << *it << llendl; + LL_INFOS("Avatar") << "AIS ONLY: " << *it << LL_ENDL; ais_only++; } } @@ -3297,7 +3296,7 @@ void RequestAgentUpdateAppearanceResponder::debugCOF(const LLSD& content) LL_INFOS("Avatar") << "COF contents identical, only version numbers differ (req " << content["observed"].asInteger() << " rcv " << content["expected"].asInteger() - << ")" << llendl; + << ")" << LL_ENDL; } } @@ -3311,7 +3310,7 @@ void RequestAgentUpdateAppearanceResponder::debugCOF(const LLSD& content) } if (content["success"].asBoolean()) { - LL_DEBUGS("Avatar") << "succeeded" << llendl; + LL_DEBUGS("Avatar") << "succeeded" << LL_ENDL; if (gSavedSettings.getBOOL("DebugAvatarAppearanceMessage")) { dump_sequential_xml(gAgentAvatarp->getFullname() + "_appearance_request_ok", content); @@ -3352,13 +3351,13 @@ void RequestAgentUpdateAppearanceResponder::onFailure() mRetryPolicy->onFailure(getStatus(), getResponseHeaders()); if (mRetryPolicy->shouldRetry(seconds_to_wait)) { - llinfos << "retrying" << llendl; + LL_INFOS() << "retrying" << LL_ENDL; doAfterInterval(boost::bind(&RequestAgentUpdateAppearanceResponder::sendRequest,this), seconds_to_wait); } else { - llwarns << "giving up after too many retries" << llendl; + LL_WARNS() << "giving up after too many retries" << LL_ENDL; } } @@ -3541,14 +3540,14 @@ void show_created_outfit(LLUUID& folder_id, bool show_panel = true) return; } - LL_DEBUGS("Avatar") << "called" << llendl; + LL_DEBUGS("Avatar") << "called" << LL_ENDL; LLSD key; //EXT-7727. For new accounts inventory callback is created during login process // and may be processed after login process is finished if (show_panel) { - LL_DEBUGS("Avatar") << "showing panel" << llendl; + LL_DEBUGS("Avatar") << "showing panel" << LL_ENDL; LLFloaterSidePanelContainer::showPanel("appearance", "panel_outfits_inventory", key); } @@ -3567,7 +3566,7 @@ void show_created_outfit(LLUUID& folder_id, bool show_panel = true) // link, since, the COF version has changed. There is a race // condition in initial outfit setup which can lead to rez // failures - SH-3860. - LL_DEBUGS("Avatar") << "requesting appearance update after createBaseOutfitLink" << llendl; + LL_DEBUGS("Avatar") << "requesting appearance update after createBaseOutfitLink" << LL_ENDL; LLPointer<LLInventoryCallback> cb = new LLUpdateAppearanceOnDestroy; LLAppearanceMgr::getInstance()->createBaseOutfitLink(folder_id, cb); } @@ -3593,7 +3592,7 @@ void LLAppearanceMgr::makeNewOutfitLinks(const std::string& new_folder_name, boo { if (!isAgentAvatarValid()) return; - LL_DEBUGS("Avatar") << "creating new outfit" << llendl; + LL_DEBUGS("Avatar") << "creating new outfit" << LL_ENDL; gAgentWearables.notifyLoadingStarted(); @@ -3714,7 +3713,7 @@ bool LLAppearanceMgr::moveWearable(LLViewerInventoryItem* item, bool closer_to_b // LL_DEBUGS("Inventory") << "swap, item " // << ll_pretty_print_sd(item->asLLSD()) // << " swap_item " - // << ll_pretty_print_sd(swap_item->asLLSD()) << llendl; + // << ll_pretty_print_sd(swap_item->asLLSD()) << LL_ENDL; // FIXME switch to use AISv3 where supported. //items need to be updated on a dataserver diff --git a/indra/newview/llassetuploadqueue.cpp b/indra/newview/llassetuploadqueue.cpp index 6f97ca6bc7..8833c57948 100755 --- a/indra/newview/llassetuploadqueue.cpp +++ b/indra/newview/llassetuploadqueue.cpp @@ -74,7 +74,7 @@ protected: virtual void httpFailure() { // Parent class will spam the failure. - //llwarns << dumpResponse() << llendl; + //LL_WARNS() << dumpResponse() << LL_ENDL; LLUpdateTaskInventoryResponder::httpFailure(); LLAssetUploadQueue *queue = mSupplier->get(); if (queue) diff --git a/indra/newview/llassetuploadresponders.cpp b/indra/newview/llassetuploadresponders.cpp index e92c897ad8..a98ff64d0a 100755 --- a/indra/newview/llassetuploadresponders.cpp +++ b/indra/newview/llassetuploadresponders.cpp @@ -297,7 +297,7 @@ void LLAssetUploadResponder::uploadUpload(const LLSD& content) void LLAssetUploadResponder::uploadFailure(const LLSD& content) { - llwarns << dumpResponse() << llendl; + LL_WARNS() << dumpResponse() << LL_ENDL; // remove the "Uploading..." message LLUploadDialog::modalUploadFinished(); LLFloater* floater_snapshot = LLFloaterReg::findInstance("snapshot"); diff --git a/indra/newview/lleventpoll.cpp b/indra/newview/lleventpoll.cpp index e603cd0483..4de6ad4d2f 100755 --- a/indra/newview/lleventpoll.cpp +++ b/indra/newview/lleventpoll.cpp @@ -260,7 +260,7 @@ namespace LL_WARNS() << "LLEventPollResponder: id undefined" << LL_ENDL; } - // was llinfos but now that CoarseRegionUpdate is TCP @ 1/second, it'd be too verbose for viewer logs. -MG + // was LL_INFOS() but now that CoarseRegionUpdate is TCP @ 1/second, it'd be too verbose for viewer logs. -MG LL_DEBUGS() << "LLEventPollResponder::httpSuccess <" << mCount << "> " << events.size() << "events (id " << LLSDXMLStreamer(mAcknowledge) << ")" << LL_ENDL; diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index 1a3ddf2b91..e2fa117453 100755 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -303,8 +303,8 @@ public: if ( HTTP_FOUND == getStatus() ) { LL_INFOS() << "Facebook: Info received" << LL_ENDL; - LL_DEBUGS("FacebookConnect") << "Getting Facebook info successful. info: " << info << LL_ENDL; - LLFacebookConnect::instance().storeInfo(info); + LL_DEBUGS("FacebookConnect") << "Getting Facebook info successful. info: " << getContent() << LL_ENDL; + LLFacebookConnect::instance().storeInfo(getContent()); } else { diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp index 9227d2102e..d0555477ea 100755 --- a/indra/newview/llfeaturemanager.cpp +++ b/indra/newview/llfeaturemanager.cpp @@ -651,7 +651,7 @@ public: { mContent["body"] = body; } - llwarns << dumpResponse() << llendl; + LL_WARNS() << dumpResponse() << LL_ENDL; } } diff --git a/indra/newview/llhomelocationresponder.cpp b/indra/newview/llhomelocationresponder.cpp index 7496b0a922..d0492bcdb4 100755 --- a/indra/newview/llhomelocationresponder.cpp +++ b/indra/newview/llhomelocationresponder.cpp @@ -104,9 +104,5 @@ void LLHomeLocationResponder::httpSuccess() void LLHomeLocationResponder::httpFailure() { -<<<<<<< local - llwarns << dumpResponse() << llendl; -======= - LL_WARNS() << "LLHomeLocationResponder error [status:" << status << "]: " << content << LL_ENDL; ->>>>>>> other + LL_WARNS() << dumpResponse() << LL_ENDL; } diff --git a/indra/newview/llhttpretrypolicy.cpp b/indra/newview/llhttpretrypolicy.cpp index ae429f11f8..7001a9a88b 100755 --- a/indra/newview/llhttpretrypolicy.cpp +++ b/indra/newview/llhttpretrypolicy.cpp @@ -94,7 +94,7 @@ void LLAdaptiveRetryPolicy::onFailureCommon(S32 status, bool has_retry_header_ti { if (!mShouldRetry) { - llinfos << "keep on failing" << llendl; + LL_INFOS() << "keep on failing" << LL_ENDL; return; } if (mRetryCount > 0) @@ -111,17 +111,17 @@ void LLAdaptiveRetryPolicy::onFailureCommon(S32 status, bool has_retry_header_ti if (mRetryCount>=mMaxRetries) { - llinfos << "Too many retries " << mRetryCount << ", will not retry" << llendl; + LL_INFOS() << "Too many retries " << mRetryCount << ", will not retry" << LL_ENDL; mShouldRetry = false; } if (!mRetryOn4xx && !isHttpServerErrorStatus(status)) { - llinfos << "Non-server error " << status << ", will not retry" << llendl; + LL_INFOS() << "Non-server error " << status << ", will not retry" << LL_ENDL; mShouldRetry = false; } if (mShouldRetry) { - llinfos << "Retry count " << mRetryCount << " should retry after " << wait_time << llendl; + LL_INFOS() << "Retry count " << mRetryCount << " should retry after " << wait_time << LL_ENDL; mRetryTimer.reset(); mRetryTimer.setTimerExpirySec(wait_time); } diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 7b3aacd5e9..29b9c2b998 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -253,7 +253,7 @@ bool LLInventoryModel::getObjectTopmostAncestor(const LLUUID& object_id, LLUUID& LLInventoryObject *parent_object = getObject(object->getParentUUID()); if (!parent_object) { - llwarns << "unable to trace topmost ancestor, missing item for uuid " << object->getParentUUID() << llendl; + LL_WARNS() << "unable to trace topmost ancestor, missing item for uuid " << object->getParentUUID() << LL_ENDL; return false; } object = parent_object; @@ -522,7 +522,7 @@ protected: } LLUUID category_id = content["folder_id"].asUUID(); - LL_DEBUGS("Avatar") << ll_pretty_print_sd(content) << llendl; + LL_DEBUGS("Avatar") << ll_pretty_print_sd(content) << LL_ENDL; // Add the category to the internal representation LLPointer<LLViewerInventoryCategory> cat = new LLViewerInventoryCategory( category_id, @@ -599,7 +599,7 @@ LLUUID LLInventoryModel::createNewCategory(const LLUUID& parent_id, request["message"] = "CreateInventoryCategory"; request["payload"] = body; - LL_DEBUGS("Avatar") << "create category request: " << ll_pretty_print_sd(request) << llendl; + LL_DEBUGS("Avatar") << "create category request: " << ll_pretty_print_sd(request) << LL_ENDL; // viewer_region->getCapAPI().post(request); LLHTTPClient::post( url, @@ -791,7 +791,7 @@ LLInventoryModel::item_array_t LLInventoryModel::collectLinksTo(const LLUUID& id LLViewerInventoryItem *item = getItem(it->second); if (item) { - items.put(item); + items.push_back(item); } } @@ -1171,7 +1171,7 @@ void LLInventoryModel::onAISUpdateReceived(const std::string& context, const LLS AISUpdate ais_update(update); // parse update llsd into stuff to do. ais_update.doUpdate(); // execute the updates in the appropriate order. - llinfos << "elapsed: " << timer.getElapsedTimeF32() << llendl; + LL_INFOS() << "elapsed: " << timer.getElapsedTimeF32() << LL_ENDL; } // Does not appear to be used currently. @@ -1180,7 +1180,7 @@ void LLInventoryModel::onItemUpdated(const LLUUID& item_id, const LLSD& updates, U32 mask = LLInventoryObserver::NONE; LLPointer<LLViewerInventoryItem> item = gInventory.getItem(item_id); - LL_DEBUGS("Inventory") << "item_id: [" << item_id << "] name " << (item ? item->getName() : "(NOT FOUND)") << llendl; + LL_DEBUGS("Inventory") << "item_id: [" << item_id << "] name " << (item ? item->getName() : "(NOT FOUND)") << LL_ENDL; if(item) { for (LLSD::map_const_iterator it = updates.beginMap(); @@ -1188,19 +1188,19 @@ void LLInventoryModel::onItemUpdated(const LLUUID& item_id, const LLSD& updates, { if (it->first == "name") { - llinfos << "Updating name from " << item->getName() << " to " << it->second.asString() << llendl; + LL_INFOS() << "Updating name from " << item->getName() << " to " << it->second.asString() << LL_ENDL; item->rename(it->second.asString()); mask |= LLInventoryObserver::LABEL; } else if (it->first == "desc") { - llinfos << "Updating description from " << item->getActualDescription() - << " to " << it->second.asString() << llendl; + LL_INFOS() << "Updating description from " << item->getActualDescription() + << " to " << it->second.asString() << LL_ENDL; item->setDescription(it->second.asString()); } else { - llerrs << "unhandled updates for field: " << it->first << llendl; + LL_ERRS() << "unhandled updates for field: " << it->first << LL_ENDL; } } mask |= LLInventoryObserver::INTERNAL; @@ -1221,7 +1221,7 @@ void LLInventoryModel::onCategoryUpdated(const LLUUID& cat_id, const LLSD& updat U32 mask = LLInventoryObserver::NONE; LLPointer<LLViewerInventoryCategory> cat = gInventory.getCategory(cat_id); - LL_DEBUGS("Inventory") << "cat_id: [" << cat_id << "] name " << (cat ? cat->getName() : "(NOT FOUND)") << llendl; + LL_DEBUGS("Inventory") << "cat_id: [" << cat_id << "] name " << (cat ? cat->getName() : "(NOT FOUND)") << LL_ENDL; if(cat) { for (LLSD::map_const_iterator it = updates.beginMap(); @@ -1229,13 +1229,13 @@ void LLInventoryModel::onCategoryUpdated(const LLUUID& cat_id, const LLSD& updat { if (it->first == "name") { - llinfos << "Updating name from " << cat->getName() << " to " << it->second.asString() << llendl; + LL_INFOS() << "Updating name from " << cat->getName() << " to " << it->second.asString() << LL_ENDL; cat->rename(it->second.asString()); mask |= LLInventoryObserver::LABEL; } else { - llerrs << "unhandled updates for field: " << it->first << llendl; + LL_ERRS() << "unhandled updates for field: " << it->first << LL_ENDL; } } mask |= LLInventoryObserver::INTERNAL; @@ -1270,12 +1270,12 @@ void LLInventoryModel::onDescendentsPurgedFromServer(const LLUUID& object_id, bo categories, items, LLInventoryModel::INCLUDE_TRASH); - S32 count = items.count(); + S32 count = items.size(); LLUUID uu_id; for(S32 i = 0; i < count; ++i) { - uu_id = items.get(i)->getUUID(); + uu_id = items.at(i)->getUUID(); // This check prevents the deletion of a previously deleted item. // This is necessary because deletion is not done in a hierarchical @@ -1287,7 +1287,7 @@ void LLInventoryModel::onDescendentsPurgedFromServer(const LLUUID& object_id, bo } } - count = categories.count(); + count = categories.size(); // Slightly kludgy way to make sure categories are removed // only after their child categories have gone away. @@ -1301,7 +1301,7 @@ void LLInventoryModel::onDescendentsPurgedFromServer(const LLUUID& object_id, bo deleted_count = 0; for(S32 i = 0; i < count; ++i) { - uu_id = categories.get(i)->getUUID(); + uu_id = categories.at(i)->getUUID(); if (getCategory(uu_id)) { cat_array_t* cat_list = getUnlockedCatArray(uu_id); @@ -1317,8 +1317,8 @@ void LLInventoryModel::onDescendentsPurgedFromServer(const LLUUID& object_id, bo while (deleted_count > 0); if (total_deleted_count != count) { - llwarns << "Unexpected count of categories deleted, got " - << total_deleted_count << " expected " << count << llendl; + LL_WARNS() << "Unexpected count of categories deleted, got " + << total_deleted_count << " expected " << count << LL_ENDL; } //gInventory.validate(); } @@ -1386,7 +1386,7 @@ void LLInventoryModel::deleteObject(const LLUUID& id, bool fix_broken_links, boo { if (item_list->size()) { - llwarns << "Deleting cat " << id << " while it still has child items" << llendl; + LL_WARNS() << "Deleting cat " << id << " while it still has child items" << LL_ENDL; } delete item_list; mParentChildItemTree.erase(id); @@ -1396,7 +1396,7 @@ void LLInventoryModel::deleteObject(const LLUUID& id, bool fix_broken_links, boo { if (cat_list->size()) { - llwarns << "Deleting cat " << id << " while it still has child cats" << llendl; + LL_WARNS() << "Deleting cat " << id << " while it still has child cats" << LL_ENDL; } delete cat_list; mParentChildCategoryTree.erase(id); @@ -1513,14 +1513,14 @@ void LLInventoryModel::addChangedMask(U32 mask, const LLUUID& referent) LLViewerInventoryItem *item = getItem(referent); if (item) { - llwarns << "Item " << item->getName() << llendl; + LL_WARNS() << "Item " << item->getName() << LL_ENDL; } else { LLViewerInventoryCategory *cat = getCategory(referent); if (cat) { - llwarns << "Category " << cat->getName() << llendl; + LL_WARNS() << "Category " << cat->getName() << LL_ENDL; } } } @@ -2267,7 +2267,7 @@ void LLInventoryModel::buildParentChildMap() LL_INFOS() << "Lost category: " << cat->getUUID() << " - " << cat->getName() << LL_ENDL; ++lost; - lost_cats.put(cat); + lost_cats.push_back(cat); // notifyObservers() has been moved to // llstartup/idle_startup() after this func completes. // Allows some system categories to be created before @@ -2277,7 +2277,7 @@ void LLInventoryModel::buildParentChildMap() if (!gInventory.validate()) { - llwarns << "model failed validity check!" << llendl; + LL_WARNS() << "model failed validity check!" << LL_ENDL; } } @@ -3419,20 +3419,20 @@ bool LLInventoryModel::validate() const if (getRootFolderID().isNull()) { - llwarns << "no root folder id" << llendl; + LL_WARNS() << "no root folder id" << LL_ENDL; valid = false; } if (getLibraryRootFolderID().isNull()) { - llwarns << "no root folder id" << llendl; + LL_WARNS() << "no root folder id" << LL_ENDL; valid = false; } if (mCategoryMap.size() + 1 != mParentChildCategoryTree.size()) { // ParentChild should be one larger because of the special entry for null uuid. - llinfos << "unexpected sizes: cat map size " << mCategoryMap.size() - << " parent/child " << mParentChildCategoryTree.size() << llendl; + LL_INFOS() << "unexpected sizes: cat map size " << mCategoryMap.size() + << " parent/child " << mParentChildCategoryTree.size() << LL_ENDL; valid = false; } S32 cat_lock = 0; @@ -3445,13 +3445,13 @@ bool LLInventoryModel::validate() const const LLViewerInventoryCategory *cat = cit->second; if (!cat) { - llwarns << "invalid cat" << llendl; + LL_WARNS() << "invalid cat" << LL_ENDL; valid = false; continue; } if (cat_id != cat->getUUID()) { - llwarns << "cat id/index mismatch " << cat_id << " " << cat->getUUID() << llendl; + LL_WARNS() << "cat id/index mismatch " << cat_id << " " << cat->getUUID() << LL_ENDL; valid = false; } @@ -3459,9 +3459,9 @@ bool LLInventoryModel::validate() const { if (cat_id != getRootFolderID() && cat_id != getLibraryRootFolderID()) { - llwarns << "cat " << cat_id << " has no parent, but is not root (" + LL_WARNS() << "cat " << cat_id << " has no parent, but is not root (" << getRootFolderID() << ") or library root (" - << getLibraryRootFolderID() << ")" << llendl; + << getLibraryRootFolderID() << ")" << LL_ENDL; } } cat_array_t* cats; @@ -3469,7 +3469,7 @@ bool LLInventoryModel::validate() const getDirectDescendentsOf(cat_id,cats,items); if (!cats || !items) { - llwarns << "invalid direct descendents for " << cat_id << llendl; + LL_WARNS() << "invalid direct descendents for " << cat_id << LL_ENDL; valid = false; continue; } @@ -3479,11 +3479,11 @@ bool LLInventoryModel::validate() const } else if (cats->size() + items->size() != cat->getDescendentCount()) { - llwarns << "invalid desc count for " << cat_id << " name [" << cat->getName() + LL_WARNS() << "invalid desc count for " << cat_id << " name [" << cat->getName() << "] parent " << cat->getParentUUID() << " cached " << cat->getDescendentCount() << " expected " << cats->size() << "+" << items->size() - << "=" << cats->size() +items->size() << llendl; + << "=" << cats->size() +items->size() << LL_ENDL; valid = false; } if (cat->getVersion() == LLViewerInventoryCategory::VERSION_UNKNOWN) @@ -3500,11 +3500,11 @@ bool LLInventoryModel::validate() const } for (S32 i = 0; i<items->size(); i++) { - LLViewerInventoryItem *item = items->get(i); + LLViewerInventoryItem *item = items->at(i); if (!item) { - llwarns << "null item at index " << i << " for cat " << cat_id << llendl; + LL_WARNS() << "null item at index " << i << " for cat " << cat_id << LL_ENDL; valid = false; continue; } @@ -3513,9 +3513,9 @@ bool LLInventoryModel::validate() const if (item->getParentUUID() != cat_id) { - llwarns << "wrong parent for " << item_id << " found " + LL_WARNS() << "wrong parent for " << item_id << " found " << item->getParentUUID() << " expected " << cat_id - << llendl; + << LL_ENDL; valid = false; } @@ -3524,8 +3524,8 @@ bool LLInventoryModel::validate() const item_map_t::const_iterator it = mItemMap.find(item_id); if (it == mItemMap.end()) { - llwarns << "item " << item_id << " found as child of " - << cat_id << " but not in top level mItemMap" << llendl; + LL_WARNS() << "item " << item_id << " found as child of " + << cat_id << " but not in top level mItemMap" << LL_ENDL; valid = false; } else @@ -3533,8 +3533,8 @@ bool LLInventoryModel::validate() const LLViewerInventoryItem *top_item = it->second; if (top_item != item) { - llwarns << "item mismatch, item_id " << item_id - << " top level entry is different, uuid " << top_item->getUUID() << llendl; + LL_WARNS() << "item mismatch, item_id " << item_id + << " top level entry is different, uuid " << top_item->getUUID() << LL_ENDL; } } @@ -3543,7 +3543,7 @@ bool LLInventoryModel::validate() const bool found = getObjectTopmostAncestor(item_id, topmost_ancestor_id); if (!found) { - llwarns << "unable to find topmost ancestor for " << item_id << llendl; + LL_WARNS() << "unable to find topmost ancestor for " << item_id << LL_ENDL; valid = false; } else @@ -3551,10 +3551,10 @@ bool LLInventoryModel::validate() const if (topmost_ancestor_id != getRootFolderID() && topmost_ancestor_id != getLibraryRootFolderID()) { - llwarns << "unrecognized top level ancestor for " << item_id + LL_WARNS() << "unrecognized top level ancestor for " << item_id << " got " << topmost_ancestor_id << " expected " << getRootFolderID() - << " or " << getLibraryRootFolderID() << llendl; + << " or " << getLibraryRootFolderID() << LL_ENDL; valid = false; } } @@ -3569,8 +3569,8 @@ bool LLInventoryModel::validate() const getDirectDescendentsOf(parent_id,cats,items); if (!cats) { - llwarns << "cat " << cat_id << " name [" << cat->getName() - << "] orphaned - no child cat array for alleged parent " << parent_id << llendl; + LL_WARNS() << "cat " << cat_id << " name [" << cat->getName() + << "] orphaned - no child cat array for alleged parent " << parent_id << LL_ENDL; valid = false; } else @@ -3578,7 +3578,7 @@ bool LLInventoryModel::validate() const bool found = false; for (S32 i = 0; i<cats->size(); i++) { - LLViewerInventoryCategory *kid_cat = cats->get(i); + LLViewerInventoryCategory *kid_cat = cats->at(i); if (kid_cat == cat) { found = true; @@ -3587,8 +3587,8 @@ bool LLInventoryModel::validate() const } if (!found) { - llwarns << "cat " << cat_id << " name [" << cat->getName() - << "] orphaned - not found in child cat array of alleged parent " << parent_id << llendl; + LL_WARNS() << "cat " << cat_id << " name [" << cat->getName() + << "] orphaned - not found in child cat array of alleged parent " << parent_id << LL_ENDL; } } } @@ -3600,14 +3600,14 @@ bool LLInventoryModel::validate() const LLViewerInventoryItem *item = iit->second; if (item->getUUID() != item_id) { - llwarns << "item_id " << item_id << " does not match " << item->getUUID() << llendl; + LL_WARNS() << "item_id " << item_id << " does not match " << item->getUUID() << LL_ENDL; valid = false; } const LLUUID& parent_id = item->getParentUUID(); if (parent_id.isNull()) { - llwarns << "item " << item_id << " name [" << item->getName() << "] has null parent id!" << llendl; + LL_WARNS() << "item " << item_id << " name [" << item->getName() << "] has null parent id!" << LL_ENDL; } else { @@ -3616,15 +3616,15 @@ bool LLInventoryModel::validate() const getDirectDescendentsOf(parent_id,cats,items); if (!items) { - llwarns << "item " << item_id << " name [" << item->getName() - << "] orphaned - alleged parent has no child items list " << parent_id << llendl; + LL_WARNS() << "item " << item_id << " name [" << item->getName() + << "] orphaned - alleged parent has no child items list " << parent_id << LL_ENDL; } else { bool found = false; for (S32 i=0; i<items->size(); ++i) { - if (items->get(i) == item) + if (items->at(i) == item) { found = true; break; @@ -3632,8 +3632,8 @@ bool LLInventoryModel::validate() const } if (!found) { - llwarns << "item " << item_id << " name [" << item->getName() - << "] orphaned - not found as child of alleged parent " << parent_id << llendl; + LL_WARNS() << "item " << item_id << " name [" << item->getName() + << "] orphaned - not found as child of alleged parent " << parent_id << LL_ENDL; } } @@ -3648,30 +3648,30 @@ bool LLInventoryModel::validate() const // Linked-to UUID should have back reference to this link. if (!hasBacklinkInfo(link_id, target_id)) { - llwarns << "link " << item->getUUID() << " type " << item->getActualType() + LL_WARNS() << "link " << item->getUUID() << " type " << item->getActualType() << " missing backlink info at target_id " << target_id - << llendl; + << LL_ENDL; } // Links should have referents. if (item->getActualType() == LLAssetType::AT_LINK && !target_item) { - llwarns << "broken item link " << item->getName() << " id " << item->getUUID() << llendl; + LL_WARNS() << "broken item link " << item->getName() << " id " << item->getUUID() << LL_ENDL; } else if (item->getActualType() == LLAssetType::AT_LINK_FOLDER && !target_cat) { - llwarns << "broken folder link " << item->getName() << " id " << item->getUUID() << llendl; + LL_WARNS() << "broken folder link " << item->getName() << " id " << item->getUUID() << LL_ENDL; } if (target_item && target_item->getIsLinkType()) { - llwarns << "link " << item->getName() << " references a link item " - << target_item->getName() << " " << target_item->getUUID() << llendl; + LL_WARNS() << "link " << item->getName() << " references a link item " + << target_item->getName() << " " << target_item->getUUID() << LL_ENDL; } // Links should not have backlinks. std::pair<backlink_mmap_t::const_iterator, backlink_mmap_t::const_iterator> range = mBacklinkMMap.equal_range(link_id); if (range.first != range.second) { - llwarns << "Link item " << item->getName() << " has backlinks!" << llendl; + LL_WARNS() << "Link item " << item->getName() << " has backlinks!" << LL_ENDL; } } else @@ -3685,7 +3685,7 @@ bool LLInventoryModel::validate() const LLViewerInventoryItem *link_item = getItem(link_id); if (!link_item || !link_item->getIsLinkType()) { - llwarns << "invalid backlink from target " << item->getName() << " to " << link_id << llendl; + LL_WARNS() << "invalid backlink from target " << item->getName() << " to " << link_id << LL_ENDL; } } } @@ -3693,19 +3693,19 @@ bool LLInventoryModel::validate() const if (cat_lock > 0 || item_lock > 0) { - llinfos << "Found locks on some categories: sub-cat arrays " - << cat_lock << ", item arrays " << item_lock << llendl; + LL_INFOS() << "Found locks on some categories: sub-cat arrays " + << cat_lock << ", item arrays " << item_lock << LL_ENDL; } if (desc_unknown_count != 0) { - llinfos << "Found " << desc_unknown_count << " cats with unknown descendent count" << llendl; + LL_INFOS() << "Found " << desc_unknown_count << " cats with unknown descendent count" << LL_ENDL; } if (version_unknown_count != 0) { - llinfos << "Found " << version_unknown_count << " cats with unknown version" << llendl; + LL_INFOS() << "Found " << version_unknown_count << " cats with unknown version" << LL_ENDL; } - llinfos << "Validate done, valid = " << (U32) valid << llendl; + LL_INFOS() << "Validate done, valid = " << (U32) valid << LL_ENDL; return valid; } diff --git a/indra/newview/llinventorymodelbackgroundfetch.cpp b/indra/newview/llinventorymodelbackgroundfetch.cpp index 5f8dc95d8a..2de37b0790 100755 --- a/indra/newview/llinventorymodelbackgroundfetch.cpp +++ b/indra/newview/llinventorymodelbackgroundfetch.cpp @@ -172,7 +172,7 @@ void LLInventoryModelBackgroundFetch::setAllFoldersFetched() mRecursiveLibraryFetchStarted) { mAllFoldersFetched = TRUE; - //llinfos << "All folders fetched, validating" << llendl; + //LL_INFOS() << "All folders fetched, validating" << LL_ENDL; //gInventory.validate(); } mFolderFetchActive = false; @@ -544,7 +544,7 @@ void LLInventoryModelFetchDescendentsResponder::httpSuccess() // If we get back an error (not found, etc...), handle it here. void LLInventoryModelFetchDescendentsResponder::httpFailure() { - llwarns << dumpResponse() << llendl; + LL_WARNS() << dumpResponse() << LL_ENDL; LLInventoryModelBackgroundFetch *fetcher = LLInventoryModelBackgroundFetch::getInstance(); LL_INFOS() << dumpResponse() << LL_ENDL; diff --git a/indra/newview/llinventoryobserver.cpp b/indra/newview/llinventoryobserver.cpp index 2df01bb494..2dd8dce42f 100755 --- a/indra/newview/llinventoryobserver.cpp +++ b/indra/newview/llinventoryobserver.cpp @@ -601,7 +601,7 @@ void LLInventoryCategoriesObserver::changed(U32 mask) LLViewerInventoryCategory* category = gInventory.getCategory(cat_id); if (!category) { - llwarns << "Category : Category id = " << cat_id << " disappeared" << llendl; + LL_WARNS() << "Category : Category id = " << cat_id << " disappeared" << LL_ENDL; cat_data.mCallback(); // Keep track of those deleted categories so we can remove them deleted_categories_ids.push_back(cat_id); diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 86b471a284..80a427c0b8 100755 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -31,7 +31,6 @@ #include "apr_dso.h" #include "llhttpconstants.h" #include "llapr.h" -#include "llhttpstatuscodes.h" #include "llmeshrepository.h" #include "llagent.h" diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp index 0447e66e4a..ac00c5d986 100755 --- a/indra/newview/llpaneleditwearable.cpp +++ b/indra/newview/llpaneleditwearable.cpp @@ -1095,7 +1095,7 @@ void LLPanelEditWearable::saveChanges(bool force_save_as) // Create new link LL_DEBUGS("Avatar") << "link refresh, creating new link to " << link_item->getLinkedUUID() << " removing old link at " << link_item->getUUID() - << " wearable item id " << mWearablePtr->getItemID() << llendl; + << " wearable item id " << mWearablePtr->getItemID() << LL_ENDL; LLInventoryObject::const_object_list_t obj_array; obj_array.push_back(LLConstPointer<LLInventoryObject>(link_item)); diff --git a/indra/newview/llpathfindingmanager.cpp b/indra/newview/llpathfindingmanager.cpp index 9534b54dcf..4977a72dc6 100755 --- a/indra/newview/llpathfindingmanager.cpp +++ b/indra/newview/llpathfindingmanager.cpp @@ -819,7 +819,7 @@ void NavMeshResponder::httpSuccess() void NavMeshResponder::httpFailure() { - llwarns << dumpResponse() << llendl; + LL_WARNS() << dumpResponse() << LL_ENDL; mNavMeshPtr->handleNavMeshError(mNavMeshVersion); } @@ -872,7 +872,7 @@ void NavMeshRebakeResponder::httpSuccess() void NavMeshRebakeResponder::httpFailure() { - LL_WARNS() << dumpResponse() < LL_ENDL; + LL_WARNS() << dumpResponse() << LL_ENDL; mRebakeNavMeshCallback(false); } @@ -907,8 +907,7 @@ void LinksetsResponder::handleObjectLinksetsResult(const LLSD &pContent) void LinksetsResponder::handleObjectLinksetsError() { - LL_WARNS() << "LinksetsResponder object linksets error with request to URL '" << pURL << "' [status:" - << pStatus << "]: " << pContent << LL_ENDL; + LL_WARNS() << "LinksetsResponder object linksets error" << LL_ENDL; mObjectMessagingState = kReceivedError; if (mTerrainMessagingState != kWaiting) { @@ -929,8 +928,7 @@ void LinksetsResponder::handleTerrainLinksetsResult(const LLSD &pContent) void LinksetsResponder::handleTerrainLinksetsError() { - LL_WARNS() << "LinksetsResponder terrain linksets error with request to URL '" << pURL << "' [status:" - << pStatus << "]: " << pContent << LL_ENDL; + LL_WARNS() << "LinksetsResponder terrain linksets error" << LL_ENDL; mTerrainMessagingState = kReceivedError; if (mObjectMessagingState != kWaiting) { @@ -981,7 +979,7 @@ void ObjectLinksetsResponder::httpSuccess() void ObjectLinksetsResponder::httpFailure() { - llwarns << dumpResponse() << llendl; + LL_WARNS() << dumpResponse() << LL_ENDL; mLinksetsResponsderPtr->handleObjectLinksetsError(); } @@ -1006,7 +1004,7 @@ void TerrainLinksetsResponder::httpSuccess() void TerrainLinksetsResponder::httpFailure() { - llwarns << dumpResponse() << llendl; + LL_WARNS() << dumpResponse() << LL_ENDL; mLinksetsResponsderPtr->handleTerrainLinksetsError(); } diff --git a/indra/newview/llpathfindingnavmesh.cpp b/indra/newview/llpathfindingnavmesh.cpp index e4a696ac7e..0287c07f96 100755 --- a/indra/newview/llpathfindingnavmesh.cpp +++ b/indra/newview/llpathfindingnavmesh.cpp @@ -186,8 +186,6 @@ void LLPathfindingNavMesh::handleNavMeshError() void LLPathfindingNavMesh::handleNavMeshError(U32 pNavMeshVersion) { - LL_WARNS() << "LLPathfindingNavMesh error with request to URL '" << pURL << "' [status:" - << pStatus << "]: " << pContent << LL_ENDL; if (mNavMeshStatus.getVersion() == pNavMeshVersion) { handleNavMeshError(); diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 5bb67490ac..7b7168d438 100755 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -2077,8 +2077,8 @@ bool idle_startup() // the gender chooser. This should occur only in very // unusual circumstances, so set the timeout fairly high // to minimize mistaken hits here. - llwarns << "Wait for valid avatar state exceeded " - << timeout.getElapsedTimeF32() << " will invoke gender chooser" << llendl; + LL_WARNS() << "Wait for valid avatar state exceeded " + << timeout.getElapsedTimeF32() << " will invoke gender chooser" << LL_ENDL; LLStartUp::setStartupState( STATE_WEARABLES_WAIT ); } else @@ -2131,7 +2131,7 @@ bool idle_startup() if (isAgentAvatarValid() && gAgentAvatarp->isFullyLoaded()) { - LL_DEBUGS("Avatar") << "avatar fully loaded" << llendl; + LL_DEBUGS("Avatar") << "avatar fully loaded" << LL_ENDL; LLStartUp::setStartupState( STATE_CLEANUP ); return TRUE; } @@ -2142,7 +2142,7 @@ bool idle_startup() if ( gAgentWearables.areWearablesLoaded() ) { // We have our clothing, proceed. - LL_DEBUGS("Avatar") << "wearables loaded" << llendl; + LL_DEBUGS("Avatar") << "wearables loaded" << LL_ENDL; LLStartUp::setStartupState( STATE_CLEANUP ); return TRUE; } diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index fb4be553c1..14a42dd8dc 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -1306,11 +1306,11 @@ bool LLTextureFetchWorker::doWork(S32 param) { if (wait_seconds <= 0.0) { - llinfos << mID << " retrying now" << llendl; + LL_INFOS() << mID << " retrying now" << LL_ENDL; } else { - //llinfos << mID << " waiting to retry for " << wait_seconds << " seconds" << llendl; + //LL_INFOS() << mID << " waiting to retry for " << wait_seconds << " seconds" << LL_ENDL; return false; } } @@ -1333,7 +1333,7 @@ bool LLTextureFetchWorker::doWork(S32 param) { if (mFTType != FTT_DEFAULT) { - llwarns << "trying to seek a non-default texture on the sim. Bad!" << llendl; + LL_WARNS() << "trying to seek a non-default texture on the sim. Bad!" << LL_ENDL; } setUrl(http_url + "/?texture_id=" + mID.asString().c_str()); mWriteToCacheState = CAN_WRITE ; //because this texture has a fixed texture id. @@ -1570,7 +1570,7 @@ bool LLTextureFetchWorker::doWork(S32 param) { if (mFTType != FTT_MAP_TILE) { - llwarns << "Texture missing from server (404): " << mUrl << llendl; + LL_WARNS() << "Texture missing from server (404): " << mUrl << LL_ENDL; } if(mWriteToCacheState == NOT_WRITE) //map tiles or server bakes @@ -1579,7 +1579,7 @@ bool LLTextureFetchWorker::doWork(S32 param) releaseHttpSemaphore(); if (mFTType != FTT_MAP_TILE) { - LL_WARNS("Texture") << mID << " abort: WAIT_HTTP_REQ not found" << llendl; + LL_WARNS("Texture") << mID << " abort: WAIT_HTTP_REQ not found" << LL_ENDL; } return true; } @@ -1598,10 +1598,10 @@ bool LLTextureFetchWorker::doWork(S32 param) else if (http_service_unavail == mGetStatus) { LL_INFOS_ONCE("Texture") << "Texture server busy (503): " << mUrl << LL_ENDL; - llinfos << "503: HTTP GET failed for: " << mUrl + LL_INFOS() << "503: HTTP GET failed for: " << mUrl << " Status: " << mGetStatus.toHex() << " Reason: '" << mGetReason << "'" - << llendl; + << LL_ENDL; } else if (http_not_sat == mGetStatus) { @@ -1957,8 +1957,8 @@ void LLTextureFetchWorker::onCompleted(LLCore::HttpHandle handle, LLCore::HttpRe F32 rate = fake_failure_rate; if (mFTType == FTT_SERVER_BAKE && (fake_failure_rate > 0.0) && (rand_val < fake_failure_rate)) { - llwarns << mID << " for debugging, setting fake failure status for texture " << mID - << " (rand was " << rand_val << "/" << rate << ")" << llendl; + LL_WARNS() << mID << " for debugging, setting fake failure status for texture " << mID + << " (rand was " << rand_val << "/" << rate << ")" << LL_ENDL; response->setStatus(LLCore::HttpStatus(503)); } bool success = true; @@ -1966,13 +1966,13 @@ void LLTextureFetchWorker::onCompleted(LLCore::HttpHandle handle, LLCore::HttpRe LLCore::HttpStatus status(response->getStatus()); if (!status && (mFTType == FTT_SERVER_BAKE)) { - llinfos << mID << " state " << e_state_name[mState] << llendl; + LL_INFOS() << mID << " state " << e_state_name[mState] << LL_ENDL; mFetchRetryPolicy.onFailure(response); F32 retry_after; if (mFetchRetryPolicy.shouldRetry(retry_after)) { - llinfos << mID << " will retry after " << retry_after << " seconds, resetting state to LOAD_FROM_NETWORK" << llendl; - mFetcher->removeFromHTTPQueue(mID, 0); + LL_INFOS() << mID << " will retry after " << retry_after << " seconds, resetting state to LOAD_FROM_NETWORK" << LL_ENDL; + mFetcher->removeFromHTTPQueue(mID, S32Bytes(0)); std::string reason(status.toString()); setGetStatus(status, reason); releaseHttpSemaphore(); @@ -1981,7 +1981,7 @@ void LLTextureFetchWorker::onCompleted(LLCore::HttpHandle handle, LLCore::HttpRe } else { - llinfos << mID << " will not retry" << llendl; + LL_INFOS() << mID << " will not retry" << LL_ENDL; } } else @@ -2011,8 +2011,8 @@ void LLTextureFetchWorker::onCompleted(LLCore::HttpHandle handle, LLCore::HttpRe { std::string reason(status.toString()); setGetStatus(status, reason); - llwarns << "CURL GET FAILED, status: " << status.toTerseString() - << " reason: " << reason << llendl; + LL_WARNS() << "CURL GET FAILED, status: " << status.toTerseString() + << " reason: " << reason << LL_ENDL; } } else @@ -2576,7 +2576,7 @@ bool LLTextureFetch::createRequest(FTType f_type, const std::string& url, const if (f_type == FTT_SERVER_BAKE) { - LL_DEBUGS("Avatar") << " requesting " << id << " " << w << "x" << h << " discard " << desired_discard << " type " << f_type << llendl; + LL_DEBUGS("Avatar") << " requesting " << id << " " << w << "x" << h << " discard " << desired_discard << " type " << f_type << LL_ENDL; } LLTextureFetchWorker* worker = getWorker(id) ; if (worker) @@ -2600,7 +2600,7 @@ bool LLTextureFetch::createRequest(FTType f_type, const std::string& url, const llassert(!url.empty() && (!exten.empty() && LLImageBase::getCodecFromExtension(exten) != IMG_CODEC_J2C)); // Do full requests for baked textures to reduce interim blurring. - LL_DEBUGS("Texture") << "full request for " << id << " texture is FTT_SERVER_BAKE" << llendl; + LL_DEBUGS("Texture") << "full request for " << id << " texture is FTT_SERVER_BAKE" << LL_ENDL; desired_size = MAX_IMAGE_DATA_SIZE; desired_discard = 0; } @@ -3354,7 +3354,7 @@ void LLTextureFetchWorker::setState(e_state new_state) // blurry images fairly frequently. Presumably this is an // indication of some subtle timing or locking issue. -// LL_INFOS("Texture") << "id: " << mID << " FTType: " << mFTType << " disc: " << mDesiredDiscard << " sz: " << mDesiredSize << " state: " << e_state_name[mState] << " => " << e_state_name[new_state] << llendl; +// LL_INFOS("Texture") << "id: " << mID << " FTType: " << mFTType << " disc: " << mDesiredDiscard << " sz: " << mDesiredSize << " state: " << e_state_name[mState] << " => " << e_state_name[new_state] << LL_ENDL; } mState = new_state; } diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 3e3e385905..b236bba3b7 100755 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -709,7 +709,7 @@ S32 LLViewerInventoryCategory::getViewerDescendentCount() const S32 descendents_actual = 0; if(cats && items) { - descendents_actual = cats->count() + items->count(); + descendents_actual = cats->size() + items->size(); } return descendents_actual; } @@ -1128,7 +1128,7 @@ void link_inventory_array(const LLUUID& category, const LLInventoryObject* baseobj = *it; if (!baseobj) { - llwarns << "attempt to link to unknown object" << llendl; + LL_WARNS() << "attempt to link to unknown object" << LL_ENDL; continue; } @@ -1137,7 +1137,7 @@ void link_inventory_array(const LLUUID& category, // Fail if item can be found but is of a type that can't be linked. // Arguably should fail if the item can't be found too, but that could // be a larger behavioral change. - llwarns << "attempt to link an unlinkable object, type = " << baseobj->getActualType() << llendl; + LL_WARNS() << "attempt to link an unlinkable object, type = " << baseobj->getActualType() << LL_ENDL; continue; } @@ -1173,7 +1173,7 @@ void link_inventory_array(const LLUUID& category, } else { - llwarns << "could not convert object into an item or category: " << baseobj->getUUID() << llendl; + LL_WARNS() << "could not convert object into an item or category: " << baseobj->getUUID() << LL_ENDL; continue; } } @@ -1281,7 +1281,7 @@ void update_inventory_item( if (!ais_ran) { LLPointer<LLViewerInventoryItem> obj = gInventory.getItem(item_id); - LL_DEBUGS("Inventory") << "item_id: [" << item_id << "] name " << (update_item ? update_item->getName() : "(NOT FOUND)") << llendl; + LL_DEBUGS("Inventory") << "item_id: [" << item_id << "] name " << (update_item ? update_item->getName() : "(NOT FOUND)") << LL_ENDL; if(obj) { LLMessageSystem* msg = gMessageSystem; @@ -1323,7 +1323,7 @@ void update_inventory_item( if (!ais_ran) { LLPointer<LLViewerInventoryItem> obj = gInventory.getItem(item_id); - LL_DEBUGS("Inventory") << "item_id: [" << item_id << "] name " << (obj ? obj->getName() : "(NOT FOUND)") << llendl; + LL_DEBUGS("Inventory") << "item_id: [" << item_id << "] name " << (obj ? obj->getName() : "(NOT FOUND)") << LL_ENDL; if(obj) { LLPointer<LLViewerInventoryItem> new_item(new LLViewerInventoryItem); @@ -1358,7 +1358,7 @@ void update_inventory_category( LLPointer<LLInventoryCallback> cb) { LLPointer<LLViewerInventoryCategory> obj = gInventory.getCategory(cat_id); - LL_DEBUGS("Inventory") << "cat_id: [" << cat_id << "] name " << (obj ? obj->getName() : "(NOT FOUND)") << llendl; + LL_DEBUGS("Inventory") << "cat_id: [" << cat_id << "] name " << (obj ? obj->getName() : "(NOT FOUND)") << LL_ENDL; if(obj) { if (LLFolderType::lookupIsProtectedType(obj->getPreferredType())) @@ -1421,7 +1421,7 @@ void remove_inventory_item( } else { - LL_DEBUGS("Inventory") << "item_id: [" << item_id << "] name " << "(NOT FOUND)" << llendl; + LL_DEBUGS("Inventory") << "item_id: [" << item_id << "] name " << "(NOT FOUND)" << LL_ENDL; } } @@ -1432,7 +1432,7 @@ void remove_inventory_item( if(obj) { const LLUUID item_id(obj->getUUID()); - LL_DEBUGS("Inventory") << "item_id: [" << item_id << "] name " << obj->getName() << llendl; + LL_DEBUGS("Inventory") << "item_id: [" << item_id << "] name " << obj->getName() << LL_ENDL; if (AISCommand::isAPIAvailable()) { LLPointer<AISCommand> cmd_ptr = new RemoveItemCommand(item_id, cb); @@ -1461,7 +1461,7 @@ void remove_inventory_item( else { // *TODO: Clean up callback? - llwarns << "remove_inventory_item called for invalid or nonexistent item." << llendl; + LL_WARNS() << "remove_inventory_item called for invalid or nonexistent item." << LL_ENDL; } } @@ -1479,7 +1479,7 @@ public: LLInventoryModel::EHasChildren children = gInventory.categoryHasChildren(mID); if(children != LLInventoryModel::CHILDREN_NO) { - llwarns << "remove descendents failed, cannot remove category " << llendl; + LL_WARNS() << "remove descendents failed, cannot remove category " << LL_ENDL; } else { @@ -1495,7 +1495,7 @@ void remove_inventory_category( const LLUUID& cat_id, LLPointer<LLInventoryCallback> cb) { - LL_DEBUGS("Inventory") << "cat_id: [" << cat_id << "] " << llendl; + LL_DEBUGS("Inventory") << "cat_id: [" << cat_id << "] " << LL_ENDL; LLPointer<LLViewerInventoryCategory> obj = gInventory.getCategory(cat_id); if(obj) { @@ -1516,7 +1516,7 @@ void remove_inventory_category( LLInventoryModel::EHasChildren children = gInventory.categoryHasChildren(cat_id); if(children != LLInventoryModel::CHILDREN_NO) { - LL_DEBUGS("Inventory") << "Will purge descendents first before deleting category " << cat_id << llendl; + LL_DEBUGS("Inventory") << "Will purge descendents first before deleting category " << cat_id << LL_ENDL; LLPointer<LLInventoryCallback> wrap_cb = new LLRemoveCategoryOnDestroy(cat_id, cb); purge_descendents_of(cat_id, wrap_cb); return; @@ -1542,7 +1542,7 @@ void remove_inventory_category( } else { - llwarns << "remove_inventory_category called for invalid or nonexistent item " << cat_id << llendl; + LL_WARNS() << "remove_inventory_category called for invalid or nonexistent item " << cat_id << LL_ENDL; } } @@ -1570,7 +1570,7 @@ void purge_descendents_of(const LLUUID& id, LLPointer<LLInventoryCallback> cb) LLInventoryModel::EHasChildren children = gInventory.categoryHasChildren(id); if(children == LLInventoryModel::CHILDREN_NO) { - LL_DEBUGS("Inventory") << "No descendents to purge for " << id << llendl; + LL_DEBUGS("Inventory") << "No descendents to purge for " << id << LL_ENDL; return; } LLPointer<LLViewerInventoryCategory> cat = gInventory.getCategory(id); @@ -1580,7 +1580,7 @@ void purge_descendents_of(const LLUUID& id, LLPointer<LLInventoryCallback> cb) { // Something on the clipboard is in "cut mode" and needs to be preserved LL_DEBUGS("Inventory") << "purge_descendents_of clipboard case " << cat->getName() - << " iterate and purge non hidden items" << llendl; + << " iterate and purge non hidden items" << LL_ENDL; LLInventoryModel::cat_array_t* categories; LLInventoryModel::item_array_t* items; // Get the list of direct descendants in tha categoy passed as argument @@ -1615,7 +1615,7 @@ void purge_descendents_of(const LLUUID& id, LLPointer<LLInventoryCallback> cb) else // no cap { // Fast purge - LL_DEBUGS("Inventory") << "purge_descendents_of fast case " << cat->getName() << llendl; + LL_DEBUGS("Inventory") << "purge_descendents_of fast case " << cat->getName() << LL_ENDL; // send it upstream LLMessageSystem* msg = gMessageSystem; @@ -1744,14 +1744,14 @@ void slam_inventory_folder(const LLUUID& folder_id, if (AISCommand::isAPIAvailable()) { LL_DEBUGS("Avatar") << "using AISv3 to slam folder, id " << folder_id - << " new contents: " << ll_pretty_print_sd(contents) << llendl; + << " new contents: " << ll_pretty_print_sd(contents) << LL_ENDL; LLPointer<AISCommand> cmd_ptr = new SlamFolderCommand(folder_id, contents, cb); cmd_ptr->run_command(); } else // no cap { LL_DEBUGS("Avatar") << "using item-by-item calls to slam folder, id " << folder_id - << " new contents: " << ll_pretty_print_sd(contents) << llendl; + << " new contents: " << ll_pretty_print_sd(contents) << LL_ENDL; for (LLSD::array_const_iterator it = contents.beginArray(); it != contents.endArray(); ++it) @@ -1772,9 +1772,9 @@ void remove_folder_contents(const LLUUID& category, bool keep_outfit_links, LLInventoryModel::item_array_t items; gInventory.collectDescendents(category, cats, items, LLInventoryModel::EXCLUDE_TRASH); - for (S32 i = 0; i < items.count(); ++i) + for (S32 i = 0; i < items.size(); ++i) { - LLViewerInventoryItem *item = items.get(i); + LLViewerInventoryItem *item = items.at(i); if (keep_outfit_links && (item->getActualType() == LLAssetType::AT_LINK_FOLDER)) continue; if (item->getIsLinkType()) diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index a5cfff177e..44ac93d3de 100755 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -182,14 +182,14 @@ private: { if (!isGoodStatus()) { - llwarns << dumpResponse() - << " [headers:" << getResponseHeaders() << "]" << llendl; + LL_WARNS() << dumpResponse() + << " [headers:" << getResponseHeaders() << "]" << LL_ENDL; } const std::string& media_type = getResponseHeader(HTTP_IN_HEADER_CONTENT_TYPE); std::string::size_type idx1 = media_type.find_first_of(";"); std::string mime_type = media_type.substr(0, idx1); - LL_DEBUGS << "status is " << getStatus() << ", media type \"" << media_type << "\"" << LL_ENDL; + LL_DEBUGS() << "status is " << getStatus() << ", media type \"" << media_type << "\"" << LL_ENDL; // 2xx status codes indicate success. // Most 4xx status codes are successful enough for our purposes. @@ -218,7 +218,7 @@ private: } //else //{ - // llwarns << "responder failed with status " << dumpResponse() << llendl; + // LL_WARNS() << "responder failed with status " << dumpResponse() << LL_ENDL; // // if(mMediaImpl) // { diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 7e22b65d4c..fd5df9b774 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -250,7 +250,7 @@ public: private: /* virtual */void httpFailure() { - LL_WARNS2("AppInit", "Capabilities") << dumpResponse() << LL_ENDL; + LL_WARNS("AppInit", "Capabilities") << dumpResponse() << LL_ENDL; LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); if (regionp) { @@ -326,7 +326,7 @@ public: private: /* virtual */ void httpFailure() { - llwarns << dumpResponse() << llendl; + LL_WARNS() << dumpResponse() << LL_ENDL; } /* virtual */ void httpSuccess() @@ -334,7 +334,7 @@ private: LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); if( !regionp ) { - LL_WARNS2("AppInit", "Capabilities") << "Received results for region that no longer exists!" << LL_ENDL; + LL_WARNS("AppInit", "Capabilities") << "Received results for region that no longer exists!" << LL_ENDL; return ; } @@ -353,18 +353,18 @@ private: if ( regionp->getRegionImpl()->mCapabilities.size() != regionp->getRegionImpl()->mSecondCapabilitiesTracker.size() ) { - LL_WARNS2("AppInit", "Capabilities") + LL_WARNS("AppInit", "Capabilities") << "Sim sent duplicate base caps that differ in size from what we initially received - most likely content. " << "mCapabilities == " << regionp->getRegionImpl()->mCapabilities.size() << " mSecondCapabilitiesTracker == " << regionp->getRegionImpl()->mSecondCapabilitiesTracker.size() << LL_ENDL; #ifdef DEBUG_CAPS_GRANTS - LL_WARNS2("AppInit", "Capabilities") + LL_WARNS("AppInit", "Capabilities") << "Initial Base capabilities: " << LL_ENDL; log_capabilities(regionp->getRegionImpl()->mCapabilities); - LL_WARNS2("AppInit", "Capabilities") + LL_WARNS("AppInit", "Capabilities") << "Latest base capabilities: " << LL_ENDL; log_capabilities(regionp->getRegionImpl()->mSecondCapabilitiesTracker); @@ -2809,14 +2809,13 @@ class SimulatorFeaturesReceived : public LLHTTPClient::Responder LOG_CLASS(SimulatorFeaturesReceived); public: SimulatorFeaturesReceived(const std::string& retry_url, U64 region_handle, - S32 attempt = 0, S32 max_attempts = MAX_CAP_REQUEST_ATTEMPTS) -<<<<<<< local + S32 attempt = 0, S32 max_attempts = MAX_CAP_REQUEST_ATTEMPTS) : mRetryURL(retry_url), mRegionHandle(region_handle), mAttempt(attempt), mMaxAttempts(max_attempts) { } /* virtual */ void httpFailure() { - LL_WARNS2("AppInit", "SimulatorFeatures") << dumpResponse() << LL_ENDL; + LL_WARNS("AppInit", "SimulatorFeatures") << dumpResponse() << LL_ENDL; retry(); } @@ -2922,7 +2921,7 @@ bool LLViewerRegion::isCapabilityAvailable(const std::string& name) const { if (!capabilitiesReceived() && (name!=std::string("Seed")) && (name!=std::string("ObjectMedia"))) { - llwarns << "isCapabilityAvailable called before caps received for " << name << llendl; + LL_WARNS() << "isCapabilityAvailable called before caps received for " << name << LL_ENDL; } CapabilityMap::const_iterator iter = mImpl->mCapabilities.find(name); @@ -3063,10 +3062,10 @@ void log_capabilities(const CapabilityMap &capmap) { if (!iter->second.empty()) { - llinfos << "log_capabilities: " << iter->first << " URL is " << iter->second << llendl; + LL_INFOS() << "log_capabilities: " << iter->first << " URL is " << iter->second << LL_ENDL; } } - llinfos << "log_capabilities: Dumped " << count << " entries." << llendl; + LL_INFOS() << "log_capabilities: Dumped " << count << " entries." << LL_ENDL; } void LLViewerRegion::resetMaterialsCapThrottle() { diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index fd2fb3695f..f60829e9e8 100755 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -639,7 +639,7 @@ void LLViewerStats::PhaseMap::startPhase(const std::string& phase_name) { LLTimer& timer = getPhaseTimer(phase_name); timer.start(); - //LL_DEBUGS("Avatar") << "startPhase " << phase_name << llendl; + //LL_DEBUGS("Avatar") << "startPhase " << phase_name << LL_ENDL; } void LLViewerStats::PhaseMap::clearPhases() @@ -711,11 +711,11 @@ bool LLViewerStats::PhaseMap::getPhaseValues(const std::string& phase_name, F32& found = true; elapsed = iter->second.getElapsedTimeF32(); completed = !iter->second.getStarted(); - //LL_DEBUGS("Avatar") << " phase_name " << phase_name << " elapsed " << elapsed << " completed " << completed << " timer addr " << (S32)(&iter->second) << llendl; + //LL_DEBUGS("Avatar") << " phase_name " << phase_name << " elapsed " << elapsed << " completed " << completed << " timer addr " << (S32)(&iter->second) << LL_ENDL; } else { - //LL_DEBUGS("Avatar") << " phase_name " << phase_name << " NOT FOUND" << llendl; + //LL_DEBUGS("Avatar") << " phase_name " << phase_name << " NOT FOUND" << LL_ENDL; } return found; diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 28b07feef7..ba89aafc84 100755 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -994,7 +994,7 @@ LLViewerFetchedTexture::LLViewerFetchedTexture(const LLUUID& id, FTType f_type, mFTType = f_type; if (mFTType == FTT_HOST_BAKE) { - llwarns << "Unsupported fetch type " << mFTType << llendl; + LL_WARNS() << "Unsupported fetch type " << mFTType << LL_ENDL; } generateGLTexture(); } @@ -1930,19 +1930,19 @@ bool LLViewerFetchedTexture::updateFetch() { if (getFTType() != FTT_MAP_TILE) { - llwarns << mID + LL_WARNS() << mID << " Fetch failure, setting as missing, decode_priority " << decode_priority << " mRawDiscardLevel " << mRawDiscardLevel << " current_discard " << current_discard << " stats " << mLastHttpGetStatus.toHex() - << llendl; + << LL_ENDL; } setIsMissingAsset(); desired_discard = -1; } else { - //llwarns << mID << ": Setting min discard to " << current_discard << llendl; + //LL_WARNS() << mID << ": Setting min discard to " << current_discard << LL_ENDL; if(current_discard >= 0) { mMinDiscardLevel = current_discard; @@ -2134,7 +2134,7 @@ void LLViewerFetchedTexture::setIsMissingAsset(BOOL is_missing) { if (mUrl.empty()) { - llwarns << mID << ": Marking image as missing" << llendl; + LL_WARNS() << mID << ": Marking image as missing" << LL_ENDL; } else { @@ -2143,7 +2143,7 @@ void LLViewerFetchedTexture::setIsMissingAsset(BOOL is_missing) // server bake texture. if (getFTType() != FTT_MAP_TILE) { - llwarns << mUrl << ": Marking image as missing" << llendl; + LL_WARNS() << mUrl << ": Marking image as missing" << LL_ENDL; } } if (mHasFetcher) @@ -2158,7 +2158,7 @@ void LLViewerFetchedTexture::setIsMissingAsset(BOOL is_missing) } else { - llinfos << mID << ": un-flagging missing asset" << llendl; + LL_INFOS() << mID << ": un-flagging missing asset" << LL_ENDL; } mIsMissingAsset = is_missing; } @@ -2211,7 +2211,7 @@ void LLViewerFetchedTexture::setLoadedCallback( loaded_callback_func loaded_call else { // We need aux data, but we've already loaded the image, and it didn't have any - llwarns << "No aux data available for callback for image:" << getID() << llendl; + LL_WARNS() << "No aux data available for callback for image:" << getID() << LL_ENDL; } } mLastCallBackActiveTime = sCurrentTime ; @@ -2385,10 +2385,10 @@ bool LLViewerFetchedTexture::doLoadedCallbacks() if (mFTType == FTT_SERVER_BAKE) { //output some debug info - llinfos << "baked texture: " << mID << "clears all call backs due to inactivity." << llendl; - llinfos << mUrl << llendl; - llinfos << "current discard: " << getDiscardLevel() << " current discard for fetch: " << getCurrentDiscardLevelForFetching() << - " Desired discard: " << getDesiredDiscardLevel() << "decode Pri: " << getDecodePriority() << llendl; + LL_INFOS() << "baked texture: " << mID << "clears all call backs due to inactivity." << LL_ENDL; + LL_INFOS() << mUrl << LL_ENDL; + LL_INFOS() << "current discard: " << getDiscardLevel() << " current discard for fetch: " << getCurrentDiscardLevelForFetching() << + " Desired discard: " << getDesiredDiscardLevel() << "decode Pri: " << getDecodePriority() << LL_ENDL; } clearCallbackEntryList() ; //remove all callbacks. @@ -2402,8 +2402,8 @@ bool LLViewerFetchedTexture::doLoadedCallbacks() if (mFTType == FTT_SERVER_BAKE) { //output some debug info - llinfos << "baked texture: " << mID << "is missing." << llendl; - llinfos << mUrl << llendl; + LL_INFOS() << "baked texture: " << mID << "is missing." << LL_ENDL; + LL_INFOS() << mUrl << LL_ENDL; } for(callback_list_t::iterator iter = mLoadedCallbackList.begin(); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index f5538efc24..9f42776d78 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1996,10 +1996,10 @@ LLViewerFetchedTexture *LLVOAvatar::getBakedTextureImage(const U8 te, const LLUU if (url.empty()) { - llwarns << "unable to determine URL for te " << te << " uuid " << uuid << llendl; + LL_WARNS() << "unable to determine URL for te " << te << " uuid " << uuid << LL_ENDL; return NULL; } - LL_DEBUGS("Avatar") << avString() << "get server-bake image from URL " << url << llendl; + LL_DEBUGS("Avatar") << avString() << "get server-bake image from URL " << url << LL_ENDL; result = LLViewerTextureManager::getFetchedTextureFromUrl( url, FTT_SERVER_BAKE, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE, 0, 0, uuid); if (result->isMissingAsset()) @@ -4665,7 +4665,7 @@ const std::string LLVOAvatar::getImageURL(const U8 te, const LLUUID &uuid) if (appearance_service_url.empty()) { // Probably a server-side issue if we get here: - llwarns << "AgentAppearanceServiceURL not set - Baked texture requests will fail" << llendl; + LL_WARNS() << "AgentAppearanceServiceURL not set - Baked texture requests will fail" << LL_ENDL; return url; } @@ -4673,7 +4673,7 @@ const std::string LLVOAvatar::getImageURL(const U8 te, const LLUUID &uuid) if (texture_entry != NULL) { url = appearance_service_url + "texture/" + getID().asString() + "/" + texture_entry->mDefaultImageName + "/" + uuid.asString(); - //llinfos << "baked texture url: " << url << llendl; + //LL_INFOS() << "baked texture url: " << url << LL_ENDL; } return url; } @@ -6055,7 +6055,7 @@ void LLVOAvatar::onGlobalColorChanged(const LLTexGlobalColor* global_color) } else if (global_color == mTexEyeColor) { -// llinfos << "invalidateComposite cause: onGlobalColorChanged( eyecolor )" << llendl; +// LL_INFOS() << "invalidateComposite cause: onGlobalColorChanged( eyecolor )" << LL_ENDL; invalidateComposite( mBakedTextureDatas[BAKED_EYES].mTexLayerSet); } updateMeshTextures(); @@ -6151,7 +6151,7 @@ void LLVOAvatar::startPhase(const std::string& phase_name) bool completed = false; bool found = getPhases().getPhaseValues(phase_name, elapsed, completed); //LL_DEBUGS("Avatar") << avString() << " phase state " << phase_name - // << " found " << found << " elapsed " << elapsed << " completed " << completed << llendl; + // << " found " << found << " elapsed " << elapsed << " completed " << completed << LL_ENDL; if (found) { if (!completed) @@ -7146,7 +7146,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) llassert(appearance_version > 0); if (appearance_version > 1) { - llwarns << "unsupported appearance version " << appearance_version << ", discarding appearance message" << llendl; + LL_WARNS() << "unsupported appearance version " << appearance_version << ", discarding appearance message" << LL_ENDL; return; } @@ -7157,7 +7157,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) { LL_DEBUGS("Avatar") << "this_update_cof_version " << this_update_cof_version << " last_update_request_cof_version " << last_update_request_cof_version - << " my_cof_version " << LLAppearanceMgr::instance().getCOFVersion() << llendl; + << " my_cof_version " << LLAppearanceMgr::instance().getCOFVersion() << LL_ENDL; } else { @@ -7208,14 +7208,14 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) && mBakedTextureDatas[baked_index].mLastTextureID != IMG_DEFAULT && baked_index != BAKED_SKIRT) { - LL_DEBUGS("Avatar") << avString() << " baked_index " << (S32) baked_index << " using mLastTextureID " << mBakedTextureDatas[baked_index].mLastTextureID << llendl; + LL_DEBUGS("Avatar") << avString() << " baked_index " << (S32) baked_index << " using mLastTextureID " << mBakedTextureDatas[baked_index].mLastTextureID << LL_ENDL; setTEImage(mBakedTextureDatas[baked_index].mTextureIndex, LLViewerTextureManager::getFetchedTexture(mBakedTextureDatas[baked_index].mLastTextureID, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE)); } else { LL_DEBUGS("Avatar") << avString() << " baked_index " << (S32) baked_index << " using texture id " - << getTE(mBakedTextureDatas[baked_index].mTextureIndex)->getID() << llendl; + << getTE(mBakedTextureDatas[baked_index].mTextureIndex)->getID() << LL_ENDL; } } @@ -7256,7 +7256,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) if(is_first_appearance_message) { - //LL_DEBUGS("Avatar") << "param slam " << i << " " << newWeight << llendl; + //LL_DEBUGS("Avatar") << "param slam " << i << " " << newWeight << LL_ENDL; param->setWeight(newWeight); } else @@ -7273,7 +7273,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) LL_DEBUGS("Avatar") << "Number of params in AvatarAppearance msg (" << num_params << ") does not match number of tweakable params in avatar xml file (" << expected_tweakable_count << "). Processing what we can. object: " << getID() << LL_ENDL; } - LL_DEBUGS("Avatar") << "Changed " << params_changed_count << " params" << llendl; + LL_DEBUGS("Avatar") << "Changed " << params_changed_count << " params" << LL_ENDL; if (params_changed) { if (interp_params) diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 20ef72708c..84e5567d37 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -232,13 +232,13 @@ bool LLVOAvatarSelf::checkStuckAppearance() if (gAgentWearables.isCOFChangeInProgress()) { - LL_DEBUGS("Avatar") << "checking for stuck appearance" << llendl; + LL_DEBUGS("Avatar") << "checking for stuck appearance" << LL_ENDL; F32 change_time = gAgentWearables.getCOFChangeTime(); - LL_DEBUGS("Avatar") << "change in progress for " << change_time << " seconds" << llendl; + LL_DEBUGS("Avatar") << "change in progress for " << change_time << " seconds" << LL_ENDL; S32 active_hp = LLAppearanceMgr::instance().countActiveHoldingPatterns(); - LL_DEBUGS("Avatar") << "active holding patterns " << active_hp << " seconds" << llendl; + LL_DEBUGS("Avatar") << "active holding patterns " << active_hp << " seconds" << LL_ENDL; S32 active_copies = LLAppearanceMgr::instance().getActiveCopyOperations(); - LL_DEBUGS("Avatar") << "active copy operations " << active_copies << llendl; + LL_DEBUGS("Avatar") << "active copy operations " << active_copies << LL_ENDL; if ((change_time > CONDITIONAL_UNSTICK_INTERVAL && active_copies == 0) || (change_time > UNCONDITIONAL_UNSTICK_INTERVAL)) @@ -2526,7 +2526,6 @@ void LLVOAvatarSelf::forceBakeAllTextures(bool slam_for_debug) } invalidateComposite(layer_set); - LLViewerStats::getInstance()->incStat(LLViewerStats::ST_TEX_REBAKES); } else { diff --git a/indra/newview/llwearablelist.cpp b/indra/newview/llwearablelist.cpp index 7f08d42e8b..b61fbbd073 100755 --- a/indra/newview/llwearablelist.cpp +++ b/indra/newview/llwearablelist.cpp @@ -81,7 +81,7 @@ void LLWearableList::getAsset(const LLAssetID& assetID, const std::string& weara LLViewerWearable* instance = get_if_there(mList, assetID, (LLViewerWearable*)NULL ); if( instance ) { - LL_DEBUGS("Avatar") << "wearable " << assetID << " found in LLWearableList" << llendl; + LL_DEBUGS("Avatar") << "wearable " << assetID << " found in LLWearableList" << LL_ENDL; asset_arrived_callback( instance, userdata ); } else diff --git a/indra/newview/llwebprofile.cpp b/indra/newview/llwebprofile.cpp index 6ee42d2274..ddb7f7bfce 100755 --- a/indra/newview/llwebprofile.cpp +++ b/indra/newview/llwebprofile.cpp @@ -168,13 +168,13 @@ public: const std::string& redir_url = getResponseHeader(HTTP_IN_HEADER_LOCATION); if (redir_url.empty()) { - llwarns << "Received empty redirection URL " << dumpResponse() << llendl; + LL_WARNS() << "Received empty redirection URL " << dumpResponse() << LL_ENDL; LL_DEBUGS("Snapshots") << "[headers:" << getResponseHeaders() << "]" << LL_ENDL; LLWebProfile::reportImageUploadStatus(false); } else { - LL_DEBUGS("Snapshots") << "Got redirection URL: " << redir_url << llendl; + LL_DEBUGS("Snapshots") << "Got redirection URL: " << redir_url << LL_ENDL; LLHTTPClient::get(redir_url, new LLWebProfileResponders::PostImageRedirectResponder, headers); } } diff --git a/indra/newview/llwebsharing.cpp b/indra/newview/llwebsharing.cpp index 7036162014..82615e55fc 100755 --- a/indra/newview/llwebsharing.cpp +++ b/indra/newview/llwebsharing.cpp @@ -82,9 +82,9 @@ public: // Only emit a warning if we failed to parse when 'content-type' == 'application/json' if (!parsed && (HTTP_CONTENT_JSON == getResponseHeader(HTTP_IN_HEADER_CONTENT_TYPE))) { - llwarns << "Failed to deserialize LLSD from JSON response. " << getURL() + LL_WARNS() << "Failed to deserialize LLSD from JSON response. " << getURL() << " [status:" << mStatus << "] " - << "(" << mReason << ") body: " << debug_body << llendl; + << "(" << mReason << ") body: " << debug_body << LL_ENDL; } if (!parsed) -- cgit v1.2.3 From 01ad22ce197ba3bbf97ee396e163e5de529ad2e8 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Thu, 15 May 2014 12:53:09 -0400 Subject: fix for bad merge --- indra/newview/llinventorymodel.cpp | 166 +++++++++++++++++++++++++++++++++++++ 1 file changed, 166 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 29b9c2b998..14ca0095ae 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -2268,6 +2268,172 @@ void LLInventoryModel::buildParentChildMap() << cat->getName() << LL_ENDL; ++lost; lost_cats.push_back(cat); + } + } + if(lost) + { + LL_WARNS() << "Found " << lost << " lost categories." << LL_ENDL; + } + + // Do moves in a separate pass to make sure we've properly filed + // the FT_LOST_AND_FOUND category before we try to find its UUID. + for(i = 0; i<lost_cats.size(); ++i) + { + LLViewerInventoryCategory *cat = lost_cats.at(i); + + // plop it into the lost & found. + LLFolderType::EType pref = cat->getPreferredType(); + if(LLFolderType::FT_NONE == pref) + { + cat->setParent(findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND)); + } + else if(LLFolderType::FT_ROOT_INVENTORY == pref) + { + // it's the root + cat->setParent(LLUUID::null); + } + else + { + // it's a protected folder. + cat->setParent(gInventory.getRootFolderID()); + } + // FIXME note that updateServer() fails with protected + // types, so this will not work as intended in that case. + cat->updateServer(TRUE); + catsp = getUnlockedCatArray(cat->getParentUUID()); + if(catsp) + { + catsp->push_back(cat); + } + else + { + LL_WARNS() << "Lost and found Not there!!" << LL_ENDL; + } + } + + const BOOL COF_exists = (findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT, FALSE) != LLUUID::null); + sFirstTimeInViewer2 = !COF_exists || gAgent.isFirstLogin(); + + + // Now the items. We allocated in the last step, so now all we + // have to do is iterate over the items and put them in the right + // place. + item_array_t items; + if(!mItemMap.empty()) + { + LLPointer<LLViewerInventoryItem> item; + for(item_map_t::iterator iit = mItemMap.begin(); iit != mItemMap.end(); ++iit) + { + item = (*iit).second; + items.push_back(item); + } + } + count = items.size(); + lost = 0; + uuid_vec_t lost_item_ids; + for(i = 0; i < count; ++i) + { + LLPointer<LLViewerInventoryItem> item; + item = items.at(i); + itemsp = getUnlockedItemArray(item->getParentUUID()); + if(itemsp) + { + itemsp->push_back(item); + } + else + { + LL_INFOS() << "Lost item: " << item->getUUID() << " - " + << item->getName() << LL_ENDL; + ++lost; + // plop it into the lost & found. + // + item->setParent(findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND)); + // move it later using a special message to move items. If + // we update server here, the client might crash. + //item->updateServer(); + lost_item_ids.push_back(item->getUUID()); + itemsp = getUnlockedItemArray(item->getParentUUID()); + if(itemsp) + { + itemsp->push_back(item); + } + else + { + LL_WARNS() << "Lost and found Not there!!" << LL_ENDL; + } + } + } + if(lost) + { + LL_WARNS() << "Found " << lost << " lost items." << LL_ENDL; + LLMessageSystem* msg = gMessageSystem; + BOOL start_new_message = TRUE; + const LLUUID lnf = findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND); + for(uuid_vec_t::iterator it = lost_item_ids.begin() ; it < lost_item_ids.end(); ++it) + { + if(start_new_message) + { + start_new_message = FALSE; + msg->newMessageFast(_PREHASH_MoveInventoryItem); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + msg->addBOOLFast(_PREHASH_Stamp, FALSE); + } + msg->nextBlockFast(_PREHASH_InventoryData); + msg->addUUIDFast(_PREHASH_ItemID, (*it)); + msg->addUUIDFast(_PREHASH_FolderID, lnf); + msg->addString("NewName", NULL); + if(msg->isSendFull(NULL)) + { + start_new_message = TRUE; + gAgent.sendReliableMessage(); + } + } + if(!start_new_message) + { + gAgent.sendReliableMessage(); + } + } + + const LLUUID &agent_inv_root_id = gInventory.getRootFolderID(); + if (agent_inv_root_id.notNull()) + { + cat_array_t* catsp = get_ptr_in_map(mParentChildCategoryTree, agent_inv_root_id); + if(catsp) + { + // *HACK - fix root inventory folder + // some accounts has pbroken inventory root folders + + std::string name = "My Inventory"; + LLUUID prev_root_id = mRootFolderID; + for (parent_cat_map_t::const_iterator it = mParentChildCategoryTree.begin(), + it_end = mParentChildCategoryTree.end(); it != it_end; ++it) + { + cat_array_t* cat_array = it->second; + for (cat_array_t::const_iterator cat_it = cat_array->begin(), + cat_it_end = cat_array->end(); cat_it != cat_it_end; ++cat_it) + { + LLPointer<LLViewerInventoryCategory> category = *cat_it; + + if(category && category->getPreferredType() != LLFolderType::FT_ROOT_INVENTORY) + continue; + if ( category && 0 == LLStringUtil::compareInsensitive(name, category->getName()) ) + { + if(category->getUUID()!=mRootFolderID) + { + LLUUID& new_inv_root_folder_id = const_cast<LLUUID&>(mRootFolderID); + new_inv_root_folder_id = category->getUUID(); + } + } + } + } + + // 'My Inventory', + // root of the agent's inv found. + // The inv tree is built. + mIsAgentInvUsable = true; + // notifyObservers() has been moved to // llstartup/idle_startup() after this func completes. // Allows some system categories to be created before -- cgit v1.2.3 From f2d7dfb1e6689968459ef680e608546d474da008 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Fri, 16 May 2014 10:18:53 -0400 Subject: merge fixes --- indra/newview/llagentwearables.cpp | 2 +- indra/newview/llappearancemgr.cpp | 8 +------- indra/newview/llvoavatarself.cpp | 1 + 3 files changed, 3 insertions(+), 8 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 11666f6c8f..26626ad894 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -654,7 +654,7 @@ public: /* virtual */ void fire(const LLUUID& inv_item) { LL_INFOS() << "One item created " << inv_item.asString() << LL_ENDL; - LLViewerInventoryItem *item = gInventory.getItem(inv_item); + LLConstPointer<LLInventoryObject> item = gInventory.getItem(inv_item); mItemsToLink.push_back(item); updatePendingWearable(inv_item); } diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index dc503dc50e..a4c430bada 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -926,7 +926,7 @@ void recovered_item_cb(const LLUUID& item_id, LLWearableType::EType type, LLView } LL_DEBUGS("Avatar") << self_av_string() << "Recovered item for type " << type << LL_ENDL; - LLViewerInventoryItem *itemp = gInventory.getItem(item_id); + LLConstPointer<LLInventoryObject> itemp = gInventory.getItem(item_id); wearable->setItemID(item_id); holder->eraseTypeToRecover(type); llassert(itemp); @@ -2975,12 +2975,6 @@ struct WearablesOrderComparator bool operator()(const LLInventoryItem* item1, const LLInventoryItem* item2) { - if (!item1 || !item2) - { - LL_WARNS() << "either item1 or item2 is NULL" << LL_ENDL; - return true; - } - const std::string& desc1 = item1->getActualDescription(); const std::string& desc2 = item2->getActualDescription(); diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 84e5567d37..1f497bc107 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2526,6 +2526,7 @@ void LLVOAvatarSelf::forceBakeAllTextures(bool slam_for_debug) } invalidateComposite(layer_set); + add(LLStatViewer::TEX_REBAKES, 1); } else { -- cgit v1.2.3 From a5bb8839fa24fa0b7da331f14eedccea1b44bc84 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Fri, 16 May 2014 15:47:34 -0400 Subject: merge fix --- indra/newview/llhttpretrypolicy.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llhttpretrypolicy.cpp b/indra/newview/llhttpretrypolicy.cpp index 7001a9a88b..2d4ce6c883 100755 --- a/indra/newview/llhttpretrypolicy.cpp +++ b/indra/newview/llhttpretrypolicy.cpp @@ -137,6 +137,6 @@ bool LLAdaptiveRetryPolicy::shouldRetry(F32& seconds_to_wait) const seconds_to_wait = F32_MAX; return false; } - seconds_to_wait = mShouldRetry ? mRetryTimer.getRemainingTimeF32() : F32_MAX; + seconds_to_wait = mShouldRetry ? (F32) mRetryTimer.getRemainingTimeF32() : F32_MAX; return mShouldRetry; } -- cgit v1.2.3 From 34b2f2d1f841f7b7f93386d66be6943910cd055b Mon Sep 17 00:00:00 2001 From: Stinson Linden <stinson@lindenlab.com> Date: Fri, 16 May 2014 22:44:25 +0100 Subject: MAINT-4009: First pass refactoring to eliminate memory related to error reporting that is not properly cleaned up. --- indra/newview/llviewerwindow.cpp | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 2cb8e6a3ab..8e5d577968 100755 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -261,7 +261,7 @@ std::string LLViewerWindow::sMovieBaseName; LLTrace::SampleStatHandle<> LLViewerWindow::sMouseVelocityStat("Mouse Velocity"); -class RecordToChatConsole : public LLError::Recorder, public LLSingleton<RecordToChatConsole> +class RecordToChatConsoleRecorder : public LLError::Recorder { public: virtual void recordMessage(LLError::ELevel level, @@ -285,6 +285,22 @@ public: } }; +class RecordToChatConsole : public LLSingleton<RecordToChatConsole> +{ +public: + RecordToChatConsole() + : LLSingleton<RecordToChatConsole>(), + mRecorder(new RecordToChatConsoleRecorder()) + { + } + + void startRecorder() { LLError::addRecorder(mRecorder); } + void stopRecorder() { LLError::removeRecorder(mRecorder); } + +private: + LLError::RecorderPtr mRecorder; +}; + //////////////////////////////////////////////////////////////////////////// // // LLDebugText @@ -1889,11 +1905,11 @@ void LLViewerWindow::initBase() // optionally forward warnings to chat console/chat floater // for qa runs and dev builds #if !LL_RELEASE_FOR_DOWNLOAD - LLError::addRecorder(RecordToChatConsole::getInstance()); + RecordToChatConsole::getInstance()->startRecorder(); #else if(gSavedSettings.getBOOL("QAMode")) { - LLError::addRecorder(RecordToChatConsole::getInstance()); + RecordToChatConsole::getInstance()->startRecorder(); } #endif @@ -2040,8 +2056,7 @@ void LLViewerWindow::initWorldUI() void LLViewerWindow::shutdownViews() { // clean up warning logger - LLError::removeRecorder(RecordToChatConsole::getInstance()); - + RecordToChatConsole::getInstance()->stopRecorder(); LL_INFOS() << "Warning logger is cleaned." << LL_ENDL ; delete mDebugText; -- cgit v1.2.3 From d0d32626a5bf25f76b4a3296f681eb13e071d55e Mon Sep 17 00:00:00 2001 From: Nyx Linden <nyx@lindenlab.com> Date: Mon, 19 May 2014 14:44:01 -0400 Subject: merge fix for merge with project interesting. New appearance utility source and one quick doubly-declared typedef. --- indra/newview/llinventorymodel.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index b72c8fed50..2e957809be 100755 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -485,7 +485,7 @@ public: // been changed 'under the hood', but outside the control of the // inventory. The next notify will include that notification. void addChangedMask(U32 mask, const LLUUID& referent); - typedef uuid_set_t changed_items_t; + const changed_items_t& getChangedIDs() const { return mChangedItemIDs; } const changed_items_t& getAddedIDs() const { return mAddedItemIDs; } protected: -- cgit v1.2.3 From 644ca6a0f8a7759119814f88df93b8e838321a12 Mon Sep 17 00:00:00 2001 From: Oz Linden <oz@lindenlab.com> Date: Mon, 19 May 2014 17:01:51 -0400 Subject: increment viewer version to 3.7.9 --- indra/newview/VIEWER_VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/VIEWER_VERSION.txt b/indra/newview/VIEWER_VERSION.txt index a0fc9e07cb..c77a7de85c 100644 --- a/indra/newview/VIEWER_VERSION.txt +++ b/indra/newview/VIEWER_VERSION.txt @@ -1 +1 @@ -3.7.8 +3.7.9 -- cgit v1.2.3 From 5537417ac35ed36322acdba843bd72bf7a7d1992 Mon Sep 17 00:00:00 2001 From: Stinson Linden <stinson@lindenlab.com> Date: Tue, 20 May 2014 01:03:50 +0100 Subject: MAINT-4009: Ensuring that the cookie store is properly cleaned on app exit. --- indra/newview/llviewermedia.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index afa2bb6728..a2a3caee00 100755 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -1604,6 +1604,12 @@ void LLViewerMedia::cleanupClass() delete sSpareBrowserMediaSource; sSpareBrowserMediaSource = NULL; } + + if (sCookieStore != NULL) + { + delete sCookieStore; + sCookieStore = NULL; + } } ////////////////////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3 From c84217cc5bf49354b39ea3521e4805c791a15c8c Mon Sep 17 00:00:00 2001 From: Stinson Linden <stinson@lindenlab.com> Date: Tue, 27 May 2014 22:45:02 +0100 Subject: MAINT-4009: Ensuring that the view listeners are properly cleaned up at app close. --- indra/newview/llviewerwindow.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index fc5fb39f4e..7d2771802e 100755 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -2088,6 +2088,9 @@ void LLViewerWindow::shutdownViews() // access to gMenuHolder cleanup_menus(); LL_INFOS() << "menus destroyed." << LL_ENDL ; + + view_listener_t::cleanup(); + LL_INFOS() << "view listeners destroyed." << LL_ENDL ; // Delete all child views. delete mRootView; -- cgit v1.2.3 From 72dba8742c3120fcb76b42aa6ede796bdad8554d Mon Sep 17 00:00:00 2001 From: "maxim@mnikolenko" <maxim@mnikolenko> Date: Wed, 28 May 2014 13:20:12 +0300 Subject: MAINT-4070 FIXED Use icon in urls when content is trusted. --- indra/newview/llchatitemscontainerctrl.cpp | 27 ++++++++++++--------------- indra/newview/llchatitemscontainerctrl.h | 2 ++ indra/newview/lltoastimpanel.cpp | 1 + indra/newview/lltoastnotifypanel.cpp | 7 ++++++- 4 files changed, 21 insertions(+), 16 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llchatitemscontainerctrl.cpp b/indra/newview/llchatitemscontainerctrl.cpp index fd4f17b694..cfc62c07b6 100755 --- a/indra/newview/llchatitemscontainerctrl.cpp +++ b/indra/newview/llchatitemscontainerctrl.cpp @@ -29,7 +29,6 @@ #include "llchatitemscontainerctrl.h" #include "lltextbox.h" -#include "llchatmsgbox.h" #include "llavatariconctrl.h" #include "llcommandhandler.h" #include "llfloaterreg.h" @@ -130,7 +129,6 @@ void LLFloaterIMNearbyChatToastPanel::addMessage(LLSD& notification) { std::string messageText = notification["message"].asString(); // UTF-8 line of text - LLChatMsgBox* msg_text = getChild<LLChatMsgBox>("msg_text", false); std::string color_name = notification["text_color"].asString(); @@ -171,7 +169,7 @@ void LLFloaterIMNearbyChatToastPanel::addMessage(LLSD& notification) { style_params.font.style = "ITALIC"; } - msg_text->appendText(messageText, TRUE, style_params); + mMsgText->appendText(messageText, TRUE, style_params); } snapToMessageHeight(); @@ -204,9 +202,10 @@ void LLFloaterIMNearbyChatToastPanel::init(LLSD& notification) case 2: messageFont = LLFontGL::getFontSansSerifBig(); break; } - LLChatMsgBox* msg_text = getChild<LLChatMsgBox>("msg_text", false); + mMsgText = getChild<LLChatMsgBox>("msg_text", false); + mMsgText->setContentTrusted(false); - msg_text->setText(std::string("")); + mMsgText->setText(std::string("")); if ( notification["chat_style"].asInteger() != CHAT_STYLE_IRC ) { @@ -232,12 +231,12 @@ void LLFloaterIMNearbyChatToastPanel::init(LLSD& notification) style_params_name.link_href = notification["sender_slurl"].asString(); style_params_name.is_link = true; - msg_text->appendText(str_sender, FALSE, style_params_name); + mMsgText->appendText(str_sender, FALSE, style_params_name); } else { - msg_text->appendText(str_sender, false); + mMsgText->appendText(str_sender, false); } } @@ -264,7 +263,7 @@ void LLFloaterIMNearbyChatToastPanel::init(LLSD& notification) { style_params.font.style = "ITALIC"; } - msg_text->appendText(messageText, FALSE, style_params); + mMsgText->appendText(messageText, FALSE, style_params); } @@ -275,8 +274,7 @@ void LLFloaterIMNearbyChatToastPanel::init(LLSD& notification) void LLFloaterIMNearbyChatToastPanel::snapToMessageHeight () { - LLChatMsgBox* text_box = getChild<LLChatMsgBox>("msg_text", false); - S32 new_height = llmax (text_box->getTextPixelHeight() + 2*text_box->getVPad() + 2*msg_height_pad, 25); + S32 new_height = llmax (mMsgText->getTextPixelHeight() + 2*mMsgText->getVPad() + 2*msg_height_pad, 25); LLRect panel_rect = getRect(); @@ -312,14 +310,13 @@ BOOL LLFloaterIMNearbyChatToastPanel::handleMouseUp (S32 x, S32 y, MASK mask) return LLPanel::handleMouseUp(x,y,mask); */ - LLChatMsgBox* text_box = getChild<LLChatMsgBox>("msg_text", false); - S32 local_x = x - text_box->getRect().mLeft; - S32 local_y = y - text_box->getRect().mBottom; + S32 local_x = x - mMsgText->getRect().mLeft; + S32 local_y = y - mMsgText->getRect().mBottom; //if text_box process mouse up (ussually this is click on url) - we didn't show nearby_chat. - if (text_box->pointInView(local_x, local_y) ) + if (mMsgText->pointInView(local_x, local_y) ) { - if (text_box->handleMouseUp(local_x,local_y,mask) == TRUE) + if (mMsgText->handleMouseUp(local_x,local_y,mask) == TRUE) return TRUE; else { diff --git a/indra/newview/llchatitemscontainerctrl.h b/indra/newview/llchatitemscontainerctrl.h index 54b6499d52..f66670ec8c 100755 --- a/indra/newview/llchatitemscontainerctrl.h +++ b/indra/newview/llchatitemscontainerctrl.h @@ -28,6 +28,7 @@ #define LL_LLCHATITEMSCONTAINERCTRL_H_ #include "llchat.h" +#include "llchatmsgbox.h" #include "llpanel.h" #include "llscrollbar.h" #include "llviewerchat.h" @@ -85,6 +86,7 @@ private: LLUUID mFromID; // agent id or object id std::string mFromName; EChatSourceType mSourceType; + LLChatMsgBox* mMsgText; diff --git a/indra/newview/lltoastimpanel.cpp b/indra/newview/lltoastimpanel.cpp index a27105e22d..39adfb3431 100755 --- a/indra/newview/lltoastimpanel.cpp +++ b/indra/newview/lltoastimpanel.cpp @@ -54,6 +54,7 @@ LLToastIMPanel::LLToastIMPanel(LLToastIMPanel::Params &p) : LLToastPanel(p.notif mAvatarName = getChild<LLTextBox>("user_name"); mTime = getChild<LLTextBox>("time_box"); mMessage = getChild<LLTextBox>("message"); + mMessage->setContentTrusted(false); LLStyle::Params style_params; LLFontGL* fontp = LLViewerChat::getChatFont(); diff --git a/indra/newview/lltoastnotifypanel.cpp b/indra/newview/lltoastnotifypanel.cpp index 51935dc03b..907baf0661 100755 --- a/indra/newview/lltoastnotifypanel.cpp +++ b/indra/newview/lltoastnotifypanel.cpp @@ -270,8 +270,12 @@ void LLToastNotifyPanel::init( LLRect rect, bool show_images ) // customize panel's attributes // is it intended for displaying a tip? mIsTip = mNotification->getType() == "notifytip"; + + std::string notif_name = mNotification->getName(); // is it a script dialog? - mIsScriptDialog = (mNotification->getName() == "ScriptDialog" || mNotification->getName() == "ScriptDialogGroup"); + mIsScriptDialog = (notif_name == "ScriptDialog" || notif_name == "ScriptDialogGroup"); + + bool is_content_trusted = (notif_name != "LoadWebPage"); // is it a caution? // // caution flag can be set explicitly by specifying it in the notification payload, or it can be set implicitly if the @@ -314,6 +318,7 @@ void LLToastNotifyPanel::init( LLRect rect, bool show_images ) mTextBox->setMaxTextLength(MAX_LENGTH); mTextBox->setVisible(TRUE); mTextBox->setPlainText(!show_images); + mTextBox->setContentTrusted(is_content_trusted); mTextBox->setValue(mNotification->getMessage()); mTextBox->setIsFriendCallback(LLAvatarActions::isFriend); -- cgit v1.2.3 From 90fc7a13d1ebf766f727f4709853d2a9bd4f2d4e Mon Sep 17 00:00:00 2001 From: Stinson Linden <stinson@lindenlab.com> Date: Thu, 29 May 2014 21:08:21 +0100 Subject: MAINT-4106: Correcting crash on exit behavior during normal shutdown. With the more comprehensive texture cleanup going on, this code was causing an crash on exit when gAgentAvatarp was null. Adding a check for null before proceeding. --- indra/newview/llvoavatarself.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 319da1abb5..83e08ff1e8 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2033,7 +2033,10 @@ BOOL LLVOAvatarSelf::getIsCloud() const /*static*/ void LLVOAvatarSelf::debugOnTimingLocalTexLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata) { - gAgentAvatarp->debugTimingLocalTexLoaded(success, src_vi, src, aux_src, discard_level, final, userdata); + if (gAgentAvatarp.notNull()) + { + gAgentAvatarp->debugTimingLocalTexLoaded(success, src_vi, src, aux_src, discard_level, final, userdata); + } } void LLVOAvatarSelf::debugTimingLocalTexLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata) -- cgit v1.2.3 From 51e0cc8140a2cbe92363cb902144ccc9bf34b7c7 Mon Sep 17 00:00:00 2001 From: Stinson Linden <stinson@lindenlab.com> Date: Sat, 31 May 2014 02:30:12 +0100 Subject: MAINT-4114: Refactoring the LLBadge code to ensure a parent view always has the badge (to preserve memory cleanliness), but to also allow for badge reparenting so that the NEW badge works in the inventory window. This change relates to 9e0d629da1487f850beb2767bd47734c4ccc393e. --- indra/newview/llpanelmarketplaceinboxinventory.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelmarketplaceinboxinventory.cpp b/indra/newview/llpanelmarketplaceinboxinventory.cpp index 2f65bedc2b..f7c2f629ec 100755 --- a/indra/newview/llpanelmarketplaceinboxinventory.cpp +++ b/indra/newview/llpanelmarketplaceinboxinventory.cpp @@ -129,11 +129,11 @@ void LLInboxFolderViewFolder::addItem(LLFolderViewItem* item) // virtual void LLInboxFolderViewFolder::draw() { - if (!badgeHasParent()) + if (!hasBadgeHolderParent()) { - addBadgeToParentPanel(); + addBadgeToParentHolder(); } - + setBadgeVisibility(mFresh); LLFolderViewFolder::draw(); @@ -214,9 +214,9 @@ BOOL LLInboxFolderViewItem::handleDoubleClick(S32 x, S32 y, MASK mask) // virtual void LLInboxFolderViewItem::draw() { - if (!badgeHasParent()) + if (!hasBadgeHolderParent()) { - addBadgeToParentPanel(); + addBadgeToParentHolder(); } setBadgeVisibility(mFresh); -- cgit v1.2.3 From 977476171ddcc057d7c28b6c14ae988b8189ed75 Mon Sep 17 00:00:00 2001 From: Oz Linden <oz@lindenlab.com> Date: Mon, 16 Jun 2014 11:35:23 -0400 Subject: increment viewer version to 3.7.10 --- indra/newview/VIEWER_VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/VIEWER_VERSION.txt b/indra/newview/VIEWER_VERSION.txt index c77a7de85c..f06fb9e915 100644 --- a/indra/newview/VIEWER_VERSION.txt +++ b/indra/newview/VIEWER_VERSION.txt @@ -1 +1 @@ -3.7.9 +3.7.10 -- cgit v1.2.3