summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorsimon <simon@lindenlab.com>2023-05-15 23:24:00 +0100
committersimon <simon@lindenlab.com>2023-05-15 23:24:00 +0100
commit2dca661b6a7b40c1dcf94a08f5304df277542597 (patch)
treed2fb6ebed3a83b351746ce74c21943f1881714ca /indra
parent74687f270545ededb77f29a7409f64303dcb2e2d (diff)
SL-19676 - more IL control, added Reset Interest List Debug menu command
Diffstat (limited to 'indra')
-rw-r--r--indra/llmessage/llcorehttputil.cpp42
-rw-r--r--indra/llmessage/llcorehttputil.h4
-rw-r--r--indra/newview/llviewermenu.cpp31
-rwxr-xr-xindra/newview/llviewerregion.cpp29
-rw-r--r--indra/newview/llviewerregion.h3
-rw-r--r--indra/newview/skins/default/xui/en/menu_viewer.xml27
6 files changed, 123 insertions, 13 deletions
diff --git a/indra/llmessage/llcorehttputil.cpp b/indra/llmessage/llcorehttputil.cpp
index c8c9280029..6b9ce54c92 100644
--- a/indra/llmessage/llcorehttputil.cpp
+++ b/indra/llmessage/llcorehttputil.cpp
@@ -1336,6 +1336,48 @@ void HttpCoroutineAdapter::trivialPostCoro(std::string url, LLCore::HttpRequest:
}
+/*static*/
+void HttpCoroutineAdapter::callbackHttpDel(const std::string &url, LLCore::HttpRequest::policy_t policyId, completionCallback_t success,
+ completionCallback_t failure)
+{
+ LLCoros::instance().launch("HttpCoroutineAdapter::genericDelCoro",
+ boost::bind(&HttpCoroutineAdapter::trivialDelCoro, url, policyId, success, failure));
+}
+
+/*static*/
+void HttpCoroutineAdapter::trivialDelCoro(std::string url, LLCore::HttpRequest::policy_t policyId, completionCallback_t success,
+ completionCallback_t failure)
+{
+ LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("genericDelCoro", policyId));
+ LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest);
+ LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions);
+
+ httpOpts->setWantHeaders(true);
+
+ LL_INFOS("HttpCoroutineAdapter", "genericDelCoro") << "Generic DEL for " << url << LL_ENDL;
+
+ LLSD result = httpAdapter->deleteAndSuspend(httpRequest, url, httpOpts);
+
+ LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
+ LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
+
+ if (!status)
+ {
+ if (failure)
+ {
+ failure(httpResults);
+ }
+ }
+ else
+ {
+ if (success)
+ {
+ success(result);
+ }
+ }
+}
+
+
} // end namespace LLCoreHttpUtil
diff --git a/indra/llmessage/llcorehttputil.h b/indra/llmessage/llcorehttputil.h
index 6f0b865f83..8df1425f2a 100644
--- a/indra/llmessage/llcorehttputil.h
+++ b/indra/llmessage/llcorehttputil.h
@@ -608,6 +608,9 @@ public:
callbackHttpPost(url, LLCore::HttpRequest::DEFAULT_POLICY_ID, postData, success, failure);
}
+ static void callbackHttpDel(const std::string &url, LLCore::HttpRequest::policy_t policyId, completionCallback_t success = NULL,
+ completionCallback_t failure = NULL);
+
/// Generic Get and post routines for HTTP via coroutines.
/// These static methods do all required setup for the GET or POST operation.
/// When the operation completes successfully they will put the success message in the log at INFO level,
@@ -669,6 +672,7 @@ private:
static void trivialGetCoro(std::string url, LLCore::HttpRequest::policy_t policyId, completionCallback_t success, completionCallback_t failure);
static void trivialPostCoro(std::string url, LLCore::HttpRequest::policy_t policyId, LLSD postData, completionCallback_t success, completionCallback_t failure);
+ static void trivialDelCoro(std::string url, LLCore::HttpRequest::policy_t policyId, completionCallback_t success, completionCallback_t failure);
void checkDefaultHeaders(LLCore::HttpHeaders::ptr_t &headers);
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index fe6676759d..c762e796aa 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -122,6 +122,7 @@
#include "llviewerstatsrecorder.h"
#include "llvoavatarself.h"
#include "llvoicevivox.h"
+#include "llworld.h"
#include "llworldmap.h"
#include "pipeline.h"
#include "llviewerjoystick.h"
@@ -333,6 +334,7 @@ void handle_debug_avatar_textures(void*);
void handle_grab_baked_texture(void*);
BOOL enable_grab_baked_texture(void*);
void handle_dump_region_object_cache(void*);
+void handle_reset_interest_lists(void *);
BOOL enable_save_into_task_inventory(void*);
@@ -1346,6 +1348,14 @@ class LLAdvancedCheckStatsRecorder : public view_listener_t
}
};
+class LLAdvancedResetInterestLists : public view_listener_t
+{
+ bool handleEvent(const LLSD &userdata)
+ { // Reset all region interest lists
+ handle_reset_interest_lists(NULL);
+ return true;
+ }
+};
class LLAdvancedBuyCurrencyTest : public view_listener_t
@@ -3892,6 +3902,22 @@ void handle_dump_region_object_cache(void*)
}
}
+void handle_reset_interest_lists(void *)
+{
+ // Check all regions and reset their interest list
+ for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin();
+ iter != LLWorld::getInstance()->getRegionList().end();
+ ++iter)
+ {
+ LLViewerRegion *regionp = *iter;
+ if (regionp && regionp->isAlive() && regionp->capabilitiesReceived())
+ {
+ regionp->resetInterestList();
+ }
+ }
+}
+
+
void handle_dump_focus()
{
LLUICtrl *ctrl = dynamic_cast<LLUICtrl*>(gFocusMgr.getKeyboardFocus());
@@ -9452,10 +9478,11 @@ void initialize_menus()
// Advanced > World
view_listener_t::addMenu(new LLAdvancedDumpScriptedCamera(), "Advanced.DumpScriptedCamera");
view_listener_t::addMenu(new LLAdvancedDumpRegionObjectCache(), "Advanced.DumpRegionObjectCache");
- view_listener_t::addMenu(new LLAdvancedToggleInterestList360Mode(), "Advanced.ToggleInterestList360Mode");
- view_listener_t::addMenu(new LLAdvancedCheckInterestList360Mode(), "Advanced.CheckInterestList360Mode");
view_listener_t::addMenu(new LLAdvancedToggleStatsRecorder(), "Advanced.ToggleStatsRecorder");
view_listener_t::addMenu(new LLAdvancedCheckStatsRecorder(), "Advanced.CheckStatsRecorder");
+ view_listener_t::addMenu(new LLAdvancedToggleInterestList360Mode(), "Advanced.ToggleInterestList360Mode");
+ view_listener_t::addMenu(new LLAdvancedCheckInterestList360Mode(), "Advanced.CheckInterestList360Mode");
+ view_listener_t::addMenu(new LLAdvancedResetInterestLists(), "Advanced.ResetInterestLists");
// Advanced > UI
commit.add("Advanced.WebBrowserTest", boost::bind(&handle_web_browser_test, _2)); // sigh! this one opens the MEDIA browser
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)
{
diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h
index 6308058f63..6956e9eb08 100644
--- a/indra/newview/llviewerregion.h
+++ b/indra/newview/llviewerregion.h
@@ -287,6 +287,7 @@ public:
httpCallback_t cbSuccess = NULL,
httpCallback_t cbFailure = NULL);
bool requestGetCapability(const std::string &capName, httpCallback_t cbSuccess = NULL, httpCallback_t cbFailure = NULL);
+ bool requestDelCapability(const std::string &capName, httpCallback_t cbSuccess = NULL, httpCallback_t cbFailure = NULL);
/// implements LLCapabilityProvider
/*virtual*/ const LLHost& getHost() const;
@@ -490,6 +491,8 @@ public:
void setInterestListMode(const std::string & new_mode);
const std::string & getInterestListMode() const { return mInterestListMode; }
+ void resetInterestList();
+
static const std::string IL_MODE_DEFAULT;
static const std::string IL_MODE_360;
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index 07471ed5bb..51ac3d17ab 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -3485,16 +3485,6 @@ function="World.EnvPreset"
<menu_item_call.on_click
function="Advanced.DumpRegionObjectCache" />
</menu_item_call>
-
- <menu_item_check
- label="Interest List 360 Mode"
- name="Interest List: 360 Mode"
- shortcut="alt|shift|I">
- <menu_item_check.on_check
- function="Advanced.CheckInterestList360Mode" />
- <menu_item_check.on_click
- function="Advanced.ToggleInterestList360Mode" />
- </menu_item_check>
<menu_item_check
label="Record Stats to File"
name="Stats Recorder File">
@@ -3503,7 +3493,22 @@ function="World.EnvPreset"
<menu_item_check.on_click
function="Advanced.ToggleStatsRecorder" />
</menu_item_check>
- </menu>
+ <menu_item_check
+ label="Interest Lists 360 Mode"
+ name="Interest List: 360 Mode"
+ shortcut="alt|shift|I">
+ <menu_item_check.on_check
+ function="Advanced.CheckInterestList360Mode" />
+ <menu_item_check.on_click
+ function="Advanced.ToggleInterestList360Mode" />
+ </menu_item_check>
+ <menu_item_call
+ label="Reset Interest Lists"
+ name="Reset Interest Lists">
+ <menu_item_call.on_click
+ function="Advanced.ResetInterestLists" />
+ </menu_item_call>
+ </menu>
<menu
create_jump_keys="true"
label="UI"