diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2025-03-18 19:29:30 +0200 |
---|---|---|
committer | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2025-03-18 21:24:37 +0200 |
commit | d3d0728bac31099785fea1bf87f11b7c29d2425d (patch) | |
tree | d840c2cd416bcdc18b951d82498111de8af00fdb /indra | |
parent | 4e5dce794923736ff7c32d55f1e75361e89a9d31 (diff) |
#3547 Further reduce ParcelInfoRequest calls
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llpanelprofilepicks.cpp | 4 | ||||
-rw-r--r-- | indra/newview/llremoteparcelrequest.cpp | 19 | ||||
-rw-r--r-- | indra/newview/llremoteparcelrequest.h | 2 |
3 files changed, 22 insertions, 3 deletions
diff --git a/indra/newview/llpanelprofilepicks.cpp b/indra/newview/llpanelprofilepicks.cpp index 09b8011ce4..a87ef4f0f9 100644 --- a/indra/newview/llpanelprofilepicks.cpp +++ b/indra/newview/llpanelprofilepicks.cpp @@ -55,7 +55,7 @@ static LLPanelInjector<LLPanelProfilePicks> t_panel_profile_picks("panel_profile_picks"); static LLPanelInjector<LLPanelProfilePick> t_panel_profile_pick("panel_profile_pick"); -constexpr F32 REQUEST_TIMOUT = 60; +constexpr F32 REQUEST_TIMEOUT = 60; constexpr F32 LOCATION_CACHE_TIMOUT = 900; class LLPickHandler : public LLCommandHandler @@ -842,7 +842,7 @@ std::string LLPanelProfilePick::getLocationNotice() void LLPanelProfilePick::sendParcelInfoRequest() { - if (mParcelId != mRequestedId || mLastRequestTimer.getElapsedTimeF32() > REQUEST_TIMOUT) + if (mParcelId != mRequestedId || mLastRequestTimer.getElapsedTimeF32() > REQUEST_TIMEOUT) { if (mRequestedId.notNull()) { diff --git a/indra/newview/llremoteparcelrequest.cpp b/indra/newview/llremoteparcelrequest.cpp index 7b80e8c27f..d0aa1af2f3 100644 --- a/indra/newview/llremoteparcelrequest.cpp +++ b/indra/newview/llremoteparcelrequest.cpp @@ -102,7 +102,15 @@ void LLRemoteParcelInfoProcessor::processParcelInfoReply(LLMessageSystem* msg, v msg->getS32 ("Data", "SalePrice", parcel_data.sale_price); msg->getS32 ("Data", "AuctionID", parcel_data.auction_id); - LLRemoteParcelInfoProcessor::observer_multimap_t & observers = LLRemoteParcelInfoProcessor::getInstance()->mObservers; + LLRemoteParcelInfoProcessor* inst = LLRemoteParcelInfoProcessor::getInstance(); + + requests_map_t::const_iterator found = inst->mPendingParcelRequests.find(parcel_data.parcel_id); + if (found != inst->mPendingParcelRequests.end()) + { + inst->mPendingParcelRequests.erase(found); + } + + LLRemoteParcelInfoProcessor::observer_multimap_t & observers = inst->mObservers; typedef std::vector<observer_multimap_t::iterator> deadlist_t; deadlist_t dead_iters; @@ -151,6 +159,15 @@ void LLRemoteParcelInfoProcessor::processParcelInfoReply(LLMessageSystem* msg, v void LLRemoteParcelInfoProcessor::sendParcelInfoRequest(const LLUUID& parcel_id) { + constexpr F32 DUPPLICATE_TIMEOUT = 0.5f; + requests_map_t::const_iterator found = mPendingParcelRequests.find(parcel_id); + if (found != mPendingParcelRequests.end() && found->second.getElapsedTimeF32() < DUPPLICATE_TIMEOUT) + { + // recently requested + return; + } + mPendingParcelRequests[parcel_id].reset(); + LLMessageSystem *msg = gMessageSystem; msg->newMessage("ParcelInfoRequest"); diff --git a/indra/newview/llremoteparcelrequest.h b/indra/newview/llremoteparcelrequest.h index 1420b4032e..7059e14bec 100644 --- a/indra/newview/llremoteparcelrequest.h +++ b/indra/newview/llremoteparcelrequest.h @@ -91,6 +91,8 @@ public: private: typedef std::multimap<LLUUID, LLHandle<LLRemoteParcelInfoObserver> > observer_multimap_t; observer_multimap_t mObservers; + typedef std::map<LLUUID, LLTimer> requests_map_t; + requests_map_t mPendingParcelRequests; // Dupplicate request avoidance void regionParcelInfoCoro(std::string url, LLUUID regionId, LLVector3 posRegion, LLVector3d posGlobal, LLHandle<LLRemoteParcelInfoObserver> observerHandle); }; |