From 285e0a41b0ad676a7015a237dd828eb686da1c14 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Thu, 23 Jul 2026 14:17:48 -0700 Subject: Was not correctly parsing metadata from task inventory API, fix how I was using the cache control. --- indra/newview/llscripteditorws.cpp | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) (limited to 'indra/newview/llscripteditorws.cpp') diff --git a/indra/newview/llscripteditorws.cpp b/indra/newview/llscripteditorws.cpp index e0bf9b0b61..555affe9a1 100644 --- a/indra/newview/llscripteditorws.cpp +++ b/indra/newview/llscripteditorws.cpp @@ -156,11 +156,11 @@ namespace } return std::string(s); } -} -LLCachedControl LLScriptEditorWSServer::sEnableScriptEditorWS(gSavedSettings, "ExternalWebsocketSyncEnable", false); -LLCachedControl LLScriptEditorWSServer::sTightIntegration(gSavedSettings, "ExternalEditorTightIntegration", false); + LLCachedControl* OPT_ENABLESCRIPTEDITORWS(nullptr); + LLCachedControl* OPT_TIGHTINTEGRATION(nullptr); +} class LLPublishedPrimListener : public LLVOInventoryListener { @@ -203,8 +203,8 @@ private: }; //======================================================================== -LLScriptEditorWSServer::LLScriptEditorWSServer(const std::string& name, U16 port, bool local_only) - : LLJSONRPCServer(name, port, local_only) +LLScriptEditorWSServer::LLScriptEditorWSServer(const std::string& name, U16 port, bool local_only): + LLJSONRPCServer(name, port, local_only) { LL_INFOS("ScriptEditorWS") << "Created JSON-RPC script editor server: " << name << " on port " << port << LL_ENDL; @@ -221,6 +221,24 @@ LLScriptEditorWSServer::ptr_t LLScriptEditorWSServer::getServer() wsmgr.findServerByName(LLScriptEditorWSServer::DEFAULT_SERVER_NAME)); } +bool LLScriptEditorWSServer::isEnabled() +{ + if (!OPT_ENABLESCRIPTEDITORWS) + { + OPT_ENABLESCRIPTEDITORWS = new LLCachedControl(gSavedSettings, "ExternalWebsocketSyncEnable", false); + } + return *OPT_ENABLESCRIPTEDITORWS; +} + +bool LLScriptEditorWSServer::isTightIntegration() +{ + if (!OPT_TIGHTINTEGRATION) + { + OPT_TIGHTINTEGRATION = new LLCachedControl(gSavedSettings, "ExternalWebsocketSyncTightIntegration", false); + } + return *OPT_TIGHTINTEGRATION; +} + LLScriptEditorWSServer::ptr_t LLScriptEditorWSServer::ensureServerRunning() { if (!LLScriptEditorWSServer::isEnabled()) -- cgit v1.3 From 5101e69367293d6d47bdb7383eabe7993e055050 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Thu, 23 Jul 2026 19:33:32 -0700 Subject: Make the cached controls static to the function. --- indra/newview/llscripteditorws.cpp | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'indra/newview/llscripteditorws.cpp') diff --git a/indra/newview/llscripteditorws.cpp b/indra/newview/llscripteditorws.cpp index 555affe9a1..17ebd03ed2 100644 --- a/indra/newview/llscripteditorws.cpp +++ b/indra/newview/llscripteditorws.cpp @@ -157,9 +157,6 @@ namespace return std::string(s); } - LLCachedControl* OPT_ENABLESCRIPTEDITORWS(nullptr); - LLCachedControl* OPT_TIGHTINTEGRATION(nullptr); - } class LLPublishedPrimListener : public LLVOInventoryListener @@ -223,20 +220,14 @@ LLScriptEditorWSServer::ptr_t LLScriptEditorWSServer::getServer() bool LLScriptEditorWSServer::isEnabled() { - if (!OPT_ENABLESCRIPTEDITORWS) - { - OPT_ENABLESCRIPTEDITORWS = new LLCachedControl(gSavedSettings, "ExternalWebsocketSyncEnable", false); - } - return *OPT_ENABLESCRIPTEDITORWS; + static LLCachedControl OPT_ENABLESCRIPTEDITORWS(gSavedSettings, "ExternalWebsocketSyncEnable", false); + return OPT_ENABLESCRIPTEDITORWS; } bool LLScriptEditorWSServer::isTightIntegration() { - if (!OPT_TIGHTINTEGRATION) - { - OPT_TIGHTINTEGRATION = new LLCachedControl(gSavedSettings, "ExternalWebsocketSyncTightIntegration", false); - } - return *OPT_TIGHTINTEGRATION; + static LLCachedControl OPT_TIGHTINTEGRATION(gSavedSettings, "ExternalWebsocketSyncTightIntegration", false); + return OPT_TIGHTINTEGRATION; } LLScriptEditorWSServer::ptr_t LLScriptEditorWSServer::ensureServerRunning() -- cgit v1.3