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/llviewermenu.cpp | 31 ++++++++++++++++++++-- indra/newview/llviewerregion.cpp | 29 ++++++++++++++++++++ indra/newview/llviewerregion.h | 3 +++ indra/newview/skins/default/xui/en/menu_viewer.xml | 27 +++++++++++-------- 4 files changed, 77 insertions(+), 13 deletions(-) (limited to 'indra/newview') 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(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" - - - - - @@ -3503,7 +3493,22 @@ function="World.EnvPreset" - + + + + + + + +