summaryrefslogtreecommitdiff
path: root/indra/newview/llscripteditorws.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llscripteditorws.cpp')
-rw-r--r--indra/newview/llscripteditorws.cpp28
1 files changed, 23 insertions, 5 deletions
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<bool> LLScriptEditorWSServer::sEnableScriptEditorWS(gSavedSettings, "ExternalWebsocketSyncEnable", false);
-LLCachedControl<bool> LLScriptEditorWSServer::sTightIntegration(gSavedSettings, "ExternalEditorTightIntegration", false);
+ LLCachedControl<bool>* OPT_ENABLESCRIPTEDITORWS(nullptr);
+ LLCachedControl<bool>* 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<bool>(gSavedSettings, "ExternalWebsocketSyncEnable", false);
+ }
+ return *OPT_ENABLESCRIPTEDITORWS;
+}
+
+bool LLScriptEditorWSServer::isTightIntegration()
+{
+ if (!OPT_TIGHTINTEGRATION)
+ {
+ OPT_TIGHTINTEGRATION = new LLCachedControl<bool>(gSavedSettings, "ExternalWebsocketSyncTightIntegration", false);
+ }
+ return *OPT_TIGHTINTEGRATION;
+}
+
LLScriptEditorWSServer::ptr_t LLScriptEditorWSServer::ensureServerRunning()
{
if (!LLScriptEditorWSServer::isEnabled())