diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index ea4c51cbf4..321b3e9898 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -1466,35 +1466,25 @@ BOOL LLToolPie::handleTooltipObject( LLViewerObject* hover_object, std::string l // Display the PE weight for an object if mesh is enabled if (gMeshRepo.meshRezEnabled()) { - // Ansariel: What a bummer! PE is only available for - // objects in the same region as you! - if (hover_object->getRegion() && gAgent.getRegion() && - hover_object->getRegion()->getRegionID() == gAgent.getRegion()->getRegionID()) + S32 link_cost = LLSelectMgr::getInstance()->getHoverObjects()->getSelectedLinksetCost(); + if (link_cost > 0) { - S32 link_cost = LLSelectMgr::getInstance()->getHoverObjects()->getSelectedLinksetCost(); - if (link_cost > 0) - { - args.clear(); - args["PEWEIGHT"] = llformat("%d", link_cost); - tooltip_msg.append(LLTrans::getString("TooltipPrimEquivalent", args)); - } + args.clear(); + args["PEWEIGHT"] = llformat("%d", link_cost); + tooltip_msg.append(LLTrans::getString("TooltipPrimEquivalent", args)); + } /// Don't show loading on vanila OpenSim (some grids have it, not not vanilla) If they have it, it will /// show eventually #ifdef OPENSIM - else if (LLGridManager::getInstance()->isInOpenSim()) - { - // Do nothing at all. - } + else if (LLGridManager::getInstance()->isInOpenSim()) + { + // Do nothing at all. + } #endif // - else - { - tooltip_msg.append(LLTrans::getString("TooltipPrimEquivalentLoading")); - } - } else { - tooltip_msg.append(LLTrans::getString("TooltipPrimEquivalentUnavailable")); + tooltip_msg.append(LLTrans::getString("TooltipPrimEquivalentLoading")); } } diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index 0a45c71c97..733fb3c7df 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -1152,23 +1152,63 @@ void LLViewerObjectList::fetchObjectCosts() // issue http request for stale object physics costs if (!mStaleObjectCost.empty()) { - LLViewerRegion* regionp = gAgent.getRegion(); + // FIRE-5496: Missing LI for objects outside agent's region + //LLViewerRegion* regionp = gAgent.getRegion(); - if (regionp) + //if (regionp) + //{ + // std::string url = regionp->getCapability("GetObjectCost"); + + // if (!url.empty()) + // { + // LLCoros::instance().launch("LLViewerObjectList::fetchObjectCostsCoro", + // boost::bind(&LLViewerObjectList::fetchObjectCostsCoro, this, url)); + // } + // else + // { + // mStaleObjectCost.clear(); + // mPendingObjectCost.clear(); + // } + //} + + std::map regionObjectMap{}; + + // Swap it for thread safety since we're going to iterate over it + uuid_set_t staleObjectCostIds{}; + staleObjectCostIds.swap(mStaleObjectCost); + + for (const auto& staleObjectId : staleObjectCostIds) { - std::string url = regionp->getCapability("GetObjectCost"); + LLViewerObject* staleObject = findObject(staleObjectId); + if (staleObject && staleObject->getRegion()) + { + if (regionObjectMap.find(staleObject->getRegion()) == regionObjectMap.end()) + { + regionObjectMap.insert(std::make_pair(staleObject->getRegion(), uuid_set_t())); + } + + regionObjectMap[staleObject->getRegion()].insert(staleObjectId); + } + } + + for (auto region : regionObjectMap) + { + std::string url = region.first->getCapability("GetObjectCost"); if (!url.empty()) { - LLCoros::instance().launch("LLViewerObjectList::fetchObjectCostsCoro", - boost::bind(&LLViewerObjectList::fetchObjectCostsCoro, this, url)); + LLCoros::instance().launch("LLViewerObjectList::fetchObjectCostsCoro", + boost::bind(&LLViewerObjectList::fetchObjectCostsCoro, this, url, region.second)); } else { - mStaleObjectCost.clear(); - mPendingObjectCost.clear(); + for (const auto& objectId : region.second) + { + mPendingObjectCost.erase(objectId); + } } } + // } } @@ -1183,7 +1223,9 @@ void LLViewerObjectList::reportObjectCostFailure(LLSD &objectList) } -void LLViewerObjectList::fetchObjectCostsCoro(std::string url) +// FIRE-5496: Missing LI for objects outside agent's region +//void LLViewerObjectList::fetchObjectCostsCoro(std::string url) +void LLViewerObjectList::fetchObjectCostsCoro(std::string url, uuid_set_t staleObjects) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t @@ -1194,11 +1236,16 @@ void LLViewerObjectList::fetchObjectCostsCoro(std::string url) uuid_set_t diff; - std::set_difference(mStaleObjectCost.begin(), mStaleObjectCost.end(), - mPendingObjectCost.begin(), mPendingObjectCost.end(), - std::inserter(diff, diff.begin())); + // FIRE-5496: Missing LI for objects outside agent's region + //std::set_difference(mStaleObjectCost.begin(), mStaleObjectCost.end(), + // mPendingObjectCost.begin(), mPendingObjectCost.end(), + // std::inserter(diff, diff.begin())); - mStaleObjectCost.clear(); + //mStaleObjectCost.clear(); + std::set_difference(staleObjects.begin(), staleObjects.end(), + mPendingObjectCost.begin(), mPendingObjectCost.end(), + std::inserter(diff, diff.begin())); + // if (diff.empty()) { @@ -1265,7 +1312,7 @@ void LLViewerObjectList::fetchObjectCostsCoro(std::string url) // area search // Update area search to have current information. - FSAreaSearch* area_search_floater = LLFloaterReg::getTypedInstance("area_search"); + FSAreaSearch* area_search_floater = LLFloaterReg::findTypedInstance("area_search"); if (area_search_floater) { area_search_floater->updateObjectCosts(objectId, objectCost, linkCost, physicsCost, linkPhysicsCost); diff --git a/indra/newview/llviewerobjectlist.h b/indra/newview/llviewerobjectlist.h index e295639cbb..7429497363 100644 --- a/indra/newview/llviewerobjectlist.h +++ b/indra/newview/llviewerobjectlist.h @@ -253,7 +253,9 @@ protected: private: static void reportObjectCostFailure(LLSD &objectList); - void fetchObjectCostsCoro(std::string url); + // FIRE-5496: Missing LI for objects outside agent's region + //void fetchObjectCostsCoro(std::string url); + void fetchObjectCostsCoro(std::string url, uuid_set_t staleObjects); static void reportPhysicsFlagFailure(LLSD &obejectList); void fetchPhisicsFlagsCoro(std::string url); diff --git a/indra/newview/skins/default/xui/de/strings.xml b/indra/newview/skins/default/xui/de/strings.xml index 70b475307e..8a39b92dbb 100644 --- a/indra/newview/skins/default/xui/de/strings.xml +++ b/indra/newview/skins/default/xui/de/strings.xml @@ -593,9 +593,6 @@ Warten Sie kurz und versuchen Sie dann noch einmal, sich anzumelden. , bestimme Auswirkung auf Land... - - , Auswirkung auf Land nicht verfügbar - Entfernung: [DISTANCE] m diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 04c157de7c..b716d89331 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -299,7 +299,6 @@ Please try logging in again in a minute. Prims: [COUNT] , Land Impact: [PEWEIGHT] , loading Land Impact... - , Land Impact unavailable Distance: [DISTANCE] m Position: [POSITION] diff --git a/indra/newview/skins/default/xui/es/strings.xml b/indra/newview/skins/default/xui/es/strings.xml index 47e7072fbb..3e9bfe63c6 100644 --- a/indra/newview/skins/default/xui/es/strings.xml +++ b/indra/newview/skins/default/xui/es/strings.xml @@ -507,7 +507,6 @@ Intenta iniciar sesión de nuevo en unos instantes. Primitivas: [COUNT] , Impacto en el Terreno: [PEWEIGHT] , cargando Impacto en el Terreno... - , Impacto en el terreno no disponible Distancia: [DISTANCE] m Posición: [POSITION] diff --git a/indra/newview/skins/default/xui/it/strings.xml b/indra/newview/skins/default/xui/it/strings.xml index be250966b9..cee90813c6 100644 --- a/indra/newview/skins/default/xui/it/strings.xml +++ b/indra/newview/skins/default/xui/it/strings.xml @@ -573,9 +573,6 @@ Provare ad accedere nuovamente tra un minuto. , carico impatto... - - , impatto non disp. - Distanza: [DISTANCE] m diff --git a/indra/newview/skins/default/xui/pl/strings.xml b/indra/newview/skins/default/xui/pl/strings.xml index 54cb6dcf58..99dd793912 100644 --- a/indra/newview/skins/default/xui/pl/strings.xml +++ b/indra/newview/skins/default/xui/pl/strings.xml @@ -544,9 +544,6 @@ Spróbuj zalogować się ponownie za minutę. , sprawdzanie wpływu na działkę... - - , wpływ na działkę niedostępny - Odległość: [DISTANCE] m diff --git a/indra/newview/skins/default/xui/ru/strings.xml b/indra/newview/skins/default/xui/ru/strings.xml index e992aa75b9..f061c75a2d 100644 --- a/indra/newview/skins/default/xui/ru/strings.xml +++ b/indra/newview/skins/default/xui/ru/strings.xml @@ -581,9 +581,6 @@ support@secondlife.com. , Загрузка влияния на землю... - - , влияние на землю недоступно - Расстояние: [DISTANCE] м