From 3ac017d797695e048f8f7b1fb894fcecbd10ea64 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 21 Jan 2015 19:56:02 +0200 Subject: MAINT-1722 FIXED Massive slowdown when opening "Place Profile" or "About Land" dialog --- indra/newview/llpanelplaceprofile.cpp | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) (limited to 'indra/newview/llpanelplaceprofile.cpp') diff --git a/indra/newview/llpanelplaceprofile.cpp b/indra/newview/llpanelplaceprofile.cpp index ed91d277dd..31238fdd48 100755 --- a/indra/newview/llpanelplaceprofile.cpp +++ b/indra/newview/llpanelplaceprofile.cpp @@ -53,6 +53,8 @@ #include "llviewerparcelmgr.h" #include "llviewerregion.h" +const F64 COVENANT_REFRESH_TIME_SEC = 60.0f; + static LLPanelInjector t_place_profile("panel_place_profile"); // Statics for textures filenames @@ -76,6 +78,7 @@ static std::string icon_see_avs_off; LLPanelPlaceProfile::LLPanelPlaceProfile() : LLPanelPlaceInfo(), + mNextCovenantUpdateTime(0), mForSalePanel(NULL), mYouAreHerePanel(NULL), mSelectedParcelID(-1), @@ -162,6 +165,9 @@ BOOL LLPanelPlaceProfile::postBuild() icon_see_avs_on = getString("icon_SeeAVs_On"); icon_see_avs_off = getString("icon_SeeAVs_Off"); + mLastSelectedRegionID = LLUUID::null; + mNextCovenantUpdateTime = 0; + return TRUE; } @@ -170,6 +176,9 @@ void LLPanelPlaceProfile::resetLocation() { LLPanelPlaceInfo::resetLocation(); + mLastSelectedRegionID = LLUUID::null; + mNextCovenantUpdateTime = 0; + mForSalePanel->setVisible(FALSE); mYouAreHerePanel->setVisible(FALSE); @@ -330,13 +339,20 @@ void LLPanelPlaceProfile::displaySelectedParcelInfo(LLParcel* parcel, if (!region || !parcel) return; - // send EstateCovenantInfo message - LLMessageSystem *msg = gMessageSystem; - msg->newMessage("EstateCovenantRequest"); - msg->nextBlockFast(_PREHASH_AgentData); - msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - msg->addUUIDFast(_PREHASH_SessionID,gAgent.getSessionID()); - msg->sendReliable(region->getHost()); + if (mLastSelectedRegionID != region->getRegionID() + || mNextCovenantUpdateTime < LLTimer::getElapsedSeconds()) + { + // send EstateCovenantInfo message + // Note: LLPanelPlaceProfile doesn't change Covenant's content and any + // changes made by Estate floater should be requested by Estate floater + LLMessageSystem *msg = gMessageSystem; + msg->newMessage("EstateCovenantRequest"); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + msg->addUUIDFast(_PREHASH_SessionID,gAgent.getSessionID()); + msg->sendReliable(region->getHost()); + mNextCovenantUpdateTime = LLTimer::getElapsedSeconds() + COVENANT_REFRESH_TIME_SEC; + } LLParcelData parcel_data; -- cgit v1.2.3