summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerregion.cpp
diff options
context:
space:
mode:
authorsimon <simon@lindenlab.com>2023-05-11 01:16:42 +0100
committersimon <simon@lindenlab.com>2023-05-11 01:16:42 +0100
commit4173cae02165e36d96638761f29bd6d00ac24ddc (patch)
tree4353f107beacd7e8110e5de6ba8467239d513e45 /indra/newview/llviewerregion.cpp
parenta9c64940cbac27328b6304f9d63cdf4265fae2f7 (diff)
sl-19676 - more loading stats and 360 Interest List mode work
Diffstat (limited to 'indra/newview/llviewerregion.cpp')
-rwxr-xr-xindra/newview/llviewerregion.cpp82
1 files changed, 81 insertions, 1 deletions
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)