summaryrefslogtreecommitdiff
path: root/indra/newview/llpreviewscript.cpp
diff options
context:
space:
mode:
authorRider Linden <rider@lindenlab.com>2025-10-01 15:30:40 -0700
committerRider Linden <rider@lindenlab.com>2025-10-07 09:19:42 -0700
commit339e7ccae99aab39a01aef052719ab9b3432919b (patch)
treef9298aae9ae88afa9afb885899c2bfa26af64b11 /indra/newview/llpreviewscript.cpp
parent672bdc8915bc5f7f305b6b51751e2c0578ef6032 (diff)
Added scripting options floater for config, switched to using config values. Added "runtime.debug" and "runtime.error" notifications.
Diffstat (limited to 'indra/newview/llpreviewscript.cpp')
-rw-r--r--indra/newview/llpreviewscript.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp
index 9aac1742d5..bd1f68da33 100644
--- a/indra/newview/llpreviewscript.cpp
+++ b/indra/newview/llpreviewscript.cpp
@@ -1671,27 +1671,26 @@ bool LLScriptEdContainer::handleKeyHere(KEY key, MASK mask)
void LLScriptEdContainer::startWebsocketServer()
{
- // if the user has enabled websockets, create the server to talk to the external editor
+ if (gSavedSettings.getBOOL("ExternalWebsocketSyncEnable"))
{
- // TODO: Get the name, port, and locality from settings
- std::string server_name(LLScriptEditorWSServer::DEFAULT_SERVER_NAME);
- U16 server_port(LLScriptEditorWSServer::DEFAULT_SERVER_PORT);
- bool server_localhost(true);
-
// Attempt to find an existing server
LLWebsocketMgr& wsmgr = LLWebsocketMgr::instance();
- LLScriptEditorWSServer::ptr_t server = std::static_pointer_cast<LLScriptEditorWSServer>(wsmgr.findServerByName(server_name));
+ LLScriptEditorWSServer::ptr_t server =
+ std::static_pointer_cast<LLScriptEditorWSServer>(
+ wsmgr.findServerByName(LLScriptEditorWSServer::DEFAULT_SERVER_NAME));
if (!server)
{ // We couldn't find one, so create it
- server = std::make_shared<LLScriptEditorWSServer>(server_name, server_port, server_localhost);
+ U16 server_port = static_cast<U16>(gSavedSettings.getS32("ExternalWebsocketSyncPort"));
+ bool server_localhost = gSavedSettings.getBOOL("ExternalWebsocketSyncLocal");
+ server = std::make_shared<LLScriptEditorWSServer>(LLScriptEditorWSServer::DEFAULT_SERVER_NAME, server_port, server_localhost);
wsmgr.addServer(server);
}
bool is_running = server->isRunning();
if (!is_running)
{ // Server isn't running, so start it
- is_running = wsmgr.startServer(server_name);
+ is_running = wsmgr.startServer(LLScriptEditorWSServer::DEFAULT_SERVER_NAME);
}
if (!is_running && !server->isRunning())
@@ -1701,7 +1700,7 @@ void LLScriptEdContainer::startWebsocketServer()
}
std::string script_id_hash_str(getUniqueHash());
- server->subscribeScriptEditor(getHandle(), script_id_hash_str);
+ server->subscribeScriptEditor(mObjectUUID, mItemUUID, mScriptEd->mScriptName, getHandle(), script_id_hash_str);
mWebSocketServer = server;
}
}