From daca555592f8029df6a3d66d80a6a29fd268143f Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 18 Apr 2023 23:33:19 +0300 Subject: SL-19609 Urls aren't dispatched according to the indicated grid --- indra/newview/llviewerregion.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'indra/newview/llviewerregion.cpp') diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index ad7321ca4b..e122baadce 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -131,8 +131,8 @@ class LLRegionHandler : public LLCommandHandler public: // requests will be throttled from a non-trusted browser LLRegionHandler() : LLCommandHandler("region", UNTRUSTED_THROTTLE) {} - - bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) + + bool handle(const LLSD& params, const LLSD& query_map, const std::string& grid, LLMediaCtrl* web) { // make sure that we at least have a region name int num_params = params.size(); @@ -143,6 +143,10 @@ public: // build a secondlife://{PLACE} SLurl from this SLapp std::string url = "secondlife://"; + if (!grid.empty()) + { + url += grid + "/secondlife/"; + } boost::regex name_rx("[A-Za-z0-9()_%]+"); boost::regex coord_rx("[0-9]+"); for (int i = 0; i < num_params; i++) -- cgit v1.2.3 From e8c1a18105bddc29951d4c4b1700dc0af37c83c2 Mon Sep 17 00:00:00 2001 From: simon Date: Thu, 4 May 2023 16:52:35 +0100 Subject: First work on sl-19676 - Stats on updates --- indra/newview/llviewerregion.cpp | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'indra/newview/llviewerregion.cpp') diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index ad7321ca4b..3d1a81694a 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -2618,14 +2618,10 @@ LLVOCacheEntry* LLViewerRegion::getCacheEntry(U32 local_id, bool valid) return NULL; } -void LLViewerRegion::addCacheMiss(U32 id, LLViewerRegion::eCacheMissType miss_type) +void LLViewerRegion::addCacheMiss(U32 id, LLViewerRegion::eCacheMissType cache_miss_type) { mRegionCacheMissCount++; -#if 0 - mCacheMissList.insert(CacheMissItem(id, miss_type)); -#else - mCacheMissList.push_back(CacheMissItem(id, miss_type)); -#endif + mCacheMissList.push_back(CacheMissItem(id, cache_miss_type)); } //check if a non-cacheable object is already created. @@ -2701,10 +2697,10 @@ bool LLViewerRegion::probeCache(U32 local_id, U32 crc, U32 flags, U8 &cache_miss } } else - { + { // Total miss, don't have the object in cache // LL_INFOS() << "Cache miss for " << local_id << LL_ENDL; - addCacheMiss(local_id, CACHE_MISS_TYPE_FULL); - cache_miss_type = CACHE_MISS_TYPE_FULL; + addCacheMiss(local_id, CACHE_MISS_TYPE_TOTAL); + cache_miss_type = CACHE_MISS_TYPE_TOTAL; } return false; @@ -2712,7 +2708,7 @@ bool LLViewerRegion::probeCache(U32 local_id, U32 crc, U32 flags, U8 &cache_miss void LLViewerRegion::addCacheMissFull(const U32 local_id) { - addCacheMiss(local_id, CACHE_MISS_TYPE_FULL); + addCacheMiss(local_id, CACHE_MISS_TYPE_TOTAL); } void LLViewerRegion::requestCacheMisses() @@ -2763,7 +2759,6 @@ void LLViewerRegion::requestCacheMisses() mCacheDirty = TRUE ; // LL_INFOS() << "KILLDEBUG Sent cache miss full " << full_count << " crc " << crc_count << LL_ENDL; LLViewerStatsRecorder::instance().requestCacheMissesEvent(mCacheMissList.size()); - LLViewerStatsRecorder::instance().log(0.2f); mCacheMissList.clear(); } -- cgit v1.2.3 From 4173cae02165e36d96638761f29bd6d00ac24ddc Mon Sep 17 00:00:00 2001 From: simon Date: Thu, 11 May 2023 01:16:42 +0100 Subject: sl-19676 - more loading stats and 360 Interest List mode work --- indra/newview/llviewerregion.cpp | 82 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 81 insertions(+), 1 deletion(-) (limited to 'indra/newview/llviewerregion.cpp') diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 54d787366f..7abd77505d 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -646,7 +646,8 @@ LLViewerRegion::LLViewerRegion(const U64 &handle, mInvisibilityCheckHistory(-1), mPaused(FALSE), mRegionCacheHitCount(0), - mRegionCacheMissCount(0) + mRegionCacheMissCount(0), + mUse360Mode(false) { mWidth = region_width_meters; mImpl->mOriginGlobal = from_region_handle(handle); @@ -3283,6 +3284,9 @@ void LLViewerRegion::setCapabilitiesReceived(bool received) // This is a single-shot signal. Forget callbacks to save resources. mCapabilitiesReceivedSignal.disconnect_all_slots(); + + // Set the region to the desired interest list mode + setInterestList360Mode(gAgent.getInterestList360Mode()); } } @@ -3301,6 +3305,82 @@ void LLViewerRegion::logActiveCapabilities() const log_capabilities(mImpl->mCapabilities); } + +bool LLViewerRegion::requestPostCapability(const std::string &capName, LLSD &postData, httpCallback_t cbSuccess, httpCallback_t cbFailure) +{ + std::string url = getCapability(capName); + + if (url.empty()) + { + LL_WARNS("Region") << "Could not retrieve region " << getRegionID() + << " POST capability \"" << capName << "\"" << LL_ENDL; + return false; + } + + LLCoreHttpUtil::HttpCoroutineAdapter::callbackHttpPost(url, gAgent.getAgentPolicy(), postData, cbSuccess, cbFailure); + return true; +} + +bool LLViewerRegion::requestGetCapability(const std::string &capName, httpCallback_t cbSuccess, httpCallback_t cbFailure) +{ + std::string url; + + url = getCapability(capName); + + if (url.empty()) + { + LL_WARNS("Region") << "Could not retrieve region " << getRegionID() + << " GET capability \"" << capName << "\"" << LL_ENDL; + return false; + } + + LLCoreHttpUtil::HttpCoroutineAdapter::callbackHttpGet(url, gAgent.getAgentPolicy(), cbSuccess, cbFailure); + return true; +} + + +void LLViewerRegion::setInterestList360Mode(bool use_360_mode) +{ + if (use_360_mode != mUse360Mode) + { + LLSD body; + mUse360Mode = use_360_mode; + + if (mUse360Mode) + { + body["mode"] = LLSD::String("360"); + } + else + { + body["mode"] = LLSD::String("default"); + } + + if (requestPostCapability("InterestList", body, + [](const LLSD &response) { + LL_DEBUGS("360Capture") << "InterestList capability responded: \n" + << ll_pretty_print_sd(response) << LL_ENDL; + })) + { + LL_DEBUGS("360Capture") << "Region " << getRegionID() + << " Successfully posted an InterestList capability request with payload: \n" + << ll_pretty_print_sd(body) << LL_ENDL; + } + else + { + LL_WARNS("360Capture") << "Region " << getRegionID() + << " Unable to post an InterestList capability request with payload: \n" + << ll_pretty_print_sd(body) << LL_ENDL; + } + } + else + { + LL_DEBUGS("360Capture") << "Region " << getRegionID() << "No change, skipping Interest List mode POST to " + << (use_360_mode ? "360" : "default") << " mode" << LL_ENDL; + } +} + + + LLSpatialPartition* LLViewerRegion::getSpatialPartition(U32 type) { if (type < mImpl->mObjectPartition.size() && type < PARTITION_VO_CACHE) -- cgit v1.2.3 From 81f1be67109885f98f649974022aa6d444dd633d Mon Sep 17 00:00:00 2001 From: simon Date: Sat, 13 May 2023 04:10:28 +0100 Subject: sl-19676 - 360 Intereset list mode. Changed mode to be a string for future expansion instead of a bool toggle --- indra/newview/llviewerregion.cpp | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) (limited to 'indra/newview/llviewerregion.cpp') diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 7abd77505d..9c2dc3c761 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -104,6 +104,9 @@ S32 LLViewerRegion::sLastCameraUpdated = 0; S32 LLViewerRegion::sNewObjectCreationThrottle = -1; LLViewerRegion::vocache_entry_map_t LLViewerRegion::sRegionCacheCleanup; +const std::string LLViewerRegion::IL_MODE_DEFAULT = "default"; +const std::string LLViewerRegion::IL_MODE_360 = "360"; + typedef std::map CapabilityMap; static void log_capabilities(const CapabilityMap &capmap); @@ -647,7 +650,7 @@ LLViewerRegion::LLViewerRegion(const U64 &handle, mPaused(FALSE), mRegionCacheHitCount(0), mRegionCacheMissCount(0), - mUse360Mode(false) + mInterestListMode(IL_MODE_DEFAULT) { mWidth = region_width_meters; mImpl->mOriginGlobal = from_region_handle(handle); @@ -3286,7 +3289,7 @@ void LLViewerRegion::setCapabilitiesReceived(bool received) mCapabilitiesReceivedSignal.disconnect_all_slots(); // Set the region to the desired interest list mode - setInterestList360Mode(gAgent.getInterestList360Mode()); + setInterestListMode(gAgent.getInterestListMode()); } } @@ -3339,22 +3342,21 @@ bool LLViewerRegion::requestGetCapability(const std::string &capName, httpCallba } -void LLViewerRegion::setInterestList360Mode(bool use_360_mode) +void LLViewerRegion::setInterestListMode(const std::string &new_mode) { - if (use_360_mode != mUse360Mode) + if (new_mode != mInterestListMode) { - LLSD body; - mUse360Mode = use_360_mode; + mInterestListMode = new_mode; - if (mUse360Mode) - { - body["mode"] = LLSD::String("360"); - } - else - { - body["mode"] = LLSD::String("default"); - } + if (mInterestListMode != std::string(IL_MODE_DEFAULT) && mInterestListMode != std::string(IL_MODE_360)) + { + LL_WARNS("360Capture") << "Region " << getRegionID() << " setInterestListMode() invalid interest list mode: " + << mInterestListMode << ", setting to default" << LL_ENDL; + mInterestListMode = IL_MODE_DEFAULT; + } + LLSD body; + body["mode"] = mInterestListMode; if (requestPostCapability("InterestList", body, [](const LLSD &response) { LL_DEBUGS("360Capture") << "InterestList capability responded: \n" @@ -3375,13 +3377,13 @@ void LLViewerRegion::setInterestList360Mode(bool use_360_mode) else { LL_DEBUGS("360Capture") << "Region " << getRegionID() << "No change, skipping Interest List mode POST to " - << (use_360_mode ? "360" : "default") << " mode" << LL_ENDL; + << new_mode << " mode" << LL_ENDL; } } -LLSpatialPartition* LLViewerRegion::getSpatialPartition(U32 type) +LLSpatialPartition *LLViewerRegion::getSpatialPartition(U32 type) { if (type < mImpl->mObjectPartition.size() && type < PARTITION_VO_CACHE) { -- cgit v1.2.3 From 2dca661b6a7b40c1dcf94a08f5304df277542597 Mon Sep 17 00:00:00 2001 From: simon Date: Mon, 15 May 2023 23:24:00 +0100 Subject: SL-19676 - more IL control, added Reset Interest List Debug menu command --- indra/newview/llviewerregion.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'indra/newview/llviewerregion.cpp') diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 9c2dc3c761..5254d766a8 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -3341,6 +3341,21 @@ bool LLViewerRegion::requestGetCapability(const std::string &capName, httpCallba return true; } +bool LLViewerRegion::requestDelCapability(const std::string &capName, httpCallback_t cbSuccess, httpCallback_t cbFailure) +{ + std::string url; + + url = getCapability(capName); + + if (url.empty()) + { + LL_WARNS("Region") << "Could not retrieve region " << getRegionID() << " DEL capability \"" << capName << "\"" << LL_ENDL; + return false; + } + + LLCoreHttpUtil::HttpCoroutineAdapter::callbackHttpDel(url, gAgent.getAgentPolicy(), cbSuccess, cbFailure); + return true; +} void LLViewerRegion::setInterestListMode(const std::string &new_mode) { @@ -3382,6 +3397,20 @@ void LLViewerRegion::setInterestListMode(const std::string &new_mode) } +void LLViewerRegion::resetInterestList() +{ + if (requestDelCapability("InterestList", [](const LLSD &response) { + LL_DEBUGS("360Capture") << "InterestList capability DEL responded: \n" << ll_pretty_print_sd(response) << LL_ENDL; + })) + { + LL_DEBUGS("360Capture") << "Region " << getRegionID() << " Successfully reset InterestList capability" << LL_ENDL; + } + else + { + LL_WARNS("360Capture") << "Region " << getRegionID() << " Unable to DEL InterestList capability request" << LL_ENDL; + } +} + LLSpatialPartition *LLViewerRegion::getSpatialPartition(U32 type) { -- cgit v1.2.3