diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index c68131402b5..ce934f1a21a 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -1,6 +1,7 @@ # Replace tabs with spaces 1b68f71348ecf3983b76b40d7940da8377f049b7 33418a77b716e122da9778869cdbabe97c83ff37 +6b974724826a038b0db794460b322eb4921da735 # Trim trailing whitespace a0b3021bdcf76859054fda8e30abb3ed47749e83 8444cd9562a6a7b755fcb075864e205122354192 diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml new file mode 100644 index 00000000000..3e3e1df3e2a --- /dev/null +++ b/.github/dependabot.yaml @@ -0,0 +1,7 @@ +version: 2 +updates: + + - package-ecosystem: github-actions + directory: / + schedule: + interval: monthly diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 8f89db0923d..4c948e55864 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -1,6 +1,7 @@ name: Build on: + workflow_dispatch: pull_request: push: branches: ["main", "release/*", "project/*"] @@ -85,7 +86,7 @@ jobs: variants: ${{ matrix.configuration }} steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: ref: ${{ github.event.pull_request.head.sha || github.sha }} @@ -94,14 +95,14 @@ jobs: with: python-version: "3.11" - name: Checkout build variables - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: repository: secondlife/build-variables ref: master path: .build-variables - name: Checkout master-message-template - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: repository: secondlife/master-message-template path: .master-message-template @@ -309,7 +310,7 @@ jobs: steps: - name: Sign and package Windows viewer if: env.AZURE_KEY_VAULT_URI && env.AZURE_CERT_NAME && env.AZURE_CLIENT_ID && env.AZURE_CLIENT_SECRET && env.AZURE_TENANT_ID - uses: secondlife/viewer-build-util/sign-pkg-windows@v2 + uses: secondlife/viewer-build-util/sign-pkg-windows@v2.0.4 with: vault_uri: "${{ env.AZURE_KEY_VAULT_URI }}" cert_name: "${{ env.AZURE_CERT_NAME }}" diff --git a/.github/workflows/pre-commit.yaml b/.github/workflows/pre-commit.yaml index d626eef38d7..726e1cd889b 100644 --- a/.github/workflows/pre-commit.yaml +++ b/.github/workflows/pre-commit.yaml @@ -11,8 +11,8 @@ jobs: pre-commit: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - uses: actions/setup-python@v4 with: python-version: 3.x - - uses: pre-commit/action@v3.0.0 + - uses: pre-commit/action@v3.0.1 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8baac5a81de..d1dcc939769 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,14 +7,14 @@ repos: - id: no-trigraphs - id: copyright - id: end-of-file - files: \.(cpp|c|h|py|glsl|cmake|txt)$ + files: \.(cpp|c|m|mm|h|py|glsl|cmake|txt)$ exclude: language.txt - id: indent-with-spaces - files: \.(cpp|c|h|inl|py|glsl|cmake)$ + files: \.(cpp|c|m|mm|h|inl|py|glsl|cmake)$ - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v5.0.0 + rev: v6.0.0 hooks: - id: check-xml - id: mixed-line-ending - id: trailing-whitespace - files: \.(cpp|c|h|inl|py|glsl|cmake|yaml|sh)$ + files: \.(cpp|c|m|mm|h|inl|py|glsl|cmake|yaml|sh)$ diff --git a/autobuild.xml b/autobuild.xml index 58c8d49c7cc..51288ed7e34 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -1460,58 +1460,6 @@ name llphysicsextensions_source - llphysicsextensions_stub - - platforms - - darwin64 - - archive - - hash - f290b000b31f9e36f2489946cbc99f5e - url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/59995/563653/llphysicsextensions_stub-1.0.542456-darwin64-542456.tar.bz2 - - name - darwin64 - - linux64 - - archive - - hash - 711f4ec769e4b5f59ba25ee43c11bcbc - url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/4724/14846/llphysicsextensions_stub-1.0.504712-linux64-504712.tar.bz2 - - name - linux64 - - windows64 - - archive - - hash - 2e5f1f7046a49d8b0bc295aa878116bc - url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/60043/564063/llphysicsextensions_stub-1.0.542456-windows-542456.tar.bz2 - - name - windows64 - - - license - internal - license_file - LICENSES/llphysicsextensions.txt - copyright - Copyright (c) 2010, Linden Research, Inc. - version - 1.0.542456 - name - llphysicsextensions_stub - llphysicsextensions_tpv platforms @@ -2934,6 +2882,78 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors description Discord Social SDK + vhacd + + platforms + + common + + archive + + hash + 140d8fc952a10edb5f2d72ab405336019ef32cadfa64f0cfce76c9de4bc6268cbc87cc8cd89d3417fb78b531d441701afc8d016bafe4bd275df2707f7daf1387 + hash_algorithm + blake2b + url + https://github.com/AlchemyViewer/3p-vhacd/releases/download/v4.1.0-r2/vhacd-4.1.0-r2-common-18166921729.tar.zst + + name + common + + + license + BSD + license_file + LICENSES/vhacd.txt + copyright + Copyright (c) 2011, Khaled Mamou + version + 4.1.0-r2 + name + vhacd + description + Voxelized Hierarchical Approximate Convex Decomposition + + websocketpp + + platforms + + common + + archive + + hash + 9b02492bbc5effd8afca1bb7c95110d43a8f75da + hash_algorithm + sha1 + url + https://github.com/secondlife/3p-websocketpp/releases/download/v0.8.2/websocketpp-0.8.2.17134644226-common-17134644226.tar.zst + + name + common + + + license + websocketpp + license_file + LICENSES/websocketpp.txt + copyright + Copyright (c) 2014, Peter Thorson + version + 0.8.2.17134644226 + name + websocketpp + vcs_branch + refs/tags/v0.8.2 + vcs_revision + bdcf1453101976fc4dc26a62c87bc98c12e9c6dc + vcs_url + git://github.com/secondlife/3p-websocketpp.git + canonical_repo + https://github.com/secondlife/3p-websocketpp + description + WebSocket++ is a C++ header only library for interacting with WebSocket servers and clients. + package_description diff --git a/build.sh b/build.sh index 694b03c42ee..ba900658276 100755 --- a/build.sh +++ b/build.sh @@ -70,7 +70,7 @@ installer_Darwin() { local package_name="$1" local package_dir="$(build_dir_Darwin)/newview/" - local pattern=".*$(viewer_channel_suffix ${package_name})_[0-9]+_[0-9]+_[0-9]+_[0-9]+_x86_64\\.dmg\$" + local pattern=".*$(viewer_channel_suffix ${package_name})_[0-9]+_[0-9]+_[0-9]+_[0-9]+_universal\\.dmg\$" # since the additional packages are built after the base package, # sorting oldest first ensures that the unqualified package is returned # even if someone makes a qualified name that duplicates the last word of the base name diff --git a/doc/external-editor-json-rpc.md b/doc/external-editor-json-rpc.md new file mode 100644 index 00000000000..b8c7fa69e32 --- /dev/null +++ b/doc/external-editor-json-rpc.md @@ -0,0 +1,464 @@ +# Viewer to External Editor JSON-RPC
Message Interfaces Documentation + +This document describes all the message interfaces defined in for WebSocket communication between the Second Life viewer and an external editor such as a VSCode extension. + +## Table of Contents + +- [Usage Flow](#usage-flow) +- [JSON-RPC Method Summary](#json-rpc-method-summary) +- [Session Management Interfaces](#session-management-interfaces) + - [SessionHandshake](#sessionhandshake) + - [SessionHandshakeResponse](#sessionhandshakeresponse) + - [Session OK](#session-ok) + - [SessionDisconnect](#sessiondisconnect) +- [Language and Syntax Interfaces](#language-and-syntax-interfaces) + - [SyntaxChange](#syntaxchange) + - [Language Syntax ID Request](#language-syntax-id-request) + - [Language Syntax Request](#language-syntax-request) +- [Script Subscription Interfaces](#script-subscription-interfaces) + - [ScriptSubscribe](#scriptsubscribe) + - [ScriptSubscribeResponse](#scriptsubscriberesponse) + - [ScriptUnsubscribe](#scriptunsubscribe) +- [Compilation Interfaces](#compilation-interfaces) + - [CompilationError](#compilationerror) + - [CompilationResult](#compilationresult) +- [Runtime Event Interfaces](#runtime-event-interfaces) + - [RuntimeDebug](#runtimedebug) + - [RuntimeError](#runtimeerror) +- [Handler and Configuration Interfaces](#handler-and-configuration-interfaces) + - [WebSocketHandlers](#websockethandlers) + - [ClientInfo](#clientinfo) + +## Usage Flow + +1. **Connection Establishment:** + + - Viewer sends `session.handshake` notification with `SessionHandshake` data + - Extension responds with `SessionHandshakeResponse` + - Viewer confirms with `session.ok` notification + +2. **Language Information Exchange:** + + - Extension makes `language.syntax.id` call to get current syntax version + - Extension makes `language.syntax` calls with different `kind` parameters to get specific language data + - Viewer responds with `LanguageInfo` data containing the requested information + +3. **Script Subscription Management:** + + - Extension makes `script.subscribe` call with `ScriptSubscribe` data to request live synchronization for a script + - Viewer responds with `ScriptSubscribeResponse` indicating success or failure + - When subscription needs to be terminated, viewer sends `script.unsubscribe` notification with `ScriptUnsubscribe` data + - Extension handles unsubscription by cleaning up local script tracking + +4. **Runtime Events:** + + - Viewer sends `language.syntax.change` notification with `SyntaxChange` when language changes + - Viewer sends `script.compiled` notification with `CompilationResult` after script compilation + - Viewer sends `runtime.debug` notification with `RuntimeDebug` for debug messages during script execution + - Viewer sends `runtime.error` notification with `RuntimeError` when runtime errors occur + +5. **Connection Termination:** + - Either side can send `session.disconnect` notification with `SessionDisconnect` data + - Connection is closed gracefully + +## JSON-RPC Method Summary + +| Method | Direction | Type | Interface/Parameters | +| ------------------------------- | ------------------ | ------------ | -------------------------- | +| `session.handshake` | Viewer → Extension | Notification | `SessionHandshake` | +| `session.handshake` (response) | Extension → Viewer | Response | `SessionHandshakeResponse` | +| `session.ok` | Viewer → Extension | Notification | _(no interface)_ | +| `session.disconnect` | Bidirectional | Notification | `SessionDisconnect` | +| `script.subscribe` | Extension → Viewer | Call | `ScriptSubscribe` | +| `script.subscribe` (response) | Viewer → Extension | Response | `ScriptSubscribeResponse` | +| `script.unsubscribe` | Viewer → Extension | Notification | `ScriptUnsubscribe` | +| `language.syntax.id` | Extension → Viewer | Call | _(no parameters)_ | +| `language.syntax.id` (response) | Viewer → Extension | Response | `{ id: string }` | +| `language.syntax` | Extension → Viewer | Call | `{ kind: string }` | +| `language.syntax` (response) | Viewer → Extension | Response | `LanguageInfo` | +| `language.syntax.change` | Viewer → Extension | Notification | `SyntaxChange` | +| `script.compiled` | Viewer → Extension | Notification | `CompilationResult` | +| `runtime.debug` | Viewer → Extension | Notification | `RuntimeDebug` | +| `runtime.error` | Viewer → Extension | Notification | `RuntimeError` | + +## Session Management Interfaces + +### SessionHandshake + +**JSON-RPC Method:** `session.handshake` (notification from viewer) + +The initial handshake message sent by the viewer to establish a connection. + +```typescript +interface SessionHandshake { + server_version: "1.0.0"; + protocol_version: "1.0"; + viewer_name: string; + viewer_version: string; + agent_id: string; + agent_name: string; + challenge?: string; + languages: string[]; + syntax_id: string; + features: { [feature: string]: boolean }; +} +``` + +**Fields:** + +- `server_version`: Fixed version "1.0.0" indicating the server API version +- `protocol_version`: Fixed version "1.0" for the communication protocol +- `viewer_name`: Name of the Second Life viewer application +- `viewer_version`: Version string of the viewer +- `agent_id`: Unique identifier for the user/agent +- `agent_name`: Human-readable name of the agent +- `challenge` (optional): Security challenge string for authentication +- `languages`: Array of supported scripting languages (e.g., ["lsl", "luau"]) +- `syntax_id`: Current active syntax/language identifier +- `features`: Dictionary of feature flags indicating viewer capabilities + +### SessionHandshakeResponse + +**JSON-RPC Method:** Response to `session.handshake` + +The response sent by the VS Code extension to complete the handshake. + +```typescript +interface SessionHandshakeResponse { + client_name: string; + client_version: "1.0"; + protocol_version: string; + challenge_response?: string; + languages: string[]; + features: { [feature: string]: boolean }; +} +``` + +**Fields:** + +- `client_name`: Name of the client (VS Code extension) +- `client_version`: Fixed version "1.0" of the client +- `protocol_version`: Protocol version the client supports +- `challenge_response` (optional): Response to the security challenge if provided +- `languages`: Array of languages supported by the client +- `features`: Dictionary of features supported by the client + +### Session OK + +**JSON-RPC Method:** `session.ok` (notification from viewer) + +Confirmation notification sent by the viewer after successful handshake completion. This interface has no defined structure as it appears to be a simple confirmation message. + +### SessionDisconnect + +**JSON-RPC Method:** `session.disconnect` (notification, bidirectional) + +Message sent when terminating the connection. + +```typescript +interface SessionDisconnect { + reason: number; + message: string; +} +``` + +**Fields:** + +- `reason`: Numeric code indicating the reason for disconnection +- `message`: Human-readable description of the disconnect reason + +## Language and Syntax Interfaces + +### SyntaxChange + +**JSON-RPC Method:** `language.syntax.change` (notification from viewer) + +Notification sent when the active language syntax changes in the viewer. + +```typescript +interface SyntaxChange { + id: string; +} +``` + +**Fields:** + +- `id`: Identifier for the new syntax/language + +### Language Syntax ID Request + +**JSON-RPC Method:** `language.syntax.id` (call from extension to viewer) + +Requests the current active language syntax identifier from the viewer. This method takes no parameters. + +**Response:** Returns an object with an `id` field containing the current syntax identifier. + +### Language Syntax Request + +**JSON-RPC Method:** `language.syntax` (call from extension to viewer) + +Requests detailed syntax information for a specific language kind. + +**Parameters:** + +```typescript +{ + kind: string; // The type of syntax information requested +} +``` + +**Fields:** + +- `kind`: The type of syntax information to retrieve (e.g., "functions", "constants", "events", "types.luau") + +**Response:** Returns `LanguageInfo` data containing the requested syntax information: + +```typescript +interface LanguageInfo { + id: string; + lslDefs?: { + controls?: any; + types?: any; + constants?: { [name: string]: ConstantDef }; + events?: { [name: string]: FunctionDef }; + functions?: { [name: string]: FunctionDef }; + }; + luaDefs?: { + modules?: { [name: string]: TypeDef }; + classes?: { [name: string]: TypeDef }; + aliases?: { [name: string]: TypeDef }; + functions?: { [name: string]: FunctionDef }; + }; +} +``` + +**Response Fields:** + +- `id`: Version identifier for the language syntax +- `lslDefs` (optional): LSL-specific language definitions containing: + - `controls` (optional): Control flow and language constructs + - `types` (optional): LSL type definitions + - `constants` (optional): Object containing constant definitions keyed by constant name + - `events` (optional): Object containing event definitions keyed by event name + - `functions` (optional): Object containing function definitions keyed by function name +- `luaDefs` (optional): Lua-specific language definitions containing: + - `modules` (optional): Module type definitions keyed by module name + - `classes` (optional): Class type definitions keyed by class name + - `aliases` (optional): Type alias definitions keyed by alias name + - `functions` (optional): Function definitions keyed by function name + +The specific sections returned depend on the `kind` parameter and the active language context. + +## Script Subscription Interfaces + +### ScriptSubscribe + +**JSON-RPC Method:** `script.subscribe` (call from extension to viewer) + +Requests subscription to a script for live synchronization between the editor and viewer. + +```typescript +interface ScriptSubscribe { + script_id: string; + script_name: string; + script_language: string; +} +``` + +**Fields:** + +- `script_id`: Unique identifier for the script to subscribe to +- `script_name`: Display name of the script file +- `script_language`: Programming language of the script (e.g., "lsl", "luau") + +### ScriptSubscribeResponse + +**JSON-RPC Method:** Response to `script.subscribe` + +Response from the viewer indicating whether script subscription was successful. + +```typescript +interface ScriptSubscribeResponse { + script_id: string; + success: boolean; + status: number; + object_id?: string; + object_name?: string; + item_id?: string; + message?: string; +} +``` + +**Fields:** + +- `script_id`: The script identifier that was subscribed to +- `success`: Whether the subscription was successful +- `status`: Numeric status code indicating the result +- `object_id` (optional): The in-world ID of the object containing the script +- `object_name` (optional): The name of the object containing the script. +- `message` (optional): Additional information about the subscription result + +### ScriptUnsubscribe + +**JSON-RPC Method:** `script.unsubscribe` (notification from viewer) + +Notification sent by the viewer when a script subscription should be terminated. + +```typescript +interface ScriptUnsubscribe { + script_id: string; +} +``` + +**Fields:** + +- `script_id`: Unique identifier for the script to unsubscribe from + +## Compilation Interfaces + +### CompilationError + +Individual compilation error record. + +```typescript +interface CompilationError { + row: number; + column: number; + level: "ERROR"; + message: string; +} +``` + +**Fields:** + +- `row`: Line number where the error occurred (0-based or 1-based depending on context) +- `column`: Column position of the error +- `level`: Severity level (currently only "ERROR" is defined) +- `message`: Error description + +### CompilationResult + +**JSON-RPC Method:** `script.compiled` (notification from viewer) + +Result of a compilation operation in the viewer. + +```typescript +interface CompilationResult { + script_id: string; + success: boolean; + running: boolean; + errors?: CompilationError[]; +} +``` + +**Fields:** + +- `script_id`: Unique identifier for the script that was compiled +- `success`: Whether the compilation was successful +- `running`: Whether the compiled script is currently running +- `errors` (optional): Array of compilation errors if any occurred + +## Runtime Event Interfaces + +### RuntimeDebug + +**JSON-RPC Method:** `runtime.debug` (notification from viewer) + +Debug message notification sent by the viewer during script execution. + +```typescript +interface RuntimeDebug { + script_id: string; + object_id: string; + object_name: string; + message: string; +} +``` + +**Fields:** + +- `script_id`: Unique identifier for the script generating the debug message +- `object_id`: Unique identifier for the object containing the script +- `object_name`: Human-readable name of the object +- `message`: The debug message content + +### RuntimeError + +**JSON-RPC Method:** `runtime.error` (notification from viewer) + +Runtime error notification sent by the viewer when a script encounters an error during execution. + +```typescript +interface RuntimeError { + script_id: string; + object_id: string; + object_name: string; + message: string; + error: string; + line: number; + stack?: string[]; +} +``` + +**Fields:** + +- `script_id`: Unique identifier for the script that encountered the error +- `object_id`: Unique identifier for the object containing the script +- `object_name`: Human-readable name of the object +- `message`: Error message description +- `error`: Specific error type or code +- `line`: Line number where the error occurred +- `stack` (optional): Stack trace information if available + +## Handler and Configuration Interfaces + +### WebSocketHandlers + +Event handler interface for WebSocket events. + +```typescript +interface WebSocketHandlers { + onHandshake?: (message: SessionHandshake) => SessionHandshakeResponse; + onHandshakeOk?: () => void; + onDisconnect?: (message: SessionDisconnect) => void; + onSubscribe?: (message: ScriptSubscribe) => ScriptSubscribeResponse; + onUnsubscribe?: (message: ScriptUnsubscribe) => void; + onSyntaxChange?: (message: SyntaxChange) => void; + onConnectionClosed?: () => void; + onCompilationResult?: (message: CompilationResult) => void; + onRuntimeDebug?: (message: RuntimeDebug) => void; + onRuntimeError?: (message: RuntimeError) => void; +} +``` + +**Methods:** + +- `onHandshake`: Handler for initial handshake message, returns handshake response +- `onHandshakeOk`: Handler called when handshake is successfully completed +- `onDisconnect`: Handler for disconnect notifications +- `onSubscribe`: Handler for script subscription requests from viewer, returns subscription response +- `onUnsubscribe`: Handler for script unsubscription notifications from viewer +- `onSyntaxChange`: Handler for syntax change notifications +- `onConnectionClosed`: Handler called when connection is closed +- `onCompilationResult`: Handler for compilation result notifications +- `onRuntimeDebug`: Handler for runtime debug message notifications +- `onRuntimeError`: Handler for runtime error notifications + +### ClientInfo + +Client information used in handshake responses. + +```typescript +interface ClientInfo { + scriptName: string; + scriptId: string; + extension: string; +} +``` + +**Fields:** + +- `scriptName`: Name of the script being edited +- `scriptId`: Unique identifier for the script +- `extension`: File extension or script type + diff --git a/indra/CMakeLists.txt b/indra/CMakeLists.txt index 6504002dd98..8fde58fa43c 100644 --- a/indra/CMakeLists.txt +++ b/indra/CMakeLists.txt @@ -70,6 +70,7 @@ add_subdirectory(${LIBS_OPEN_PREFIX}llinventory) add_subdirectory(${LIBS_OPEN_PREFIX}llmath) add_subdirectory(${LIBS_OPEN_PREFIX}llmeshoptimizer) add_subdirectory(${LIBS_OPEN_PREFIX}llmessage) +add_subdirectory(${LIBS_OPEN_PREFIX}llphysicsextensionsos) add_subdirectory(${LIBS_OPEN_PREFIX}llprimitive) add_subdirectory(${LIBS_OPEN_PREFIX}llrender) add_subdirectory(${LIBS_OPEN_PREFIX}llfilesystem) diff --git a/indra/cmake/APR.cmake b/indra/cmake/APR.cmake index e0807a7d19d..310659686dc 100644 --- a/indra/cmake/APR.cmake +++ b/indra/cmake/APR.cmake @@ -31,3 +31,8 @@ if(DARWIN) endif() target_include_directories(ll::apr SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/apr-1) + +# Fix erroneous check for __attribute__ definition introduced with APR 1.7.5, causing lots of "this declaration may not have extern 'C' linkage" errors in VS +file(READ ${LIBS_PREBUILT_DIR}/include/apr-1/apr.h APR_HEADER_CONTENTS) +string(REPLACE "#if !(defined(__attribute__) || defined(__has_attribute))" "#if !defined(__attribute__)" APR_HEADER_CONTENTS "${APR_HEADER_CONTENTS}") +file(WRITE ${LIBS_PREBUILT_DIR}/include/apr-1/apr.h "${APR_HEADER_CONTENTS}") diff --git a/indra/cmake/CMakeLists.txt b/indra/cmake/CMakeLists.txt index 4608f68f509..270a5c86644 100644 --- a/indra/cmake/CMakeLists.txt +++ b/indra/cmake/CMakeLists.txt @@ -62,10 +62,12 @@ set(cmake_SOURCE_FILES UI.cmake UnixInstall.cmake Variables.cmake + VHACD.cmake ViewerMiscLibs.cmake VisualLeakDetector.cmake LibVLCPlugin.cmake WebRTC.cmake + websocketpp.cmake xxHash.cmake ZLIBNG.cmake ) diff --git a/indra/cmake/LLPhysicsExtensions.cmake b/indra/cmake/LLPhysicsExtensions.cmake index 6112621b5ad..84722b45a7e 100644 --- a/indra/cmake/LLPhysicsExtensions.cmake +++ b/indra/cmake/LLPhysicsExtensions.cmake @@ -29,14 +29,18 @@ if (HAVOK) #target_link_libraries( llphysicsextensions_impl INTERFACE llphysicsextensionsstub) else() target_link_libraries( llphysicsextensions_impl INTERFACE llphysicsextensions) + target_compile_definitions( llphysicsextensions_impl INTERFACE LL_HAVOK=1 ) endif() + target_include_directories( llphysicsextensions_impl INTERFACE ${LIBS_PREBUILT_DIR}/include/llphysicsextensions) elseif (HAVOK_TPV) use_prebuilt_binary(llphysicsextensions_tpv) - target_link_libraries( llphysicsextensions_impl INTERFACE llphysicsextensions_tpv) -else (HAVOK) - use_prebuilt_binary(llphysicsextensions_stub) - set(LLPHYSICSEXTENSIONS_SRC_DIR ${LIBS_PREBUILT_DIR}/llphysicsextensions/stub) - target_link_libraries( llphysicsextensions_impl INTERFACE llphysicsextensionsstub) -endif (HAVOK) - -target_include_directories( llphysicsextensions_impl INTERFACE ${LIBS_PREBUILT_DIR}/include/llphysicsextensions) + if (NOT DARWIN) + if(WINDOWS) + target_link_libraries( llphysicsextensions_impl INTERFACE ${ARCH_PREBUILT_DIRS}/llphysicsextensions_tpv.lib) + elseif(LINUX) + target_link_libraries( llphysicsextensions_impl INTERFACE ${ARCH_PREBUILT_DIRS}/libllphysicsextensions_tpv.a) + endif() + target_compile_definitions( llphysicsextensions_impl INTERFACE LL_HAVOK=1 ) + endif() + target_include_directories( llphysicsextensions_impl INTERFACE ${LIBS_PREBUILT_DIR}/include/llphysicsextensions) +endif () diff --git a/indra/cmake/VHACD.cmake b/indra/cmake/VHACD.cmake new file mode 100644 index 00000000000..9f37f32b2d8 --- /dev/null +++ b/indra/cmake/VHACD.cmake @@ -0,0 +1,9 @@ +# -*- cmake -*- +include(Prebuilt) + +add_library(ll::vhacd INTERFACE IMPORTED) + +use_system_binary(vhacd) +use_prebuilt_binary(vhacd) + +target_include_directories(ll::vhacd SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/vhacd/) diff --git a/indra/cmake/websocketpp.cmake b/indra/cmake/websocketpp.cmake new file mode 100644 index 00000000000..726f0a5e0b4 --- /dev/null +++ b/indra/cmake/websocketpp.cmake @@ -0,0 +1,7 @@ +# -*- cmake -*- +include(Prebuilt) + +add_library( ll::websocketpp INTERFACE IMPORTED ) + +use_system_binary( websocketpp ) +use_prebuilt_binary(websocketpp) diff --git a/indra/llappearance/llpolymesh.cpp b/indra/llappearance/llpolymesh.cpp index 719381b4fce..d5323e0b846 100644 --- a/indra/llappearance/llpolymesh.cpp +++ b/indra/llappearance/llpolymesh.cpp @@ -283,6 +283,7 @@ bool LLPolyMeshSharedData::loadMesh( const std::string& fileName ) LLFILE* fp = LLFile::fopen(fileName, "rb"); /*Flawfinder: ignore*/ if (!fp) { + LLError::LLUserWarningMsg::showMissingFiles(); LL_ERRS() << "can't open: " << fileName << LL_ENDL; return false; } diff --git a/indra/llappearance/lltexlayer.cpp b/indra/llappearance/lltexlayer.cpp index b3800e69811..7f7eaf18554 100644 --- a/indra/llappearance/lltexlayer.cpp +++ b/indra/llappearance/lltexlayer.cpp @@ -1890,7 +1890,10 @@ LLGLTexture* LLTexLayerStaticImageList::getTexture(const std::string& file_name, image_raw->copyUnscaledAlphaMask(alpha_image_raw, LLColor4U::black); } - tex->createGLTexture(0, image_raw, 0, true, LLGLTexture::LOCAL); + if (!tex->createGLTexture(0, image_raw, 0, true, LLGLTexture::LOCAL)) + { + LL_WARNS() << "Failed to create GL texture for image: " << file_name << LL_ENDL; + } gGL.getTexUnit(0)->bind(tex); tex->setAddressMode(LLTexUnit::TAM_CLAMP); diff --git a/indra/llappearance/lltexlayerparams.cpp b/indra/llappearance/lltexlayerparams.cpp index 30551c115d9..dd2499cf374 100644 --- a/indra/llappearance/lltexlayerparams.cpp +++ b/indra/llappearance/lltexlayerparams.cpp @@ -338,7 +338,10 @@ bool LLTexLayerParamAlpha::render(S32 x, S32 y, S32 width, S32 height) // Create the GL texture, and then hang onto it for future use. if (mNeedsCreateTexture) { - mCachedProcessedTexture->createGLTexture(0, mStaticImageRaw); + if (!mCachedProcessedTexture->createGLTexture(0, mStaticImageRaw)) + { + LL_WARNS() << "Failed to create GL texture for image: " << mCachedProcessedTexture->getID() << LL_ENDL; + } mNeedsCreateTexture = false; gGL.getTexUnit(0)->bind(mCachedProcessedTexture); mCachedProcessedTexture->setAddressMode(LLTexUnit::TAM_CLAMP); diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index 2de9deea701..daa1def7263 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -314,7 +314,7 @@ if (LL_TESTS) LL_ADD_INTEGRATION_TEST(llleap "" "${test_libs}") LL_ADD_INTEGRATION_TEST(llmainthreadtask "" "${test_libs}") LL_ADD_INTEGRATION_TEST(llpounceable "" "${test_libs}") - LL_ADD_INTEGRATION_TEST(llprocess "" "${test_libs}") + #LL_ADD_INTEGRATION_TEST(llprocess "" "${test_libs}") RIDER: Test is a known failure. Disabling for the moment. LL_ADD_INTEGRATION_TEST(llprocessor "" "${test_libs}") LL_ADD_INTEGRATION_TEST(llprocinfo "" "${test_libs}") LL_ADD_INTEGRATION_TEST(llrand "" "${test_libs}") diff --git a/indra/llcommon/llfile.cpp b/indra/llcommon/llfile.cpp index 53659ac13ff..a539e4fe282 100644 --- a/indra/llcommon/llfile.cpp +++ b/indra/llcommon/llfile.cpp @@ -35,7 +35,6 @@ #if LL_WINDOWS #include "llwin32headers.h" -#include // Windows errno #include #else #include @@ -49,6 +48,86 @@ static std::string empty; // variants of strerror() to report errors. #if LL_WINDOWS +// For the situations where we directly call into Windows API functions we need to translate +// the Windows error codes into errno values +namespace +{ + struct errentry + { + unsigned long oserr; // Windows OS error value + int errcode; // System V error code + }; +} + +// translation table between Windows OS error value and System V errno code +static errentry const errtable[] +{ + { ERROR_INVALID_FUNCTION, EINVAL }, // 1 + { ERROR_FILE_NOT_FOUND, ENOENT }, // 2 + { ERROR_PATH_NOT_FOUND, ENOENT }, // 3 + { ERROR_TOO_MANY_OPEN_FILES, EMFILE }, // 4 + { ERROR_ACCESS_DENIED, EACCES }, // 5 + { ERROR_INVALID_HANDLE, EBADF }, // 6 + { ERROR_ARENA_TRASHED, ENOMEM }, // 7 + { ERROR_NOT_ENOUGH_MEMORY, ENOMEM }, // 8 + { ERROR_INVALID_BLOCK, ENOMEM }, // 9 + { ERROR_BAD_ENVIRONMENT, E2BIG }, // 10 + { ERROR_BAD_FORMAT, ENOEXEC }, // 11 + { ERROR_INVALID_ACCESS, EINVAL }, // 12 + { ERROR_INVALID_DATA, EINVAL }, // 13 + { ERROR_INVALID_DRIVE, ENOENT }, // 15 + { ERROR_CURRENT_DIRECTORY, EACCES }, // 16 + { ERROR_NOT_SAME_DEVICE, EXDEV }, // 17 + { ERROR_NO_MORE_FILES, ENOENT }, // 18 + { ERROR_LOCK_VIOLATION, EACCES }, // 33 + { ERROR_BAD_NETPATH, ENOENT }, // 53 + { ERROR_NETWORK_ACCESS_DENIED, EACCES }, // 65 + { ERROR_BAD_NET_NAME, ENOENT }, // 67 + { ERROR_FILE_EXISTS, EEXIST }, // 80 + { ERROR_CANNOT_MAKE, EACCES }, // 82 + { ERROR_FAIL_I24, EACCES }, // 83 + { ERROR_INVALID_PARAMETER, EINVAL }, // 87 + { ERROR_NO_PROC_SLOTS, EAGAIN }, // 89 + { ERROR_DRIVE_LOCKED, EACCES }, // 108 + { ERROR_BROKEN_PIPE, EPIPE }, // 109 + { ERROR_DISK_FULL, ENOSPC }, // 112 + { ERROR_INVALID_TARGET_HANDLE, EBADF }, // 114 + { ERROR_WAIT_NO_CHILDREN, ECHILD }, // 128 + { ERROR_CHILD_NOT_COMPLETE, ECHILD }, // 129 + { ERROR_DIRECT_ACCESS_HANDLE, EBADF }, // 130 + { ERROR_NEGATIVE_SEEK, EINVAL }, // 131 + { ERROR_SEEK_ON_DEVICE, EACCES }, // 132 + { ERROR_DIR_NOT_EMPTY, ENOTEMPTY }, // 145 + { ERROR_NOT_LOCKED, EACCES }, // 158 + { ERROR_BAD_PATHNAME, ENOENT }, // 161 + { ERROR_MAX_THRDS_REACHED, EAGAIN }, // 164 + { ERROR_LOCK_FAILED, EACCES }, // 167 + { ERROR_ALREADY_EXISTS, EEXIST }, // 183 + { ERROR_FILENAME_EXCED_RANGE, ENOENT }, // 206 + { ERROR_NESTING_NOT_ALLOWED, EAGAIN }, // 215 + { ERROR_NO_UNICODE_TRANSLATION, EILSEQ }, // 1113 + { ERROR_NOT_ENOUGH_QUOTA, ENOMEM } // 1816 +}; + +static int set_errno_from_oserror(unsigned long oserr) +{ + if (!oserr) + return 0; + + // Check the table for the Windows OS error code + for (const struct errentry &entry : errtable) + { + if (oserr == entry.oserr) + { + _set_errno(entry.errcode); + return -1; + } + } + + _set_errno(EINVAL); + return -1; +} + // On Windows, use strerror_s(). std::string strerr(int errn) { @@ -57,7 +136,67 @@ std::string strerr(int errn) return buffer; } -typedef std::basic_ios > _Myios; +inline bool is_slash(wchar_t const c) +{ + return c == L'\\' || c == L'/'; +} + +static std::wstring utf8path_to_wstring(const std::string& utf8path) +{ + if (utf8path.size() >= MAX_PATH) + { + // By prepending "\\?\" to a path, Windows widechar file APIs will not fail on long path names + std::wstring utf16path = L"\\\\?\\" + ll_convert(utf8path); + // We need to make sure that the path does not contain forward slashes as above + // prefix does bypass the path normalization that replaces slashes with backslashes + // before passing the path to kernel mode APIs + std::replace(utf16path.begin(), utf16path.end(), L'/', L'\\'); + return utf16path; + } + return ll_convert(utf8path); +} + +static unsigned short get_fileattr(const std::wstring& utf16path, bool dontFollowSymLink = false) +{ + unsigned long flags = FILE_FLAG_BACKUP_SEMANTICS; + if (dontFollowSymLink) + { + flags |= FILE_FLAG_OPEN_REPARSE_POINT; + } + HANDLE file_handle = CreateFileW(utf16path.c_str(), FILE_READ_ATTRIBUTES, + FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE, + nullptr, OPEN_EXISTING, flags, nullptr); + if (file_handle != INVALID_HANDLE_VALUE) + { + FILE_ATTRIBUTE_TAG_INFO attribute_info; + if (GetFileInformationByHandleEx(file_handle, FileAttributeTagInfo, &attribute_info, sizeof(attribute_info))) + { + // A volume path alone (only drive letter) is not recognized as directory while it technically is + bool is_directory = (attribute_info.FileAttributes & FILE_ATTRIBUTE_DIRECTORY) || + (iswalpha(utf16path[0]) && utf16path[1] == ':' && + (!utf16path[2] || (is_slash(utf16path[2]) && !utf16path[3]))); + unsigned short st_mode = is_directory ? S_IFDIR : + (attribute_info.FileAttributes & FILE_ATTRIBUTE_REPARSE_POINT ? S_IFLNK : S_IFREG); + st_mode |= (attribute_info.FileAttributes & FILE_ATTRIBUTE_READONLY) ? S_IREAD : S_IREAD | S_IWRITE; + // we do not try to guess executable flag + + // propagate user bits to group/other fields: + st_mode |= (st_mode & 0700) >> 3; + st_mode |= (st_mode & 0700) >> 6; + + CloseHandle(file_handle); + return st_mode; + } + } + // Retrieve last error and set errno before calling CloseHandle() + set_errno_from_oserror(GetLastError()); + + if (file_handle != INVALID_HANDLE_VALUE) + { + CloseHandle(file_handle); + } + return 0; +} #else // On Posix we want to call strerror_r(), but alarmingly, there are two @@ -108,18 +247,13 @@ std::string strerr(int errn) } #endif // ! LL_WINDOWS -// On either system, shorthand call just infers global 'errno'. -std::string strerr() -{ - return strerr(errno); -} - -int warnif(const std::string& desc, const std::string& filename, int rc, int accept=0) +static int warnif(const std::string& desc, const std::string& filename, int rc, int accept = 0) { if (rc < 0) { // Capture errno before we start emitting output int errn = errno; + // For certain operations, a particular errno value might be // acceptable -- e.g. stat() could permit ENOENT, mkdir() could permit // EEXIST. Don't warn if caller explicitly says this errno is okay. @@ -176,62 +310,59 @@ int warnif(const std::string& desc, const std::string& filename, int rc, int acc // static int LLFile::mkdir(const std::string& dirname, int perms) { + // We often use mkdir() to ensure the existence of a directory that might + // already exist. There is no known case in which we want to call out as + // an error the requested directory already existing. #if LL_WINDOWS // permissions are ignored on Windows - std::wstring utf16dirname = ll_convert(dirname); - int rc = _wmkdir(utf16dirname.c_str()); + int rc = 0; + std::wstring utf16dirname = utf8path_to_wstring(dirname); + if (!CreateDirectoryW(utf16dirname.c_str(), nullptr)) + { + // Only treat other errors than an already existing file as a real error + unsigned long oserr = GetLastError(); + if (oserr != ERROR_ALREADY_EXISTS) + { + rc = set_errno_from_oserror(oserr); + } + } #else int rc = ::mkdir(dirname.c_str(), (mode_t)perms); -#endif - // We often use mkdir() to ensure the existence of a directory that might - // already exist. There is no known case in which we want to call out as - // an error the requested directory already existing. if (rc < 0 && errno == EEXIST) { // this is not the error you want, move along return 0; } +#endif // anything else might be a problem - return warnif("mkdir", dirname, rc, EEXIST); + return warnif("mkdir", dirname, rc); } // static -int LLFile::rmdir(const std::string& dirname) +int LLFile::rmdir(const std::string& dirname, int suppress_error) { #if LL_WINDOWS - // permissions are ignored on Windows - std::wstring utf16dirname = ll_convert(dirname); + std::wstring utf16dirname = utf8path_to_wstring(dirname); int rc = _wrmdir(utf16dirname.c_str()); #else int rc = ::rmdir(dirname.c_str()); #endif - return warnif("rmdir", dirname, rc); + return warnif("rmdir", dirname, rc, suppress_error); } // static -LLFILE* LLFile::fopen(const std::string& filename, const char* mode) /* Flawfinder: ignore */ -{ -#if LL_WINDOWS - std::wstring utf16filename = ll_convert(filename); - std::wstring utf16mode = ll_convert(std::string(mode)); - return _wfopen(utf16filename.c_str(),utf16mode.c_str()); -#else - return ::fopen(filename.c_str(),mode); /* Flawfinder: ignore */ -#endif -} - -LLFILE* LLFile::_fsopen(const std::string& filename, const char* mode, int sharingFlag) +LLFILE* LLFile::fopen(const std::string& filename, const char* mode) { #if LL_WINDOWS - std::wstring utf16filename = ll_convert(filename); + std::wstring utf16filename = utf8path_to_wstring(filename); std::wstring utf16mode = ll_convert(std::string(mode)); - return _wfsopen(utf16filename.c_str(),utf16mode.c_str(),sharingFlag); + return _wfopen(utf16filename.c_str(), utf16mode.c_str()); #else - llassert(0);//No corresponding function on non-windows - return NULL; + return ::fopen(filename.c_str(),mode); #endif } +// static int LLFile::close(LLFILE * file) { int ret_value = 0; @@ -242,9 +373,10 @@ int LLFile::close(LLFILE * file) return ret_value; } +// static std::string LLFile::getContents(const std::string& filename) { - LLFILE* fp = fopen(filename, "rb"); /* Flawfinder: ignore */ + LLFILE* fp = LLFile::fopen(filename, "rb"); if (fp) { fseek(fp, 0, SEEK_END); @@ -261,42 +393,80 @@ std::string LLFile::getContents(const std::string& filename) return LLStringUtil::null; } -int LLFile::remove(const std::string& filename, int supress_error) +// static +int LLFile::remove(const std::string& filename, int suppress_error) { #if LL_WINDOWS - std::wstring utf16filename = ll_convert(filename); - int rc = _wremove(utf16filename.c_str()); + // Posix remove() works on both files and directories although on Windows + // remove() and its wide char variant _wremove() only removes files just + // as its siblings unlink() and _wunlink(). + // If we really only want to support files we should instead use + // unlink() in the non-Windows part below too + int rc = -1; + std::wstring utf16filename = utf8path_to_wstring(filename); + unsigned short st_mode = get_fileattr(utf16filename); + if (S_ISDIR(st_mode)) + { + rc = _wrmdir(utf16filename.c_str()); + } + else if (S_ISREG(st_mode)) + { + rc = _wunlink(utf16filename.c_str()); + } + else if (st_mode) + { + // it is something else than a file or directory + // this should not really happen as long as we do not allow for symlink + // detection in the optional parameter to get_fileattr() + rc = set_errno_from_oserror(ERROR_INVALID_PARAMETER); + } + else + { + // get_fileattr() failed and already set errno, preserve it for correct error reporting + } #else int rc = ::remove(filename.c_str()); #endif - return warnif("remove", filename, rc, supress_error); + return warnif("remove", filename, rc, suppress_error); } -int LLFile::rename(const std::string& filename, const std::string& newname, int supress_error) +// static +int LLFile::rename(const std::string& filename, const std::string& newname, int suppress_error) { #if LL_WINDOWS - std::wstring utf16filename = ll_convert(filename); - std::wstring utf16newname = ll_convert(newname); - int rc = _wrename(utf16filename.c_str(),utf16newname.c_str()); + // Posix rename() will gladly overwrite a file at newname if it exists, the Windows + // rename(), respectively _wrename(), will bark on that. Instead call directly the Windows + // API MoveFileEx() and use its flags to specify that overwrite is allowed. + std::wstring utf16filename = utf8path_to_wstring(filename); + std::wstring utf16newname = utf8path_to_wstring(newname); + int rc = 0; + if (!MoveFileExW(utf16filename.c_str(), utf16newname.c_str(), MOVEFILE_REPLACE_EXISTING | MOVEFILE_COPY_ALLOWED)) + { + rc = set_errno_from_oserror(GetLastError()); + } #else int rc = ::rename(filename.c_str(),newname.c_str()); #endif - return warnif(STRINGIZE("rename to '" << newname << "' from"), filename, rc, supress_error); + return warnif(STRINGIZE("rename to '" << newname << "' from"), filename, rc, suppress_error); } +// Make this a define rather than using magic numbers multiple times in the code +#define LLFILE_COPY_BUFFER_SIZE 16384 + +// static bool LLFile::copy(const std::string& from, const std::string& to) { bool copied = false; - LLFILE* in = LLFile::fopen(from, "rb"); /* Flawfinder: ignore */ + LLFILE* in = LLFile::fopen(from, "rb"); if (in) { - LLFILE* out = LLFile::fopen(to, "wb"); /* Flawfinder: ignore */ + LLFILE* out = LLFile::fopen(to, "wb"); if (out) { - char buf[16384]; /* Flawfinder: ignore */ + char buf[LLFILE_COPY_BUFFER_SIZE]; size_t readbytes; bool write_ok = true; - while(write_ok && (readbytes = fread(buf, 1, 16384, in))) /* Flawfinder: ignore */ + while (write_ok && (readbytes = fread(buf, 1, LLFILE_COPY_BUFFER_SIZE, in))) { if (fwrite(buf, 1, readbytes, out) != readbytes) { @@ -315,33 +485,62 @@ bool LLFile::copy(const std::string& from, const std::string& to) return copied; } -int LLFile::stat(const std::string& filename, llstat* filestatus) +// static +int LLFile::stat(const std::string& filename, llstat* filestatus, int suppress_error) { #if LL_WINDOWS - std::wstring utf16filename = ll_convert(filename); - int rc = _wstat(utf16filename.c_str(),filestatus); + std::wstring utf16filename = utf8path_to_wstring(filename); + int rc = _wstat64(utf16filename.c_str(), filestatus); #else - int rc = ::stat(filename.c_str(),filestatus); + int rc = ::stat(filename.c_str(), filestatus); #endif - // We use stat() to determine existence (see isfile(), isdir()). - // Don't spam the log if the subject pathname doesn't exist. - return warnif("stat", filename, rc, ENOENT); + return warnif("stat", filename, rc, suppress_error); } -bool LLFile::isdir(const std::string& filename) +// static +unsigned short LLFile::getattr(const std::string& filename, bool dontFollowSymLink, int suppress_error) { - llstat st; +#if LL_WINDOWS + // _wstat64() is a bit heavyweight on Windows, use a more lightweight API + // to just get the attributes + int rc = -1; + std::wstring utf16filename = utf8path_to_wstring(filename); + unsigned short st_mode = get_fileattr(utf16filename, dontFollowSymLink); + if (st_mode) + { + return st_mode; + } +#else + llstat filestatus; + int rc = dontFollowSymLink ? ::lstat(filename.c_str(), &filestatus) : ::stat(filename.c_str(), &filestatus); + if (rc == 0) + { + return filestatus.st_mode; + } +#endif + warnif("getattr", filename, rc, suppress_error); + return 0; +} - return stat(filename, &st) == 0 && S_ISDIR(st.st_mode); +// static +bool LLFile::isdir(const std::string& filename) +{ + return S_ISDIR(getattr(filename)); } +// static bool LLFile::isfile(const std::string& filename) { - llstat st; + return S_ISREG(getattr(filename)); +} - return stat(filename, &st) == 0 && S_ISREG(st.st_mode); +// static +bool LLFile::islink(const std::string& filename) +{ + return S_ISLNK(getattr(filename, true)); } +// static const char *LLFile::tmpdir() { static std::string utf8path; @@ -368,75 +567,8 @@ const char *LLFile::tmpdir() return utf8path.c_str(); } - -/***************** Modified file stream created to overcome the incorrect behaviour of posix fopen in windows *******************/ - #if LL_WINDOWS -LLFILE * LLFile::_Fiopen(const std::string& filename, - std::ios::openmode mode) -{ // open a file - static const char *mods[] = - { // fopen mode strings corresponding to valid[i] - "r", "w", "w", "a", "rb", "wb", "wb", "ab", - "r+", "w+", "a+", "r+b", "w+b", "a+b", - 0}; - static const int valid[] = - { // valid combinations of open flags - ios_base::in, - ios_base::out, - ios_base::out | ios_base::trunc, - ios_base::out | ios_base::app, - ios_base::in | ios_base::binary, - ios_base::out | ios_base::binary, - ios_base::out | ios_base::trunc | ios_base::binary, - ios_base::out | ios_base::app | ios_base::binary, - ios_base::in | ios_base::out, - ios_base::in | ios_base::out | ios_base::trunc, - ios_base::in | ios_base::out | ios_base::app, - ios_base::in | ios_base::out | ios_base::binary, - ios_base::in | ios_base::out | ios_base::trunc - | ios_base::binary, - ios_base::in | ios_base::out | ios_base::app - | ios_base::binary, - 0}; - - LLFILE *fp = 0; - int n; - ios_base::openmode atendflag = mode & ios_base::ate; - ios_base::openmode norepflag = mode & ios_base::_Noreplace; - - if (mode & ios_base::_Nocreate) - mode |= ios_base::in; // file must exist - mode &= ~(ios_base::ate | ios_base::_Nocreate | ios_base::_Noreplace); - for (n = 0; valid[n] != 0 && valid[n] != mode; ++n) - ; // look for a valid mode - - if (valid[n] == 0) - return (0); // no valid mode - else if (norepflag && mode & (ios_base::out | ios_base::app) - && (fp = LLFile::fopen(filename, "r")) != 0) /* Flawfinder: ignore */ - { // file must not exist, close and fail - fclose(fp); - return (0); - } - else if (fp != 0 && fclose(fp) != 0) - return (0); // can't close after test open -// should open with protection here, if other than default - else if ((fp = LLFile::fopen(filename, mods[n])) == 0) /* Flawfinder: ignore */ - return (0); // open failed - - if (!atendflag || fseek(fp, 0, SEEK_END) == 0) - return (fp); // no need to seek to end, or seek succeeded - - fclose(fp); // can't position at end - return (0); -} - -#endif /* LL_WINDOWS */ - - -#if LL_WINDOWS /************** input file stream ********************************/ llifstream::llifstream() {} diff --git a/indra/llcommon/llfile.h b/indra/llcommon/llfile.h index 1661cbeb55e..04a2946ac42 100644 --- a/indra/llcommon/llfile.h +++ b/indra/llcommon/llfile.h @@ -41,8 +41,9 @@ typedef FILE LLFILE; #include #if LL_WINDOWS -// windows version of stat function and stat data structure are called _stat -typedef struct _stat llstat; +// The Windows version of stat function and stat data structure are called _stat64 +// We use _stat64 here to support 64-bit st_size and time_t values +typedef struct _stat64 llstat; #else typedef struct stat llstat; #include @@ -56,35 +57,110 @@ typedef struct stat llstat; # define S_ISDIR(x) (((x) & S_IFMT) == S_IFDIR) #endif +// Windows C runtime library does not define this and does not support symlink detection in the +// stat functions but we do in our getattr() function +#ifndef S_IFLNK +#define S_IFLNK 0xA000 /* symlink */ +#endif + +#ifndef S_ISLNK +#define S_ISLNK(x) (((x) & S_IFMT) == S_IFLNK) +#endif + #include "llstring.h" // safe char* -> std::string conversion +/// LLFile is a class of static functions operating on paths +/// All the functions with a path string input take UTF8 path/filenames class LL_COMMON_API LLFile { public: - // All these functions take UTF8 path/filenames. - static LLFILE* fopen(const std::string& filename,const char* accessmode); /* Flawfinder: ignore */ - static LLFILE* _fsopen(const std::string& filename,const char* accessmode,int sharingFlag); + /// open a file with the specified access mode + static LLFILE* fopen(const std::string& filename, const char* accessmode); /* Flawfinder: ignore */ + ///< 'accessmode' follows the rules of the Posix fopen() mode parameter + /// "r" open the file for reading only and positions the stream at the beginning + /// "r+" open the file for reading and writing and positions the stream at the beginning + /// "w" open the file for reading and writing and truncate it to zero length + /// "w+" open or create the file for reading and writing and truncate to zero length if it existed + /// "a" open the file for reading and writing and position the stream at the end of the file + /// "a+" open or create the file for reading and writing and position the stream at the end of the file + /// + /// in addition to these values, "b" can be appended to indicate binary stream access, but on Linux and Mac + /// this is strictly for compatibility and has no effect. On Windows this makes the file functions not + /// try to translate line endings. Windows also allows to append "t" to indicate text mode. If neither + /// "b" or "t" is defined, Windows uses the value set by _fmode which by default is _O_TEXT. + /// This means that it is always a good idea to append "b" specifically for binary file access to + /// avoid corruption of the binary consistency of the data stream when reading or writing + /// Other characters in 'accessmode' will usually cause an error as fopen will verify this parameter + /// @returns a valid LLFILE* pointer on success or NULL on failure static int close(LLFILE * file); + /// retrieve the content of a file into a string static std::string getContents(const std::string& filename); + ///< @returns the content of the file or an empty string on failure - // perms is a permissions mask like 0777 or 0700. In most cases it will - // be overridden by the user's umask. It is ignored on Windows. - // mkdir() considers "directory already exists" to be SUCCESS. + /// create a directory static int mkdir(const std::string& filename, int perms = 0700); - - static int rmdir(const std::string& filename); - static int remove(const std::string& filename, int supress_error = 0); - static int rename(const std::string& filename,const std::string& newname, int supress_error = 0); + ///< perms is a permissions mask like 0777 or 0700. In most cases it will be + /// overridden by the user's umask. It is ignored on Windows. + /// mkdir() considers "directory already exists" to be not an error. + /// @returns 0 on success and -1 on failure. + + //// remove a directory + static int rmdir(const std::string& filename, int suppress_error = 0); + ///< pass ENOENT in the optional 'suppress_error' parameter + /// if you don't want a warning in the log when the directory does not exist + /// @returns 0 on success and -1 on failure. + + /// remove a file or directory + static int remove(const std::string& filename, int suppress_error = 0); + ///< pass ENOENT in the optional 'suppress_error' parameter + /// if you don't want a warning in the log when the directory does not exist + /// @returns 0 on success and -1 on failure. + + /// rename a file + static int rename(const std::string& filename, const std::string& newname, int suppress_error = 0); + ///< it will silently overwrite newname if it exists without returning an error + /// Posix guarantees that if newname already exists, then there will be no moment + /// in which for other processes newname does not exist. There is no such guarantee + /// under Windows at this time. It may do it in the same way but the used Windows API + /// does not make such guarantees. + /// @returns 0 on success and -1 on failure. + + + /// copy the contents of file from 'from' to 'to' filename static bool copy(const std::string& from, const std::string& to); - - static int stat(const std::string& filename,llstat* file_status); - static bool isdir(const std::string& filename); - static bool isfile(const std::string& filename); - static LLFILE * _Fiopen(const std::string& filename, - std::ios::openmode mode); - + ///< @returns true on success and false on failure. + + /// return the file stat structure for filename + static int stat(const std::string& filename, llstat* file_status, int suppress_error = ENOENT); + ///< for compatibility with existing uses of LL_File::stat() we use ENOENT as default in the + /// optional 'suppress_error' parameter to avoid spamming the log with warnings when the API + /// is used to detect if a file exists + /// @returns 0 on success and -1 on failure. + + /// get the file or directory attributes for filename + static unsigned short getattr(const std::string& filename, bool dontFollowSymLink = false, int suppress_error = ENOENT); + ///< a more lightweight function on Windows to stat, that just returns the file attribute flags + /// dontFollowSymLinks set to true returns the attributes of the symlink if it is one, rather than resolving it + /// we pass by default ENOENT in the optional 'suppress_error' parameter to not spam the log with + /// warnings when the file or directory does not exist + /// @returns 0 on failure and a st_mode value with either S_IFDIR or S_IFREG set otherwise + /// together with the three access bits which under Windows only the write bit is relevant. + + /// check if filename is an existing directory + static bool isdir(const std::string& filename); + ///< @returns true if the path is for an existing directory + + /// check if filename is an existing file + static bool isfile(const std::string& filename); + ///< @returns true if the path is for an existing file + + /// check if filename is a symlink + static bool islink(const std::string& filename); + ///< @returns true if the path is pointing at a symlink + + /// return a path to the temporary directory on the system static const char * tmpdir(); }; diff --git a/indra/llcommon/llleap.cpp b/indra/llcommon/llleap.cpp index 662a2511cdc..ada6b9519e5 100644 --- a/indra/llcommon/llleap.cpp +++ b/indra/llcommon/llleap.cpp @@ -188,6 +188,17 @@ class LLLeapImpl: public LLLeap << childout.peek(0, peeklen) << "..." << LL_ENDL; } + // Handle any remaining stderr data (partial lines) the same way as we do + // for stdout: log it. + LLProcess::ReadPipe& childerr(mChild->getReadPipe(LLProcess::STDERR)); + if (childerr.size()) + { + LLProcess::ReadPipe::size_type + peeklen((std::min)(LLProcess::ReadPipe::size_type(50), childerr.size())); + LL_WARNS("LLLeap") << "Final stderr " << childerr.size() << " bytes: " + << childerr.peek(0, peeklen) << "..." << LL_ENDL; + } + // Kill this instance. MUST BE LAST before return! delete this; return false; diff --git a/indra/llcommon/llqueuedthread.cpp b/indra/llcommon/llqueuedthread.cpp index 0196a24b183..efeeb1340ed 100644 --- a/indra/llcommon/llqueuedthread.cpp +++ b/indra/llcommon/llqueuedthread.cpp @@ -80,7 +80,7 @@ void LLQueuedThread::shutdown() mRequestQueue.close(); } - S32 timeout = 100; + S32 timeout = 50; for ( ; timeout>0; timeout--) { if (isStopped()) @@ -101,19 +101,34 @@ void LLQueuedThread::shutdown() } QueuedRequest* req; - S32 active_count = 0; + S32 queued_count = 0; + bool has_active = false; + lockData(); while ( (req = (QueuedRequest*)mRequestHash.pop_element()) ) { - if (req->getStatus() == STATUS_QUEUED || req->getStatus() == STATUS_INPROGRESS) + if (req->getStatus() == STATUS_INPROGRESS) + { + has_active = true; + req->setFlags(FLAG_ABORT | FLAG_AUTO_COMPLETE); + continue; + } + if (req->getStatus() == STATUS_QUEUED) { - ++active_count; + ++queued_count; req->setStatus(STATUS_ABORTED); // avoid assert in deleteRequest } req->deleteRequest(); } - if (active_count) + unlockData(); + if (queued_count) + { + LL_WARNS() << "~LLQueuedThread() called with unpocessed requests: " << queued_count << LL_ENDL; + } + if (has_active) { - LL_WARNS() << "~LLQueuedThread() called with active requests: " << active_count << LL_ENDL; + LL_WARNS() << "~LLQueuedThread() called with active requests!" << LL_ENDL; + ms_sleep(100); // last chance for request to finish + printQueueStats(); } mRequestQueue.close(); @@ -570,7 +585,12 @@ LLQueuedThread::QueuedRequest::QueuedRequest(LLQueuedThread::handle_t handle, U3 LLQueuedThread::QueuedRequest::~QueuedRequest() { - llassert_always(mStatus == STATUS_DELETE); + if (mStatus != STATUS_DELETE) + { + // The only method to delete a request is deleteRequest(), + // it should have set the status to STATUS_DELETE + LL_ERRS() << "LLQueuedThread::QueuedRequest deleted with status " << mStatus << LL_ENDL; + } } //virtual diff --git a/indra/llcommon/llstl.h b/indra/llcommon/llstl.h index 7d41c42ba7f..0088eeec67d 100644 --- a/indra/llcommon/llstl.h +++ b/indra/llcommon/llstl.h @@ -35,6 +35,7 @@ #include #include #include +#include #ifdef LL_LINUX // For strcmp @@ -709,5 +710,208 @@ struct ll_template_cast_impl \ } \ } +//----------------------------------------------- +namespace LL +{ + /** + * @brief A range adapter that provides filtered iteration over a container. + * + * filter_range creates a filtered view of an iterator range using a predicate function. + * Only elements that satisfy the predicate will be accessible when iterating through + * the range. This is useful for processing subsets of containers without copying data. + * + * The class uses boost::filter_iterator internally to provide the filtering functionality. + * + * @tparam Predicate A callable object (function, functor, lambda) that takes an element + * from the iterator range and returns true if the element should be + * included in the filtered range. + * @tparam Iterator The iterator type for the underlying container/range. + * + * Example usage: + * @code + * std::vector numbers = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; + * + * // Create a predicate to filter even numbers + * auto is_even = [](int n) { return n % 2 == 0; }; + * + * // Create filtered range using make_filter helper + * auto even_range = LL::make_filter(is_even, numbers.begin(), numbers.end()); + * + * // Iterate through only even numbers + * for (auto value : even_range) { + * std::cout << value << " "; // Prints: 2 4 6 8 10 + * } + * + * // Or manually construct the filter_range + * LL::filter_range::iterator> + * manual_range(is_even, numbers.begin(), numbers.end()); + * @endcode + * + * @note This class provides a lightweight view over the original data. + * No copying of elements occurs, making it efficient for large containers. + * @note The predicate is applied during iteration, so complex predicates may + * impact performance for frequently-accessed ranges. + * @note The underlying container must remain valid for the lifetime of the filter_range. + * + * @see make_filter() for a convenient factory function + * @see boost::filter_iterator for the underlying implementation details + */ + template + class filter_range + { + public: + /// The filtered iterator type - combines predicate with base iterator + using filter_iter = boost::filter_iterator; + + /// Value type of the filtered elements + using value_type = typename std::iterator_traits::value_type; + + /// Iterator type for range-based for loops and STL algorithms + using iterator = filter_iter; + using const_iterator = filter_iter; + + /** + * @brief Constructs a filter_range with the given predicate and iterator range. + * + * @param pred The predicate function/functor to filter elements. + * Must be callable with signature: bool(const value_type&) + * @param begin Iterator to the beginning of the range to filter + * @param end Iterator to the end of the range to filter + * + * @pre begin and end must form a valid iterator range + * @pre pred must be a valid callable that can be invoked with elements from [begin, end) + */ + filter_range(Predicate pred, Iterator begin, Iterator end) + : begin_(pred, begin, end), end_(pred, end, end) {} + + /** + * @brief Returns an iterator to the first element that satisfies the predicate. + * + * @return filter_iter Iterator pointing to the first filtered element, + * or equal to end() if no elements satisfy the predicate. + */ + filter_iter begin() const { return begin_; } + + /** + * @brief Returns an iterator representing the end of the filtered range. + * + * @return filter_iter Past-the-end iterator for the filtered range. + */ + filter_iter end() const { return end_; } + + /** + * @brief Checks if the filtered range is empty. + * + * @return true if no elements in the range satisfy the predicate, false otherwise. + * + * @note This operation has O(1) complexity as it only compares iterators. + */ + bool empty() const { return begin_ == end_; } + + private: + filter_iter begin_; ///< Iterator to first element satisfying predicate + filter_iter end_; ///< Past-the-end iterator for the filtered range + }; + + /** + * @brief Factory function to create a filter_range with automatic template deduction. + * + * This convenience function eliminates the need to explicitly specify template parameters + * when creating a filter_range. The template parameters are automatically deduced from + * the function arguments. + * + * @tparam Predicate Automatically deduced predicate type + * @tparam Iterator Automatically deduced iterator type + * + * @param pred Predicate function/functor for filtering elements + * @param begin Iterator to the beginning of the range + * @param end Iterator to the end of the range + * + * @return filter_range A filter_range object configured with + * the provided predicate and range + * + * Example usage: + * @code + * std::vector words = {"hello", "world", "test", "example"}; + * + * // Filter strings longer than 4 characters + * auto long_words = LL::make_filter( + * [](const std::string& s) { return s.length() > 4; }, + * words.begin(), + * words.end() + * ); + * + * // Use with range-based for loop + * for (const auto& word : long_words) { + * std::cout << word << std::endl; // Prints: hello, world, example + * } + * + * // Use with STL algorithms + * auto count = std::distance(long_words.begin(), long_words.end()); + * std::cout << "Found " << count << " long words." << std::endl; + * @endcode + * + * @note This function is preferred over direct construction of filter_range + * for most use cases due to automatic template parameter deduction. + */ + template + filter_range make_filter(Predicate pred, Iterator begin, Iterator end) + { + return filter_range(pred, begin, end); + } + + /** + * @brief Create a filter_range over an entire container with automatic template deduction. + * + * This convenience function creates a filtered view over an entire container without + * requiring explicit begin() and end() calls. It automatically handles both const and + * non-const containers, preserving constness in the resulting iterator types. + * + * @tparam Predicate Automatically deduced predicate type + * @tparam Container Automatically deduced container type (const or non-const) + * + * @param pred Predicate function/functor for filtering elements + * @param container The container to filter (can be const or non-const) + * + * @return filter_range with appropriate iterator type for the container + * + * Example usage: + * @code + * // Non-const container + * std::vector numbers = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; + * auto evens = LL::make_filter([](int n) { return n % 2 == 0; }, numbers); + * + * // Const container + * const std::list words = {"cat", "elephant", "dog", "hippopotamus"}; + * auto long_words = LL::make_filter([](const std::string& s) { return s.size() > 3; }, words); + * + * // Works with any container that supports begin()/end() + * std::set values = {1.1, 2.2, 3.3, 4.4, 5.5}; + * auto large_values = LL::make_filter([](double d) { return d > 3.0; }, values); + * + * // Use with range-based for loops + * for (const auto& word : long_words) { + * std::cout << word << " "; // Prints: elephant hippopotamus + * } + * + * // Chain with STL algorithms + * auto even_count = std::distance(evens.begin(), evens.end()); + * std::cout << "Found " << even_count << " even numbers." << std::endl; + * @endcode + * + * @note This overload automatically calls begin() and end() on the container, + * making it more convenient than the iterator-based version. + * @note The container must remain valid for the lifetime of the returned filter_range. + * @note Constness of the container is preserved in the iterator type. + */ + template + filter_range()))> + make_filter(Predicate pred, Container&& container) + { + return filter_range()))>( + pred, std::begin(container), std::end(container)); + } + +} // namespace LL #endif // LL_LLSTL_H diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp index 21b11c53112..270ca400863 100644 --- a/indra/llcommon/llsys.cpp +++ b/indra/llcommon/llsys.cpp @@ -1348,10 +1348,6 @@ bool gunzip_file(const std::string& srcfile, const std::string& dstfile) } while(gzeof(src) == 0); fclose(dst); dst = NULL; -#if LL_WINDOWS - // Rename in windows needs the dstfile to not exist. - LLFile::remove(dstfile, ENOENT); -#endif if (LLFile::rename(tmpfile, dstfile) == -1) goto err; /* Flawfinder: ignore */ retval = true; err: @@ -1399,10 +1395,6 @@ bool gzip_file(const std::string& srcfile, const std::string& dstfile) gzclose(dst); dst = NULL; -#if LL_WINDOWS - // Rename in windows needs the dstfile to not exist. - LLFile::remove(dstfile); -#endif if (LLFile::rename(tmpfile, dstfile) == -1) goto err; /* Flawfinder: ignore */ retval = true; err: diff --git a/indra/llcommon/tests/llprocess_test.cpp b/indra/llcommon/tests/llprocess_test.cpp index b63cc52becd..13422612d67 100644 --- a/indra/llcommon/tests/llprocess_test.cpp +++ b/indra/llcommon/tests/llprocess_test.cpp @@ -54,14 +54,29 @@ std::string apr_strerror_helper(apr_status_t rv) *****************************************************************************/ #define ensure_equals_(left, right) \ - ensure_equals(STRINGIZE(#left << " != " << #right), (left), (right)) +do { \ + auto _left_val = (left); \ + auto _right_val = (right); \ + if (_left_val != _right_val) { \ + std::string _msg = std::string(#left) + " != " + std::string(#right); \ + tut::ensure_equals(_msg, _left_val, _right_val); \ + } else { \ + tut::ensure_equals("", _left_val, _right_val); \ + } \ +} while(0) #define aprchk(expr) aprchk_(#expr, (expr)) static void aprchk_(const char* call, apr_status_t rv, apr_status_t expected=APR_SUCCESS) { - tut::ensure_equals(STRINGIZE(call << " => " << rv << ": " << apr_strerror_helper - (rv)), - rv, expected); + if (rv != expected) + { + std::string msg = std::string(call) + " => " + std::to_string(rv) + ": " + apr_strerror_helper(rv); + tut::ensure_equals(msg, rv, expected); + } + else + { + tut::ensure_equals("", rv, expected); + } } /** @@ -78,11 +93,14 @@ static std::string readfile(const std::string& pathname, const std::string& desc std::string use_desc(desc); if (use_desc.empty()) { - use_desc = STRINGIZE("in " << pathname); + use_desc = "in " + pathname; } std::ifstream inf(pathname.c_str()); std::string output; - tut::ensure(STRINGIZE("No output " << use_desc), bool(std::getline(inf, output))); + if (!std::getline(inf, output)) + { + tut::ensure("No output " + use_desc, false); + } std::string more; while (std::getline(inf, more)) { @@ -108,8 +126,8 @@ void waitfor(LLProcess& proc, int timeout=60) { yield(); } - tut::ensure(STRINGIZE("process took longer than " << timeout << " seconds to terminate"), - i < timeout); + std::string msg = "process took longer than " + std::to_string(timeout) + " seconds to terminate"; + tut::ensure(msg, i < timeout); } void waitfor(LLProcess::handle h, const std::string& desc, int timeout=60) @@ -119,8 +137,8 @@ void waitfor(LLProcess::handle h, const std::string& desc, int timeout=60) { yield(); } - tut::ensure(STRINGIZE("process took longer than " << timeout << " seconds to terminate"), - i < timeout); + std::string msg = "process took longer than " + std::to_string(timeout) + " seconds to terminate"; + tut::ensure(msg, i < timeout); } /** @@ -153,7 +171,8 @@ struct PythonProcessLauncher try { mPy = LLProcess::create(mParams); - tut::ensure(STRINGIZE("Couldn't launch " << mDesc << " script"), bool(mPy)); + std::string msg = "Couldn't launch " + mDesc + " script"; + tut::ensure(msg, bool(mPy)); } catch (const tut::failure&) { @@ -214,7 +233,8 @@ struct PythonProcessLauncher mParams.args.add(out.getName()); run(); // assuming the script wrote to that file, read it - return readfile(out.getName(), STRINGIZE("from " << mDesc << " script")); + std::string desc = "from " + mDesc + " script"; + return readfile(out.getName(), desc); } LLProcess::Params mParams; diff --git a/indra/llcorehttp/CMakeLists.txt b/indra/llcorehttp/CMakeLists.txt index 05b788a4338..fa37d231263 100644 --- a/indra/llcorehttp/CMakeLists.txt +++ b/indra/llcorehttp/CMakeLists.txt @@ -12,6 +12,7 @@ include(LLAddBuildTest) include(LLCommon) include(Tut) include(bugsplat) +include(websocketpp) set(llcorehttp_SOURCE_FILES bufferarray.cpp @@ -23,6 +24,8 @@ set(llcorehttp_SOURCE_FILES httprequest.cpp httpresponse.cpp httpstats.cpp + llwebsocketmgr.cpp + lljsonrpcws.cpp _httplibcurl.cpp _httpopcancel.cpp _httpoperation.cpp @@ -51,6 +54,8 @@ set(llcorehttp_HEADER_FILES httprequest.h httpresponse.h httpstats.h + llwebsocketmgr.h + lljsonrpcws.h _httpinternal.h _httplibcurl.h _httpopcancel.h @@ -85,6 +90,7 @@ target_link_libraries( ll::libcurl ll::openssl ll::nghttp2 + ll::websocketpp ) target_include_directories( llcorehttp INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) # llmessage depends on llcorehttp, yet llcorehttp also depends on llmessage (at least for includes). @@ -131,7 +137,7 @@ if (LL_TESTS AND LLCOREHTTP_TESTS) ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/tests/test_llcorehttp_peer.py" ) - + # # Example Programs # diff --git a/indra/llcorehttp/llhttpconstants.cpp b/indra/llcorehttp/llhttpconstants.cpp index 40d6c7506c2..7a671543d93 100755 --- a/indra/llcorehttp/llhttpconstants.cpp +++ b/indra/llcorehttp/llhttpconstants.cpp @@ -100,6 +100,7 @@ const std::string HTTP_IN_HEADER_LOCATION("location"); const std::string HTTP_IN_HEADER_RETRY_AFTER("retry-after"); const std::string HTTP_IN_HEADER_SET_COOKIE("set-cookie"); const std::string HTTP_IN_HEADER_USER_AGENT("user-agent"); +const std::string HTTP_IN_HEADER_X_CONTENT_TYPE_OPTIONS("x-content-type-options"); const std::string HTTP_IN_HEADER_X_FORWARDED_FOR("x-forwarded-for"); const std::string HTTP_CONTENT_LLSD_XML("application/llsd+xml"); @@ -122,6 +123,7 @@ const std::string HTTP_CONTENT_IMAGE_BMP("image/bmp"); const std::string HTTP_NO_CACHE("no-cache"); const std::string HTTP_NO_CACHE_CONTROL("no-cache, max-age=0"); +const std::string HTTP_NOSNIFF("nosniff"); const std::string HTTP_VERB_INVALID("(invalid)"); const std::string HTTP_VERB_HEAD("HEAD"); diff --git a/indra/llcorehttp/llhttpconstants.h b/indra/llcorehttp/llhttpconstants.h index 583f9fbcb77..71c1dfa1730 100755 --- a/indra/llcorehttp/llhttpconstants.h +++ b/indra/llcorehttp/llhttpconstants.h @@ -190,6 +190,7 @@ extern const std::string HTTP_IN_HEADER_LOCATION; extern const std::string HTTP_IN_HEADER_RETRY_AFTER; extern const std::string HTTP_IN_HEADER_SET_COOKIE; extern const std::string HTTP_IN_HEADER_USER_AGENT; +extern const std::string HTTP_IN_HEADER_X_CONTENT_TYPE_OPTIONS; extern const std::string HTTP_IN_HEADER_X_FORWARDED_FOR; //// HTTP Content Types //// @@ -215,5 +216,6 @@ extern const std::string HTTP_CONTENT_IMAGE_BMP; //// HTTP Cache Settings //// extern const std::string HTTP_NO_CACHE; extern const std::string HTTP_NO_CACHE_CONTROL; +extern const std::string HTTP_NOSNIFF; #endif diff --git a/indra/llcorehttp/lljsonrpcws.cpp b/indra/llcorehttp/lljsonrpcws.cpp new file mode 100644 index 00000000000..93e38a8397c --- /dev/null +++ b/indra/llcorehttp/lljsonrpcws.cpp @@ -0,0 +1,628 @@ +/** + * @file lljsonrpcws.cpp + * @brief JSON-RPC 2.0 WebSocket server and connection implementation + * + * $LicenseInfo:firstyear=2025&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2025, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "linden_common.h" + +#include "lljsonrpcws.h" +#include "llerror.h" +#include "llsdjson.h" +#include "lldate.h" + +#include + +//======================================================================== +// LLJSONRPCConnection Implementation +//======================================================================== + +void LLJSONRPCConnection::onOpen() +{ + LL_INFOS("JSONRPC") << "JSON-RPC connection opened" << LL_ENDL; +} + +void LLJSONRPCConnection::onClose() +{ + LL_INFOS("JSONRPC") << "JSON-RPC connection closed, clearing " + << mPendingRequests.size() << " pending requests" << LL_ENDL; + + // Cancel all pending requests + for (auto& [id, callback] : mPendingRequests) + { + if (callback) + { + LLSD error; + error["code"] = RPCError::CONNECTION_CLOSED; // Use named constant instead of magic number + error["message"] = "Connection closed"; + callback(LLSD(), error); + } + } + mPendingRequests.clear(); +} + +void LLJSONRPCConnection::onMessage(const std::string& message) +{ + LL_DEBUGS("JSONRPC") << "Received JSON-RPC message: " << message << LL_ENDL; + + try + { + // Parse JSON message + boost::system::error_code ec; + boost::json::value json_value = boost::json::parse(message, ec); + + if (ec.failed()) + { + LL_WARNS("JSONRPC") << "Failed to parse JSON: " << ec.message() << LL_ENDL; + sendError(LLSD(), ParseError(ec.message())); + return; + } + + // Convert to LLSD + LLSD message_obj = LlsdFromJson(json_value); + + // Handle batch vs single message + if (message_obj.isArray()) + { + // Batch request + if (message_obj.size() == 0) + { + sendError(LLSD(), InvalidRequest("Empty batch")); + return; + } + + // Process each message in the batch + for (S32 i = 0; i < message_obj.size(); ++i) + { + processMessage(message_obj[i]); + } + } + else + { + // Single message + processMessage(message_obj); + } + } + catch (const std::exception& e) + { + LL_WARNS("JSONRPC") << "Exception processing JSON-RPC message: " << e.what() << LL_ENDL; + sendError(LLSD(), InternalError(e.what())); + } +} + +void LLJSONRPCConnection::processMessage(const LLSD& message_obj) +{ + try + { + // Determine if this is a request, notification, or response + if (message_obj.has("method")) + { + // This is a request or notification + if (validateMessage(message_obj, true)) + { + processRequest(message_obj); + } + } + else if (message_obj.has("result") || message_obj.has("error")) + { + // This is a response + if (validateMessage(message_obj, false)) + { + processResponse(message_obj); + } + } + else + { + LL_WARNS("JSONRPC") << "Message must contain 'method' or 'result'/'error'" << LL_ENDL; + } + } + catch (const RPCError& e) + { + LLSD id = message_obj.has("id") ? message_obj["id"] : LLSD(); + sendError(id, e); + } +} + +void LLJSONRPCConnection::processRequest(const LLSD& request) +{ + std::string method = request["method"].asString(); + LLSD params = request.has("params") ? request["params"] : LLSD(); + LLSD id = request.has("id") ? request["id"] : LLSD(); + bool is_notification = !request.has("id"); + + LL_DEBUGS("JSONRPC") << "Processing " << (is_notification ? "notification" : "request") + << " for method: " << method << LL_ENDL; + + // Find method handler + auto it = mMethodHandlers.find(method); + if (it == mMethodHandlers.end()) + { + if (!is_notification) + { + sendError(id, MethodNotFound(method)); + } + return; + } + + try + { + // Call the method handler with method name, ID, and parameters + LLSD result = it->second(method, id, params); + + if (!is_notification) + { + sendResponse(id, result); + } + } + catch (const RPCError& e) + { + if (!is_notification) + { + sendError(id, e); + } + else + { + LL_WARNS("JSONRPC") << "Error in notification handler for " << method + << ": " << e.what() << LL_ENDL; + } + } + catch (const std::exception& e) + { + if (!is_notification) + { + sendError(id, InternalError(e.what())); + } + else + { + LL_WARNS("JSONRPC") << "Exception in notification handler for " << method + << ": " << e.what() << LL_ENDL; + } + } +} + +void LLJSONRPCConnection::processResponse(const LLSD& response) +{ + if (!response.has("id")) + { + LL_WARNS("JSONRPC") << "Response missing id field" << LL_ENDL; + return; + } + + std::string id = response["id"].asString(); + auto it = mPendingRequests.find(id); + if (it == mPendingRequests.end()) + { + LL_WARNS("JSONRPC") << "Received response for unknown request id: " << id << LL_ENDL; + return; + } + + ResponseCallback callback = it->second; + mPendingRequests.erase(it); + + if (callback) + { + LLSD result = response.has("result") ? response["result"] : LLSD(); + LLSD error = response.has("error") ? response["error"] : LLSD(); + + callback(result, error); + } +} + +bool LLJSONRPCConnection::validateMessage(const LLSD& message, bool is_request) +{ + // Check JSON-RPC version + if (!message.has("jsonrpc") || message["jsonrpc"].asString() != "2.0") + { + LL_WARNS("JSONRPC") << "Missing or invalid jsonrpc version" << LL_ENDL; + return false; + } + + if (is_request) + { + // Request/notification validation + if (!message.has("method")) + { + LL_WARNS("JSONRPC") << "Missing method field" << LL_ENDL; + return false; + } + + if (!message["method"].isString()) + { + LL_WARNS("JSONRPC") << "Method must be a string" << LL_ENDL; + return false; + } + + // Params are optional but must be array or object if present + if (message.has("params")) + { + if (!message["params"].isArray() && !message["params"].isMap()) + { + LL_WARNS("JSONRPC") << "Params must be array or object" << LL_ENDL; + return false; + } + } + } + else + { + // Response validation + if (!message.has("id")) + { + LL_WARNS("JSONRPC") << "Response missing id field" << LL_ENDL; + return false; + } + + // Must have either result or error, but not both + bool has_result = message.has("result"); + bool has_error = message.has("error"); + + if (!has_result && !has_error) + { + LL_WARNS("JSONRPC") << "Response must have result or error" << LL_ENDL; + return false; + } + + if (has_result && has_error) + { + LL_WARNS("JSONRPC") << "Response cannot have both result and error" << LL_ENDL; + return false; + } + + // Error must be an object with code and message + if (has_error) + { + LLSD error = message["error"]; + if (!error.isMap()) + { + LL_WARNS("JSONRPC") << "Error must be an object" << LL_ENDL; + } + if (!error.has("code") || !error.has("message")) + { + LL_WARNS("JSONRPC") << "Error must have code and message" << LL_ENDL; + } + } + } + return true; +} + +LLSD LLJSONRPCConnection::generateId() +{ + // Server-wide atomic counter for efficient unique ID generation + // Start from 1000 to avoid conflicts with any manual test IDs + static std::atomic sRequestIdCounter{1000}; + + // Generate server-unique sequential ID + U64 id = sRequestIdCounter.fetch_add(1); + return LLSD(llformat("rpc_%llu", id)); +} + +void LLJSONRPCConnection::registerMethod(const std::string& method, MethodHandler handler) +{ + mMethodHandlers[method] = handler; + LL_DEBUGS("JSONRPC") << "Registered method: " << method << LL_ENDL; +} + +void LLJSONRPCConnection::unregisterMethod(const std::string& method) +{ + mMethodHandlers.erase(method); + LL_DEBUGS("JSONRPC") << "Unregistered method: " << method << LL_ENDL; +} + +LLSD LLJSONRPCConnection::call(const std::string& method, const LLSD& params, ResponseCallback callback) +{ + LLSD request; + request["jsonrpc"] = "2.0"; + request["method"] = method; + + if (!params.isUndefined()) + { + request["params"] = params; + } + + LLSD id = generateId(); + request["id"] = id; + + // Store callback if provided + if (callback) + { + mPendingRequests[id.asString()] = callback; + } + + // Send the request + if (!sendMessage(LlsdToJson(request))) + { + // Remove from pending if send failed + if (callback) + { + mPendingRequests.erase(id.asString()); + } + LL_WARNS("JSONRPC") << "Failed to send request" << LL_ENDL; + return LLSD(); + } + + LL_DEBUGS("JSONRPC") << "Sent request: " << method << " with id: " << id.asString() << LL_ENDL; + return id; +} + +bool LLJSONRPCConnection::notify(const std::string& method, const LLSD& params) +{ + LLSD notification; + notification["jsonrpc"] = "2.0"; + notification["method"] = method; + + if (!params.isUndefined()) + { + notification["params"] = params; + } + + // Notifications don't have an id + + if (!sendMessage(LlsdToJson(notification))) + { + LL_WARNS("JSONRPC") << "Failed to send notification" << LL_ENDL; + return false; + } + + LL_DEBUGS("JSONRPC") << "Sent notification: " << method << LL_ENDL; + return true; +} + +bool LLJSONRPCConnection::sendResponse(const LLSD& id, const LLSD& result) +{ + LLSD response; + response["jsonrpc"] = "2.0"; + response["result"] = result; + response["id"] = id; + + if (!sendMessage(LlsdToJson(response))) + { + LL_WARNS("JSONRPC") << "Failed to send response for id: " << id.asString() << LL_ENDL; + return false; + } + LL_DEBUGS("JSONRPC") << "Sent response for id: " << id.asString() << LL_ENDL; + return true; +} + +bool LLJSONRPCConnection::sendError(const LLSD& id, const RPCError& error) +{ + LLSD response; + response["jsonrpc"] = "2.0"; + + LLSD error_obj; + error_obj["code"] = error.getCode(); + error_obj["message"] = error.what(); + + if (!error.getData().isUndefined()) + { + error_obj["data"] = error.getData(); + } + + response["error"] = error_obj; + response["id"] = id.isUndefined() ? LLSD() : id; // null for parse errors + + if (!sendMessage(LlsdToJson(response))) + { + LL_WARNS("JSONRPC") << "Failed to send error response" << LL_ENDL; + return false; + } + LL_DEBUGS("JSONRPC") << "Sent error response: " << error.what() << LL_ENDL; + return true; +} + +bool LLJSONRPCConnection::sendBatch(const LLSD& batch, ResponseCallback callback) +{ + if (!batch.isArray() || batch.size() == 0) + { + LL_WARNS("JSONRPC") << "Batch must be non-empty array" << LL_ENDL; + return false; + } + + // For batch requests with callbacks, we need to track multiple responses + // This is complex as we need to correlate all responses before calling callback + // For now, we'll send the batch but won't support batch response callbacks + if (callback) + { + LL_WARNS("JSONRPC") << "Batch response callbacks not yet implemented" << LL_ENDL; + } + + if (!sendMessage(LlsdToJson(batch))) + { + LL_WARNS("JSONRPC") << "Failed to send batch" << LL_ENDL; + return false; + } + + LL_DEBUGS("JSONRPC") << "Sent batch with " << batch.size() << " messages" << LL_ENDL; + return true; +} + +//======================================================================== +// LLJSONRPCServer Implementation +//======================================================================== + +LLJSONRPCServer::LLJSONRPCServer(const std::string& name, U16 port, bool local_only) + : LLWebsocketMgr::WSServer(name, port, local_only), mServerName(name) +{ + LL_INFOS("JSONRPC") << "Created JSON-RPC server: " << name + << " on port " << port << LL_ENDL; + + // Register standard JSON-RPC methods + registerGlobalMethod("system.listMethods", [this](const std::string& method, const LLSD& id, const LLSD& params) -> LLSD { + LL_DEBUGS("JSONRPC") << "System method " << method << " called" << LL_ENDL; + return getMethodList(); + }); + + registerGlobalMethod("system.getStats", [this](const std::string& method, const LLSD& id, const LLSD& params) -> LLSD { + LL_DEBUGS("JSONRPC") << "System method " << method << " called" << LL_ENDL; + return getServerStats(); + }); + + registerGlobalMethod("system.ping", [](const std::string& method, const LLSD& id, const LLSD& params) -> LLSD { + LL_DEBUGS("JSONRPC") << "System method " << method << " called" << LL_ENDL; + LLSD result; + result["pong"] = LLDate::now().asString(); + result["params"] = params; + return result; + }); +} + +LLWebsocketMgr::WSConnection::ptr_t LLJSONRPCServer::connectionFactory(LLWebsocketMgr::WSServer::ptr_t server, + LLWebsocketMgr::connection_h handle) +{ + auto connection = std::make_shared(server, handle); + setupConnectionMethods(connection); + return connection; +} + +void LLJSONRPCServer::onConnectionOpened(const LLWebsocketMgr::WSConnection::ptr_t& connection) +{ + LL_INFOS("JSONRPC") << "JSON-RPC client connected, total connections: " + << getConnectionCount() << LL_ENDL; +} + +void LLJSONRPCServer::onConnectionClosed(const LLWebsocketMgr::WSConnection::ptr_t& connection) +{ + LL_INFOS("JSONRPC") << "JSON-RPC client disconnected, total connections: " + << getConnectionCount() << LL_ENDL; +} + +void LLJSONRPCServer::setupConnectionMethods(LLJSONRPCConnection::ptr_t connection) +{ + LLMutexLock lock(&mGlobalMethodsMutex); + + // Register all global methods on the new connection + for (const auto& [method, handler] : mGlobalMethods) + { + connection->registerMethod(method, handler); + } +} + +void LLJSONRPCServer::registerGlobalMethod(const std::string& method, MethodHandler handler) +{ + { + LLMutexLock lock(&mGlobalMethodsMutex); + mGlobalMethods[method] = handler; + } + + // Apply to all existing connections - we need to iterate through connections + // Since mConnections is private, we need to use broadcastMessage or find another approach + // For now, we'll only apply to new connections + + LL_INFOS("JSONRPC") << "Registered global method: " << method << LL_ENDL; +} + +void LLJSONRPCServer::unregisterGlobalMethod(const std::string& method) +{ + { + LLMutexLock lock(&mGlobalMethodsMutex); + mGlobalMethods.erase(method); + } + + // For existing connections, we would need access to them + // This is a limitation of the current design - methods added after connection + // establishment won't be retroactively applied + + LL_INFOS("JSONRPC") << "Unregistered global method: " << method << LL_ENDL; +} + +LLSD LLJSONRPCServer::getMethodList() const +{ + LLMutexLock lock(&mGlobalMethodsMutex); + + LLSD methods = LLSD::emptyArray(); + for (const auto& [method, handler] : mGlobalMethods) + { + methods.append(method); + } + + return methods; +} + +void LLJSONRPCServer::broadcastNotification(const std::string& method, const LLSD& params) +{ + // Use custom broadcast logic since we need to call notify() on each JSON-RPC connection + // We can't use the base broadcastMessage() because we need structured JSON-RPC messages + + // Create the notification message + LLSD notification; + notification["jsonrpc"] = "2.0"; + notification["method"] = method; + if (!params.isUndefined()) + { + notification["params"] = params; + } + + // Use the base class broadcast functionality + broadcastMessage(boost::json::serialize(LlsdToJson(notification))); + + mTotalNotificationsSent += getConnectionCount(); + LL_DEBUGS("JSONRPC") << "Broadcast notification: " << method + << " to " << getConnectionCount() << " clients" << LL_ENDL; +} + +void LLJSONRPCServer::broadcastCall(const std::string& method, const LLSD& params, + BatchResponseCallback callback) +{ + if (callback) + { + LL_WARNS("JSONRPC") << "Broadcast call response callbacks not yet implemented" << LL_ENDL; + } + + // Create the request message with a server-unique ID + LLSD request; + request["jsonrpc"] = "2.0"; + request["method"] = method; + + // Use the same ID generation as connections for consistency + static std::atomic sBroadcastIdCounter{10000000}; // Start at 10M to clearly distinguish from regular requests + U64 id = sBroadcastIdCounter.fetch_add(1); + request["id"] = LLSD(llformat("broadcast_%llu", id)); + + if (!params.isUndefined()) + { + request["params"] = params; + } + + // Use the base class broadcast functionality + broadcastMessage(boost::json::serialize(LlsdToJson(request))); + + LL_DEBUGS("JSONRPC") << "Broadcast call: " << method + << " to " << getConnectionCount() << " clients" << LL_ENDL; +} + +LLSD LLJSONRPCServer::getServerStats() const +{ + LLSD stats; + stats["server_name"] = mServerName; + stats["connection_count"] = static_cast(getConnectionCount()); + stats["is_running"] = isRunning(); + + { + LLMutexLock lock(&mGlobalMethodsMutex); + stats["global_method_count"] = static_cast(mGlobalMethods.size()); + } + + stats["total_requests_handled"] = static_cast(mTotalRequestsHandled.load()); + stats["total_notifications_sent"] = static_cast(mTotalNotificationsSent.load()); + stats["uptime"] = LLDate::now().asString(); + + return stats; +} diff --git a/indra/llcorehttp/lljsonrpcws.h b/indra/llcorehttp/lljsonrpcws.h new file mode 100644 index 00000000000..bd9939aa339 --- /dev/null +++ b/indra/llcorehttp/lljsonrpcws.h @@ -0,0 +1,461 @@ +/** + * @file lljsonrpcws.h + * @brief JSON-RPC 2.0 WebSocket server and connection implementation + * + * $LicenseInfo:firstyear=2025&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2025, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#pragma once + +#include "llwebsocketmgr.h" +#include "llsd.h" +#include "lluuid.h" + +#include +#include +#include + +/** + * @class LLJSONRPCConnection + * @brief JSON-RPC 2.0 WebSocket connection implementation + * + * This class implements the JSON-RPC 2.0 protocol over WebSocket connections. + * It handles request/response patterns, notifications, method registration, + * and error handling according to the JSON-RPC 2.0 specification. + * + * ## JSON-RPC 2.0 Protocol Features + * + * - **Requests**: Method calls that expect a response + * - **Notifications**: Method calls that do not expect a response + * - **Batch Operations**: Multiple requests/notifications in a single message + * - **Error Handling**: Standardized error codes and messages + * - **ID Correlation**: Request/response correlation using unique identifiers + * + * ## Method Handler Registration + * + * Methods use an enhanced handler signature that provides method name and request ID context: + * + * @code + * connection->registerMethod("echo", [](const std::string& method, const LLSD& id, const LLSD& params) -> LLSD { + * LL_INFOS("JSONRPC") << "Method " << method << " called with ID " << id.asString() << LL_ENDL; + * return params; // Echo back the parameters + * }); + * + * connection->registerMethod("add", [](const std::string& method, const LLSD& id, const LLSD& params) -> LLSD { + * if (params.isArray() && params.size() >= 2) { + * LL_INFOS("JSONRPC") << "Adding numbers via " << method << LL_ENDL; + * return params[0].asReal() + params[1].asReal(); + * } + * throw LLJSONRPCConnection::InvalidParams("Expected array with 2 numbers"); + * }); + * @endcode + * + * The enhanced signature enables: + * - Method context awareness for shared handlers + * - Request correlation and distributed tracing + * - Distinction between notifications (id undefined) and requests + * - Enhanced logging and error reporting with context + * + * ## Making RPC Calls + * + * @code + * // Asynchronous request with callback + * LLSD params; + * params.append(5); + * params.append(3); + * connection->call("add", params, [](const LLSD& result, const LLSD& error) { + * if (error.isUndefined()) { + * LL_INFOS() << "Result: " << result.asReal() << LL_ENDL; + * } else { + * LL_WARNS() << "Error: " << error["message"].asString() << LL_ENDL; + * } + * }); + * + * // Fire-and-forget notification + * connection->notify("log", LLSD("Server started")); + * @endcode + */ +class LLJSONRPCConnection : public LLWebsocketMgr::WSConnection +{ +public: + using ptr_t = std::shared_ptr; + + /// Method handler function signature + /// @param method The method name that was called + /// @param id The request ID (undefined for notifications) + /// @param params The parameters passed to the method + /// @return The result to return to the caller + /// @throw RPCError-derived exceptions for error responses + using MethodHandler = std::function; + + /// Response callback function signature + /// @param result The result from a successful call (undefined if error occurred) + /// @param error The error object if call failed (undefined if successful) + using ResponseCallback = std::function; + + /** + * @brief JSON-RPC error base class + */ + class RPCError : public std::runtime_error + { + public: + // JSON-RPC 2.0 Standard Error Codes + static constexpr S32 PARSE_ERROR = -32700; ///< Invalid JSON was received by the server + static constexpr S32 INVALID_REQUEST = -32600; ///< The JSON sent is not a valid Request object + static constexpr S32 METHOD_NOT_FOUND = -32601; ///< The method does not exist / is not available + static constexpr S32 INVALID_PARAMS = -32602; ///< Invalid method parameter(s) + static constexpr S32 INTERNAL_ERROR = -32603; ///< Internal JSON-RPC error + + // Server Error Range (-32000 to -32099) + static constexpr S32 SERVER_ERROR_MIN = -32099; ///< Server error range minimum + static constexpr S32 SERVER_ERROR_MAX = -32000; ///< Server error range maximum + + // Common server-specific errors + static constexpr S32 CONNECTION_CLOSED = -32000; ///< Connection closed unexpectedly + static constexpr S32 REQUEST_TIMEOUT = -32001; ///< Request timed out + static constexpr S32 UNAUTHORIZED = -32002; ///< Authentication required + static constexpr S32 FORBIDDEN = -32003; ///< Access denied + static constexpr S32 RATE_LIMITED = -32004; ///< Too many requests + static constexpr S32 SERVICE_UNAVAILABLE = -32005; ///< Service temporarily unavailable + static constexpr S32 MESSAGE_TOO_LARGE = -32006; ///< Message exceeds maximum size + static constexpr S32 INVALID_SESSION = -32007; ///< Session expired or invalid + + RPCError(S32 code, const std::string& message, const LLSD& data = LLSD()) + : std::runtime_error(message), mCode(code), mData(data) {} + + S32 getCode() const { return mCode; } + const LLSD& getData() const { return mData; } + + protected: + S32 mCode; + LLSD mData; + }; + + /// Standard JSON-RPC error classes using named constants + class ParseError : public RPCError { + public: + ParseError(const std::string& details = "") + : RPCError(PARSE_ERROR, "Parse error" + (details.empty() ? "" : ": " + details)) {} + }; + + class InvalidRequest : public RPCError { + public: + InvalidRequest(const std::string& details = "") + : RPCError(INVALID_REQUEST, "Invalid Request" + (details.empty() ? "" : ": " + details)) {} + }; + + class MethodNotFound : public RPCError { + public: + MethodNotFound(const std::string& method = "") + : RPCError(METHOD_NOT_FOUND, "Method not found" + (method.empty() ? "" : ": " + method)) {} + }; + + class InvalidParams : public RPCError { + public: + InvalidParams(const std::string& details = "") + : RPCError(INVALID_PARAMS, "Invalid params" + (details.empty() ? "" : ": " + details)) {} + }; + + class InternalError : public RPCError { + public: + InternalError(const std::string& details = "") + : RPCError(INTERNAL_ERROR, "Internal error" + (details.empty() ? "" : ": " + details)) {} + }; + + /// Server-specific errors (in the -32000 to -32099 range) + class ConnectionClosedError : public RPCError { + public: + ConnectionClosedError(const std::string& details = "Connection closed") + : RPCError(CONNECTION_CLOSED, details) {} + }; + + class RequestTimeoutError : public RPCError { + public: + RequestTimeoutError(const std::string& details = "Request timed out") + : RPCError(REQUEST_TIMEOUT, details) {} + }; + + class UnauthorizedError : public RPCError { + public: + UnauthorizedError(const std::string& details = "Authentication required") + : RPCError(UNAUTHORIZED, details) {} + }; + + class ForbiddenError : public RPCError { + public: + ForbiddenError(const std::string& details = "Access denied") + : RPCError(FORBIDDEN, details) {} + }; + + class RateLimitedError : public RPCError { + public: + RateLimitedError(const std::string& details = "Too many requests") + : RPCError(RATE_LIMITED, details) {} + }; + + class ServiceUnavailableError : public RPCError { + public: + ServiceUnavailableError(const std::string& details = "Service temporarily unavailable") + : RPCError(SERVICE_UNAVAILABLE, details) {} + }; + + class MessageTooLargeError : public RPCError { + public: + MessageTooLargeError(const std::string& details = "Message exceeds maximum size") + : RPCError(MESSAGE_TOO_LARGE, details) {} + }; + + class InvalidSessionError : public RPCError { + public: + InvalidSessionError(const std::string& details = "Session expired or invalid") + : RPCError(INVALID_SESSION, details) {} + }; + + + LLJSONRPCConnection(const LLWebsocketMgr::WSServer::ptr_t server, + const LLWebsocketMgr::connection_h& handle) + : LLWebsocketMgr::WSConnection(server, handle) {} + + virtual ~LLJSONRPCConnection() = default; + + // WebSocket connection lifecycle + void onOpen() override; + void onClose() override; + void onMessage(const std::string& message) override; + + /** + * @brief Register a method handler + * @param method The method name to register + * @param handler The function to call when this method is invoked + */ + void registerMethod(const std::string& method, MethodHandler handler); + + /** + * @brief Unregister a method handler + * @param method The method name to unregister + */ + void unregisterMethod(const std::string& method); + + /** + * @brief Make an asynchronous JSON-RPC call + * @param method The method name to call + * @param params The parameters to pass + * @param callback Callback for the response (optional) + * @return The request ID for correlation + */ + LLSD call(const std::string& method, const LLSD& params = LLSD(), + ResponseCallback callback = nullptr); + + /** + * @brief Send a JSON-RPC notification (no response expected) + * @param method The method name + * @param params The parameters to pass + */ + bool notify(const std::string& method, const LLSD& params = LLSD()); + + /** + * @brief Send a successful response to a request + * @param id The request ID from the original request + * @param result The result to return + */ + bool sendResponse(const LLSD& id, const LLSD& result); + + /** + * @brief Send an error response to a request + * @param id The request ID from the original request (can be null) + * @param error The RPCError to send + */ + bool sendError(const LLSD& id, const RPCError& error); + + /** + * @brief Send a batch of requests/notifications + * @param batch Array of request/notification objects + * @param callback Callback for batch response (optional) + */ + bool sendBatch(const LLSD& batch, ResponseCallback callback = nullptr); + +protected: + /** + * @brief Process a single JSON-RPC message + * @param message_obj The parsed JSON message + */ + void processMessage(const LLSD& message_obj); + + /** + * @brief Process a JSON-RPC request + * @param request The request object + */ + void processRequest(const LLSD& request); + + /** + * @brief Process a JSON-RPC response + * @param response The response object + */ + void processResponse(const LLSD& response); + + /** + * @brief Validate a JSON-RPC message structure + * @param message The message to validate + * @param is_request True if validating a request, false for response + */ + bool validateMessage(const LLSD& message, bool is_request = true); + + /** + * @brief Generate the next unique request ID + * @return A server-unique request ID + * + * Generates a server-wide unique identifier using an atomic counter. + * This ensures request IDs are unique across all connections within the + * server instance, providing efficient ID generation with guaranteed uniqueness. + * + * IDs follow the format "rpc_{counter}" where counter is a monotonically + * increasing 64-bit value starting from 1. This approach provides: + * - Guaranteed uniqueness within server scope + * - High performance (atomic increment operation) + * - Predictable, sequential ordering for debugging + * - Thread-safe generation across multiple connections + */ + LLSD generateId(); + +private: + std::unordered_map mMethodHandlers; + std::unordered_map mPendingRequests; +}; + +/** + * @class LLJSONRPCServer + * @brief JSON-RPC 2.0 WebSocket server implementation + * + * This server extends the basic WebSocket server to provide JSON-RPC 2.0 + * protocol support. It manages JSON-RPC connections and provides server-wide + * method registration and broadcasting capabilities. + * + * ## Server-Wide Method Registration + * + * Methods can be registered at the server level and will be available + * on all connections: + * + * @code + * auto server = std::make_shared("rpc_server", 8080); + * + * server->registerGlobalMethod("getServerInfo", [](const std::string& method, const LLSD& id, const LLSD& params) -> LLSD { + * LL_INFOS("JSONRPC") << "Server info requested via " << method << LL_ENDL; + * LLSD info; + * info["name"] = "My RPC Server"; + * info["version"] = "1.0.0"; + * info["uptime"] = LLDate::now().secondsSinceEpoch(); + * return info; + * }); + * + * server->registerGlobalMethod("listMethods", [server](const std::string& method, const LLSD& id, const LLSD& params) -> LLSD { + * return server->getMethodList(); + * }); + * @endcode + * + * ## Broadcasting and Multi-client Operations + * + * @code + * // Broadcast notification to all connected clients + * server->broadcastNotification("serverAlert", LLSD("Server will restart in 5 minutes")); + * + * // Call a method on all clients and collect responses + * server->broadcastCall("getClientStatus", LLSD(), [](const LLSD& responses) { + * for (const auto& response : llsd::inArray(responses)) { + * LL_INFOS() << "Client status: " << response << LL_ENDL; + * } + * }); + * @endcode + */ +class LLJSONRPCServer : public LLWebsocketMgr::WSServer +{ +public: + using ptr_t = std::shared_ptr; + using MethodHandler = LLJSONRPCConnection::MethodHandler; + using ResponseCallback = LLJSONRPCConnection::ResponseCallback; + using BatchResponseCallback = std::function; + + LLJSONRPCServer(const std::string& name, U16 port, bool local_only = true); + virtual ~LLJSONRPCServer() = default; + + // Server lifecycle callbacks + void onConnectionOpened(const LLWebsocketMgr::WSConnection::ptr_t& connection) override; + void onConnectionClosed(const LLWebsocketMgr::WSConnection::ptr_t& connection) override; + + /** + * @brief Register a global method available on all connections + * @param method The method name to register + * @param handler The function to call when this method is invoked + */ + void registerGlobalMethod(const std::string& method, MethodHandler handler); + + /** + * @brief Unregister a global method + * @param method The method name to unregister + */ + void unregisterGlobalMethod(const std::string& method); + + /** + * @brief Get list of registered global methods + * @return Array of method names + */ + LLSD getMethodList() const; + + /** + * @brief Broadcast a notification to all connected clients + * @param method The method name + * @param params The parameters to pass + */ + void broadcastNotification(const std::string& method, const LLSD& params = LLSD()); + + /** + * @brief Call a method on all connected clients + * @param method The method name + * @param params The parameters to pass + * @param callback Callback to receive aggregated responses + */ + void broadcastCall(const std::string& method, const LLSD& params = LLSD(), + BatchResponseCallback callback = nullptr); + + /** + * @brief Get server statistics + * @return Statistics object with connection count, method count, etc. + */ + LLSD getServerStats() const; + +protected: + LLWebsocketMgr::WSConnection::ptr_t connectionFactory(LLWebsocketMgr::WSServer::ptr_t server, + LLWebsocketMgr::connection_h handle) override; + + /** + * @brief Apply global method handlers to a new connection + * @param connection The connection to configure + */ + virtual void setupConnectionMethods(LLJSONRPCConnection::ptr_t connection); + +private: + std::unordered_map mGlobalMethods; + mutable LLMutex mGlobalMethodsMutex; + + std::string mServerName; // Store server name for stats + std::atomic mTotalRequestsHandled{0}; + std::atomic mTotalNotificationsSent{0}; +}; diff --git a/indra/llcorehttp/llwebsocketmgr.cpp b/indra/llcorehttp/llwebsocketmgr.cpp new file mode 100644 index 00000000000..ea87d1e07e5 --- /dev/null +++ b/indra/llcorehttp/llwebsocketmgr.cpp @@ -0,0 +1,674 @@ +/** + * @file llwebsocketmgr.cpp + * @brief WebSocket manager singleton implementation + * + * $LicenseInfo:firstyear=2025&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2025, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "linden_common.h" + +#include "llwebsocketmgr.h" +#include "llerror.h" +#include "llsdserialize.h" +#include "llhost.h" +#include "llsdjson.h" + +#include +#include +#include +#include + +#include +#include +#include + +//------------------------------------------------------------------------ +namespace +{ + using Server_t = websocketpp::server; + using Client_t = websocketpp::client; + using Connection_t = websocketpp::connection; +} + +//------------------------------------------------------------------------ + +//------------------------------------------------------------------------ +// LLWebsocketMgr Implementation +// + +void LLWebsocketMgr::initSingleton() +{ } + +void LLWebsocketMgr::cleanupSingleton() +{ + stopAllServers(); +} + +void LLWebsocketMgr::update() +{ + std::vector stops; + + for (auto &[name, server] : mServers) + { + if (server && server->isRunning()) + { + if (!server->update()) + { + stops.push_back(server); + } + } + } + + for (const auto& server : stops) + { + if (server) + { + LL_DEBUGS("WebSocket") << "Stopping server: " << server->mServerName << LL_ENDL; + removeServer(server->mServerName); + } + } +} + + +LLWebsocketMgr::WSServer::ptr_t LLWebsocketMgr::findServerByName(const std::string &name) const +{ + auto it = mServers.find(std::string(name)); + if (it != mServers.end()) + { + return it->second; + } + return nullptr; +} + +bool LLWebsocketMgr::addServer(const LLWebsocketMgr::WSServer::ptr_t& server) +{ + if (!server) + { + LL_WARNS("WebSocket") << "Attempted to add a null server" << LL_ENDL; + return false; + } + + auto it = mServers.find(server->mServerName); + if (it != mServers.end()) + { + LL_WARNS("WebSocket") << "Server with name " << server->mServerName << " already exists" << LL_ENDL; + return false; + } + mServers[server->mServerName] = server; + LL_INFOS("WebSocket") << "Added WebSocket server: " << server->mServerName << LL_ENDL; + return true; +} + +bool LLWebsocketMgr::removeServer(const std::string& name) +{ + auto it = mServers.find(name); + if (it == mServers.end()) + { + LL_WARNS("WebSocket") << "No server found with name " << name << " to remove" << LL_ENDL; + return false; + } + if (it->second && it->second->isRunning()) + it->second->stop(); + mServers.erase(it); + LL_INFOS("WebSocket") << "Removed WebSocket server: " << name << LL_ENDL; + return true; +} + + +bool LLWebsocketMgr::startServer(const std::string &name) const +{ + LLWebsocketMgr::WSServer::ptr_t server = findServerByName(name); + if (!server) + { + LL_WARNS("WebSocket") << "No server found with name " << name << " to start" << LL_ENDL; + return false; + } + if (server->isRunning()) + { + LL_WARNS("WebSocket") << "Server " << name << " is already running" << LL_ENDL; + return false; + } + return server->start(); +} + +void LLWebsocketMgr::stopServer(const std::string& name) const +{ + LLWebsocketMgr::WSServer::ptr_t server = findServerByName(name); + if (!server) + { + LL_WARNS("WebSocket") << "No server found with name " << name << " to stop" << LL_ENDL; + return; + } + if (!server->isRunning()) + { + LL_WARNS("WebSocket") << "Server " << name << " is not running" << LL_ENDL; + return; + } + server->stop(); +} + +void LLWebsocketMgr::stopAllServers() +{ + for (auto &[name, server] : mServers) + { + if (server && server->isRunning()) + { + LL_INFOS("WebSocket") << "Stopping server: " << name << LL_ENDL; + server->stop(); + } + } + + mServers.clear(); +} + +//------------------------------------------------------------------------ +struct Server_impl +{ + Server_impl(LLWebsocketMgr::WSServer *owner, U16 port, bool local_only) : + mOwner(owner), + mPort(port), + mLocalOnly(local_only) + { + + mServer.set_open_handler([this](websocketpp::connection_hdl hdl) { this->onOpen(hdl); }); + mServer.set_close_handler([this](websocketpp::connection_hdl hdl) { this->onClose(hdl); }); + mServer.set_message_handler([this](websocketpp::connection_hdl hdl, Server_t::message_ptr msg) { this->onMessage(hdl, msg); }); + } + + ~Server_impl() = default; + + /** + * @brief Initialize the websocketpp server and configure listening + * + * Performs the initial setup of the websocketpp server by calling init_asio() + * to initialize the ASIO networking layer, then configures the server to listen + * on the specified port. The binding behavior depends on the mLocalOnly flag: + * - If mLocalOnly is true: binds to "127.0.0.1" (localhost only) + * - If mLocalOnly is false: binds to all available network interfaces + */ + void init() + { + mServer.init_asio(); + try { + if (mLocalOnly) + { + std::stringstream port_str; + port_str << mPort; + mServer.listen("127.0.0.1", port_str.str()); + } + else + { + mServer.listen(mPort); + } + } + catch (const websocketpp::exception& e) + { + LL_WARNS("WebSocket") << "WebSocket server listen exception: " << e.what() << LL_ENDL; + } + catch (const std::exception& e) + { + LL_WARNS("WebSocket") << "WebSocket server listen std::exception: " << e.what() << LL_ENDL; + } + catch (...) + { + LL_WARNS("WebSocket") << "WebSocket server listen unknown exception" << LL_ENDL; + } + } + + /** + * @brief Start the websocket server and begin accepting connections + * @return true if server started successfully, false on error + */ + bool start() + { + //if (!mServer.stopped()) + //{ + // LL_WARNS("WebSocket") << "WebSocket server is already running" << LL_ENDL; + // return false; + //} + + try + { + LL_INFOS("WebSocket") << "Starting WebSocket server on port " << mPort + << (mLocalOnly ? " (localhost only)" : " (all interfaces)") << LL_ENDL; + mServer.start_accept(); + + // Run controlled event loop with periodic stop flag checking + while (!mOwner->mShouldStop && !mServer.stopped()) + { + // Process events for up to 100ms, then check the stop flag + std::chrono::milliseconds timeout(100); + std::size_t handlers_run = mServer.get_io_service().run_for(timeout); + + // If no handlers were run and the server isn't stopped, + // reset the io_service for the next iteration + if (handlers_run == 0 && !mServer.stopped() && !mOwner->mShouldStop) + { + mServer.get_io_service().restart(); + } + } + + LL_INFOS("WebSocket") << "WebSocket server event loop exited cleanly" << LL_ENDL; + return true; + } + catch (const websocketpp::exception& e) + { + LL_WARNS("WebSocket") << "WebSocket server exception: " << e.what() << LL_ENDL; + return false; + } + catch (const std::exception& e) + { + LL_WARNS("WebSocket") << "WebSocket server std::exception: " << e.what() << LL_ENDL; + return false; + } + catch (...) + { + LL_WARNS("WebSocket") << "WebSocket server unknown exception" << LL_ENDL; + return false; + } + } + + void stop() + { + if (mServer.stopped()) + { + return; + } + try + { + mServer.stop_listening(); + mServer.stop(); + } + catch (const std::exception&) + { + LL_WARNS("WebSocket") << "Error stopping WebSocket server" << LL_ENDL; + } + } + + /** + * @brief Handle new connection establishment event + * @param hdl WebSocket connection handle from websocketpp + * + * Called automatically by the websocketpp library when a new client connection + * is successfully established. This method serves as a bridge between the + * low-level websocketpp callback and the high-level WSServer interface. + */ + void onOpen(websocketpp::connection_hdl hdl) const + { + LL_ERRS_IF(!mOwner, "WebSocket") << "mOwner should never be null. If it is, something is very wrong!" << LL_ENDL; + + mOwner->handleOpenConnection(hdl); + } + + /** + * @brief Handle connection closure event + * @param hdl WebSocket connection handle from websocketpp + */ + void onClose(websocketpp::connection_hdl hdl) const + { + LL_ERRS_IF(!mOwner, "WebSocket") << "mOwner should never be null" << LL_ENDL; + mOwner->handleCloseConnection(hdl); + } + + /** + * @brief Handle incoming message from client + * @param hdl WebSocket connection handle identifying the sender + * @param msg Shared pointer to the message object containing payload and metadata + * + * Called automatically by the websocketpp library when a complete message is + * received from a client. This method validates the connection exists, extracts + * the message payload, and forwards it to the appropriate connection handler. + * + * Currently handles text messages only. + */ + void onMessage(websocketpp::connection_hdl hdl, Server_t::message_ptr msg) const + { + LL_ERRS_IF(!mOwner, "WebSocket") << "mOwner should never be null" << LL_ENDL; + LLWebsocketMgr::WSConnection::ptr_t connection = mOwner->getConnection(hdl); + if (!connection) + { + LL_WARNS("WebSocket") << "Received message for unknown connection" << LL_ENDL; + return; + } + + // TODO: check the FIN bit and handle fragmented messages if needed + // TODO: check terminal and close codes and handle connection closure if needed + mOwner->handleMessage(hdl, msg->get_payload()); + } + + //------------------------------------------- + Server_t mServer; ///< The underlying websocketpp server instance + LLWebsocketMgr::WSServer* mOwner{ nullptr }; ///< Back-reference to the owning WSServer instance (guaranteed non-null) + U16 mPort{ 0 }; ///< TCP port number the server listens on + bool mLocalOnly{ true }; ///< Whether to bind to localhost only (true) or all interfaces (false) +}; + +//------------------------------------------------------------------------ +LLWebsocketMgr::WSServer::WSServer(std::string_view name, U16 port, bool local_only): + mServerName(name), + mImpl(std::make_unique(this, port, local_only)) +{ + mImpl->init(); + + // Initialize the server with the given name and host + LL_INFOS("WebSocket") << "Creating WebSocket server: " << name << + " listening " << (mImpl->mLocalOnly ? "locally" : "ON ALL INTERFACES") << + " on port " << mImpl->mPort << LL_ENDL; +} + +LLWebsocketMgr::WSServer::~WSServer() +{ + // Ensure the server is stopped before destruction + stop(); +} + +LLWebsocketMgr::WSConnection::ptr_t LLWebsocketMgr::WSServer::connectionFactory(LLWebsocketMgr::WSServer::ptr_t server, + LLWebsocketMgr::connection_h handle) +{ + return std::make_shared(server, handle); +} + +bool LLWebsocketMgr::WSServer::start() +{ + LL_ERRS_IF(!mImpl, "WebSocket") << "WebSocket server " << mServerName << " implementation is null !" << LL_ENDL; + + LLMutexLock lock(&mThreadMutex); + + // Check if already running + if (isRunning()) + { + LL_WARNS("WebSocket") << "Server " << mServerName << " is already running" << LL_ENDL; + return false; + } + + // Reset the stop flag + mShouldStop = false; + + // Start the server thread + mServerThread = std::thread([this]() { + LL_INFOS("WebSocket") << "WebSocket server thread starting for: " << mServerName << LL_ENDL; + + // Run the controlled server loop that checks the stop flag + // Server_impl accesses mShouldStop through the mOwner pointer + bool success = mImpl->start(); + + if (!success) + { + LL_WARNS("WebSocket") << "WebSocket server thread failed to start for: " << mServerName << LL_ENDL; + } + + LL_INFOS("WebSocket") << "WebSocket server thread exiting for: " << mServerName << LL_ENDL; + }); + + onStarted(); + LL_INFOS("WebSocket") << "Started WebSocket server thread: " << mServerName << LL_ENDL; + return true; +} + +void LLWebsocketMgr::WSServer::stop() +{ + LL_ERRS_IF(!mImpl, "WebSocket") << "WebSocket server " << mServerName << " implementation is null !" << LL_ENDL; + + { + LLMutexLock lock(&mThreadMutex); + + // Check if already stopped + if (!isRunning()) + { + return; + } + + LL_INFOS("WebSocket") << "Stopping WebSocket server: " << mServerName << LL_ENDL; + + mShouldStop = true; + + // Stop the websocket server (this will cause the controlled run loop to exit) + mImpl->stop(); + } // Release the lock here + + if (mServerThread.joinable()) + { + mServerThread.join(); + LL_INFOS("WebSocket") << "WebSocket server thread joined for: " << mServerName << LL_ENDL; + } + onStopped(); +} + +bool LLWebsocketMgr::WSServer::isRunning() const +{ + LL_ERRS_IF(!mImpl, "WebSocket") << "WebSocket server " << mServerName << " implementation is null !" << LL_ENDL; + + // Check both the thread state, websocket server state, and the stop flag + return mServerThread.joinable() && !mImpl->mServer.stopped() && !mShouldStop; +} + +void LLWebsocketMgr::WSServer::broadcastMessage(const std::string& message) +{ + LL_ERRS_IF(!mImpl, "WebSocket") << "WebSocket server " << mServerName << " implementation is null !" << LL_ENDL; + LLMutexLock lock(&mConnectionMutex); + for (const auto& [handle, conn] : mConnections) + { + sendMessageTo(handle, message); + } +} + +bool LLWebsocketMgr::WSServer::sendMessageTo(const connection_h& handle, const std::string& message) +{ + LL_ERRS_IF(!mImpl, "WebSocket") << "WebSocket server " << mServerName << " implementation is null !" << LL_ENDL; + websocketpp::lib::error_code ec; + mImpl->mServer.send(handle, message, websocketpp::frame::opcode::text, ec); + if (ec) + { + LL_WARNS("WebSocket") << mServerName << " failed to send message: " << ec.message() << LL_ENDL; + return false; + } + return true; +} + +bool LLWebsocketMgr::WSServer::closeConnection(const connection_h& handle, U16 code, const std::string& reason) +{ + LL_ERRS_IF(!mImpl, "WebSocket") << "WebSocket server " << mServerName << " implementation is null !" << LL_ENDL; + + try + { + websocketpp::lib::error_code ec; + mImpl->mServer.close(handle, code, reason, ec); + if (ec) + { + LL_WARNS("WebSocket") << mServerName << " failed to close connection: " << ec.message() << LL_ENDL; + return false; + } + + LL_INFOS("WebSocket") << mServerName << " initiated close for connection with code " + << code << " and reason: " << reason << LL_ENDL; + return true; + } + catch (const websocketpp::exception& e) + { + LL_WARNS("WebSocket") << mServerName << " exception closing connection: " << e.what() << LL_ENDL; + return false; + } + catch (const std::exception& e) + { + LL_WARNS("WebSocket") << mServerName << " std::exception closing connection: " << e.what() << LL_ENDL; + return false; + } + catch (...) + { + LL_WARNS("WebSocket") << mServerName << " unknown exception closing connection" << LL_ENDL; + return false; + } +} + +LLWebsocketMgr::WSConnection::ptr_t LLWebsocketMgr::WSServer::getConnection(const connection_h& handle) +{ + LLMutexLock lock(&mConnectionMutex); + auto it = mConnections.find(handle); + if (it != mConnections.end()) + { + return it->second; + } + return nullptr; +} + +LLWebsocketMgr::connection_state_t LLWebsocketMgr::WSServer::getConnectionState(const connection_h& handle) const +{ + websocketpp::lib::error_code ec; + auto con = mImpl->mServer.get_con_from_hdl(handle, ec); + if (ec) + { + LL_WARNS("WebSocket") << mServerName << " failed to get connection state: " << ec.message() << LL_ENDL; + websocketpp::session::state::value state = websocketpp::session::state::closed; + return connection_closed; + } + return static_cast(con->get_state()); +} + + +void LLWebsocketMgr::WSServer::handleOpenConnection(const connection_h& handle) +{ + WSConnection::ptr_t connection; + size_t size(0); + { + LLMutexLock lock(&mConnectionMutex); + auto it = mConnections.find(handle); + if (it == mConnections.end()) + { + connection = connectionFactory(shared_from_this(), handle); + if (!connection) + { + LL_WARNS("WebSocket") << "Failed to create connection for websocket server " << mServerName << LL_ENDL; + return; + } + mConnections[handle] = connection; + } + else + { + connection = it->second; + } + + if (!connection) + { + LL_WARNS("WebSocket") << mServerName << " failed to create connection object" << LL_ENDL; + return; + } + // Removed redundant assignment to mConnections[handle] + size = mConnections.size(); + } + + onConnectionOpened(connection); // TODO: consider letting the server reject the connection here + connection->onOpen(); + LL_INFOS("WebSocket") << mServerName << " opened new connection, total connections: " << size << LL_ENDL; +} + +void LLWebsocketMgr::WSServer::handleCloseConnection(const connection_h& handle) +{ + size_t size(0); + WSConnection::ptr_t connection; + { + LLMutexLock lock(&mConnectionMutex); + auto it = mConnections.find(handle); + if (it != mConnections.end()) + { + connection = it->second; + mConnections.erase(it); + } + size = mConnections.size(); + } + if (connection) + { + connection->onClose(); + onConnectionClosed(connection); + LL_INFOS("WebSocket") << mServerName << " closed connection, total connections: " << size << LL_ENDL; + } + else + { + LL_WARNS("WebSocket") << mServerName << " attempted to close unknown connection" << LL_ENDL; + } +} + +void LLWebsocketMgr::WSServer::handleMessage(const connection_h& handle, const std::string& message) +{ + WSConnection::ptr_t connection = getConnection(handle); + if (connection) + { + connection->onMessage(message); + } + else + { + LL_WARNS("WebSocket") << mServerName << " received message for unknown connection" << LL_ENDL; + } +} + +//------------------------------------------------------------------------ +bool LLWebsocketMgr::WSConnection::sendMessage(const std::string& message) const +{ + if (mOwningServer.expired()) + { + LL_WARNS("WebSocket") << "Attempted to send message on connection with null server reference" << LL_ENDL; + return false; + } + return mOwningServer.lock()->sendMessageTo(mConnectionHandle, message); +} + +bool LLWebsocketMgr::WSConnection::sendMessage(const boost::json::value& json) const +{ + std::string message = boost::json::serialize(json); + return sendMessage(message); +} + +bool LLWebsocketMgr::WSConnection::sendMessage(const LLSD& data) const +{ + return sendMessage(LlsdToJson(data)); +} + +void LLWebsocketMgr::WSConnection::closeConnection(U16 code, const std::string& reason) +{ + if (mOwningServer.expired()) + { + LL_WARNS("WebSocket") << "Attempted to close connection with null server reference" << LL_ENDL; + return; + } + + LL_INFOS("WebSocket") << "WSConnection closing connection with code " << code + << " and reason: " << (reason.empty() ? "(no reason)" : reason) << LL_ENDL; + + if (!mOwningServer.lock()->closeConnection(mConnectionHandle, code, reason)) + { + LL_WARNS("WebSocket") << "Failed to close connection through server" << LL_ENDL; + } +} + +bool LLWebsocketMgr::WSConnection::isConnected() const +{ + if (mOwningServer.expired()) + { + return false; + } + + LLWebsocketMgr::WSServer::ptr_t server = mOwningServer.lock(); + if (!server) + { + return false; + } + return server->getConnectionState(mConnectionHandle) == connection_open; +} diff --git a/indra/llcorehttp/llwebsocketmgr.h b/indra/llcorehttp/llwebsocketmgr.h new file mode 100644 index 00000000000..4165b3cecc4 --- /dev/null +++ b/indra/llcorehttp/llwebsocketmgr.h @@ -0,0 +1,305 @@ +/** + * @file llwebsocketmgr.h + * @brief WebSocket manager singleton for managing WebSocket servers and connections + * + * $LicenseInfo:firstyear=2025&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2025, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#pragma once + +#include "llsingleton.h" +#include "llsd.h" +#include "lluuid.h" +#include "llhost.h" +#include "llmutex.h" + +#include +#include +#include +#include +#include +#include + +#include + +#include + +struct Server_impl; + +/** + * @class LLWebsocketMgr + * @brief Singleton manager for WebSocket connections and servers + * + * This class provides a high-level interface for managing WebSocket connections + * and servers using websocketpp library. It handles both client and server + * connections, provides thread-safe operations, and integrates with the + * existing Linden Lab infrastructure. + */ +class LLWebsocketMgr: public LLSingleton +{ + LLSINGLETON(LLWebsocketMgr) = default; + virtual ~LLWebsocketMgr() = default; + LOG_CLASS(LLWebsocketMgr); + +public: + using connection_h = websocketpp::connection_hdl; + class WSServer; + + enum connection_state_t + { // must map to websocketpp::session::state + connection_connecting = 0, + connection_open = 1, + connection_closing = 2, + connection_closed = 3 + }; + + class WSConnection + { + friend class LLWebsocketMgr; + + public: + using ptr_t = std::shared_ptr; + + /** + * @brief Constructor for WSConnection + * @param server Shared pointer to the parent WSServer + * @param handle WebSocket connection handle from websocketpp + */ + WSConnection(const std::shared_ptr &server, const connection_h& handle): + mConnectionHandle(handle), + mOwningServer(server) + {} + + virtual ~WSConnection() = default; + + /** + * Override this method in derived classes to handle connection establishment. + * This is called after the WebSocket handshake is complete and the connection + * is ready to send/receive messages. + */ + virtual void onOpen() {} + + /** + * Override this method in derived classes to handle connection closure. + * This is called when the connection has been terminated, either normally + * or due to an error condition. + */ + virtual void onClose() {} + + /** + * @brief Called when a message is received + * @param message The received message as a string + * + * Override this method in derived classes to handle incoming messages. + * Currently only text messages are supported. + */ + virtual void onMessage(const std::string& message) {} + + /** + * @brief Send a message to the connected client + * @param message The message string to send + * @return true if the message was queued successfully, false on error + * + * Sends a text message to the remote endpoint. The message is queued + * asynchronously and may not be sent immediately. + */ + bool sendMessage(const std::string& message) const; + bool sendMessage(const boost::json::value& json) const; + bool sendMessage(const LLSD& data) const; + + /** + * @brief Close the WebSocket connection gracefully + * @param code Optional close code (default: normal closure) + * @param reason Optional reason string (default: empty) + * + * Initiates a graceful WebSocket close handshake. The connection will + * send a close frame with the specified code and reason, then wait for + * the remote endpoint to respond with its own close frame before + * actually closing the underlying TCP connection. + * + * Common close codes: + * - 1000: Normal closure (default) + * - 1001: Going away (server shutting down, page navigating away) + * - 1002: Protocol error + * - 1003: Unsupported data type + * - 1008: Policy violation + * - 1009: Message too big + * + * @note After calling this method, no further messages should be sent + * @note The onClose() callback will be invoked when the close handshake completes + */ + void closeConnection(U16 code = 1000, const std::string& reason = std::string()); + + bool isConnected() const; + + protected: + connection_h mConnectionHandle; + std::weak_ptr mOwningServer; // Back-reference to the server this connection belongs to + }; + + /** + * @class WSServer + * @brief Base class for WebSocket servers with customizable connection handling + * + * WSServer provides a high-level abstraction over websocketpp servers, handling + * threading, connection management, and event dispatching. Derive from this class + * to create custom WebSocket servers with application-specific logic. + * + * ## Basic Usage + * + * @code + * class MyServer : public LLWebsocketMgr::WSServer + * { + * public: + * MyServer(const std::string& name, U16 port) + * : WSServer(name, port, false) // Listen on all interfaces + * {} + * + * void onConnectionOpened(const WSConnection::ptr_t& connection) override + * { + * LL_INFOS("MyServer") << "New client connected" << LL_ENDL; + * // Send welcome message + * connection->sendMessage("Welcome to the server!"); + * } + * + * void onConnectionClosed(const WSConnection::ptr_t& connection) override + * { + * LL_INFOS("MyServer") << "Client disconnected" << LL_ENDL; + * } + * + * protected: + * // Use custom connection class + * WSConnection::ptr_t connectionFactory(WSServer::ptr_t server, connection_h handle) override + * { + * return std::make_shared(server, handle); + * } + * }; + * @endcode + * + * ## Connection Management + * + * The server automatically manages connection lifetimes and provides several ways + * to interact with connections: + * + * - `broadcastMessage()` - Send message to all connected clients + * - `sendMessageTo()` - Send message to specific connection + * - `closeConnection()` - Close specific connection with code/reason + * - `getConnection()` - Get connection object by handle + * + * ## Thread Safety + * + * All public methods are thread-safe and can be called from any thread. The server + * runs its own background thread for handling WebSocket events, while connection + * callbacks are also executed on this background thread. + */ + class WSServer: public std::enable_shared_from_this + { + friend struct Server_impl; + friend class WSConnection; + friend class LLWebsocketMgr; + + public: + using ptr_t = std::shared_ptr; + + WSServer(std::string_view name, U16 port, bool local_only = true); + virtual ~WSServer(); + + virtual void onStarted() {} + virtual void onStopped() {} + + virtual void onConnectionOpened(const WSConnection::ptr_t& connection) { } + virtual void onConnectionClosed(const WSConnection::ptr_t& connection) { } + + bool isRunning() const; + size_t getConnectionCount() const + { + LLMutexLock lock(&mConnectionMutex); + return mConnections.size(); + } + + void broadcastMessage(const std::string& message); + virtual bool update() { return true; } + + connection_state_t getConnectionState(const connection_h& handle) const; + + protected: + virtual WSConnection::ptr_t connectionFactory(WSServer::ptr_t server, connection_h handle); + + bool start(); + void stop(); + + bool sendMessageTo(const connection_h& handle, const std::string& message); + + /** + * @brief Close a specific connection gracefully + * @param handle The connection handle to close + * @param code Close code (default: normal closure) + * @param reason Close reason string (default: empty) + * @return true if close was initiated successfully, false on error + * + * Internal method used by WSConnection to close individual connections. + * This method is thread-safe and can be called from any thread. + */ + bool closeConnection(const connection_h& handle, U16 code = 1000, const std::string& reason = std::string()); + + private: + using connection_map_t = std::map >; + + WSConnection::ptr_t getConnection(const connection_h& handle); + + void handleOpenConnection(const connection_h& handle); + void handleCloseConnection(const connection_h& handle); + void handleMessage(const connection_h& handle, const std::string& message); + + std::string mServerName; + std::unique_ptr mImpl; + connection_map_t mConnections; + mutable LLMutex mConnectionMutex; + + // Threading support + std::thread mServerThread; ///< Thread running the ASIO event loop + std::atomic mShouldStop{ false }; ///< Thread-safe stop flag + mutable LLMutex mThreadMutex; ///< Mutex for thread synchronization + }; + + // Server and Connection Management + WSServer::ptr_t findServerByName(const std::string &name) const; + + bool addServer(const WSServer::ptr_t& server); + bool removeServer(const std::string &name); + + bool startServer(const std::string &name) const; + void stopServer(const std::string &name) const; + + void update(); + +protected: + void initSingleton() override; + void cleanupSingleton() override; + +private: + using server_map_t = std::map; + + void stopAllServers(); + + server_map_t mServers; +}; diff --git a/indra/llcrashlogger/llcrashlogger.cpp b/indra/llcrashlogger/llcrashlogger.cpp index b1b698375aa..d5c585b45e0 100644 --- a/indra/llcrashlogger/llcrashlogger.cpp +++ b/indra/llcrashlogger/llcrashlogger.cpp @@ -576,10 +576,6 @@ bool LLCrashLogger::init() std::string old_log_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "crashreport.log.old"); std::string log_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "crashreport.log"); -#if LL_WINDOWS - LLAPRFile::remove(old_log_file); -#endif - LLFile::rename(log_file.c_str(), old_log_file.c_str()); // Set the log file to crashreport.log diff --git a/indra/llfilesystem/lldir_utils_objc.mm b/indra/llfilesystem/lldir_utils_objc.mm index 01fe9e1f2cc..35513d56479 100644 --- a/indra/llfilesystem/lldir_utils_objc.mm +++ b/indra/llfilesystem/lldir_utils_objc.mm @@ -1,28 +1,28 @@ -/** +/** * @file lldir_utils_objc.mm * @brief Cocoa implementation of directory utilities for macOS * * $LicenseInfo:firstyear=2020&license=viewerlgpl$ * Second Life Viewer Source Code * Copyright (C) 2020, Linden Research, Inc. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; * version 2.1 of the License only. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * + * * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ - */ + */ #if LL_DARWIN //WARNING: This file CANNOT use standard linden includes due to conflicts between definitions of BOOL @@ -39,18 +39,18 @@ tempDir = @"/tmp"; result = std::string([tempDir UTF8String]); } - + return result; } -//findSystemDirectory scoped exclusively to this file. +//findSystemDirectory scoped exclusively to this file. std::string findSystemDirectory(NSSearchPathDirectory searchPathDirectory, NSSearchPathDomainMask domainMask) { std::string result; @autoreleasepool { NSString *path = nil; - + // Search for the path NSArray* paths = NSSearchPathForDirectoriesInDomains(searchPathDirectory, domainMask, @@ -60,10 +60,10 @@ path = [paths objectAtIndex:0]; //HACK: Always attempt to create directory, ignore errors. NSError *error = nil; - + [[NSFileManager defaultManager] createDirectoryAtPath:path withIntermediateDirectories:YES attributes:nil error:&error]; - - + + result = std::string([path UTF8String]); } } @@ -88,7 +88,7 @@ NSString *bundlePath = [[NSBundle mainBundle] resourcePath]; result = std::string([bundlePath UTF8String]); } - + return result; } @@ -102,7 +102,7 @@ { return findSystemDirectory (NSApplicationSupportDirectory, NSUserDomainMask); - + } #endif // LL_DARWIN diff --git a/indra/llfilesystem/llfilesystem.cpp b/indra/llfilesystem/llfilesystem.cpp index 5ce5244107d..541266af4f6 100644 --- a/indra/llfilesystem/llfilesystem.cpp +++ b/indra/llfilesystem/llfilesystem.cpp @@ -103,9 +103,6 @@ bool LLFileSystem::renameFile(const LLUUID& old_file_id, const LLAssetType::ETyp const std::string old_filename = LLDiskCache::metaDataToFilepath(old_file_id, old_file_type); const std::string new_filename = LLDiskCache::metaDataToFilepath(new_file_id, new_file_type); - // Rename needs the new file to not exist. - LLFileSystem::removeFile(new_file_id, new_file_type, ENOENT); - if (LLFile::rename(old_filename, new_filename) != 0) { // We would like to return false here indicating the operation diff --git a/indra/llimagej2coj/llimagej2coj.cpp b/indra/llimagej2coj/llimagej2coj.cpp index 5fa53657a08..7cfadb889dd 100644 --- a/indra/llimagej2coj/llimagej2coj.cpp +++ b/indra/llimagej2coj/llimagej2coj.cpp @@ -554,11 +554,6 @@ class JPEG2KEncode : public JPEG2KBase } - if (!opj_setup_encoder(encoder, ¶meters, image)) - { - return false; - } - U32 width_tiles = (rawImageIn.getWidth() >> 6); U32 height_tiles = (rawImageIn.getHeight() >> 6); @@ -572,6 +567,19 @@ class JPEG2KEncode : public JPEG2KBase height_tiles = 1; } + if (width_tiles == 1 || height_tiles == 1) + { + // Images with either dimension less than 32 need less number of resolutions otherwise they error + int min_dim = rawImageIn.getWidth() < rawImageIn.getHeight() ? rawImageIn.getWidth() : rawImageIn.getHeight(); + int max_res = 1 + (int)floor(log2(min_dim)); + parameters.numresolution = max_res; + } + + if (!opj_setup_encoder(encoder, ¶meters, image)) + { + return false; + } + U32 tile_count = width_tiles * height_tiles; U32 data_size_guess = tile_count * TILE_SIZE; diff --git a/indra/llinventory/llpermissions.cpp b/indra/llinventory/llpermissions.cpp index ebf7445c65c..b17e22e4650 100644 --- a/indra/llinventory/llpermissions.cpp +++ b/indra/llinventory/llpermissions.cpp @@ -774,6 +774,7 @@ void LLPermissions::importLLSD(const LLSD& sd_perm) } } + fixOwnership(); fix(); } diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index 7c602536186..b3cb278d599 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -5713,6 +5713,8 @@ bool LLVolumeFace::cacheOptimize(bool gen_tangents) { try { + // providing mIndices should help avoid unused vertices + // but those should have been filtered out on upload vert_count = static_cast(meshopt_generateVertexRemapMulti(&remap[0], nullptr, data.p.size(), data.p.size(), mos, stream_count)); } catch (std::bad_alloc&) @@ -5722,10 +5724,16 @@ bool LLVolumeFace::cacheOptimize(bool gen_tangents) } } - if (vert_count < 65535 && vert_count != 0) + // Probably should be using meshopt_remapVertexBuffer instead of remaping manually + if (vert_count < 65535 && vert_count > 0) { //copy results back into volume resizeVertices(vert_count); + if (mNumVertices == 0) + { + LLError::LLUserWarningMsg::showOutOfMemory(); + LL_ERRS("LLCoros") << "Failed to allocate memory for resizeVertices(" << vert_count << ")" << LL_ENDL; + } if (!data.w.empty()) { @@ -5738,13 +5746,27 @@ bool LLVolumeFace::cacheOptimize(bool gen_tangents) { U32 src_idx = i; U32 dst_idx = remap[i]; - if (dst_idx >= (U32)mNumVertices) + if (dst_idx == U32_MAX) + { + // Unused indices? Probably need to resize mIndices + dst_idx = mNumVertices - 1; + llassert(false); + LL_DEBUGS_ONCE("LLVOLUME") << "U32_MAX destination index, substituting" << LL_ENDL; + } + else if (dst_idx >= (U32)mNumVertices) { dst_idx = mNumVertices - 1; // Shouldn't happen, figure out what gets returned in remap and why. llassert(false); LL_DEBUGS_ONCE("LLVOLUME") << "Invalid destination index, substituting" << LL_ENDL; } + if (src_idx >= (U32)data.p.size()) + { + // data.p.size() is supposed to be equal to mNumIndices + src_idx = (U32)(data.p.size() - 1); + llassert(false); + LL_DEBUGS_ONCE("LLVOLUME") << "Invalid source index, substituting" << LL_ENDL; + } mIndices[i] = dst_idx; mPositions[dst_idx].load3(data.p[src_idx].mV); @@ -5778,7 +5800,7 @@ bool LLVolumeFace::cacheOptimize(bool gen_tangents) } else { - if (vert_count == 0) + if (vert_count <= 0) { LL_WARNS_ONCE("LLVOLUME") << "meshopt_generateVertexRemapMulti failed to process a model or model was invalid" << LL_ENDL; } diff --git a/indra/llmessage/llcoproceduremanager.cpp b/indra/llmessage/llcoproceduremanager.cpp index 563dd9459c3..5c7b1c42350 100644 --- a/indra/llmessage/llcoproceduremanager.cpp +++ b/indra/llmessage/llcoproceduremanager.cpp @@ -138,7 +138,22 @@ LLCoprocedureManager::LLCoprocedureManager() LLCoprocedureManager::~LLCoprocedureManager() { - close(); + try + { + close(); + } + catch (const boost::fibers::fiber_error&) + { + LL_WARNS() << "Fiber error during ~LLCoprocedureManager()" << LL_ENDL; + } + catch (const std::exception& e) + { + // Shutting down, just log it + LL_WARNS() << "Exception during ~LLCoprocedureManager(): " << e.what() << LL_ENDL; + } + mPropertyQueryFn.clear(); + mPropertyDefineFn.clear(); + mPoolMap.clear(); } void LLCoprocedureManager::initializePool(const std::string &poolName, size_t queue_size) @@ -365,6 +380,22 @@ LLCoprocedurePool::LLCoprocedurePool(const std::string &poolName, size_t size, s LLCoprocedurePool::~LLCoprocedurePool() { + try + { + close(); // should have been closed already, but shouldn't hurt + mStatusListener.disconnect(); + mPendingCoprocs.reset(); + mCoroMapping.clear(); + } + catch (const boost::fibers::fiber_error&) + { + LL_WARNS() << "Fiber error during ~LLCoprocedurePool() " << mPoolName << LL_ENDL; + } + catch (const std::exception& e) + { + // Shutting down, just log it + LL_WARNS() << "Exception " << e.what() << " during ~LLCoprocedurePool() in " << mPoolName << LL_ENDL; + } } //------------------------------------------------------------------------- diff --git a/indra/llmessage/message_prehash.cpp b/indra/llmessage/message_prehash.cpp index 21dbf35783a..f42cbfdac7a 100644 --- a/indra/llmessage/message_prehash.cpp +++ b/indra/llmessage/message_prehash.cpp @@ -714,6 +714,9 @@ char const* const _PREHASH_FirstName = LLMessageStringTable::getInstance()->getS char const* const _PREHASH_AttachedSoundGainChange = LLMessageStringTable::getInstance()->getString("AttachedSoundGainChange"); char const* const _PREHASH_LocationID = LLMessageStringTable::getInstance()->getString("LocationID"); char const* const _PREHASH_Running = LLMessageStringTable::getInstance()->getString("Running"); +char const* const _PREHASH_Mono = LLMessageStringTable::getInstance()->getString("Mono"); +char const* const _PREHASH_Luau = LLMessageStringTable::getInstance()->getString("Luau"); +char const* const _PREHASH_LuauLanguage = LLMessageStringTable::getInstance()->getString("LuauLanguage"); char const* const _PREHASH_AgentThrottle = LLMessageStringTable::getInstance()->getString("AgentThrottle"); char const* const _PREHASH_NeighborList = LLMessageStringTable::getInstance()->getString("NeighborList"); char const* const _PREHASH_PathTaperX = LLMessageStringTable::getInstance()->getString("PathTaperX"); diff --git a/indra/llmessage/message_prehash.h b/indra/llmessage/message_prehash.h index 8a2ad1587c8..53f8123b353 100644 --- a/indra/llmessage/message_prehash.h +++ b/indra/llmessage/message_prehash.h @@ -714,6 +714,9 @@ extern char const* const _PREHASH_FirstName; extern char const* const _PREHASH_AttachedSoundGainChange; extern char const* const _PREHASH_LocationID; extern char const* const _PREHASH_Running; +extern char const* const _PREHASH_Mono; +extern char const* const _PREHASH_Luau; +extern char const* const _PREHASH_LuauLanguage; extern char const* const _PREHASH_AgentThrottle; extern char const* const _PREHASH_NeighborList; extern char const* const _PREHASH_PathTaperX; diff --git a/indra/llphysicsextensionsos/CMakeLists.txt b/indra/llphysicsextensionsos/CMakeLists.txt new file mode 100644 index 00000000000..c04115ef26b --- /dev/null +++ b/indra/llphysicsextensionsos/CMakeLists.txt @@ -0,0 +1,47 @@ +# -*- cmake -*- + +project(llphysicsextensionsos) + +include(00-Common) +include(LLCommon) +include(LLMath) +include(VHACD) + +set(llphysicsextensionsos_SOURCE_FILES + llconvexdecomposition.cpp + llconvexdecompositionvhacd.cpp + llpathinglib.cpp + LLPathingLibStubImpl.cpp + llphysicsextensions.cpp + LLPhysicsExtensionsStubImpl.cpp + ) + +set(llphysicsextensionsos_HEADER_FILES + CMakeLists.txt + llconvexdecomposition.h + llconvexdecompositionvhacd.h + llpathinglib.h + LLPathingLibStubImpl.h + llphysicsextensions.h + LLPhysicsExtensionsStubImpl.h + ) + +set_source_files_properties(${llphysicsextensionsos_HEADER_FILES} + PROPERTIES HEADER_FILE_ONLY TRUE) + +list(APPEND llphysicsextensionsos_SOURCE_FILES ${llphysicsextensionsos_HEADER_FILES}) + +add_library (llphysicsextensionsos ${llphysicsextensionsos_SOURCE_FILES}) +target_include_directories(llphysicsextensionsos INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) + +target_link_libraries(llphysicsextensionsos + llcommon + llmath + ll::vhacd) + +if(WINDOWS) + target_compile_options(llphysicsextensionsos PRIVATE /bigobj) +endif() + +# Add tests + diff --git a/indra/llphysicsextensionsos/LLPathingLibStubImpl.cpp b/indra/llphysicsextensionsos/LLPathingLibStubImpl.cpp new file mode 100644 index 00000000000..9830fd1ad01 --- /dev/null +++ b/indra/llphysicsextensionsos/LLPathingLibStubImpl.cpp @@ -0,0 +1,109 @@ +/** +* @file LLPathingLibStubImpl.cpp +* @author prep@lindenlab.com +* @brief A stubbed implementation of LLPathingLib +* +* $LicenseInfo:firstyear=2012&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 20112010, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ + +#include "linden_common.h" + +#include "llpathinglib.h" +#include "LLPathingLibStubImpl.h" + +#include "llsd.h" + +//============================================================================= +LLPathingLibImpl::LLPathingLibImpl() +{ +} + +LLPathingLibImpl::~LLPathingLibImpl() +{ + +} + +LLPathingLib* LLPathingLibImpl::getInstance() +{ + return NULL; +} + + +LLPathingLib::LLPLResult LLPathingLibImpl::initSystem() +{ + return LLPL_NOT_IMPLEMENTED; +} + +LLPathingLib::LLPLResult LLPathingLibImpl::quitSystem() +{ + return LLPL_NOT_IMPLEMENTED; +} + +LLPathingLib::LLPLResult LLPathingLibImpl::extractNavMeshSrcFromLLSD( const LLSD::Binary& dataBlock, int dir ) +{ + return LLPL_NOT_IMPLEMENTED; +} + +void LLPathingLibImpl::processNavMeshData() +{ +} + +LLPathingLibImpl::LLPLResult LLPathingLibImpl::generatePath( const PathingPacket& pathingPacket ) +{ + return LLPL_NOT_IMPLEMENTED; +} + +void LLPathingLibImpl::setNavMeshMaterialType( LLPLCharacterType materialType ) +{ +} + +void LLPathingLibImpl::setNavMeshColors( const NavMeshColors& color ) +{ +} + +void LLPathingLibImpl::renderNavMesh() +{ +} + +void LLPathingLibImpl::renderNavMeshEdges() +{ +} + +void LLPathingLibImpl::renderNavMeshShapesVBO( U32 shapeRenderFlags ) +{ +} + +void LLPathingLibImpl::renderPath() +{ +} + +void LLPathingLibImpl::renderPathBookend( LLRender& gl, LLPathingLib::LLPLPathBookEnd type ) +{ +} + +void LLPathingLibImpl::cleanupVBOManager() +{ +} + +void LLPathingLibImpl::cleanupResidual() +{ +} diff --git a/indra/llphysicsextensionsos/LLPathingLibStubImpl.h b/indra/llphysicsextensionsos/LLPathingLibStubImpl.h new file mode 100644 index 00000000000..8a97566e8c8 --- /dev/null +++ b/indra/llphysicsextensionsos/LLPathingLibStubImpl.h @@ -0,0 +1,78 @@ +/** +* @file LLPathingLibSubImpl.h +* @author prep@lindenlab.com +* @brief A stubbed implementation of LLPathingLib +* +* $LicenseInfo:firstyear=2012&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2012, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ + +#ifndef LL_PATHING_LIB_H +#define LL_PATHING_LIB_H + +#include "llpathinglib.h" + +class LLSD; + +//============================================================================= +class LLPathingLibImpl : public LLPathingLib +{ +public: + LLPathingLibImpl(); + virtual ~LLPathingLibImpl(); + + // Obtain a pointer to the actual implementation + static LLPathingLib* getInstance(); + static LLPathingLib::LLPLResult initSystem(); + static LLPathingLib::LLPLResult quitSystem(); + + //Extract and store navmesh data from the llsd datablock sent down by the server + virtual LLPLResult extractNavMeshSrcFromLLSD( const LLSD::Binary& dataBlock, int dir ); + //Stitch any stored navmeshes together + virtual void processNavMeshData(); + + //Method used to generate and visualize a path on the viewers navmesh + virtual LLPLResult generatePath( const PathingPacket& pathingPacket ); + + //Set the material type for the heatmap type + virtual void setNavMeshMaterialType( LLPLCharacterType materialType ); + //Set the various navmesh colors + virtual void setNavMeshColors( const NavMeshColors& color ); + + //The entry method to rendering the client side navmesh + virtual void renderNavMesh(); + //The entry method to rendering the client side navmesh edges + virtual void renderNavMeshEdges(); + //The entry method to render the client navmesh shapes VBO + virtual void renderNavMeshShapesVBO( U32 shapeRenderFlags ); + //The entry method to render the clients designated path + virtual void renderPath(); + //The entry method to render the capsule bookends for the clients designated path + virtual void renderPathBookend( LLRender& gl, LLPathingLib::LLPLPathBookEnd type ); + + //Method to delete any vbo's that are currently being managed by the pathing library + virtual void cleanupVBOManager(); + //Method to cleanup any allocations within the implementation + virtual void cleanupResidual(); +}; + +#endif //LL_PATHING_LIB_H + diff --git a/indra/llphysicsextensionsos/LLPhysicsExtensionsStubImpl.cpp b/indra/llphysicsextensionsos/LLPhysicsExtensionsStubImpl.cpp new file mode 100644 index 00000000000..8401e16e9cf --- /dev/null +++ b/indra/llphysicsextensionsos/LLPhysicsExtensionsStubImpl.cpp @@ -0,0 +1,51 @@ +/** +* @file LLPhysicsExtensionsStubImpl.cpp +* @author prep@lindenlab.com +* @brief A stubbed implementation of LLPhysicsExtensions +* +* $LicenseInfo:firstyear=2012&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2012, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ + +#include "linden_common.h" + +#include "llphysicsextensions.h" +#include "LLPhysicsExtensionsStubImpl.h" + +//============================================================================= +LLPhysicsExtensionsImpl::LLPhysicsExtensionsImpl() +{ +} + +LLPhysicsExtensionsImpl::~LLPhysicsExtensionsImpl() +{ +} + +bool LLPhysicsExtensionsImpl::initSystem() +{ + return false; +} + +bool LLPhysicsExtensionsImpl::quitSystem() +{ + return false; +} + diff --git a/indra/llphysicsextensionsos/LLPhysicsExtensionsStubImpl.h b/indra/llphysicsextensionsos/LLPhysicsExtensionsStubImpl.h new file mode 100644 index 00000000000..135f92bb88f --- /dev/null +++ b/indra/llphysicsextensionsos/LLPhysicsExtensionsStubImpl.h @@ -0,0 +1,46 @@ +/** +* @file LLPhysicsExtensionsSubImpl.h +* @author prep@lindenlab.com +* @brief A stubbed implementation of LLPhysicsExtensions +* +* $LicenseInfo:firstyear=2012&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2012, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ + +#ifndef LL_PHYSICS_EXTENSIONS_STUB_IMPL_H +#define LL_PHYSICS_EXTENSIONS_STUB_IMPL_H + +#include "llphysicsextensions.h" + +//============================================================================= +class LLPhysicsExtensionsImpl : public LLPhysicsExtensions +{ + public: + + LLPhysicsExtensionsImpl(); + virtual ~LLPhysicsExtensionsImpl(); + + static bool initSystem(); + static bool quitSystem(); +}; + +#endif //LL_PHYSICS_EXTENSIONS_STUB_IMPL_H + diff --git a/indra/llphysicsextensionsos/llconvexdecomposition.cpp b/indra/llphysicsextensionsos/llconvexdecomposition.cpp new file mode 100644 index 00000000000..7b9d775c537 --- /dev/null +++ b/indra/llphysicsextensionsos/llconvexdecomposition.cpp @@ -0,0 +1,83 @@ +/** +* @file llconvexdecomposition.cpp +* @author falcon@lindenlab.com +* @brief Inner implementation of LLConvexDecomposition interface +* +* $LicenseInfo:firstyear=2011&license=lgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2011, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ + +#include "linden_common.h" + +#include "llconvexdecompositionvhacd.h" +#include "llconvexdecomposition.h" + +bool LLConvexDecomposition::s_isInitialized = false; + +// static +bool LLConvexDecomposition::isFunctional() +{ + return LLConvexDecompositionVHACD::isFunctional(); +} + +// static +LLConvexDecomposition* LLConvexDecomposition::getInstance() +{ + if ( !s_isInitialized ) + { + return nullptr; + } + else + { + return LLConvexDecompositionVHACD::getInstance(); + } +} + +// static +LLCDResult LLConvexDecomposition::initSystem() +{ + LLCDResult result = LLConvexDecompositionVHACD::initSystem(); + if ( result == LLCD_OK ) + { + s_isInitialized = true; + } + return result; +} + +// static +LLCDResult LLConvexDecomposition::initThread() +{ + return LLConvexDecompositionVHACD::initThread(); +} + +// static +LLCDResult LLConvexDecomposition::quitThread() +{ + return LLConvexDecompositionVHACD::quitThread(); +} + +// static +LLCDResult LLConvexDecomposition::quitSystem() +{ + return LLConvexDecompositionVHACD::quitSystem(); +} + + diff --git a/indra/llphysicsextensionsos/llconvexdecomposition.h b/indra/llphysicsextensionsos/llconvexdecomposition.h new file mode 100644 index 00000000000..8008bc6e123 --- /dev/null +++ b/indra/llphysicsextensionsos/llconvexdecomposition.h @@ -0,0 +1,231 @@ +/** + * @file llconvexdecomposition.cpp + * @brief LLConvexDecomposition interface definition + * + * $LicenseInfo:firstyear=2011&license=lgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2011, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_CONVEX_DECOMPOSITION +#define LL_CONVEX_DECOMPOSITION + +typedef int bool32; + +#if defined(_WIN32) || defined(_WIN64) +#define LLCD_CALL __cdecl +#else +#define LLCD_CALL +#endif + +struct LLCDParam +{ + enum LLCDParamType + { + LLCD_INVALID = 0, + LLCD_INTEGER, + LLCD_FLOAT, + LLCD_BOOLEAN, + LLCD_ENUM + }; + + struct LLCDEnumItem + { + const char* mName; + int mValue; + }; + + union LLCDValue + { + float mFloat; + int mIntOrEnumValue; + bool32 mBool; + }; + + union LLCDParamDetails + { + struct { + LLCDValue mLow; + LLCDValue mHigh; + LLCDValue mDelta; + } mRange; + + struct { + int mNumEnums; + LLCDEnumItem* mEnumsArray; + } mEnumValues; + }; + + const char* mName; + const char* mDescription; + LLCDParamType mType; + LLCDParamDetails mDetails; + LLCDValue mDefault; + int mStage; + + // WARNING: Only the LLConvexDecomposition implementation + // should change this value + int mReserved; +}; + +struct LLCDStageData +{ + const char* mName; + const char* mDescription; + bool32 mSupportsCallback; +}; + +struct LLCDMeshData +{ + enum IndexType + { + INT_16, + INT_32 + }; + + const float* mVertexBase; + int mVertexStrideBytes; + int mNumVertices; + const void* mIndexBase; + IndexType mIndexType; + int mIndexStrideBytes; + int mNumTriangles; +}; + +struct LLCDHull +{ + const float* mVertexBase; + int mVertexStrideBytes; + int mNumVertices; +}; + +enum LLCDResult +{ + LLCD_OK = 0, + LLCD_UNKOWN_ERROR, + LLCD_NULL_PTR, + LLCD_INVALID_STAGE, + LLCD_UNKNOWN_PARAM, + LLCD_BAD_VALUE, + LLCD_REQUEST_OUT_OF_RANGE, + LLCD_INVALID_MESH_DATA, + LLCD_INVALID_HULL_DATA, + LLCD_STAGE_NOT_READY, + LLCD_INVALID_THREAD, + LLCD_NOT_IMPLEMENTED +}; + +// This callback will receive a string describing the current subtask being performed +// as well as a pair of numbers indicating progress. (The values should not be interpreted +// as a completion percentage as 'current' may be greater than 'final'.) +// If the callback returns zero, the decomposition will be terminated +typedef int (LLCD_CALL *llcdCallbackFunc)(const char* description, int current_progress, int final_progress); + +class LLConvexDecomposition +{ +public: + // Obtain a pointer to the actual implementation + static LLConvexDecomposition* getInstance(); + + /// @returns false if this is the stub + static bool isFunctional(); + + static LLCDResult initSystem(); + static LLCDResult initThread(); + static LLCDResult quitThread(); + static LLCDResult quitSystem(); + + // Generate a decomposition object handle + virtual void genDecomposition(int& decomp) = 0; + // Delete decomposition object handle + virtual void deleteDecomposition(int decomp) = 0; + // Bind given decomposition handle + // Commands operate on currently bound decomposition + virtual void bindDecomposition(int decomp) = 0; + + // Sets *paramsOut to the address of the LLCDParam array and returns + // the number of parameters + virtual int getParameters(const LLCDParam** paramsOut) = 0; + + + // Sets *stagesOut to the address of the LLCDStageData array and returns + // the number of stages + virtual int getStages(const LLCDStageData** stagesOut) = 0; + + + // Set a parameter by name. Pass enum values as integers. + virtual LLCDResult setParam(const char* name, float val) = 0; + virtual LLCDResult setParam(const char* name, int val) = 0; + virtual LLCDResult setParam(const char* name, bool val) = 0; + + + // Set incoming mesh data. Data is copied to local buffers and will + // persist until the next setMeshData call + virtual LLCDResult setMeshData( const LLCDMeshData* data, bool vertex_based ) = 0; + + + // Register a callback to be called periodically during the specified stage + // See the typedef above for more information + virtual LLCDResult registerCallback( int stage, llcdCallbackFunc callback ) = 0; + + + // Execute the specified decomposition stage + virtual LLCDResult executeStage(int stage) = 0; + virtual LLCDResult buildSingleHull() = 0 ; + + + // Gets the number of hulls generated by the specified decompositions stage + virtual int getNumHullsFromStage(int stage) = 0; + + + // Populates hullOut to reference the internal copy of the requested hull + // The data will persist only until the next executeStage call for that stage. + virtual LLCDResult getHullFromStage( int stage, int hull, LLCDHull* hullOut ) = 0; + + virtual LLCDResult getSingleHull( LLCDHull* hullOut ) = 0 ; + + + // TODO: Implement lock of some kind to disallow this call if data not yet ready + // Populates the meshDataOut to reference the utility's copy of the mesh geometry + // for the hull and stage specified. + // You must copy this data if you want to continue using it after the next executeStage + // call + virtual LLCDResult getMeshFromStage( int stage, int hull, LLCDMeshData* meshDataOut) = 0; + + + // Creates a mesh from hullIn and temporarily stores it internally in the utility. + // The mesh data persists only until the next call to getMeshFromHull + virtual LLCDResult getMeshFromHull( LLCDHull* hullIn, LLCDMeshData* meshOut ) = 0; + + // Takes meshIn, generates a single convex hull from it, converts that to a mesh + // stored internally, and populates meshOut to reference the internally stored data. + // The data is persistent only until the next call to generateSingleHullMeshFromMesh + virtual LLCDResult generateSingleHullMeshFromMesh( LLCDMeshData* meshIn, LLCDMeshData* meshOut) = 0; + + // + /// Debug + virtual void loadMeshData(const char* fileIn, LLCDMeshData** meshDataOut) = 0; + +private: + static bool s_isInitialized; +}; + +#endif //LL_CONVEX_DECOMPOSITION + diff --git a/indra/llphysicsextensionsos/llconvexdecompositionvhacd.cpp b/indra/llphysicsextensionsos/llconvexdecompositionvhacd.cpp new file mode 100644 index 00000000000..78876f9f365 --- /dev/null +++ b/indra/llphysicsextensionsos/llconvexdecompositionvhacd.cpp @@ -0,0 +1,492 @@ +/** +* @file llconvexdecompositionvhacd.cpp +* @author rye@alchemyviewer.org +* @brief A VHACD based implementation of LLConvexDecomposition +* +* $LicenseInfo:firstyear=2025&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2025, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ + +#include "linden_common.h" + +#include "llmath.h" +#include "v3math.h" + +#include +#include + +#define ENABLE_VHACD_IMPLEMENTATION 1 +#include "VHACD.h" + +#include "llconvexdecompositionvhacd.h" + +constexpr S32 MAX_HULLS = 256; +constexpr S32 MAX_VERTICES_PER_HULL = 256; + +bool LLConvexDecompositionVHACD::isFunctional() +{ + return true; +} + +LLConvexDecomposition* LLConvexDecompositionVHACD::getInstance() +{ + return LLSimpleton::getInstance(); +} + +LLCDResult LLConvexDecompositionVHACD::initSystem() +{ + createInstance(); + return LLCD_OK; +} + +LLCDResult LLConvexDecompositionVHACD::initThread() +{ + return LLCD_OK; +} + +LLCDResult LLConvexDecompositionVHACD::quitThread() +{ + return LLCD_OK; +} + +LLCDResult LLConvexDecompositionVHACD::quitSystem() +{ + deleteSingleton(); + return LLCD_OK; +} + +LLConvexDecompositionVHACD::LLConvexDecompositionVHACD() +{ + //Create our vhacd instance and setup default parameters + mVHACD = VHACD::CreateVHACD(); + + mVHACDParameters.m_callback = &mVHACDCallback; + mVHACDParameters.m_logger = &mVHACDLogger; + + mDecompStages[0].mName = "Analyze"; + mDecompStages[0].mDescription = nullptr; + + LLCDParam param; + param.mName = "Fill Mode"; + param.mDescription = nullptr; + param.mType = LLCDParam::LLCD_ENUM; + param.mDetails.mEnumValues.mNumEnums = 3; + + static LLCDParam::LLCDEnumItem fill_enums[3]; + fill_enums[(size_t)VHACD::FillMode::FLOOD_FILL].mName = "Flood"; + fill_enums[(size_t)VHACD::FillMode::FLOOD_FILL].mValue = (int)VHACD::FillMode::FLOOD_FILL; + fill_enums[(size_t)VHACD::FillMode::SURFACE_ONLY].mName = "Surface Only"; + fill_enums[(size_t)VHACD::FillMode::SURFACE_ONLY].mValue = (int)VHACD::FillMode::SURFACE_ONLY; + fill_enums[(size_t)VHACD::FillMode::RAYCAST_FILL].mName = "Raycast"; + fill_enums[(size_t)VHACD::FillMode::RAYCAST_FILL].mValue = (int)VHACD::FillMode::RAYCAST_FILL; + + param.mDetails.mEnumValues.mEnumsArray = fill_enums; + param.mDefault.mIntOrEnumValue = (int)VHACD::FillMode::FLOOD_FILL; + param.mStage = 0; + param.mReserved = -1; + mDecompParams.push_back(param); + + enum EVoxelQualityLevels + { + E_LOW_QUALITY = 0, + E_NORMAL_QUALITY, + E_HIGH_QUALITY, + E_VERY_HIGH_QUALITY, + E_ULTRA_QUALITY, + E_MAX_QUALITY, + E_NUM_QUALITY_LEVELS + }; + + param.mName = "Voxel Resolution"; + param.mDescription = nullptr; + param.mType = LLCDParam::LLCD_ENUM; + param.mDetails.mEnumValues.mNumEnums = E_NUM_QUALITY_LEVELS; + + static LLCDParam::LLCDEnumItem voxel_quality_enums[E_NUM_QUALITY_LEVELS]; + voxel_quality_enums[E_LOW_QUALITY].mName = "Low"; + voxel_quality_enums[E_LOW_QUALITY].mValue = 200000; + voxel_quality_enums[E_NORMAL_QUALITY].mName = "Normal"; + voxel_quality_enums[E_NORMAL_QUALITY].mValue = 400000; + voxel_quality_enums[E_HIGH_QUALITY].mName = "High"; + voxel_quality_enums[E_HIGH_QUALITY].mValue = 800000; + voxel_quality_enums[E_VERY_HIGH_QUALITY].mName = "Very High"; + voxel_quality_enums[E_VERY_HIGH_QUALITY].mValue = 1200000; + voxel_quality_enums[E_ULTRA_QUALITY].mName = "Ultra"; + voxel_quality_enums[E_ULTRA_QUALITY].mValue = 1600000; + voxel_quality_enums[E_MAX_QUALITY].mName = "Maximum"; + voxel_quality_enums[E_MAX_QUALITY].mValue = 2000000; + + param.mDetails.mEnumValues.mEnumsArray = voxel_quality_enums; + param.mDefault.mIntOrEnumValue = 400000; + param.mStage = 0; + param.mReserved = -1; + mDecompParams.push_back(param); + + param.mName = "Num Hulls"; + param.mDescription = nullptr; + param.mType = LLCDParam::LLCD_FLOAT; + param.mDetails.mRange.mLow.mFloat = 1.f; + param.mDetails.mRange.mHigh.mFloat = MAX_HULLS; + param.mDetails.mRange.mDelta.mFloat = 1.f; + param.mDefault.mFloat = 8.f; + param.mStage = 0; + param.mReserved = -1; + mDecompParams.push_back(param); + + param.mName = "Num Vertices"; + param.mDescription = nullptr; + param.mType = LLCDParam::LLCD_FLOAT; + param.mDetails.mRange.mLow.mFloat = 3.f; + param.mDetails.mRange.mHigh.mFloat = MAX_VERTICES_PER_HULL; + param.mDetails.mRange.mDelta.mFloat = 1.f; + param.mDefault.mFloat = 32.f; + param.mStage = 0; + param.mReserved = -1; + mDecompParams.push_back(param); + + param.mName = "Error Tolerance"; + param.mDescription = nullptr; + param.mType = LLCDParam::LLCD_FLOAT; + param.mDetails.mRange.mLow.mFloat = 0.0001f; + param.mDetails.mRange.mHigh.mFloat = 99.f; + param.mDetails.mRange.mDelta.mFloat = 0.001f; + param.mDefault.mFloat = 1.f; + param.mStage = 0; + param.mReserved = -1; + mDecompParams.push_back(param); + + for (const LLCDParam& param : mDecompParams) + { + const char* const name = param.mName; + + switch (param.mType) + { + case LLCDParam::LLCD_FLOAT: + { + setParam(name, param.mDefault.mFloat); + break; + } + case LLCDParam::LLCD_ENUM: + case LLCDParam::LLCD_INTEGER: + { + setParam(name, param.mDefault.mIntOrEnumValue); + break; + } + case LLCDParam::LLCD_BOOLEAN: + { + setParam(name, (param.mDefault.mBool != 0)); + break; + } + case LLCDParam::LLCD_INVALID: + default: + { + break; + } + } + } +} + +LLConvexDecompositionVHACD::~LLConvexDecompositionVHACD() +{ + mBoundDecomp = nullptr; + mDecompData.clear(); + + mVHACD->Release(); +} + +void LLConvexDecompositionVHACD::genDecomposition(int& decomp) +{ + int new_decomp_id = static_cast(mDecompData.size()) + 1; + mDecompData[new_decomp_id] = LLDecompData(); + decomp = new_decomp_id; +} + +void LLConvexDecompositionVHACD::deleteDecomposition(int decomp) +{ + auto iter = mDecompData.find(decomp); + if (iter != mDecompData.end()) + { + if (mBoundDecomp == &iter->second) + { + mBoundDecomp = nullptr; + } + mDecompData.erase(iter); + } +} + +void LLConvexDecompositionVHACD::bindDecomposition(int decomp) +{ + auto iter = mDecompData.find(decomp); + if (iter != mDecompData.end()) + { + mBoundDecomp = &iter->second; + } + else + { + LL_WARNS() << "Failed to bind unknown decomposition: " << decomp << LL_ENDL; + mBoundDecomp = nullptr; + } +} + +LLCDResult LLConvexDecompositionVHACD::setParam(const char* name, float val) +{ + if (name == std::string("Num Hulls")) + { + mVHACDParameters.m_maxConvexHulls = llclamp(ll_round(val), 1, MAX_HULLS); + } + else if (name == std::string("Num Vertices")) + { + mVHACDParameters.m_maxNumVerticesPerCH = llclamp(ll_round(val), 3, MAX_VERTICES_PER_HULL); + } + else if (name == std::string("Error Tolerance")) + { + mVHACDParameters.m_minimumVolumePercentErrorAllowed = val; + } + return LLCD_OK; +} + +LLCDResult LLConvexDecompositionVHACD::setParam(const char* name, bool val) +{ + return LLCD_OK; +} + +LLCDResult LLConvexDecompositionVHACD::setParam(const char* name, int val) +{ + if (name == std::string("Fill Mode")) + { + mVHACDParameters.m_fillMode = (VHACD::FillMode)val; + } + else if (name == std::string("Voxel Resolution")) + { + mVHACDParameters.m_resolution = val; + } + return LLCD_OK; +} + +LLCDResult LLConvexDecompositionVHACD::setMeshData( const LLCDMeshData* data, bool vertex_based ) +{ + if (!mBoundDecomp) + { + return LLCD_NULL_PTR; + } + + return mBoundDecomp->mSourceMesh.from(data, vertex_based); +} + +LLCDResult LLConvexDecompositionVHACD::registerCallback(int stage, llcdCallbackFunc callback ) +{ + if (stage == 0) + { + mVHACDCallback.setCallbackFunc(callback); + return LLCD_OK; + } + else + { + return LLCD_INVALID_STAGE; + } +} + +LLCDResult LLConvexDecompositionVHACD::executeStage(int stage) +{ + if (!mBoundDecomp) + { + return LLCD_NULL_PTR; + } + + if (stage != 0) + { + return LLCD_INVALID_STAGE; + } + + mBoundDecomp->mDecomposedHulls.clear(); + + const auto& decomp_mesh = mBoundDecomp->mSourceMesh; + if (!mVHACD->Compute((const double* const)decomp_mesh.mVertices.data(), static_cast(decomp_mesh.mVertices.size()), (const uint32_t* const)decomp_mesh.mIndices.data(), static_cast(decomp_mesh.mIndices.size()), mVHACDParameters)) + { + return LLCD_INVALID_HULL_DATA; + } + + uint32_t num_nulls = mVHACD->GetNConvexHulls(); + if (num_nulls == 0) + { + return LLCD_INVALID_HULL_DATA; + } + + for (uint32_t i = 0; num_nulls > i; ++i) + { + VHACD::IVHACD::ConvexHull ch; + if (!mVHACD->GetConvexHull(i, ch)) + continue; + + LLConvexMesh out_mesh; + out_mesh.setVertices(ch.m_points); + out_mesh.setIndices(ch.m_triangles); + + mBoundDecomp->mDecomposedHulls.push_back(std::move(out_mesh)); + } + + mVHACD->Clean(); + + return LLCD_OK; +} + +LLCDResult LLConvexDecompositionVHACD::buildSingleHull() +{ + LL_INFOS() << "Building single hull mesh" << LL_ENDL; + if (!mBoundDecomp || mBoundDecomp->mSourceMesh.mVertices.empty()) + { + return LLCD_NULL_PTR; + } + + mBoundDecomp->mSingleHullMesh.clear(); + + VHACD::QuickHull quickhull; + uint32_t num_tris = quickhull.ComputeConvexHull(mBoundDecomp->mSourceMesh.mVertices, MAX_VERTICES_PER_HULL); + if (num_tris > 0) + { + mBoundDecomp->mSingleHullMesh.setVertices(quickhull.GetVertices()); + mBoundDecomp->mSingleHullMesh.setIndices(quickhull.GetIndices()); + + return LLCD_OK; + } + + return LLCD_INVALID_MESH_DATA; +} + +int LLConvexDecompositionVHACD::getNumHullsFromStage(int stage) +{ + if (!mBoundDecomp || stage != 0) + { + return 0; + } + + return narrow(mBoundDecomp->mDecomposedHulls.size()); +} + +LLCDResult LLConvexDecompositionVHACD::getSingleHull( LLCDHull* hullOut ) +{ + memset( hullOut, 0, sizeof(LLCDHull) ); + + if (!mBoundDecomp) + { + return LLCD_NULL_PTR; + } + + if (mBoundDecomp->mSingleHullMesh.vertices.empty()) + { + return LLCD_INVALID_HULL_DATA; + } + + mBoundDecomp->mSingleHullMesh.to(hullOut); + return LLCD_OK; +} + +LLCDResult LLConvexDecompositionVHACD::getHullFromStage( int stage, int hull, LLCDHull* hullOut ) +{ + memset( hullOut, 0, sizeof(LLCDHull) ); + + if (!mBoundDecomp) + { + return LLCD_NULL_PTR; + } + + if (stage != 0) + { + return LLCD_INVALID_STAGE; + } + + if (mBoundDecomp->mDecomposedHulls.empty() || mBoundDecomp->mDecomposedHulls.size() <= hull) + { + return LLCD_REQUEST_OUT_OF_RANGE; + } + + mBoundDecomp->mDecomposedHulls[hull].to(hullOut); + return LLCD_OK; +} + +LLCDResult LLConvexDecompositionVHACD::getMeshFromStage( int stage, int hull, LLCDMeshData* meshDataOut ) +{ + memset( meshDataOut, 0, sizeof(LLCDMeshData)); + if (!mBoundDecomp) + { + return LLCD_NULL_PTR; + } + + if (stage != 0) + { + return LLCD_INVALID_STAGE; + } + + if (mBoundDecomp->mDecomposedHulls.empty() || mBoundDecomp->mDecomposedHulls.size() <= hull) + { + return LLCD_REQUEST_OUT_OF_RANGE; + } + + mBoundDecomp->mDecomposedHulls[hull].to(meshDataOut); + return LLCD_OK; +} + +LLCDResult LLConvexDecompositionVHACD::getMeshFromHull( LLCDHull* hullIn, LLCDMeshData* meshOut ) +{ + memset(meshOut, 0, sizeof(LLCDMeshData)); + + LLVHACDMesh inMesh(hullIn); + + VHACD::QuickHull quickhull; + uint32_t num_tris = quickhull.ComputeConvexHull(inMesh.mVertices, MAX_VERTICES_PER_HULL); + if (num_tris > 0) + { + mMeshFromHullData.setVertices(quickhull.GetVertices()); + mMeshFromHullData.setIndices(quickhull.GetIndices()); + + mMeshFromHullData.to(meshOut); + return LLCD_OK; + } + + return LLCD_INVALID_HULL_DATA; +} + +LLCDResult LLConvexDecompositionVHACD::generateSingleHullMeshFromMesh(LLCDMeshData* meshIn, LLCDMeshData* meshOut) +{ + memset( meshOut, 0, sizeof(LLCDMeshData) ); + + LLVHACDMesh inMesh(meshIn, true); + + VHACD::QuickHull quickhull; + uint32_t num_tris = quickhull.ComputeConvexHull(inMesh.mVertices, MAX_VERTICES_PER_HULL); + if (num_tris > 0) + { + mSingleHullMeshFromMeshData.setVertices(quickhull.GetVertices()); + mSingleHullMeshFromMeshData.setIndices(quickhull.GetIndices()); + + mSingleHullMeshFromMeshData.to(meshOut); + return LLCD_OK; + } + + return LLCD_INVALID_MESH_DATA; +} + +void LLConvexDecompositionVHACD::loadMeshData(const char* fileIn, LLCDMeshData** meshDataOut) +{ + static LLCDMeshData meshData; + memset( &meshData, 0, sizeof(LLCDMeshData) ); + *meshDataOut = &meshData; +} diff --git a/indra/llphysicsextensionsos/llconvexdecompositionvhacd.h b/indra/llphysicsextensionsos/llconvexdecompositionvhacd.h new file mode 100644 index 00000000000..675356629c4 --- /dev/null +++ b/indra/llphysicsextensionsos/llconvexdecompositionvhacd.h @@ -0,0 +1,339 @@ +/** +* @file llconvexdecompositionvhacd.h +* @author rye@alchemyviewer.org +* @brief A VHACD based implementation of LLConvexDecomposition +* +* $LicenseInfo:firstyear=2025&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2025, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ + +#ifndef LL_CONVEX_DECOMP_UTIL_VHACD_H +#define LL_CONVEX_DECOMP_UTIL_VHACD_H + +#include "llconvexdecomposition.h" +#include "llsingleton.h" +#include "llmath.h" + +#include + +#include "VHACD.h" + +class LLDecompDataVHACD; + +class LLConvexDecompositionVHACD : public LLSimpleton, public LLConvexDecomposition +{ + class VHACDCallback : public VHACD::IVHACD::IUserCallback + { + public: + void Update(const double overallProgress, const double stageProgress, const char* const stage, const char* operation) override + { + std::string out_msg = llformat("Stage: %s Operation: %s", stage, operation); + if (mCurrentStage != stage && mCurrentOperation != operation) + { + mCurrentStage = stage; + mCurrentOperation = operation; + LL_INFOS("VHACD") << out_msg << LL_ENDL; + } + + if(mCallbackFunc) + { + mCallbackFunc(out_msg.c_str(), ll_round(static_cast(stageProgress)), ll_round(static_cast(overallProgress))); + } + } + + void setCallbackFunc(llcdCallbackFunc func) + { + mCallbackFunc = func; + } + + private: + std::string mCurrentStage; + std::string mCurrentOperation; + llcdCallbackFunc mCallbackFunc = nullptr; + }; + + class VHACDLogger : public VHACD::IVHACD::IUserLogger + { + void Log(const char* const msg) override + { + LL_INFOS("VHACD") << msg << LL_ENDL; + } + }; + +public: + + LLConvexDecompositionVHACD(); + virtual ~LLConvexDecompositionVHACD(); + + static bool isFunctional(); + static LLConvexDecomposition* getInstance(); + static LLCDResult initSystem(); + static LLCDResult initThread(); + static LLCDResult quitThread(); + static LLCDResult quitSystem(); + + void genDecomposition(int& decomp); + void deleteDecomposition(int decomp); + void bindDecomposition(int decomp); + + // Sets *paramsOut to the address of the LLCDParam array and returns + // the length of the array + int getParameters(const LLCDParam** paramsOut) + { + *paramsOut = mDecompParams.data(); + return narrow(mDecompParams.size()); + } + + int getStages(const LLCDStageData** stagesOut) + { + *stagesOut = mDecompStages.data(); + return narrow(mDecompStages.size()); + } + + // Set a parameter by name. Returns false if out of bounds or unsupported parameter + LLCDResult setParam(const char* name, float val); + LLCDResult setParam(const char* name, int val); + LLCDResult setParam(const char* name, bool val); + LLCDResult setMeshData( const LLCDMeshData* data, bool vertex_based ); + LLCDResult registerCallback(int stage, llcdCallbackFunc callback ); + + LLCDResult executeStage(int stage); + LLCDResult buildSingleHull(); + + int getNumHullsFromStage(int stage); + + LLCDResult getHullFromStage( int stage, int hull, LLCDHull* hullOut ); + LLCDResult getSingleHull( LLCDHull* hullOut ) ; + + // TODO: Implement lock of some kind to disallow this call if data not yet ready + LLCDResult getMeshFromStage( int stage, int hull, LLCDMeshData* meshDataOut); + LLCDResult getMeshFromHull( LLCDHull* hullIn, LLCDMeshData* meshOut ); + + // For visualizing convex hull shapes in the viewer physics shape display + LLCDResult generateSingleHullMeshFromMesh( LLCDMeshData* meshIn, LLCDMeshData* meshOut); + + /// Debug + void loadMeshData(const char* fileIn, LLCDMeshData** meshDataOut); + +private: + std::vector mDecompParams; + std::array mDecompStages; + + struct LLVHACDMesh + { + using vertex_type = VHACD::Vertex; + using index_type = VHACD::Triangle; + using vertex_array_type = std::vector; + using index_array_type = std::vector; + + LLVHACDMesh() = default; + LLVHACDMesh(const LLCDHull* hullIn) + { + if (hullIn) + { + from(hullIn); + } + }; + + LLVHACDMesh(const LLCDMeshData* meshIn, bool vertex_based) + { + if (meshIn) + { + from(meshIn, vertex_based); + } + }; + + void clear() + { + mVertices.clear(); + mIndices.clear(); + } + + void setVertices(const float* data, int num_vertices, int vertex_stride_bytes) + { + vertex_array_type vertices; + vertices.reserve(num_vertices); + + const int stride = vertex_stride_bytes / sizeof(float); + for (int i = 0; i < num_vertices; ++i) + { + vertices.emplace_back(data[i * stride + 0], + data[i * stride + 1], + data[i * stride + 2]); + } + + mVertices = std::move(vertices); + } + + void setIndices(const void* data, int num_indices, int index_stride_bytes, LLCDMeshData::IndexType type) + { + index_array_type indices; + indices.reserve(num_indices); + + if (type == LLCDMeshData::INT_16) + { + const U16* index_data = static_cast(data); + const int stride = index_stride_bytes / sizeof(U16); + for (int i = 0; i < num_indices; ++i) + { + indices.emplace_back(index_data[i * stride + 0], + index_data[i * stride + 1], + index_data[i * stride + 2]); + } + } + else + { + const U32* index_data = static_cast(data); + const int stride = index_stride_bytes / sizeof(U32); + for (int i = 0; i < num_indices; ++i) + { + indices.emplace_back(index_data[i * stride + 0], + index_data[i * stride + 1], + index_data[i * stride + 2]); + } + } + + mIndices = std::move(indices); + } + + LLCDResult from(const LLCDHull* hullIn) + { + clear(); + + if (!hullIn || !hullIn->mVertexBase || (hullIn->mNumVertices < 3) || (hullIn->mVertexStrideBytes != 12 && hullIn->mVertexStrideBytes != 16)) + { + return LLCD_INVALID_HULL_DATA; + } + + setVertices(hullIn->mVertexBase, hullIn->mNumVertices, hullIn->mVertexStrideBytes); + + return LLCD_OK; + } + + LLCDResult from(const LLCDMeshData* meshIn, bool vertex_based) + { + clear(); + + if (!meshIn || !meshIn->mVertexBase || (meshIn->mNumVertices < 3) || (meshIn->mVertexStrideBytes != 12 && meshIn->mVertexStrideBytes != 16)) + { + return LLCD_INVALID_MESH_DATA; + } + + if (!vertex_based && ((meshIn->mNumTriangles < 1) || !meshIn->mIndexBase)) + { + return LLCD_INVALID_MESH_DATA; + } + + setVertices(meshIn->mVertexBase, meshIn->mNumVertices, meshIn->mVertexStrideBytes); + if(!vertex_based) + { + setIndices(meshIn->mIndexBase, meshIn->mNumTriangles, meshIn->mIndexStrideBytes, meshIn->mIndexType); + } + + return LLCD_OK; + } + + vertex_array_type mVertices; + index_array_type mIndices; + }; + + struct LLConvexMesh + { + using vertex_type = glm::vec3; + using index_type = glm::u32vec3; + using vertex_array_type = std::vector; + using index_array_type = std::vector; + + LLConvexMesh() = default; + + void clear() + { + vertices.clear(); + indices.clear(); + } + + void setVertices(const std::vector& in_vertices) + { + vertices.clear(); + vertices.reserve(in_vertices.size()); + + for (const auto& vertex : in_vertices) + { + vertices.emplace_back(narrow(vertex.mX), narrow(vertex.mY), narrow(vertex.mZ)); + } + } + + void setIndices(const std::vector& in_indices) + { + indices.clear(); + indices.reserve(in_indices.size()); + + for (const auto& triangle : in_indices) + { + indices.emplace_back(narrow(triangle.mI0), narrow(triangle.mI1), narrow(triangle.mI2)); + } + } + + void to(LLCDHull* meshOut) const + { + meshOut->mVertexBase = (float*)vertices.data(); + meshOut->mVertexStrideBytes = sizeof(vertex_type); + meshOut->mNumVertices = (int)vertices.size(); + } + + void to(LLCDMeshData* meshOut) const + { + meshOut->mVertexBase = (float*)vertices.data(); + meshOut->mVertexStrideBytes = sizeof(vertex_type); + meshOut->mNumVertices = (int)vertices.size(); + + meshOut->mIndexType = LLCDMeshData::INT_32; + meshOut->mIndexBase = indices.data(); + meshOut->mIndexStrideBytes = sizeof(index_type); + meshOut->mNumTriangles = (int)indices.size(); + } + + vertex_array_type vertices; + index_array_type indices; + }; + + struct LLDecompData + { + LLVHACDMesh mSourceMesh; + LLConvexMesh mSingleHullMesh; + + std::vector mDecomposedHulls; + }; + + std::unordered_map mDecompData; + + LLDecompData* mBoundDecomp = nullptr; + + VHACD::IVHACD* mVHACD = nullptr; + VHACDCallback mVHACDCallback; + VHACDLogger mVHACDLogger; + VHACD::IVHACD::Parameters mVHACDParameters; + + LLConvexMesh mMeshFromHullData; + LLConvexMesh mSingleHullMeshFromMeshData; +}; + +#endif //LL_CONVEX_DECOMP_UTIL_VHACD_H diff --git a/indra/llphysicsextensionsos/llpathinglib.cpp b/indra/llphysicsextensionsos/llpathinglib.cpp new file mode 100644 index 00000000000..f41cb9c45fb --- /dev/null +++ b/indra/llphysicsextensionsos/llpathinglib.cpp @@ -0,0 +1,83 @@ +/** +* @file llpathinglib.cpp +* @author prep@lindenlab.com +* @brief LLPathingLib core creation methods +* +* $LicenseInfo:firstyear=2012&license=lgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2011, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ + +#include "linden_common.h" + +#include "LLPathingLibStubImpl.h" + +#include "llpathinglib.h" + +//============================================================================= + +/*static */bool LLPathingLib::s_isInitialized = false; + +//============================================================================= + + +/*static*/bool LLPathingLib::isFunctional() +{ + return false; +} + +/*static*/LLPathingLib* LLPathingLib::getInstance() +{ + if ( !s_isInitialized ) + { + return NULL; + } + else + { + return LLPathingLibImpl::getInstance(); + } +} + +//============================================================================= + +/*static */LLPathingLib::LLPLResult LLPathingLib::initSystem() +{ + if ( LLPathingLibImpl::initSystem() == LLPL_OK ) + { + s_isInitialized = true; + return LLPL_OK; + } + return LLPL_UNKOWN_ERROR; +} +//============================================================================= +/*static */LLPathingLib::LLPLResult LLPathingLib::quitSystem() +{ + LLPLResult quitResult = LLPL_UNKOWN_ERROR; + + if (s_isInitialized) + { + quitResult = LLPathingLibImpl::quitSystem(); + s_isInitialized = false; + } + + return quitResult; +} +//============================================================================= + diff --git a/indra/llphysicsextensionsos/llpathinglib.h b/indra/llphysicsextensionsos/llpathinglib.h new file mode 100644 index 00000000000..41583f1fd1e --- /dev/null +++ b/indra/llphysicsextensionsos/llpathinglib.h @@ -0,0 +1,187 @@ +/** + * @file llpathinglib.cpp + * @author prep@lindenlab.com + * @brief LLPathingLib interface definition + * + * $LicenseInfo:firstyear=2012&license=lgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2011, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_PATHING_LIBRARY +#define LL_PATHING_LIBRARY + +#include "llpreprocessor.h" +#include "llsd.h" +#include "v3dmath.h" +#include "v4math.h" + +#include "v4color.h" +#include "v4coloru.h" +#include "llphysicsextensions.h" + +typedef int bool32; + +#if defined(_WIN32) || defined(_WIN64) +#define LLCD_CALL __cdecl +#else +#define LLCD_CALL +#endif + +class LLRender; + +//============================================================================= +class LLPathingLib +{ + +public: + enum LLShapeType + { + LLST_WalkableObjects = 0, + LLST_ObstacleObjects, + LLST_MaterialPhantoms, + LLST_ExclusionPhantoms, + LLST_MaxShapeTypes = LLST_ExclusionPhantoms+1, + LLST_None = LLST_MaxShapeTypes+2, + LLST_SimpleBox = LLST_None+1, + LLST_SimpleCapsule = LLST_SimpleBox+1, + }; + + enum LLShapeTypeFlag + { + LLSTB_WalkableObjects = 0x1 << 1, + LLSTB_ObstacleObjects = 0x1 << 2, + LLSTB_MaterialPhantoms = 0x1 << 3, + LLSTB_ExclusionPhantoms = 0x1 << 4, + LLSTB_None = 0x1 << 5 + }; + + enum LLPLPathBookEnd + { + LLPL_START = 0, + LLPL_END, + }; + + enum LLPLResult + { + LLPL_OK = 0, + LLPL_NOTSET, + LLPL_ERROR, + LLPL_NO_NAVMESH, + LLPL_UNKOWN_ERROR, + LLPL_NO_PATH, + LLPL_PATH_GENERATED_OK, + LLPL_NOT_IMPLEMENTED, + }; + + enum LLPLCharacterType + { + LLPL_CHARACTER_TYPE_A = 4, + LLPL_CHARACTER_TYPE_B = 3, + LLPL_CHARACTER_TYPE_C = 2, + LLPL_CHARACTER_TYPE_D = 1, + LLPL_CHARACTER_TYPE_NONE = 0 + }; + + struct PathingPacket + { + PathingPacket() : mHasPointA(false), mHasPointB(false), mCharacterWidth(0.0f), mCharacterType(LLPL_CHARACTER_TYPE_NONE) {} + bool mHasPointA; + LLVector3 mStartPointA; + LLVector3 mEndPointA; + bool mHasPointB; + LLVector3 mStartPointB; + LLVector3 mEndPointB; + F32 mCharacterWidth; + LLPLCharacterType mCharacterType; + }; + + struct NavMeshColors + { + LLColor4U mWalkable; + LLColor4U mObstacle; + LLColor4U mMaterial; + LLColor4U mExclusion; + LLColor4U mConnectedEdge; + LLColor4U mBoundaryEdge; + LLColor4 mHeatColorBase; + LLColor4 mHeatColorMax; + LLColor4U mFaceColor; + LLColor4U mStarValid; + LLColor4U mStarInvalid; + LLColor4U mTestPath; + LLColor4U mWaterColor; + }; + +public: + //Ctor + LLPathingLib() {} + virtual ~LLPathingLib() {} + + /// @returns false if this is the stub + static bool isFunctional(); + + // Obtain a pointer to the actual implementation + static LLPathingLib* getInstance(); + static LLPathingLib::LLPLResult initSystem(); + static LLPathingLib::LLPLResult quitSystem(); + + //Extract and store navmesh data from the llsd datablock sent down by the server + virtual LLPLResult extractNavMeshSrcFromLLSD( const LLSD::Binary& dataBlock, int dir ) = 0; + //Stitch any stored navmeshes together + virtual void processNavMeshData( ) = 0; + + //Method used to generate and visualize a path on the viewers navmesh + virtual LLPLResult generatePath( const PathingPacket& pathingPacket ) = 0; + + //Set the material type for the heatmap type + virtual void setNavMeshMaterialType( LLPLCharacterType materialType ) = 0; + //Set the various navmesh colors + virtual void setNavMeshColors( const NavMeshColors& color ) = 0; + + //The entry method to rendering the client side navmesh + virtual void renderNavMesh() = 0; + //The entry method to rendering the client side navmesh edges + virtual void renderNavMeshEdges() = 0; + //The entry method to render the client navmesh shapes VBO + virtual void renderNavMeshShapesVBO( U32 shapeRenderFlags ) = 0; + //The entry method to render the clients designated path + virtual void renderPath() = 0; + //The entry method to render the capsule bookends for the clients designated path + virtual void renderPathBookend( LLRender& gl, LLPathingLib::LLPLPathBookEnd type ) = 0; + //Renders all of the generated simple shapes (using their default transforms) + virtual void renderSimpleShapes( LLRender& gl, F32 regionsWaterHeight ) = 0; + + //Method called from second life to create a capsule from properties of a character + virtual void createPhysicsCapsuleRep( F32 length, F32 radius, BOOL horizontal, const LLUUID& id ) = 0; + //Removes any cached physics capsule using a list of cached uuids + virtual void cleanupPhysicsCapsuleRepResiduals() = 0; + //Renders a selected uuids physics rep + virtual void renderSimpleShapeCapsuleID( LLRender& gl, const LLUUID& id, const LLVector3& pos, const LLQuaternion& rot ) = 0; + + //Method to delete any vbo's that are currently being managed by the pathing library + virtual void cleanupVBOManager( ) = 0; + //Method to cleanup any allocations within the implementation + virtual void cleanupResidual( ) = 0; +private: + static bool s_isInitialized; +}; + +#endif //LL_PATHING_LIBRARY diff --git a/indra/llphysicsextensionsos/llphysicsextensions.cpp b/indra/llphysicsextensionsos/llphysicsextensions.cpp new file mode 100644 index 00000000000..3bb8ffbf1a5 --- /dev/null +++ b/indra/llphysicsextensionsos/llphysicsextensions.cpp @@ -0,0 +1,78 @@ +/** +* @file llphysicsextensions.cpp +* @author nyx@lindenlab.com +* @brief LLPhysicsExtensions core initialization methods +* +* $LicenseInfo:firstyear=2012&license=lgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2011, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ + +#include "linden_common.h" + +#include "llphysicsextensions.h" +#include "LLPhysicsExtensionsStubImpl.h" + + +//disable the undefined symbol optimization +//#pragma warning (disable : 4221) + +//============================================================================= + +/*static */bool LLPhysicsExtensions::s_isInitialized = false; + + +/*static*/bool LLPhysicsExtensions::isFunctional() +{ + return false; +} + +//============================================================================= + +/*static*/LLPhysicsExtensions* LLPhysicsExtensions::getInstance() +{ + if ( !s_isInitialized ) + { + return NULL; + } + else + { + return LLPhysicsExtensionsImpl::getInstance(); + } +} + +//============================================================================= + +/*static */bool LLPhysicsExtensions::initSystem() +{ + bool result = LLPhysicsExtensionsImpl::initSystem(); + if ( result ) + { + s_isInitialized = true; + } + return result; +} +//============================================================================= +/*static */bool LLPhysicsExtensions::quitSystem() +{ + return LLPhysicsExtensionsImpl::quitSystem(); +} +//============================================================================= + diff --git a/indra/llphysicsextensionsos/llphysicsextensions.h b/indra/llphysicsextensionsos/llphysicsextensions.h new file mode 100644 index 00000000000..fa23ebd7259 --- /dev/null +++ b/indra/llphysicsextensionsos/llphysicsextensions.h @@ -0,0 +1,59 @@ +/** +* @file llphysicsextensions.h +* @author nyx@lindenlab.com +* @brief LLPhysicsExtensions core shared initialization +* routines +* +* $LicenseInfo:firstyear=2012&license=lgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2011, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ + +#ifndef LL_PHYSICS_EXTENSIONS +#define LL_PHYSICS_EXTENSIONS + +#include "llpreprocessor.h" +#include "llsd.h" +#include "v3dmath.h" + +#define LLPHYSICSEXTENSIONS_VERSION "1.0" + +typedef int bool32; + +class LLPhysicsExtensions +{ + +public: + // Obtain a pointer to the actual implementation + static LLPhysicsExtensions* getInstance(); + + /// @returns false if this is the stub + static bool isFunctional(); + + static bool initSystem(); + static bool quitSystem(); + +private: + static bool s_isInitialized; +}; + +#endif //LL_PATHING_LIBRARY + + diff --git a/indra/llplugin/llpluginprocessparent.cpp b/indra/llplugin/llpluginprocessparent.cpp index afee0996977..4f55d75e7d5 100644 --- a/indra/llplugin/llpluginprocessparent.cpp +++ b/indra/llplugin/llpluginprocessparent.cpp @@ -982,14 +982,18 @@ void LLPluginProcessParent::poll(F64 timeout) } } - // Remove instances in the done state from the sInstances map. - mapInstances_t::iterator itClean = sInstances.begin(); - while (itClean != sInstances.end()) + if (sInstancesMutex) { - if ((*itClean).second->isDone()) - itClean = sInstances.erase(itClean); - else - ++itClean; + // Remove instances in the done state from the sInstances map. + LLCoros::LockType lock(*sInstancesMutex); + mapInstances_t::iterator itClean = sInstances.begin(); + while (itClean != sInstances.end()) + { + if ((*itClean).second->isDone()) + itClean = sInstances.erase(itClean); + else + ++itClean; + } } } diff --git a/indra/llplugin/slplugin/slplugin-objc.mm b/indra/llplugin/slplugin/slplugin-objc.mm index 68ff196eaf4..adde594b59a 100644 --- a/indra/llplugin/slplugin/slplugin-objc.mm +++ b/indra/llplugin/slplugin/slplugin-objc.mm @@ -7,21 +7,21 @@ * $LicenseInfo:firstyear=2010&license=viewerlgpl$ * Second Life Viewer Source Code * Copyright (C) 2010, Linden Research, Inc. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; * version 2.1 of the License only. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * + * * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ * @@ -38,51 +38,51 @@ void LLCocoaPlugin::setupCocoa() { - static bool inited = false; - - if(!inited) - { - createAutoReleasePool(); - - // The following prevents the Cocoa command line parser from trying to open 'unknown' arguements as documents. - // ie. running './secondlife -set Language fr' would cause a pop-up saying can't open document 'fr' - // when init'ing the Cocoa App window. - [[NSUserDefaults standardUserDefaults] setObject:@"NO" forKey:@"NSTreatUnknownArgumentsAsOpen"]; - - // This is a bit of voodoo taken from the Apple sample code "CarbonCocoa_PictureCursor": - // http://developer.apple.com/samplecode/CarbonCocoa_PictureCursor/index.html - - // Needed for Carbon based applications which call into Cocoa - NSApplicationLoad(); - - // Must first call [[[NSWindow alloc] init] release] to get the NSWindow machinery set up so that NSCursor can use a window to cache the cursor image - [[[NSWindow alloc] init] release]; - + static bool inited = false; + + if(!inited) + { + createAutoReleasePool(); + + // The following prevents the Cocoa command line parser from trying to open 'unknown' arguements as documents. + // ie. running './secondlife -set Language fr' would cause a pop-up saying can't open document 'fr' + // when init'ing the Cocoa App window. + [[NSUserDefaults standardUserDefaults] setObject:@"NO" forKey:@"NSTreatUnknownArgumentsAsOpen"]; + + // This is a bit of voodoo taken from the Apple sample code "CarbonCocoa_PictureCursor": + // http://developer.apple.com/samplecode/CarbonCocoa_PictureCursor/index.html + + // Needed for Carbon based applications which call into Cocoa + NSApplicationLoad(); + + // Must first call [[[NSWindow alloc] init] release] to get the NSWindow machinery set up so that NSCursor can use a window to cache the cursor image + [[[NSWindow alloc] init] release]; + mPluginWindow = [NSApp mainWindow]; - - deleteAutoReleasePool(); - - inited = true; - } + + deleteAutoReleasePool(); + + inited = true; + } } static NSAutoreleasePool *sPool = NULL; void LLCocoaPlugin::createAutoReleasePool() { - if(!sPool) - { - sPool = [[NSAutoreleasePool alloc] init]; - } + if(!sPool) + { + sPool = [[NSAutoreleasePool alloc] init]; + } } void LLCocoaPlugin::deleteAutoReleasePool() { - if(sPool) - { - [sPool release]; - sPool = NULL; - } + if(sPool) + { + [sPool release]; + sPool = NULL; + } } LLCocoaPlugin::LLCocoaPlugin():mHackState(0) @@ -110,12 +110,12 @@ // { // // Start out with a window layer that's way out in front (fixes the problem with the menubar not getting hidden on first switch to fullscreen youtube) // SetWindowGroupName(layer_group, CFSTR("SLPlugin Layer")); - // SetWindowGroupLevel(layer_group, kCGOverlayWindowLevel); + // SetWindowGroupLevel(layer_group, kCGOverlayWindowLevel); // } - + } -void LLCocoaPlugin::updateWindows() +void LLCocoaPlugin::updateWindows() { // NSArray* window_list = [NSApp orderedWindows]; // NSWindow* current_window = [window_list objectAtIndex:0]; @@ -123,38 +123,38 @@ // bool this_is_front_process = false; // bool parent_is_front_process = false; // -// +// // // Check for a change in this process's frontmost window. // if ( current_window != mFrontWindow ) // { // // and figure out whether this process or its parent are currently frontmost // if ( current_window == parent_window ) parent_is_front_process = true; // if ( current_window == mPluginWindow ) this_is_front_process = true; -// +// // if (current_window != NULL && mFrontWindow == NULL) // { // // Opening the first window -// +// // if(mHackState == 0) // { // // Next time through the event loop, lower the window group layer // mHackState = 1; // } -// +// // if(parent_is_front_process) // { // // Bring this process's windows to the front. // [mPluginWindow makeKeyAndOrderFront:NSApp]; // [mPluginWindow setOrderedIndex:0]; // } -// +// // [NSApp activateIgnoringOtherApps:YES]; // } -// +// // else if (( current_window == NULL) && (mFrontWindow != NULL)) // { // // Closing the last window -// +// // if(this_is_front_process) // { // // Try to bring this process's parent to the front @@ -171,7 +171,7 @@ //// } // mHackState = 2; // } -// +// // mFrontWindow = [window_list objectAtIndex:0]; // } } diff --git a/indra/llprimitive/CMakeLists.txt b/indra/llprimitive/CMakeLists.txt index e13f0bbd96d..ff0cad58d63 100644 --- a/indra/llprimitive/CMakeLists.txt +++ b/indra/llprimitive/CMakeLists.txt @@ -65,11 +65,20 @@ target_link_libraries(llprimitive llxml llcharacter llrender - llphysicsextensions_impl ll::colladadom ll::glm ) +if (HAVOK OR HAVOK_TPV) + target_link_libraries(llprimitive + llphysicsextensions_impl + ) +else() + target_link_libraries(llprimitive + llphysicsextensionsos + ) +endif () + #add unit tests if (LL_TESTS) INCLUDE(LLAddBuildTest) diff --git a/indra/llprimitive/llgltfmaterial.cpp b/indra/llprimitive/llgltfmaterial.cpp index cc4921416f6..930222e3db8 100644 --- a/indra/llprimitive/llgltfmaterial.cpp +++ b/indra/llprimitive/llgltfmaterial.cpp @@ -923,3 +923,34 @@ void LLGLTFMaterial::updateTextureTracking() // setTEGLTFMaterialOverride is responsible for tracking // for material overrides editor will set it } + +void LLGLTFMaterial::convertTextureTransformToPBR( + F32 tex_scale_s, + F32 tex_scale_t, + F32 tex_offset_s, + F32 tex_offset_t, + F32 tex_rotation, + LLVector2& pbr_scale, + LLVector2& pbr_offset, + F32& pbr_rotation) +{ + pbr_scale.set(tex_scale_s, tex_scale_t); + pbr_rotation = -(tex_rotation) / 2.f; + const F32 adjusted_offset_s = tex_offset_s; + const F32 adjusted_offset_t = -tex_offset_t; + F32 center_adjust_s = 0.5f * (1.0f - tex_scale_s); + F32 center_adjust_t = 0.5f * (1.0f - tex_scale_t); + + if (pbr_rotation != 0.0f) + { + const F32 c = cosf(pbr_rotation); + const F32 s = sinf(pbr_rotation); + const F32 tmp_s = center_adjust_s * c - center_adjust_t * s; + const F32 tmp_t = center_adjust_s * s + center_adjust_t * c; + center_adjust_s = tmp_s; + center_adjust_t = tmp_t; + } + + pbr_offset.set(adjusted_offset_s + center_adjust_s, + adjusted_offset_t + center_adjust_t); +} diff --git a/indra/llprimitive/llgltfmaterial.h b/indra/llprimitive/llgltfmaterial.h index 10df4c8ee11..8d45cb61851 100644 --- a/indra/llprimitive/llgltfmaterial.h +++ b/indra/llprimitive/llgltfmaterial.h @@ -214,6 +214,14 @@ class LLGLTFMaterial : public LLRefCount bool hasLocalTextures() { return !mTrackingIdToLocalTexture.empty(); } virtual bool replaceLocalTexture(const LLUUID& tracking_id, const LLUUID &old_id, const LLUUID& new_id); virtual void updateTextureTracking(); + + // Convert legacy TE transform values to PBR transform values. + static void convertTextureTransformToPBR(F32 tex_scale_s, F32 tex_scale_t, + F32 tex_offset_s, F32 tex_offset_t, + F32 tex_rotation, + LLVector2& pbr_scale, + LLVector2& pbr_offset, + F32& pbr_rotation); protected: static LLVector2 vec2FromJson(const std::map& object, const char* key, const LLVector2& default_value); static F32 floatFromJson(const std::map& object, const char* key, const F32 default_value); diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp index 00ef79ce7fd..8055bffd32a 100644 --- a/indra/llprimitive/llmodel.cpp +++ b/indra/llprimitive/llmodel.cpp @@ -1296,10 +1296,10 @@ LLModel::weight_list& LLModel::getJointInfluences(const LLVector3& pos) } void LLModel::setConvexHullDecomposition( - const LLModel::convex_hull_decomposition& decomp) + const LLModel::convex_hull_decomposition& decomp, const std::vector& decomp_mesh) { mPhysics.mHull = decomp; - mPhysics.mMesh.clear(); + mPhysics.mMesh = decomp_mesh; updateHullCenters(); } diff --git a/indra/llprimitive/llmodel.h b/indra/llprimitive/llmodel.h index 6501b3dc502..ac88af18f02 100644 --- a/indra/llprimitive/llmodel.h +++ b/indra/llprimitive/llmodel.h @@ -305,7 +305,8 @@ class LLModel : public LLVolume S32 mDecompID; void setConvexHullDecomposition( - const convex_hull_decomposition& decomp); + const convex_hull_decomposition& decomp, + const std::vector& decomp_mesh); void updateHullCenters(); LLVector3 mCenterOfHullCenters; diff --git a/indra/llrender/llcubemap.cpp b/indra/llrender/llcubemap.cpp index 26e4aaad524..b15cec58045 100644 --- a/indra/llrender/llcubemap.cpp +++ b/indra/llrender/llcubemap.cpp @@ -86,7 +86,10 @@ void LLCubeMap::initGL() #endif mImages[i]->setTarget(mTargets[i], LLTexUnit::TT_CUBE_MAP); mRawImages[i] = new LLImageRaw(RESOLUTION, RESOLUTION, 4); - mImages[i]->createGLTexture(0, mRawImages[i], texname); + if (!mImages[i]->createGLTexture(0, mRawImages[i], texname)) + { + LL_WARNS() << "Failed to create GL texture for environment cubemap face " << i << LL_ENDL; + } gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_CUBE_MAP, texname); mImages[i]->setAddressMode(LLTexUnit::TAM_CLAMP); @@ -203,7 +206,10 @@ void LLCubeMap::initEnvironmentMap(const std::vector >& ra mImages[i] = new LLImageGL(resolution, resolution, components, true); mImages[i]->setTarget(mTargets[i], LLTexUnit::TT_CUBE_MAP); mRawImages[i] = rawimages[i]; - mImages[i]->createGLTexture(0, mRawImages[i], texname); + if (!mImages[i]->createGLTexture(0, mRawImages[i], texname)) + { + LL_WARNS() << "Failed to create GL texture for environment cubemap face " << i << LL_ENDL; + } gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_CUBE_MAP, texname); mImages[i]->setAddressMode(LLTexUnit::TAM_CLAMP); diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index 9cd5dc8145b..a268ea07bb4 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -57,6 +57,7 @@ S32 LLGLSLShader::sIndexedTextureChannels = 0; U32 LLGLSLShader::sMaxGLTFMaterials = 0; U32 LLGLSLShader::sMaxGLTFNodes = 0; bool LLGLSLShader::sProfileEnabled = false; +bool LLGLSLShader::sCanProfile = true; std::set LLGLSLShader::sInstances; LLGLSLShader::defines_map_t LLGLSLShader::sGlobalDefines; U64 LLGLSLShader::sTotalTimeElapsed = 0; @@ -267,7 +268,7 @@ void LLGLSLShader::placeProfileQuery(bool for_runtime) bool LLGLSLShader::readProfileQuery(bool for_runtime, bool force_read) { - if (sProfileEnabled || for_runtime) + if ((sProfileEnabled || for_runtime) && sCanProfile) { if (!mProfilePending) { diff --git a/indra/llrender/llglslshader.h b/indra/llrender/llglslshader.h index 4702a27cc54..272a99aaa58 100644 --- a/indra/llrender/llglslshader.h +++ b/indra/llrender/llglslshader.h @@ -160,6 +160,7 @@ class LLGLSLShader static std::set sInstances; static bool sProfileEnabled; + static bool sCanProfile; LLGLSLShader(); ~LLGLSLShader(); diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index 52738ec626a..97ea6f67bd8 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -1097,6 +1097,8 @@ void sub_image_lines(U32 target, S32 miplevel, S32 x_offset, S32 y_offset, S32 w // full width texture, do 32 lines at a time for (U32 y_pos = y_offset; y_pos < y_offset_end; y_pos += batch_size) { + // If this keeps crashing, pass down data_size, looks like it is using + // imageraw->getData(); for data, but goes way over allocated size limit glTexSubImage2D(target, miplevel, x_offset, y_pos, width, batch_size, pixformat, pixtype, src); src += line_width * batch_size; } @@ -1106,6 +1108,8 @@ void sub_image_lines(U32 target, S32 miplevel, S32 x_offset, S32 y_offset, S32 w // partial width or strange height for (U32 y_pos = y_offset; y_pos < y_offset_end; y_pos += 1) { + // If this keeps crashing, pass down data_size, looks like it is using + // imageraw->getData(); for data, but goes way over allocated size limit glTexSubImage2D(target, miplevel, x_offset, y_pos, width, 1, pixformat, pixtype, src); src += line_width; } @@ -1546,6 +1550,7 @@ bool LLImageGL::createGLTexture(S32 discard_level, const LLImageRaw* imageraw, S llassert(mCurrentDiscardLevel >= 0); discard_level = mCurrentDiscardLevel; } + discard_level = llmin(discard_level, MAX_DISCARD_LEVEL); // Actual image width/height = raw image width/height * 2^discard_level S32 raw_w = imageraw->getWidth() ; @@ -1644,6 +1649,7 @@ bool LLImageGL::createGLTexture(S32 discard_level, const U8* data_in, bool data_ discard_level = mCurrentDiscardLevel; } discard_level = llclamp(discard_level, 0, (S32)mMaxDiscardLevel); + discard_level = llmin(discard_level, MAX_DISCARD_LEVEL); if (main_thread // <--- always force creation of new_texname when not on main thread ... && !defer_copy // <--- ... or defer copy is set diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp index 9cdd02f4032..e9bbdeead52 100644 --- a/indra/llrender/llshadermgr.cpp +++ b/indra/llrender/llshadermgr.cpp @@ -1048,6 +1048,7 @@ void LLShaderMgr::clearShaderCache() LL_INFOS("ShaderMgr") << "Removing shader cache at " << shader_cache << LL_ENDL; const std::string mask = "*"; gDirUtilp->deleteFilesInDir(shader_cache, mask); + LLFile::rmdir(shader_cache); mShaderBinaryCache.clear(); } diff --git a/indra/llui/llaccordionctrl.cpp b/indra/llui/llaccordionctrl.cpp index 495ba2f40fd..2cd394476ee 100644 --- a/indra/llui/llaccordionctrl.cpp +++ b/indra/llui/llaccordionctrl.cpp @@ -494,6 +494,7 @@ void LLAccordionCtrl::arrangeMultiple() void LLAccordionCtrl::arrange() { + LL_PROFILE_ZONE_SCOPED; updateNoTabsHelpTextVisibility(); if (mAccordionTabs.empty()) diff --git a/indra/llui/llaccordionctrltab.cpp b/indra/llui/llaccordionctrltab.cpp index ac665250306..828bfb289b4 100644 --- a/indra/llui/llaccordionctrltab.cpp +++ b/indra/llui/llaccordionctrltab.cpp @@ -248,10 +248,22 @@ void LLAccordionCtrlTab::LLAccordionCtrlTabHeader::draw() void LLAccordionCtrlTab::LLAccordionCtrlTabHeader::reshape(S32 width, S32 height, bool called_from_parent /* = true */) { S32 header_height = mHeaderTextbox->getTextPixelHeight(); + LLRect old_header_rect = mHeaderTextbox->getRect(); LLRect textboxRect(HEADER_TEXT_LEFT_OFFSET, (height + header_height) / 2, width, (height - header_height) / 2); - mHeaderTextbox->reshape(textboxRect.getWidth(), textboxRect.getHeight()); - mHeaderTextbox->setRect(textboxRect); + if (old_header_rect.getHeight() != textboxRect.getHeight() + || old_header_rect.mLeft != textboxRect.mLeft + || old_header_rect.mTop != textboxRect.mTop + || old_header_rect.getWidth() > textboxRect.getWidth() // reducing header's width + || (old_header_rect.getWidth() < textboxRect.getWidth() && old_header_rect.getWidth() < mHeaderTextbox->getTextPixelWidth())) + { + // Expensive text reflow + // Update if position or height changes + // Update if width reduces + // But do not update if text already fits and width increases (arguably LLTextBox::reshape should be smarter, not Accordion) + mHeaderTextbox->reshape(textboxRect.getWidth(), textboxRect.getHeight()); + mHeaderTextbox->setRect(textboxRect); + } if (mHeaderTextbox->getTextPixelWidth() > mHeaderTextbox->getRect().getWidth()) { @@ -416,8 +428,11 @@ void LLAccordionCtrlTab::reshape(S32 width, S32 height, bool called_from_parent LLRect headerRect; headerRect.setLeftTopAndSize(0, height, width, HEADER_HEIGHT); - mHeader->setRect(headerRect); - mHeader->reshape(headerRect.getWidth(), headerRect.getHeight()); + if (mHeader->getRect() != headerRect) + { + mHeader->setRect(headerRect); + mHeader->reshape(headerRect.getWidth(), headerRect.getHeight()); + } if (!mDisplayChildren) return; @@ -464,7 +479,34 @@ void LLAccordionCtrlTab::onUpdateScrollToChild(const LLUICtrl *cntrl) // Translate to parent coordinatess to check if we are in visible rectangle rect.translate(getRect().mLeft, getRect().mBottom); - if (!getRect().contains(rect)) + bool needs_to_scroll = false; + const LLRect &acc_rect = getRect(); + if (!acc_rect.contains(rect)) + { + if (acc_rect.mTop < rect.mBottom || acc_rect.mBottom > rect.mTop) + { + // Content fully not in view + needs_to_scroll = true; + } + else if (acc_rect.getHeight() >= rect.getHeight()) + { + // Content can be displayed fully, but only partially in view + needs_to_scroll = true; + } + else if (acc_rect.mTop <= rect.mTop || acc_rect.mBottom >= rect.mBottom) + { + // Intersects, but too big to be displayed fully + S32 covered_height = acc_rect.mTop > rect.mTop ? rect.mTop - acc_rect.mBottom : acc_rect.mTop - rect.mBottom; + constexpr F32 covered_ratio = 0.7f; + if (covered_height < covered_ratio * acc_rect.getHeight()) + { + // Try to show bigger portion of the content + needs_to_scroll = true; + } + } + // else too big and in the middle of the view as is + } + if (needs_to_scroll) { // for accordition's scroll, height is in pixels // Back to local coords and calculate position for scroller @@ -932,7 +974,7 @@ void LLAccordionCtrlTab::adjustContainerPanel(const LLRect& child_rect) show_hide_scrollbar(child_rect); updateLayout(child_rect); } - else + else if (mContainerPanel->getRect() != child_rect) { mContainerPanel->reshape(child_rect.getWidth(), child_rect.getHeight()); mContainerPanel->setRect(child_rect); diff --git a/indra/llui/llcombobox.cpp b/indra/llui/llcombobox.cpp index f3876ef6957..17e583b868c 100644 --- a/indra/llui/llcombobox.cpp +++ b/indra/llui/llcombobox.cpp @@ -251,11 +251,26 @@ void LLComboBox::resetDirty() } } -bool LLComboBox::itemExists(const std::string& name) +bool LLComboBox::itemExists(const std::string& name) const { return mList->getItemByLabel(name); } +bool LLComboBox::valueExists(const std::string& value) const +{ + return mList->getItemByValue(value); +} + +LLScrollListItem* LLComboBox::findItemByValue(const std::string& value) const +{ + return mList->getItemByValue(value); +} + +std::vector LLComboBox::getAllData() const +{ + return mList->getAllData(); +} + // add item "name" to menu LLScrollListItem* LLComboBox::add(const std::string& name, EAddPosition pos, bool enabled) { diff --git a/indra/llui/llcombobox.h b/indra/llui/llcombobox.h index 8be3eb57e4f..be18cdba487 100644 --- a/indra/llui/llcombobox.h +++ b/indra/llui/llcombobox.h @@ -143,7 +143,10 @@ class LLComboBox LLScrollListItem* addSeparator(EAddPosition pos = ADD_BOTTOM); bool remove( S32 index ); // remove item by index, return true if found and removed void removeall() { clearRows(); } - bool itemExists(const std::string& name); + bool itemExists(const std::string& name) const; + bool valueExists(const std::string& value) const; + LLScrollListItem* findItemByValue(const std::string& value) const; + std::vector getAllData() const; void sortByName(bool ascending = true); // Sort the entries in the combobox by name diff --git a/indra/llui/llemojidictionary.cpp b/indra/llui/llemojidictionary.cpp index 925608e47ea..16e6f0591af 100644 --- a/indra/llui/llemojidictionary.cpp +++ b/indra/llui/llemojidictionary.cpp @@ -390,14 +390,17 @@ void LLEmojiDictionary::loadEmojis() continue; } + std::string category; std::list categories = loadCategories(sd); if (categories.empty()) { - LL_WARNS() << "Skipping invalid emoji descriptor (no categories)" << LL_ENDL; - continue; + // Should already have a localization for "other symbols" + category = "other symbols"; + } + else + { + category = categories.front(); } - - std::string category = categories.front(); if (std::find(mSkipCategories.begin(), mSkipCategories.end(), category) != mSkipCategories.end()) { diff --git a/indra/llui/llemojihelper.cpp b/indra/llui/llemojihelper.cpp index b2c59ce7752..7cdd19bebcb 100644 --- a/indra/llui/llemojihelper.cpp +++ b/indra/llui/llemojihelper.cpp @@ -117,7 +117,17 @@ void LLEmojiHelper::showHelper(LLUICtrl* hostctrl_p, S32 local_x, S32 local_y, c S32 top = floater_y - HELPER_FLOATER_OFFSET_Y + rect.getHeight(); rect.setLeftTopAndSize(left, top, rect.getWidth(), rect.getHeight()); pHelperFloater->setRect(rect); + + // Hack: Trying to open floater, search for a match, + // and hide floater immediately if no match found, + // instead of checking prior to opening + // + // Supress sounds in case floater won't be shown. + // Todo: add some kind of shouldShow(short_code) + U8 sound_flags = pHelperFloater->getSoundFlags(); + pHelperFloater->setSoundFlags(LLView::SILENT); pHelperFloater->openFloater(LLSD().with("hint", short_code)); + pHelperFloater->setSoundFlags(sound_flags); } void LLEmojiHelper::hideHelper(const LLUICtrl* ctrl_p, bool strict) diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index fd07b2ec5da..52a5e3dbd69 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -2274,7 +2274,7 @@ void LLFloater::drawConeToOwner(F32 &context_cone_opacity, LLRect local_rect = getLocalRect(); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - LLGLEnable(GL_CULL_FACE); + LLGLEnable cull_face(GL_CULL_FACE); gGL.begin(LLRender::TRIANGLE_STRIP); { gGL.color4f(0.f, 0.f, 0.f, contex_cone_in_alpha * context_cone_opacity); diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index b664065532a..db4ab8487e5 100644 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -1510,6 +1510,7 @@ bool LLFolderView::handleRightMouseDown( S32 x, S32 y, MASK mask ) && ( count > 0 && (hasVisibleChildren()) ))) && // show menu only if selected items are visible !hide_folder_menu) { + LL_INFOS("Inventory") << "Opening inventory menu from path: " << getPathname() << LL_ENDL; if (mCallbackRegistrar) { mCallbackRegistrar->pushScope(); diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index 9ca77dbe46b..878f1cb856e 100644 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -1884,10 +1884,18 @@ void LLFolderViewFolder::updateHasFavorites(bool new_childs_value) void LLFolderViewFolder::onIdleUpdateFavorites(void* data) { LLFolderViewFolder* self = reinterpret_cast(data); + if (self->mFavoritesDirtyFlags == FAVORITE_CLEANUP) + { + // parent or child already processed the update, clean the callback + self->mFavoritesDirtyFlags = 0; + gIdleCallbacks.deleteFunction(&LLFolderViewFolder::onIdleUpdateFavorites, data); + return; + } + if (self->mFavoritesDirtyFlags == 0) { - // already processed either on previous run or by a different callback - gIdleCallbacks.deleteFunction(&LLFolderViewFolder::onIdleUpdateFavorites, self); + llassert(false); // should not happen, everything that sets to 0 should clean callback + gIdleCallbacks.deleteFunction(&LLFolderViewFolder::onIdleUpdateFavorites, data); return; } @@ -1915,7 +1923,7 @@ void LLFolderViewFolder::onIdleUpdateFavorites(void* data) // Parent will remove onIdleUpdateFavorites later, don't remove now, // We are inside gIdleCallbacks. Removing 'self' callback is safe, // but removing 'parent' can invalidate following iterator - parent->mFavoritesDirtyFlags = 0; + parent->mFavoritesDirtyFlags = FAVORITE_CLEANUP; } parent = parent->getParentFolder(); } @@ -1981,7 +1989,7 @@ void LLFolderViewFolder::onIdleUpdateFavorites(void* data) // Parent will remove onIdleUpdateFavorites later, don't remove now, // We are inside gIdleCallbacks. Removing 'self' callback is safe, // but removing 'parent' can invalidate following iterator - parent->mFavoritesDirtyFlags = 0; + parent->mFavoritesDirtyFlags = FAVORITE_CLEANUP; } parent = parent->getParentFolder(); } @@ -1992,7 +2000,7 @@ void LLFolderViewFolder::onIdleUpdateFavorites(void* data) // Parent will remove onIdleUpdateFavorites later, don't remove now. // We are inside gIdleCallbacks. Removing 'self' callback is safe, // but removing 'parent' can invalidate following iterator - parent->mFavoritesDirtyFlags = 0; + parent->mFavoritesDirtyFlags = FAVORITE_CLEANUP; } parent = parent->getParentFolder(); } @@ -2106,10 +2114,14 @@ void LLFolderViewFolder::setOpen(bool openitem) { // navigateToFolder can destroy this view // delay it in case setOpen was called from click or key processing - doOnIdleOneTime([this]() - { - getViewModelItem()->navigateToFolder(); - }); + LLPointer view_model_item = mViewModelItem; + doOnIdleOneTime([view_model_item]() + { + if (view_model_item.notNull()) + { + view_model_item.get()->navigateToFolder(); + } + }); } else { diff --git a/indra/llui/llfolderviewitem.h b/indra/llui/llfolderviewitem.h index c9b003b892f..23d794bf264 100644 --- a/indra/llui/llfolderviewitem.h +++ b/indra/llui/llfolderviewitem.h @@ -421,6 +421,7 @@ class LLFolderViewFolder : public LLFolderViewItem constexpr static S32 FAVORITE_ADDED = 1; constexpr static S32 FAVORITE_REMOVED = 2; + constexpr static S32 FAVORITE_CLEANUP = 4; S32 mFavoritesDirtyFlags { 0 }; public: diff --git a/indra/llui/llkeywords.cpp b/indra/llui/llkeywords.cpp index 2bea8fb4ed2..aa5aceddfac 100644 --- a/indra/llui/llkeywords.cpp +++ b/indra/llui/llkeywords.cpp @@ -28,43 +28,26 @@ #include #include +#include #include "llkeywords.h" #include "llsdserialize.h" #include "lltexteditor.h" #include "llstl.h" +#include "llcontrol.h" + +extern LLControlGroup gSavedSettings; inline bool LLKeywordToken::isHead(const llwchar* s) const { - // strncmp is much faster than string compare - bool res = true; - const llwchar* t = mToken.c_str(); - auto len = mToken.size(); - for (S32 i=0; ifirst == "llsd-lsl-syntax-version") { @@ -258,6 +264,21 @@ void LLKeywords::processTokens() } } } + + // Pre-compile all regex patterns for tokens in mRegexTokenList + for (LLKeywordToken* regex_token : mRegexTokenList) + { + std::string start_pattern(regex_token->getToken().begin(), regex_token->getToken().end()); + try + { + regex_token->setCompiledRegex(new std::regex(start_pattern)); + } + catch (const std::regex_error& e) + { + LL_WARNS() << "Regex error in start pattern: " << e.what() << " in pattern: " << start_pattern << LL_ENDL; + } + } + LL_INFOS("SyntaxLSL") << "Finished processing tokens." << LL_ENDL; } @@ -346,8 +367,11 @@ void LLKeywords::processTokensGroup(const LLSD& tokens, std::string_view group) break; case LLKeywordToken::TT_FUNCTION: tooltip = getAttribute("return") + " " + outer_itr->first + "(" + getArguments(arguments) + ");"; - tooltip.append("\nEnergy: "); - tooltip.append(getAttribute("energy").empty() ? "0.0" : getAttribute("energy")); + if (std::stod(getAttribute("energy")) >= 0) + { + tooltip.append("\nEnergy: "); + tooltip.append(getAttribute("energy").empty() ? "0.0" : getAttribute("energy")); + } if (!getAttribute("sleep").empty()) { tooltip += ", Sleep: " + getAttribute("sleep"); @@ -482,17 +506,28 @@ LLTrace::BlockTimerStatHandle FTM_SYNTAX_COLORING("Syntax Coloring"); void LLKeywords::findSegments(std::vector* seg_list, const LLWString& wtext, LLTextEditor& editor, LLStyleConstSP style) { LL_RECORD_BLOCK_TIME(FTM_SYNTAX_COLORING); - seg_list->clear(); if( wtext.empty() ) { return; } + // Clear the segment list + seg_list->clear(); + // Reserve capacity for segments based on an estimated average of 8 characters per segment. + constexpr size_t AVERAGE_SEGMENT_LENGTH = 8; + seg_list->reserve(wtext.size() / AVERAGE_SEGMENT_LENGTH); + S32 text_len = static_cast(wtext.size()) + 1; seg_list->push_back( new LLNormalTextSegment( style, 0, text_len, editor ) ); + std::string text_to_search; + text_to_search.reserve(wtext.size()); + + bool has_regex = !mRegexTokenList.empty(); + auto& delimiters = mDelimiterTokenList; + const llwchar* base = wtext.c_str(); const llwchar* cur = base; while( *cur ) @@ -560,16 +595,148 @@ void LLKeywords::findSegments(std::vector* seg_list, const LLW cur++; } + // Check if syntax highlighting is disabled + static LLCachedControl sDisableSyntaxHighlighting(gSavedSettings, "ScriptEditorDisableSyntaxHighlight", false); + if (sDisableSyntaxHighlighting) + { + if (*cur && *cur != '\n') + { + cur++; + } + continue; // skip processing any further syntax highlighting + } + while( *cur && *cur != '\n' ) { + // Check for regex matches first + bool regex_matched = false; + if (has_regex) + { + S32 seg_start = (S32)(cur - base); + + text_to_search.assign(wtext.begin() + seg_start, wtext.end()); + + for (LLKeywordToken* regex_token : mRegexTokenList) + { + std::regex* compiled_regex = regex_token->getCompiledRegex(); + + // If we have a pre-compiled regex, use it + if (compiled_regex) + { + std::string end_pattern(regex_token->getDelimiter().begin(), regex_token->getDelimiter().end()); + + try + { + std::smatch start_match; + + if (std::regex_search(text_to_search, start_match, *compiled_regex) && !start_match.empty()) + { + if (start_match.position() == 0) // Match starts at current position + { + // Calculate segment boundaries for start pattern + S32 start_match_length = static_cast(start_match.str().length()); + S32 start_seg_end = seg_start + start_match_length; + + if (end_pattern.empty()) + { + // If no end pattern is provided, treat the entire regex match as a single segment + // Move cursor past the matched segment + cur = base + start_seg_end; + + // Insert the matched segment + insertSegments(wtext, *seg_list, regex_token, text_len, seg_start, start_seg_end, style, editor); + } + else + { // TODO: better optimization for this part + + // Look for the end pattern after the start pattern + std::string remaining_text = text_to_search.substr(start_match_length); + + // Process end pattern - replace any capture group references + std::string actual_end_pattern = end_pattern; + + // Handle capture groups in the end pattern (replace \1, \2, etc. with their matched content) + for (size_t i = 1; i < start_match.size(); ++i) + { + std::string capture = start_match[i].str(); + std::string placeholder = "\\" + std::to_string(i); + + // Replace all occurrences of the placeholder with the captured content + size_t pos = 0; + while ((pos = actual_end_pattern.find(placeholder, pos)) != std::string::npos) + { + actual_end_pattern.replace(pos, placeholder.length(), capture); + pos += capture.length(); + } + } + + try + { + std::regex end_regex_pattern(actual_end_pattern); + std::smatch end_match; + + S32 seg_end = start_seg_end; + + if (std::regex_search(remaining_text, end_match, end_regex_pattern) && !end_match.empty()) + { + // Calculate position of end match relative to the original text + S32 end_match_position = static_cast(end_match.position()); + S32 end_match_length = static_cast(end_match.str().length()); + + // Calculate the total length including both patterns and text between + seg_end += end_match_position + end_match_length; + } + else + { + // End pattern not found, treat everything up to EOF as the segment + seg_end += static_cast(remaining_text.length()); + } + + // Move cursor past the entire matched segment (start + content + end) + cur = base + seg_end; + + // Insert the matched segment + insertSegments(wtext, *seg_list, regex_token, text_len, seg_start, seg_end, style, editor); + } + catch (const std::regex_error& e) + { + LL_WARNS() << "Regex error in end pattern: " << e.what() << " in pattern: " << actual_end_pattern << LL_ENDL; + // Fall back to treating the start match as the entire segment + cur = base + start_seg_end; + insertSegments(wtext, *seg_list, regex_token, text_len, seg_start, start_seg_end, style, editor); + } + } + + regex_matched = true; + break; + } + } + } + catch (const std::regex_error& e) + { + LL_WARNS() << "Error using compiled regex: " << e.what() << LL_ENDL; + } + } + else + { + // Skip tokens that aren't pre-compiled + LL_WARNS() << "Skipping regex token due to missing pre-compiled pattern: " + << wstring_to_utf8str(regex_token->getToken()) << LL_ENDL; + } + } + + if (regex_matched) + { + continue; + } + } + // Check against delimiters { S32 seg_start = 0; LLKeywordToken* cur_delimiter = NULL; - for (token_list_t::iterator iter = mDelimiterTokenList.begin(); - iter != mDelimiterTokenList.end(); ++iter) + for (auto* delimiter : delimiters) { - LLKeywordToken* delimiter = *iter; if( delimiter->isHead( cur ) ) { cur_delimiter = delimiter; @@ -586,7 +753,7 @@ void LLKeywords::findSegments(std::vector* seg_list, const LLW cur += cur_delimiter->getLengthHead(); LLKeywordToken::ETokenType type = cur_delimiter->getType(); - if( type == LLKeywordToken::TT_TWO_SIDED_DELIMITER || type == LLKeywordToken::TT_DOUBLE_QUOTATION_MARKS ) + if(type == LLKeywordToken::TT_TWO_SIDED_DELIMITER || type == LLKeywordToken::TT_DOUBLE_QUOTATION_MARKS) { while( *cur && !cur_delimiter->isTail(cur)) { @@ -627,7 +794,7 @@ void LLKeywords::findSegments(std::vector* seg_list, const LLW if( *cur ) { - cur += cur_delimiter->getLengthHead(); + cur += cur_delimiter->getLengthTail(); seg_end = seg_start + between_delimiters + cur_delimiter->getLengthHead() + cur_delimiter->getLengthTail(); } else @@ -648,12 +815,7 @@ void LLKeywords::findSegments(std::vector* seg_list, const LLW seg_end = seg_start + between_delimiters + cur_delimiter->getLengthHead(); } - insertSegments(wtext, *seg_list,cur_delimiter, text_len, seg_start, seg_end, style, editor); - /* - LLTextSegmentPtr text_segment = new LLNormalTextSegment( cur_delimiter->getColor(), seg_start, seg_end, editor ); - text_segment->setToken( cur_delimiter ); - insertSegment( seg_list, text_segment, text_len, defaultColor, editor); - */ + insertSegments(wtext, *seg_list, cur_delimiter, text_len, seg_start, seg_end, style, editor); // Note: we don't increment cur, since the end of one delimited seg may be immediately // followed by the start of another one. continue; @@ -662,34 +824,83 @@ void LLKeywords::findSegments(std::vector* seg_list, const LLW // check against words llwchar prev = cur > base ? *(cur-1) : 0; - if( !iswalnum( prev ) && (prev != '_') ) + if (!iswalnum(prev) && prev != '_' && prev != '.') { - const llwchar* p = cur; - while( iswalnum( *p ) || (*p == '_') ) + const llwchar* word_start = cur; + S32 namespace_dots = 0; + const llwchar* last_dot = nullptr; + + // Find the full extent of the word, potentially including namespace dots + while (iswalnum(*cur) || *cur == '_' || (mLuauLanguage && *cur == '.' && iswalnum(*(cur+1)))) { - p++; + if (mLuauLanguage && *cur == '.') + { + namespace_dots++; + last_dot = cur; + } + cur++; } - S32 seg_len = (S32)(p - cur); - if( seg_len > 0 ) + + S32 seg_len = (S32)(cur - word_start); + if (seg_len > 0) { - WStringMapIndex word( cur, seg_len ); - word_token_map_t::iterator map_iter = mWordTokenMap.find(word); - if( map_iter != mWordTokenMap.end() ) + S32 seg_start = (S32)(word_start - base); + S32 seg_end = seg_start + seg_len; + + // First try to match the whole token (including dots for Lua namespaces) + word_token_map_t::iterator map_iter = mWordTokenMap.find(WStringMapIndex(word_start, seg_len)); + + if (map_iter != mWordTokenMap.end()) { + // Found a match for the complete token (including any namespace) LLKeywordToken* cur_token = map_iter->second; - S32 seg_start = (S32)(cur - base); - S32 seg_end = seg_start + seg_len; + insertSegments(wtext, *seg_list, cur_token, text_len, seg_start, seg_end, style, editor); + } + else if (namespace_dots > 0 && mLuauLanguage) + { + // If using Lua and we have namespace dots but didn't match the whole token, + // check if we have a match for just the namespace prefix (e.g., "ll") + if (last_dot > word_start) + { + // Get the namespace prefix (part before the first dot) + S32 prefix_len = (S32)(last_dot - word_start); + map_iter = mWordTokenMap.find(WStringMapIndex(word_start, prefix_len)); - // LL_INFOS("SyntaxLSL") << "Seg: [" << word.c_str() << "]" << LL_ENDL; + if (map_iter != mWordTokenMap.end()) + { + // Found a match for the namespace prefix, highlight just that part + LLKeywordToken* cur_token = map_iter->second; + insertSegments(wtext, *seg_list, cur_token, text_len, seg_start, seg_start + prefix_len, style, editor); - insertSegments(wtext, *seg_list,cur_token, text_len, seg_start, seg_end, style, editor); + // Now try to match the function part (after the dot) + const llwchar* func_part = last_dot + 1; + S32 func_len = (S32)(cur - func_part); + + if (func_len > 0) + { + // Look for complete function matches + map_iter = mWordTokenMap.find(WStringMapIndex(func_part, func_len)); + + if (map_iter != mWordTokenMap.end()) + { + // Found a match for the function part + LLKeywordToken* cur_token = map_iter->second; + insertSegments(wtext, *seg_list, cur_token, text_len, seg_start, seg_end, style, editor); + } + else + { + // No token found, continue without incrementing cur + // since we already advanced it while collecting the word + } + } + } + } } - cur += seg_len; - continue; + continue; // Continue to next token regardless of match } } - if( *cur && *cur != '\n' ) + if (*cur && *cur != '\n') { cur++; } @@ -798,6 +1009,14 @@ void LLKeywords::dump() LLKeywordToken* delimiter_token = *iter; delimiter_token->dump(); } + + LL_INFOS() << "LLKeywords::sRegexTokenList" << LL_ENDL; + for (token_list_t::iterator iter = mRegexTokenList.begin(); + iter != mRegexTokenList.end(); ++iter) + { + LLKeywordToken* regex_token = *iter; + regex_token->dump(); + } } void LLKeywordToken::dump() diff --git a/indra/llui/llkeywords.h b/indra/llui/llkeywords.h index 5892238593e..f5da50a0539 100644 --- a/indra/llui/llkeywords.h +++ b/indra/llui/llkeywords.h @@ -36,6 +36,7 @@ #include #include #include +#include #include "llpointer.h" class LLTextSegment; @@ -53,6 +54,11 @@ class LLKeywordToken * - TT_ONE_SIDED_DELIMITER are for open-ended delimiters which are terminated by EOL. * - TT_TWO_SIDED_DELIMITER are for delimiters that end with a different delimiter than they open with. * - TT_DOUBLE_QUOTATION_MARKS are for delimiting areas using the same delimiter to open and close. + * - TT_REGEX_MATCH are for pattern-based matching using regular expressions. + * For TT_REGEX_MATCH: mToken contains the start pattern, mDelimiter contains the end pattern (if any). + * If mDelimiter is empty, the entire match is considered one segment. + * If mDelimiter contains capture group references (e.g. \1, \2), these will be replaced with + * the corresponding capture groups from the start pattern match. */ typedef enum e_token_type { @@ -62,6 +68,7 @@ class LLKeywordToken TT_TWO_SIDED_DELIMITER, TT_ONE_SIDED_DELIMITER, TT_DOUBLE_QUOTATION_MARKS, + TT_REGEX_MATCH, // Following constants are more specific versions of the preceding ones TT_CONSTANT, // WORD TT_CONTROL, // WORD @@ -78,10 +85,20 @@ class LLKeywordToken mToken( token ), mColor( color ), mToolTip( tool_tip ), - mDelimiter( delimiter ) // right delimiter + mDelimiter( delimiter ), // right delimiter + mCompiledRegex( nullptr ) { } + ~LLKeywordToken() + { + if (mCompiledRegex) + { + delete mCompiledRegex; + mCompiledRegex = nullptr; + } + } + S32 getLengthHead() const { return static_cast(mToken.size()); } S32 getLengthTail() const { return static_cast(mDelimiter.size()); } bool isHead(const llwchar* s) const; @@ -91,6 +108,8 @@ class LLKeywordToken ETokenType getType() const { return mType; } const LLWString& getToolTip() const { return mToolTip; } const LLWString& getDelimiter() const { return mDelimiter; } + std::regex* getCompiledRegex() const { return mCompiledRegex; } + void setCompiledRegex(std::regex* regex) { mCompiledRegex = regex; } #ifdef _DEBUG void dump(); @@ -102,6 +121,7 @@ class LLKeywordToken LLUIColor mColor; LLWString mToolTip; LLWString mDelimiter; + std::regex* mCompiledRegex; }; class LLKeywords @@ -118,7 +138,7 @@ class LLKeywords const LLWString& text, class LLTextEditor& editor, LLStyleConstSP style); - void initialize(LLSD SyntaxXML); + void initialize(LLSD SyntaxXML, bool luau_language = false); void processTokens(); // Add the token as described @@ -189,10 +209,12 @@ class LLKeywords bool mLoaded; LLSD mSyntax; + bool mLuauLanguage; word_token_map_t mWordTokenMap; typedef std::deque token_list_t; token_list_t mLineTokenList; token_list_t mDelimiterTokenList; + token_list_t mRegexTokenList; typedef std::map> element_attributes_t; typedef element_attributes_t::const_iterator attribute_iterator_t; diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index ff77b4d4820..7d0d0b72379 100644 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -1281,6 +1281,19 @@ LLScrollListItem* LLScrollListCtrl::getItemByLabel(const std::string& label, boo return NULL; } +LLScrollListItem* LLScrollListCtrl::getItemByValue(const std::string& value) +{ + for (LLScrollListItem* item : mItemList) + { + if (item->getValue().asString() == value) + { + return item; + } + } + + return NULL; +} + LLScrollListItem* LLScrollListCtrl::getItemByIndex(S32 index) { if (index >= 0 && index < (S32)mItemList.size()) diff --git a/indra/llui/llscrolllistctrl.h b/indra/llui/llscrolllistctrl.h index 1f041003069..3028d1f02e2 100644 --- a/indra/llui/llscrolllistctrl.h +++ b/indra/llui/llscrolllistctrl.h @@ -262,7 +262,8 @@ class LLScrollListCtrl : public LLUICtrl, public LLEditMenuHandler, bool selectItemByLabel(const std::string& item, bool case_sensitive = true, S32 column = 0); // false if item not found bool selectItemByPrefix(const std::string& target, bool case_sensitive = true, S32 column = -1); bool selectItemByPrefix(const LLWString& target, bool case_sensitive = true, S32 column = -1); - LLScrollListItem* getItemByLabel(const std::string& item, bool case_sensitive = true, S32 column = 0); + LLScrollListItem* getItemByLabel(const std::string& label, bool case_sensitive = true, S32 column = 0); + LLScrollListItem* getItemByValue(const std::string& value); LLScrollListItem* getItemByIndex(S32 index); std::string getSelectedItemLabel(S32 column = 0) const; LLSD getSelectedValue(); diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 3fe0df1848c..44151a43554 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -185,6 +185,7 @@ LLTextBase::LLTextBase(const LLTextBase::Params &p) mURLClickSignal(NULL), mIsFriendSignal(NULL), mIsObjectBlockedSignal(NULL), + mIsObjectReachableSignal(NULL), mMaxTextByteLength( p.max_text_length ), mFont(p.font), mFontShadow(p.font_shadow), @@ -290,6 +291,7 @@ LLTextBase::~LLTextBase() delete mURLClickSignal; delete mIsFriendSignal; delete mIsObjectBlockedSignal; + delete mIsObjectReachableSignal; } void LLTextBase::initFromParams(const LLTextBase::Params& p) @@ -1036,8 +1038,37 @@ S32 LLTextBase::insertStringNoUndo(S32 pos, const LLWString &wstr, LLTextBase::s { LLStyleSP emoji_style; LLEmojiDictionary* ed = LLEmojiDictionary::instanceExists() ? LLEmojiDictionary::getInstance() : NULL; + LLTextSegment* segmentp = nullptr; + segment_vec_t::iterator seg_iter; + if (segments && segments->size() > 0) + { + seg_iter = segments->begin(); + segmentp = *seg_iter; + } for (S32 text_kitty = 0, text_len = static_cast(wstr.size()); text_kitty < text_len; text_kitty++) { + if (segmentp) + { + if (segmentp->getEnd() <= pos + text_kitty) + { + seg_iter++; + if (seg_iter != segments->end()) + { + segmentp = *seg_iter; + } + else + { + segmentp = nullptr; + } + } + if (segmentp && !segmentp->getPermitsEmoji()) + { + // Some segments, like LLInlineViewSegment do not permit splitting + // and should not be interrupted by emoji segments + continue; + } + } + llwchar code = wstr[text_kitty]; bool isEmoji = ed ? ed->isEmoji(code) : LLStringOps::isEmoji(code); if (isEmoji) @@ -1446,6 +1477,8 @@ void LLTextBase::reshape(S32 width, S32 height, bool called_from_parent) // up-to-date mVisibleTextRect updateRects(); + // Todo: This might be wrong. updateRects already sets needsReflow conditionaly. + // Reflow is expensive and doing it at any twith can be too much. needsReflow(); } } @@ -2281,6 +2314,15 @@ void LLTextBase::createUrlContextMenu(S32 x, S32 y, const std::string &in_url) unblockButton->setVisible(is_blocked); } } + + if (mIsObjectReachableSignal) + { + bool is_reachable = *(*mIsObjectReachableSignal)(LLUUID(LLUrlAction::getObjectId(url))); + if (LLView* zoom_btn = menu->getChild("zoom_in")) + { + zoom_btn->setEnabled(is_reachable); + } + } menu->show(x, y); LLMenuGL::showPopup(this, menu, x, y); } @@ -3387,6 +3429,15 @@ boost::signals2::connection LLTextBase::setIsObjectBlockedCallback(const is_bloc return mIsObjectBlockedSignal->connect(cb); } +boost::signals2::connection LLTextBase::setIsObjectReachableCallback(const is_obj_reachable_signal_t::slot_type& cb) +{ + if (!mIsObjectReachableSignal) + { + mIsObjectReachableSignal = new is_obj_reachable_signal_t(); + } + return mIsObjectReachableSignal->connect(cb); +} + // // LLTextSegment // @@ -3426,6 +3477,7 @@ S32 LLTextSegment::getNumChars(S32 num_pixels, S32 segment_offset, S32 line_offs void LLTextSegment::updateLayout(const LLTextBase& editor) {} F32 LLTextSegment::draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect) { return draw_rect.mLeft; } bool LLTextSegment::canEdit() const { return false; } +bool LLTextSegment::getPermitsEmoji() const { return true; } void LLTextSegment::unlinkFromDocument(LLTextBase*) {} void LLTextSegment::linkToDocument(LLTextBase*) {} const LLUIColor& LLTextSegment::getColor() const { static const LLUIColor white = LLUIColorTable::instance().getColor("White", LLColor4::white); return white; } diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h index 8ca653acb91..50767a35b3a 100644 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -87,6 +87,7 @@ class LLTextSegment virtual void updateLayout(const class LLTextBase& editor); virtual F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect); virtual bool canEdit() const; + virtual bool getPermitsEmoji() const; virtual void unlinkFromDocument(class LLTextBase* editor); virtual void linkToDocument(class LLTextBase* editor); @@ -255,6 +256,7 @@ class LLInlineViewSegment : public LLTextSegment /*virtual*/ void updateLayout(const class LLTextBase& editor); /*virtual*/ F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect); /*virtual*/ bool canEdit() const { return false; } + /*virtual*/ bool getPermitsEmoji() const { return false; } /*virtual*/ void unlinkFromDocument(class LLTextBase* editor); /*virtual*/ void linkToDocument(class LLTextBase* editor); @@ -325,6 +327,7 @@ class LLTextBase typedef boost::signals2::signal is_friend_signal_t; typedef boost::signals2::signal is_blocked_signal_t; + typedef boost::signals2::signal is_obj_reachable_signal_t; struct LineSpacingParams : public LLInitParam::ChoiceBlock { @@ -535,6 +538,7 @@ class LLTextBase boost::signals2::connection setURLClickedCallback(const commit_signal_t::slot_type& cb); boost::signals2::connection setIsFriendCallback(const is_friend_signal_t::slot_type& cb); boost::signals2::connection setIsObjectBlockedCallback(const is_blocked_signal_t::slot_type& cb); + boost::signals2::connection setIsObjectReachableCallback(const is_obj_reachable_signal_t::slot_type& cb); void setWordWrap(bool wrap); LLScrollContainer* getScrollContainer() const { return mScroller; } @@ -783,6 +787,7 @@ class LLTextBase // Used to check if user with given ID is avatar's friend is_friend_signal_t* mIsFriendSignal; is_blocked_signal_t* mIsObjectBlockedSignal; + is_obj_reachable_signal_t* mIsObjectReachableSignal; LLUIString mLabel; // text label that is visible when no user text provided }; diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp index 5955a28fa32..56ab6e9bae1 100644 --- a/indra/llui/lltoolbar.cpp +++ b/indra/llui/lltoolbar.cpp @@ -1054,7 +1054,7 @@ bool LLToolBar::handleDragAndDrop(S32 x, S32 y, MASK mask, bool drop, // if drop is set, it's time to call the callback to get the operation done if (handled && drop) { - handled = mHandleDropCallback(cargo_data, x, y, this); + handled = mHandleDropCallback(cargo_data, cargo_type, x, y, this); } // We accept only single tool drop on toolbars diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index 5556406fbda..a3f044c256e 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -41,7 +41,7 @@ class LLIconCtrl; typedef boost::function tool_startdrag_callback_t; typedef boost::function tool_handledrag_callback_t; -typedef boost::function tool_handledrop_callback_t; +typedef boost::function tool_handledrop_callback_t; class LLToolBarButton : public LLButton { diff --git a/indra/llui/llviewereventrecorder.cpp b/indra/llui/llviewereventrecorder.cpp index 6d907d7e457..9eefba13903 100644 --- a/indra/llui/llviewereventrecorder.cpp +++ b/indra/llui/llviewereventrecorder.cpp @@ -34,8 +34,6 @@ LLViewerEventRecorder::LLViewerEventRecorder() { logEvents = false; // Remove any previous event log file std::string old_log_ui_events_to_llsd_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "SecondLife_Events_log.old"); - LLFile::remove(old_log_ui_events_to_llsd_file, ENOENT); - mLogFilename = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "SecondLife_Events_log.llsd"); LLFile::rename(mLogFilename, old_log_ui_events_to_llsd_file, ENOENT); diff --git a/indra/llwebrtc/llwebrtc.cpp b/indra/llwebrtc/llwebrtc.cpp index d5182b16e7d..161d8d7e915 100644 --- a/indra/llwebrtc/llwebrtc.cpp +++ b/indra/llwebrtc/llwebrtc.cpp @@ -374,8 +374,6 @@ void LLWebRTCImpl::terminate() mSignalingThread->BlockingCall([this]() { mPeerConnectionFactory = nullptr; }); - mPeerConnections.clear(); - mWorkerThread->BlockingCall( [this]() { @@ -386,6 +384,14 @@ void LLWebRTCImpl::terminate() mDeviceModule = nullptr; mTaskQueueFactory = nullptr; }); + + // In case peer connections still somehow have jobs in workers, + // only clear connections up after clearing workers. + mNetworkThread = nullptr; + mWorkerThread = nullptr; + mSignalingThread = nullptr; + + mPeerConnections.clear(); webrtc::LogMessage::RemoveLogToStream(mLogSink); } @@ -566,14 +572,20 @@ void LLWebRTCImpl::workerDeployDevices() void LLWebRTCImpl::setCaptureDevice(const std::string &id) { - mRecordingDevice = id; - deployDevices(); + if (mRecordingDevice != id) + { + mRecordingDevice = id; + deployDevices(); + } } void LLWebRTCImpl::setRenderDevice(const std::string &id) { - mPlayoutDevice = id; - deployDevices(); + if (mPlayoutDevice != id) + { + mPlayoutDevice = id; + deployDevices(); + } } // updateDevices needs to happen on the worker thread. @@ -635,6 +647,13 @@ void LLWebRTCImpl::OnDevicesUpdated() void LLWebRTCImpl::setTuningMode(bool enable) { mTuningMode = enable; + if (!mTuningMode + && !mMute + && mPeerCustomProcessor + && mPeerCustomProcessor->getGain() != mGain) + { + mPeerCustomProcessor->setGain(mGain); + } mWorkerThread->PostTask( [this] { @@ -766,6 +785,7 @@ void LLWebRTCImpl::freePeerConnection(LLWebRTCPeerConnectionInterface* peer_conn std::find(mPeerConnections.begin(), mPeerConnections.end(), peer_connection); if (it != mPeerConnections.end()) { + // Todo: make sure conection had no jobs in workers mPeerConnections.erase(it); if (mPeerConnections.empty()) { @@ -785,7 +805,8 @@ LLWebRTCPeerConnectionImpl::LLWebRTCPeerConnectionImpl() : mWebRTCImpl(nullptr), mPeerConnection(nullptr), mMute(MUTE_INITIAL), - mAnswerReceived(false) + mAnswerReceived(false), + mPendingJobs(0) { } @@ -793,6 +814,10 @@ LLWebRTCPeerConnectionImpl::~LLWebRTCPeerConnectionImpl() { mSignalingObserverList.clear(); mDataObserverList.clear(); + if (mPendingJobs > 0) + { + RTC_LOG(LS_ERROR) << __FUNCTION__ << "Destroying a connection that has " << std::to_string(mPendingJobs) << " unfinished jobs that might cause workers to crash"; + } } // @@ -804,8 +829,10 @@ void LLWebRTCPeerConnectionImpl::init(LLWebRTCImpl * webrtc_impl) mWebRTCImpl = webrtc_impl; mPeerConnectionFactory = mWebRTCImpl->getPeerConnectionFactory(); } + void LLWebRTCPeerConnectionImpl::terminate() { + mPendingJobs++; mWebRTCImpl->PostSignalingTask( [this]() { @@ -848,7 +875,9 @@ void LLWebRTCPeerConnectionImpl::terminate() observer->OnPeerConnectionClosed(); } } + mPendingJobs--; }); + mPeerConnectionFactory.release(); } void LLWebRTCPeerConnectionImpl::setSignalingObserver(LLWebRTCSignalingObserver *observer) { mSignalingObserverList.emplace_back(observer); } @@ -869,6 +898,7 @@ bool LLWebRTCPeerConnectionImpl::initializeConnection(const LLWebRTCPeerConnecti RTC_DCHECK(!mPeerConnection); mAnswerReceived = false; + mPendingJobs++; mWebRTCImpl->PostSignalingTask( [this,options]() { @@ -890,6 +920,13 @@ bool LLWebRTCPeerConnectionImpl::initializeConnection(const LLWebRTCPeerConnecti config.set_max_port(60100); webrtc::PeerConnectionDependencies pc_dependencies(this); + if (mPeerConnectionFactory == nullptr) + { + RTC_LOG(LS_ERROR) << __FUNCTION__ << "Error creating peer connection, factory doesn't exist"; + // Too early? + mPendingJobs--; + return; + } auto error_or_peer_connection = mPeerConnectionFactory->CreatePeerConnectionOrError(config, std::move(pc_dependencies)); if (error_or_peer_connection.ok()) { @@ -902,6 +939,7 @@ bool LLWebRTCPeerConnectionImpl::initializeConnection(const LLWebRTCPeerConnecti { observer->OnRenegotiationNeeded(); } + mPendingJobs--; return; } @@ -964,6 +1002,7 @@ bool LLWebRTCPeerConnectionImpl::initializeConnection(const LLWebRTCPeerConnecti webrtc::PeerConnectionInterface::RTCOfferAnswerOptions offerOptions; mPeerConnection->CreateOffer(this, offerOptions); + mPendingJobs--; }); return true; @@ -1006,6 +1045,7 @@ void LLWebRTCPeerConnectionImpl::AnswerAvailable(const std::string &sdp) { RTC_LOG(LS_INFO) << __FUNCTION__ << " Remote SDP: " << sdp; + mPendingJobs++; mWebRTCImpl->PostSignalingTask( [this, sdp]() { @@ -1015,6 +1055,7 @@ void LLWebRTCPeerConnectionImpl::AnswerAvailable(const std::string &sdp) mPeerConnection->SetRemoteDescription(webrtc::CreateSessionDescription(webrtc::SdpType::kAnswer, sdp), webrtc::scoped_refptr(this)); } + mPendingJobs--; }); } @@ -1037,6 +1078,7 @@ void LLWebRTCPeerConnectionImpl::setMute(bool mute) mMute = new_state; + mPendingJobs++; mWebRTCImpl->PostSignalingTask( [this, force_reset, enable]() { @@ -1060,6 +1102,7 @@ void LLWebRTCPeerConnectionImpl::setMute(bool mute) track->set_enabled(enable); } } + mPendingJobs--; } }); } @@ -1081,6 +1124,7 @@ void LLWebRTCPeerConnectionImpl::resetMute() void LLWebRTCPeerConnectionImpl::setReceiveVolume(float volume) { + mPendingJobs++; mWebRTCImpl->PostSignalingTask( [this, volume]() { @@ -1099,11 +1143,13 @@ void LLWebRTCPeerConnectionImpl::setReceiveVolume(float volume) } } } + mPendingJobs--; }); } void LLWebRTCPeerConnectionImpl::setSendVolume(float volume) { + mPendingJobs++; mWebRTCImpl->PostSignalingTask( [this, volume]() { @@ -1114,6 +1160,7 @@ void LLWebRTCPeerConnectionImpl::setSendVolume(float volume) track->GetSource()->SetVolume(volume*5.0); } } + mPendingJobs--; }); } @@ -1190,11 +1237,13 @@ void LLWebRTCPeerConnectionImpl::OnConnectionChange(webrtc::PeerConnectionInterf { case webrtc::PeerConnectionInterface::PeerConnectionState::kConnected: { + mPendingJobs++; mWebRTCImpl->PostWorkerTask([this]() { for (auto &observer : mSignalingObserverList) { observer->OnAudioEstablished(this); } + mPendingJobs--; }); break; } @@ -1452,11 +1501,13 @@ void LLWebRTCPeerConnectionImpl::sendData(const std::string& data, bool binary) { webrtc::CopyOnWriteBuffer cowBuffer(data.data(), data.length()); webrtc::DataBuffer buffer(cowBuffer, binary); + mPendingJobs++; mWebRTCImpl->PostNetworkTask([this, buffer]() { if (mDataChannel) { mDataChannel->Send(buffer); } + mPendingJobs--; }); } } diff --git a/indra/llwebrtc/llwebrtc_impl.h b/indra/llwebrtc/llwebrtc_impl.h index df06cb88fa9..01cfb17ced2 100644 --- a/indra/llwebrtc/llwebrtc_impl.h +++ b/indra/llwebrtc/llwebrtc_impl.h @@ -422,6 +422,9 @@ class LLWebRTCImpl : public LLWebRTCDeviceInterface, public webrtc::AudioDeviceO ~LLWebRTCImpl() { delete mLogSink; + + // Explicit cleanup for the sake of debugging and crash stacks + mPeerCustomProcessor = nullptr; } void init(); @@ -669,6 +672,8 @@ class LLWebRTCPeerConnectionImpl : public LLWebRTCPeerConnectionInterface, // data std::vector mDataObserverList; webrtc::scoped_refptr mDataChannel; + + std::atomic mPendingJobs; }; } diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm index c9a62eedb1c..403103991e3 100644 --- a/indra/llwindow/llopenglview-objc.mm +++ b/indra/llwindow/llopenglview-objc.mm @@ -114,7 +114,7 @@ @implementation LLOpenGLView - (unsigned long)getVramSize { CGLRendererInfoObj info = 0; - GLint vram_megabytes = 0; + GLint vram_megabytes = 0; int num_renderers = 0; CGLError the_err = CGLQueryRendererInfo (CGDisplayIDToOpenGLDisplayMask(kCGDirectMainDisplay), &info, &num_renderers); if(0 == the_err) @@ -132,29 +132,29 @@ - (unsigned long)getVramSize vram_megabytes = 256; } - return (unsigned long)vram_megabytes; // return value is in megabytes. + return (unsigned long)vram_megabytes; // return value is in megabytes. } - (void)viewDidMoveToWindow { - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(windowResized:) name:NSWindowDidResizeNotification - object:[self window]]; + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(windowResized:) name:NSWindowDidResizeNotification + object:[self window]]; [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(windowWillMiniaturize:) name:NSWindowWillMiniaturizeNotification - object:[self window]]; + selector:@selector(windowWillMiniaturize:) name:NSWindowWillMiniaturizeNotification + object:[self window]]; [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(windowDidDeminiaturize:) name:NSWindowDidDeminiaturizeNotification - object:[self window]]; + selector:@selector(windowDidDeminiaturize:) name:NSWindowDidDeminiaturizeNotification + object:[self window]]; [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(windowDidBecomeKey:) name:NSWindowDidBecomeKeyNotification - object:[self window]]; - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(windowDidChangeScreen:) name:NSWindowDidChangeScreenNotification - object:[self window]]; + selector:@selector(windowDidBecomeKey:) name:NSWindowDidBecomeKeyNotification + object:[self window]]; + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(windowDidChangeScreen:) name:NSWindowDidChangeScreenNotification + object:[self window]]; NSRect wnd_rect = [[self window] frame]; @@ -188,28 +188,28 @@ - (void)windowDidBecomeKey:(NSNotification *)notification; -(void)windowDidChangeScreen:(NSNotification *)notification; { - callWindowDidChangeScreen(); + callWindowDidChangeScreen(); } - (void)dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self]; - [super dealloc]; + [[NSNotificationCenter defaultCenter] removeObserver:self]; + [super dealloc]; } - (id) init { - return [self initWithFrame:[self bounds] withSamples:2 andVsync:TRUE]; + return [self initWithFrame:[self bounds] withSamples:2 andVsync:TRUE]; } - (id) initWithSamples:(NSUInteger)samples { - return [self initWithFrame:[self bounds] withSamples:samples andVsync:TRUE]; + return [self initWithFrame:[self bounds] withSamples:samples andVsync:TRUE]; } - (id) initWithSamples:(NSUInteger)samples andVsync:(BOOL)vsync { - return [self initWithFrame:[self bounds] withSamples:samples andVsync:vsync]; + return [self initWithFrame:[self bounds] withSamples:samples andVsync:vsync]; } #if LL_DARWIN @@ -221,90 +221,90 @@ - (id) initWithSamples:(NSUInteger)samples andVsync:(BOOL)vsync - (id) initWithFrame:(NSRect)frame withSamples:(NSUInteger)samples andVsync:(BOOL)vsync { [self registerForDraggedTypes:[NSArray arrayWithObject:NSPasteboardTypeURL]]; - [self initWithFrame:frame]; + [self initWithFrame:frame]; - // Initialize with a default "safe" pixel format that will work with versions dating back to OS X 10.6. - // Any specialized pixel formats, i.e. a core profile pixel format, should be initialized through rebuildContextWithFormat. - // 10.7 and 10.8 don't really care if we're defining a profile or not. If we don't explicitly request a core or legacy profile, it'll always assume a legacy profile (for compatibility reasons). - NSOpenGLPixelFormatAttribute attrs[] = { + // Initialize with a default "safe" pixel format that will work with versions dating back to OS X 10.6. + // Any specialized pixel formats, i.e. a core profile pixel format, should be initialized through rebuildContextWithFormat. + // 10.7 and 10.8 don't really care if we're defining a profile or not. If we don't explicitly request a core or legacy profile, it'll always assume a legacy profile (for compatibility reasons). + NSOpenGLPixelFormatAttribute attrs[] = { NSOpenGLPFANoRecovery, - NSOpenGLPFADoubleBuffer, - NSOpenGLPFAClosestPolicy, - NSOpenGLPFAAccelerated, - NSOpenGLPFASampleBuffers, 0, - NSOpenGLPFASamples, 0, - NSOpenGLPFAStencilSize, 8, - NSOpenGLPFADepthSize, 24, - NSOpenGLPFAAlphaSize, 8, - NSOpenGLPFAColorSize, 24, - NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion4_1Core, - 0 + NSOpenGLPFADoubleBuffer, + NSOpenGLPFAClosestPolicy, + NSOpenGLPFAAccelerated, + NSOpenGLPFASampleBuffers, 0, + NSOpenGLPFASamples, 0, + NSOpenGLPFAStencilSize, 8, + NSOpenGLPFADepthSize, 24, + NSOpenGLPFAAlphaSize, 8, + NSOpenGLPFAColorSize, 24, + NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion4_1Core, + 0 }; - NSOpenGLPixelFormat *pixelFormat = [[[NSOpenGLPixelFormat alloc] initWithAttributes:attrs] autorelease]; + NSOpenGLPixelFormat *pixelFormat = [[[NSOpenGLPixelFormat alloc] initWithAttributes:attrs] autorelease]; - if (pixelFormat == nil) - { - NSLog(@"Failed to create pixel format!", nil); - return nil; - } + if (pixelFormat == nil) + { + NSLog(@"Failed to create pixel format!", nil); + return nil; + } - NSOpenGLContext *glContext = [[NSOpenGLContext alloc] initWithFormat:pixelFormat shareContext:nil]; + NSOpenGLContext *glContext = [[NSOpenGLContext alloc] initWithFormat:pixelFormat shareContext:nil]; - if (glContext == nil) - { - NSLog(@"Failed to create OpenGL context!", nil); - return nil; - } + if (glContext == nil) + { + NSLog(@"Failed to create OpenGL context!", nil); + return nil; + } - [self setPixelFormat:pixelFormat]; + [self setPixelFormat:pixelFormat]; - //for retina support - [self setWantsBestResolutionOpenGLSurface:gHiDPISupport]; + //for retina support + [self setWantsBestResolutionOpenGLSurface:gHiDPISupport]; - [self setOpenGLContext:glContext]; + [self setOpenGLContext:glContext]; - [glContext setView:self]; + [glContext setView:self]; - [glContext makeCurrentContext]; + [glContext makeCurrentContext]; - if (vsync) - { - GLint value = 1; + if (vsync) + { + GLint value = 1; [glContext setValues:&value forParameter:NSOpenGLContextParameterSwapInterval]; - } else { - // supress this error after move to Xcode 7: - // error: null passed to a callee that requires a non-null argument [-Werror,-Wnonnull] - // Tried using ObjC 'nonnull' keyword as per SO article but didn't build - GLint swapInterval=0; + } else { + // supress this error after move to Xcode 7: + // error: null passed to a callee that requires a non-null argument [-Werror,-Wnonnull] + // Tried using ObjC 'nonnull' keyword as per SO article but didn't build + GLint swapInterval=0; [glContext setValues:&swapInterval forParameter:NSOpenGLContextParameterSwapInterval]; - } + } - return self; + return self; } - (BOOL) rebuildContext { - return [self rebuildContextWithFormat:[self pixelFormat]]; + return [self rebuildContextWithFormat:[self pixelFormat]]; } - (BOOL) rebuildContextWithFormat:(NSOpenGLPixelFormat *)format { - NSOpenGLContext *ctx = [self openGLContext]; + NSOpenGLContext *ctx = [self openGLContext]; - [ctx clearDrawable]; - [ctx initWithFormat:format shareContext:nil]; + [ctx clearDrawable]; + [ctx initWithFormat:format shareContext:nil]; - if (ctx == nil) - { - NSLog(@"Failed to create OpenGL context!", nil); - return false; - } + if (ctx == nil) + { + NSLog(@"Failed to create OpenGL context!", nil); + return false; + } - [self setOpenGLContext:ctx]; - [ctx setView:self]; - [ctx makeCurrentContext]; - return true; + [self setOpenGLContext:ctx]; + [ctx setView:self]; + [ctx makeCurrentContext]; + return true; } #if LL_DARWIN @@ -313,14 +313,14 @@ - (BOOL) rebuildContextWithFormat:(NSOpenGLPixelFormat *)format - (CGLContextObj)getCGLContextObj { - NSOpenGLContext *ctx = [self openGLContext]; - return (CGLContextObj)[ctx CGLContextObj]; + NSOpenGLContext *ctx = [self openGLContext]; + return (CGLContextObj)[ctx CGLContextObj]; } - (CGLPixelFormatObj*)getCGLPixelFormatObj { - NSOpenGLPixelFormat *fmt = [self pixelFormat]; - return (CGLPixelFormatObj*)[fmt CGLPixelFormatObj]; + NSOpenGLPixelFormat *fmt = [self pixelFormat]; + return (CGLPixelFormatObj*)[fmt CGLPixelFormatObj]; } // Various events can be intercepted by our view, thus not reaching our window. @@ -365,29 +365,29 @@ - (void) mouseUp:(NSEvent *)theEvent - (void) rightMouseDown:(NSEvent *)theEvent { - callRightMouseDown(mMousePos, [theEvent modifierFlags]); + callRightMouseDown(mMousePos, [theEvent modifierFlags]); } - (void) rightMouseUp:(NSEvent *)theEvent { - callRightMouseUp(mMousePos, [theEvent modifierFlags]); + callRightMouseUp(mMousePos, [theEvent modifierFlags]); } - (void)mouseMoved:(NSEvent *)theEvent { NSPoint dev_delta = [self convertPointToBacking:NSMakePoint([theEvent deltaX], [theEvent deltaY])]; - float mouseDeltas[] = { - float(dev_delta.x), - float(dev_delta.y) - }; + float mouseDeltas[] = { + float(dev_delta.x), + float(dev_delta.y) + }; - callDeltaUpdate(mouseDeltas, 0); + callDeltaUpdate(mouseDeltas, 0); NSPoint mPoint = [self convertPointToBacking:[theEvent locationInWindow]]; - mMousePos[0] = mPoint.x; - mMousePos[1] = mPoint.y; - callMouseMoved(mMousePos, 0); + mMousePos[0] = mPoint.x; + mMousePos[1] = mPoint.y; + callMouseMoved(mMousePos, 0); } // NSWindow doesn't trigger mouseMoved when the mouse is being clicked and dragged. @@ -395,23 +395,23 @@ - (void)mouseMoved:(NSEvent *)theEvent - (void) mouseDragged:(NSEvent *)theEvent { - // Trust the deltas supplied by NSEvent. - // The old CoreGraphics APIs we previously relied on are now flagged as obsolete. - // NSEvent isn't obsolete, and provides us with the correct deltas. + // Trust the deltas supplied by NSEvent. + // The old CoreGraphics APIs we previously relied on are now flagged as obsolete. + // NSEvent isn't obsolete, and provides us with the correct deltas. NSPoint dev_delta = [self convertPointToBacking:NSMakePoint([theEvent deltaX], [theEvent deltaY])]; - float mouseDeltas[] = { - float(dev_delta.x), - float(dev_delta.y) - }; + float mouseDeltas[] = { + float(dev_delta.x), + float(dev_delta.y) + }; - callDeltaUpdate(mouseDeltas, 0); + callDeltaUpdate(mouseDeltas, 0); - NSPoint mPoint = [self convertPointToBacking:[theEvent locationInWindow]]; - mMousePos[0] = mPoint.x; - mMousePos[1] = mPoint.y; - callMouseDragged(mMousePos, 0); + NSPoint mPoint = [self convertPointToBacking:[theEvent locationInWindow]]; + mMousePos[0] = mPoint.x; + mMousePos[1] = mPoint.y; + callMouseDragged(mMousePos, 0); } - (void) otherMouseDown:(NSEvent *)theEvent @@ -426,29 +426,29 @@ - (void) otherMouseUp:(NSEvent *)theEvent - (void) rightMouseDragged:(NSEvent *)theEvent { - [self mouseDragged:theEvent]; + [self mouseDragged:theEvent]; } - (void) otherMouseDragged:(NSEvent *)theEvent { - [self mouseDragged:theEvent]; + [self mouseDragged:theEvent]; } - (void) scrollWheel:(NSEvent *)theEvent { - callScrollMoved(-[theEvent deltaX], -[theEvent deltaY]); + callScrollMoved(-[theEvent deltaX], -[theEvent deltaY]); } - (void) mouseExited:(NSEvent *)theEvent { - callMouseExit(); + callMouseExit(); } - (void) keyUp:(NSEvent *)theEvent { NativeKeyEventData eventData = extractKeyDataFromKeyEvent(theEvent); eventData.mKeyEvent = NativeKeyEventData::KEYUP; - callKeyUp(&eventData, [theEvent keyCode], [theEvent modifierFlags]); + callKeyUp(&eventData, [theEvent keyCode], [theEvent modifierFlags]); } - (void) keyDown:(NSEvent *)theEvent @@ -462,7 +462,7 @@ - (void) keyDown:(NSEvent *)theEvent // Because flagsChange event handler misses event when other window is activated, // e.g. OS Window for upload something or Input Window... // mModifiers instance variable is for insertText: or insertText:replacementRange: (by Pell Smit) - mModifiers = [theEvent modifierFlags]; + mModifiers = [theEvent modifierFlags]; NSString *str_no_modifiers = [theEvent charactersIgnoringModifiers]; unichar ch = 0; if (str_no_modifiers.length) @@ -490,8 +490,8 @@ - (void)flagsChanged:(NSEvent *)theEvent { NativeKeyEventData eventData = extractKeyDataFromModifierEvent(theEvent); - mModifiers = [theEvent modifierFlags]; - callModifier([theEvent modifierFlags]); + mModifiers = [theEvent modifierFlags]; + callModifier([theEvent modifierFlags]); NSInteger mask = 0; switch([theEvent keyCode]) @@ -532,69 +532,69 @@ - (void)flagsChanged:(NSEvent *)theEvent - (BOOL) acceptsFirstResponder { - return YES; + return YES; } - (NSDragOperation) draggingEntered:(id)sender { - NSPasteboard *pboard; + NSPasteboard *pboard; NSDragOperation sourceDragMask; - sourceDragMask = [sender draggingSourceOperationMask]; + sourceDragMask = [sender draggingSourceOperationMask]; - pboard = [sender draggingPasteboard]; + pboard = [sender draggingPasteboard]; if ([[pboard types] containsObject:NSPasteboardTypeURL]) - { - if (sourceDragMask & NSDragOperationLink) { - NSURL *fileUrl = [[pboard readObjectsForClasses:[NSArray arrayWithObject:[NSURL class]] options:[NSDictionary dictionary]] objectAtIndex:0]; - mLastDraggedUrl = [[fileUrl absoluteString] UTF8String]; + { + if (sourceDragMask & NSDragOperationLink) { + NSURL *fileUrl = [[pboard readObjectsForClasses:[NSArray arrayWithObject:[NSURL class]] options:[NSDictionary dictionary]] objectAtIndex:0]; + mLastDraggedUrl = [[fileUrl absoluteString] UTF8String]; return NSDragOperationLink; } - } - return NSDragOperationNone; + } + return NSDragOperationNone; } - (NSDragOperation)draggingUpdated:(id )sender { - callHandleDragUpdated(mLastDraggedUrl); + callHandleDragUpdated(mLastDraggedUrl); - return NSDragOperationLink; + return NSDragOperationLink; } - (void) draggingExited:(id)sender { - callHandleDragExited(mLastDraggedUrl); + callHandleDragExited(mLastDraggedUrl); } - (BOOL)prepareForDragOperation:(id < NSDraggingInfo >)sender { - return YES; + return YES; } - (BOOL) performDragOperation:(id)sender { - callHandleDragDropped(mLastDraggedUrl); - return true; + callHandleDragDropped(mLastDraggedUrl); + return true; } - (BOOL)hasMarkedText { - return mHasMarkedText; + return mHasMarkedText; } - (NSRange)markedRange { - int range[2]; - getPreeditMarkedRange(&range[0], &range[1]); - return NSMakeRange(range[0], range[1]); + int range[2]; + getPreeditMarkedRange(&range[0], &range[1]); + return NSMakeRange(range[0], range[1]); } - (NSRange)selectedRange { - int range[2]; - getPreeditSelectionRange(&range[0], &range[1]); - return NSMakeRange(range[0], range[1]); + int range[2]; + getPreeditSelectionRange(&range[0], &range[1]); + return NSMakeRange(range[0], range[1]); } - (void)setMarkedText:(id)aString selectedRange:(NSRange)selectedRange replacementRange:(NSRange)replacementRange @@ -680,21 +680,21 @@ - (void)commitCurrentPreedit - (void)unmarkText { - [[self inputContext] discardMarkedText]; - resetPreedit(); - mHasMarkedText = FALSE; + [[self inputContext] discardMarkedText]; + resetPreedit(); + mHasMarkedText = FALSE; } // We don't support attributed strings. - (NSArray *)validAttributesForMarkedText { - return [NSArray array]; + return [NSArray array]; } // See above. - (NSAttributedString *)attributedSubstringForProposedRange:(NSRange)aRange actualRange:(NSRangePointer)actualRange { - return nil; + return nil; } - (void)insertText:(id)insertString @@ -707,9 +707,9 @@ - (void)insertText:(id)insertString - (void)insertText:(id)aString replacementRange:(NSRange)replacementRange { - // SL-19801 Special workaround for system emoji picker - if ([aString length] == 2) - { + // SL-19801 Special workaround for system emoji picker + if ([aString length] == 2) + { @try { uint32_t b0 = [aString characterAtIndex:0]; @@ -727,7 +727,7 @@ - (void)insertText:(id)aString replacementRange:(NSRange)replacementRange NSLog(@"Encountered an unsupported attributed character. Exception: %@ String: %@", e.name, aString); return; } - } + } @try { @@ -760,36 +760,36 @@ - (void) insertNewline:(id)sender if (!(mModifiers & NSEventModifierFlagCommand) && !(mModifiers & NSEventModifierFlagShift) && !(mModifiers & NSEventModifierFlagOption)) - { - callUnicodeCallback(13, 0); - } else { - callUnicodeCallback(13, mModifiers); - } + { + callUnicodeCallback(13, 0); + } else { + callUnicodeCallback(13, mModifiers); + } } - (NSUInteger)characterIndexForPoint:(NSPoint)aPoint { - return NSNotFound; + return NSNotFound; } - (NSRect)firstRectForCharacterRange:(NSRange)aRange actualRange:(NSRangePointer)actualRange { - float pos[4] = {0, 0, 0, 0}; - getPreeditLocation(pos, mMarkedTextLength); - return NSMakeRect(pos[0], pos[1], pos[2], pos[3]); + float pos[4] = {0, 0, 0, 0}; + getPreeditLocation(pos, mMarkedTextLength); + return NSMakeRect(pos[0], pos[1], pos[2], pos[3]); } - (void)doCommandBySelector:(SEL)aSelector { - if (aSelector == @selector(insertNewline:)) - { - [self insertNewline:self]; - } + if (aSelector == @selector(insertNewline:)) + { + [self insertNewline:self]; + } } - (BOOL)drawsVerticallyForCharacterAtIndex:(NSUInteger)charIndex { - return NO; + return NO; } - (void) allowMarkedTextInput:(bool)allowed @@ -824,7 +824,7 @@ @implementation LLNonInlineTextView - (void) setGLView:(LLOpenGLView *)view { - glview = view; + glview = view; } - (void)keyDown:(NSEvent *)theEvent @@ -875,24 +875,24 @@ @implementation LLNSWindow - (id) init { - return self; + return self; } - (BOOL) becomeFirstResponder { - callFocus(); - return true; + callFocus(); + return true; } - (BOOL) resignFirstResponder { - callFocusLost(); - return true; + callFocusLost(); + return true; } - (void) close { - callQuitHandler(); + callQuitHandler(); } @end diff --git a/indra/llwindow/llwindow.h b/indra/llwindow/llwindow.h index d0fa16b26a6..7a5404e6154 100644 --- a/indra/llwindow/llwindow.h +++ b/indra/llwindow/llwindow.h @@ -95,6 +95,7 @@ class LLWindow : public LLInstanceTracker #if LL_WINDOWS virtual bool getCursorDelta(LLCoordCommon* delta) = 0; #endif + virtual bool isWrapMouse() const = 0; virtual void showCursor() = 0; virtual void hideCursor() = 0; virtual bool isCursorHidden() = 0; diff --git a/indra/llwindow/llwindowcallbacks.cpp b/indra/llwindow/llwindowcallbacks.cpp index 195f68e08be..7331f50ba0c 100644 --- a/indra/llwindow/llwindowcallbacks.cpp +++ b/indra/llwindow/llwindowcallbacks.cpp @@ -68,7 +68,13 @@ void LLWindowCallbacks::handleMouseLeave(LLWindow *window) return; } -bool LLWindowCallbacks::handleCloseRequest(LLWindow *window) +bool LLWindowCallbacks::handleCloseRequest(LLWindow *window, bool from_user) +{ + //allow the window to close + return true; +} + +bool LLWindowCallbacks::handleSessionExit(LLWindow* window) { //allow the window to close return true; diff --git a/indra/llwindow/llwindowcallbacks.h b/indra/llwindow/llwindowcallbacks.h index d812f935244..59dcdd3adee 100644 --- a/indra/llwindow/llwindowcallbacks.h +++ b/indra/llwindow/llwindowcallbacks.h @@ -42,7 +42,8 @@ class LLWindowCallbacks virtual bool handleMouseUp(LLWindow *window, LLCoordGL pos, MASK mask); virtual void handleMouseLeave(LLWindow *window); // return true to allow window to close, which will then cause handleQuit to be called - virtual bool handleCloseRequest(LLWindow *window); + virtual bool handleCloseRequest(LLWindow *window, bool from_user); + virtual bool handleSessionExit(LLWindow* window); // window is about to be destroyed, clean up your business virtual void handleQuit(LLWindow *window); virtual bool handleRightMouseDown(LLWindow *window, LLCoordGL pos, MASK mask); diff --git a/indra/llwindow/llwindowheadless.h b/indra/llwindow/llwindowheadless.h index 5696b69a59d..dc7b833013d 100644 --- a/indra/llwindow/llwindowheadless.h +++ b/indra/llwindow/llwindowheadless.h @@ -63,6 +63,7 @@ class LLWindowHeadless : public LLWindow #if LL_WINDOWS /*virtual*/ bool getCursorDelta(LLCoordCommon* delta) override { return false; } #endif + /*virtual*/ bool isWrapMouse() const override { return true; } /*virtual*/ void showCursor() override {} /*virtual*/ void hideCursor() override {} /*virtual*/ void showCursorFromMouseMove() override {} diff --git a/indra/llwindow/llwindowmacosx-objc.mm b/indra/llwindow/llwindowmacosx-objc.mm index 42cd95be5dd..d902a82a3c6 100644 --- a/indra/llwindow/llwindowmacosx-objc.mm +++ b/indra/llwindow/llwindowmacosx-objc.mm @@ -41,15 +41,15 @@ int createNSApp(int argc, const char *argv[]) { - return NSApplicationMain(argc, argv); + return NSApplicationMain(argc, argv); } void setupCocoa() { - static bool inited = false; - - if(!inited) - { + static bool inited = false; + + if(!inited) + { @autoreleasepool { // The following prevents the Cocoa command line parser from trying to open 'unknown' arguements as documents. // ie. running './secondlife -set Language fr' would cause a pop-up saying can't open document 'fr' @@ -57,8 +57,8 @@ void setupCocoa() [[NSUserDefaults standardUserDefaults] setObject:@"NO" forKey:@"NSTreatUnknownArgumentsAsOpen"]; } - inited = true; - } + inited = true; + } } bool copyToPBoard(const unsigned short *str, unsigned int len) @@ -66,7 +66,7 @@ bool copyToPBoard(const unsigned short *str, unsigned int len) @autoreleasepool { NSPasteboard *pboard = [NSPasteboard generalPasteboard]; [pboard clearContents]; - + NSArray *contentsToPaste = [[[NSArray alloc] initWithObjects:[NSString stringWithCharacters:str length:len], nil] autorelease]; return [pboard writeObjects:contentsToPaste]; } @@ -74,8 +74,8 @@ bool copyToPBoard(const unsigned short *str, unsigned int len) bool pasteBoardAvailable() { - NSArray *classArray = [NSArray arrayWithObject:[NSString class]]; - return [[NSPasteboard generalPasteboard] canReadObjectForClasses:classArray options:[NSDictionary dictionary]]; + NSArray *classArray = [NSArray arrayWithObject:[NSString class]]; + return [[NSPasteboard generalPasteboard] canReadObjectForClasses:classArray options:[NSDictionary dictionary]]; } unsigned short *copyFromPBoard() @@ -111,55 +111,55 @@ CursorRef createImageCursor(const char *fullpath, int hotspotX, int hotspotY) hotSpot:NSMakePoint(hotspotX, hotspotY) ] retain]; } - - return (CursorRef)cursor; + + return (CursorRef)cursor; } void setArrowCursor() { - NSCursor *cursor = [NSCursor arrowCursor]; - [NSCursor unhide]; - [cursor set]; + NSCursor *cursor = [NSCursor arrowCursor]; + [NSCursor unhide]; + [cursor set]; } void setIBeamCursor() { - NSCursor *cursor = [NSCursor IBeamCursor]; - [cursor set]; + NSCursor *cursor = [NSCursor IBeamCursor]; + [cursor set]; } void setPointingHandCursor() { - NSCursor *cursor = [NSCursor pointingHandCursor]; - [cursor set]; + NSCursor *cursor = [NSCursor pointingHandCursor]; + [cursor set]; } void setCopyCursor() { - NSCursor *cursor = [NSCursor dragCopyCursor]; - [cursor set]; + NSCursor *cursor = [NSCursor dragCopyCursor]; + [cursor set]; } void setCrossCursor() { - NSCursor *cursor = [NSCursor crosshairCursor]; - [cursor set]; + NSCursor *cursor = [NSCursor crosshairCursor]; + [cursor set]; } void setNotAllowedCursor() { - NSCursor *cursor = [NSCursor operationNotAllowedCursor]; - [cursor set]; + NSCursor *cursor = [NSCursor operationNotAllowedCursor]; + [cursor set]; } void hideNSCursor() { - [NSCursor hide]; + [NSCursor hide]; } void showNSCursor() { - [NSCursor unhide]; + [NSCursor unhide]; } #if LL_DARWIN @@ -179,42 +179,42 @@ bool isCGCursorVisible() void hideNSCursorTillMove(bool hide) { - [NSCursor setHiddenUntilMouseMoves:hide]; + [NSCursor setHiddenUntilMouseMoves:hide]; } // This is currently unused, since we want all our cursors to persist for the life of the app, but I've included it for completeness. OSErr releaseImageCursor(CursorRef ref) { - if( ref != NULL ) - { + if( ref != NULL ) + { @autoreleasepool { NSCursor *cursor = (NSCursor*)ref; [cursor autorelease]; } - } - else - { - return paramErr; - } - - return noErr; + } + else + { + return paramErr; + } + + return noErr; } OSErr setImageCursor(CursorRef ref) { - if( ref != NULL ) - { + if( ref != NULL ) + { @autoreleasepool { NSCursor *cursor = (NSCursor*)ref; [cursor set]; } - } - else - { - return paramErr; - } - - return noErr; + } + else + { + return paramErr; + } + + return noErr; } // Now for some unholy juggling between generic pointers and casting them to Obj-C objects! @@ -222,46 +222,46 @@ OSErr setImageCursor(CursorRef ref) NSWindowRef createNSWindow(int x, int y, int width, int height) { - LLNSWindow *window = [[LLNSWindow alloc]initWithContentRect:NSMakeRect(x, y, width, height) + LLNSWindow *window = [[LLNSWindow alloc]initWithContentRect:NSMakeRect(x, y, width, height) styleMask:NSWindowStyleMaskTitled | NSWindowStyleMaskResizable | NSWindowStyleMaskClosable | NSWindowStyleMaskMiniaturizable backing:NSBackingStoreBuffered defer:NO]; - [window makeKeyAndOrderFront:nil]; - [window setAcceptsMouseMovedEvents:TRUE]; + [window makeKeyAndOrderFront:nil]; + [window setAcceptsMouseMovedEvents:TRUE]; [window setRestorable:FALSE]; // Viewer manages state from own settings - return window; + return window; } GLViewRef createOpenGLView(NSWindowRef window, unsigned int samples, bool vsync) { - LLOpenGLView *glview = [[LLOpenGLView alloc]initWithFrame:[(LLNSWindow*)window frame] withSamples:samples andVsync:vsync]; - [(LLNSWindow*)window setContentView:glview]; - return glview; + LLOpenGLView *glview = [[LLOpenGLView alloc]initWithFrame:[(LLNSWindow*)window frame] withSamples:samples andVsync:vsync]; + [(LLNSWindow*)window setContentView:glview]; + return glview; } void glSwapBuffers(void* context) { - [(NSOpenGLContext*)context flushBuffer]; + [(NSOpenGLContext*)context flushBuffer]; } CGLContextObj getCGLContextObj(GLViewRef view) { - return [(LLOpenGLView *)view getCGLContextObj]; + return [(LLOpenGLView *)view getCGLContextObj]; } CGLPixelFormatObj* getCGLPixelFormatObj(NSWindowRef window) { - LLOpenGLView *glview = [(LLNSWindow*)window contentView]; - return [glview getCGLPixelFormatObj]; + LLOpenGLView *glview = [(LLNSWindow*)window contentView]; + return [glview getCGLPixelFormatObj]; } unsigned long getVramSize(GLViewRef view) { - return [(LLOpenGLView *)view getVramSize]; + return [(LLOpenGLView *)view getVramSize]; } float getDeviceUnitSize(GLViewRef view) { - return [(LLOpenGLView*)view convertSizeToBacking:NSMakeSize(1, 1)].width; + return [(LLOpenGLView*)view convertSizeToBacking:NSMakeSize(1, 1)].width; } CGRect getContentViewRect(NSWindowRef window) @@ -276,48 +276,48 @@ CGRect getBackingViewRect(NSWindowRef window, GLViewRef view) void getWindowSize(NSWindowRef window, float* size) { - NSRect frame = [(LLNSWindow*)window frame]; - size[0] = frame.origin.x; - size[1] = frame.origin.y; - size[2] = frame.size.width; - size[3] = frame.size.height; + NSRect frame = [(LLNSWindow*)window frame]; + size[0] = frame.origin.x; + size[1] = frame.origin.y; + size[2] = frame.size.width; + size[3] = frame.size.height; } void setWindowSize(NSWindowRef window, int width, int height) { - NSRect frame = [(LLNSWindow*)window frame]; - frame.size.width = width; - frame.size.height = height; - [(LLNSWindow*)window setFrame:frame display:TRUE]; + NSRect frame = [(LLNSWindow*)window frame]; + frame.size.width = width; + frame.size.height = height; + [(LLNSWindow*)window setFrame:frame display:TRUE]; } void setWindowPos(NSWindowRef window, float* pos) { - NSPoint point; - point.x = pos[0]; - point.y = pos[1]; - [(LLNSWindow*)window setFrameOrigin:point]; + NSPoint point; + point.x = pos[0]; + point.y = pos[1]; + [(LLNSWindow*)window setFrameOrigin:point]; } void getCursorPos(NSWindowRef window, float* pos) { - NSPoint mLoc; - mLoc = [(LLNSWindow*)window mouseLocationOutsideOfEventStream]; - pos[0] = mLoc.x; - pos[1] = mLoc.y; + NSPoint mLoc; + mLoc = [(LLNSWindow*)window mouseLocationOutsideOfEventStream]; + pos[0] = mLoc.x; + pos[1] = mLoc.y; } void makeWindowOrderFront(NSWindowRef window) { - [(LLNSWindow*)window makeKeyAndOrderFront:nil]; + [(LLNSWindow*)window makeKeyAndOrderFront:nil]; } void convertScreenToWindow(NSWindowRef window, float *coord) { NSRect point = NSMakeRect(coord[0], coord[1], 0,0); - point = [(LLNSWindow*)window convertRectFromScreen:point]; - coord[0] = point.origin.x; - coord[1] = point.origin.y; + point = [(LLNSWindow*)window convertRectFromScreen:point]; + coord[0] = point.origin.x; + coord[1] = point.origin.y; } void convertRectToScreen(NSWindowRef window, float *coord) @@ -325,21 +325,21 @@ void convertRectToScreen(NSWindowRef window, float *coord) NSRect rect = NSMakeRect(coord[0], coord[1], coord[2], coord[3]);; rect = [(LLNSWindow*)window convertRectToScreen:rect]; - coord[0] = rect.origin.x; - coord[1] = rect.origin.y; - coord[2] = rect.size.width; - coord[3] = rect.size.height; + coord[0] = rect.origin.x; + coord[1] = rect.origin.y; + coord[2] = rect.size.width; + coord[3] = rect.size.height; } void convertRectFromScreen(NSWindowRef window, float *coord) { - NSRect point = NSMakeRect(coord[0], coord[1], coord[2], coord[3]); - point = [(LLNSWindow*)window convertRectFromScreen:point]; - - coord[0] = point.origin.x; - coord[1] = point.origin.y; - coord[2] = point.size.width; - coord[3] = point.size.height; + NSRect point = NSMakeRect(coord[0], coord[1], coord[2], coord[3]); + point = [(LLNSWindow*)window convertRectFromScreen:point]; + + coord[0] = point.origin.x; + coord[1] = point.origin.y; + coord[2] = point.size.width; + coord[3] = point.size.height; } void convertWindowToScreen(NSWindowRef window, float *coord) @@ -353,24 +353,24 @@ void convertWindowToScreen(NSWindowRef window, float *coord) void closeWindow(NSWindowRef window) { - [(LLNSWindow*)window close]; - [(LLNSWindow*)window release]; + [(LLNSWindow*)window close]; + [(LLNSWindow*)window release]; } void removeGLView(GLViewRef view) { - [(LLOpenGLView*)view clearGLContext]; - [(LLOpenGLView*)view removeFromSuperview]; + [(LLOpenGLView*)view clearGLContext]; + [(LLOpenGLView*)view removeFromSuperview]; } void setupInputWindow(NSWindowRef window, GLViewRef glview) { - [[(LLAppDelegate*)[NSApp delegate] inputView] setGLView:(LLOpenGLView*)glview]; + [[(LLAppDelegate*)[NSApp delegate] inputView] setGLView:(LLOpenGLView*)glview]; } void commitCurrentPreedit(GLViewRef glView) { - [(LLOpenGLView*)glView commitCurrentPreedit]; + [(LLOpenGLView*)glView commitCurrentPreedit]; } void allowDirectMarkedTextInput(bool allow, GLViewRef glView) @@ -380,20 +380,20 @@ void allowDirectMarkedTextInput(bool allow, GLViewRef glView) NSWindowRef getMainAppWindow() { - LLNSWindow *winRef = [(LLAppDelegate*)[[NSApplication sharedApplication] delegate] window]; - - [winRef setAcceptsMouseMovedEvents:TRUE]; - return winRef; + LLNSWindow *winRef = [(LLAppDelegate*)[[NSApplication sharedApplication] delegate] window]; + + [winRef setAcceptsMouseMovedEvents:TRUE]; + return winRef; } void makeFirstResponder(NSWindowRef window, GLViewRef view) { - [(LLNSWindow*)window makeFirstResponder:(LLOpenGLView*)view]; + [(LLNSWindow*)window makeFirstResponder:(LLOpenGLView*)view]; } void requestUserAttention() { - [[NSApplication sharedApplication] requestUserAttention:NSInformationalRequest]; + [[NSApplication sharedApplication] requestUserAttention:NSInformationalRequest]; } long showAlert(std::string text, std::string title, int type) @@ -401,7 +401,7 @@ long showAlert(std::string text, std::string title, int type) long ret = 0; @autoreleasepool { NSAlert *alert = [[[NSAlert alloc] init] autorelease]; - + [alert setMessageText:[NSString stringWithCString:title.c_str() encoding:[NSString defaultCStringEncoding]]]; [alert setInformativeText:[NSString stringWithCString:text.c_str() encoding:[NSString defaultCStringEncoding]]]; if (type == 0) @@ -418,7 +418,7 @@ long showAlert(std::string text, std::string title, int type) } ret = [alert runModal]; } - + if (ret == NSAlertFirstButtonReturn) { if (type == 1) @@ -438,7 +438,7 @@ long showAlert(std::string text, std::string title, int type) ret = 1; } } - + return ret; } @@ -451,5 +451,5 @@ GLViewRef getGLView() unsigned int getModifiers() { - return [NSEvent modifierFlags]; + return [NSEvent modifierFlags]; } diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index 030bd5ee7e3..e37fe116711 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -610,7 +610,7 @@ void callQuitHandler() { if (gWindowImplementation && gWindowImplementation->getCallbacks()) { - if(gWindowImplementation->getCallbacks()->handleCloseRequest(gWindowImplementation)) + if(gWindowImplementation->getCallbacks()->handleCloseRequest(gWindowImplementation, true)) { gWindowImplementation->getCallbacks()->handleQuit(gWindowImplementation); } diff --git a/indra/llwindow/llwindowmacosx.h b/indra/llwindow/llwindowmacosx.h index 110c5756d0f..d703a84d027 100644 --- a/indra/llwindow/llwindowmacosx.h +++ b/indra/llwindow/llwindowmacosx.h @@ -63,6 +63,7 @@ class LLWindowMacOSX : public LLWindow bool switchContext(bool fullscreen, const LLCoordScreen &size, bool enable_vsync, const LLCoordScreen * const posp = NULL) override; bool setCursorPosition(LLCoordWindow position) override; bool getCursorPosition(LLCoordWindow *position) override; + bool isWrapMouse() const override { return !mCursorDecoupled; }; void showCursor() override; void hideCursor() override; void showCursorFromMouseMove() override; diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp index 7433ad6bd27..05be319c0b3 100644 --- a/indra/llwindow/llwindowsdl.cpp +++ b/indra/llwindow/llwindowsdl.cpp @@ -1881,7 +1881,7 @@ void LLWindowSDL::gatherInput() { // *FIX: More informative dialog? LL_INFOS() << "Could not recreate context after resize! Quitting..." << LL_ENDL; - if(mCallbacks->handleCloseRequest(this)) + if(mCallbacks->handleCloseRequest(this, false)) { // Get the app to initiate cleanup. mCallbacks->handleQuit(this); @@ -1931,7 +1931,7 @@ void LLWindowSDL::gatherInput() break; case SDL_QUIT: - if(mCallbacks->handleCloseRequest(this)) + if(mCallbacks->handleCloseRequest(this, true)) { // Get the app to initiate cleanup. mCallbacks->handleQuit(this); diff --git a/indra/llwindow/llwindowsdl.h b/indra/llwindow/llwindowsdl.h index 196ad2986d3..521d52df302 100644 --- a/indra/llwindow/llwindowsdl.h +++ b/indra/llwindow/llwindowsdl.h @@ -68,6 +68,7 @@ class LLWindowSDL : public LLWindow /*virtual*/ bool switchContext(bool fullscreen, const LLCoordScreen &size, bool disable_vsync, const LLCoordScreen * const posp = NULL); /*virtual*/ bool setCursorPosition(LLCoordWindow position); /*virtual*/ bool getCursorPosition(LLCoordWindow *position); + /*virtual*/ bool isWrapMouse() const override { return true; } /*virtual*/ void showCursor(); /*virtual*/ void hideCursor(); /*virtual*/ void showCursorFromMouseMove(); diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index fc7d8cec725..824d0f5ec62 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -450,6 +450,7 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks, F32 max_gl_version) : LLWindow(callbacks, fullscreen, flags), + mAbsoluteCursorPosition(false), mMaxGLVersion(max_gl_version), mMaxCores(max_cores) { @@ -2464,10 +2465,13 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ case WM_CLOSE: { LL_PROFILE_ZONE_NAMED_CATEGORY_WIN32("mwp - WM_CLOSE"); + // todo: WM_CLOSE can be caused by user and by task manager, + // distinguish these cases. + // For now assume it is always user. window_imp->post([=]() { // Will the app allow the window to close? - if (window_imp->mCallbacks->handleCloseRequest(window_imp)) + if (window_imp->mCallbacks->handleCloseRequest(window_imp, true)) { // Get the app to initiate cleanup. window_imp->mCallbacks->handleQuit(window_imp); @@ -2485,6 +2489,50 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ } return 0; } + case WM_QUERYENDSESSION: + { + // Generally means that OS is going to shut down or user is going to log off. + // Can use ShutdownBlockReasonCreate here. + LL_INFOS("Window") << "Received WM_QUERYENDSESSION with wParam: " << (U32)w_param << " lParam: " << (U32)l_param << LL_ENDL; + return TRUE; // 1 = ok to end session. 0 no longer works by itself, use ShutdownBlockReasonCreate + } + case WM_ENDSESSION: + { + // OS session is shutting down, initiate cleanup. + // Comes after WM_QUERYENDSESSION + LL_PROFILE_ZONE_NAMED_CATEGORY_WIN32("mwp - WM_ENDSESSION"); + LL_INFOS("Window") << "Received WM_ENDSESSION with wParam: " << (U32)w_param << " lParam: " << (U32)l_param << LL_ENDL; + unsigned int end_session_flags = (U32)w_param; + if (end_session_flags == 0) + { + // session is not actually ending + return 0; + } + + if ((end_session_flags & ENDSESSION_CLOSEAPP) + || (end_session_flags & ENDSESSION_CRITICAL) + || (end_session_flags & ENDSESSION_LOGOFF)) + { + window_imp->post([=]() + { + // Check if app needs cleanup or can be closed immediately. + if (window_imp->mCallbacks->handleSessionExit(window_imp)) + { + // Get the app to initiate cleanup. + window_imp->mCallbacks->handleQuit(window_imp); + // The app is responsible for calling destroyWindow when done with GL + } + }); + // Give app a second to finish up. That's not enough for a clean exit, + // but better than nothing. + // Todo: sync this better, some kind of waitForResult? Can't wait forever, + // but can potentially use ShutdownBlockReasonCreate for a bigger delay. + ms_sleep(1000); + } + // Don't need to post quit or destroy window, + // if session is ending OS is going to take care of it. + return 0; + } case WM_COMMAND: { LL_PROFILE_ZONE_NAMED_CATEGORY_WIN32("mwp - WM_COMMAND"); @@ -3109,6 +3157,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ prev_absolute_x = absolute_x; prev_absolute_y = absolute_y; + window_imp->mAbsoluteCursorPosition = true; } else { @@ -3125,6 +3174,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ window_imp->mRawMouseDelta.mX += (S32)round((F32)raw->data.mouse.lLastX * (F32)speed / DEFAULT_SPEED); window_imp->mRawMouseDelta.mY -= (S32)round((F32)raw->data.mouse.lLastY * (F32)speed / DEFAULT_SPEED); } + window_imp->mAbsoluteCursorPosition = false; } } } diff --git a/indra/llwindow/llwindowwin32.h b/indra/llwindow/llwindowwin32.h index 7196706f871..0fc93ad0b12 100644 --- a/indra/llwindow/llwindowwin32.h +++ b/indra/llwindow/llwindowwin32.h @@ -70,6 +70,7 @@ class LLWindowWin32 : public LLWindow /*virtual*/ bool setCursorPosition(LLCoordWindow position); /*virtual*/ bool getCursorPosition(LLCoordWindow *position); /*virtual*/ bool getCursorDelta(LLCoordCommon* delta); + /*virtual*/ bool isWrapMouse() const override { return !mAbsoluteCursorPosition; }; /*virtual*/ void showCursor(); /*virtual*/ void hideCursor(); /*virtual*/ void showCursorFromMouseMove(); @@ -195,6 +196,7 @@ class LLWindowWin32 : public LLWindow HCURSOR mCursor[ UI_CURSOR_COUNT ]; // Array of all mouse cursors LLCoordWindow mCursorPosition; // mouse cursor position, should only be mutated on main thread + bool mAbsoluteCursorPosition; // true if last position was received in absolute coordinates. LLMutex mRawMouseMutex; RAWINPUTDEVICE mRawMouse; LLCoordWindow mLastCursorPosition; // mouse cursor position from previous frame diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index eb40067930a..5ee2915b608 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -50,7 +50,7 @@ include(VulkanGltf) include(ZLIBNG) include(LLPrimitive) -if (NOT HAVOK_TPV) +if (HAVOK) # When using HAVOK_TPV, the library is precompiled, so no need for this # Stub and probably havok lib itself is a hack, autobuild loads a 3p that really is a source tarball @@ -76,7 +76,7 @@ if (NOT HAVOK_TPV) target_compile_options( llphysicsextensions PRIVATE -Wno-unused-local-typedef) endif (DARWIN) endif() -endif (NOT HAVOK_TPV) +endif () set(viewer_SOURCE_FILES gltfscenemanager.cpp @@ -296,6 +296,7 @@ set(viewer_SOURCE_FILES llfloatersceneloadstats.cpp llfloaterscriptdebug.cpp llfloaterscriptedprefs.cpp + llfloaterscripting.cpp llfloaterscriptlimits.cpp llfloatersearch.cpp llfloatersellland.cpp @@ -556,6 +557,7 @@ set(viewer_SOURCE_FILES llsceneview.cpp llscreenchannel.cpp llscripteditor.cpp + llscripteditorws.cpp llscriptfloater.cpp llscrollingpanelparam.cpp llscrollingpanelparambase.cpp @@ -975,6 +977,7 @@ set(viewer_HEADER_FILES llfloatersceneloadstats.h llfloaterscriptdebug.h llfloaterscriptedprefs.h + llfloaterscripting.h llfloaterscriptlimits.h llfloatersearch.h llfloatersellland.h @@ -1221,6 +1224,7 @@ set(viewer_HEADER_FILES llsceneview.h llscreenchannel.h llscripteditor.h + llscripteditorws.h llscriptfloater.h llscriptruntimeperms.h llscrollingpanelparam.h @@ -1654,7 +1658,8 @@ set_source_files_properties(${viewer_SHADER_FILES} PROPERTIES HEADER_FILE_ONLY TRUE) list(APPEND viewer_SOURCE_FILES ${viewer_SHADER_FILES}) - +# note that the scripts which publish these files are sensitive to the file +# extensions. Be cautious about adding new file types here. set(viewer_APPSETTINGS_FILES app_settings/anim.ini app_settings/autoreplace.xml @@ -1666,6 +1671,7 @@ set(viewer_APPSETTINGS_FILES app_settings/ignorable_dialogs.xml app_settings/key_bindings.xml app_settings/keywords_lsl_default.xml + app_settings/keywords_lua_default.xml app_settings/logcontrol.xml app_settings/settings.xml app_settings/settings_crash_behavior.xml @@ -1674,6 +1680,7 @@ set(viewer_APPSETTINGS_FILES app_settings/std_bump.ini app_settings/toolbars.xml app_settings/trees.xml + app_settings/types_lua_default.xml app_settings/viewerart.xml app_settings/message.xml ${CMAKE_SOURCE_DIR}/../scripts/messages/message_template.msg @@ -1714,10 +1721,6 @@ if (WINDOWS) list(APPEND viewer_SOURCE_FILES ${viewer_INSTALLER_FILES}) endif (WINDOWS) -if (HAVOK OR HAVOK_TPV) - set(LLSTARTUP_COMPILE_FLAGS "${LLSTARTUP_COMPILE_FLAGS} -DLL_HAVOK") -endif (HAVOK OR HAVOK_TPV) - if( DEFINED LLSTARTUP_COMPILE_FLAGS ) # progress view disables/enables icons based on available packages set_source_files_properties(llprogressview.cpp PROPERTIES COMPILE_FLAGS "${LLSTARTUP_COMPILE_FLAGS}") @@ -1956,13 +1959,30 @@ elseif (DARWIN) PROPERTIES RESOURCE SecondLife.xib LINK_FLAGS_RELEASE "${LINK_FLAGS_RELEASE} -Xlinker -dead_strip" - # arch specific flags for universal builds: https://stackoverflow.com/a/77942065 - XCODE_ATTRIBUTE_OTHER_CFLAGS[arch=x86_64] "$(inherited) -DLLPHYSICSEXTENSIONS_USE_FULL" - XCODE_ATTRIBUTE_OTHER_CFLAGS[arch=arm64] "$(inherited) -DLLPHYSICSEXTENSIONS_USE_STUB" - # only generate the .MAP file for llphysicsextensions_tpv on x86_64 - XCODE_ATTRIBUTE_OTHER_LDFLAGS[arch=x86_64] "$(inherited) -L${CMAKE_CURRENT_BINARY_DIR}/llphysicsextensions/$,$,${CMAKE_CFG_INTDIR}>/ -lllphysicsextensions -Xlinker -map -Xlinker ${CMAKE_CURRENT_BINARY_DIR}/${VIEWER_BINARY_NAME}.MAP" - XCODE_ATTRIBUTE_OTHER_LDFLAGS[arch=arm64] "$(inherited) -L${CMAKE_CURRENT_BINARY_DIR}/llphysicsextensionsstub/$,$,${CMAKE_CFG_INTDIR}>/ -lllphysicsextensionsstub" ) + if(HAVOK) + set_target_properties(${VIEWER_BINARY_NAME} + PROPERTIES + # arch specific flags for universal builds: https://stackoverflow.com/a/77942065 + XCODE_ATTRIBUTE_OTHER_CFLAGS[arch=x86_64] "$(inherited) -DLLPHYSICSEXTENSIONS_USE_FULL -DLL_HAVOK=1" + XCODE_ATTRIBUTE_OTHER_CFLAGS[arch=arm64] "$(inherited) -DLLPHYSICSEXTENSIONS_USE_STUB" + # only generate the .MAP file for llphysicsextensions_tpv on x86_64 + XCODE_ATTRIBUTE_OTHER_LDFLAGS[arch=x86_64] "$(inherited) -L${CMAKE_CURRENT_BINARY_DIR}/llphysicsextensions/$,$,${CMAKE_CFG_INTDIR}>/ -lllphysicsextensions -Xlinker -map -Xlinker ${CMAKE_CURRENT_BINARY_DIR}/${VIEWER_BINARY_NAME}.MAP" + XCODE_ATTRIBUTE_OTHER_LDFLAGS[arch=arm64] "$(inherited) -L${CMAKE_BINARY_DIR}/llphysicsextensionsos/$,$,${CMAKE_CFG_INTDIR}>/ -lllphysicsextensionsos" + ) + elseif(HAVOK_TPV) + set_target_properties(${VIEWER_BINARY_NAME} + PROPERTIES + # arch specific flags for universal builds: https://stackoverflow.com/a/77942065 + XCODE_ATTRIBUTE_OTHER_CFLAGS[arch=x86_64] "$(inherited) -DLLPHYSICSEXTENSIONS_USE_FULL -DLL_HAVOK=1" + XCODE_ATTRIBUTE_OTHER_CFLAGS[arch=arm64] "$(inherited) -DLLPHYSICSEXTENSIONS_USE_STUB" + # only generate the .MAP file for llphysicsextensions_tpv on x86_64 + XCODE_ATTRIBUTE_OTHER_LDFLAGS[arch=x86_64] "$(inherited) -L${ARCH_PREBUILT_DIRS}/ -lllphysicsextensions_tpv" + XCODE_ATTRIBUTE_OTHER_LDFLAGS[arch=arm64] "$(inherited) -L${CMAKE_BINARY_DIR}/llphysicsextensionsos/$,$,${CMAKE_CFG_INTDIR}>/ -lllphysicsextensionsos" + ) + else() + target_link_libraries(${VIEWER_BINARY_NAME} llphysicsextensionsos) + endif() else (WINDOWS) # Linux set_target_properties(${VIEWER_BINARY_NAME} @@ -2039,6 +2059,10 @@ if( TARGET ll::nvapi ) target_link_libraries(${VIEWER_BINARY_NAME} ll::nvapi ) endif() +if ( TARGET llconvexdecomposition ) + target_link_libraries(${VIEWER_BINARY_NAME} llconvexdecomposition ) +endif () + set(ARTWORK_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE PATH "Path to artwork files.") diff --git a/indra/newview/VIEWER_VERSION.txt b/indra/newview/VIEWER_VERSION.txt index 77f5bec5b2b..429dc57af3a 100644 --- a/indra/newview/VIEWER_VERSION.txt +++ b/indra/newview/VIEWER_VERSION.txt @@ -1 +1 @@ -7.2.2 +7.2.3 diff --git a/indra/newview/app_settings/keywords_lsl_default.xml b/indra/newview/app_settings/keywords_lsl_default.xml index f99b86bd399..db9bc9924ff 100644 --- a/indra/newview/app_settings/keywords_lsl_default.xml +++ b/indra/newview/app_settings/keywords_lsl_default.xml @@ -1,4 +1,3 @@ - controls @@ -31,7 +30,7 @@ return tooltip - Leave current event or function.\nreturn [<variable>];\nOptionally pass back a variable's value, from a function. + Leave current event or function.\nreturn [<variable>];\nOptionally pass back a variable's value, from a function. state @@ -59,12 +58,12 @@ key tooltip - A 128 bit unique identifier (UUID).\nThe key is represented as hexidecimal characters (A-F and 0-9), grouped into sections (8,4,4,4,12 characters) and separated by hyphens (for a total of 36 characters). e.g. "A822FF2B-FF02-461D-B45D-DCD10A2DE0C2". + A 128 bit unique identifier (UUID).\nThe key is represented as hexidecimal characters (A-F and 0-9), grouped into sections (8,4,4,4,12 characters) and separated by hyphens (for a total of 36 characters). e.g. "A822FF2B-FF02-461D-B45D-DCD10A2DE0C2". list tooltip - A collection of other data types.\nLists are signified by square brackets surrounding their elements; the elements inside are separated by commas. e.g. [0, 1, 2, 3, 4] or ["Yes", "No", "Perhaps"]. + A collection of other data types.\nLists are signified by square brackets surrounding their elements; the elements inside are separated by commas. e.g. [0, 1, 2, 3, 4] or ["Yes", "No", "Perhaps"]. quaternion @@ -74,7 +73,7 @@ rotation tooltip - The rotation type is one of several ways to represent an orientation in 3D.\nIt is a mathematical object called a quaternion. You can think of a quaternion as four numbers (x, y, z, w), three of which represent the direction an object is facing and a fourth that represents the object's banking left or right around that direction. + The rotation type is one of several ways to represent an orientation in 3D.\nIt is a mathematical object called a quaternion. You can think of a quaternion as four numbers (x, y, z, w), three of which represent the direction an object is facing and a fourth that represents the object's banking left or right around that direction. string @@ -91,14750 +90,19403 @@ ACTIVE + tooltip + Objects in world that are running a script or currently physically moving. type integer value 0x2 - tooltip - Objects in world that are running a script or currently physically moving. AGENT + tooltip + Objects in world that are agents. type integer value 0x1 - tooltip - Objects in world that are agents. AGENT_ALWAYS_RUN + tooltip + type integer value 0x1000 - tooltip - AGENT_ATTACHMENTS + tooltip + The agent has attachments. type integer value 0x2 + + AGENT_AUTOMATED + tooltip - The agent has attachments. + The agent has been identified as a scripted agent + type + integer + value + 0x4000 AGENT_AUTOPILOT + tooltip + type integer value 0x2000 - tooltip - AGENT_AWAY + tooltip + type integer value 0x40 - tooltip - AGENT_BUSY + tooltip + type integer value 0x800 - tooltip - AGENT_BY_LEGACY_NAME + tooltip + type integer value 0x1 - tooltip - AGENT_BY_USERNAME + tooltip + type integer value 0x10 - tooltip - AGENT_CROUCHING + tooltip + type integer value 0x400 + + AGENT_FLOATING_VIA_SCRIPTED_ATTACHMENT + tooltip - + The agent is floating via scripted attachment. + type + integer + value + 0x8000 AGENT_FLYING + tooltip + The agent is flying. type integer value 0x1 - tooltip - The agent is flying. AGENT_IN_AIR + tooltip + type integer value 0x100 - tooltip - AGENT_LIST_PARCEL + tooltip + Agents on the same parcel where the script is running. type integer value - 1 - tooltip - Agents on the same parcel where the script is running. + 1 AGENT_LIST_PARCEL_OWNER + tooltip + Agents on any parcel in the region where the parcel owner is the same as the owner of the parcel under the scripted object. type integer value - 2 - tooltip - Agents on any parcel in the region where the parcel owner is the same as the owner of the parcel under the scripted object. + 2 AGENT_LIST_REGION + tooltip + All agents in the region. type integer value - 4 - tooltip - All agents in the region. + 4 AGENT_MOUSELOOK + tooltip + type integer value 0x8 - tooltip - AGENT_ON_OBJECT + tooltip + type integer value 0x20 - tooltip - AGENT_SCRIPTED + tooltip + The agent has scripted attachments. type integer value 0x4 - tooltip - The agent has scripted attachments. AGENT_SITTING + tooltip + type integer value 0x10 - tooltip - AGENT_TYPING + tooltip + type integer value 0x200 - tooltip - AGENT_WALKING + tooltip + type integer value 0x80 - tooltip - ALL_SIDES + tooltip + type integer value - -1 - tooltip - + -1 ANIM_ON + tooltip + Texture animation is on. type integer value 0x1 + + ATTACH_ANY_HUD + tooltip - Texture animation is on. + Filtering for any HUD attachment. + type + integer + value + -1 ATTACH_AVATAR_CENTER + tooltip + Attach to the avatar's geometric centre. type integer value - 40 - tooltip - Attach to the avatar's geometric centre. + 40 ATTACH_BACK + tooltip + Attach to the avatar's back. type integer value - 9 - tooltip - Attach to the avatar's back. + 9 ATTACH_BELLY + tooltip + Attach to the avatar's belly. type integer value - 28 - tooltip - Attach to the avatar's belly. + 28 ATTACH_CHEST + tooltip + Attach to the avatar's chest. type integer value - 1 - tooltip - Attach to the avatar's chest. + 1 ATTACH_CHIN + tooltip + Attach to the avatar's chin. + type + integer + value + 12 + + ATTACH_FACE_JAW + + tooltip + Attach to the avatar's jaw. + type + integer + value + 47 + + ATTACH_FACE_LEAR + + tooltip + Attach to the avatar's left ear (extended). + type + integer + value + 48 + + ATTACH_FACE_LEYE + + tooltip + Attach to the avatar's left eye (extended). + type + integer + value + 50 + + ATTACH_FACE_REAR + + tooltip + Attach to the avatar's right ear (extended). + type + integer + value + 49 + + ATTACH_FACE_REYE + + tooltip + Attach to the avatar's right eye (extended). + type + integer + value + 51 + + ATTACH_FACE_TONGUE + + tooltip + Attach to the avatar's tongue. type integer value - 12 + 52 + + ATTACH_GROIN + tooltip - Attach to the avatar's chin. + Attach to the avatar's groin. + type + integer + value + 53 ATTACH_HEAD + tooltip + Attach to the avatar's head. + type + integer + value + 2 + + ATTACH_HIND_LFOOT + + tooltip + Attach to the avatar's left hind foot. type integer value - 2 + 54 + + ATTACH_HIND_RFOOT + tooltip - Attach to the avatar's head. + Attach to the avatar's right hind foot. + type + integer + value + 55 ATTACH_HUD_BOTTOM + tooltip + type integer value - 37 - tooltip - + 37 ATTACH_HUD_BOTTOM_LEFT + tooltip + type integer value - 36 - tooltip - + 36 ATTACH_HUD_BOTTOM_RIGHT + tooltip + type integer value - 38 - tooltip - + 38 ATTACH_HUD_CENTER_1 + tooltip + type integer value - 35 - tooltip - + 35 ATTACH_HUD_CENTER_2 + tooltip + type integer value - 31 - tooltip - + 31 ATTACH_HUD_TOP_CENTER + tooltip + type integer value - 33 - tooltip - + 33 ATTACH_HUD_TOP_LEFT + tooltip + type integer value - 34 - tooltip - + 34 ATTACH_HUD_TOP_RIGHT + tooltip + type integer value - 32 - tooltip - + 32 ATTACH_LEAR + tooltip + Attach to the avatar's left ear. type integer value - 13 - tooltip - Attach to the avatar's left ear. + 13 ATTACH_LEFT_PEC + tooltip + Attach to the avatar's left pectoral. type integer value - 29 - tooltip - Attach to the avatar's left pectoral. + 29 ATTACH_LEYE + tooltip + Attach to the avatar's left eye. type integer value - 15 - tooltip - Attach to the avatar's left eye. + 15 ATTACH_LFOOT + tooltip + Attach to the avatar's left foot. type integer value - 7 - tooltip - Attach to the avatar's left foot. + 7 ATTACH_LHAND + tooltip + Attach to the avatar's left hand. type integer value - 5 + 5 + + ATTACH_LHAND_RING1 + tooltip - Attach to the avatar's left hand. + Attach to the avatar's left ring finger. + type + integer + value + 41 ATTACH_LHIP + tooltip + Attach to the avatar's left hip. type integer value - 25 - tooltip - Attach to the avatar's left hip. + 25 ATTACH_LLARM + tooltip + Attach to the avatar's left lower arm. type integer value - 21 - tooltip - Attach to the avatar's left lower arm. + 21 ATTACH_LLLEG + tooltip + Attach to the avatar's lower left leg. type integer value - 27 - tooltip - Attach to the avatar's lower left leg. + 27 ATTACH_LPEC deprecated - true + 1 + tooltip + Attach to the avatar's right pectoral. (Deprecated, use ATTACH_RIGHT_PEC) type integer value - 30 - tooltip - Attach to the avatar's right pectoral. (Deprecated, use ATTACH_RIGHT_PEC) + 30 ATTACH_LSHOULDER + tooltip + Attach to the avatar's left shoulder. type integer value - 3 - tooltip - Attach to the avatar's left shoulder. + 3 ATTACH_LUARM + tooltip + Attach to the avatar's left upper arm. type integer value - 20 - tooltip - Attach to the avatar's left upper arm. + 20 ATTACH_LULEG + tooltip + Attach to the avatar's lower upper leg. type integer value - 26 + 26 + + ATTACH_LWING + tooltip - Attach to the avatar's lower upper leg. + Attach to the avatar's left wing. + type + integer + value + 45 ATTACH_MOUTH + tooltip + Attach to the avatar's mouth. type integer value - 11 - tooltip - Attach to the avatar's mouth. + 11 ATTACH_NECK + tooltip + Attach to the avatar's neck. type integer value - 39 - tooltip - Attach to the avatar's neck. + 39 ATTACH_NOSE + tooltip + Attach to the avatar's nose. type integer value - 17 - tooltip - Attach to the avatar's nose. + 17 ATTACH_PELVIS + tooltip + Attach to the avatar's pelvis. type integer value - 10 - tooltip - Attach to the avatar's pelvis. + 10 ATTACH_REAR + tooltip + Attach to the avatar's right ear. type integer value - 14 - tooltip - Attach to the avatar's right ear. + 14 ATTACH_REYE + tooltip + Attach to the avatar's right eye. type integer value - 16 - tooltip - Attach to the avatar's right eye. + 16 ATTACH_RFOOT + tooltip + Attach to the avatar's right foot. type integer value - 8 - tooltip - Attach to the avatar's right foot. + 8 ATTACH_RHAND + tooltip + Attach to the avatar's right hand. type integer value - 6 + 6 + + ATTACH_RHAND_RING1 + tooltip - Attach to the avatar's right hand. + Attach to the avatar's right ring finger. + type + integer + value + 42 ATTACH_RHIP + tooltip + Attach to the avatar's right hip. type integer value - 22 - tooltip - Attach to the avatar's right hip. + 22 ATTACH_RIGHT_PEC + tooltip + Attach to the avatar's right pectoral. type integer value - 30 - tooltip - Attach to the avatar's right pectoral. + 30 ATTACH_RLARM + tooltip + Attach to the avatar's right lower arm. type integer value - 19 - tooltip - Attach to the avatar's right lower arm. + 19 ATTACH_RLLEG + tooltip + Attach to the avatar's right lower leg. type integer value - 24 - tooltip - Attach to the avatar's right lower leg. + 24 ATTACH_RPEC deprecated - true + 1 + tooltip + Attach to the avatar's left pectoral. (deprecated, use ATTACH_LEFT_PEC) type integer value - 29 - tooltip - Attach to the avatar's left pectoral. (deprecated, use ATTACH_LEFT_PEC) + 29 ATTACH_RSHOULDER + tooltip + Attach to the avatar's right shoulder. type integer value - 4 - tooltip - Attach to the avatar's right shoulder. + 4 ATTACH_RUARM + tooltip + Attach to the avatar's right upper arm. type integer value - 18 - tooltip - Attach to the avatar's right upper arm. + 18 ATTACH_RULEG - type - integer - value - 23 tooltip - Attach to the avatar's right upper leg. - - ATTACH_LHAND_RING1 - + Attach to the avatar's right upper leg. type integer value - 41 - tooltip - Attach to the avatar's left ring finger. + 23 - ATTACH_RHAND_RING1 + ATTACH_RWING + tooltip + Attach to the avatar's right wing. type integer value - 42 - tooltip - Attach to the avatar's right ring finger. + 46 ATTACH_TAIL_BASE + tooltip + Attach to the avatar's tail base. type integer value - 43 - tooltip - Attach to the avatar's tail base. + 43 ATTACH_TAIL_TIP + tooltip + Attach to the avatar's tail tip. type integer value - 44 - tooltip - Attach to the avatar's tail tip. + 44 - ATTACH_LWING + AVOID_CHARACTERS + tooltip + type integer value - 45 - tooltip - Attach to the avatar's left wing. - - ATTACH_RWING - - type - integer - value - 46 - tooltip - Attach to the avatar's right wing. - - ATTACH_FACE_JAW - - type - integer - value - 47 - tooltip - Attach to the avatar's jaw. - - ATTACH_FACE_LEAR - - type - integer - value - 48 - tooltip - Attach to the avatar's left ear (extended). - - ATTACH_FACE_REAR - - type - integer - value - 49 - tooltip - Attach to the avatar's right ear (extended). - - ATTACH_FACE_LEYE - - type - integer - value - 50 - tooltip - Attach to the avatar's left eye (extended). - - ATTACH_FACE_REYE - - type - integer - value - 51 - tooltip - Attach to the avatar's right eye (extended). - - ATTACH_FACE_TONGUE - - type - integer - value - 52 - tooltip - Attach to the avatar's tongue. + 1 - ATTACH_GROIN + AVOID_DYNAMIC_OBSTACLES - type - integer - value - 53 tooltip - Attach to the avatar's groin. - - ATTACH_HIND_LFOOT - + type integer value - 54 - tooltip - Attach to the avatar's left hind foot. + 2 - ATTACH_HIND_RFOOT + AVOID_NONE - type - integer - value - 55 tooltip - Attach to the avatar's right hind foot. - - AVOID_CHARACTERS - + type integer value - 1 - tooltip - + 0 - AVOID_DYNAMIC_OBSTACLES + BEACON_MAP - type - integer - value - 2 tooltip - - - AVOID_NONE - + Cause llMapBeacon to optionally display and focus the world map on the avatar's viewer. type integer value - 0 - tooltip - + 1 CAMERA_ACTIVE + tooltip + type integer value - 12 - tooltip - + 12 CAMERA_BEHINDNESS_ANGLE + tooltip + type integer value - 8 - tooltip - + 8 CAMERA_BEHINDNESS_LAG + tooltip + type integer value - 9 - tooltip - + 9 CAMERA_DISTANCE + tooltip + type integer value - 7 - tooltip - + 7 CAMERA_FOCUS + tooltip + type integer value - 17 - tooltip - + 17 CAMERA_FOCUS_LAG + tooltip + type integer value - 6 - tooltip - + 6 CAMERA_FOCUS_LOCKED + tooltip + type integer value - 22 - tooltip - + 22 CAMERA_FOCUS_OFFSET + tooltip + type integer value - 1 - tooltip - + 1 CAMERA_FOCUS_THRESHOLD + tooltip + type integer value - 11 - tooltip - + 11 CAMERA_PITCH + tooltip + type integer value - 0 - tooltip - + 0 CAMERA_POSITION + tooltip + type integer value - 13 - tooltip - + 13 CAMERA_POSITION_LAG + tooltip + type integer value - 5 - tooltip - + 5 CAMERA_POSITION_LOCKED + tooltip + type integer value - 21 - tooltip - + 21 CAMERA_POSITION_THRESHOLD + tooltip + type integer value - 10 - tooltip - + 10 CHANGED_ALLOWED_DROP + tooltip + The object inventory has changed because an item was added through the llAllowInventoryDrop interface. type integer value 0x40 - tooltip - The object inventory has changed because an item was added through the llAllowInventoryDrop interface. CHANGED_COLOR + tooltip + The object color has changed. type integer value 0x2 - tooltip - The object color has changed. CHANGED_INVENTORY + tooltip + The object inventory has changed. type integer value 0x1 - tooltip - The object inventory has changed. CHANGED_LINK + tooltip + The object has linked or its links were broken. type integer value 0x20 - tooltip - The object has linked or its links were broken. CHANGED_MEDIA + tooltip + type integer value 0x800 - tooltip - CHANGED_OWNER + tooltip + type integer value 0x80 - tooltip - CHANGED_REGION + tooltip + type integer value 0x100 - tooltip - CHANGED_REGION_START + tooltip + type integer value 0x400 + + CHANGED_RENDER_MATERIAL + tooltip - + The render material has changed. + type + integer + value + 0x1000 CHANGED_SCALE + tooltip + The object scale (size) has changed. type integer value 0x8 - tooltip - The object scale (size) has changed. CHANGED_SHAPE + tooltip + The object base shape has changed, e.g., a box to a cylinder. type integer value 0x4 - tooltip - The object base shape has changed, e.g., a box to a cylinder. CHANGED_TELEPORT + tooltip + type integer value 0x200 - tooltip - CHANGED_TEXTURE + tooltip + The texture offset, scale rotation, or simply the object texture has changed. type integer value 0x10 - tooltip - The texture offset, scale rotation, or simply the object texture has changed. CHARACTER_ACCOUNT_FOR_SKIPPED_FRAMES + tooltip + If set to false, character will not attempt to catch up on lost time when pathfinding performance is low, potentially providing more reliable movement (albeit while potentially appearing to be more stuttery). Default is true to match pre-existing behavior. type integer value - 14 - tooltip - If set to false, character will not attempt to catch up on lost time when pathfinding performance is low, potentially providing more reliable movement (albeit while potentially appearing to be more stuttery). Default is true to match pre-existing behavior. + 14 CHARACTER_AVOIDANCE_MODE + tooltip + Allows you to specify that a character should not try to avoid other characters, should not try to avoid dynamic obstacles (relatively fast moving objects and avatars), or both. type integer value - 5 - tooltip - Allows you to specify that a character should not try to avoid other characters, should not try to avoid dynamic obstacles (relatively fast moving objects and avatars), or both. + 5 CHARACTER_CMD_JUMP + tooltip + Makes the character jump. Requires an additional parameter, the height to jump, between 0.1m and 2.0m. This must be provided as the first element of the llExecCharacterCmd option list. type integer value 0x01 - tooltip - Makes the character jump. Requires an additional parameter, the height to jump, between 0.1m and 2.0m. This must be provided as the first element of the llExecCharacterCmd option list. CHARACTER_CMD_SMOOTH_STOP + tooltip + type integer value - 2 - tooltip - + 2 CHARACTER_CMD_STOP + tooltip + Stops any current pathfinding operation. type integer value 0x00 - tooltip - Stops any current pathfinding operation. CHARACTER_DESIRED_SPEED + tooltip + Speed of pursuit in meters per second. type integer value - 1 - tooltip - Speed of pursuit in meters per second. + 1 CHARACTER_DESIRED_TURN_SPEED + tooltip + The character's maximum speed while turning about the Z axis. - Note that this is only loosely enforced. type integer value - 12 - tooltip - The character's maximum speed while turning about the Z axis. - Note that this is only loosely enforced. + 12 CHARACTER_LENGTH + tooltip + Set collision capsule length - cannot be less than two times the radius. type integer value - 3 - tooltip - Set collision capsule length - cannot be less than two times the radius. + 3 CHARACTER_MAX_ACCEL + tooltip + The character's maximum acceleration rate. type integer value - 8 - tooltip - The character's maximum acceleration rate. + 8 CHARACTER_MAX_DECEL + tooltip + The character's maximum deceleration rate. type integer value - 9 - tooltip - The character's maximum deceleration rate. + 9 CHARACTER_MAX_SPEED + tooltip + The character's maximum speed. type integer value - 13 - tooltip - The character's maximum speed. + 13 CHARACTER_MAX_TURN_RADIUS + tooltip + The character's turn radius when travelling at CHARACTER_MAX_TURN_SPEED. type integer value - 10 - tooltip - The character's turn radius when travelling at CHARACTER_MAX_TURN_SPEED. + 10 CHARACTER_ORIENTATION + tooltip + Valid options are: VERTICAL, HORIZONTAL. type integer value - 4 - tooltip - Valid options are: VERTICAL, HORIZONTAL. + 4 CHARACTER_RADIUS + tooltip + Set collision capsule radius. type integer value - 2 - tooltip - Set collision capsule radius. + 2 CHARACTER_STAY_WITHIN_PARCEL + tooltip + Determines whether a character can leave its starting parcel.\nTakes a boolean parameter. If TRUE, the character cannot voluntarilly leave the parcel, but can return to it. type integer value - 15 - tooltip - Determines whether a character can leave its starting parcel.\nTakes a boolean parameter. If TRUE, the character cannot voluntarilly leave the parcel, but can return to it. + 15 CHARACTER_TYPE + tooltip + Specifies which walk-ability coefficient will be used by this character. type integer value - 6 - tooltip - Specifies which walk-ability coefficient will be used by this character. + 6 CHARACTER_TYPE_A + tooltip + type integer value - 0 - tooltip - + 0 CHARACTER_TYPE_B + tooltip + type integer value - 1 - tooltip - + 1 CHARACTER_TYPE_C + tooltip + type integer value - 2 - tooltip - + 2 CHARACTER_TYPE_D + tooltip + type integer value - 3 - tooltip - + 3 CHARACTER_TYPE_NONE + tooltip + type integer value - 4 - tooltip - + 4 CLICK_ACTION_BUY + tooltip + When the prim is clicked, the buy dialog is opened. type integer value - 2 + 2 + + CLICK_ACTION_DISABLED + tooltip - When the prim is clicked, the buy dialog is opened. + No click action. No touches detected or passed. + type + integer + value + 8 - CLICK_ACTION_NONE + CLICK_ACTION_IGNORE + tooltip + No click action. Object is invisible to the mouse. type integer value - 0 + 9 + + CLICK_ACTION_NONE + tooltip Performs the default action: when the prim is clicked, touch events are triggered. + type + integer + value + 0 CLICK_ACTION_OPEN + tooltip + When the prim is clicked, the object inventory dialog is opened. type integer value - 4 - tooltip - When the prim is clicked, the object inventory dialog is opened. + 4 CLICK_ACTION_OPEN_MEDIA + tooltip + When the prim is touched, the web media dialog is opened. type integer value - 6 - tooltip - When the prim is touched, the web media dialog is opened. + 6 CLICK_ACTION_PAY + tooltip + When the prim is clicked, the pay dialog is opened. type integer value - 3 - tooltip - When the prim is clicked, the pay dialog is opened. + 3 CLICK_ACTION_PLAY + tooltip + When the prim is clicked, html-on-a-prim is enabled? type integer value - 5 - tooltip - When the prim is clicked, html-on-a-prim is enabled? + 5 CLICK_ACTION_SIT - type - integer - value - 1 tooltip When the prim is clicked, the avatar sits upon it. + type + integer + value + 1 CLICK_ACTION_TOUCH + tooltip + When the prim is clicked, touch events are triggered. type integer value - 0 + 0 + + CLICK_ACTION_ZOOM + tooltip - When the prim is clicked, touch events are triggered. + Zoom in on object when clicked. + type + integer + value + 7 - CONTENT_TYPE_ATOM + COMBAT_CHANNEL + tooltip + COMBAT_CHANNEL is an integer constant that, when passed to llRegionSay will add the message to the combat log. A script with a chat listen active on COMBAT_CHANNEL may also monitor the combat log. type integer value - 4 + 2147483646 + + COMBAT_LOG_ID + tooltip - "application/atom+xml" + + type + string + value + 45e0fcfa-2268-4490-a51c-3e51bdfe80d1 - CONTENT_TYPE_FORM + CONTENT_TYPE_ATOM + tooltip + "application/atom+xml" type integer value - 7 + 4 + + CONTENT_TYPE_FORM + tooltip - "application/x-www-form-urlencoded" + "application/x-www-form-urlencoded" + type + integer + value + 7 CONTENT_TYPE_HTML + tooltip + "text/html", only valid for embedded browsers on content owned by the person viewing. Falls back to "text/plain" otherwise. type integer value - 1 - tooltip - "text/html", only valid for embedded browsers on content owned by the person viewing. Falls back to "text/plain" otherwise. + 1 CONTENT_TYPE_JSON + tooltip + "application/json" type integer value - 5 - tooltip - "application/json" + 5 CONTENT_TYPE_LLSD + tooltip + "application/llsd+xml" type integer value - 6 - tooltip - "application/llsd+xml" + 6 CONTENT_TYPE_RSS + tooltip + "application/rss+xml" type integer value - 8 - tooltip - "application/rss+xml" + 8 CONTENT_TYPE_TEXT + tooltip + "text/plain" type integer value - 0 - tooltip - "text/plain" + 0 CONTENT_TYPE_XHTML + tooltip + "application/xhtml+xml" type integer value - 3 - tooltip - "application/xhtml+xml" + 3 CONTENT_TYPE_XML + tooltip + "application/xml" type integer value - 2 - tooltip - "application/xml" + 2 CONTROL_BACK + tooltip + Test for the avatar move back control. type integer value 0x2 - tooltip - Test for the avatar move back control. CONTROL_DOWN + tooltip + Test for the avatar move down control. type integer value 0x20 - tooltip - Test for the avatar move down control. CONTROL_FWD + tooltip + Test for the avatar move forward control. type integer value 0x1 - tooltip - Test for the avatar move forward control. CONTROL_LBUTTON + tooltip + Test for the avatar left button control. type integer value 0x10000000 - tooltip - Test for the avatar left button control. CONTROL_LEFT + tooltip + Test for the avatar move left control. type integer value 0x4 - tooltip - Test for the avatar move left control. CONTROL_ML_LBUTTON + tooltip + Test for the avatar left button control while in mouse look. type integer value 0x40000000 - tooltip - Test for the avatar left button control while in mouse look. CONTROL_RIGHT + tooltip + Test for the avatar move right control. type integer value 0x8 - tooltip - Test for the avatar move right control. CONTROL_ROT_LEFT + tooltip + Test for the avatar rotate left control. type integer value 0x100 - tooltip - Test for the avatar rotate left control. CONTROL_ROT_RIGHT + tooltip + Test for the avatar rotate right control. type integer value 0x200 - tooltip - Test for the avatar rotate right control. CONTROL_UP + tooltip + Test for the avatar move up control. type integer value 0x10 - tooltip - Test for the avatar move up control. - DATA_BORN + DAMAGEABLE + tooltip + Objects in world that are able to process damage. type integer value - 3 - tooltip - The date the agent was born, returned in ISO 8601 format of YYYY-MM-DD. + 0x20 - DATA_NAME + DAMAGE_TYPE_ACID + tooltip + Damage caused by a caustic substance, such as acid type integer value - 2 - tooltip - The name of the agent. + 1 - DATA_ONLINE + DAMAGE_TYPE_BLUDGEONING + tooltip + Damage caused by a blunt object, such as a club. type integer value - 1 - tooltip - TRUE for online, FALSE for offline. + 2 - DATA_PAYINFO + DAMAGE_TYPE_COLD + tooltip + Damage inflicted by exposure to extreme cold type integer value - 8 - tooltip - + 3 - DATA_RATING + DAMAGE_TYPE_ELECTRIC + tooltip + Damage caused by electricity. type integer value - 4 - tooltip - Returns the agent ratings as a comma separated string of six integers. They are: - 1) Positive rated behaviour - 2) Negative rated behaviour - 3) Positive rated appearance - 4) Negative rated appearance - 5) Positive rated building - 6) Negative rated building + 4 - DATA_SIM_POS + DAMAGE_TYPE_EMOTIONAL + tooltip + type integer value - 5 - tooltip - + 14 - DATA_SIM_RATING + DAMAGE_TYPE_FIRE + tooltip + Damage inflicted by exposure to heat or flames. type integer value - 7 - tooltip - + 5 - DATA_SIM_STATUS + DAMAGE_TYPE_FORCE + tooltip + Damage inflicted by a great force or impact. type integer value - 6 - tooltip - + 6 - DEBUG_CHANNEL + DAMAGE_TYPE_GENERIC + tooltip + Generic or legacy damage. type integer value - 2147483647 - tooltip - DEBUG_CHANNEL is an integer constant that, when passed to llSay, llWhisper, or llShout as a channel parameter, will print text to the Script Warning/Error Window. + 0 - DEG_TO_RAD + DAMAGE_TYPE_IMPACT - type - float - value - 0.017453293 tooltip - 0.017453293 - Number of radians per degree. - You can use this to convert degrees to radians by multiplying the degrees by this number. - - DENSITY - + System damage generated by imapact with land or a prim. type integer value - 1 - tooltip - Used with llSetPhysicsMaterial to enable the density value. Must be between 1.0 and 22587.0 (in Kg/m^3 -- see if you can figure out what 22587 represents) + -1 - EOF + DAMAGE_TYPE_NECROTIC + tooltip + Damage caused by a direct assault on life-force type - string + integer value - \\n\\n\\n - tooltip - Indicates the last line of a notecard was read. + 7 - ERR_GENERIC + DAMAGE_TYPE_PIERCING + tooltip + Damage caused by a piercing object such as a bullet, spear, or arrow. type integer value - -1 - tooltip - + 8 - ERR_MALFORMED_PARAMS + DAMAGE_TYPE_POISON + tooltip + Damage caused by poison. type integer value - -3 - tooltip - + 9 - ERR_PARCEL_PERMISSIONS + DAMAGE_TYPE_PSYCHIC + tooltip + Damage caused by a direct assault on the mind. type integer value - -2 - tooltip - + 10 - ERR_RUNTIME_PERMISSIONS + DAMAGE_TYPE_RADIANT + tooltip + Damage caused by radiation or extreme light. type integer value - -4 - tooltip - + 11 - ERR_THROTTLED + DAMAGE_TYPE_SLASHING + tooltip + Damage caused by a slashing object such as a sword or axe. type integer value - -5 - tooltip - + 12 - ESTATE_ACCESS_ALLOWED_AGENT_ADD + DAMAGE_TYPE_SONIC + tooltip + Damage caused by loud noises, like a Crash Worship concert. type integer value - 4 - tooltip - Add the agent to this estate's Allowed Residents list. + 13 - ESTATE_ACCESS_ALLOWED_AGENT_REMOVE + DATA_BORN + tooltip + The date the agent was born, returned in ISO 8601 format of YYYY-MM-DD. type integer value - 8 - tooltip - Remove the agent from this estate's Allowed Residents list. + 3 - ESTATE_ACCESS_ALLOWED_GROUP_ADD + DATA_NAME + tooltip + The name of the agent. type integer value - 16 - tooltip - Add the group to this estate's Allowed groups list. + 2 - ESTATE_ACCESS_ALLOWED_GROUP_REMOVE + DATA_ONLINE + tooltip + TRUE for online, FALSE for offline. type integer value - 32 - tooltip - Remove the group from this estate's Allowed groups list. + 1 - ESTATE_ACCESS_BANNED_AGENT_ADD + DATA_PAYINFO + tooltip + type integer value - 64 - tooltip - Add the agent to this estate's Banned residents list. + 8 - ESTATE_ACCESS_BANNED_AGENT_REMOVE + DATA_RATING + tooltip + + Returns the agent ratings as a comma separated string of six integers. They are: + 1) Positive rated behaviour + 2) Negative rated behaviour + 3) Positive rated appearance + 4) Negative rated appearance + 5) Positive rated building + 6) Negative rated building + type integer value - 128 - tooltip - Remove the agent from this estate's Banned residents list. + 4 - FALSE + DATA_SIM_POS + tooltip + type integer value - 0 - tooltip - An integer constant for boolean comparisons. Has the value '0'. + 5 - FORCE_DIRECT_PATH + DATA_SIM_RATING + tooltip + type integer value - 1 - tooltip - Makes character navigate in a straight line toward position. May be set to TRUE or FALSE. + 7 - FRICTION + DATA_SIM_STATUS + tooltip + type integer value - 2 - tooltip - Used with llSetPhysicsMaterial to enable the friction value. Must be between 0.0 and 255.0 + 6 - GCNP_RADIUS + DEBUG_CHANNEL + tooltip + DEBUG_CHANNEL is an integer constant that, when passed to llSay, llWhisper, or llShout as a channel parameter, will print text to the Script Warning/Error Window. type integer value - 0 - tooltip - + 2147483647 - GCNP_STATIC + DEG_TO_RAD + tooltip + + 0.017453293 - Number of radians per degree. + You can use this to convert degrees to radians by multiplying the degrees by this number. + type - integer + float value - 1 - tooltip - + 0.017453293 - GRAVITY_MULTIPLIER + DENSITY + tooltip + Used with llSetPhysicsMaterial to enable the density value. Must be between 1.0 and 22587.0 (in Kg/m^3 -- see if you can figure out what 22587 represents) type integer value - 8 - tooltip - Used with llSetPhysicsMaterial to enable the gravity multiplier value. Must be between -1.0 and +28.0 + 1 - HORIZONTAL + DEREZ_DIE + tooltip + Causes the object to immediately die. type integer value - 1 - tooltip - + 0 - HTTP_BODY_MAXLENGTH + DEREZ_MAKE_TEMP + tooltip + The object is made temporary and will be cleaned up at some later timer. type integer value - 2 - tooltip - + 1 - HTTP_BODY_TRUNCATED + ENVIRONMENT_DAYINFO + tooltip + Day length, offset and progression. type integer value - 0 - tooltip - + 200 - HTTP_CUSTOM_HEADER + ENV_INVALID_AGENT + tooltip + Could not find agent with the specified ID type integer value - 5 - tooltip - Add an extra custom HTTP header to the request. The first string is the name of the parameter to change, e.g. "Pragma", and the second string is the value, e.g. "no-cache". Up to 8 custom headers may be configured per request. Note that certain headers, such as the default headers, are blocked for security reasons. + -4 - HTTP_METHOD + ENV_INVALID_RULE + tooltip + Attempted to change an unknown property. type integer value - 0 - tooltip - + -5 - HTTP_MIMETYPE + ENV_NOT_EXPERIENCE + tooltip + Attempt to change environments outside an experience. type integer value - 1 - tooltip - + -1 - HTTP_PRAGMA_NO_CACHE + ENV_NO_ENVIRONMENT + tooltip + Could not find environmental settings in object inventory. type integer value - 6 - tooltip - Allows enabling/disbling of the "Pragma: no-cache" header.\nUsage: [HTTP_PRAGMA_NO_CACHE, integer SendHeader]. When SendHeader is TRUE, the "Pragma: no-cache" header is sent by the script. This matches the default behavior. When SendHeader is FALSE, no "Pragma" header is sent by the script. + -3 - HTTP_VERBOSE_THROTTLE + ENV_NO_EXPERIENCE_LAND + tooltip + The experience has not been enabled on this land. type integer value - 4 - tooltip - + -7 - HTTP_VERIFY_CERT + ENV_NO_EXPERIENCE_PERMISSION + tooltip + Agent has not granted permission to change environments. type integer value - 3 - tooltip - + -2 - INVENTORY_ALL + ENV_NO_PERMISSIONS + tooltip + Script does not have permission to modify environment. type integer value - -1 - tooltip - + -9 - INVENTORY_ANIMATION + ENV_THROTTLE + tooltip + Could not validate values for environment. type integer value - 20 - tooltip - + -8 - INVENTORY_BODYPART + ENV_VALIDATION_FAIL + tooltip + Could not validate values for environment. type integer value - 13 - tooltip - + -6 - INVENTORY_CLOTHING + EOF + tooltip + Indicates the last line of a notecard was read. type - integer + string value - 5 - tooltip - + \\n\\n\\n - INVENTORY_GESTURE + ERR_GENERIC + tooltip + type integer value - 21 - tooltip - + -1 - INVENTORY_LANDMARK + ERR_MALFORMED_PARAMS + tooltip + type integer value - 3 - tooltip - + -3 - INVENTORY_NONE + ERR_PARCEL_PERMISSIONS + tooltip + type integer value - -1 - tooltip - + -2 - INVENTORY_NOTECARD + ERR_RUNTIME_PERMISSIONS + tooltip + type integer value - 7 - tooltip - + -4 - INVENTORY_OBJECT + ERR_THROTTLED + tooltip + type integer value - 6 - tooltip - + -5 - INVENTORY_SCRIPT + ESTATE_ACCESS_ALLOWED_AGENT_ADD + tooltip + Add the agent to this estate's Allowed Residents list. type integer value - 10 - tooltip - + 4 - INVENTORY_SETTING + ESTATE_ACCESS_ALLOWED_AGENT_REMOVE + tooltip + Remove the agent from this estate's Allowed Residents list. type integer value - 56 - tooltip - + 8 - INVENTORY_SOUND + ESTATE_ACCESS_ALLOWED_GROUP_ADD + tooltip + Add the group to this estate's Allowed groups list. type integer value - 1 - tooltip - + 16 - INVENTORY_TEXTURE + ESTATE_ACCESS_ALLOWED_GROUP_REMOVE + tooltip + Remove the group from this estate's Allowed groups list. type integer value - 0 - tooltip - + 32 - INVENTORY_MATERIAL + ESTATE_ACCESS_BANNED_AGENT_ADD + tooltip + Add the agent to this estate's Banned residents list. type integer value - 57 - tooltip - + 64 - JSON_APPEND + ESTATE_ACCESS_BANNED_AGENT_REMOVE + tooltip + Remove the agent from this estate's Banned residents list. type integer value - -1 - tooltip - + 128 - JSON_ARRAY + FALSE - type - string - value - U+FDD2 tooltip - - - JSON_DELETE - + An integer constant for boolean comparisons. Has the value '0'. type - string + integer value - U+FDD8 - tooltip - + 0 - JSON_FALSE + FILTER_FLAGS + tooltip + Flags to control returned attachments. type - string + integer value - U+FDD7 - tooltip - + 2 - JSON_INVALID + FILTER_FLAG_HUDS + tooltip + Include HUDs with matching experience. type - string + integer value - U+FDD0 - tooltip - + 0x0001 - JSON_NULL + FILTER_INCLUDE + tooltip + Include attachment point. type - string + integer value - U+FDD5 - tooltip - + 1 - JSON_NUMBER + FORCE_DIRECT_PATH + tooltip + Makes character navigate in a straight line toward position. May be set to TRUE or FALSE. type - string + integer value - U+FDD3 - tooltip - + 1 - JSON_OBJECT + FRICTION + tooltip + Used with llSetPhysicsMaterial to enable the friction value. Must be between 0.0 and 255.0 type - string + integer value - U+FDD1 - tooltip - + 2 - JSON_STRING + GAME_CONTROL_AXIS_LEFTX + tooltip + type - string + integer value - U+FDD4 - tooltip - + 0 - JSON_TRUE + GAME_CONTROL_AXIS_LEFTY + tooltip + type - string + integer value - U+FDD6 - tooltip - + 1 - KFM_CMD_PAUSE + GAME_CONTROL_AXIS_RIGHTX + tooltip + type integer value - 2 - tooltip - For use with KFM_COMMAND. + 2 - KFM_CMD_PLAY + GAME_CONTROL_AXIS_RIGHTY + tooltip + type integer value - 0 - tooltip - For use with KFM_COMMAND. + 3 - KFM_CMD_STOP + GAME_CONTROL_AXIS_TRIGGERLEFT + tooltip + type integer value - 1 - tooltip - For use with KFM_COMMAND. + 4 - KFM_COMMAND + GAME_CONTROL_AXIS_TRIGGERRIGHT + tooltip + type integer value - 0 - tooltip - + 5 - KFM_DATA + GAME_CONTROL_BUTTON_A + tooltip + type integer value - 2 - tooltip - + 0x1 - KFM_FORWARD + GAME_CONTROL_BUTTON_B + tooltip + type integer value - 0 - tooltip - For use with KFM_MODE. + 0x2 - KFM_LOOP + GAME_CONTROL_BUTTON_BACK + tooltip + type integer value - 1 - tooltip - For use with KFM_MODE. + 0x10 - KFM_MODE + GAME_CONTROL_BUTTON_DPAD_DOWN + tooltip + type integer value - 1 - tooltip - + 0x1000 - KFM_PING_PONG + GAME_CONTROL_BUTTON_DPAD_LEFT + tooltip + type integer value - 2 - tooltip - For use with KFM_MODE. + 0x2000 - KFM_REVERSE + GAME_CONTROL_BUTTON_DPAD_RIGHT + tooltip + type integer value - 3 - tooltip - For use with KFM_MODE. + 0x4000 - KFM_ROTATION + GAME_CONTROL_BUTTON_DPAD_UP + tooltip + type integer value - 1 - tooltip - For use with KFM_DATA. + 0x800 - KFM_TRANSLATION + GAME_CONTROL_BUTTON_GUIDE + tooltip + type integer value - 2 - tooltip - For use with KFM_DATA. + 0x20 - LAND_LARGE_BRUSH + GAME_CONTROL_BUTTON_LEFTSHOULDER + tooltip + type integer value - 3 - tooltip - Use a large brush size.\nNOTE: This value is incorrect, a large brush should be 2. + 0x200 - LAND_LEVEL + GAME_CONTROL_BUTTON_LEFTSTICK + tooltip + type integer value - 0 - tooltip - Action to level the land. + 0x80 - LAND_LOWER + GAME_CONTROL_BUTTON_MISC1 + tooltip + type integer value - 2 - tooltip - Action to lower the land. + 0x8000 - LAND_MEDIUM_BRUSH + GAME_CONTROL_BUTTON_PADDLE1 + tooltip + type integer value - 2 - tooltip - Use a medium brush size.\nNOTE: This value is incorrect, a medium brush should be 1. + 0x10000 - LAND_NOISE + GAME_CONTROL_BUTTON_PADDLE2 + tooltip + type integer value - 4 - tooltip - + 0x20000 - LAND_RAISE + GAME_CONTROL_BUTTON_PADDLE3 + tooltip + type integer value - 1 - tooltip - Action to raise the land. + 0x40000 - LAND_REVERT + GAME_CONTROL_BUTTON_PADDLE4 + tooltip + type integer value - 5 - tooltip - + 0x80000 - LAND_SMALL_BRUSH + GAME_CONTROL_BUTTON_RIGHTSHOULDER + tooltip + type integer value - 1 - tooltip - Use a small brush size.\nNOTE: This value is incorrect, a small brush should be 0. + 0x400 - LAND_SMOOTH + GAME_CONTROL_BUTTON_RIGHTSTICK + tooltip + type integer value - 3 - tooltip - + 0x100 - LINK_ALL_CHILDREN + GAME_CONTROL_BUTTON_START + tooltip + type integer value - -3 - tooltip - This targets every object except the root in the linked set. + 0x40 - LINK_ALL_OTHERS + GAME_CONTROL_BUTTON_TOUCHPAD + tooltip + type integer value - -2 - tooltip - This targets every object in the linked set except the object with the script. + 0x100000 - LINK_ROOT + GAME_CONTROL_BUTTON_X + tooltip + type integer value - 1 - tooltip - This targets the root of the linked set. + 0x4 - LINK_SET + GAME_CONTROL_BUTTON_Y + tooltip + type integer value - -1 - tooltip - This targets every object in the linked set. + 0x8 - LINK_THIS + GCNP_RADIUS + tooltip + type integer value - -4 - tooltip - The link number of the prim containing the script. + 0 - LIST_STAT_GEOMETRIC_MEAN + GCNP_STATIC + tooltip + type integer value - 9 - tooltip - + 1 - LIST_STAT_MAX + GRAVITY_MULTIPLIER + tooltip + Used with llSetPhysicsMaterial to enable the gravity multiplier value. Must be between -1.0 and +28.0 type integer value - 2 - tooltip - + 8 - LIST_STAT_MEAN + HORIZONTAL + tooltip + type integer value - 3 - tooltip - + 1 - LIST_STAT_MEDIAN + HTTP_ACCEPT + tooltip + + Provide a string value to be included in the HTTP + accepts header value. This replaces the default Second Life HTTP accepts header. + type integer value - 4 - tooltip - + 8 - LIST_STAT_MIN + HTTP_BODY_MAXLENGTH + tooltip + type integer value - 1 - tooltip - + 2 - LIST_STAT_NUM_COUNT + HTTP_BODY_TRUNCATED + tooltip + type integer value - 8 - tooltip - + 0 - LIST_STAT_RANGE + HTTP_CUSTOM_HEADER + tooltip + Add an extra custom HTTP header to the request. The first string is the name of the parameter to change, e.g. "Pragma", and the second string is the value, e.g. "no-cache". Up to 8 custom headers may be configured per request. Note that certain headers, such as the default headers, are blocked for security reasons. type integer value - 0 - tooltip - + 5 - LIST_STAT_STD_DEV + HTTP_EXTENDED_ERROR + tooltip + Report extended error information through http_response event. type integer value - 5 - tooltip - + 9 - LIST_STAT_SUM + HTTP_METHOD + tooltip + type integer value - 6 - tooltip - + 0 - LIST_STAT_SUM_SQUARES + HTTP_MIMETYPE + tooltip + type integer value - 7 - tooltip - + 1 - LOOP + HTTP_PRAGMA_NO_CACHE + tooltip + Allows enabling/disbling of the "Pragma: no-cache" header.\nUsage: [HTTP_PRAGMA_NO_CACHE, integer SendHeader]. When SendHeader is TRUE, the "Pragma: no-cache" header is sent by the script. This matches the default behavior. When SendHeader is FALSE, no "Pragma" header is sent by the script. type integer value - 0x2 - tooltip - Loop the texture animation. + 6 - MASK_BASE + HTTP_USER_AGENT + tooltip + + Provide a string value to be included in the HTTP + User-Agent header value. This is appended to the default value. + type integer value - 0 - tooltip - + 7 - MASK_EVERYONE + HTTP_VERBOSE_THROTTLE + tooltip + type integer value - 3 - tooltip - + 4 - MASK_GROUP + HTTP_VERIFY_CERT + tooltip + type integer value - 2 - tooltip - + 3 - MASK_NEXT + IMG_USE_BAKED_AUX1 + tooltip + type - integer + string value - 4 - tooltip - + 9742065b-19b5-297c-858a-29711d539043 - MASK_OWNER + IMG_USE_BAKED_AUX2 + tooltip + type - integer + string value - 1 - tooltip - + 03642e83-2bd1-4eb9-34b4-4c47ed586d2d - NULL_KEY + IMG_USE_BAKED_AUX3 + tooltip + type string value - 00000000-0000-0000-0000-000000000000 - tooltip - + edd51b77-fc10-ce7a-4b3d-011dfc349e4f - OBJECT_ATTACHED_POINT + IMG_USE_BAKED_EYES + tooltip + type - integer + string value - 19 - tooltip - Gets the attachment point to which the object is attached.\nReturns 0 if the object is not an attachment (or is an avatar, etc). + 52cc6bb6-2ee5-e632-d3ad-50197b1dcb8a - OBJECT_BODY_SHAPE_TYPE + IMG_USE_BAKED_HAIR + tooltip + type - integer + string value - 26 - tooltip - This is a flag used with llGetObjectDetails to get the body type of the avatar, based on shape data.\nIf no data is available, -1.0 is returned.\nThis is normally between 0 and 1.0, with 0.5 and larger considered 'male' + 09aac1fb-6bce-0bee-7d44-caac6dbb6c63 - OBJECT_CHARACTER_TIME + IMG_USE_BAKED_HEAD + tooltip + type - integer + string value - 17 - tooltip - Units in seconds + 5a9f4a74-30f2-821c-b88d-70499d3e7183 - OBJECT_CLICK_ACTION + IMG_USE_BAKED_LEFTARM + tooltip + type - integer + string value - 28 - tooltip - This is a flag used with llGetObjectDetails to get the click action.\nThe default is 0 + ff62763f-d60a-9855-890b-0c96f8f8cd98 - OBJECT_CREATOR + IMG_USE_BAKED_LEFTLEG + tooltip + type - integer + string value - 8 - tooltip - Gets the object's creator key. If id is an avatar, a NULL_KEY is returned. + 8e915e25-31d1-cc95-ae08-d58a47488251 - OBJECT_DESC + IMG_USE_BAKED_LOWER + tooltip + type - integer + string value - 2 - tooltip - Gets the object's description. If id is an avatar, an empty string is returned. + 24daea5f-0539-cfcf-047f-fbc40b2786ba - OBJECT_GROUP + IMG_USE_BAKED_SKIRT + tooltip + type - integer + string value - 7 - tooltip - Gets the prims's group key. If id is an avatar, a NULL_KEY is returned. + 43529ce8-7faa-ad92-165a-bc4078371687 - OBJECT_HOVER_HEIGHT + IMG_USE_BAKED_UPPER + tooltip + type - integer + string value - 25 - tooltip - This is a flag used with llGetObjectDetails to get hover height of the avatar\nIf no data is available, 0.0 is returned. + ae2de45c-d252-50b8-5c6e-19f39ce79317 - OBJECT_LAST_OWNER_ID + INVENTORY_ALL + tooltip + type integer value - 27 - tooltip - Gets the object's last owner ID. + -1 - OBJECT_NAME + INVENTORY_ANIMATION + tooltip + type integer value - 1 - tooltip - Gets the object's name. + 20 - OBJECT_OMEGA + INVENTORY_BODYPART + tooltip + type integer value - 29 - tooltip - Gets an object's angular velocity. + 13 - OBJECT_OWNER + INVENTORY_CLOTHING + tooltip + type integer value - 6 - tooltip - Gets an object's owner's key. If id is group owned, a NULL_KEY is returned. + 5 - OBJECT_PRIM_COUNT + INVENTORY_GESTURE + tooltip + type integer value - 30 - tooltip - Gets the prim count of the object. The script and target object must be owned by the same owner + 21 - OBJECT_PATHFINDING_TYPE + INVENTORY_LANDMARK + tooltip + type integer value - 20 - tooltip - Returns the pathfinding setting of any object in the region. It returns an integer matching one of the OPT_* constants. + 3 - OBJECT_PHANTOM + INVENTORY_MATERIAL + tooltip + type integer value - 22 - tooltip - Returns boolean, detailing if phantom is enabled or disabled on the object.\nIf id is an avatar or attachment, 0 is returned. + 57 - OBJECT_PHYSICS + INVENTORY_NONE + tooltip + type integer value - 21 - tooltip - Returns boolean, detailing if physics is enabled or disabled on the object.\nIf id is an avatar or attachment, 0 is returned. + -1 - OBJECT_PHYSICS_COST + INVENTORY_NOTECARD + tooltip + type integer value - 16 - tooltip - + 7 - OBJECT_POS + INVENTORY_OBJECT + tooltip + type integer value - 3 - tooltip - Gets the object's position in region coordinates. + 6 - OBJECT_PRIM_EQUIVALENCE + INVENTORY_SCRIPT + tooltip + type integer value - 13 - tooltip - + 10 - OBJECT_RENDER_WEIGHT + INVENTORY_SETTING + tooltip + type integer value - 24 - tooltip - This is a flag used with llGetObjectDetails to get the Avatar_Rendering_Cost of an avatar, based on values reported by nearby viewers.\nIf no data is available, -1 is returned.\nThe maximum render weight stored by the simulator is 500000. When called against an object, 0 is returned. + 56 - OBJECT_RETURN_PARCEL + INVENTORY_SOUND + tooltip + type integer value - 1 - tooltip - + 1 - OBJECT_RETURN_PARCEL_OWNER + INVENTORY_TEXTURE + tooltip + type integer value - 2 - tooltip - + 0 - OBJECT_RETURN_REGION + JSON_APPEND + tooltip + type integer value - 4 - tooltip - + -1 - OBJECT_REZZER_KEY + JSON_ARRAY + tooltip + type - integer + string value - 32 - tooltip - + \\ufdd2 - OBJECT_ROOT + JSON_DELETE + tooltip + type - integer + string value - 18 - tooltip - Gets the id of the root prim of the object requested.\nIf id is an avatar, return the id of the root prim of the linkset the avatar is sitting on (or the avatar's own id if the avatar is not sitting on an object within the region). + \\ufdd8 - OBJECT_ROT + JSON_FALSE + tooltip + type - integer + string value - 4 - tooltip - Gets the object's rotation. + \\ufdd7 - OBJECT_RUNNING_SCRIPT_COUNT + JSON_INVALID + tooltip + type - integer + string value - 9 - tooltip - + \\ufdd0 - OBJECT_SCRIPT_MEMORY + JSON_NULL + tooltip + type - integer + string value - 11 - tooltip - + \\ufdd5 - OBJECT_SCRIPT_TIME + JSON_NUMBER + tooltip + type - integer + string value - 12 - tooltip - + \\ufdd3 - OBJECT_SERVER_COST + JSON_OBJECT + tooltip + type - integer + string value - 14 - tooltip - + \\ufdd1 - OBJECT_STREAMING_COST + JSON_STRING + tooltip + type - integer + string value - 15 - tooltip - + \\ufdd4 - OBJECT_TEMP_ON_REZ + JSON_TRUE + tooltip + type - integer + string value - 23 - tooltip - Returns boolean, detailing if temporary is enabled or disabled on the object. + \\ufdd6 - OBJECT_TOTAL_INVENTORY_COUNT + KFM_CMD_PAUSE + tooltip + For use with KFM_COMMAND. type integer value - 31 - tooltip - Gets the total inventory count of the object. The script and target object must be owned by the same owner + 2 - OBJECT_TOTAL_SCRIPT_COUNT + KFM_CMD_PLAY + tooltip + For use with KFM_COMMAND. type integer value - 10 - tooltip - + 0 - OBJECT_UNKNOWN_DETAIL + KFM_CMD_STOP + tooltip + For use with KFM_COMMAND. type integer value - -1 - tooltip - + 1 - OBJECT_VELOCITY + KFM_COMMAND + tooltip + type integer value - 5 - tooltip - Gets the object's velocity. + 0 - OPT_AVATAR + KFM_DATA + tooltip + type integer value - 1 - tooltip - Returned for avatars. + 2 - OPT_CHARACTER + KFM_FORWARD + tooltip + For use with KFM_MODE. type integer value - 2 - tooltip - Returned for pathfinding characters. + 0 - OPT_EXCLUSION_VOLUME + KFM_LOOP + tooltip + For use with KFM_MODE. type integer value - 6 - tooltip - Returned for exclusion volumes. + 1 - OPT_LEGACY_LINKSET + KFM_MODE + tooltip + type integer value - 0 - tooltip - Returned for movable obstacles, movable phantoms, physical, and volumedetect objects. + 1 - OPT_MATERIAL_VOLUME + KFM_PING_PONG + tooltip + For use with KFM_MODE. type integer value - 5 - tooltip - Returned for material volumes. + 2 - OPT_OTHER + KFM_REVERSE + tooltip + For use with KFM_MODE. type integer value - -1 - tooltip - Returned for attachments, Linden trees, and grass. + 3 - OPT_STATIC_OBSTACLE + KFM_ROTATION + tooltip + For use with KFM_DATA. type integer value - 4 - tooltip - Returned for static obstacles. + 1 - OPT_WALKABLE + KFM_TRANSLATION + tooltip + For use with KFM_DATA. type integer value - 3 - tooltip - Returned for walkable objects. + 2 - PARCEL_COUNT_GROUP + LAND_LARGE_BRUSH + tooltip + Use a large brush size.\nNOTE: This value is incorrect, a large brush should be 2. type integer value - 2 - tooltip - + 3 - PARCEL_COUNT_OTHER + LAND_LEVEL + tooltip + Action to level the land. type integer value - 3 - tooltip - + 0 - PARCEL_COUNT_OWNER + LAND_LOWER + tooltip + Action to lower the land. type integer value - 1 - tooltip - + 2 - PARCEL_COUNT_SELECTED + LAND_MEDIUM_BRUSH + tooltip + Use a medium brush size.\nNOTE: This value is incorrect, a medium brush should be 1. type integer value - 4 - tooltip - + 2 - PARCEL_COUNT_TEMP + LAND_NOISE + tooltip + type integer value - 5 - tooltip - + 4 - PARCEL_COUNT_TOTAL + LAND_RAISE + tooltip + Action to raise the land. type integer value - 0 - tooltip - + 1 - PARCEL_DETAILS_AREA + LAND_REVERT + tooltip + type integer value - 4 - tooltip - The parcel's area, in square meters. (5 chars.). + 5 - PARCEL_DETAILS_DESC + LAND_SMALL_BRUSH + tooltip + Use a small brush size.\nNOTE: This value is incorrect, a small brush should be 0. type integer value - 1 - tooltip - The description of the parcel. (127 chars). + 1 - PARCEL_DETAILS_GROUP + LAND_SMOOTH + tooltip + type integer value - 3 - tooltip - The parcel group's key. (36 chars.). + 3 - PARCEL_DETAILS_ID + LINKSETDATA_DELETE + tooltip + A name:value pair has been removed from the linkset datastore. type integer value - 5 - tooltip - The parcel's key. (36 chars.). + 2 - PARCEL_DETAILS_NAME + LINKSETDATA_EMEMORY + tooltip + A name:value pair was too large to write to the linkset datastore. type integer value - 0 - tooltip - The name of the parcel. (63 chars.). + 1 - PARCEL_DETAILS_OWNER + LINKSETDATA_ENOKEY + tooltip + The key supplied was empty. type integer value - 2 - tooltip - The parcel owner's key. (36 chars.). + 2 - PARCEL_DETAILS_SEE_AVATARS + LINKSETDATA_EPROTECTED + tooltip + The name:value pair has been protected from overwrite in the linkset datastore. type integer value - 6 - tooltip - The parcel's avatar visibility setting. (1 char.). + 3 - PARCEL_FLAG_ALLOW_ALL_OBJECT_ENTRY + LINKSETDATA_MULTIDELETE + tooltip + A CSV list of names removed from the linkset datastore. type integer value - 0x08000000 - tooltip - + 3 - PARCEL_FLAG_ALLOW_CREATE_GROUP_OBJECTS + LINKSETDATA_NOTFOUND + tooltip + The named key was not found in the datastore. type integer value - 0x4000000 - tooltip - + 4 - PARCEL_FLAG_ALLOW_CREATE_OBJECTS + LINKSETDATA_NOUPDATE + tooltip + The value written to a name in the keystore is the same as the value already there. type integer value - 0x40 - tooltip - + 5 - PARCEL_FLAG_ALLOW_DAMAGE + LINKSETDATA_OK + tooltip + The name:value pair was written to the datastore. type integer value - 0x20 - tooltip - + 0 - PARCEL_FLAG_ALLOW_FLY + LINKSETDATA_RESET + tooltip + The linkset datastore has been reset. type integer value - 0x1 - tooltip - + 0 - PARCEL_FLAG_ALLOW_GROUP_OBJECT_ENTRY + LINKSETDATA_UPDATE + tooltip + A name:value pair in the linkset datastore has been changed or created. type integer value - 0x10000000 - tooltip - + 1 - PARCEL_FLAG_ALLOW_GROUP_SCRIPTS + LINK_ALL_CHILDREN + tooltip + This targets every object except the root in the linked set. type integer value - 0x2000000 - tooltip - + -3 - PARCEL_FLAG_ALLOW_LANDMARK + LINK_ALL_OTHERS + tooltip + This targets every object in the linked set except the object with the script. type integer value - 0x8 - tooltip - + -2 - PARCEL_FLAG_ALLOW_SCRIPTS + LINK_ROOT + tooltip + This targets the root of the linked set. type integer value - 0x2 - tooltip - + 1 - PARCEL_FLAG_ALLOW_TERRAFORM + LINK_SET + tooltip + This targets every object in the linked set. type integer value - 0x10 - tooltip - + -1 - PARCEL_FLAG_LOCAL_SOUND_ONLY + LINK_THIS + tooltip + The link number of the prim containing the script. type integer value - 0x8000 - tooltip - + -4 - PARCEL_FLAG_RESTRICT_PUSHOBJECT + LIST_STAT_GEOMETRIC_MEAN + tooltip + type integer value - 0x200000 - tooltip - + 9 - PARCEL_FLAG_USE_ACCESS_GROUP + LIST_STAT_MAX + tooltip + type integer value - 0x100 - tooltip - + 2 - PARCEL_FLAG_USE_ACCESS_LIST + LIST_STAT_MEAN + tooltip + type integer value - 0x200 - tooltip - + 3 - PARCEL_FLAG_USE_BAN_LIST + LIST_STAT_MEDIAN + tooltip + type integer value - 0x400 - tooltip - + 4 - PARCEL_FLAG_USE_LAND_PASS_LIST + LIST_STAT_MIN + tooltip + type integer value - 0x800 - tooltip - + 1 - PARCEL_MEDIA_COMMAND_AGENT + LIST_STAT_NUM_COUNT + tooltip + type integer value - 7 - tooltip - + 8 - PARCEL_MEDIA_COMMAND_AUTO_ALIGN + LIST_STAT_RANGE + tooltip + type integer value - 9 - tooltip - + 0 - PARCEL_MEDIA_COMMAND_DESC + LIST_STAT_STD_DEV + tooltip + type integer value - 12 - tooltip - Use this to get or set the parcel media description. + 5 - PARCEL_MEDIA_COMMAND_LOOP + LIST_STAT_SUM + tooltip + type integer value - 3 - tooltip - + 6 - PARCEL_MEDIA_COMMAND_LOOP_SET + LIST_STAT_SUM_SQUARES + tooltip + type integer value - 13 - tooltip - Used to get or set the parcel's media looping variable. + 7 - PARCEL_MEDIA_COMMAND_PAUSE + LOOP + tooltip + Loop the texture animation. type integer value - 1 - tooltip - + 0x2 - PARCEL_MEDIA_COMMAND_PLAY + MASK_BASE + tooltip + type integer value - 2 - tooltip - + 0 - PARCEL_MEDIA_COMMAND_SIZE + MASK_COMBINED + tooltip + Fold permissions for object inventory into results. type integer value - 11 - tooltip - Use this to get or set the parcel media pixel resolution. + 0x10 - PARCEL_MEDIA_COMMAND_STOP + MASK_EVERYONE + tooltip + type integer value - 0 - tooltip - + 3 - PARCEL_MEDIA_COMMAND_TEXTURE + MASK_GROUP + tooltip + type integer value - 4 - tooltip - + 2 - PARCEL_MEDIA_COMMAND_TIME + MASK_NEXT + tooltip + type integer value - 6 - tooltip - + 4 - PARCEL_MEDIA_COMMAND_TYPE + MASK_OWNER + tooltip + type integer value - 10 - tooltip - Use this to get or set the parcel media MIME type (e.g. "text/html"). + 1 - PARCEL_MEDIA_COMMAND_UNLOAD + NAK + tooltip + Indicates a notecard read was attempted and the notecard was not yet cached on the server. type - integer + string value - 8 - tooltip - + \\n\\x15\\n - PARCEL_MEDIA_COMMAND_URL + NULL_KEY + tooltip + type - integer + string value - 5 - tooltip - + 00000000-0000-0000-0000-000000000000 - PASS_ALWAYS + OBJECT_ACCOUNT_LEVEL + tooltip + Retrieves the account level of an avatar.\nReturns 0 when the avatar has a basic account,\n 1 when the avatar has a premium account,\n 10 when the avatar has a premium plus account,\n or -1 if the object is not an avatar. type integer value - 1 - tooltip - Always pass the event. + 41 - PASS_NEVER + OBJECT_ANIMATED_COUNT + tooltip + This is a flag used with llGetObjectDetails to get the number of associated animated objects type integer value - 2 - tooltip - Always pass the event. + 39 - PASS_IF_NOT_HANDLED + OBJECT_ANIMATED_SLOTS_AVAILABLE + tooltip + This is a flag used with llGetObjectDetails to get the number of additional animated object attachments allowed. type integer value - 0 - tooltip - Pass the event if there is no script handling the event in the prim. + 40 - PASSIVE + OBJECT_ATTACHED_POINT + tooltip + Gets the attachment point to which the object is attached.\nReturns 0 if the object is not an attachment (or is an avatar, etc). type integer value - 0x4 - tooltip - Static in-world objects. + 19 - PATROL_PAUSE_AT_WAYPOINTS + OBJECT_ATTACHED_SLOTS_AVAILABLE + tooltip + Returns the number of attachment slots available.\nReturns 0 if the object is not an avatar or none are available. type integer value - 0 - tooltip - + 35 - PAY_DEFAULT + OBJECT_BODY_SHAPE_TYPE + tooltip + This is a flag used with llGetObjectDetails to get the body type of the avatar, based on shape data.\nIf no data is available, -1.0 is returned.\nThis is normally between 0 and 1.0, with 0.5 and larger considered 'male' type integer value - -2 - tooltip - + 26 - PAY_HIDE + OBJECT_CHARACTER_TIME + tooltip + Units in seconds type integer value - -1 - tooltip - + 17 - PAYMENT_INFO_ON_FILE + OBJECT_CLICK_ACTION + tooltip + This is a flag used with llGetObjectDetails to get the click action.\nThe default is 0 type integer value - 1 - tooltip - + 28 - PAYMENT_INFO_USED + OBJECT_CREATION_TIME + tooltip + This is a flag used with llGetObjectDetails to get the time this object was created type integer value - 2 - tooltip - + 36 - PERM_ALL + OBJECT_CREATOR + tooltip + Gets the object's creator key. If id is an avatar, a NULL_KEY is returned. type integer value - 0x7FFFFFFF - tooltip - + 8 - PERM_COPY + OBJECT_DAMAGE + tooltip + Gets the damage value assigned to this object. type integer value - 0x8000 - tooltip - + 51 - PERM_MODIFY + OBJECT_DAMAGE_TYPE + tooltip + Gets the damage type, if any, assigned to this object. type integer value - 0x4000 - tooltip - + 52 - PERM_MOVE + OBJECT_DESC + tooltip + Gets the object's description. If id is an avatar, an empty string is returned. type integer value - 0x80000 - tooltip - + 2 - PERM_TRANSFER + OBJECT_GROUP + tooltip + Gets the prims's group key. If id is an avatar, a NULL_KEY is returned. type integer value - 0x2000 - tooltip - + 7 - PERMISSION_ATTACH + OBJECT_GROUP_TAG + tooltip + Gets the agent's current group role tag. If id is an object, an empty is returned. type integer value - 0x20 - tooltip - If this permission is enabled, the object can successfully call llAttachToAvatar to attach to the given avatar. + 33 - PERMISSION_CHANGE_JOINTS + OBJECT_HEALTH + tooltip + Gets current health value for the object. type integer value - 0x100 - tooltip - (not yet implemented) + 50 - PERMISSION_CHANGE_LINKS + OBJECT_HOVER_HEIGHT + tooltip + This is a flag used with llGetObjectDetails to get hover height of the avatar\nIf no data is available, 0.0 is returned. type integer value - 0x80 - tooltip - If this permission is enabled, the object can successfully call llCreateLink, llBreakLink, and llBreakAllLinks to change links to other objects. + 25 - PERMISSION_CHANGE_PERMISSIONS + OBJECT_LAST_OWNER_ID + tooltip + Gets the object's last owner ID. type integer value - 0x200 - tooltip - (not yet implemented) + 27 - PERMISSION_CONTROL_CAMERA + OBJECT_LINK_NUMBER + tooltip + Gets the object's link number or 0 if unlinked. type integer value - 0x800 - tooltip - + 46 - PERMISSION_DEBIT + OBJECT_MASS + tooltip + Get the object's mass type integer value - 0x2 - tooltip - If this permission is enabled, the object can successfully call llGiveMoney or llTransferLindenDollars to debit the owners account. + 43 - PERMISSION_OVERRIDE_ANIMATIONS + OBJECT_MATERIAL + tooltip + Get an object's material setting. type integer value - 0x8000 - tooltip - Permission to override default animations. + 42 - PERMISSION_RELEASE_OWNERSHIP + OBJECT_NAME + tooltip + Gets the object's name. type integer value - 0x40 - tooltip - (not yet implemented) + 1 - PERMISSION_REMAP_CONTROLS + OBJECT_OMEGA + tooltip + Gets an object's angular velocity. type integer value - 0x8 - tooltip - (not yet implemented) + 29 - PERMISSION_RETURN_OBJECTS + OBJECT_OWNER + tooltip + Gets an object's owner's key. If id is group owned, a NULL_KEY is returned. type integer value - 65536 - tooltip - + 6 - PERMISSION_SILENT_ESTATE_MANAGEMENT + OBJECT_PATHFINDING_TYPE + tooltip + Returns the pathfinding setting of any object in the region. It returns an integer matching one of the OPT_* constants. type integer value - 0x4000 - tooltip - A script with this permission does not notify the object owner when it modifies estate access rules via llManageEstateAccess. + 20 - PERMISSION_TAKE_CONTROLS + OBJECT_PERMS + tooltip + Gets the objects permissions type integer value - 0x4 - tooltip - If this permission enabled, the object can successfully call the llTakeControls libray call. + 53 - PERMISSION_TELEPORT + OBJECT_PERMS_COMBINED + tooltip + Gets the object's permissions including any inventory. type integer value - 0x1000 - tooltip - + 54 - PERMISSION_TRACK_CAMERA + OBJECT_PHANTOM + tooltip + Returns boolean, detailing if phantom is enabled or disabled on the object.\nIf id is an avatar or attachment, 0 is returned. type integer value - 0x400 - tooltip - + 22 - PERMISSION_TRIGGER_ANIMATION + OBJECT_PHYSICS + tooltip + Returns boolean, detailing if physics is enabled or disabled on the object.\nIf id is an avatar or attachment, 0 is returned. type integer value - 0x10 - tooltip - If this permission is enabled, the object can successfully call llStartAnimation for the avatar that owns this. + 21 - PI + OBJECT_PHYSICS_COST - type - float - value - 3.14159265 tooltip - 3.14159265 - The number of radians in a semi-circle. - - PI_BY_TWO - + type - float + integer value - 1.57079633 - tooltip - 1.57079633 - The number of radians in a quarter circle. + 16 - PING_PONG + OBJECT_POS + tooltip + Gets the object's position in region coordinates. type integer value - 0x8 - tooltip - Play animation going forwards, then backwards. + 3 - PRIM_ALPHA_MODE + OBJECT_PRIM_COUNT + tooltip + Gets the prim count of the object. The script and target object must be owned by the same owner type integer value - 38 - tooltip - Prim parameter for materials using integer face, integer alpha_mode, integer alpha_cutoff.\nDefines how the alpha channel of the diffuse texture should be rendered.\nValid options for alpha_mode are PRIM_ALPHA_MODE_BLEND, _NONE, _MASK, and _EMISSIVE.\nalpha_cutoff is used only for PRIM_ALPHA_MODE_MASK. + 30 - PRIM_ALPHA_MODE_NONE + OBJECT_PRIM_EQUIVALENCE + tooltip + type integer value - 0 - tooltip - Prim parameter setting for PRIM_ALPHA_MODE.\nIndicates that the diffuse texture's alpha channel should be ignored. + 13 - PRIM_ALPHA_MODE_BLEND + OBJECT_RENDER_WEIGHT + tooltip + This is a flag used with llGetObjectDetails to get the Avatar_Rendering_Cost of an avatar, based on values reported by nearby viewers.\nIf no data is available, -1 is returned.\nThe maximum render weight stored by the simulator is 500000. When called against an object, 0 is returned. type integer value - 1 - tooltip - Prim parameter setting for PRIM_ALPHA_MODE.\nIndicates that the diffuse texture's alpha channel should be rendered as alpha-blended. + 24 - PRIM_ALPHA_MODE_MASK + OBJECT_RETURN_PARCEL + tooltip + type integer value - 2 - tooltip - Prim parameter setting for PRIM_ALPHA_MODE.\nIndicates that the diffuse texture's alpha channel should be rendered as fully opaque for alpha values above alpha_cutoff and fully transparent otherwise. + 1 - PRIM_ALPHA_MODE_EMISSIVE + OBJECT_RETURN_PARCEL_OWNER + tooltip + type integer value - 3 - tooltip - Prim parameter setting for PRIM_ALPHA_MODE.\nIndicates that the diffuse texture's alpha channel should be rendered as an emissivity mask. + 2 - PRIM_BUMP_BARK + OBJECT_RETURN_REGION + tooltip + type integer value - 4 - tooltip - + 4 - PRIM_BUMP_BLOBS + OBJECT_REZZER_KEY + tooltip + type integer value - 12 - tooltip - + 32 - PRIM_BUMP_BRICKS + OBJECT_REZ_TIME + tooltip + Get the time when an object was rezzed. type integer value - 5 - tooltip - + 45 - PRIM_BUMP_BRIGHT + OBJECT_ROOT + tooltip + Gets the id of the root prim of the object requested.\nIf id is an avatar, return the id of the root prim of the linkset the avatar is sitting on (or the avatar's own id if the avatar is not sitting on an object within the region). type integer value - 1 - tooltip - + 18 - PRIM_BUMP_CHECKER + OBJECT_ROT + tooltip + Gets the object's rotation. type integer value - 6 - tooltip - + 4 - PRIM_BUMP_CONCRETE + OBJECT_RUNNING_SCRIPT_COUNT + tooltip + type integer value - 7 - tooltip - + 9 - PRIM_BUMP_DARK + OBJECT_SCALE + tooltip + Gets the object's size. type integer value - 2 - tooltip - + 47 - PRIM_BUMP_DISKS + OBJECT_SCRIPT_MEMORY + tooltip + type integer value - 10 - tooltip - + 11 - PRIM_BUMP_GRAVEL + OBJECT_SCRIPT_TIME + tooltip + type integer value - 11 - tooltip - + 12 - PRIM_BUMP_LARGETILE + OBJECT_SELECT_COUNT + tooltip + This is a flag used with llGetObjectDetails to get the number of avatars selecting any part of the object type integer value - 14 - tooltip - + 37 - PRIM_BUMP_NONE + OBJECT_SERVER_COST + tooltip + type integer value - 0 - tooltip - + 14 - PRIM_BUMP_SHINY + OBJECT_SIT_COUNT + tooltip + This is a flag used with llGetObjectDetails to get the number of avatars sitting on the object type integer value - 19 - tooltip - + 38 - PRIM_BUMP_SIDING + OBJECT_STREAMING_COST + tooltip + type integer value - 13 - tooltip - + 15 - PRIM_BUMP_STONE + OBJECT_TEMP_ATTACHED + tooltip + Returns boolean, indicating if object is a temp attachment. type integer value - 9 - tooltip - + 34 - PRIM_BUMP_STUCCO + OBJECT_TEMP_ON_REZ + tooltip + Returns boolean, detailing if temporary is enabled or disabled on the object. type integer value - 15 - tooltip - + 23 - PRIM_BUMP_SUCTION + OBJECT_TEXT + tooltip + Gets an objects hover text. type integer value - 16 - tooltip - + 44 - PRIM_BUMP_TILE + OBJECT_TEXT_ALPHA + tooltip + Gets the alpha of an objects hover text. type integer value - 8 - tooltip - + 49 - PRIM_BUMP_WEAVE + OBJECT_TEXT_COLOR + tooltip + Gets the color of an objects hover text. type integer value - 17 - tooltip - + 48 - PRIM_BUMP_WOOD + OBJECT_TOTAL_INVENTORY_COUNT + tooltip + Gets the total inventory count of the object. The script and target object must be owned by the same owner type integer value - 3 - tooltip - + 31 - PRIM_CAST_SHADOWS + OBJECT_TOTAL_SCRIPT_COUNT - deprecated - true + tooltip + type integer value - 24 - tooltip - + 10 - PRIM_COLOR + OBJECT_UNKNOWN_DETAIL + tooltip + type integer value - 18 - tooltip - + -1 - PRIM_DESC + OBJECT_VELOCITY + tooltip + Gets the object's velocity. type integer value - 28 - tooltip - + 5 - PRIM_FLEXIBLE + OPT_AVATAR + tooltip + Returned for avatars. type integer value - 21 - tooltip - + 1 - PRIM_FULLBRIGHT + OPT_CHARACTER + tooltip + Returned for pathfinding characters. type integer value - 20 - tooltip - + 2 - PRIM_GLOW + OPT_EXCLUSION_VOLUME + tooltip + Returned for exclusion volumes. type integer value - 25 - tooltip - PRIM_GLOW is used to get or set the glow status of the face. + 6 - PRIM_HOLE_CIRCLE + OPT_LEGACY_LINKSET + tooltip + Returned for movable obstacles, movable phantoms, physical, and volumedetect objects. type integer value - 0x10 - tooltip - + 0 - PRIM_HOLE_DEFAULT + OPT_MATERIAL_VOLUME + tooltip + Returned for material volumes. type integer value - 0x00 - tooltip - + 5 - PRIM_HOLE_SQUARE + OPT_OTHER + tooltip + Returned for attachments, Linden trees, and grass. type integer value - 0x20 - tooltip - + -1 - PRIM_HOLE_TRIANGLE + OPT_STATIC_OBSTACLE + tooltip + Returned for static obstacles. type integer value - 0x30 - tooltip - + 4 - PRIM_LINK_TARGET + OPT_WALKABLE + tooltip + Returned for walkable objects. type integer value - 34 - tooltip - + 3 - PRIM_MATERIAL + PARCEL_COUNT_GROUP + tooltip + type integer value - 2 - tooltip - + 2 - PRIM_MATERIAL_FLESH + PARCEL_COUNT_OTHER + tooltip + type integer value - 4 - tooltip - + 3 - PRIM_MATERIAL_GLASS + PARCEL_COUNT_OWNER + tooltip + type integer value - 2 - tooltip - + 1 - PRIM_MATERIAL_LIGHT + PARCEL_COUNT_SELECTED + tooltip + type integer value - 7 - tooltip - + 4 - PRIM_MATERIAL_METAL + PARCEL_COUNT_TEMP + tooltip + type integer value - 1 - tooltip - + 5 - PRIM_MATERIAL_PLASTIC + PARCEL_COUNT_TOTAL + tooltip + type integer value - 5 - tooltip - + 0 - PRIM_MATERIAL_RUBBER + PARCEL_DETAILS_AREA + tooltip + The parcel's area, in square meters. (5 chars.). type integer value - 6 - tooltip - + 4 - PRIM_MATERIAL_STONE + PARCEL_DETAILS_DESC + tooltip + The description of the parcel. (127 chars). type integer value - 0 - tooltip - + 1 - PRIM_MATERIAL_WOOD + PARCEL_DETAILS_FLAGS + tooltip + Flags set on the parcel type integer value - 3 - tooltip - + 12 - PRIM_MEDIA_ALT_IMAGE_ENABLE + PARCEL_DETAILS_GROUP + tooltip + The parcel group's key. (36 chars.). type integer value - 0 - tooltip - Boolean. Gets/Sets the default image state (the image that the user sees before a piece of media is active) for the chosen face. The default image is specified by Second Life's server for that media type. + 3 - PRIM_MEDIA_AUTO_LOOP + PARCEL_DETAILS_ID + tooltip + The parcel's key. (36 chars.). type integer value - 4 - tooltip - Boolean. Gets/Sets whether auto-looping is enabled. + 5 - PRIM_MEDIA_AUTO_PLAY + PARCEL_DETAILS_LANDING_LOOKAT + tooltip + Lookat vector set for teleport routing. type integer value - 5 - tooltip - Boolean. Gets/Sets whether the media auto-plays when a Resident can view it. + 10 - PRIM_MEDIA_AUTO_SCALE + PARCEL_DETAILS_LANDING_POINT + tooltip + The parcel's landing point, if any. type integer value - 6 - tooltip - Boolean. Gets/Sets whether auto-scaling is enabled. Auto-scaling forces the media to the full size of the texture. + 9 - PRIM_MEDIA_AUTO_ZOOM + PARCEL_DETAILS_NAME + tooltip + The name of the parcel. (63 chars.). type integer value - 7 - tooltip - Boolean. Gets/Sets whether clicking the media triggers auto-zoom and auto-focus on the media. + 0 - PRIM_MEDIA_CONTROLS + PARCEL_DETAILS_OWNER + tooltip + The parcel owner's key. (36 chars.). type integer value - 1 - tooltip - Integer. Gets/Sets the style of controls. Can be either PRIM_MEDIA_CONTROLS_STANDARD or PRIM_MEDIA_CONTROLS_MINI. + 2 - PRIM_MEDIA_CONTROLS_MINI + PARCEL_DETAILS_PRIM_CAPACITY + tooltip + The parcel's prim capacity. type integer value - 1 - tooltip - Mini web navigation controls; does not include an address bar. + 7 - PRIM_MEDIA_CONTROLS_STANDARD + PARCEL_DETAILS_PRIM_USED + tooltip + The number of prims used on this parcel. type integer value - 0 - tooltip - Standard web navigation controls. + 8 - PRIM_MEDIA_CURRENT_URL + PARCEL_DETAILS_SCRIPT_DANGER + tooltip + There are restrictions on this parcel that may impact script execution. type integer value - 2 - tooltip - String. Gets/Sets the current url displayed on the chosen face. Changing this URL causes navigation. 1024 characters Maximum. + 13 - PRIM_MEDIA_FIRST_CLICK_INTERACT + PARCEL_DETAILS_SEE_AVATARS + tooltip + The parcel's avatar visibility setting. (1 char.). type integer value - 8 - tooltip - Boolean. Gets/Sets whether the first click interaction is enabled. + 6 - PRIM_MEDIA_HEIGHT_PIXELS + PARCEL_DETAILS_TP_ROUTING + tooltip + Parcel's teleport routing setting. type integer value - 10 - tooltip - Integer. Gets/Sets the height of the media in pixels. + 11 - PRIM_MEDIA_HOME_URL + PARCEL_FLAG_ALLOW_ALL_OBJECT_ENTRY + tooltip + type integer value - 3 - tooltip - String. Gets/Sets the home URL for the chosen face. 1024 characters maximum. + 0x08000000 - PRIM_MEDIA_MAX_HEIGHT_PIXELS + PARCEL_FLAG_ALLOW_CREATE_GROUP_OBJECTS + tooltip + type integer value - 2048 - tooltip - + 0x4000000 - PRIM_MEDIA_MAX_URL_LENGTH + PARCEL_FLAG_ALLOW_CREATE_OBJECTS + tooltip + type integer value - 1024 - tooltip - + 0x40 - PRIM_MEDIA_MAX_WHITELIST_COUNT + PARCEL_FLAG_ALLOW_DAMAGE + tooltip + type integer value - 64 - tooltip - + 0x20 - PRIM_MEDIA_MAX_WHITELIST_SIZE + PARCEL_FLAG_ALLOW_FLY + tooltip + type integer value - 1024 - tooltip - + 0x1 - PRIM_MEDIA_MAX_WIDTH_PIXELS + PARCEL_FLAG_ALLOW_GROUP_OBJECT_ENTRY + tooltip + type integer value - 2048 - tooltip - + 0x10000000 - PRIM_MEDIA_PARAM_MAX + PARCEL_FLAG_ALLOW_GROUP_SCRIPTS + tooltip + type integer value - 14 - tooltip - + 0x2000000 - PRIM_MEDIA_PERM_ANYONE + PARCEL_FLAG_ALLOW_LANDMARK + tooltip + type integer value - 4 - tooltip - + 0x8 - PRIM_MEDIA_PERM_GROUP + PARCEL_FLAG_ALLOW_SCRIPTS + tooltip + type integer value - 2 - tooltip - + 0x2 - PRIM_MEDIA_PERM_NONE + PARCEL_FLAG_ALLOW_TERRAFORM + tooltip + type integer value - 0 - tooltip - + 0x10 - PRIM_MEDIA_PERM_OWNER + PARCEL_FLAG_LOCAL_SOUND_ONLY + tooltip + type integer value - 1 - tooltip - + 0x8000 - PRIM_MEDIA_PERMS_CONTROL + PARCEL_FLAG_RESTRICT_PUSHOBJECT + tooltip + type integer value - 14 - tooltip - Integer. Gets/Sets the permissions mask that control who can see the media control bar above the object:: PRIM_MEDIA_PERM_ANYONE, PRIM_MEDIA_PERM_GROUP, PRIM_MEDIA_PERM_NONE, PRIM_MEDIA_PERM_OWNER + 0x200000 - PRIM_MEDIA_PERMS_INTERACT + PARCEL_FLAG_USE_ACCESS_GROUP + tooltip + type integer value - 13 - tooltip - Integer. Gets/Sets the permissions mask that control who can interact with the object: PRIM_MEDIA_PERM_ANYONE, PRIM_MEDIA_PERM_GROUP, PRIM_MEDIA_PERM_NONE, PRIM_MEDIA_PERM_OWNER + 0x100 - PRIM_MEDIA_WHITELIST + PARCEL_FLAG_USE_ACCESS_LIST + tooltip + type integer value - 12 - tooltip - String. Gets/Sets the white-list as a string of escaped, comma-separated URLs. This string can hold up to 64 URLs or 1024 characters, whichever comes first. + 0x200 - PRIM_MEDIA_WHITELIST_ENABLE + PARCEL_FLAG_USE_BAN_LIST + tooltip + type integer value - 11 - tooltip - Boolean. Gets/Sets whether navigation is restricted to URLs in PRIM_MEDIA_WHITELIST. + 0x400 - PRIM_MEDIA_WIDTH_PIXELS + PARCEL_FLAG_USE_LAND_PASS_LIST + tooltip + type integer value - 9 - tooltip - Integer. Gets/Sets the width of the media in pixels. + 0x800 - PRIM_NAME + PARCEL_MEDIA_COMMAND_AGENT + tooltip + type integer value - 27 - tooltip - + 7 - PRIM_NORMAL + PARCEL_MEDIA_COMMAND_AUTO_ALIGN + tooltip + type integer value - 37 - tooltip - Prim parameter for materials using integer face, string texture, vector repeats, vector offsets, float rotation_in_radians + 9 - PRIM_OMEGA + PARCEL_MEDIA_COMMAND_DESC + tooltip + Use this to get or set the parcel media description. type integer value - 32 - tooltip - + 12 - PRIM_PHANTOM + PARCEL_MEDIA_COMMAND_LOOP + tooltip + type integer value - 5 - tooltip - + 3 - PRIM_PHYSICS + PARCEL_MEDIA_COMMAND_LOOP_SET + tooltip + Used to get or set the parcel's media looping variable. type integer value - 3 - tooltip - + 13 - PRIM_PHYSICS_SHAPE_CONVEX + PARCEL_MEDIA_COMMAND_PAUSE + tooltip + type integer value - 2 - tooltip - Use the convex hull of the prim shape for physics (this is the default for mesh objects). + 1 - PRIM_PHYSICS_SHAPE_NONE + PARCEL_MEDIA_COMMAND_PLAY + tooltip + type integer value - 1 - tooltip - Ignore this prim in the physics shape. NB: This cannot be applied to the root prim. + 2 - PRIM_PHYSICS_SHAPE_PRIM + PARCEL_MEDIA_COMMAND_SIZE + tooltip + Use this to get or set the parcel media pixel resolution. type integer value - 0 - tooltip - Use the normal prim shape for physics (this is the default for all non-mesh objects). + 11 - PRIM_PHYSICS_SHAPE_TYPE + PARCEL_MEDIA_COMMAND_STOP + tooltip + type integer value - 30 - tooltip - Allows you to set the physics shape type of a prim via lsl. Permitted values are: - PRIM_PHYSICS_SHAPE_NONE, PRIM_PHYSICS_SHAPE_PRIM, PRIM_PHYSICS_SHAPE_CONVEX + 0 - PRIM_POINT_LIGHT + PARCEL_MEDIA_COMMAND_TEXTURE + tooltip + type integer value - 23 - tooltip - + 4 - PRIM_POS_LOCAL + PARCEL_MEDIA_COMMAND_TIME + tooltip + type integer value - 33 - tooltip - + 6 - PRIM_POSITION + PARCEL_MEDIA_COMMAND_TYPE + tooltip + Use this to get or set the parcel media MIME type (e.g. "text/html"). type integer value - 6 - tooltip - + 10 - PRIM_ROT_LOCAL + PARCEL_MEDIA_COMMAND_UNLOAD + tooltip + type integer value - 29 - tooltip - + 8 - PRIM_ROTATION + PARCEL_MEDIA_COMMAND_URL + tooltip + type integer value - 8 - tooltip - + 5 - PRIM_SCULPT_FLAG_INVERT + PASSIVE + tooltip + Static in-world objects. type integer value - 64 - tooltip - Render inside out (inverts the normals). + 0x4 - PRIM_SCULPT_FLAG_MIRROR + PASS_ALWAYS + tooltip + Always pass the event. type integer value - 128 - tooltip - Render an X axis mirror of the sculpty. + 1 - PRIM_SCULPT_TYPE_CYLINDER + PASS_IF_NOT_HANDLED + tooltip + Pass the event if there is no script handling the event in the prim. type integer value - 4 - tooltip - + 0 - PRIM_SCULPT_TYPE_MASK + PASS_NEVER + tooltip + Always pass the event. type integer value - 7 - tooltip - + 2 - PRIM_SCULPT_TYPE_PLANE + PATROL_PAUSE_AT_WAYPOINTS + tooltip + type integer value - 3 - tooltip - + 0 - PRIM_SCULPT_TYPE_SPHERE + PAYMENT_INFO_ON_FILE + tooltip + type integer value - 1 - tooltip - + 1 - PRIM_SCULPT_TYPE_TORUS + PAYMENT_INFO_USED + tooltip + type integer value - 2 - tooltip - + 2 - PRIM_SHINY_HIGH + PAY_DEFAULT + tooltip + type integer value - 3 - tooltip - + -2 - PRIM_SHINY_LOW + PAY_HIDE + tooltip + type integer value - 1 - tooltip - + -1 - PRIM_SHINY_MEDIUM + PERMISSION_ATTACH + tooltip + If this permission is enabled, the object can successfully call llAttachToAvatar to attach to the given avatar. type integer value - 2 - tooltip - + 0x20 - PRIM_SHINY_NONE + PERMISSION_CHANGE_JOINTS + tooltip + (not yet implemented) type integer value - 0 - tooltip - + 0x100 - PRIM_SIZE + PERMISSION_CHANGE_LINKS + tooltip + If this permission is enabled, the object can successfully call llCreateLink, llBreakLink, and llBreakAllLinks to change links to other objects. type integer value - 7 - tooltip - + 0x80 - PRIM_SLICE + PERMISSION_CHANGE_PERMISSIONS + tooltip + (not yet implemented) type integer value - 35 - tooltip - + 0x200 - PRIM_SPECULAR + PERMISSION_CONTROL_CAMERA + tooltip + type integer value - 36 - tooltip - Prim parameter for materials using integer face, string texture, vector repeats, vector offsets, float rotation_in_radians, vector color, integer glossy, integer environment + 0x800 - PRIM_TEMP_ON_REZ + PERMISSION_DEBIT + tooltip + If this permission is enabled, the object can successfully call llGiveMoney or llTransferLindenDollars to debit the owners account. type integer value - 4 - tooltip - + 0x2 - PRIM_TEXGEN + PERMISSION_OVERRIDE_ANIMATIONS + tooltip + Permission to override default animations. type integer value - 22 - tooltip - + 0x8000 - PRIM_TEXGEN_DEFAULT + PERMISSION_RELEASE_OWNERSHIP + tooltip + (not yet implemented) type integer value - 0 - tooltip - + 0x40 - PRIM_TEXGEN_PLANAR + PERMISSION_REMAP_CONTROLS + tooltip + (not yet implemented) type integer value - 1 - tooltip - + 0x8 - PRIM_TEXT + PERMISSION_RETURN_OBJECTS + tooltip + type integer value - 26 - tooltip - + 65536 - PRIM_TEXTURE + PERMISSION_SILENT_ESTATE_MANAGEMENT + tooltip + A script with this permission does not notify the object owner when it modifies estate access rules via llManageEstateAccess. type integer value - 17 - tooltip - + 0x4000 - PRIM_TYPE + PERMISSION_TAKE_CONTROLS + tooltip + If this permission enabled, the object can successfully call the llTakeControls libray call. type integer value - 9 - tooltip - + 0x4 - PRIM_TYPE_BOX + PERMISSION_TELEPORT + tooltip + type integer value - 0 - tooltip - + 0x1000 - PRIM_TYPE_CYLINDER + PERMISSION_TRACK_CAMERA + tooltip + type integer value - 1 - tooltip - + 0x400 - PRIM_TYPE_PRISM + PERMISSION_TRIGGER_ANIMATION + tooltip + If this permission is enabled, the object can successfully call llStartAnimation for the avatar that owns this. type integer value - 2 - tooltip - + 0x10 - PRIM_TYPE_RING + PERM_ALL + tooltip + type integer value - 6 - tooltip - + 0x7FFFFFFF - PRIM_TYPE_SCULPT + PERM_COPY + tooltip + type integer value - 7 - tooltip - + 0x8000 - PRIM_TYPE_SPHERE + PERM_MODIFY + tooltip + type integer value - 3 - tooltip - + 0x4000 - PRIM_TYPE_TORUS + PERM_MOVE + tooltip + type integer value - 4 - tooltip - + 0x80000 - PRIM_TYPE_TUBE + PERM_TRANSFER + tooltip + type integer value - 5 - tooltip - + 0x2000 - PROFILE_NONE + PI + tooltip + 3.14159265 - The number of radians in a semi-circle. type - integer + float value - 0 - tooltip - Disables profiling + 3.14159265 - PROFILE_SCRIPT_MEMORY + PING_PONG + tooltip + Play animation going forwards, then backwards. type integer value - 1 - tooltip - Enables memory profiling + 0x8 - PSYS_PART_BF_DEST_COLOR + PI_BY_TWO + tooltip + 1.57079633 - The number of radians in a quarter circle. type - integer + float value - 2 - tooltip - + 1.57079633 - PSYS_PART_BF_ONE + PRIM_ALLOW_UNSIT + tooltip + Prim parameter for restricting manual standing for seated avatars in an experience.\nIgnored if the avatar was not seated via a call to llSitOnLink. type integer value - 0 - tooltip - + 39 - PSYS_PART_BF_ONE_MINUS_DEST_COLOR + PRIM_ALPHA_MODE + tooltip + Prim parameter for materials using integer face, integer alpha_mode, integer alpha_cutoff.\nDefines how the alpha channel of the diffuse texture should be rendered.\nValid options for alpha_mode are PRIM_ALPHA_MODE_BLEND, _NONE, _MASK, and _EMISSIVE.\nalpha_cutoff is used only for PRIM_ALPHA_MODE_MASK. type integer value - 4 - tooltip - + 38 - PSYS_PART_BF_ONE_MINUS_SOURCE_COLOR + PRIM_ALPHA_MODE_BLEND + tooltip + Prim parameter setting for PRIM_ALPHA_MODE.\nIndicates that the diffuse texture's alpha channel should be rendered as alpha-blended. type integer value - 5 - tooltip - + 1 - PSYS_PART_BF_ONE_MINUS_SOURCE_ALPHA + PRIM_ALPHA_MODE_EMISSIVE + tooltip + Prim parameter setting for PRIM_ALPHA_MODE.\nIndicates that the diffuse texture's alpha channel should be rendered as an emissivity mask. type integer value - 9 - tooltip - + 3 - PSYS_PART_BF_SOURCE_ALPHA + PRIM_ALPHA_MODE_MASK + tooltip + Prim parameter setting for PRIM_ALPHA_MODE.\nIndicates that the diffuse texture's alpha channel should be rendered as fully opaque for alpha values above alpha_cutoff and fully transparent otherwise. type integer value - 7 - tooltip - + 2 - PSYS_PART_BF_SOURCE_COLOR + PRIM_ALPHA_MODE_NONE + tooltip + Prim parameter setting for PRIM_ALPHA_MODE.\nIndicates that the diffuse texture's alpha channel should be ignored. type integer value - 3 - tooltip - + 0 - PSYS_PART_BF_ZERO + PRIM_BUMP_BARK + tooltip + type integer value - 1 - tooltip - + 4 - PSYS_PART_BLEND_FUNC_DEST + PRIM_BUMP_BLOBS + tooltip + type integer value - 25 - tooltip - + 12 - PSYS_PART_BLEND_FUNC_SOURCE + PRIM_BUMP_BRICKS + tooltip + type integer value - 24 - tooltip - + 5 - PSYS_PART_BOUNCE_MASK + PRIM_BUMP_BRIGHT + tooltip + type integer value - 0x4 - tooltip - Particles bounce off of a plane at the objects Z height. + 1 - PSYS_PART_EMISSIVE_MASK + PRIM_BUMP_CHECKER + tooltip + type integer value - 0x100 - tooltip - The particle glows. + 6 - PSYS_PART_END_ALPHA + PRIM_BUMP_CONCRETE + tooltip + type integer value - 4 - tooltip - A float which determines the ending alpha of the object. + 7 - PSYS_PART_END_COLOR + PRIM_BUMP_DARK + tooltip + type integer value - 3 - tooltip - A vector <r, g, b> which determines the ending color of the object. + 2 - PSYS_PART_END_GLOW + PRIM_BUMP_DISKS + tooltip + type integer value - 27 - tooltip - + 10 - PSYS_PART_END_SCALE + PRIM_BUMP_GRAVEL + tooltip + type integer value - 6 - tooltip - A vector <sx, sy, z>, which is the ending size of the particle billboard in meters (z is ignored). + 11 - PSYS_PART_FLAGS + PRIM_BUMP_LARGETILE + tooltip + type integer value - 0 - tooltip - Each particle that is emitted by the particle system is simulated based on the following flags. To use multiple flags, bitwise or (|) them together. + 14 - PSYS_PART_FOLLOW_SRC_MASK + PRIM_BUMP_NONE + tooltip + type integer value - 0x10 - tooltip - The particle position is relative to the source objects position. + 0 - PSYS_PART_FOLLOW_VELOCITY_MASK + PRIM_BUMP_SHINY + tooltip + type integer value - 0x20 - tooltip - The particle orientation is rotated so the vertical axis faces towards the particle velocity. + 19 - PSYS_PART_INTERP_COLOR_MASK + PRIM_BUMP_SIDING + tooltip + type integer value - 0x1 - tooltip - Interpolate both the color and alpha from the start value to the end value. + 13 - PSYS_PART_INTERP_SCALE_MASK + PRIM_BUMP_STONE + tooltip + type integer value - 0x2 - tooltip - Interpolate the particle scale from the start value to the end value. + 9 - PSYS_PART_MAX_AGE + PRIM_BUMP_STUCCO + tooltip + type integer value - 7 - tooltip - Age in seconds of a particle at which it dies. + 15 - PSYS_PART_RIBBON_MASK + PRIM_BUMP_SUCTION + tooltip + type integer value - 0x400 - tooltip - + 16 - PSYS_PART_START_ALPHA + PRIM_BUMP_TILE + tooltip + type integer value - 2 - tooltip - A float which determines the starting alpha of the object. + 8 - PSYS_PART_START_COLOR + PRIM_BUMP_WEAVE + tooltip + type integer value - 1 - tooltip - A vector <r.r, g.g, b.b> which determines the starting color of the object. + 17 - PSYS_PART_START_GLOW + PRIM_BUMP_WOOD + tooltip + type integer value - 26 - tooltip - + 3 - PSYS_PART_START_SCALE + PRIM_CAST_SHADOWS + deprecated + 1 + tooltip + type integer value - 5 - tooltip - A vector <sx, sy, z>, which is the starting size of the particle billboard in meters (z is ignored). + 24 - PSYS_PART_TARGET_LINEAR_MASK + PRIM_CLICK_ACTION + tooltip + type integer value - 0x80 - tooltip - + 43 - PSYS_PART_TARGET_POS_MASK + PRIM_COLLISION_SOUND + tooltip + Collision sound uuid and volume for this prim type integer value - 0x40 - tooltip - The particle heads towards the location of the target object as defined by PSYS_SRC_TARGET_KEY. + 53 - PSYS_PART_WIND_MASK + PRIM_COLOR + tooltip + type integer value - 0x8 - tooltip - Particles have their velocity damped towards the wind velocity. + 18 - PSYS_SRC_ACCEL + PRIM_DAMAGE + tooltip + Damage and damage type assigned to this prim. type integer value - 8 - tooltip - A vector <x, y, z> which is the acceleration to apply on particles. + 51 - PSYS_SRC_ANGLE_BEGIN + PRIM_DESC + tooltip + type integer value - 22 - tooltip - Area in radians specifying where particles will NOT be created (for ANGLE patterns) + 28 - PSYS_SRC_ANGLE_END + PRIM_FLEXIBLE + tooltip + type integer value - 23 - tooltip - Area in radians filled with particles (for ANGLE patterns) (if lower than PSYS_SRC_ANGLE_BEGIN, acts as PSYS_SRC_ANGLE_BEGIN itself, and PSYS_SRC_ANGLE_BEGIN acts as PSYS_SRC_ANGLE_END). + 21 - PSYS_SRC_BURST_PART_COUNT + PRIM_FULLBRIGHT + tooltip + type integer value - 15 - tooltip - How many particles to release in a burst. + 20 - PSYS_SRC_BURST_RADIUS + PRIM_GLOW + tooltip + PRIM_GLOW is used to get or set the glow status of the face. type integer value - 16 - tooltip - What distance from the center of the object to create the particles. + 25 - PSYS_SRC_BURST_RATE + PRIM_GLTF_ALPHA_MODE_BLEND + tooltip + Prim parameter setting for PRIM_GLTF_BASE_COLOR alpha mode "BLEND". type integer value - 13 - tooltip - How often to release a particle burst (float seconds). + 1 - PSYS_SRC_BURST_SPEED_MAX + PRIM_GLTF_ALPHA_MODE_MASK + tooltip + Prim parameter setting for PRIM_GLTF_BASE_COLOR alpha mode "MASK". type integer value - 18 - tooltip - Maximum speed that a particle should be moving. + 2 - PSYS_SRC_BURST_SPEED_MIN + PRIM_GLTF_ALPHA_MODE_OPAQUE + tooltip + Prim parameter setting for PRIM_GLTF_BASE_COLOR alpha mode "OPAQUE". type integer value - 17 - tooltip - Minimum speed that a particle should be moving. + 0 - PSYS_SRC_INNERANGLE + PRIM_GLTF_BASE_COLOR + tooltip + Prim parameter for materials using integer face, string texture, vector repeats, vector offsets, float rotation_in_radians, vector color, integer alpha_mode, integer alpha_cutoff, boolean double_sided.\nValid options for alpha_mode are PRIM_ALPHA_MODE_BLEND, _NONE, and _MASK.\nalpha_cutoff is used only for PRIM_ALPHA_MODE_MASK. type integer value - 10 - tooltip - Specifies the inner angle of the arc created by the PSYS_SRC_PATTERN_ANGLE or PSYS_SRC_PATTERN_ANGLE_CONE source pattern. - The area specified will NOT have particles in it. + 48 - PSYS_SRC_MAX_AGE + PRIM_GLTF_EMISSIVE + tooltip + Prim parameter for GLTF materials using integer face, string texture, vector repeats, vector offsets, float rotation_in_radians, vector color type integer value - 19 - tooltip - How long this particle system should last, 0.0 means forever. + 46 - PSYS_SRC_OMEGA + PRIM_GLTF_METALLIC_ROUGHNESS + tooltip + Prim parameter for GLTF materials using integer face, string texture, vector repeats, vector offsets, float rotation_in_radians, float metallic_factor, float roughness_factor type integer value - 21 - tooltip - Sets the angular velocity to rotate the axis that SRC_PATTERN_ANGLE and SRC_PATTERN_ANGLE_CONE use. + 47 - PSYS_SRC_OUTERANGLE + PRIM_GLTF_NORMAL + tooltip + Prim parameter for GLTF materials using integer face, string texture, vector repeats, vector offsets, float rotation_in_radians type integer value - 11 - tooltip - Specifies the outer angle of the arc created by the PSYS_SRC_PATTERN_ANGLE or PSYS_SRC_PATTERN_ANGLE_CONE source pattern. - The area between the outer and inner angle will be filled with particles. + 45 - PSYS_SRC_PATTERN + PRIM_HEALTH + tooltip + Health value for this prim type integer value - 9 - tooltip - The pattern which is used to generate particles. - Use one of the following values: PSYS_SRC_PATTERN Values. + 52 - PSYS_SRC_PATTERN_ANGLE + PRIM_HOLE_CIRCLE + tooltip + type integer value - 0x04 - tooltip - Shoot particles across a 2 dimensional area defined by the arc created from PSYS_SRC_OUTERANGLE. There will be an open area defined by PSYS_SRC_INNERANGLE within the larger arc. + 0x10 - PSYS_SRC_PATTERN_ANGLE_CONE + PRIM_HOLE_DEFAULT + tooltip + type integer value - 0x08 - tooltip - Shoot particles out in a 3 dimensional cone with an outer arc of PSYS_SRC_OUTERANGLE and an inner open area defined by PSYS_SRC_INNERANGLE. + 0x00 - PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY + PRIM_HOLE_SQUARE + tooltip + type integer value - 0x10 - tooltip - + 0x20 - PSYS_SRC_PATTERN_DROP + PRIM_HOLE_TRIANGLE + tooltip + type integer value - 0x01 - tooltip - Drop particles at the source position. + 0x30 - PSYS_SRC_PATTERN_EXPLODE + PRIM_LINK_TARGET + tooltip + type integer value - 0x02 - tooltip - Shoot particles out in all directions, using the burst parameters. + 34 - PSYS_SRC_TARGET_KEY + PRIM_MATERIAL + tooltip + type integer value - 20 - tooltip - The key of a target object to move towards if PSYS_PART_TARGET_POS_MASK is enabled. + 2 - PSYS_SRC_TEXTURE + PRIM_MATERIAL_FLESH + tooltip + type integer value - 12 - tooltip - An asset name for the texture to use for the particles. + 4 - PU_EVADE_HIDDEN + PRIM_MATERIAL_GLASS + tooltip + type integer value - 0x07 - tooltip - Triggered when an llEvade character thinks it has hidden from its pursuer. + 2 - PU_EVADE_SPOTTED + PRIM_MATERIAL_LIGHT + tooltip + type integer value - 0x08 - tooltip - Triggered when an llEvade character switches from hiding to running + 7 - PU_FAILURE_DYNAMIC_PATHFINDING_DISABLED + PRIM_MATERIAL_METAL + tooltip + type integer value - 10 - tooltip - + 1 - PU_FAILURE_INVALID_GOAL + PRIM_MATERIAL_PLASTIC + tooltip + type integer value - 0x03 - tooltip - Goal is not on the navigation-mesh and cannot be reached. + 5 - PU_FAILURE_INVALID_START + PRIM_MATERIAL_RUBBER + tooltip + type integer value - 0x02 - tooltip - Character cannot navigate from the current location - e.g., the character is off the navmesh or too high above it. + 6 - PU_FAILURE_NO_NAVMESH + PRIM_MATERIAL_STONE + tooltip + type integer value - 0x09 - tooltip - This is a fatal error reported to a character when there is no navmesh for the region. This usually indicates a server failure and users should file a bug report and include the time and region in which they received this message. + 0 - PU_FAILURE_NO_VALID_DESTINATION + PRIM_MATERIAL_WOOD + tooltip + type integer value - 0x06 - tooltip - There is no good place for the character to go - e.g., it is patrolling and all the patrol points are now unreachable. + 3 - PU_FAILURE_OTHER + PRIM_MEDIA_ALT_IMAGE_ENABLE + tooltip + Boolean. Gets/Sets the default image state (the image that the user sees before a piece of media is active) for the chosen face. The default image is specified by Second Life's server for that media type. type integer value - 1000000 - tooltip - + 0 - PU_FAILURE_PARCEL_UNREACHABLE + PRIM_MEDIA_AUTO_LOOP + tooltip + Boolean. Gets/Sets whether auto-looping is enabled. type integer value - 11 - tooltip - + 4 - PU_FAILURE_TARGET_GONE + PRIM_MEDIA_AUTO_PLAY + tooltip + Boolean. Gets/Sets whether the media auto-plays when a Resident can view it. type integer value - 0x05 - tooltip - Target (for llPursue or llEvade) can no longer be tracked - e.g., it left the region or is an avatar that is now more than about 30m outside the region. + 5 - PU_FAILURE_UNREACHABLE + PRIM_MEDIA_AUTO_SCALE + tooltip + Boolean. Gets/Sets whether auto-scaling is enabled. Auto-scaling forces the media to the full size of the texture. type integer value - 0x04 - tooltip - Goal is no longer reachable for some reason - e.g., an obstacle blocks the path. + 6 - PU_GOAL_REACHED + PRIM_MEDIA_AUTO_ZOOM + tooltip + Boolean. Gets/Sets whether clicking the media triggers auto-zoom and auto-focus on the media. type integer value - 0x01 - tooltip - Character has reached the goal and will stop or choose a new goal (if wandering). + 7 - PU_SLOWDOWN_DISTANCE_REACHED + PRIM_MEDIA_CONTROLS + tooltip + Integer. Gets/Sets the style of controls. Can be either PRIM_MEDIA_CONTROLS_STANDARD or PRIM_MEDIA_CONTROLS_MINI. type integer value - 0x00 - tooltip - Character is near current goal. + 1 - PUBLIC_CHANNEL + PRIM_MEDIA_CONTROLS_MINI + tooltip + Mini web navigation controls; does not include an address bar. type integer value - 0 - tooltip - PUBLIC_CHANNEL is an integer constant that, when passed to llSay, llWhisper, or llShout as a channel parameter, will print text to the publicly heard chat channel. + 1 - PURSUIT_FUZZ_FACTOR + PRIM_MEDIA_CONTROLS_STANDARD + tooltip + Standard web navigation controls. type integer value - 3 - tooltip - Selects a random destination near the offset. + 0 - PURSUIT_GOAL_TOLERANCE + PRIM_MEDIA_CURRENT_URL + tooltip + String. Gets/Sets the current url displayed on the chosen face. Changing this URL causes navigation. 1024 characters Maximum. type integer value - 5 - tooltip - + 2 - PURSUIT_INTERCEPT + PRIM_MEDIA_FIRST_CLICK_INTERACT + tooltip + Boolean. Gets/Sets whether the first click interaction is enabled. type integer value - 4 - tooltip - Define whether the character attempts to predict the target's location. + 8 - PURSUIT_OFFSET + PRIM_MEDIA_HEIGHT_PIXELS + tooltip + Integer. Gets/Sets the height of the media in pixels. type integer value - 1 - tooltip - Go to a position offset from the target. + 10 - RAD_TO_DEG + PRIM_MEDIA_HOME_URL + tooltip + String. Gets/Sets the home URL for the chosen face. 1024 characters maximum. type - float + integer value - 57.2957795 - tooltip - 57.2957795 - Number of degrees per radian. You can use this number to convert radians to degrees by multiplying the radians by this number. + 3 - RC_DATA_FLAGS + PRIM_MEDIA_MAX_HEIGHT_PIXELS + tooltip + type integer value - 2 - tooltip - + 2048 - RC_DETECT_PHANTOM + PRIM_MEDIA_MAX_URL_LENGTH + tooltip + type integer value - 1 - tooltip - + 1024 - RC_GET_LINK_NUM + PRIM_MEDIA_MAX_WHITELIST_COUNT + tooltip + type integer value - 4 - tooltip - + 64 - RC_GET_NORMAL + PRIM_MEDIA_MAX_WHITELIST_SIZE + tooltip + type integer value - 1 - tooltip - + 1024 - RC_GET_ROOT_KEY + PRIM_MEDIA_MAX_WIDTH_PIXELS + tooltip + type integer value - 2 - tooltip - + 2048 - RC_MAX_HITS + PRIM_MEDIA_PARAM_MAX + tooltip + type integer value - 3 - tooltip - + 14 - RC_REJECT_AGENTS + PRIM_MEDIA_PERMS_CONTROL + tooltip + Integer. Gets/Sets the permissions mask that control who can see the media control bar above the object:: PRIM_MEDIA_PERM_ANYONE, PRIM_MEDIA_PERM_GROUP, PRIM_MEDIA_PERM_NONE, PRIM_MEDIA_PERM_OWNER type integer value - 1 - tooltip - + 14 - RC_REJECT_LAND + PRIM_MEDIA_PERMS_INTERACT + tooltip + Integer. Gets/Sets the permissions mask that control who can interact with the object: PRIM_MEDIA_PERM_ANYONE, PRIM_MEDIA_PERM_GROUP, PRIM_MEDIA_PERM_NONE, PRIM_MEDIA_PERM_OWNER type integer value - 8 - tooltip - + 13 - RC_REJECT_NONPHYSICAL + PRIM_MEDIA_PERM_ANYONE + tooltip + type integer value - 4 - tooltip - + 4 - RC_REJECT_PHYSICAL + PRIM_MEDIA_PERM_GROUP + tooltip + type integer value - 2 - tooltip - + 2 - RC_REJECT_TYPES + PRIM_MEDIA_PERM_NONE + tooltip + type integer value - 0 - tooltip - + 0 - RCERR_CAST_TIME_EXCEEDED + PRIM_MEDIA_PERM_OWNER + tooltip + type integer value - -3 - tooltip - + 1 - RCERR_SIM_PERF_LOW + PRIM_MEDIA_WHITELIST + tooltip + String. Gets/Sets the white-list as a string of escaped, comma-separated URLs. This string can hold up to 64 URLs or 1024 characters, whichever comes first. type integer value - -2 - tooltip - + 12 - RCERR_UNKNOWN + PRIM_MEDIA_WHITELIST_ENABLE + tooltip + Boolean. Gets/Sets whether navigation is restricted to URLs in PRIM_MEDIA_WHITELIST. type integer value - -1 - tooltip - + 11 - REGION_FLAG_ALLOW_DAMAGE + PRIM_MEDIA_WIDTH_PIXELS + tooltip + Integer. Gets/Sets the width of the media in pixels. type integer value - 0x1 - tooltip - + 9 - REGION_FLAG_ALLOW_DIRECT_TELEPORT + PRIM_NAME + tooltip + type integer value - 0x100000 - tooltip - + 27 - REGION_FLAG_BLOCK_FLY + PRIM_NORMAL + tooltip + Prim parameter for materials using integer face, string texture, vector repeats, vector offsets, float rotation_in_radians type integer value - 0x80000 - tooltip - + 37 - REGION_FLAG_BLOCK_FLYOVER + PRIM_OMEGA + tooltip + type integer value - 0x8000000 - tooltip - + 32 - REGION_FLAG_BLOCK_TERRAFORM + PRIM_PHANTOM + tooltip + type integer value - 0x40 - tooltip - + 5 - REGION_FLAG_DISABLE_COLLISIONS + PRIM_PHYSICS + tooltip + type integer value - 0x1000 - tooltip - + 3 - REGION_FLAG_DISABLE_PHYSICS + PRIM_PHYSICS_SHAPE_CONVEX + tooltip + Use the convex hull of the prim shape for physics (this is the default for mesh objects). type integer value - 0x4000 - tooltip - + 2 - REGION_FLAG_FIXED_SUN + PRIM_PHYSICS_SHAPE_NONE + tooltip + Ignore this prim in the physics shape. NB: This cannot be applied to the root prim. type integer value - 0x10 - tooltip - + 1 - REGION_FLAG_RESTRICT_PUSHOBJECT + PRIM_PHYSICS_SHAPE_PRIM + tooltip + Use the normal prim shape for physics (this is the default for all non-mesh objects). type integer value - 0x400000 - tooltip - + 0 - REGION_FLAG_SANDBOX + PRIM_PHYSICS_SHAPE_TYPE + tooltip + + Allows you to set the physics shape type of a prim via lsl. Permitted values are: + PRIM_PHYSICS_SHAPE_NONE, PRIM_PHYSICS_SHAPE_PRIM, PRIM_PHYSICS_SHAPE_CONVEX + type integer value - 0x100 - tooltip - + 30 - REMOTE_DATA_CHANNEL + PRIM_POINT_LIGHT + tooltip + type integer value - 1 - tooltip - + 23 - REMOTE_DATA_REPLY + PRIM_POSITION + tooltip + type integer value - 3 - tooltip - + 6 - REMOTE_DATA_REQUEST + PRIM_POS_LOCAL + tooltip + type integer value - 2 - tooltip - + 33 - REQUIRE_LINE_OF_SIGHT + PRIM_PROJECTOR + tooltip + type integer value - 2 - tooltip - Define whether the character needs a line-of-sight to give chase. + 42 - RESTITUTION + PRIM_REFLECTION_PROBE + tooltip + Allows you to configure the object as a custom-placed reflection probe, for image-based lighting (IBL). Only objects in the influence volume of the reflection probe object are affected. type integer value - 4 - tooltip - Used with llSetPhysicsMaterial to enable the density value. Must be between 0.0 and 1.0 + 44 - REVERSE + PRIM_REFLECTION_PROBE_BOX + tooltip + This is a flag option used with llGetPrimitiveParams and related functions when the parameter is PRIM_REFLECTION_PROBE. When set, the reflection probe is a box. When unset, the reflection probe is a sphere. type integer value - 0x4 - tooltip - Play animation in reverse direction. + 1 - ROTATE + PRIM_REFLECTION_PROBE_DYNAMIC + tooltip + This is a flag option used with llGetPrimitiveParams and related functions when the parameter is PRIM_REFLECTION_PROBE. When set, the reflection probe includes avatars in IBL effects. When unset, the reflection probe excludes avatars. type integer value - 0x20 - tooltip - Animate texture rotation. + 2 - SCALE + PRIM_REFLECTION_PROBE_MIRROR + tooltip + This is a flag option used with llGetPrimitiveParams and related functions when the parameter is PRIM_REFLECTION_PROBE. When set, the reflection probe acts as a mirror. type integer value - 0x40 - tooltip - Animate the texture scale. + 4 - SCRIPTED + PRIM_RENDER_MATERIAL + tooltip + type integer value - 0x8 - tooltip - Scripted in-world objects. + 49 - SIM_STAT_PCT_CHARS_STEPPED + PRIM_ROTATION + tooltip + type integer value - 0 - tooltip - Returns the % of pathfinding characters skipped each frame, averaged over the last minute.\nThe returned value corresponds to the "Characters Updated" stat in the viewer's Statistics Bar. + 8 - SMOOTH + PRIM_ROT_LOCAL + tooltip + type integer value - 0x10 - tooltip - Slide in the X direction, instead of playing separate frames. + 29 - SQRT2 + PRIM_SCRIPTED_SIT_ONLY + tooltip + Prim parameter for restricting manual sitting on this prim.\nSitting must be initiated via call to llSitOnLink. type - float + integer value - 1.41421356 - tooltip - 1.41421356 - The square root of 2. + 40 - STATUS_BLOCK_GRAB + PRIM_SCULPT_FLAG_ANIMESH + tooltip + Mesh is animated. type integer value - 0x40 - tooltip - Controls whether the object can be grabbed.\nA grab is the default action when in third person, and is available as the hand tool in build mode. This is useful for physical objects that you don't want other people to be able to trivially disturb. The default is FALSE + 32 - STATUS_BLOCK_GRAB_OBJECT + PRIM_SCULPT_FLAG_INVERT + tooltip + Render inside out (inverts the normals). type integer value - 0x400 - tooltip - Prevent click-and-drag movement on all prims in the object. + 64 - STATUS_BOUNDS_ERROR + PRIM_SCULPT_FLAG_MIRROR + tooltip + Render an X axis mirror of the sculpty. type integer value - 1002 - tooltip - Argument(s) passed to function had a bounds error. + 128 - STATUS_CAST_SHADOWS + PRIM_SCULPT_TYPE_CYLINDER + tooltip + type integer value - 0x200 - tooltip - + 4 - STATUS_DIE_AT_EDGE + PRIM_SCULPT_TYPE_MASK + tooltip + type integer value - 0x80 - tooltip - Controls whether the object is returned to the owners inventory if it wanders off the edge of the world.\nIt is useful to set this status TRUE for things like bullets or rockets. The default is TRUE + 7 - STATUS_INTERNAL_ERROR + PRIM_SCULPT_TYPE_MESH + tooltip + type integer value - 1999 - tooltip - An internal error occurred. + 5 - STATUS_MALFORMED_PARAMS + PRIM_SCULPT_TYPE_PLANE + tooltip + type integer value - 1000 - tooltip - Function was called with malformed parameters. + 3 - STATUS_NOT_FOUND + PRIM_SCULPT_TYPE_SPHERE + tooltip + type integer value - 1003 - tooltip - Object or other item was not found. + 1 - STATUS_NOT_SUPPORTED + PRIM_SCULPT_TYPE_TORUS + tooltip + type integer value - 1004 - tooltip - Feature not supported. + 2 - STATUS_OK + PRIM_SHINY_HIGH + tooltip + type integer value - 0 - tooltip - Result of function call was a success. + 3 - STATUS_PHANTOM + PRIM_SHINY_LOW + tooltip + type integer value - 0x10 - tooltip - Controls/indicates whether the object collides or not.\nSetting the value to TRUE makes the object non-colliding with all objects. It is a good idea to use this for most objects that move or rotate, but are non-physical. It is also useful for simulating volumetric lighting. The default is FALSE. + 1 - STATUS_PHYSICS + PRIM_SHINY_MEDIUM + tooltip + type integer value - 0x1 - tooltip - Controls/indicates whether the object moves physically.\nThis controls the same flag that the UI check-box for Physical controls. The default is FALSE. + 2 - STATUS_RETURN_AT_EDGE + PRIM_SHINY_NONE + tooltip + type integer value - 0x100 - tooltip - + 0 - STATUS_ROTATE_X + PRIM_SIT_FLAGS + tooltip + type integer value - 0x2 - tooltip - + 50 - STATUS_ROTATE_Y + PRIM_SIT_TARGET + tooltip + type integer value - 0x4 - tooltip - + 41 - STATUS_ROTATE_Z + PRIM_SIZE + tooltip + type integer value - 0x8 - tooltip - Controls/indicates whether the object can physically rotate around - the specific axis or not. This flag has no meaning - for non-physical objects. Set the value to FALSE - if you want to disable rotation around that axis. The - default is TRUE for a physical object. - A useful example to think about when visualizing - the effect is a sit-and-spin device. They spin around the - Z axis (up) but not around the X or Y axis. + 7 - STATUS_SANDBOX + PRIM_SLICE + tooltip + type integer value - 0x20 - tooltip - Controls/indicates whether the object can cross region boundaries - and move more than 20 meters from its creation - point. The default if FALSE. + 35 - STATUS_TYPE_MISMATCH + PRIM_SPECULAR + tooltip + Prim parameter for materials using integer face, string texture, vector repeats, vector offsets, float rotation_in_radians, vector color, integer glossy, integer environment type integer value - 1001 - tooltip - Argument(s) passed to function had a type mismatch. + 36 - STATUS_WHITELIST_FAILED + PRIM_TEMP_ON_REZ + tooltip + type integer value - 2001 - tooltip - Whitelist Failed. + 4 - STRING_TRIM + PRIM_TEXGEN + tooltip + type integer value - 0x03 - tooltip - + 22 - STRING_TRIM_HEAD + PRIM_TEXGEN_DEFAULT + tooltip + type integer value - 0x01 - tooltip - + 0 - STRING_TRIM_TAIL + PRIM_TEXGEN_PLANAR + tooltip + type integer value - 0x02 - tooltip - + 1 - TEXTURE_BLANK + PRIM_TEXT + tooltip + type - string + integer value - 5748decc-f629-461c-9a36-a35a221fe21f - tooltip - + 26 - TEXTURE_DEFAULT + PRIM_TEXTURE + tooltip + type - string + integer value - 89556747-24cb-43ed-920b-47caed15465f - tooltip - + 17 - TEXTURE_MEDIA + PRIM_TYPE + tooltip + type - string + integer value - 8b5fec65-8d8d-9dc5-cda8-8fdf2716e361 - tooltip - + 9 - TEXTURE_PLYWOOD + PRIM_TYPE_BOX + tooltip + type - string + integer value - 89556747-24cb-43ed-920b-47caed15465f - tooltip - + 0 - TEXTURE_TRANSPARENT + PRIM_TYPE_CYLINDER + tooltip + type - string + integer value - 8dcd4a48-2d37-4909-9f78-f7a9eb4ef903 - tooltip - + 1 - TOUCH_INVALID_FACE + PRIM_TYPE_PRISM + tooltip + type integer value - 0xFFFFFFFF - tooltip - + 2 - TOUCH_INVALID_TEXCOORD + PRIM_TYPE_RING + tooltip + type - vector + integer value - <-1.0, -1.0, 0.0> - tooltip - + 6 - TOUCH_INVALID_VECTOR + PRIM_TYPE_SCULPT + tooltip + type - vector + integer value - <0.0, 0.0, 0.0> - tooltip - + 7 - TRAVERSAL_TYPE + PRIM_TYPE_SPHERE + tooltip + type integer value - 7 - tooltip - One of TRAVERSAL_TYPE_FAST, TRAVERSAL_TYPE_SLOW, and TRAVERSAL_TYPE_NONE. + 3 - TRAVERSAL_TYPE_FAST + PRIM_TYPE_TORUS + tooltip + type integer value - 1 - tooltip - + 4 - TRAVERSAL_TYPE_NONE + PRIM_TYPE_TUBE + tooltip + type integer value - 2 - tooltip - + 5 - TRAVERSAL_TYPE_SLOW + PROFILE_NONE + tooltip + Disables profiling type integer value - 0 - tooltip - + 0 - TRUE + PROFILE_SCRIPT_MEMORY + tooltip + Enables memory profiling type integer value - 1 - tooltip - An integer constant for boolean comparisons. Has the value '1'. + 1 - TWO_PI + PSYS_PART_BF_DEST_COLOR + tooltip + type - float + integer value - 6.28318530 - tooltip - 6.28318530 - The radians of a circle. + 2 - TYPE_FLOAT + PSYS_PART_BF_ONE + tooltip + type integer value - 2 - tooltip - The list entry is a float. + 0 - TYPE_INTEGER + PSYS_PART_BF_ONE_MINUS_DEST_COLOR + tooltip + type integer value - 1 - tooltip - The list entry is an integer. + 4 - TYPE_INVALID + PSYS_PART_BF_ONE_MINUS_SOURCE_ALPHA + tooltip + type integer value - 0 - tooltip - The list entry is invalid. + 9 - TYPE_KEY + PSYS_PART_BF_ONE_MINUS_SOURCE_COLOR + tooltip + type integer value - 4 - tooltip - The list entry is a key. + 5 - TYPE_ROTATION + PSYS_PART_BF_SOURCE_ALPHA + tooltip + type integer value - 6 - tooltip - The list entry is a rotation. + 7 - TYPE_STRING + PSYS_PART_BF_SOURCE_COLOR + tooltip + type integer value - 3 - tooltip - The list entry is a string. + 3 - TYPE_VECTOR + PSYS_PART_BF_ZERO + tooltip + type integer value - 5 - tooltip - The list entry is a vector. + 1 - URL_REQUEST_DENIED + PSYS_PART_BLEND_FUNC_DEST - type - string - value - URL_REQUEST_DENIED tooltip - - - URL_REQUEST_GRANTED - + type - string + integer value - URL_REQUEST_GRANTED - tooltip - + 25 - VEHICLE_ANGULAR_DEFLECTION_EFFICIENCY + PSYS_PART_BLEND_FUNC_SOURCE + tooltip + type integer value - 32 - tooltip - A slider between minimum (0.0) and maximum (1.0) deflection of angular orientation. That is, its a simple scalar for modulating the strength of angular deflection such that the vehicles preferred axis of motion points toward its real velocity. + 24 - VEHICLE_ANGULAR_DEFLECTION_TIMESCALE + PSYS_PART_BOUNCE_MASK + tooltip + Particles bounce off of a plane at the objects Z height. type integer value - 33 - tooltip - The time-scale for exponential success of linear deflection deflection. Its another way to specify the strength of the vehicles tendency to reorient itself so that its preferred axis of motion agrees with its true velocity. + 0x4 - VEHICLE_ANGULAR_FRICTION_TIMESCALE + PSYS_PART_EMISSIVE_MASK + tooltip + The particle glows. type integer value - 17 - tooltip - A vector of timescales for exponential decay of the vehicles angular velocity about its preferred axes of motion (at, left, up). - Range = [0.07, inf) seconds for each element of the vector. + 0x100 - VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE + PSYS_PART_END_ALPHA + tooltip + A float which determines the ending alpha of the object. type integer value - 35 - tooltip - The timescale for exponential decay of the angular motors magnitude. + 4 - VEHICLE_ANGULAR_MOTOR_DIRECTION + PSYS_PART_END_COLOR + tooltip + A vector <r, g, b> which determines the ending color of the object. type integer value - 19 - tooltip - The direction and magnitude (in preferred frame) of the vehicles angular motor.The vehicle will accelerate (or decelerate if necessary) to match its velocity to its motor. + 3 - VEHICLE_ANGULAR_MOTOR_TIMESCALE + PSYS_PART_END_GLOW + tooltip + type integer value - 34 - tooltip - The timescale for exponential approach to full angular motor velocity. + 27 - VEHICLE_BANKING_EFFICIENCY + PSYS_PART_END_SCALE + tooltip + A vector <sx, sy, z>, which is the ending size of the particle billboard in meters (z is ignored). type integer value - 38 - tooltip - A slider between anti (-1.0), none (0.0), and maxmum (1.0) banking strength. + 6 - VEHICLE_BANKING_MIX + PSYS_PART_FLAGS + tooltip + Each particle that is emitted by the particle system is simulated based on the following flags. To use multiple flags, bitwise or (|) them together. type integer value - 39 - tooltip - A slider between static (0.0) and dynamic (1.0) banking. "Static" means the banking scales only with the angle of roll, whereas "dynamic" is a term that also scales with the vehicles linear speed. + 0 - VEHICLE_BANKING_TIMESCALE + PSYS_PART_FOLLOW_SRC_MASK + tooltip + The particle position is relative to the source objects position. type integer value - 40 - tooltip - The timescale for banking to exponentially approach its maximum effect. This is another way to scale the strength of the banking effect, however it affects the term that is proportional to the difference between what the banking behavior is trying to do, and what the vehicle is actually doing. + 0x10 - VEHICLE_BUOYANCY + PSYS_PART_FOLLOW_VELOCITY_MASK + tooltip + The particle orientation is rotated so the vertical axis faces towards the particle velocity. type integer value - 27 - tooltip - A slider between minimum (0.0) and maximum anti-gravity (1.0). + 0x20 - VEHICLE_FLAG_CAMERA_DECOUPLED + PSYS_PART_INTERP_COLOR_MASK + tooltip + Interpolate both the color and alpha from the start value to the end value. type integer value - 0x200 - tooltip - + 0x1 - VEHICLE_FLAG_HOVER_GLOBAL_HEIGHT + PSYS_PART_INTERP_SCALE_MASK + tooltip + Interpolate the particle scale from the start value to the end value. type integer value - 0x10 - tooltip - Hover at global height. + 0x2 - VEHICLE_FLAG_HOVER_TERRAIN_ONLY + PSYS_PART_MAX_AGE + tooltip + Age in seconds of a particle at which it dies. type integer value - 0x8 - tooltip - Ignore water height when hovering. + 7 - VEHICLE_FLAG_HOVER_UP_ONLY + PSYS_PART_RIBBON_MASK + tooltip + type integer value - 0x20 - tooltip - Hover does not push down. Use this flag for hovering vehicles that should be able to jump above their hover height. + 0x400 - VEHICLE_FLAG_HOVER_WATER_ONLY + PSYS_PART_START_ALPHA + tooltip + A float which determines the starting alpha of the object. type integer value - 0x4 - tooltip - Ignore terrain height when hovering. + 2 - VEHICLE_FLAG_LIMIT_MOTOR_UP + PSYS_PART_START_COLOR + tooltip + A vector <r.r, g.g, b.b> which determines the starting color of the object. type integer value - 0x40 - tooltip - Prevents ground vehicles from motoring into the sky. + 1 - VEHICLE_FLAG_LIMIT_ROLL_ONLY + PSYS_PART_START_GLOW + tooltip + type integer value - 0x2 - tooltip - For vehicles with vertical attractor that want to be able to climb/dive, for instance, aeroplanes that want to use the banking feature. + 26 - VEHICLE_FLAG_MOUSELOOK_BANK + PSYS_PART_START_SCALE + tooltip + A vector <sx, sy, z>, which is the starting size of the particle billboard in meters (z is ignored). type integer value - 0x100 - tooltip - + 5 - VEHICLE_FLAG_MOUSELOOK_STEER + PSYS_PART_TARGET_LINEAR_MASK + tooltip + type integer value 0x80 - tooltip - - VEHICLE_FLAG_NO_DEFLECTION_UP + PSYS_PART_TARGET_POS_MASK + tooltip + The particle heads towards the location of the target object as defined by PSYS_SRC_TARGET_KEY. type integer value - 0x1 - tooltip - This flag prevents linear deflection parallel to world z-axis. This is useful for preventing ground vehicles with large linear deflection, like bumper cars, from climbing their linear deflection into the sky. + 0x40 - VEHICLE_FLAG_NO_FLY_UP + PSYS_PART_WIND_MASK - deprecated - true + tooltip + Particles have their velocity damped towards the wind velocity. type integer value - 0x1 - tooltip - Old, changed to VEHICLE_FLAG_NO_DEFLECTION_UP + 0x8 - VEHICLE_HOVER_EFFICIENCY + PSYS_SRC_ACCEL + tooltip + A vector <x, y, z> which is the acceleration to apply on particles. type integer value - 25 - tooltip - A slider between minimum (0.0 = bouncy) and maximum (1.0 = fast as possible) damped motion of the hover behavior. + 8 - VEHICLE_HOVER_HEIGHT + PSYS_SRC_ANGLE_BEGIN + tooltip + Area in radians specifying where particles will NOT be created (for ANGLE patterns) type integer value - 24 - tooltip - The height (above the terrain or water, or global) at which the vehicle will try to hover. + 22 - VEHICLE_HOVER_TIMESCALE + PSYS_SRC_ANGLE_END + tooltip + Area in radians filled with particles (for ANGLE patterns) (if lower than PSYS_SRC_ANGLE_BEGIN, acts as PSYS_SRC_ANGLE_BEGIN itself, and PSYS_SRC_ANGLE_BEGIN acts as PSYS_SRC_ANGLE_END). type integer value - 26 - tooltip - Period of time (in seconds) for the vehicle to achieve its hover height. + 23 - VEHICLE_LINEAR_DEFLECTION_EFFICIENCY + PSYS_SRC_BURST_PART_COUNT + tooltip + How many particles to release in a burst. type integer value - 28 - tooltip - A slider between minimum (0.0) and maximum (1.0) deflection of linear velocity. That is, its a simple scalar for modulating the strength of linear deflection. + 15 - VEHICLE_LINEAR_DEFLECTION_TIMESCALE + PSYS_SRC_BURST_RADIUS + tooltip + What distance from the center of the object to create the particles. type integer value - 29 - tooltip - The timescale for exponential success of linear deflection deflection. It is another way to specify how much time it takes for the vehicles linear velocity to be redirected to its preferred axis of motion. + 16 - VEHICLE_LINEAR_FRICTION_TIMESCALE + PSYS_SRC_BURST_RATE + tooltip + How often to release a particle burst (float seconds). type integer value - 16 - tooltip - A vector of timescales for exponential decay of the vehicles linear velocity along its preferred axes of motion (at, left, up). - Range = [0.07, inf) seconds for each element of the vector. + 13 - VEHICLE_LINEAR_MOTOR_DECAY_TIMESCALE + PSYS_SRC_BURST_SPEED_MAX + tooltip + Maximum speed that a particle should be moving. type integer value - 31 - tooltip - The timescale for exponential decay of the linear motors magnitude. + 18 - VEHICLE_LINEAR_MOTOR_DIRECTION + PSYS_SRC_BURST_SPEED_MIN + tooltip + Minimum speed that a particle should be moving. type integer value - 18 - tooltip - The direction and magnitude (in preferred frame) of the vehicles linear motor. The vehicle will accelerate (or decelerate if necessary) to match its velocity to its motor. - Range of magnitude = [0, 30] meters/second. + 17 - VEHICLE_LINEAR_MOTOR_OFFSET + PSYS_SRC_INNERANGLE + tooltip + + Specifies the inner angle of the arc created by the PSYS_SRC_PATTERN_ANGLE or PSYS_SRC_PATTERN_ANGLE_CONE source pattern. + The area specified will NOT have particles in it. + type integer value - 20 - tooltip - + 10 - VEHICLE_LINEAR_MOTOR_TIMESCALE + PSYS_SRC_MAX_AGE + tooltip + How long this particle system should last, 0.0 means forever. type integer value - 30 - tooltip - The timescale for exponential approach to full linear motor velocity. + 19 - VEHICLE_REFERENCE_FRAME + PSYS_SRC_OMEGA + tooltip + Sets the angular velocity to rotate the axis that SRC_PATTERN_ANGLE and SRC_PATTERN_ANGLE_CONE use. type integer value - 44 - tooltip - A rotation of the vehicles preferred axes of motion and orientation (at, left, up) with respect to the vehicles local frame (x, y, z). + 21 - VEHICLE_TYPE_AIRPLANE + PSYS_SRC_OUTERANGLE + tooltip + + Specifies the outer angle of the arc created by the PSYS_SRC_PATTERN_ANGLE or PSYS_SRC_PATTERN_ANGLE_CONE source pattern. + The area between the outer and inner angle will be filled with particles. + type integer value - 4 - tooltip - Uses linear deflection for lift, no hover, and banking to turn.\nSee http://wiki.secondlife.com/wiki/VEHICLE_TYPE_AIRPLANE + 11 - VEHICLE_TYPE_BALLOON + PSYS_SRC_PATTERN + tooltip + + The pattern which is used to generate particles. + Use one of the following values: PSYS_SRC_PATTERN Values. + type integer value - 5 - tooltip - Hover, and friction, but no deflection.\nSee http://wiki.secondlife.com/wiki/VEHICLE_TYPE_BALLOON + 9 - VEHICLE_TYPE_BOAT + PSYS_SRC_PATTERN_ANGLE + tooltip + Shoot particles across a 2 dimensional area defined by the arc created from PSYS_SRC_OUTERANGLE. There will be an open area defined by PSYS_SRC_INNERANGLE within the larger arc. type integer value - 3 - tooltip - Hovers over water with lots of friction and some anglar deflection.\nSee http://wiki.secondlife.com/wiki/VEHICLE_TYPE_BOAT + 0x04 - VEHICLE_TYPE_CAR + PSYS_SRC_PATTERN_ANGLE_CONE + tooltip + Shoot particles out in a 3 dimensional cone with an outer arc of PSYS_SRC_OUTERANGLE and an inner open area defined by PSYS_SRC_INNERANGLE. type integer value - 2 - tooltip - Another vehicle that bounces along the ground but needs the motors to be driven from external controls or timer events.\nSee http://wiki.secondlife.com/wiki/VEHICLE_TYPE_CAR + 0x08 - VEHICLE_TYPE_NONE + PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY + tooltip + type integer value - 0 - tooltip - + 0x10 - VEHICLE_TYPE_SLED + PSYS_SRC_PATTERN_DROP + tooltip + Drop particles at the source position. type integer value - 1 - tooltip - Simple vehicle that bumps along the ground, and likes to move along its local x-axis.\nSee http://wiki.secondlife.com/wiki/VEHICLE_TYPE_SLED + 0x01 - VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY + PSYS_SRC_PATTERN_EXPLODE + tooltip + Shoot particles out in all directions, using the burst parameters. type integer value - 36 - tooltip - A slider between minimum (0.0 = wobbly) and maximum (1.0 = firm as possible) stability of the vehicle to keep itself upright. + 0x02 - VEHICLE_VERTICAL_ATTRACTION_TIMESCALE + PSYS_SRC_TARGET_KEY + tooltip + The key of a target object to move towards if PSYS_PART_TARGET_POS_MASK is enabled. type integer value - 37 - tooltip - The period of wobble, or timescale for exponential approach, of the vehicle to rotate such that its preferred "up" axis is oriented along the worlds "up" axis. + 20 - VERTICAL + PSYS_SRC_TEXTURE + tooltip + An asset name for the texture to use for the particles. type integer value - 0 - tooltip - + 12 - WANDER_PAUSE_AT_WAYPOINTS + PUBLIC_CHANNEL + tooltip + PUBLIC_CHANNEL is an integer constant that, when passed to llSay, llWhisper, or llShout as a channel parameter, will print text to the publicly heard chat channel. type integer value - 0 - tooltip - + 0 - XP_ERROR_EXPERIENCES_DISABLED + PURSUIT_FUZZ_FACTOR + tooltip + Selects a random destination near the offset. type integer value - 2 - tooltip - The region currently has experiences disabled. + 3 - XP_ERROR_EXPERIENCE_DISABLED + PURSUIT_GOAL_TOLERANCE + tooltip + type integer value - 8 - tooltip - The experience owner has temporarily disabled the experience. + 5 - XP_ERROR_EXPERIENCE_SUSPENDED + PURSUIT_INTERCEPT + tooltip + Define whether the character attempts to predict the target's location. type integer value - 9 - tooltip - The experience has been suspended by Linden Customer Support. + 4 - XP_ERROR_INVALID_EXPERIENCE + PURSUIT_OFFSET + tooltip + Go to a position offset from the target. type integer value - 7 - tooltip - The script is associated with an experience that no longer exists. + 1 - XP_ERROR_INVALID_PARAMETERS + PU_EVADE_HIDDEN + tooltip + Triggered when an llEvade character thinks it has hidden from its pursuer. type integer value - 3 + 0x07 + + PU_EVADE_SPOTTED + tooltip - One of the string arguments was too big to fit in the key-value store. + Triggered when an llEvade character switches from hiding to running + type + integer + value + 0x08 - XP_ERROR_KEY_NOT_FOUND + PU_FAILURE_DYNAMIC_PATHFINDING_DISABLED + tooltip + type integer value - 14 + 10 + + PU_FAILURE_INVALID_GOAL + tooltip - The requested key does not exist. + Goal is not on the navigation-mesh and cannot be reached. + type + integer + value + 0x03 - XP_ERROR_MATURITY_EXCEEDED + PU_FAILURE_INVALID_START + tooltip + Character cannot navigate from the current location - e.g., the character is off the navmesh or too high above it. type integer value - 16 + 0x02 + + PU_FAILURE_NO_NAVMESH + tooltip - The content rating of the experience exceeds that of the region. + This is a fatal error reported to a character when there is no navmesh for the region. This usually indicates a server failure and users should file a bug report and include the time and region in which they received this message. + type + integer + value + 0x09 - XP_ERROR_NONE + PU_FAILURE_NO_VALID_DESTINATION + tooltip + There is no good place for the character to go - e.g., it is patrolling and all the patrol points are now unreachable. type integer value - 0 + 0x06 + + PU_FAILURE_OTHER + tooltip - No error was detected. + + type + integer + value + 1000000 - XP_ERROR_NOT_FOUND + PU_FAILURE_PARCEL_UNREACHABLE + tooltip + type integer value - 6 + 11 + + PU_FAILURE_TARGET_GONE + tooltip - The sim was unable to verify the validity of the experience. Retrying after a short wait is advised. + Target (for llPursue or llEvade) can no longer be tracked - e.g., it left the region or is an avatar that is now more than about 30m outside the region. + type + integer + value + 0x05 - XP_ERROR_NOT_PERMITTED + PU_FAILURE_UNREACHABLE + tooltip + Goal is no longer reachable for some reason - e.g., an obstacle blocks the path. type integer value - 4 + 0x04 + + PU_GOAL_REACHED + tooltip - This experience is not allowed to run by the requested agent. + Character has reached the goal and will stop or choose a new goal (if wandering). + type + integer + value + 0x01 - XP_ERROR_NOT_PERMITTED_LAND + PU_SLOWDOWN_DISTANCE_REACHED + tooltip + Character is near current goal. type integer value - 17 + 0x00 + + RAD_TO_DEG + tooltip - This experience is not allowed to run on the current region. + 57.2957795 - Number of degrees per radian. You can use this number to convert radians to degrees by multiplying the radians by this number. + type + float + value + 57.2957795 - XP_ERROR_NO_EXPERIENCE + RCERR_CAST_TIME_EXCEEDED + tooltip + type integer value - 5 + -3 + + RCERR_SIM_PERF_LOW + tooltip - This script is not associated with an experience. + + type + integer + value + -2 - XP_ERROR_QUOTA_EXCEEDED + RCERR_UNKNOWN + tooltip + type integer value - 11 + -1 + + RC_DATA_FLAGS + tooltip - An attempted write data to the key-value store failed due to the data quota being met. + + type + integer + value + 2 - XP_ERROR_RETRY_UPDATE + RC_DETECT_PHANTOM + tooltip + type integer value - 15 + 1 + + RC_GET_LINK_NUM + tooltip - A checked update failed due to an out of date request. + + type + integer + value + 4 - XP_ERROR_STORAGE_EXCEPTION + RC_GET_NORMAL + tooltip + type integer value - 13 + 1 + + RC_GET_ROOT_KEY + tooltip - Unable to communicate with the key-value store. + + type + integer + value + 2 - XP_ERROR_STORE_DISABLED + RC_MAX_HITS + tooltip + type integer value - 12 + 3 + + RC_REJECT_AGENTS + tooltip - The key-value store is currently disabled on this region. + + type + integer + value + 1 - XP_ERROR_THROTTLED + RC_REJECT_LAND + tooltip + type integer value - 1 + 8 + + RC_REJECT_NONPHYSICAL + tooltip - The call failed due to too many recent calls. + + type + integer + value + 4 - XP_ERROR_UNKNOWN_ERROR + RC_REJECT_PHYSICAL + tooltip + type integer value - 10 + 2 + + RC_REJECT_TYPES + tooltip - Other unknown error. + + type + integer + value + 0 - ZERO_ROTATION + REGION_FLAG_ALLOW_DAMAGE + tooltip + type - rotation + integer value - <0.0, 0.0, 0.0, 1.0> + 0x1 + + REGION_FLAG_ALLOW_DIRECT_TELEPORT + tooltip - + + type + integer + value + 0x100000 - ZERO_VECTOR + REGION_FLAG_BLOCK_FLY + tooltip + type - vector + integer value - <0.0, 0.0, 0.0> + 0x80000 + + REGION_FLAG_BLOCK_FLYOVER + tooltip - + + type + integer + value + 0x8000000 - default + REGION_FLAG_BLOCK_TERRAFORM tooltip - All scripts must have a default state, which is the first state entered when the script starts.\nIf another state is defined before the default state, the compiler will report a syntax error. + + type + integer + value + 0x40 - - events - - at_rot_target + REGION_FLAG_DISABLE_COLLISIONS - arguments - + tooltip + + type + integer + value + 0x1000 + + REGION_FLAG_DISABLE_PHYSICS + + tooltip + + type + integer + value + 0x4000 + + REGION_FLAG_FIXED_SUN + + tooltip + + type + integer + value + 0x10 + + REGION_FLAG_RESTRICT_PUSHOBJECT + + tooltip + + type + integer + value + 0x400000 + + REGION_FLAG_SANDBOX + + tooltip + + type + integer + value + 0x100 + + REMOTE_DATA_CHANNEL + + tooltip + + type + integer + value + 1 + + REMOTE_DATA_REPLY + + tooltip + + type + integer + value + 3 + + REMOTE_DATA_REQUEST + + tooltip + + type + integer + value + 2 + + REQUIRE_LINE_OF_SIGHT + + tooltip + Define whether the character needs a line-of-sight to give chase. + type + integer + value + 2 + + RESTITUTION + + tooltip + Used with llSetPhysicsMaterial to enable the density value. Must be between 0.0 and 1.0 + type + integer + value + 4 + + REVERSE + + tooltip + Play animation in reverse direction. + type + integer + value + 0x4 + + REZ_ACCEL + + tooltip + Acceleration forced applied to the rezzed object. [vector force, integer rel] + type + integer + value + 5 + + REZ_DAMAGE + + tooltip + Damage applied by the object when it collides with an agent. [float damage] + type + integer + value + 8 + + REZ_DAMAGE_TYPE + + tooltip + Set the damage type applied when this object collides. + type + integer + value + 12 + + REZ_FLAGS + + tooltip + Rez flags to set on the newly rezzed object. [integer flags] + type + integer + value + 1 + + REZ_FLAG_BLOCK_GRAB_OBJECT + + tooltip + Prevent grabbing the object. + type + integer + value + 0x0080 + + REZ_FLAG_DIE_ON_COLLIDE + + tooltip + Object will die after its first collision. + type + integer + value + 0x0008 + + REZ_FLAG_DIE_ON_NOENTRY + + tooltip + Object will die if it attempts to enter a parcel that it can not. + type + integer + value + 0x0010 + + REZ_FLAG_NO_COLLIDE_FAMILY + + tooltip + Object will not trigger collision events with other objects created by the same rezzer. + type + integer + value + 0x0040 + + REZ_FLAG_NO_COLLIDE_OWNER + + tooltip + Object will not trigger collision events with its owner. + type + integer + value + 0x0020 + + REZ_FLAG_PHANTOM + + tooltip + Make the object phantom on rez. + type + integer + value + 0x0004 + + REZ_FLAG_PHYSICAL + + tooltip + Make the object physical on rez. + type + integer + value + 0x0002 + + REZ_FLAG_TEMP + + tooltip + Flag the object as temp on rez. + type + integer + value + 0x0001 + + REZ_LOCK_AXES + + tooltip + Prevent the object from rotating around some axes. [vector locks] + type + integer + value + 11 + + REZ_OMEGA + + tooltip + Omega applied to the rezzed object. [vector axis, integer rel, float spin, float gain] + type + integer + value + 7 + + REZ_PARAM + + tooltip + Integer value to pass to the object as its rez parameter. [integer param] + type + integer + value + 0 + + REZ_PARAM_STRING + + tooltip + A string value to pass to the object as its rez parameter. [string param] + type + integer + value + 13 + + REZ_POS + + tooltip + Position at which to rez the new object. [vector position, integer rel, integer atroot] + type + integer + value + 2 + + REZ_ROT + + tooltip + Rotation applied to newly rezzed object. [rotation rot, integer rel] + type + integer + value + 3 + + REZ_SOUND + + tooltip + Sound attached to the rezzed object. [string name, float volume, integer loop] + type + integer + value + 9 + + REZ_SOUND_COLLIDE + + tooltip + Sound played by the object on a collision. [string name, float volume] + type + integer + value + 10 + + REZ_VEL + + tooltip + Initial velocity of rezzed object. [vector vel, integer rel, integer inherit] + type + integer + value + 4 + + ROTATE + + tooltip + Animate texture rotation. + type + integer + value + 0x20 + + SCALE + + tooltip + Animate the texture scale. + type + integer + value + 0x40 + + SCRIPTED + + tooltip + Scripted in-world objects. + type + integer + value + 0x8 + + SIM_STAT_ACTIVE_SCRIPT_COUNT + + tooltip + Number of active scripts. + type + integer + value + 12 + + SIM_STAT_AGENT_COUNT + + tooltip + Number of agents in region. + type + integer + value + 10 + + SIM_STAT_AGENT_MS + + tooltip + Time spent in 'agent' segment of simulation frame. + type + integer + value + 7 + + SIM_STAT_AGENT_UPDATES + + tooltip + Agent updates per second. + type + integer + value + 2 + + SIM_STAT_AI_MS + + tooltip + Time spent on AI step. + type + integer + value + 26 + + SIM_STAT_ASSET_DOWNLOADS + + tooltip + Pending asset download count. + type + integer + value + 15 + + SIM_STAT_ASSET_UPLOADS + + tooltip + Pending asset upload count. + type + integer + value + 16 + + SIM_STAT_CHILD_AGENT_COUNT + + tooltip + Number of child agents in region. + type + integer + value + 11 + + SIM_STAT_FRAME_MS + + tooltip + Total frame time. + type + integer + value + 3 + + SIM_STAT_IMAGE_MS + + tooltip + Time spent in 'image' segment of simulation frame. + type + integer + value + 8 + + SIM_STAT_IO_PUMP_MS + + tooltip + Pump IO time. + type + integer + value + 24 + + SIM_STAT_NET_MS + + tooltip + Time spent in 'network' segment of simulation frame. + type + integer + value + 4 + + SIM_STAT_OTHER_MS + + tooltip + Time spent in 'other' segment of simulation frame. + type + integer + value + 5 + + SIM_STAT_PACKETS_IN + + tooltip + Packets in per second. + type + integer + value + 13 + + SIM_STAT_PACKETS_OUT + + tooltip + Packets out per second. + type + integer + value + 14 + + SIM_STAT_PCT_CHARS_STEPPED + + tooltip + Returns the % of pathfinding characters skipped each frame, averaged over the last minute.\nThe returned value corresponds to the "Characters Updated" stat in the viewer's Statistics Bar. + type + integer + value + 0 + + SIM_STAT_PHYSICS_FPS + + tooltip + Physics simulation FPS. + type + integer + value + 1 + + SIM_STAT_PHYSICS_MS + + tooltip + Time spent in 'physics' segment of simulation frame. + type + integer + value + 6 + + SIM_STAT_PHYSICS_OTHER_MS + + tooltip + Physics other time. + type + integer + value + 20 + + SIM_STAT_PHYSICS_SHAPE_MS + + tooltip + Physics shape update time. + type + integer + value + 19 + + SIM_STAT_PHYSICS_STEP_MS + + tooltip + Physics step time. + type + integer + value + 18 + + SIM_STAT_SCRIPT_EPS + + tooltip + Script events per second. + type + integer + value + 21 + + SIM_STAT_SCRIPT_MS + + tooltip + Time spent in 'script' segment of simulation frame. + type + integer + value + 9 + + SIM_STAT_SCRIPT_RUN_PCT + + tooltip + Percent of scripts run during frame. + type + integer + value + 25 + + SIM_STAT_SLEEP_MS + + tooltip + Time spent sleeping. + type + integer + value + 23 + + SIM_STAT_SPARE_MS + + tooltip + Spare time left after frame. + type + integer + value + 22 + + SIM_STAT_UNACKED_BYTES + + tooltip + Total unacknowledged bytes. + type + integer + value + 17 + + SIT_FLAG_ALLOW_UNSIT + + tooltip + The prim allows a seated avatar to stand up. + type + integer + value + 0x0002 + + SIT_FLAG_NO_COLLIDE + + tooltip + The seated avatar's hit box is disabled when seated on this prim. + type + integer + value + 0x0010 + + SIT_FLAG_NO_DAMAGE + + tooltip + Damage will not be forwarded to an avatar seated on this prim. + type + integer + value + 0x0020 + + SIT_FLAG_SCRIPTED_ONLY + + tooltip + An avatar may not manually sit on this prim. + type + integer + value + 0x0004 + + SIT_FLAG_SIT_TARGET + + tooltip + The prim has an explicitly set sit target. + type + integer + value + 0x0001 + + SIT_INVALID_AGENT + + tooltip + Avatar ID did not specify a valid avatar. + type + integer + value + -4 + + SIT_INVALID_LINK + + tooltip + Link ID did not specify a valid prim in the linkset or resolved to multiple prims. + type + integer + value + -5 + + SIT_INVALID_OBJECT + + tooltip + Attempt to force an avatar to sit on an attachment or other invalid target. + type + integer + value + -7 + + SIT_NOT_EXPERIENCE + + tooltip + Attempt to force an avatar to sit outside an experience. + type + integer + value + -1 + + SIT_NO_ACCESS + + tooltip + Avatar does not have access to the parcel containing the target linkset of the forced sit. + type + integer + value + -6 + + SIT_NO_EXPERIENCE_PERMISSION + + tooltip + Avatar has not granted permission to force sits. + type + integer + value + -2 + + SIT_NO_SIT_TARGET + + tooltip + No available sit target in linkset for forced sit. + type + integer + value + -3 + + SKY_AMBIENT + + tooltip + The ambient color of the environment + type + integer + value + 0 + + SKY_BLUE + + tooltip + Blue settings for environment + type + integer + value + 22 + + SKY_CLOUDS + + tooltip + Settings controlling cloud density and configuration + type + integer + value + 2 + + SKY_CLOUD_TEXTURE + + tooltip + Texture ID used by clouds + type + integer + value + 19 + + SKY_DOME + + tooltip + Sky dome information. + type + integer + value + 4 + + SKY_GAMMA + + tooltip + The gamma value applied to the scene. + type + integer + value + 5 + + SKY_GLOW + + tooltip + Glow color applied to the sun and moon. + type + integer + value + 6 + + SKY_HAZE + + tooltip + Haze settings for environment + type + integer + value + 23 + + SKY_LIGHT + + tooltip + Miscellaneous lighting values. + type + integer + value + 8 + + SKY_MOON + + tooltip + Environmental moon details. + type + integer + value + 9 + + SKY_MOON_TEXTURE + + tooltip + Environmental moon texture. + type + integer + value + 20 + + SKY_PLANET + + tooltip + Planet information used in rendering the sky. + type + integer + value + 10 + + SKY_REFLECTION_PROBE_AMBIANCE + + tooltip + Settings the ambience of the reflection probe. + type + integer + value + 24 + + SKY_REFRACTION + + tooltip + Sky refraction parameters for rainbows and optical effects. + type + integer + value + 11 + + SKY_STAR_BRIGHTNESS + + tooltip + Brightness value for the stars. + type + integer + value + 13 + + SKY_SUN + + tooltip + Detailed sun information + type + integer + value + 14 + + SKY_SUN_TEXTURE + + tooltip + Environmental sun texture + type + integer + value + 21 + + SKY_TEXTURE_DEFAULTS + + tooltip + Is the environment using the default textures. + type + integer + value + 1 + + SKY_TRACKS + + tooltip + Track elevations for this region. + type + integer + value + 15 + + SMOOTH + + tooltip + Slide in the X direction, instead of playing separate frames. + type + integer + value + 0x10 + + SOUND_LOOP + + tooltip + Sound will loop until stopped. + type + integer + value + 0x01 + + SOUND_PLAY + + tooltip + Sound will play normally. + type + integer + value + 0x00 + + SOUND_SYNC + + tooltip + Sound will be synchronized with the nearest master. + type + integer + value + 0x04 + + SOUND_TRIGGER + + tooltip + Sound will be triggered at the prim's location and not attached. + type + integer + value + 0x02 + + SQRT2 + + tooltip + 1.41421356 - The square root of 2. + type + float + value + 1.41421356 + + STATUS_BLOCK_GRAB + + tooltip + Controls whether the object can be grabbed.\nA grab is the default action when in third person, and is available as the hand tool in build mode. This is useful for physical objects that you don't want other people to be able to trivially disturb. The default is FALSE + type + integer + value + 0x40 + + STATUS_BLOCK_GRAB_OBJECT + + tooltip + Prevent click-and-drag movement on all prims in the object. + type + integer + value + 0x400 + + STATUS_BOUNDS_ERROR + + tooltip + Argument(s) passed to function had a bounds error. + type + integer + value + 1002 + + STATUS_CAST_SHADOWS + + tooltip + + type + integer + value + 0x200 + + STATUS_DIE_AT_EDGE + + tooltip + Controls whether the object is returned to the owners inventory if it wanders off the edge of the world.\nIt is useful to set this status TRUE for things like bullets or rockets. The default is TRUE + type + integer + value + 0x80 + + STATUS_DIE_AT_NO_ENTRY + + tooltip + Controls whether the object dies if it attempts to enter a parcel that does not allow object entry or does not have enough capacity.\nIt is useful to set this status TRUE for things like bullets or rockets. The default is FALSE + type + integer + value + 0x800 + + STATUS_INTERNAL_ERROR + + tooltip + An internal error occurred. + type + integer + value + 1999 + + STATUS_MALFORMED_PARAMS + + tooltip + Function was called with malformed parameters. + type + integer + value + 1000 + + STATUS_NOT_FOUND + + tooltip + Object or other item was not found. + type + integer + value + 1003 + + STATUS_NOT_SUPPORTED + + tooltip + Feature not supported. + type + integer + value + 1004 + + STATUS_OK + + tooltip + Result of function call was a success. + type + integer + value + 0 + + STATUS_PHANTOM + + tooltip + Controls/indicates whether the object collides or not.\nSetting the value to TRUE makes the object non-colliding with all objects. It is a good idea to use this for most objects that move or rotate, but are non-physical. It is also useful for simulating volumetric lighting. The default is FALSE. + type + integer + value + 0x10 + + STATUS_PHYSICS + + tooltip + Controls/indicates whether the object moves physically.\nThis controls the same flag that the UI check-box for Physical controls. The default is FALSE. + type + integer + value + 0x1 + + STATUS_RETURN_AT_EDGE + + tooltip + + type + integer + value + 0x100 + + STATUS_ROTATE_X + + tooltip + + type + integer + value + 0x2 + + STATUS_ROTATE_Y + + tooltip + + type + integer + value + 0x4 + + STATUS_ROTATE_Z + + tooltip + + Controls/indicates whether the object can physically rotate around + the specific axis or not. This flag has no meaning + for non-physical objects. Set the value to FALSE + if you want to disable rotation around that axis. The + default is TRUE for a physical object. + A useful example to think about when visualizing + the effect is a sit-and-spin device. They spin around the + Z axis (up) but not around the X or Y axis. + + type + integer + value + 0x8 + + STATUS_SANDBOX + + tooltip + + Controls/indicates whether the object can cross region boundaries + and move more than 20 meters from its creation + point. The default if FALSE. + + type + integer + value + 0x20 + + STATUS_TYPE_MISMATCH + + tooltip + Argument(s) passed to function had a type mismatch. + type + integer + value + 1001 + + STATUS_WHITELIST_FAILED + + tooltip + Whitelist Failed. + type + integer + value + 2001 + + STRING_TRIM + + tooltip + + type + integer + value + 0x03 + + STRING_TRIM_HEAD + + tooltip + + type + integer + value + 0x01 + + STRING_TRIM_TAIL + + tooltip + + type + integer + value + 0x02 + + TARGETED_EMAIL_OBJECT_OWNER + + tooltip + Send email to the owner of the object + type + integer + value + 0x02 + + TARGETED_EMAIL_ROOT_CREATOR + + tooltip + Send email to the creator of the root object + type + integer + value + 0x01 + + TERRAIN_DETAIL_1 + + tooltip + + type + integer + value + 0 + + TERRAIN_DETAIL_2 + + tooltip + + type + integer + value + 1 + + TERRAIN_DETAIL_3 + + tooltip + + type + integer + value + 2 + + TERRAIN_DETAIL_4 + + tooltip + + type + integer + value + 3 + + TERRAIN_HEIGHT_RANGE_NE + + tooltip + + type + integer + value + 7 + + TERRAIN_HEIGHT_RANGE_NW + + tooltip + + type + integer + value + 6 + + TERRAIN_HEIGHT_RANGE_SE + + tooltip + + type + integer + value + 5 + + TERRAIN_HEIGHT_RANGE_SW + + tooltip + + type + integer + value + 4 + + TERRAIN_PBR_OFFSET_1 + + tooltip + + type + integer + value + 16 + + TERRAIN_PBR_OFFSET_2 + + tooltip + + type + integer + value + 17 + + TERRAIN_PBR_OFFSET_3 + + tooltip + + type + integer + value + 18 + + TERRAIN_PBR_OFFSET_4 + + tooltip + + type + integer + value + 19 + + TERRAIN_PBR_ROTATION_1 + + tooltip + + type + integer + value + 12 + + TERRAIN_PBR_ROTATION_2 + + tooltip + + type + integer + value + 13 + + TERRAIN_PBR_ROTATION_3 + + tooltip + + type + integer + value + 14 + + TERRAIN_PBR_ROTATION_4 + + tooltip + + type + integer + value + 15 + + TERRAIN_PBR_SCALE_1 + + tooltip + + type + integer + value + 8 + + TERRAIN_PBR_SCALE_2 + + tooltip + + type + integer + value + 9 + + TERRAIN_PBR_SCALE_3 + + tooltip + + type + integer + value + 10 + + TERRAIN_PBR_SCALE_4 + + tooltip + + type + integer + value + 11 + + TEXTURE_BLANK + + tooltip + + type + string + value + 5748decc-f629-461c-9a36-a35a221fe21f + + TEXTURE_DEFAULT + + tooltip + + type + string + value + 89556747-24cb-43ed-920b-47caed15465f + + TEXTURE_MEDIA + + tooltip + + type + string + value + 8b5fec65-8d8d-9dc5-cda8-8fdf2716e361 + + TEXTURE_PLYWOOD + + tooltip + + type + string + value + 89556747-24cb-43ed-920b-47caed15465f + + TEXTURE_TRANSPARENT + + tooltip + + type + string + value + 8dcd4a48-2d37-4909-9f78-f7a9eb4ef903 + + TOUCH_INVALID_FACE + + tooltip + + type + integer + value + -1 + + TOUCH_INVALID_TEXCOORD + + tooltip + + type + vector + value + <-1.0, -1.0, 0.0> + + TOUCH_INVALID_VECTOR + + tooltip + + type + vector + value + <0.0, 0.0, 0.0> + + TP_ROUTING_BLOCKED + + tooltip + Direct teleporting is blocked on this parcel. + type + integer + value + 0 + + TP_ROUTING_FREE + + tooltip + Teleports are unrestricted on this parcel. + type + integer + value + 2 + + TP_ROUTING_LANDINGP + + tooltip + Teleports are routed to a landing point if set on this parcel. + type + integer + value + 1 + + TRANSFER_BAD_OPTS + + tooltip + Invalid inventory options. + type + integer + value + -1 + + TRANSFER_BAD_ROOT + + tooltip + The root path specified in TRANSFER_DEST contained an invalid directory or was reduced to nothing. + type + integer + value + -5 + + TRANSFER_DEST + + tooltip + The root folder to transfer inventory into. + type + integer + value + 0 + + TRANSFER_FLAGS + + tooltip + Flags to control the behavior of inventory transfer. + type + integer + value + 1 + + TRANSFER_FLAG_COPY + + tooltip + Gives a copy of the object being transfered. Implies TRANSFER_FLAG_TAKE. + type + integer + value + 0x0004 + + TRANSFER_FLAG_RESERVED + + tooltip + Reserved for future expansion. + type + integer + value + 0x0001 + + TRANSFER_FLAG_TAKE + + tooltip + On a successful transfer, automatically takes the object into inventory. + type + integer + value + 0x0002 + + TRANSFER_NO_ATTACHMENT + + tooltip + Can not transfer ownership of an attached object. + type + integer + value + -7 + + TRANSFER_NO_ITEMS + + tooltip + No items in the inventory list are eligible for transfer. + type + integer + value + -4 + + TRANSFER_NO_PERMS + + tooltip + The object does not have transfer permissions. + type + integer + value + -6 + + TRANSFER_NO_TARGET + + tooltip + Could not find the receiver in the current region. + type + integer + value + -2 + + TRANSFER_OK + + tooltip + Inventory transfer offer was successfully made. + type + integer + value + 0 + + TRANSFER_THROTTLE + + tooltip + Inventory throttle hit. + type + integer + value + -3 + + TRAVERSAL_TYPE + + tooltip + One of TRAVERSAL_TYPE_FAST, TRAVERSAL_TYPE_SLOW, and TRAVERSAL_TYPE_NONE. + type + integer + value + 7 + + TRAVERSAL_TYPE_FAST + + tooltip + + type + integer + value + 1 + + TRAVERSAL_TYPE_NONE + + tooltip + + type + integer + value + 2 + + TRAVERSAL_TYPE_SLOW + + tooltip + + type + integer + value + 0 + + TRUE + + tooltip + An integer constant for boolean comparisons. Has the value '1'. + type + integer + value + 1 + + TWO_PI + + tooltip + 6.28318530 - The radians of a circle. + type + float + value + 6.28318530 + + TYPE_FLOAT + + tooltip + The list entry is a float. + type + integer + value + 2 + + TYPE_INTEGER + + tooltip + The list entry is an integer. + type + integer + value + 1 + + TYPE_INVALID + + tooltip + The list entry is invalid. + type + integer + value + 0 + + TYPE_KEY + + tooltip + The list entry is a key. + type + integer + value + 4 + + TYPE_ROTATION + + tooltip + The list entry is a rotation. + type + integer + value + 6 + + TYPE_STRING + + tooltip + The list entry is a string. + type + integer + value + 3 + + TYPE_VECTOR + + tooltip + The list entry is a vector. + type + integer + value + 5 + + URL_REQUEST_DENIED + + tooltip + + type + string + value + URL_REQUEST_DENIED + + URL_REQUEST_GRANTED + + tooltip + + type + string + value + URL_REQUEST_GRANTED + + VEHICLE_ANGULAR_DEFLECTION_EFFICIENCY + + tooltip + A slider between minimum (0.0) and maximum (1.0) deflection of angular orientation. That is, its a simple scalar for modulating the strength of angular deflection such that the vehicles preferred axis of motion points toward its real velocity. + type + integer + value + 32 + + VEHICLE_ANGULAR_DEFLECTION_TIMESCALE + + tooltip + The time-scale for exponential success of linear deflection deflection. Its another way to specify the strength of the vehicles tendency to reorient itself so that its preferred axis of motion agrees with its true velocity. + type + integer + value + 33 + + VEHICLE_ANGULAR_FRICTION_TIMESCALE + + tooltip + + A vector of timescales for exponential decay of the vehicles angular velocity about its preferred axes of motion (at, left, up). + Range = [0.07, inf) seconds for each element of the vector. + + type + integer + value + 17 + + VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE + + tooltip + The timescale for exponential decay of the angular motors magnitude. + type + integer + value + 35 + + VEHICLE_ANGULAR_MOTOR_DIRECTION + + tooltip + The direction and magnitude (in preferred frame) of the vehicles angular motor.The vehicle will accelerate (or decelerate if necessary) to match its velocity to its motor. + type + integer + value + 19 + + VEHICLE_ANGULAR_MOTOR_TIMESCALE + + tooltip + The timescale for exponential approach to full angular motor velocity. + type + integer + value + 34 + + VEHICLE_BANKING_EFFICIENCY + + tooltip + A slider between anti (-1.0), none (0.0), and maxmum (1.0) banking strength. + type + integer + value + 38 + + VEHICLE_BANKING_MIX + + tooltip + A slider between static (0.0) and dynamic (1.0) banking. "Static" means the banking scales only with the angle of roll, whereas "dynamic" is a term that also scales with the vehicles linear speed. + type + integer + value + 39 + + VEHICLE_BANKING_TIMESCALE + + tooltip + The timescale for banking to exponentially approach its maximum effect. This is another way to scale the strength of the banking effect, however it affects the term that is proportional to the difference between what the banking behavior is trying to do, and what the vehicle is actually doing. + type + integer + value + 40 + + VEHICLE_BUOYANCY + + tooltip + A slider between minimum (0.0) and maximum anti-gravity (1.0). + type + integer + value + 27 + + VEHICLE_FLAG_BLOCK_INTERFERENCE + + tooltip + Prevent other scripts from pushing vehicle. + type + integer + value + 0x400 + + VEHICLE_FLAG_CAMERA_DECOUPLED + + tooltip + + type + integer + value + 0x200 + + VEHICLE_FLAG_HOVER_GLOBAL_HEIGHT + + tooltip + Hover at global height. + type + integer + value + 0x10 + + VEHICLE_FLAG_HOVER_TERRAIN_ONLY + + tooltip + Ignore water height when hovering. + type + integer + value + 0x8 + + VEHICLE_FLAG_HOVER_UP_ONLY + + tooltip + Hover does not push down. Use this flag for hovering vehicles that should be able to jump above their hover height. + type + integer + value + 0x20 + + VEHICLE_FLAG_HOVER_WATER_ONLY + + tooltip + Ignore terrain height when hovering. + type + integer + value + 0x4 + + VEHICLE_FLAG_LIMIT_MOTOR_UP + + tooltip + Prevents ground vehicles from motoring into the sky. + type + integer + value + 0x40 + + VEHICLE_FLAG_LIMIT_ROLL_ONLY + + tooltip + For vehicles with vertical attractor that want to be able to climb/dive, for instance, aeroplanes that want to use the banking feature. + type + integer + value + 0x2 + + VEHICLE_FLAG_MOUSELOOK_BANK + + tooltip + + type + integer + value + 0x100 + + VEHICLE_FLAG_MOUSELOOK_STEER + + tooltip + + type + integer + value + 0x80 + + VEHICLE_FLAG_NO_DEFLECTION_UP + + tooltip + This flag prevents linear deflection parallel to world z-axis. This is useful for preventing ground vehicles with large linear deflection, like bumper cars, from climbing their linear deflection into the sky. + type + integer + value + 0x1 + + VEHICLE_FLAG_NO_FLY_UP + + deprecated + 1 + tooltip + Old, changed to VEHICLE_FLAG_NO_DEFLECTION_UP + type + integer + value + 0x1 + + VEHICLE_HOVER_EFFICIENCY + + tooltip + A slider between minimum (0.0 = bouncy) and maximum (1.0 = fast as possible) damped motion of the hover behavior. + type + integer + value + 25 + + VEHICLE_HOVER_HEIGHT + + tooltip + The height (above the terrain or water, or global) at which the vehicle will try to hover. + type + integer + value + 24 + + VEHICLE_HOVER_TIMESCALE + + tooltip + Period of time (in seconds) for the vehicle to achieve its hover height. + type + integer + value + 26 + + VEHICLE_LINEAR_DEFLECTION_EFFICIENCY + + tooltip + A slider between minimum (0.0) and maximum (1.0) deflection of linear velocity. That is, its a simple scalar for modulating the strength of linear deflection. + type + integer + value + 28 + + VEHICLE_LINEAR_DEFLECTION_TIMESCALE + + tooltip + The timescale for exponential success of linear deflection deflection. It is another way to specify how much time it takes for the vehicles linear velocity to be redirected to its preferred axis of motion. + type + integer + value + 29 + + VEHICLE_LINEAR_FRICTION_TIMESCALE + + tooltip + + A vector of timescales for exponential decay of the vehicles linear velocity along its preferred axes of motion (at, left, up). + Range = [0.07, inf) seconds for each element of the vector. + + type + integer + value + 16 + + VEHICLE_LINEAR_MOTOR_DECAY_TIMESCALE + + tooltip + The timescale for exponential decay of the linear motors magnitude. + type + integer + value + 31 + + VEHICLE_LINEAR_MOTOR_DIRECTION + + tooltip + + The direction and magnitude (in preferred frame) of the vehicles linear motor. The vehicle will accelerate (or decelerate if necessary) to match its velocity to its motor. + Range of magnitude = [0, 30] meters/second. + + type + integer + value + 18 + + VEHICLE_LINEAR_MOTOR_OFFSET + + tooltip + + type + integer + value + 20 + + VEHICLE_LINEAR_MOTOR_TIMESCALE + + tooltip + The timescale for exponential approach to full linear motor velocity. + type + integer + value + 30 + + VEHICLE_REFERENCE_FRAME + + tooltip + A rotation of the vehicles preferred axes of motion and orientation (at, left, up) with respect to the vehicles local frame (x, y, z). + type + integer + value + 44 + + VEHICLE_TYPE_AIRPLANE + + tooltip + Uses linear deflection for lift, no hover, and banking to turn.\nSee http://wiki.secondlife.com/wiki/VEHICLE_TYPE_AIRPLANE + type + integer + value + 4 + + VEHICLE_TYPE_BALLOON + + tooltip + Hover, and friction, but no deflection.\nSee http://wiki.secondlife.com/wiki/VEHICLE_TYPE_BALLOON + type + integer + value + 5 + + VEHICLE_TYPE_BOAT + + tooltip + Hovers over water with lots of friction and some anglar deflection.\nSee http://wiki.secondlife.com/wiki/VEHICLE_TYPE_BOAT + type + integer + value + 3 + + VEHICLE_TYPE_CAR + + tooltip + Another vehicle that bounces along the ground but needs the motors to be driven from external controls or timer events.\nSee http://wiki.secondlife.com/wiki/VEHICLE_TYPE_CAR + type + integer + value + 2 + + VEHICLE_TYPE_NONE + + tooltip + + type + integer + value + 0 + + VEHICLE_TYPE_SLED + + tooltip + Simple vehicle that bumps along the ground, and likes to move along its local x-axis.\nSee http://wiki.secondlife.com/wiki/VEHICLE_TYPE_SLED + type + integer + value + 1 + + VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY + + tooltip + A slider between minimum (0.0 = wobbly) and maximum (1.0 = firm as possible) stability of the vehicle to keep itself upright. + type + integer + value + 36 + + VEHICLE_VERTICAL_ATTRACTION_TIMESCALE + + tooltip + The period of wobble, or timescale for exponential approach, of the vehicle to rotate such that its preferred "up" axis is oriented along the worlds "up" axis. + type + integer + value + 37 + + VERTICAL + + tooltip + + type + integer + value + 0 + + WANDER_PAUSE_AT_WAYPOINTS + + tooltip + + type + integer + value + 0 + + WATER_BLUR_MULTIPLIER + + tooltip + Blur factor. + type + integer + value + 100 + + WATER_FOG + + tooltip + Fog properties when underwater. + type + integer + value + 101 + + WATER_FRESNEL + + tooltip + Fresnel scattering applied to the surface of the water. + type + integer + value + 102 + + WATER_NORMAL_SCALE + + tooltip + Scaling applied to the water normal map. + type + integer + value + 104 + + WATER_NORMAL_TEXTURE + + tooltip + Normal map used for environmental waves. + type + integer + value + 107 + + WATER_REFRACTION + + tooltip + Refraction factors when looking through the surface of the water. + type + integer + value + 105 + + WATER_TEXTURE_DEFAULTS + + tooltip + Is the environment using the default wave map. + type + integer + value + 103 + + WATER_WAVE_DIRECTION + + tooltip + Vectors for the directions of the waves. + type + integer + value + 106 + + XP_ERROR_EXPERIENCES_DISABLED + + tooltip + The region currently has experiences disabled. + type + integer + value + 2 + + XP_ERROR_EXPERIENCE_DISABLED + + tooltip + The experience owner has temporarily disabled the experience. + type + integer + value + 8 + + XP_ERROR_EXPERIENCE_SUSPENDED + + tooltip + The experience has been suspended by Linden Customer Support. + type + integer + value + 9 + + XP_ERROR_INVALID_EXPERIENCE + + tooltip + The script is associated with an experience that no longer exists. + type + integer + value + 7 + + XP_ERROR_INVALID_PARAMETERS + + tooltip + One of the string arguments was too big to fit in the key-value store. + type + integer + value + 3 + + XP_ERROR_KEY_NOT_FOUND + + tooltip + The requested key does not exist. + type + integer + value + 14 + + XP_ERROR_MATURITY_EXCEEDED + + tooltip + The content rating of the experience exceeds that of the region. + type + integer + value + 16 + + XP_ERROR_NONE + + tooltip + No error was detected. + type + integer + value + 0 + + XP_ERROR_NOT_FOUND + + tooltip + The sim was unable to verify the validity of the experience. Retrying after a short wait is advised. + type + integer + value + 6 + + XP_ERROR_NOT_PERMITTED + + tooltip + This experience is not allowed to run by the requested agent. + type + integer + value + 4 + + XP_ERROR_NOT_PERMITTED_LAND + + tooltip + This experience is not allowed to run on the current region. + type + integer + value + 17 + + XP_ERROR_NO_EXPERIENCE + + tooltip + This script is not associated with an experience. + type + integer + value + 5 + + XP_ERROR_QUOTA_EXCEEDED + + tooltip + An attempted write data to the key-value store failed due to the data quota being met. + type + integer + value + 11 + + XP_ERROR_REQUEST_PERM_TIMEOUT + + tooltip + Request timed out; permissions not modified. + type + integer + value + 18 + + XP_ERROR_RETRY_UPDATE + + tooltip + A checked update failed due to an out of date request. + type + integer + value + 15 + + XP_ERROR_STORAGE_EXCEPTION + + tooltip + Unable to communicate with the key-value store. + type + integer + value + 13 + + XP_ERROR_STORE_DISABLED + + tooltip + The key-value store is currently disabled on this region. + type + integer + value + 12 + + XP_ERROR_THROTTLED + + tooltip + The call failed due to too many recent calls. + type + integer + value + 1 + + XP_ERROR_UNKNOWN_ERROR + + tooltip + Other unknown error. + type + integer + value + 10 + + ZERO_ROTATION + + tooltip + + type + rotation + value + <0.0, 0.0, 0.0, 1.0> + + ZERO_VECTOR + + tooltip + + type + vector + value + <0.0, 0.0, 0.0> + + default + + tooltip + + All scripts must have a default state, which is the first state entered when the script starts. + If another state is defined before the default state, the compiler will report a syntax error. + + + + events + + at_rot_target + + arguments + + + TargetNumber + + tooltip + + type + integer + + + + TargetRotation + + tooltip + + type + rotation + + + + CurrentRotation + + tooltip + + type + rotation + + + + tooltip + This event is triggered when a script comes within a defined angle of a target rotation. The range and rotation, are set by a call to llRotTarget. + + at_target + + arguments + + + TargetNumber + + tooltip + + type + integer + + + + TargetPosition + + tooltip + + type + vector + + + + CurrentPosition + + tooltip + + type + vector + + + + tooltip + This event is triggered when the scripted object comes within a defined range of the target position, defined by the llTarget function call. + + attach + + arguments + + + AvatarID + + tooltip + + type + key + + + + tooltip + This event is triggered whenever an object is attached or detached from an avatar. If it is attached, the key of the avatar it is attached to is passed in, otherwise NULL_KEY is. + + changed + + arguments + + + Changed + + tooltip + + type + integer + + + + tooltip + Triggered when various events change the object. The change argument will be a bit-field of CHANGED_* constants. + + collision + + arguments + + + NumberOfCollisions + + tooltip + + type + integer + + + + tooltip + + This event is raised while another object, or avatar, is colliding with the object the script is attached to. + The number of detected objects is passed to the script. Information on those objects may be gathered via the llDetected* functions. + + + collision_end + + arguments + + + NumberOfCollisions + + tooltip + + type + integer + + + + tooltip + + This event is raised when another object, or avatar, stops colliding with the object the script is attached to. + The number of detected objects is passed to the script. Information on those objects may be gathered via the llDetected* library functions. + + + collision_start + + arguments + + + NumberOfCollisions + + tooltip + + type + integer + + + + tooltip + + This event is raised when another object, or avatar, starts colliding with the object the script is attached to. + The number of detected objects is passed to the script. Information on those objects may be gathered via the llDetected* library functions. + + + control + + arguments + + + AvatarID + + tooltip + + type + key + + + + Levels + + tooltip + + type + integer + + + + Edges + + tooltip + + type + integer + + + + tooltip + + Once a script has the ability to grab control inputs from the avatar, this event will be used to pass the commands into the script. + The levels and edges are bit-fields of control constants. + + + dataserver + + arguments + + + RequestID + + tooltip + + type + key + + + + Data + + tooltip + + type + string + + + + tooltip + + This event is triggered when the requested data is returned to the script. + Data may be requested by the llRequestAgentData, llRequestInventoryData, and llGetNotecardLine function calls, for example. + + + email + + arguments + + + Time + + tooltip + + type + string + + + + Address + + tooltip + + type + string + + + + Subject + + tooltip + + type + string + + + + Body + + tooltip + + type + string + + + + NumberRemaining + + tooltip + + type + integer + + + + tooltip + + This event is triggered when an email sent to this script arrives. + The number remaining tells how many more emails are known to be still pending. + + + experience_permissions + + arguments + + + agent_id + + tooltip + ID of the agent approving permission for the Experience. + type + key + + + + tooltip + Triggered when an agent has approved an experience permissions request. + + experience_permissions_denied + + arguments + + + agent_id + + tooltip + ID of the agent denying permission for the Experience. + type + key + + + + Reason + + tooltip + One of the XP_ERROR_... constants describing the reason why the Experience permissions were denied for the agent. + type + integer + + + + tooltip + Describes why the Experience permissions were denied for the agent. + + final_damage + + arguments + + + count + + tooltip + The number of damage events queued. + type + integer + + + + tooltip + Triggered as damage is applied to an avatar or task, after all on_damage events have been processed. + + game_control + + arguments + + + id + + tooltip + UUID of avatar supplying input + type + key + + + + buttons + + tooltip + 32-bit mask of buttons pressed + type + integer + + + + axes + + tooltip + Six float values in range [-1, 1] + type + list + + + + tooltip + This event is raised when game controller input changes. + + http_request + + arguments + + + HTTPRequestID + + tooltip + + type + key + + + + HTTPMethod + + tooltip + + type + string + + + + Body + + tooltip + + type + string + + + + tooltip + Triggered when task receives an HTTP request. + + http_response + + arguments + + + HTTPRequestID + + tooltip + + type + key + + + + Status + + tooltip + + type + integer + + + + Metadata + + tooltip + + type + list + + + + Body + + tooltip + + type + string + + + + tooltip + This event handler is invoked when an HTTP response is received for a pending llHTTPRequest request or if a pending request fails or times out. + + land_collision + + arguments + + + Position + + tooltip + + type + vector + + + + tooltip + This event is raised when the object the script is attached to is colliding with the ground. + + land_collision_end + + arguments + + + Position + + tooltip + + type + vector + + + + tooltip + This event is raised when the object the script is attached to stops colliding with the ground. + + land_collision_start + + arguments + + + Position + + tooltip + + type + vector + + + + tooltip + This event is raised when the object the script is attached to begins to collide with the ground. + + link_message + + arguments + + + SendersLink + + tooltip + + type + integer + + + + Value + + tooltip + + type + integer + + + + Text + + tooltip + + type + string + + + + ID + + tooltip + + type + key + + + + tooltip + Triggered when object receives a link message via llMessageLinked function call. + + linkset_data + + arguments + + + action + + tooltip + + type + integer + + + + name + + tooltip + + type + string + + + + value + + tooltip + + type + string + + + + tooltip + Triggered when a script modifies the linkset datastore. + + listen + + arguments + + + Channel + + tooltip + + type + integer + + + + Name + + tooltip + + type + string + + + + ID + + tooltip + + type + key + + + + Text + + tooltip + + type + string + + + + tooltip + + This event is raised whenever a chat message matching the constraints set in the llListen command is received. The name and ID of the speaker, as well as the message, are passed in as parameters. + Channel 0 is the public chat channel that all avatars see as chat text. Channels 1 through 2,147,483,648 are private channels that are not sent to avatars but other scripts can listen on those channels. + + + money + + arguments + + + Payer + + tooltip + + type + key + + + + Amount + + tooltip + + type + integer + + + + tooltip + This event is triggered when a resident has given an amount of Linden dollars to the object. + + moving_end + + arguments + + tooltip + Triggered whenever an object with this script stops moving. + + moving_start + + arguments + + tooltip + Triggered whenever an object with this script starts moving. + + no_sensor + + arguments + + tooltip + This event is raised when sensors are active, via the llSensor function call, but are not sensing anything. + + not_at_rot_target + + arguments + + tooltip + When a target is set via the llRotTarget function call, but the script is outside the specified angle this event is raised. + + not_at_target + + arguments + + tooltip + When a target is set via the llTarget library call, but the script is outside the specified range this event is raised. + + object_rez + + arguments + + + RezzedObjectsID + + tooltip + + type + key + + + + tooltip + Triggered when an object rezzes another object from its inventory via the llRezObject, or similar, functions. The id is the globally unique key for the object rezzed. + + on_damage + + arguments + + + count + + tooltip + The number of damage events queued. + type + integer + + + + tooltip + Triggered when an avatar or object receives damage. + + on_death + + arguments + + tooltip + Triggered when an avatar reaches 0 health. + + on_rez + + arguments + + + StartParameter + + tooltip + + type + integer + + + + tooltip + Triggered whenever an object is rezzed from inventory or by another object. The start parameter is passed in from the llRezObject call, or zero if from inventory. + + path_update + + arguments + + + Type + + tooltip + + type + integer + + + + Reserved + + tooltip + + type + list + + + + tooltip + This event is called to inform the script of changes within the object's path-finding status. + + remote_data + + arguments + + + EventType + + tooltip + + type + integer + + + + ChannelID + + tooltip + + type + key + + + + MessageID + + tooltip + + type + key + + + + Sender + + tooltip + + type + string + + + + IData + + tooltip + + type + integer + + + + SData + + tooltip + + type + string + + + + tooltip + This event is deprecated. + + run_time_permissions + + arguments + + + PermissionFlags + + tooltip + + type + integer + + + + tooltip + + Scripts need permission from either the owner or the avatar they wish to act on before they may perform certain functions, such as debiting money from their owners account, triggering an animation on an avatar, or capturing control inputs. The llRequestPermissions library function is used to request these permissions and the various permissions integer constants can be supplied. + The integer returned to this event handler contains the current set of permissions flags, so if permissions equal 0 then no permissions are set. + + + sensor + + arguments + + + NumberDetected + + tooltip + + type + integer + + + + tooltip + + This event is raised whenever objects matching the constraints of the llSensor command are detected. + The number of detected objects is passed to the script in the parameter. Information on those objects may be gathered via the llDetected* functions. + + + state_entry + + arguments + + tooltip + The state_entry event occurs whenever a new state is entered, including at program start, and is always the first event handled. + + state_exit + + arguments + + tooltip + The state_exit event occurs whenever the state command is used to transition to another state. It is handled before the new states state_entry event. + + timer + + arguments + + tooltip + This event is raised at regular intervals set by the llSetTimerEvent library function. + + touch + + arguments + + + NumberOfTouches + + tooltip + + type + integer + + + + tooltip + + This event is raised while a user is touching the object the script is attached to. + The number of touching objects is passed to the script in the parameter. + Information on those objects may be gathered via the llDetected* library functions. + + + touch_end + + arguments + + + NumberOfTouches + + tooltip + + type + integer + + + + tooltip + + This event is raised when a user stops touching the object the script is attached to. The number of touches is passed to the script in the parameter. + Information on those objects may be gathered via the llDetected* library functions. + + + touch_start + + arguments + + + NumberOfTouches + + tooltip + + type + integer + + + + tooltip + + This event is raised when a user first touches the object the script is attached to. The number of touches is passed to the script in the parameter. + Information on those objects may be gathered via the llDetected() library functions. + + + transaction_result + + arguments + + + RequestID + + tooltip + + type + key + + + + Success + + tooltip + + type + integer + + + + Message + + tooltip + + type + string + + + + tooltip + Triggered by llTransferMoney() function. + + + functions + + llAbs + + arguments + + + Value + + tooltip + An integer value. + type + integer + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the absolute (positive) version of Value. + + llAcos + + arguments + + + Value + + tooltip + A floating-point value. + type + float + + + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the arc-cosine of Value, in radians. + + llAddToLandBanList + + arguments + + + ID + + tooltip + Agent UUID to add to ban-list. + type + key + + + + Hours + + tooltip + Period, in hours, to ban the avatar for. + type + float + + + + energy + 10 + return + void + sleep + 0.1000000000000000055511151 + tooltip + Add avatar ID to the parcel ban list for the specified number of Hours.\nA value of 0 for Hours will add the agent indefinitely.\nThe smallest value that Hours will accept is 0.01; anything smaller will be seen as 0.\nWhen values that small are used, it seems the function bans in approximately 30 second increments (Probably 36 second increments, as 0.01 of an hour is 36 seconds).\nResidents teleporting to a parcel where they are banned will be redirected to a neighbouring parcel. + + llAddToLandPassList + + arguments + + + ID + + tooltip + Agent UUID to add to pass-list. + type + key + + + + Hours + + tooltip + Period, in hours, to allow the avatar for. + type + float + + + + energy + 10 + return + void + sleep + 0.1000000000000000055511151 + tooltip + Add avatar ID to the land pass list, for a duration of Hours. + + llAdjustDamage + + arguments + + + Number + + tooltip + Damage event index to modify. + type + integer + + + + Damage + + tooltip + New damage amount to apply on this event. + type + float + + + + energy + 10 + return + void + sleep + 0 + tooltip + Changes the amount of damage to be delivered by this damage event. + + llAdjustSoundVolume + + arguments + + + Volume + + tooltip + The volume to set. + type + float + + + + energy + 10 + return + void + sleep + 0.1000000000000000055511151 + tooltip + Adjusts the volume (0.0 - 1.0) of the currently playing attached sound.\nThis function has no effect on sounds started with llTriggerSound. + + llAgentInExperience + + arguments + + + AgentID + + tooltip + + type + key + + + + energy + 10 + return + integer + sleep + 0 + tooltip + + Returns TRUE if the agent is in the Experience and the Experience can run in the current location. + + + llAllowInventoryDrop + + arguments + + + Flag + + tooltip + Boolean, If TRUE allows anyone to drop inventory on prim, FALSE revokes. + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + If Flag == TRUE, users without object modify permissions can still drop inventory items into the object. + + llAngleBetween + + arguments + - TargetNumber + Rot1 + + tooltip + First rotation. + type + rotation + + + + Rot2 + + tooltip + Second rotation. + type + rotation + + + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the angle, in radians, between rotations Rot1 and Rot2. + + llApplyImpulse + + arguments + + + Force + + tooltip + Amount of impulse force to apply. + type + vector + + + + Local + tooltip + Boolean, if TRUE, force is treated as a local directional vector instead of region directional vector. type integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Applies impulse to the object.\nIf Local == TRUE, apply the Force in local coordinates; otherwise, apply the Force in global coordinates.\nThis function only works on physical objects. + + llApplyRotationalImpulse + + arguments + + + Force + tooltip - + Amount of impulse force to apply. + type + vector - TargetRotation + Local + tooltip + Boolean, if TRUE, uses local axis, if FALSE, uses region axis. type - rotation + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Applies rotational impulse to the object.\nIf Local == TRUE, apply the Force in local coordinates; otherwise, apply the Force in global coordinates.\nThis function only works on physical objects. + + llAsin + + arguments + + + Value + tooltip - + A floating-point value. + type + float + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the arc-sine, in radians, of Value. + + llAtan2 + + arguments + - CurrentRotation + y + tooltip + A floating-point value. type - rotation + float + + + + x + tooltip - + A floating-point value. + type + float + energy + 10 + return + float + sleep + 0 tooltip - This event is triggered when a script comes within a defined angle of a target rotation. The range and rotation, are set by a call to llRotTarget. + Returns the arc-tangent2 of y, x. - at_target + llAttachToAvatar arguments - TargetNumber + AttachmentPoint + tooltip + type integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Attach to avatar at point AttachmentPoint.\nRequires the PERMISSION_ATTACH runtime permission. + + llAttachToAvatarTemp + + arguments + + + AttachPoint + tooltip - + Valid attachment point or ATTACH_* constant. + type + integer + + energy + 10 + return + void + sleep + 0 + tooltip + Follows the same convention as llAttachToAvatar, with the exception that the object will not create new inventory for the user, and will disappear on detach or disconnect. + + llAvatarOnLinkSitTarget + + arguments + - TargetPosition + LinkNumber + + tooltip + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag. + type + integer + + + + energy + 10 + return + key + sleep + 0 + tooltip + If an avatar is sitting on the link's sit target, return the avatar's key, NULL_KEY otherwise.\nReturns a key that is the UUID of the user seated on the specified link's prim. + + llAvatarOnSitTarget + + arguments + + energy + 10 + return + key + sleep + 0 + tooltip + If an avatar is seated on the sit target, returns the avatar's key, otherwise NULL_KEY.\nThis only will detect avatars sitting on sit targets defined with llSitTarget. + + llAxes2Rot + + arguments + + + Forward + tooltip + Forward/Back part of rotation. type vector + + + + Left + tooltip - + Left/Right part of rotation. + type + vector - CurrentPosition + Up + tooltip + Up/Down part of rotation. + type + vector + + + + energy + 10 + return + rotation + sleep + 0 + tooltip + Returns the rotation represented by coordinate axes Forward, Left, and Up. + + llAxisAngle2Rot + + arguments + + + Axis + + tooltip + Axis. type vector + + + + Angle + tooltip - + Angle in radians. + type + float + energy + 10 + return + rotation + sleep + 0 tooltip - This event is triggered when the scripted object comes within a defined range of the target position, defined by the llTarget function call. + Returns the rotation that is a generated Angle about Axis. - attach + llBase64ToInteger arguments - AvatarID + Text - type - key tooltip - + + type + string + energy + 10 + return + integer + sleep + 0 tooltip - This event is triggered whenever an object is attached or detached from an avatar. If it is attached, the key of the avatar it is attached to is passed in, otherwise NULL_KEY is. + Returns an integer that is the Text, Base64 decoded as a big endian integer.\nReturns zero if Text is longer then 8 characters. If Text contains fewer then 6 characters, the return value is unpredictable. - changed + llBase64ToString arguments - Changed + Text - type - integer tooltip - + + type + string + energy + 10 + return + string + sleep + 0 tooltip - Triggered when various events change the object. The change argument will be a bit-field of CHANGED_* constants. + Converts a Base64 string to a conventional string.\nIf the conversion creates any unprintable characters, they are converted to question marks. - collision + llBreakAllLinks arguments - - - NumberOfCollisions - - type - integer - tooltip - - - - + + energy + 10 + return + void + sleep + 0 tooltip - This event is raised while another object, or avatar, is colliding with the object the script is attached to. - The number of detected objects is passed to the script. Information on those objects may be gathered via the llDetected* functions. + De-links all prims in the link set (requires permission PERMISSION_CHANGE_LINKS be set). - collision_end + llBreakLink arguments - NumberOfCollisions + LinkNumber + tooltip + type integer - tooltip - + energy + 10 + return + void + sleep + 0 tooltip - This event is raised when another object, or avatar, stops colliding with the object the script is attached to. - The number of detected objects is passed to the script. Information on those objects may be gathered via the llDetected* library functions. + De-links the prim with the given link number (requires permission PERMISSION_CHANGE_LINKS be set). - collision_start + llCSV2List arguments - NumberOfCollisions + Text - type - integer tooltip - + + type + string + energy + 10 + return + list + sleep + 0 tooltip - This event is raised when another object, or avatar, starts colliding with the object the script is attached to. - The number of detected objects is passed to the script. Information on those objects may be gathered via the llDetected* library functions. + Create a list from a string of comma separated values specified in Text. - control + llCastRay arguments - AvatarID + Start - type - key tooltip - + + type + vector - Levels + End - type - integer tooltip - + + type + vector - Edges + Options - type - integer tooltip - + + type + list + energy + 10 + return + list + sleep + 0 tooltip - Once a script has the ability to grab control inputs from the avatar, this event will be used to pass the commands into the script. - The levels and edges are bit-fields of control constants. + Casts a ray into the physics world from 'start' to 'end' and returns data according to details in Options.\nReports collision data for intersections with objects.\nReturn value: [UUID_1, {link_number_1}, hit_position_1, {hit_normal_1}, UUID_2, {link_number_2}, hit_position_2, {hit_normal_2}, ... , status_code] where {} indicates optional data. - dataserver + llCeil arguments - RequestID + Value - type - key tooltip - - - - - Data - + type - string - tooltip - + float + energy + 10 + return + integer + sleep + 0 tooltip - This event is triggered when the requested data is returned to the script. - Data may be requested by the llRequestAgentData, llRequestInventoryData, and llGetNotecardLine function calls, for example. + Returns smallest integer value >= Value. - email + llChar arguments - Time + value - type - string tooltip - - - - - Address - + Unicode value to convert into a string. type - string - tooltip - + integer + + energy + 10 + return + string + sleep + 0 + tooltip + Returns a single character string that is the representation of the unicode value. + + llClearCameraParams + + arguments + + energy + 10 + return + void + sleep + 0 + tooltip + Resets all camera parameters to default values and turns off scripted camera control. + + llClearLinkMedia + + arguments + - Subject + Link - type - string tooltip - - - - - Body - + type - string - tooltip - + integer - NumberRemaining + Face + tooltip + type integer - tooltip - + energy + 10 + return + integer + sleep + 0 tooltip - This event is triggered when an email sent to this script arrives. - The number remaining tells how many more emails are known to be still pending. - - experience_permissions - - arguments - - - agent_id - - type - key - tooltip - ID of the agent approving permission for the Experience. - - - + Clears (deletes) the media and all parameters from the given Face on the linked prim.\nReturns an integer that is a STATUS_* flag, which details the success/failure of the operation. - experience_permissions_denied + llClearPrimMedia arguments - - agent_id - - type - key - tooltip - ID of the agent denying permission for the Experience. - - - - Reason - - type - integer - tooltip - One of the XP_ERROR_... constants describing the reason why the Experience permissions were denied for the agent. - - + + Face + + tooltip + Number of side to clear. + type + integer + + + energy + 10 + return + integer + sleep + 1 tooltip - Describes why the Experience permissions were denied for the agent. + Clears (deletes) the media and all parameters from the given Face.\nReturns an integer that is a STATUS_* flag which details the success/failure of the operation. - http_request + llCloseRemoteDataChannel arguments - HTTPRequestID + ChannelID + tooltip + type key - tooltip - + + energy + 10 + return + void + sleep + 1 + tooltip + This function is deprecated. + + llCloud + + arguments + - HTTPMethod + Offset - type - string tooltip - - - - - Body - + type - string - tooltip - + vector + energy + 10 + return + float + sleep + 0 tooltip - Triggered when task receives an HTTP request. + Returns the cloud density at the object's position + Offset. - http_response + llCollisionFilter arguments - HTTPRequestID - - type - key - tooltip - - - - - Status + ObjectName - type - integer tooltip - + + type + string - Metadata + ObjectID - type - list tooltip - + + type + key - Body + Accept - type - string tooltip - + If TRUE, only accept collisions with ObjectName name AND ObjectID (either is optional), otherwise with objects not ObjectName AND ObjectID. + type + integer + energy + 10 + return + void + sleep + 0 tooltip - This event handler is invoked when an HTTP response is received for a pending llHTTPRequest request or if a pending request fails or times out. + Specify an empty string or NULL_KEY for Accept, to not filter on the corresponding parameter. - land_collision + llCollisionSound arguments - Position + ImpactSound - type - vector tooltip - + + type + string - - tooltip - This event is raised when the object the script is attached to is colliding with the ground. - - land_collision_end - - arguments - - Position + ImpactVolume - type - vector tooltip - + + type + float + energy + 10 + return + void + sleep + 0 tooltip - This event is raised when the object the script is attached to stops colliding with the ground. + Suppress default collision sounds, replace default impact sounds with ImpactSound.\nThe ImpactSound must be in the object inventory.\nSupply an empty string to suppress collision sounds. - land_collision_start + llCollisionSprite arguments - Position + ImpactSprite - type - vector tooltip - + + type + string + energy + 10 + return + void + sleep + 0 tooltip - This event is raised when the object the script is attached to begins to collide with the ground. + Suppress default collision sprites, replace default impact sprite with ImpactSprite; found in the object inventory (empty string to just suppress). - link_message + llComputeHash arguments - SendersLink + Message - type - integer tooltip - - - - - Value - + The message to be hashed. type - integer - tooltip - + string - Text + Algorithm + tooltip + The digest algorithm: md5, sha1, sha224, sha256, sha384, sha512. type string - tooltip - + + energy + 10 + return + string + sleep + 0 + tooltip + Returns hex-encoded Hash string of Message using digest Algorithm. + + llCos + + arguments + - ID + Theta - type - key tooltip - + + type + float + energy + 10 + return + float + sleep + 0 tooltip - Triggered when object receives a link message via llMessageLinked function call. + Returns the cosine of Theta (Theta in radians). - listen + llCreateCharacter arguments - Channel + Options - type - integer tooltip - + + type + list + + energy + 10 + return + void + sleep + 0 + tooltip + Convert link-set to AI/Physics character.\nCreates a path-finding entity, known as a "character", from the object containing the script. Required to activate use of path-finding functions.\nOptions is a list of key/value pairs. + + llCreateKeyValue + + arguments + - Name + Key + tooltip + type string - tooltip - - ID + Value - type - key tooltip - - - - - Text - + type string - tooltip - + energy + 10 + return + key + sleep + 0 tooltip - This event is raised whenever a chat message matching the constraints set in the llListen command is received. The name and ID of the speaker, as well as the message, are passed in as parameters. - Channel 0 is the public chat channel that all avatars see as chat text. Channels 1 through 2,147,483,648 are private channels that are not sent to avatars but other scripts can listen on those channels. + + Starts an asychronous transaction to create a key-value pair. Will fail with XP_ERROR_STORAGE_EXCEPTION if the key already exists. The dataserver callback will be executed with the key returned from this call and a string describing the result. The result is a two element commma-delimited list. The first item is an integer specifying if the transaction succeeded (1) or not (0). In the failure case, the second item will be an integer corresponding to one of the XP_ERROR_... constants. In the success case the second item will be the value passed to the function. + - money + llCreateLink arguments - Payer + TargetPrim + tooltip + Object UUID that is in the same region. type key - tooltip - - Amount + Parent + tooltip + If FALSE, then TargetPrim becomes the root. If TRUE, then the script's object becomes the root. type integer - tooltip - + energy + 10 + return + void + sleep + 0.1000000000000000055511151 tooltip - This event is triggered when a resident has given an amount of Linden dollars to the object. - - moving_end - - arguments - - tooltip - Triggered whenever an object with this script stops moving. - - moving_start - - arguments - - tooltip - Triggered whenever an object with this script starts moving. - - no_sensor - - arguments - - tooltip - This event is raised when sensors are active, via the llSensor function call, but are not sensing anything. - - not_at_rot_target - - arguments - - tooltip - When a target is set via the llRotTarget function call, but the script is outside the specified angle this event is raised. - - not_at_target - - arguments - - tooltip - When a target is set via the llTarget library call, but the script is outside the specified range this event is raised. + Attempt to link the object the script is in, to target (requires permission PERMISSION_CHANGE_LINKS be set).\nRequires permission PERMISSION_CHANGE_LINKS be set. - object_rez + llDamage arguments - RezzedObjectsID + target + tooltip + Agent or task to receive damage. type key + + + + damage + tooltip - + Damage amount to inflict on this target. + type + float - - tooltip - Triggered when an object rezzes another object from its inventory via the llRezObject, or similar, functions. The id is the globally unique key for the object rezzed. - - on_rez - - arguments - - StartParameter + type + tooltip + Damage type to inflict on this target. type integer - tooltip - + energy + 10 + return + void + sleep + 0 tooltip - Triggered whenever an object is rezzed from inventory or by another object. The start parameter is passed in from the llRezObject call, or zero if from inventory. + Generates a damage event on the targeted agent or task. - path_update + llDataSizeKeyValue arguments - - - Type - - type - integer - tooltip - - - + + energy + 10 + return + key + sleep + 0 + tooltip + + Starts an asychronous transaction the request the used and total amount of data allocated for the Experience. The dataserver callback will be executed with the key returned from this call and a string describing the result. The result is commma-delimited list. The first item is an integer specifying if the transaction succeeded (1) or not (0). In the failure case, the second item will be an integer corresponding to one of the XP_ERROR_... constants. In the success case the second item will be the the amount in use and the third item will be the total available. + + + llDeleteCharacter + + arguments + + energy + 10 + return + void + sleep + 0 + tooltip + Convert link-set from AI/Physics character to Physics object.\nConvert the current link-set back to a standard object, removing all path-finding properties. + + llDeleteKeyValue + + arguments + - Reserved + Key - type - list tooltip - + + type + string + energy + 10 + return + key + sleep + 0 tooltip - This event is called to inform the script of changes within the object's path-finding status. + + Starts an asychronous transaction to delete a key-value pair. The dataserver callback will be executed with the key returned from this call and a string describing the result. The result is a two element commma-delimited list. The first item is an integer specifying if the transaction succeeded (1) or not (0). In the failure case, the second item will be an integer corresponding to one of the XP_ERROR_... constants. In the success case the second item will be the value associated with the key. + - remote_data + llDeleteSubList arguments - EventType + Source - type - integer tooltip - + + type + list - ChannelID + Start - type - key tooltip - + + type + integer - MessageID + End - type - key tooltip - + + type + integer + + energy + 10 + return + list + sleep + 0 + tooltip + Removes the slice from start to end and returns the remainder of the list.\nRemove a slice from the list and return the remainder, start and end are inclusive.\nUsing negative numbers for start and/or end causes the index to count backwards from the length of the list, so 0, -1 would delete the entire list.\nIf Start is larger than End the list deleted is the exclusion of the entries; so 6, 4 would delete the entire list except for the 5th. list entry. + + llDeleteSubString + + arguments + - Sender + Source + tooltip + type string - tooltip - - Data + Start + tooltip + type integer - tooltip - - Data + End - type - string tooltip - + + type + integer + energy + 10 + return + string + sleep + 0 tooltip - Triggered by various XML-RPC calls with event_type specifying the type of data. + Removes the indicated sub-string and returns the result.\nStart and End are inclusive.\nUsing negative numbers for Start and/or End causes the index to count backwards from the length of the string, so 0, -1 would delete the entire string.\nIf Start is larger than End, the sub-string is the exclusion of the entries; so 6, 4 would delete the entire string except for the 5th. character. - run_time_permissions + llDerezObject arguments - PermissionFlags + ID - type - integer tooltip - + The ID of an object in the region. + type + key - - tooltip - Scripts need permission from either the owner or the avatar they wish to act on before they may perform certain functions, such as debiting money from their owners account, triggering an animation on an avatar, or capturing control inputs. The llRequestPermissions library function is used to request these permissions and the various permissions integer constants can be supplied. - The integer returned to this event handler contains the current set of permissions flags, so if permissions equal 0 then no permissions are set. - - sensor - - arguments - - NumberDetected + flags + tooltip + Flags for derez behavior. type integer - tooltip - + energy + 10 + return + integer + sleep + 0 tooltip - This event is raised whenever objects matching the constraints of the llSensor command are detected. - The number of detected objects is passed to the script in the parameter. Information on those objects may be gathered via the llDetected* functions. - - state_entry - - arguments - - tooltip - The state_entry event occurs whenever a new state is entered, including at program start, and is always the first event handled. - - state_exit - - arguments - - tooltip - The state_exit event occurs whenever the state command is used to transition to another state. It is handled before the new states state_entry event. + Derezzes an object previously rezzed by a script in this region. Returns TRUE on success or FALSE if the object could not be derezzed. - timer + llDetachFromAvatar arguments - + + energy + 10 + return + void + sleep + 0 tooltip - This event is raised at regular intervals set by the llSetTimerEvent library function. + Remove the object containing the script from the avatar. - touch + llDetectedDamage arguments - NumberOfTouches + Number + tooltip + type integer - tooltip - + energy + 10 + return + list + sleep + 0 tooltip - This event is raised while a user is touching the object the script is attached to. - The number of touching objects is passed to the script in the parameter. - Information on those objects may be gathered via the llDetected* library functions. + Returns a list containing the current damage for the event, the damage type and the original damage delivered. - touch_end + llDetectedGrab arguments - NumberOfTouches + Number + tooltip + type integer - tooltip - + energy + 10 + return + vector + sleep + 0 tooltip - This event is raised when a user stops touching the object the script is attached to. The number of touches is passed to the script in the parameter. - Information on those objects may be gathered via the llDetected* library functions. + Returns the grab offset of a user touching the object.\nReturns <0.0, 0.0, 0.0> if Number is not a valid object. - touch_start + llDetectedGroup arguments - NumberOfTouches + Number + tooltip + type integer - tooltip - + energy + 10 + return + integer + sleep + 0 tooltip - This event is raised when a user first touches the object the script is attached to. The number of touches is passed to the script in the parameter. - Information on those objects may be gathered via the llDetected() library functions. + Returns TRUE if detected object or agent Number has the same user group active as this object.\nIt will return FALSE if the object or agent is in the group, but the group is not active. - transaction_result + llDetectedKey arguments - RequestID + Number - type - key tooltip - - - - - Success - + type integer - tooltip - - - - - Message - - type - string - tooltip - + energy + 10 + return + key + sleep + 0 tooltip - Triggered by llTransferMoney() function. + Returns the key of detected object or avatar number.\nReturns NULL_KEY if Number is not a valid index. - - functions - - llAbs + llDetectedLinkNumber - energy - 10.0 - sleep - 0.0 - return - integer arguments - Value + Number + tooltip + type integer - tooltip - An integer value. + energy + 10 + return + integer + sleep + 0 tooltip - Returns the absolute (positive) version of Value. + Returns the link position of the triggered event for touches and collisions only.\n0 for a non-linked object, 1 for the root of a linked object, 2 for the first child, etc. - llAcos + llDetectedName - energy - 10.0 - sleep - 0.0 - return - float arguments - Value + Number - type - float tooltip - A floating-point value. + + type + integer + energy + 10 + return + string + sleep + 0 tooltip - Returns the arc-cosine of Value, in radians. + Returns the name of detected object or avatar number.\nReturns the name of detected object number.\nReturns empty string if Number is not a valid index. - llAddToLandBanList + llDetectedOwner - energy - 10.0 - sleep - 0.0 - return - void arguments - ID + Number - type - key tooltip - Agent UUID to add to ban-list. - - - - Hours - + type - float - tooltip - Period, in hours, to ban the avatar for. + integer + energy + 10 + return + key + sleep + 0 tooltip - Add avatar ID to the parcel ban list for the specified number of Hours.\nA value of 0 for Hours will add the agent indefinitely.\nThe smallest value that Hours will accept is 0.01; anything smaller will be seen as 0.\nWhen values that small are used, it seems the function bans in approximately 30 second increments (Probably 36 second increments, as 0.01 of an hour is 36 seconds).\nResidents teleporting to a parcel where they are banned will be redirected to a neighbouring parcel. + Returns the key of detected object's owner.\nReturns invalid key if Number is not a valid index. - llAddToLandPassList + llDetectedPos - energy - 10.0 - sleep - 0.1 - return - void arguments - ID - - type - key - tooltip - Agent UUID to add to pass-list. - - - - Hours + Number - type - float tooltip - Period, in hours, to allow the avatar for. + + type + integer + energy + 10 + return + vector + sleep + 0 tooltip - Add avatar ID to the land pass list, for a duration of Hours. + Returns the position of detected object or avatar number.\nReturns <0.0, 0.0, 0.0> if Number is not a valid index. - llAdjustSoundVolume + llDetectedRezzer - energy - 10.0 - sleep - 0.1 - return - void arguments - Volume + Number - type - float tooltip - The volume to set. + + type + integer - tooltip - Adjusts the volume (0.0 - 1.0) of the currently playing attached sound.\nThis function has no effect on sounds started with llTriggerSound. - - llAgentInExperience - energy - 10.0 - sleep - 0.0 + 10 return - integer - arguments - - - AgentID - - type - key - tooltip - - - - + key + sleep + 0 tooltip - - Returns TRUE if the agent is in the Experience and the Experience can run in the current location. - + Returns the key for the rezzer of the detected object. - llAllowInventoryDrop + llDetectedRot - energy - 10.0 - sleep - 0.0 - return - void arguments - Flag + Number + tooltip + type integer - tooltip - Boolean, If TRUE allows anyone to drop inventory on prim, FALSE revokes. + energy + 10 + return + rotation + sleep + 0 tooltip - If Flag == TRUE, users without object modify permissions can still drop inventory items into the object. + Returns the rotation of detected object or avatar number.\nReturns <0.0, 0.0, 0.0, 1.0> if Number is not a valid offset. - llAngleBetween + llDetectedTouchBinormal - energy - 10.0 - sleep - 0.0 - return - float arguments - Rot1 + Index - type - rotation tooltip - First rotation. - - - - Rot2 - + Index of detection information type - rotation - tooltip - Second rotation. + integer + energy + 10 + return + vector + sleep + 0 tooltip - Returns the angle, in radians, between rotations Rot1 and Rot2. + Returns the surface bi-normal for a triggered touch event.\nReturns a vector that is the surface bi-normal (tangent to the surface) where the touch event was triggered. - llApplyImpulse + llDetectedTouchFace - energy - 10.0 - sleep - 0.0 - return - void arguments - Force + Index - type - vector tooltip - Amount of impulse force to apply. - - - - Local - + Index of detection information type integer - tooltip - Boolean, if TRUE, force is treated as a local directional vector instead of region directional vector. + energy + 10 + return + integer + sleep + 0 tooltip - Applies impulse to the object.\nIf Local == TRUE, apply the Force in local coordinates; otherwise, apply the Force in global coordinates.\nThis function only works on physical objects. + Returns the index of the face where the avatar clicked in a triggered touch event. - llApplyRotationalImpulse + llDetectedTouchNormal - energy - 10.0 - sleep - 0.0 - return - void arguments - Force + Index - type - vector tooltip - Amount of impulse force to apply. - - - - Local - + Index of detection information type integer - tooltip - Boolean, if TRUE, uses local axis, if FALSE, uses region axis. + energy + 10 + return + vector + sleep + 0 tooltip - Applies rotational impulse to the object.\nIf Local == TRUE, apply the Force in local coordinates; otherwise, apply the Force in global coordinates.\nThis function only works on physical objects. + Returns the surface normal for a triggered touch event.\nReturns a vector that is the surface normal (perpendicular to the surface) where the touch event was triggered. - llAsin + llDetectedTouchPos - energy - 10.0 - sleep - 0.0 - return - float arguments - Value + Index - type - float tooltip - A floating-point value. + Index of detected information + type + integer + energy + 10 + return + vector + sleep + 0 tooltip - Returns the arc-sine, in radians, of Value. + Returns the position, in region coordinates, where the object was touched in a triggered touch event.\nUnless it is a HUD, in which case it returns the position relative to the attach point. - llAtan2 + llDetectedTouchST - energy - 10.0 - sleep - 0.0 - return - float arguments - y + Index - type - float tooltip - A floating-point value. - - - - x - + Index of detection information type - float - tooltip - A floating-point value. + integer + energy + 10 + return + vector + sleep + 0 tooltip - Returns the arc-tangent2 of y, x. + Returns a vector that is the surface coordinates where the prim was touched.\nThe X and Y vector positions contain the horizontal (S) and vertical (T) face coordinates respectively.\nEach component is in the interval [0.0, 1.0].\nTOUCH_INVALID_TEXCOORD is returned if the surface coordinates cannot be determined (e.g. when the viewer does not support this function). - llAttachToAvatar + llDetectedTouchUV - energy - 10.0 - sleep - 0.0 - return - void arguments - AttachmentPoint + Index + tooltip + Index of detection information type integer - tooltip - - tooltip - Attach to avatar at point AttachmentPoint.\nRequires the PERMISSION_ATTACH runtime permission. - - llAttachToAvatarTemp - energy - 0 + 10 + return + vector sleep 0 - return - void + tooltip + Returns a vector that is the texture coordinates for where the prim was touched.\nThe X and Y vector positions contain the U and V face coordinates respectively.\nTOUCH_INVALID_TEXCOORD is returned if the touch UV coordinates cannot be determined (e.g. when the viewer does not support this function). + + llDetectedType + arguments - AttachPoint + Number + tooltip + type integer - tooltip - Valid attachment point or ATTACH_* constant. + energy + 10 + return + integer + sleep + 0 tooltip - Follows the same convention as llAttachToAvatar, with the exception that the object will not create new inventory for the user, and will disappear on detach or disconnect. + Returns the type (AGENT, ACTIVE, PASSIVE, SCRIPTED) of detected object.\nReturns 0 if number is not a valid index.\nNote that number is a bit-field, so comparisons need to be a bitwise checked. e.g.:\ninteger iType = llDetectedType(0);\n{\n // ...do stuff with the agent\n} - llAvatarOnLinkSitTarget + llDetectedVel - energy - 10.0 - sleep - 0.0 - return - key arguments - LinkNumber + Number + tooltip + type integer - tooltip - Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag. - tooltip - If an avatar is sitting on the link's sit target, return the avatar's key, NULL_KEY otherwise.\nReturns a key that is the UUID of the user seated on the specified link's prim. - - llAvatarOnSitTarget - energy - 10.0 - sleep - 0.0 + 10 return - key - arguments - + vector + sleep + 0 tooltip - If an avatar is seated on the sit target, returns the avatar's key, otherwise NULL_KEY.\nThis only will detect avatars sitting on sit targets defined with llSitTarget. + Returns the velocity of the detected object Number.\nReturns<0.0, 0.0, 0.0> if Number is not a valid offset. - llAxes2Rot + llDialog - energy - 10.0 - sleep - 0.0 - return - rotation arguments - Forward + AvatarID - type - vector tooltip - Forward/Back part of rotation. + + type + key - Left + Text - type - vector tooltip - Left/Right part of rotation. + + type + string - Up + Buttons + tooltip + type - vector + list + + + + Channel + tooltip - Up/Down part of rotation. + + type + integer + energy + 10 + return + void + sleep + 1 tooltip - Returns the rotation represented by coordinate axes Forward, Left, and Up. + + Shows a dialog box on the avatar's screen with the message.\n + Up to 12 strings in the list form buttons.\n + If a button is clicked, the name is chatted on Channel.\nOpens a "notify box" in the given avatars screen displaying the message.\n + Up to twelve buttons can be specified in a list of strings. When the user clicks a button, the name of the button is said on the specified channel.\n + Channels work just like llSay(), so channel 0 can be heard by everyone.\n + The chat originates at the object's position, not the avatar's position, even though it is said as the avatar (uses avatar's UUID and Name etc.).\n + Examples:\n + llDialog(who, "Are you a boy or a girl?", [ "Boy", "Girl" ], -4913);\n + llDialog(who, "This shows only an OK button.", [], -192);\n + llDialog(who, "This chats so you can 'hear' it.", ["Hooray"], 0); + - llAxisAngle2Rot + llDie + arguments + energy - 10.0 - sleep - 0.0 + 0 return - rotation + void + sleep + 0 + tooltip + Delete the object which holds the script. + + llDumpList2String + arguments - Axis + Source - type - vector tooltip - Axis. + + type + list - Angle + Separator - type - float tooltip - Angle in radians. + + type + string + energy + 10 + return + string + sleep + 0 tooltip - Returns the rotation that is a generated Angle about Axis. + Returns the list as a single string, using Separator between the entries.\nWrite the list out as a single string, using Separator between values. - llBase64ToInteger + llEdgeOfWorld - energy - 10.0 - sleep - 0.0 - return - integer arguments - Text + Position - type - string tooltip - + + type + vector - - tooltip - Returns an integer that is the Text, Base64 decoded as a big endian integer.\nReturns zero if Text is longer then 8 characters. If Text contains fewer then 6 characters, the return value is unpredictable. - - llBase64ToString - - energy - 10.0 - sleep - 0.0 - return - string - arguments - - Text + Direction - type - string tooltip - + + type + vector - tooltip - Converts a Base64 string to a conventional string.\nIf the conversion creates any unprintable characters, they are converted to question marks. - - llBreakAllLinks - energy - 10.0 - sleep - 0.0 + 10 return - void - arguments - + integer + sleep + 0 tooltip - De-links all prims in the link set (requires permission PERMISSION_CHANGE_LINKS be set). + Checks to see whether the border hit by Direction from Position is the edge of the world (has no neighboring region).\nReturns TRUE if the line along Direction from Position hits the edge of the world in the current simulator, returns FALSE if that edge crosses into another simulator. - llBreakLink + llEjectFromLand - energy - 10.0 - sleep - 0.0 - return - void arguments - LinkNumber + AvatarID - type - integer tooltip - + + type + key + energy + 10 + return + void + sleep + 0 tooltip - De-links the prim with the given link number (requires permission PERMISSION_CHANGE_LINKS be set). + Ejects AvatarID from land that you own.\nEjects AvatarID from land that the object owner (group or resident) owns. - llCastRay + llEmail - energy - - sleep - - return - list arguments - Start + Address - type - vector tooltip - + + type + string - End + Subject - type - vector tooltip - + + type + string - Options + Text - type - list tooltip - + + type + string + energy + 10 + return + void + sleep + 20 tooltip - Casts a ray into the physics world from 'start' to 'end' and returns data according to details in Options.\nReports collision data for intersections with objects.\nReturn value: [UUID_1, {link_number_1}, hit_position_1, {hit_normal_1}, UUID_2, {link_number_2}, hit_position_2, {hit_normal_2}, ... , status_code] where {} indicates optional data. + Sends email to Address with Subject and Message.\nSends an email to Address with Subject and Message. - llCeil + llEscapeURL - energy - 10.0 - sleep - 0.0 - return - integer arguments - Value + URL - type - float tooltip - + + type + string - tooltip - Returns smallest integer value >= Value. - - llClearCameraParams - energy - 10.0 - sleep - 0.0 + 10 return - void - arguments - + string + sleep + 0 tooltip - Resets all camera parameters to default values and turns off scripted camera control. + + Returns an escaped/encoded version of url, replacing spaces with %20 etc.\nReturns the string that is the URL-escaped version of URL (replacing spaces with %20, etc.).\n + This function returns the UTF-8 encoded escape codes for selected characters. + - llClearLinkMedia + llEuler2Rot - energy - 0.0 - sleep - 0.0 - return - integer arguments - Link + Vector - type - integer tooltip - - - - - Face - + type - integer - tooltip - + vector + energy + 10 + return + rotation + sleep + 0 tooltip - Clears (deletes) the media and all parameters from the given Face on the linked prim.\nReturns an integer that is a STATUS_* flag, which details the success/failure of the operation. + Returns the rotation representation of the Euler angles.\nReturns the rotation represented by the Euler Angle. - llClearPrimMedia + llEvade - energy - 10.0 - sleep - 0.1 - return - integer arguments - Face + TargetID + tooltip + Agent or object to evade. type - integer + key + + + + Options + tooltip - Number of side to clear. + No options yet. + type + list - tooltip - Clears (deletes) the media and all parameters from the given Face.\nReturns an integer that is a STATUS_* flag which details the success/failure of the operation. - - llCloseRemoteDataChannel - energy - 10.0 - sleep - 1.0 + 10 return void + sleep + 0 + tooltip + Evade a specified target.\nCharacters will (roughly) try to hide from their pursuers if there is a good hiding spot along their fleeing path. Hiding means no direct line of sight from the head of the character (centre of the top of its physics bounding box) to the head of its pursuer and no direct path between the two on the navigation-mesh. + + llExecCharacterCmd + arguments - ChannelID + Command + tooltip + Command to send. type - key + integer + + + + Options + tooltip - + Height for CHARACTER_CMD_JUMP. + type + list + energy + 10 + return + void + sleep + 0 tooltip - Closes the specified XML-RPC channel. + Execute a character command.\nSend a command to the path system.\nCurrently only supports stopping the current path-finding operation or causing the character to jump. - llCloud + llFabs - energy - 10.0 - sleep - 0.0 - return - float arguments - Offset + Value - type - vector tooltip - + + type + float + energy + 10 + return + float + sleep + 0 tooltip - Returns the cloud density at the object's position + Offset. + Returns the positive version of Value.\nReturns the absolute value of Value. - llCollisionFilter + llFindNotecardTextCount - energy - 10.0 - sleep - 0.0 - return - void arguments - ObjectName + NotecardName + tooltip + type string - tooltip - - ObjectID + Pattern - type - key tooltip - + Regex pattern to find in the notecard text. + type + string - Accept + Options - type - integer tooltip - If TRUE, only accept collisions with ObjectName name AND ObjectID (either is optional), otherwise with objects not ObjectName AND ObjectID. + A list of options to control the search. Included for future expansion, should be [] + type + list + energy + 10 + return + key + sleep + 0 tooltip - Specify an empty string or NULL_KEY for Accept, to not filter on the corresponding parameter. + + Searches the text of a cached notecard for lines containing the given pattern and returns the + number of matches found through a dataserver event. + - llCollisionSound + llFindNotecardTextSync - energy - 10.0 - sleep - 0.0 - return - void arguments - ImpactSound + NotecardName + + tooltip + + type + string + + + + Pattern + tooltip + Regex pattern to find in the notecard text. type string + + + + StartMatch + tooltip - + The number of matches to skip before returning values. + type + integer - ImpactVolume + Count + tooltip + The maximum number of matches to return. If 0 this function will return the first 64 matches found. type - float + integer + + + + Options + tooltip - + A list of options to control the search. Included for future expansion, should be [] + type + list + energy + 10 + return + list + sleep + 0 tooltip - Suppress default collision sounds, replace default impact sounds with ImpactSound.\nThe ImpactSound must be in the object inventory.\nSupply an empty string to suppress collision sounds. + + Searches the text of a cached notecard for lines containing the given pattern. + Returns a list of line numbers and column where a match is found. If the notecard is not in + the cache it returns a list containing a single entry of NAK. If no matches are found an + empty list is returned. + - llCollisionSprite + llFleeFrom - energy - 10.0 - sleep - 0.0 - return - void arguments - ImpactSprite + Source - type - string tooltip - + Global coordinate from which to flee. + type + vector - - tooltip - Suppress default collision sprites, replace default impact sprite with ImpactSprite; found in the object inventory (empty string to just suppress). - - llCos - - energy - 10.0 - sleep - 0.0 - return - float - arguments - - Theta + Distance + tooltip + Distance in meters to flee from the source. type float - tooltip - - - tooltip - Returns the cosine of Theta (Theta in radians). - - llCreateCharacter - - energy - - sleep - - return - void - arguments - Options + tooltip + No options available at this time. type list - tooltip - + energy + 10 + return + void + sleep + 0 tooltip - Convert link-set to AI/Physics character.\nCreates a path-finding entity, known as a "character", from the object containing the script. Required to activate use of path-finding functions.\nOptions is a list of key/value pairs. + Flee from a point.\nDirects a character (llCreateCharacter) to keep away from a defined position in the region or adjacent regions. - llCreateKeyValue + llFloor - energy - 10.0 - sleep - 0.0 - return - key arguments - - Key - - type - string - tooltip - - - - - Value - type - string - tooltip - + Value + + tooltip + + type + float + - + energy + 10 + return + integer + sleep + 0 tooltip - - Starts an asychronous transaction to create a key-value pair. Will fail with XP_ERROR_STORAGE_EXCEPTION if the key already exists. The dataserver callback will be executed with the key returned from this call and a string describing the result. The result is a two element commma-delimited list. The first item is an integer specifying if the transaction succeeded (1) or not (0). In the failure case, the second item will be an integer corresponding to one of the XP_ERROR_... constants. In the success case the second item will be the value passed to the function. - + Returns largest integer value <= Value. - llCreateLink + llForceMouselook - energy - 10.0 - sleep - 1.0 - return - void arguments - TargetPrim + Enable - type - key tooltip - Object UUID that is in the same region. - - - - Parent - + Boolean, if TRUE when an avatar sits on the prim, the avatar will be forced into mouse-look mode.\nFALSE is the default setting and will undo a previously set TRUE or do nothing. type integer - tooltip - If FALSE, then TargetPrim becomes the root. If TRUE, then the script's object becomes the root. + energy + 10 + return + void + sleep + 0 tooltip - Attempt to link the object the script is in, to target (requires permission PERMISSION_CHANGE_LINKS be set).\nRequires permission PERMISSION_CHANGE_LINKS be set. + If Enable is TRUE any avatar that sits on this object is forced into mouse-look mode.\nAfter calling this function with Enable set to TRUE, any agent sitting down on the prim will be forced into mouse-look.\nJust like llSitTarget, this changes a permanent property of the prim (not the object) and needs to be reset by calling this function with Enable set to FALSE in order to disable it. - llCSV2List + llFrand - energy - 10.0 - sleep - 0.0 - return - list arguments - Text + Magnitude - type - string tooltip - + + type + float + energy + 10 + return + float + sleep + 0 tooltip - Create a list from a string of comma separated values specified in Text. + Returns a pseudo random number in the range [0, Magnitude] or [Magnitude, 0].\nReturns a pseudo-random number between [0, Magnitude]. - llDataSizeKeyValue + llGenerateKey + arguments + energy - 10.0 - sleep - 0.0 + 10 return key - arguments - + sleep + 0 tooltip - - Starts an asychronous transaction the request the used and total amount of data allocated for the Experience. The dataserver callback will be executed with the key returned from this call and a string describing the result. The result is commma-delimited list. The first item is an integer specifying if the transaction succeeded (1) or not (0). In the failure case, the second item will be an integer corresponding to one of the XP_ERROR_... constants. In the success case the second item will be the the amount in use and the third item will be the total available. - + Generates a key (SHA-1 hash) using UUID generation to create a unique key.\nAs the UUID produced is versioned, it should never return a value of NULL_KEY.\nThe specific UUID version is an implementation detail that has changed in the past and may change again in the future. Do not depend upon the UUID that is returned to be version 5 SHA-1 hash. - llDeleteCharacter + llGetAccel + arguments + energy - - sleep - + 10 return - void - arguments - + vector + sleep + 0 tooltip - Convert link-set from AI/Physics character to Physics object.\nConvert the current link-set back to a standard object, removing all path-finding properties. + Returns the acceleration of the object relative to the region's axes.\nGets the acceleration of the object. - llDeleteKeyValue + llGetAgentInfo - energy - 10.0 - sleep - 0.0 - return - key arguments - - Key - - type - string - tooltip - - - + + AvatarID + + tooltip + + type + key + + + energy + 10 + return + integer + sleep + 0 tooltip - Starts an asychronous transaction to delete a key-value pair. The dataserver callback will be executed with the key returned from this call and a string describing the result. The result is a two element commma-delimited list. The first item is an integer specifying if the transaction succeeded (1) or not (0). In the failure case, the second item will be an integer corresponding to one of the XP_ERROR_... constants. In the success case the second item will be the value associated with the key. + Returns an integer bit-field containing the agent information about id.\n + Returns AGENT_FLYING, AGENT_ATTACHMENTS, AGENT_SCRIPTED, AGENT_SITTING, AGENT_ON_OBJECT, AGENT_MOUSELOOK, AGENT_AWAY, AGENT_BUSY, AGENT_TYPING, AGENT_CROUCHING, AGENT_ALWAYS_RUN, AGENT_WALKING, AGENT_IN_AIR and/or AGENT_FLOATING_VIA_SCRIPTED_ATTACHMENT.\nReturns information about the given agent ID as a bit-field of agent info constants. - llDeleteSubList + llGetAgentLanguage - energy - 10.0 - sleep - 0.0 - return - list arguments - Source + AvatarID - type - list tooltip - + + type + key + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the language code of the preferred interface language of the avatar.\nReturns a string that is the language code of the preferred interface language of the resident. + + llGetAgentList + + arguments + - Start + Scope + tooltip + The scope (region, parcel, parcel same owner) to return agents for. type integer - tooltip - - End + Options - type - integer tooltip - + List of options to apply. Current unused. + type + list + energy + 10 + return + list + sleep + 0 tooltip - Removes the slice from start to end and returns the remainder of the list.\nRemove a slice from the list and return the remainder, start and end are inclusive.\nUsing negative numbers for start and/or end causes the index to count backwards from the length of the list, so 0, -1 would delete the entire list.\nIf Start is larger than End the list deleted is the exclusion of the entries; so 6, 4 would delete the entire list except for the 5th. list entry. + Requests a list of agents currently in the region, limited by the scope parameter.\nReturns a list [key UUID-0, key UUID-1, ..., key UUID-n] or [string error_msg] - returns avatar keys for all agents in the region limited to the area(s) specified by scope - llDeleteSubString + llGetAgentSize - energy - 10.0 - sleep - 0.0 - return - string arguments - Source + AvatarID - type - string tooltip - - - - - Start - + type - integer - tooltip - + key + + energy + 10 + return + vector + sleep + 0 + tooltip + If the avatar is in the same region, returns the size of the bounding box of the requested avatar by id, otherwise returns ZERO_VECTOR.\nIf the agent is in the same region as the object, returns the size of the avatar. + + llGetAlpha + + arguments + - End + Face + tooltip + type integer - tooltip - + energy + 10 + return + float + sleep + 0 tooltip - Removes the indicated sub-string and returns the result.\nStart and End are inclusive.\nUsing negative numbers for Start and/or End causes the index to count backwards from the length of the string, so 0, -1 would delete the entire string.\nIf Start is larger than End, the sub-string is the exclusion of the entries; so 6, 4 would delete the entire string except for the 5th. character. + Returns the alpha value of Face.\nReturns the 'alpha' of the given face. If face is ALL_SIDES the value returned is the mean average of all faces. - llDetachFromAvatar + llGetAndResetTime + arguments + energy - 10.0 - sleep - 0.0 + 10 return - void - arguments - + float + sleep + 0 tooltip - Remove the object containing the script from the avatar. + Returns the script time in seconds and then resets the script timer to zero.\nGets the time in seconds since starting and resets the time to zero. - llDetectedGrab + llGetAnimation - energy - 10.0 - sleep - 0.0 - return - vector arguments - Number + AvatarID - type - integer tooltip - + + type + key + energy + 10 + return + string + sleep + 0 tooltip - Returns the grab offset of a user touching the object.\nReturns <0.0, 0.0, 0.0> if Number is not a valid object. + Returns the name of the currently playing locomotion animation for the avatar id.\nReturns the currently playing animation for the specified avatar ID. - llDetectedGroup + llGetAnimationList - energy - 10.0 - sleep - 0.0 - return - integer arguments - Number + AvatarID - type - integer tooltip - + + type + key + energy + 10 + return + list + sleep + 0 tooltip - Returns TRUE if detected object or agent Number has the same user group active as this object.\nIt will return FALSE if the object or agent is in the group, but the group is not active. + Returns a list of keys of playing animations for an avatar.\nReturns a list of keys of all playing animations for the specified avatar ID. - llDetectedKey + llGetAnimationOverride - energy - 10.0 - sleep - 0.0 - return - key arguments - Number + AnimationState - type - integer tooltip - + + type + string + energy + 10 + return + string + sleep + 0 tooltip - Returns the key of detected object or avatar number.\nReturns NULL_KEY if Number is not a valid index. + Returns a string that is the name of the animation that is used for the specified animation state\nTo use this function the script must obtain either the PERMISSION_OVERRIDE_ANIMATIONS or PERMISSION_TRIGGER_ANIMATION permission (automatically granted to attached objects). - llDetectedLinkNumber + llGetAttached + arguments + energy - 10.0 - sleep - 0.0 + 10 return integer + sleep + 0 + tooltip + Returns the object's attachment point, or 0 if not attached. + + llGetAttachedList + arguments - Number + ID - type - integer tooltip - + Avatar to get attachments + type + key + energy + 10 + return + list + sleep + 0 tooltip - Returns the link position of the triggered event for touches and collisions only.\n0 for a non-linked object, 1 for the root of a linked object, 2 for the first child, etc. + Returns a list of keys of all visible (not HUD) attachments on the avatar identified by the ID argument - llDetectedName + llGetAttachedListFiltered - energy - 10.0 - sleep - 0.0 - return - string arguments - Number + AgentID + tooltip + An agent in the region. type - integer + key + + + + Options + tooltip - + A list of option for inventory transfer. + type + list + energy + 10 + return + list + sleep + 0 tooltip - Returns the name of detected object or avatar number.\nReturns the name of detected object number.\nReturns empty string if Number is not a valid index. + Retrieves a list of attachments on an avatar. - llDetectedOwner + llGetBoundingBox - energy - 10.0 - sleep - 0.0 - return - key arguments - Number + ID - type - integer tooltip - + + type + key + energy + 10 + return + list + sleep + 0 tooltip - Returns the key of detected object's owner.\nReturns invalid key if Number is not a valid index. + Returns the bounding box around the object (including any linked prims) relative to its root prim, as a list in the format [ (vector) min_corner, (vector) max_corner ]. - llDetectedPos + llGetCameraAspect + + arguments + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the current camera aspect ratio (width / height) of the agent who has granted the scripted object PERMISSION_TRACK_CAMERA permissions. If no permissions have been granted: it returns zero. + + llGetCameraFOV + arguments + energy - 10.0 + 10 + return + float sleep - 0.0 + 0 + tooltip + Returns the current camera field of view of the agent who has granted the scripted object PERMISSION_TRACK_CAMERA permissions. If no permissions have been granted: it returns zero. + + llGetCameraPos + + arguments + + energy + 10 return vector - arguments - - - Number - - type - integer - tooltip - - - - + sleep + 0 tooltip - Returns the position of detected object or avatar number.\nReturns <0.0, 0.0, 0.0> if Number is not a valid index. + Returns the current camera position for the agent the task has permissions for.\nReturns the position of the camera, of the user that granted the script PERMISSION_TRACK_CAMERA. If no user has granted the permission, it returns ZERO_VECTOR. - llDetectedRot + llGetCameraRot + arguments + energy - 10.0 - sleep - 0.0 + 10 return rotation - arguments - - - Number - - type - integer - tooltip - - - - + sleep + 0 tooltip - Returns the rotation of detected object or avatar number.\nReturns <0.0, 0.0, 0.0, 1.0> if Number is not a valid offset. + Returns the current camera orientation for the agent the task has permissions for. If no user has granted the PERMISSION_TRACK_CAMERA permission, returns ZERO_ROTATION. - llDetectedTouchBinormal + llGetCenterOfMass + arguments + energy - 10.0 - sleep - 0.0 + 10 return vector + sleep + 0 + tooltip + Returns the prim's centre of mass (unless called from the root prim, where it returns the object's centre of mass). + + llGetClosestNavPoint + arguments - Index + Point - type - integer tooltip - Index of detection information + A point in region-local space. + type + vector - - tooltip - Returns the surface bi-normal for a triggered touch event.\nReturns a vector that is the surface bi-normal (tangent to the surface) where the touch event was triggered. - - llDetectedTouchFace - - energy - 10.0 - sleep - 0.0 - return - integer - arguments - - Index + Options - type - integer tooltip - Index of detection information + No options at this time. + type + list + energy + 10 + return + list + sleep + 0 tooltip - Returns the index of the face where the avatar clicked in a triggered touch event. + Get the closest navigable point to the point provided.\nThe function accepts a point in region-local space (like all the other path-finding methods) and returns either an empty list or a list containing a single vector which is the closest point on the navigation-mesh to the point provided. - llDetectedTouchNormal + llGetColor - energy - 10.0 - sleep - 0.0 - return - vector arguments - Index + Face + tooltip + type integer - tooltip - Index of detection information + energy + 10 + return + vector + sleep + 0 tooltip - Returns the surface normal for a triggered touch event.\nReturns a vector that is the surface normal (perpendicular to the surface) where the touch event was triggered. + Returns the color on Face.\nReturns the color of Face as a vector of red, green, and blue values between 0 and 1. If face is ALL_SIDES the color returned is the mean average of each channel. - llDetectedTouchPos + llGetCreator + arguments + energy - 10.0 - sleep - 0.0 + 10 return - vector - arguments - - - Index - - type - integer - tooltip - Index of detected information - - - + key + sleep + 0 tooltip - Returns the position, in region coordinates, where the object was touched in a triggered touch event.\nUnless it is a HUD, in which case it returns the position relative to the attach point. + Returns a key for the creator of the prim.\nReturns the key of the object's original creator. Similar to llGetOwner. - llDetectedTouchST + llGetDate + arguments + energy - 10.0 - sleep - 0.0 + 10 return - vector - arguments - - - Index - - type - integer - tooltip - Index of detection information - - - + string + sleep + 0 tooltip - Returns a vector that is the surface coordinates where the prim was touched.\nThe X and Y vector positions contain the horizontal (S) and vertical (T) face coordinates respectively.\nEach component is in the interval [0.0, 1.0].\nTOUCH_INVALID_TEXCOORD is returned if the surface coordinates cannot be determined (e.g. when the viewer does not support this function). + Returns the current date in the UTC time zone in the format YYYY-MM-DD.\nReturns the current UTC date as YYYY-MM-DD. - llDetectedTouchUV + llGetDayLength + arguments + energy - 10.0 - sleep - 0.0 + 10 return - vector - arguments - - - Index - - type - integer - tooltip - Index of detection information - - - + integer + sleep + 0 tooltip - Returns a vector that is the texture coordinates for where the prim was touched.\nThe X and Y vector positions contain the U and V face coordinates respectively.\nTOUCH_INVALID_TEXCOORD is returned if the touch UV coordinates cannot be determined (e.g. when the viewer does not support this function). + Returns the number of seconds in a day on this parcel. - llDetectedType + llGetDayOffset + arguments + energy - 10.0 - sleep - 0.0 + 10 return integer + sleep + 0 + tooltip + Returns the number of seconds in a day is offset from midnight in this parcel. + + llGetDisplayName + arguments - Number + AvatarID - type - integer tooltip - + Avatar UUID that is in the same region, or is otherwise known to the region. + type + key + energy + 10 + return + string + sleep + 0 tooltip - Returns the type (AGENT, ACTIVE, PASSIVE, SCRIPTED) of detected object.\nReturns 0 if number is not a valid index.\nNote that number is a bit-field, so comparisons need to be a bitwise checked. e.g.:\ninteger iType = llDetectedType(0);\n{\n // ...do stuff with the agent\n} + Returns the display name of an avatar, if the avatar is connected to the current region, or if the name has been cached. Otherwise, returns an empty string. Use llRequestDisplayName if the avatar may be absent from the region. - llDetectedVel + llGetEnergy + arguments + energy - 10.0 - sleep - 0.0 + 10 return - vector + float + sleep + 0 + tooltip + Returns how much energy is in the object as a percentage of maximum. + + llGetEnv + arguments - Number + DataRequest - type - integer tooltip - + The type of data to request. Any other string will cause an empty string to be returned. + type + string + energy + 10 + return + string + sleep + 0 tooltip - Returns the velocity of the detected object Number.\nReturns<0.0, 0.0, 0.0> if Number is not a valid offset. + Returns a string with the requested data about the region. - llDialog + llGetEnvironment - energy - 10.0 - sleep - 0.1 - return - void arguments - AvatarID + Position - type - key tooltip - - - - - Text - + Location within the region. type - string - tooltip - + vector - Buttons + EnvParams - type - list tooltip - - - - - Channel - + List of environment settings requested for the specified parcel location. type - integer - tooltip - + list - tooltip - Shows a dialog box on the avatar's screen with the message.\n - Up to 12 strings in the list form buttons.\n - If a button is clicked, the name is chatted on Channel.\nOpens a "notify box" in the given avatars screen displaying the message.\n - Up to twelve buttons can be specified in a list of strings. When the user clicks a button, the name of the button is said on the specified channel.\n - Channels work just like llSay(), so channel 0 can be heard by everyone.\n - The chat originates at the object's position, not the avatar's position, even though it is said as the avatar (uses avatar's UUID and Name etc.).\n - Examples:\n - llDialog(who, "Are you a boy or a girl?", [ "Boy", "Girl" ], -4913);\n - llDialog(who, "This shows only an OK button.", [], -192);\n - llDialog(who, "This chats so you can 'hear' it.", ["Hooray"], 0); - - llDie - energy - 0.0 - sleep - 0.0 + 10 return - void - arguments - + list + sleep + 0 tooltip - Delete the object which holds the script. + Returns a string with the requested data about the region. - llDumpList2String + llGetExperienceDetails - energy - 10.0 - sleep - 0.0 - return - string arguments - Source + ExperienceID - type - list tooltip - - - - - Separator - + May be NULL_KEY to retrieve the details for the script's Experience type - string - tooltip - + key + energy + 10 + return + list + sleep + 0 tooltip - Returns the list as a single string, using Separator between the entries.\nWrite the list out as a single string, using Separator between values. + + Returns a list with the following Experience properties: [Experience Name, Owner ID, Group ID, Experience ID, State, State Message]. State is an integer corresponding to one of the constants XP_ERROR_... and State Message is the string returned by llGetExperienceErrorMessage for that integer. + - llEdgeOfWorld + llGetExperienceErrorMessage - energy - 10.0 - sleep - 0.0 - return - integer arguments - Position + Error - type - vector tooltip - - - - - Direction - + An Experience error code to translate. type - vector - tooltip - + integer + energy + 10 + return + string + sleep + 0 tooltip - Checks to see whether the border hit by Direction from Position is the edge of the world (has no neighboring region).\nReturns TRUE if the line along Direction from Position hits the edge of the world in the current simulator, returns FALSE if that edge crosses into another simulator. + + Returns a string describing the error code passed or the string corresponding with XP_ERROR_UNKNOWN_ERROR if the value is not a valid Experience error code. + - llEjectFromLand + llGetForce + arguments + energy - 10.0 + 10 + return + vector sleep - 0.0 + 0 + tooltip + Returns the force (if the script is physical).\nReturns the current force if the script is physical. + + llGetFreeMemory + + arguments + + energy + 10 return - void + integer + sleep + 0 + tooltip + Returns the number of free bytes of memory the script can use.\nReturns the available free space for the current script. This is inaccurate with LSO. + + llGetFreeURLs + arguments - - - AvatarID - - type - key - tooltip - - - - + + energy + 10 + return + integer + sleep + 0 tooltip - Ejects AvatarID from land that you own.\nEjects AvatarID from land that the object owner (group or resident) owns. + Returns the number of available URLs for the current script.\nReturns an integer that is the number of available URLs. - llEmail + llGetGMTclock + arguments + energy - 10.0 + 10 + return + float sleep - 20.0 + 0 + tooltip + Returns the time in seconds since midnight GMT.\nGets the time in seconds since midnight in GMT/UTC. + + llGetGeometricCenter + + arguments + + energy + 10 return - void + vector + sleep + 0 + tooltip + Returns the vector that is the geometric center of the object relative to the root prim. + + llGetHTTPHeader + arguments - Address + HTTPRequestID - type - string tooltip - - - - - Subject - + A valid HTTP request key type - string - tooltip - + key - Text + Header + tooltip + Header value name type string - tooltip - - tooltip - Sends email to Address with Subject and Message.\nSends an email to Address with Subject and Message. - - llEscapeURL - energy - 10.0 - sleep - 0.0 + 10 return string + sleep + 0 + tooltip + Returns the value for header for request_id.\nReturns a string that is the value of the Header for HTTPRequestID. + + llGetHealth + arguments - URL + ID - type - string tooltip - + The ID of an agent or object in the region. + type + key + energy + 10 + return + float + sleep + 0 tooltip - Returns an escaped/encoded version of url, replacing spaces with %20 etc.\nReturns the string that is the URL-escaped version of URL (replacing spaces with %20, etc.).\n - This function returns the UTF-8 encoded escape codes for selected characters. + Returns the current health of an avatar or object in the region. - llEuler2Rot + llGetInventoryAcquireTime - energy - 10.0 - sleep - 0.0 - return - rotation arguments - Vector + InventoryItem - type - vector tooltip - + Name of item in prim inventory. + type + string + energy + 10 + return + string + sleep + 0 tooltip - Returns the rotation representation of the Euler angles.\nReturns the rotation represented by the Euler Angle. + Returns the time at which the item was placed into this prim's inventory as a timestamp. - llEvade + llGetInventoryCreator - energy - - sleep - - return - void arguments - TargetID + InventoryItem - type - key tooltip - Agent or object to evade. - - - - Options - + type - list - tooltip - No options yet. + string + energy + 10 + return + key + sleep + 0 tooltip - Evade a specified target.\nCharacters will (roughly) try to hide from their pursuers if there is a good hiding spot along their fleeing path. Hiding means no direct line of sight from the head of the character (centre of the top of its physics bounding box) to the head of its pursuer and no direct path between the two on the navigation-mesh. + Returns a key for the creator of the inventory item.\nThis function returns the UUID of the creator of item. If item is not found in inventory, the object says "No item named 'name'". - llExecCharacterCmd + llGetInventoryDesc - energy - - sleep - - return - void arguments - Command + InventoryItem - type - integer tooltip - Command to send. - - - - Options - + type - list - tooltip - Height for CHARACTER_CMD_JUMP. + string + energy + 10 + return + string + sleep + 0 tooltip - Execute a character command.\nSend a command to the path system.\nCurrently only supports stopping the current path-finding operation or causing the character to jump. + Returns the item description of the item in inventory. If item is not found in inventory, the object says "No item named 'name'" to the debug channel and returns an empty string. - llFabs + llGetInventoryKey - energy - 10.0 - sleep - 0.0 - return - float arguments - Value + InventoryItem - type - float tooltip - + + type + string + energy + 10 + return + key + sleep + 0 tooltip - Returns the positive version of Value.\nReturns the absolute value of Value. + Returns the key that is the UUID of the inventory named.\nReturns the key of the inventory named. - llFleeFrom + llGetInventoryName - energy - - sleep - - return - void arguments - Source + InventoryType - type - vector tooltip - Global coordinate from which to flee. - - - - Distance - + Inventory item type type - float - tooltip - Distance in meters to flee from the source. + integer - Options + Index - type - list tooltip - No options available at this time. + Index number of inventory item. + type + integer + energy + 10 + return + string + sleep + 0 tooltip - Flee from a point.\nDirects a character (llCreateCharacter) to keep away from a defined position in the region or adjacent regions. + Returns the name of the inventory item of a given type, specified by index number.\nUse the inventory constants INVENTORY_* to specify the type. - llFloor + llGetInventoryNumber - energy - 10.0 - sleep - 0.0 - return - integer arguments - Value + InventoryType - type - float tooltip - + Inventory item type + type + integer + energy + 10 + return + integer + sleep + 0 tooltip - Returns largest integer value <= Value. + Returns the quantity of items of a given type (INVENTORY_* flag) in the prim's inventory.\nUse the inventory constants INVENTORY_* to specify the type. - llForceMouselook + llGetInventoryPermMask - energy - 10.0 - sleep - 0.0 - return - void arguments - Enable + InventoryItem + tooltip + Inventory item name. type - integer + string + + + + BitMask + tooltip - Boolean, if TRUE when an avatar sits on the prim, the avatar will be forced into mouse-look mode.\nFALSE is the default setting and will undo a previously set TRUE or do nothing. + MASK_BASE, MASK_OWNER, MASK_GROUP, MASK_EVERYONE or MASK_NEXT + type + integer + energy + 10 + return + integer + sleep + 0 tooltip - If Enable is TRUE any avatar that sits on this object is forced into mouse-look mode.\nAfter calling this function with Enable set to TRUE, any agent sitting down on the prim will be forced into mouse-look.\nJust like llSitTarget, this changes a permanent property of the prim (not the object) and needs to be reset by calling this function with Enable set to FALSE in order to disable it. + Returns the requested permission mask for the inventory item.\nReturns the requested permission mask for the inventory item defined by InventoryItem. If item is not in the object's inventory, llGetInventoryPermMask returns FALSE and causes the object to say "No item named '<item>'", where "<item>" is item. - llFrand + llGetInventoryType - energy - 10.0 - sleep - 0.0 - return - float arguments - Magnitude + InventoryItem - type - float tooltip - + + type + string - tooltip - Returns a pseudo random number in the range [0, Magnitude] or [Magnitude, 0].\nReturns a pseudo-random number between [0, Magnitude]. - - llGenerateKey - energy - 0 + 10 + return + integer sleep 0 - return - key - arguments - tooltip - Generates a key (SHA-1 hash) using UUID generation to create a unique key.\nAs the UUID produced is versioned, it should never return a value of NULL_KEY.\nThe specific UUID version is an implementation detail that has changed in the past and may change again in the future. Do not depend upon the UUID that is returned to be version 5 SHA-1 hash. + Returns the type of the named inventory item.\nLike all inventory functions, llGetInventoryType is case-sensitive. - llGetAccel + llGetKey + arguments + energy - 10.0 - sleep - 0.0 + 10 return - vector - arguments - + key + sleep + 0 tooltip - Returns the acceleration of the object relative to the region's axes.\nGets the acceleration of the object. + Returns the key of the prim the script is attached to.\nGet the key for the object which has this script. - llGetAgentInfo + llGetLandOwnerAt - energy - 10.0 - sleep - 0.0 - return - integer arguments - AvatarID + Position - type - key tooltip - + + type + vector + energy + 10 + return + key + sleep + 0 tooltip - Returns an integer bit-field containing the agent information about id.\n - Returns AGENT_FLYING, AGENT_ATTACHMENTS, AGENT_SCRIPTED, AGENT_SITTING, AGENT_ON_OBJECT, AGENT_MOUSELOOK, AGENT_AWAY, AGENT_BUSY, AGENT_TYPING, AGENT_CROUCHING, AGENT_ALWAYS_RUN, AGENT_WALKING and/or AGENT_IN_AIR.\nReturns information about the given agent ID as a bit-field of agent info constants. + Returns the key of the land owner, returns NULL_KEY if public.\nReturns the key of the land owner at Position, or NULL_KEY if public. - llGetAgentLanguage + llGetLinkKey - energy - 10.0 - sleep - 0.0 - return - string arguments - AvatarID + LinkNumber - type - key tooltip - + + type + integer + energy + 10 + return + key + sleep + 0 tooltip - Returns the language code of the preferred interface language of the avatar.\nReturns a string that is the language code of the preferred interface language of the resident. + Returns the key of the linked prim LinkNumber.\nReturns the key of LinkNumber in the link set. - llGetAgentList + llGetLinkMedia - energy - 10.0 - sleep - 0.0 - return - list arguments - Scope + LinkNumber + tooltip + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag type integer - tooltip - The scope (region, parcel, parcel same owner) to return agents for. - Options + Face - type - list tooltip - List of options to apply. Current unused. + The prim's side number + type + integer - - tooltip - Requests a list of agents currently in the region, limited by the scope parameter.\nReturns a list [key UUID-0, key UUID-1, ..., key UUID-n] or [string error_msg] - returns avatar keys for all agents in the region limited to the area(s) specified by scope - - llGetAgentSize - - energy - 10.0 - sleep - 0.0 - return - vector - arguments - - AvatarID + Parameters - type - key tooltip - + A list of PRIM_* property constants to return values of. + type + list + energy + 10 + return + list + sleep + 0 tooltip - If the avatar is in the same region, returns the size of the bounding box of the requested avatar by id, otherwise returns ZERO_VECTOR.\nIf the agent is in the same region as the object, returns the size of the avatar. + Get the media parameters for a particular face on linked prim, given the desired list of parameter names. Returns a list of values in the order requested. Returns an empty list if no media exists on the face. - llGetAlpha + llGetLinkName - energy - 10.0 - sleep - 0.0 - return - float arguments - Face + LinkNumber + tooltip + type integer - tooltip - + energy + 10 + return + string + sleep + 0 tooltip - Returns the alpha value of Face.\nReturns the 'alpha' of the given face. If face is ALL_SIDES the value returned is the mean average of all faces. + Returns the name of LinkNumber in a link set.\nReturns the name of LinkNumber the link set. - llGetAndResetTime + llGetLinkNumber + arguments + energy - 10.0 - sleep - 0.0 + 10 return - float - arguments - + integer + sleep + 0 tooltip - Returns the script time in seconds and then resets the script timer to zero.\nGets the time in seconds since starting and resets the time to zero. + Returns the link number of the prim containing the script (0 means not linked, 1 the prim is the root, 2 the prim is the first child, etc.).\nReturns the link number of the prim containing the script. 0 means no link, 1 the root, 2 for first child, etc. - llGetAnimation + llGetLinkNumberOfSides - energy - 10.0 - sleep - 0.0 - return - string arguments - AvatarID + LinkNumber - type - key tooltip - + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag. + type + integer + energy + 10 + return + integer + sleep + 0 tooltip - Returns the name of the currently playing locomotion animation for the avatar id.\nReturns the currently playing animation for the specified avatar ID. + Returns the number of sides of the specified linked prim.\nReturns an integer that is the number of faces (or sides) of the prim link. - llGetAnimationList + llGetLinkPrimitiveParams - energy - 10.0 - sleep - 0.0 - return - list arguments - AvatarID + LinkNumber + tooltip + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag. type - key + integer + + + + Parameters + tooltip - + PRIM_* flags. + type + list - tooltip - Returns a list of keys of playing animations for an avatar.\nReturns a list of keys of all playing animations for the specified avatar ID. - - llGetAnimationOverride - energy - 0 + 10 + return + list sleep 0 - return - string + tooltip + Returns the list of primitive attributes requested in the Parameters list for LinkNumber.\nPRIM_* flags can be broken into three categories, face flags, prim flags, and object flags.\n* Supplying a prim or object flag will return that flags attributes.\n* Face flags require the user to also supply a face index parameter. + + llGetLinkSitFlags + arguments - AnimationState + LinkNumber - type - string tooltip - + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag. + type + integer - - tooltip - Returns a string that is the name of the animation that is used for the specified animation state\nTo use this function the script must obtain either the PERMISSION_OVERRIDE_ANIMATIONS or PERMISSION_TRIGGER_ANIMATION permission (automatically granted to attached objects). - - llGetAttached - + energy - 10.0 - sleep - 0.0 + 10 return integer - arguments - + sleep + 0 tooltip - Returns the object's attachment point, or 0 if not attached. + Returns the sit flags set on the specified prim in a linkset. - llGetAttachedList + llGetListEntryType - energy - 10.0 - sleep - 0.0 - return - list arguments - ID + ListVariable + tooltip + type - key + list + + + + Index + tooltip - Avatar to get attachments + + type + integer + energy + 10 + return + integer + sleep + 0 tooltip - Returns a list of keys of all visible (not HUD) attachments on the avatar identified by the ID argument + Returns the type of the index entry in the list (TYPE_INTEGER, TYPE_FLOAT, TYPE_STRING, TYPE_KEY, TYPE_VECTOR, TYPE_ROTATION, or TYPE_INVALID if index is off list).\nReturns the type of the variable at Index in ListVariable. - llGetBoundingBox + llGetListLength - energy - 10.0 - sleep - 0.0 - return - list arguments - ID + ListVariable - type - key tooltip - + + type + list + energy + 10 + return + integer + sleep + 0 tooltip - Returns the bounding box around the object (including any linked prims) relative to its root prim, as a list in the format [ (vector) min_corner, (vector) max_corner ]. + Returns the number of elements in the list.\nReturns the number of elements in ListVariable. - llGetCameraPos + llGetLocalPos + arguments + energy - 10.0 - sleep - 0.0 + 10 return vector - arguments - + sleep + 0 tooltip - Returns the current camera position for the agent the task has permissions for.\nReturns the position of the camera, of the user that granted the script PERMISSION_TRACK_CAMERA. If no user has granted the permission, it returns ZERO_VECTOR. + Returns the position relative to the root.\nReturns the local position of a child object relative to the root. - llGetCameraRot + llGetLocalRot + arguments + energy - 10.0 - sleep - 0.0 + 10 return rotation - arguments - + sleep + 0 tooltip - Returns the current camera orientation for the agent the task has permissions for. If no user has granted the PERMISSION_TRACK_CAMERA permission, returns ZERO_ROTATION. + Returns the rotation local to the root.\nReturns the local rotation of a child object relative to the root. - llGetCenterOfMass + llGetMass + arguments + energy - 10.0 - sleep - 0.0 + 10 return - vector - arguments - + float + sleep + 0 tooltip - Returns the prim's centre of mass (unless called from the root prim, where it returns the object's centre of mass). + Returns the mass of object that the script is attached to.\nReturns the scripted object's mass. When called from a script in a link-set, the parent will return the sum of the link-set weights, while a child will return just its own mass. When called from a script inside an attachment, this function will return the mass of the avatar it's attached to, not its own. - llGetClosestNavPoint + llGetMassMKS + arguments + energy - - sleep - + 10 return - list - arguments - - - Point - - type - vector - tooltip - A point in region-local space. - - - - Options - - type - list - tooltip - No options at this time. - - - + float + sleep + 0 tooltip - Get the closest navigable point to the point provided.\nThe function accepts a point in region-local space (like all the other path-finding methods) and returns either an empty list or a list containing a single vector which is the closest point on the navigation-mesh to the point provided. + Acts as llGetMass(), except that the units of the value returned are Kg. - llGetColor + llGetMaxScaleFactor + arguments + energy - 10.0 - sleep - 0.0 + 10 return - vector - arguments - - - Face - - type - integer - tooltip - - - - + float + sleep + 0 tooltip - Returns the color on Face.\nReturns the color of Face as a vector of red, green, and blue values between 0 and 1. If face is ALL_SIDES the color returned is the mean average of each channel. + Returns the largest multiplicative uniform scale factor that can be successfully applied (via llScaleByFactor()) to the object without violating prim size or linkability rules. - llGetCreator + llGetMemoryLimit + arguments + energy - 10.0 - sleep - 0.0 + 10 return - key - arguments - + integer + sleep + 0 tooltip - Returns a key for the creator of the prim.\nReturns the key of the object's original creator. Similar to llGetOwner. + Get the maximum memory a script can use, in bytes. - llGetDate + llGetMinScaleFactor + arguments + energy - 10.0 - sleep - 0.0 + 10 return - string - arguments - + float + sleep + 0 tooltip - Returns the current date in the UTC time zone in the format YYYY-MM-DD.\nReturns the current UTC date as YYYY-MM-DD. + Returns the smallest multiplicative uniform scale factor that can be successfully applied (via llScaleByFactor()) to the object without violating prim size or linkability rules. - llGetDisplayName + llGetMoonDirection + arguments + energy - 10.0 + 10 + return + vector sleep - 0.0 + 0 + tooltip + Returns a normalized vector of the direction of the moon in the parcel.\nReturns the moon's direction on the simulator in the parcel. + + llGetMoonRotation + + arguments + + energy + 10 return - string + rotation + sleep + 0 + tooltip + Returns the rotation applied to the moon in the parcel. + + llGetNextEmail + arguments - AvatarID + Address + tooltip + type - key + string + + + + Subject + tooltip - Avatar UUID that is in the same region, or is otherwise known to the region. + + type + string - tooltip - Returns the display name of an avatar, if the avatar is connected to the current region, or if the name has been cached. Otherwise, returns an empty string. Use llRequestDisplayName if the avatar may be absent from the region. - - llGetEnergy - energy - 10.0 - sleep - 0.0 + 10 return - float - arguments - + void + sleep + 0 tooltip - Returns how much energy is in the object as a percentage of maximum. + Fetch the next queued email with that matches the given address and/or subject, via the email event.\nIf the parameters are blank, they are not used for filtering. - llGetEnv + llGetNotecardLine - energy - 10.0 - sleep - 0.0 - return - string arguments - DataRequest + NotecardName + tooltip + type string + + + + LineNumber + tooltip - The type of data to request. Any other string will cause an empty string to be returned. + + type + integer + energy + 10 + return + key + sleep + 0.1000000000000000055511151 tooltip - Returns a string with the requested data about the region. + Returns LineNumber from NotecardName via the dataserver event. The line index starts at zero.\nIf the requested line is passed the end of the note-card the dataserver event will return the constant EOF string.\nThe key returned by this function is a unique identifier which will be supplied to the dataserver event in the requested parameter. - llGetExperienceDetails + llGetNotecardLineSync - energy - 10.0 - sleep - 0.0 - return - list arguments - - ExperienceID - - type - key - tooltip - May be NULL_KEY to retrieve the details for the script's Experience - - + + NotecardName + + tooltip + + type + string + + + + LineNumber + + tooltip + + type + integer + + - tooltip - - Returns a list with the following Experience properties: [Experience Name, Owner ID, Group ID, Experience ID, State, State Message]. State is an integer corresponding to one of the constants XP_ERROR_... and State Message is the string returned by llGetExperienceErrorMessage for that integer. - - - llGetExperienceErrorMessage - energy - 10.0 - sleep - 0.0 + 10 return string - arguments - - - Error - - type - integer - tooltip - An Experience error code to translate. - - - - tooltip - - Returns a string describing the error code passed or the string corresponding with XP_ERROR_UNKNOWN_ERROR if the value is not a valid Experience error code. - + sleep + 0 + tooltip + Returns LineNumber from NotecardName. The line index starts at zero.\nIf the requested line is past the end of the note-card the return value will be set to the constant EOF string.\nIf the note-card is not cached on the simulator the return value is the NAK string. - llGetForce + llGetNumberOfNotecardLines + arguments + + + NotecardName + + tooltip + + type + string + + + energy - 10.0 - sleep - 0.0 + 10 return - vector - arguments - + key + sleep + 0.1000000000000000055511151 tooltip - Returns the force (if the script is physical).\nReturns the current force if the script is physical. + Returns the number of lines contained within a notecard via the dataserver event.\nThe key returned by this function is a query ID for identifying the dataserver reply. - llGetFreeMemory + llGetNumberOfPrims + arguments + energy - 10.0 - sleep - 0.0 + 10 return integer - arguments - + sleep + 0 tooltip - Returns the number of free bytes of memory the script can use.\nReturns the available free space for the current script. This is inaccurate with LSO. + Returns the number of prims in a link set the script is attached to.\nReturns the number of prims in (and avatars seated on) the object the script is in. - llGetFreeURLs + llGetNumberOfSides + arguments + energy - 10.0 - sleep - 0.0 + 10 return integer - arguments - + sleep + 0 tooltip - Returns the number of available URLs for the current script.\nReturns an integer that is the number of available URLs. + Returns the number of faces (or sides) of the prim.\nReturns the number of sides of the prim which has the script. - llGetGeometricCenter + llGetObjectAnimationNames + arguments + energy - 10.0 - sleep - 0.0 + 10 return - vector - arguments - + list + sleep + 0 tooltip - Returns the vector that is the geometric center of the object relative to the root prim. + Returns a list of names of playing animations for an object.\nReturns a list of names of all playing animations for the current object. - llGetGMTclock + llGetObjectDesc + arguments + energy - 10.0 - sleep - 0.0 + 10 return - float - arguments - + string + sleep + 0 tooltip - Returns the time in seconds since midnight GMT.\nGets the time in seconds since midnight in GMT/UTC. + Returns the description of the prim the script is attached to.\nReturns the description of the scripted object/prim. You can set the description using llSetObjectDesc. - llGetHTTPHeader + llGetObjectDetails - energy - 10.0 - sleep - 0.0 - return - string arguments - HTTPRequestID + ID + tooltip + Prim or avatar UUID that is in the same region. type key - tooltip - A valid HTTP request key - Header + Parameters - type - string tooltip - Header value name + List of OBJECT_* flags. + type + list + energy + 10 + return + list + sleep + 0 tooltip - Returns the value for header for request_id.\nReturns a string that is the value of the Header for HTTPRequestID. + Returns a list of object details specified in the Parameters list for the object or avatar in the region with key ID.\nParameters are specified by the OBJECT_* constants. - llGetInventoryCreator + llGetObjectLinkKey - energy - 10.0 - sleep - 0.0 - return - key arguments - InventoryItem + id + tooltip + UUID of prim type - string + key + + + + link_no + tooltip - + Link number to retrieve + type + integer - tooltip - Returns a key for the creator of the inventory item.\nThis function returns the UUID of the creator of item. If item is not found in inventory, the object says "No item named 'name'". - - llGetInventoryKey - energy - 10.0 - sleep - 0.0 + 10 return key + sleep + 0 + tooltip + Returns the key of the linked prim link_no in a linkset.\nReturns the key of link_no in the link set specified by id. + + llGetObjectMass + arguments - InventoryItem + ID - type - string tooltip - + + type + key + energy + 10 + return + float + sleep + 0 tooltip - Returns the key that is the UUID of the inventory named.\nReturns the key of the inventory named. + Returns the mass of the avatar or object in the region.\nGets the mass of the object or avatar corresponding to ID. - llGetInventoryName + llGetObjectName + arguments + energy - 10.0 - sleep - 0.0 + 10 return string + sleep + 0 + tooltip + Returns the name of the prim which the script is attached to.\nReturns the name of the prim (not object) which contains the script. + + llGetObjectPermMask + arguments - InventoryType + Category - type - integer tooltip - Inventory item type - - - - Index - + Category is one of MASK_BASE, MASK_OWNER, MASK_GROUP, MASK_EVERYONE, or MASK_NEXT type integer - tooltip - Index number of inventory item. - tooltip - Returns the name of the inventory item of a given type, specified by index number.\nUse the inventory constants INVENTORY_* to specify the type. - - llGetInventoryNumber - energy - 10.0 - sleep - 0.0 + 10 return integer + sleep + 0 + tooltip + Returns the permission mask of the requested category for the object. + + llGetObjectPrimCount + arguments - InventoryType + ObjectID - type - integer tooltip - Inventory item type + + type + key + energy + 10 + return + integer + sleep + 0 tooltip - Returns the quantity of items of a given type (INVENTORY_* flag) in the prim's inventory.\nUse the inventory constants INVENTORY_* to specify the type. + Returns the total number of prims for an object in the region.\nReturns the prim count for any object id in the same region. - llGetInventoryPermMask + llGetOmega + arguments + energy - 10.0 + 10 + return + vector sleep - 0.0 + 0 + tooltip + Returns the rotation velocity in radians per second.\nReturns a vector that is the rotation velocity of the object in radians per second. + + llGetOwner + + arguments + + energy + 10 return - integer + key + sleep + 0 + tooltip + Returns the object owner's UUID.\nReturns the key for the owner of the object. + + llGetOwnerKey + arguments - InventoryItem + ObjectID - type - string tooltip - Inventory item name. - - - - BitMask - + type - integer - tooltip - MASK_BASE, MASK_OWNER, MASK_GROUP, MASK_EVERYONE or MASK_NEXT + key + energy + 10 + return + key + sleep + 0 tooltip - Returns the requested permission mask for the inventory item.\nReturns the requested permission mask for the inventory item defined by InventoryItem. If item is not in the object's inventory, llGetInventoryPermMask returns FALSE and causes the object to say "No item named '<item>'", where "<item>" is item. + Returns the owner of ObjectID.\nReturns the key for the owner of object ObjectID. - llGetInventoryType + llGetParcelDetails - energy - 10.0 - sleep - 0.0 - return - integer arguments - InventoryItem + Position + tooltip + Location within the region. type - string + vector + + + + ParcelDetails + tooltip - + List of details requested for the specified parcel location. + type + list - tooltip - Returns the type of the named inventory item.\nLike all inventory functions, llGetInventoryType is case-sensitive. - - llGetKey - energy - 10.0 - sleep - 0.0 + 10 return - key - arguments - + list + sleep + 0 tooltip - Returns the key of the prim the script is attached to.\nGet the key for the object which has this script. + Returns a list of parcel details specified in the ParcelDetails list for the parcel at Position.\nParameters is one or more of: PARCEL_DETAILS_NAME, _DESC, _OWNER, _GROUP, _AREA, _ID, _SEE_AVATARS.\nReturns a list that is the parcel details specified in ParcelDetails (in the same order) for the parcel at Position. - llGetLandOwnerAt - - energy - 10.0 - sleep - 0.0 - return - key + llGetParcelFlags + arguments Position + tooltip + type vector - tooltip - + energy + 10 + return + integer + sleep + 0 tooltip - Returns the key of the land owner, returns NULL_KEY if public.\nReturns the key of the land owner at Position, or NULL_KEY if public. + Returns a mask of the parcel flags (PARCEL_FLAG_*) for the parcel that includes the point Position.\nReturns a bit-field specifying the parcel flags (PARCEL_FLAG_*) for the parcel at Position. - llGetLinkKey + llGetParcelMaxPrims - energy - 10.0 - sleep - 0.0 - return - key arguments - LinkNumber + Position + tooltip + Region coordinates (z is ignored) of parcel. type - integer + vector + + + + SimWide + tooltip - + Boolean. If FALSE then the return is the maximum prims supported by the parcel. If TRUE then it is the combined number of prims on all parcels in the region owned by the specified parcel's owner. + type + integer + energy + 10 + return + integer + sleep + 0 tooltip - Returns the key of the linked prim LinkNumber.\nReturns the key of LinkNumber in the link set. + Returns the maximum number of prims allowed on the parcel at Position for a given scope.\nThe scope may be set to an individual parcel or the combined resources of all parcels with the same ownership in the region. - llGetLinkMedia + llGetParcelMusicURL + arguments + energy - 0.0 - sleep - 0.0 + 10 return - list + string + sleep + 0 + tooltip + Gets the streaming audio URL for the parcel object is on.\nThe object owner, avatar or group, must also be the land owner. + + llGetParcelPrimCount + arguments - LinkNumber + Position - type - integer tooltip - Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag + Region coordinates of parcel to query. + type + vector - Face + Category + tooltip + A PARCEL_COUNT_* flag. type integer - tooltip - The prim's side number - Parameters + SimWide - type - list tooltip - A list of PRIM_* property constants to return values of. + Boolean. If FALSE then the return is the maximum prims supported by the parcel. If TRUE then it is the combined number of prims on all parcels in the region owned by the specified parcel's owner. + type + integer + energy + 10 + return + integer + sleep + 0 tooltip - Get the media parameters for a particular face on linked prim, given the desired list of parameter names. Returns a list of values in the order requested. Returns an empty list if no media exists on the face. + Returns the number of prims on the parcel at Position of the given category.\nCategories: PARCEL_COUNT_TOTAL, _OWNER, _GROUP, _OTHER, _SELECTED, _TEMP.\nReturns the number of prims used on the parcel at Position which are in Category.\nIf SimWide is TRUE, it returns the total number of objects for all parcels with matching ownership in the category specified.\nIf SimWide is FALSE, it returns the number of objects on this specific parcel in the category specified - llGetLinkName + llGetParcelPrimOwners - energy - 10.0 - sleep - 0.0 - return - string arguments - LinkNumber + Position - type - integer tooltip - + + type + vector + energy + 10 + return + list + sleep + 2 tooltip - Returns the name of LinkNumber in a link set.\nReturns the name of LinkNumber the link set. + Returns a list of up to 100 residents who own objects on the parcel at Position, with per-owner land impact totals.\nRequires owner-like permissions for the parcel, and for the script owner to be present in the region.\nThe list is formatted as [ key agentKey1, integer agentLI1, key agentKey2, integer agentLI2, ... ], sorted by agent key.\nThe integers are the combined land impacts of the objects owned by the corresponding agents. - llGetLinkNumber + llGetPermissions + arguments + energy - 10.0 - sleep - 0.0 + 10 return integer - arguments - + sleep + 0 tooltip - Returns the link number of the prim containing the script (0 means not linked, 1 the prim is the root, 2 the prim is the first child, etc.).\nReturns the link number of the prim containing the script. 0 means no link, 1 the root, 2 for first child, etc. + Returns an integer bitmask of the permissions that have been granted to the script. Individual permissions can be determined using a bit-wise "and" operation against the PERMISSION_* constants - llGetLinkNumberOfSides + llGetPermissionsKey + arguments + energy - 10.0 - sleep - 0.0 + 10 return - integer - arguments - - - LinkNumber - - type - integer - tooltip - Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag. - - - + key + sleep + 0 tooltip - Returns the number of sides of the specified linked prim.\nReturns an integer that is the number of faces (or sides) of the prim link. + Returns the key of the avatar that last granted or declined permissions to the script.\nReturns NULL_KEY if permissions were never granted or declined. - llGetLinkPrimitiveParams + llGetPhysicsMaterial + arguments + energy - 10.0 - sleep - 0.0 + 10 return list + sleep + 0 + tooltip + Returns a list of the form [float gravity_multiplier, float restitution, float friction, float density]. + + llGetPos + + arguments + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the position of the task in region coordinates.\nReturns the vector position of the task in region coordinates. + + llGetPrimMediaParams + arguments - LinkNumber + Face + tooltip + face number type integer - tooltip - Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag. Parameters + tooltip + One or more PRIM_MEDIA_* flags type list - tooltip - PRIM_* flags. + energy + 10 + return + list + sleep + 1 tooltip - Returns the list of primitive attributes requested in the Parameters list for LinkNumber.\nPRIM_* flags can be broken into three categories, face flags, prim flags, and object flags.\n* Supplying a prim or object flag will return that flags attributes.\n* Face flags require the user to also supply a face index parameter. + Returns the media parameters for a particular face on an object, given the desired list of parameter names, in the order requested. Returns an empty list if no media exists on the face. - llGetListEntryType + llGetPrimitiveParams - energy - 10.0 - sleep - 0.0 - return - integer arguments - ListVariable + Parameters - type - list tooltip - - - - - Index - + PRIM_* flags and face parameters type - integer - tooltip - + list + energy + 10 + return + list + sleep + 0.2000000000000000111022302 tooltip - Returns the type of the index entry in the list (TYPE_INTEGER, TYPE_FLOAT, TYPE_STRING, TYPE_KEY, TYPE_VECTOR, TYPE_ROTATION, or TYPE_INVALID if index is off list).\nReturns the type of the variable at Index in ListVariable. + Returns the primitive parameters specified in the parameters list.\nReturns primitive parameters specified in the Parameters list. - llGetListLength + llGetRegionAgentCount + + arguments + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the number of avatars in the region.\nReturns an integer that is the number of avatars in the region. + + llGetRegionCorner + arguments + energy - 10.0 + 10 + return + vector sleep - 0.0 + 0 + tooltip + Returns a vector, in meters, that is the global location of the south-west corner of the region which the object is in.\nReturns the Region-Corner of the simulator containing the task. The region-corner is a vector (values in meters) representing distance from the first region. + + llGetRegionDayLength + + arguments + + energy + 10 return integer + sleep + 0 + tooltip + Returns the number of seconds in a day in this region. + + llGetRegionDayOffset + arguments - - - ListVariable - - type - list - tooltip - - - - + + energy + 10 + return + integer + sleep + 0 tooltip - Returns the number of elements in the list.\nReturns the number of elements in ListVariable. + Returns the number of seconds in a day is offset from midnight in this parcel. - llGetLocalPos + llGetRegionFPS + + arguments + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the mean region frames per second. + + llGetRegionFlags + arguments + energy - 10.0 + 10 + return + integer sleep - 0.0 + 0 + tooltip + Returns the region flags (REGION_FLAG_*) for the region the object is in.\nReturns a bit-field specifying the region flags (REGION_FLAG_*) for the region the object is in. + + llGetRegionMoonDirection + + arguments + + energy + 10 return vector - arguments - + sleep + 0 tooltip - Returns the position relative to the root.\nReturns the local position of a child object relative to the root. + Returns a normalized vector of the direction of the moon in the region.\nReturns the moon's direction on the simulator. - llGetLocalRot + llGetRegionMoonRotation + arguments + energy - 10.0 - sleep - 0.0 + 10 return rotation - arguments - + sleep + 0 tooltip - Returns the rotation local to the root.\nReturns the local rotation of a child object relative to the root. + Returns the rotation applied to the moon in the region. - llGetMass + llGetRegionName + arguments + energy - 10.0 - sleep - 0.0 + 10 return - float - arguments - + string + sleep + 0 tooltip - Returns the mass of object that the script is attached to.\nReturns the scripted object's mass. When called from a script in a link-set, the parent will return the sum of the link-set weights, while a child will return just its own mass. When called from a script inside an attachment, this function will return the mass of the avatar it's attached to, not its own. + Returns the current region name. - llGetMassMKS + llGetRegionSunDirection + arguments + energy - - sleep - 0.0 + 10 return - float - arguments - + vector + sleep + 0 tooltip - Acts as llGetMass(), except that the units of the value returned are Kg. + Returns a normalized vector of the direction of the sun in the region.\nReturns the sun's direction on the simulator. - llGetMaxScaleFactor + llGetRegionSunRotation + arguments + energy - 10.0 - sleep - 0.0 + 10 return - float - arguments - + rotation + sleep + 0 tooltip - Returns a float that is the largest scaling factor that can be used with llScaleByFactor to resize the object. This maximum is determined by the Linkability Rules and prim scale limits. + Returns the rotation applied to the sun in the region. - llGetMemoryLimit + llGetRegionTimeDilation + arguments + energy - - sleep - 0.0 + 10 return - integer - arguments - + float + sleep + 0 tooltip - Get the maximum memory a script can use, in bytes. + Returns the current time dilation as a float between 0.0 (full dilation) and 1.0 (no dilation).\nReturns the current time dilation as a float between 0.0 and 1.0. - llGetMinScaleFactor + llGetRegionTimeOfDay + arguments + energy - 10.0 - sleep - 0.0 + 10 return float - arguments - + sleep + 0 tooltip - Returns a float that is the smallest scaling factor that can be used with llScaleByFactor to resize the object. This minimum is determined by the prim scale limits. + Returns the time in seconds since environmental midnight for the entire region. - llGetNextEmail + llGetRenderMaterial - energy - 10.0 - sleep - 0.0 - return - void arguments - Address + Face - type - string tooltip - - - - - Subject - + type - string - tooltip - + integer + energy + 10 + return + string + sleep + 0 tooltip - Fetch the next queued email with that matches the given address and/or subject, via the email event.\nIf the parameters are blank, they are not used for filtering. + Returns a string that is the render material on face (the inventory name if it is a material in the prim's inventory, otherwise the key).\nReturns the render material of a face, if it is found in object inventory, its key otherwise. - llGetNotecardLine + llGetRootPosition + arguments + energy - 10.0 - sleep - 0.1 + 10 return - key - arguments - - - NotecardName - - type - string - tooltip - - - - - LineNumber - - type - integer - tooltip - - - - + vector + sleep + 0 tooltip - Returns LineNumber from NotecardName via the dataserver event. The line index starts at zero.\nIf the requested line is passed the end of the note-card the dataserver event will return the constant EOF string.\nThe key returned by this function is a unique identifier which will be supplied to the dataserver event in the requested parameter. + Returns the position (in region coordinates) of the root prim of the object which the script is attached to.\nThis is used to allow a child prim to determine where the root is. - llGetNumberOfNotecardLines + llGetRootRotation + arguments + energy - 10.0 - sleep - 0.1 + 10 return - key - arguments - - - NotecardName - - type - string - tooltip - - - - + rotation + sleep + 0 tooltip - Returns the number of lines contained within a notecard via the dataserver event.\nThe key returned by this function is a query ID for identifying the dataserver reply. + Returns the rotation (relative to the region) of the root prim of the object which the script is attached to.\nGets the global rotation of the root object of the object script is attached to. - llGetNumberOfPrims + llGetRot + arguments + energy - 10.0 - sleep - 0.0 + 10 return - integer - arguments - + rotation + sleep + 0 tooltip - Returns the number of prims in a link set the script is attached to.\nReturns the number of prims in (and avatars seated on) the object the script is in. + Returns the rotation relative to the region's axes.\nReturns the rotation. - llGetNumberOfSides + llGetSPMaxMemory + arguments + energy - 10.0 - sleep - 0.0 + 10 return integer - arguments - + sleep + 0 tooltip - Returns the number of faces (or sides) of the prim.\nReturns the number of sides of the prim which has the script. + Returns the maximum used memory for the current script. Only valid after using PROFILE_SCRIPT_MEMORY. Non-mono scripts always use 16k.\nReturns the integer of the most bytes used while llScriptProfiler was last active. - llGetObjectDesc + llGetScale + arguments + energy - 10.0 - sleep - 0.0 + 10 return - string - arguments - + vector + sleep + 0 tooltip - Returns the description of the prim the script is attached to.\nReturns the description of the scripted object/prim. You can set the description using llSetObjectDesc. + Returns the scale of the prim.\nReturns a vector that is the scale (dimensions) of the prim. - llGetObjectDetails + llGetScriptName + arguments + energy - 10.0 - sleep - 0.0 + 10 return - list - arguments - - - ID - - type - key - tooltip - Prim or avatar UUID that is in the same region. - - - - Parameters - - type - list - tooltip - List of OBJECT_* flags. - - - + string + sleep + 0 tooltip - Returns a list of object details specified in the Parameters list for the object or avatar in the region with key ID.\nParameters are specified by the OBJECT_* constants. + Returns the name of the script that this function is used in.\nReturns the name of this script. - llGetObjectMass + llGetScriptState - energy - 10.0 - sleep - 0.0 - return - float arguments - ID + ScriptName - type - key tooltip - + + type + string - tooltip - Returns the mass of the avatar or object in the region.\nGets the mass of the object or avatar corresponding to ID. - - llGetObjectName - energy - 10.0 - sleep - 0.0 + 10 return - string - arguments - + integer + sleep + 0 tooltip - Returns the name of the prim which the script is attached to.\nReturns the name of the prim (not object) which contains the script. + Returns TRUE if the script named is running.\nReturns TRUE if ScriptName is running. - llGetObjectPermMask + llGetSimStats - energy - 10.0 - sleep - 0.0 - return - integer arguments - Category + StatType + tooltip + Statistic type. type integer - tooltip - Category is one of MASK_BASE, MASK_OWNER, MASK_GROUP, MASK_EVERYONE, or MASK_NEXT - tooltip - Returns the permission mask of the requested category for the object. - - llGetObjectPrimCount - energy - 10.0 - sleep - 0.0 + 10 return - integer - arguments - - - ObjectID - - type - key - tooltip - - - - + float + sleep + 0 tooltip - Returns the total number of prims for an object in the region.\nReturns the prim count for any object id in the same region. + Returns a float that is the requested statistic. - llGetOmega + llGetSimulatorHostname + arguments + energy - 10.0 - sleep - 0.0 + 10 return - vector - arguments - + string + sleep + 10 tooltip - Returns the rotation velocity in radians per second.\nReturns a vector that is the rotation velocity of the object in radians per second. + Returns the host-name of the machine which the script is running on.\nFor example, "sim225.agni.lindenlab.com". - llGetOwner + llGetStartParameter + arguments + energy - 10.0 - sleep - 0.0 + 10 return - key - arguments - + integer + sleep + 0 tooltip - Returns the object owner's UUID.\nReturns the key for the owner of the object. + Returns an integer that is the script rez parameter.\nIf the object was rezzed by an agent, this function returns 0. - llGetOwnerKey + llGetStartString + arguments + energy - 10.0 - sleep - 0.0 + 10 return - key + string + sleep + 0 + tooltip + Returns an string that is the value passed to llRezObjectWithParams with REZ_PARAM_STRING.\nIf the object was rezzed by an agent, this function returns an empty string. + + llGetStaticPath + arguments - ObjectID + Start - type - key tooltip - + Starting position. + type + vector - - tooltip - Returns the owner of ObjectID.\nReturns the key for the owner of object ObjectID. - - llGetParcelDetails - - energy - 10.0 - sleep - 0.0 - return - list - arguments - - Position + End + tooltip + Ending position. type vector + + + + Radius + tooltip - Location within the region. + Radius of the character that the path is for, between 0.125m and 5.0m. + type + float - ParcelDetails + Parameters + tooltip + Currently only accepts the parameter CHARACTER_TYPE; the options are identical to those used for llCreateCharacter. The default value is CHARACTER_TYPE_NONE. type list - tooltip - List of details requested for the specified parcel location. + energy + 10 + return + list + sleep + 0 tooltip - Returns a list of parcel details specified in the ParcelDetails list for the parcel at Position.\nParameters is one or more of: PARCEL_DETAILS_NAME, _DESC, _OWNER, _GROUP, _AREA, _ID, _SEE_AVATARS.\nReturns a list that is the parcel details specified in ParcelDetails (in the same order) for the parcel at Position. + - llGetParcelFlags + llGetStatus - energy - 10.0 - sleep - 0.0 - return - integer arguments - Position + StatusFlag - type - vector tooltip - + A STATUS_* flag + type + integer - tooltip - Returns a mask of the parcel flags (PARCEL_FLAG_*) for the parcel that includes the point Position.\nReturns a bit-field specifying the parcel flags (PARCEL_FLAG_*) for the parcel at Position. - - llGetParcelMaxPrims - energy - 10.0 - sleep - 0.0 + 10 return integer + sleep + 0 + tooltip + Returns boolean value of the specified status (e.g. STATUS_PHANTOM) of the object the script is attached to. + + llGetSubString + arguments - Position + String - type - vector tooltip - Region coordinates (z is ignored) of parcel. + + type + string - SimWide + Start + tooltip + type integer + + + + End + tooltip - Boolean. If FALSE then the return is the maximum prims supported by the parcel. If TRUE then it is the combined number of prims on all parcels in the region owned by the specified parcel's owner. + + type + integer + energy + 10 + return + string + sleep + 0 tooltip - Returns the maximum number of prims allowed on the parcel at Position for a given scope.\nThe scope may be set to an individual parcel or the combined resources of all parcels with the same ownership in the region. + Returns a sub-string from String, in a range specified by the Start and End indicies (inclusive).\nUsing negative numbers for Start and/or End causes the index to count backwards from the length of the string, so 0, -1 would capture the entire string.\nIf Start is greater than End, the sub string is the exclusion of the entries. - llGetParcelMusicURL + llGetSunDirection + arguments + energy - - sleep - + 10 return - string - arguments - + vector + sleep + 0 tooltip - Gets the streaming audio URL for the parcel object is on.\nThe object owner, avatar or group, must also be the land owner. + Returns a normalized vector of the direction of the sun in the parcel.\nReturns the sun's direction on the simulator in the parcel. - llGetParcelPrimCount + llGetSunRotation + arguments + energy - 10.0 - sleep - 0.0 + 10 return - integer + rotation + sleep + 0 + tooltip + Returns the rotation applied to the sun in the parcel. + + llGetTexture + arguments - Position + Face - type - vector tooltip - Region coordinates of parcel to query. + + type + integer + + energy + 10 + return + string + sleep + 0 + tooltip + Returns a string that is the texture on face (the inventory name if it is a texture in the prim's inventory, otherwise the key).\nReturns the texture of a face, if it is found in object inventory, its key otherwise. + + llGetTextureOffset + + arguments + - Category + Face + tooltip + type integer - tooltip - A PARCEL_COUNT_* flag. + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the texture offset of face in the x and y components of a vector. + + llGetTextureRot + + arguments + - SimWide + Face + tooltip + type integer - tooltip - Boolean. If FALSE then the return is the maximum prims supported by the parcel. If TRUE then it is the combined number of prims on all parcels in the region owned by the specified parcel's owner. + energy + 10 + return + float + sleep + 0 tooltip - Returns the number of prims on the parcel at Position of the given category.\nCategories: PARCEL_COUNT_TOTAL, _OWNER, _GROUP, _OTHER, _SELECTED, _TEMP.\nReturns the number of prims used on the parcel at Position which are in Category.\nIf SimWide is TRUE, it returns the total number of objects for all parcels with matching ownership in the category specified.\nIf SimWide is FALSE, it returns the number of objects on this specific parcel in the category specified + Returns the texture rotation of side. - llGetParcelPrimOwners + llGetTextureScale - energy - 10.0 - sleep - 2.0 - return - list arguments - Position + Face - type - vector tooltip - + + type + integer + energy + 10 + return + vector + sleep + 0 tooltip - Returns a list of up to 100 residents who own objects on the parcel at Position, with per-owner land impact totals.\nRequires owner-like permissions for the parcel, and for the script owner to be present in the region.\nThe list is formatted as [ key agentKey1, integer agentLI1, key agentKey2, integer agentLI2, ... ], sorted by agent key.\nThe integers are the combined land impacts of the objects owned by the corresponding agents. + Returns the texture scale of side in the x and y components of a vector.\nReturns the texture scale of a side in the x and y components of a vector. - llGetPermissions + llGetTime + arguments + energy - 10.0 + 10 + return + float sleep - 0.0 + 0 + tooltip + Returns the time in seconds since the last region reset, script reset, or call to either llResetTime or llGetAndResetTime. + + llGetTimeOfDay + + arguments + + energy + 10 return - integer + float + sleep + 0 + tooltip + Returns the time in seconds since environmental midnight on the parcel. + + llGetTimestamp + arguments - + + energy + 10 + return + string + sleep + 0 tooltip - Returns an integer bitmask of the permissions that have been granted to the script. Individual permissions can be determined using a bit-wise "and" operation against the PERMISSION_* constants + Returns a time-stamp (UTC time zone) in the format: YYYY-MM-DDThh:mm:ss.ff..fZ. - llGetPermissionsKey + llGetTorque + arguments + energy - 10.0 + 10 + return + vector sleep - 0.0 + 0 + tooltip + Returns the torque (if the script is physical).\nReturns a vector that is the torque (if the script is physical). + + llGetUnixTime + + arguments + + energy + 10 return - key + integer + sleep + 0 + tooltip + Returns the number of seconds elapsed since 00:00 hours, Jan 1, 1970 UTC from the system clock. + + llGetUsedMemory + arguments - + + energy + 10 + return + integer + sleep + 0 tooltip - Returns the key of the avatar that last granted or declined permissions to the script.\nReturns NULL_KEY if permissions were never granted or declined. + Returns the current used memory for the current script. Non-mono scripts always use 16K.\nReturns the integer of the number of bytes of memory currently in use by the script. Non-mono scripts always use 16K. - llGetPhysicsMaterial + llGetUsername + arguments + + + AvatarID + + tooltip + + type + key + + + energy - - sleep - + 10 return - list - arguments - + string + sleep + 0 tooltip - Returns a list of the form [float gravity_multiplier, float restitution, float friction, float density]. + Returns the username of an avatar, if the avatar is connected to the current region, or if the name has been cached. Otherwise, returns an empty string. Use llRequestUsername if the avatar may be absent from the region. - llGetPos + llGetVel + arguments + energy - 10.0 - sleep - 0.0 + 10 return vector - arguments - + sleep + 0 tooltip - Returns the position of the task in region coordinates.\nReturns the vector position of the task in region coordinates. + Returns the velocity of the object.\nReturns a vector that is the velocity of the object. - llGetPrimitiveParams + llGetVisualParams - energy - 10.0 - sleep - 0.2 - return - list arguments + + ID + + tooltip + Avatar UUID in the same region. + type + key + + Parameters + tooltip + List of visual parameter IDs. type list - tooltip - PRIM_* flags and face parameters + energy + 10 + return + list + sleep + 0 tooltip - Returns the primitive parameters specified in the parameters list.\nReturns primitive parameters specified in the Parameters list. + Returns a list of the current value for each requested visual parameter. - llGetPrimMediaParams + llGetWallclock + arguments + energy - 10.0 - sleep - 0.1 + 10 return - list + float + sleep + 0 + tooltip + Returns the time in seconds since midnight California Pacific time (PST/PDT).\nReturns the time in seconds since simulator's time-zone midnight (Pacific Time). + + llGiveAgentInventory + arguments - Face + AgentID + tooltip + An agent in the region. type - integer + key + + + + FolderName + tooltip - face number + Folder name to give to the agent. + type + string - Parameters + InventoryItems + tooltip + Inventory items to give to the agent. type list + + + + Options + tooltip - One or more PRIM_MEDIA_* flags + A list of option for inventory transfer. + type + list - tooltip - Returns the media parameters for a particular face on an object, given the desired list of parameter names, in the order requested. Returns an empty list if no media exists on the face. - - llGetRegionAgentCount - energy - 10.0 - sleep - 0.0 + 10 return integer - arguments - - tooltip - Returns the number of avatars in the region.\nReturns an integer that is the number of avatars in the region. - - llGetRegionCorner - - energy - 10.0 sleep - 0.0 - return - vector - arguments - + 3 tooltip - Returns a vector, in meters, that is the global location of the south-west corner of the region which the object is in.\nReturns the Region-Corner of the simulator containing the task. The region-corner is a vector (values in meters) representing distance from the first region. + Give InventoryItems to the specified agent as a new folder of items, as permitted by the permissions system. The target must be an agent. - llGetRegionFlags + llGiveInventory - energy - 10.0 - sleep - 0.0 - return - integer arguments - - tooltip - Returns the region flags (REGION_FLAG_*) for the region the object is in.\nReturns a bit-field specifying the region flags (REGION_FLAG_*) for the region the object is in. - - llGetRegionFPS - + + + TargetID + + tooltip + + type + key + + + + InventoryItem + + tooltip + + type + string + + + energy - 10.0 - sleep - 0.0 + 10 return - float - arguments - - tooltip - Returns the mean region frames per second. - - llGetRegionName - - energy - 10.0 + void sleep - 0.0 - return - string - arguments - + 0 tooltip - Returns the current region name. + Give InventoryItem to destination represented by TargetID, as permitted by the permissions system.\nTargetID may be any agent or an object in the same region. - llGetRegionTimeDilation + llGiveInventoryList - energy - 10.0 - sleep - 0.0 - return - float arguments - - tooltip - Returns the current time dilation as a float between 0.0 (full dilation) and 1.0 (no dilation).\nReturns the current time dilation as a float between 0.0 and 1.0. - - llGetRootPosition - + + + TargetID + + tooltip + + type + key + + + + FolderName + + tooltip + + type + string + + + + InventoryItems + + tooltip + + type + list + + + energy - 10.0 - sleep - 0.0 + 10 return - vector - arguments - - tooltip - Returns the position (in region coordinates) of the root prim of the object which the script is attached to.\nThis is used to allow a child prim to determine where the root is. - - llGetRootRotation - - energy - 10.0 + void sleep - 0.0 - return - rotation - arguments - + 3 tooltip - Returns the rotation (relative to the region) of the root prim of the object which the script is attached to.\nGets the global rotation of the root object of the object script is attached to. + Give InventoryItems to destination (represented by TargetID) as a new folder of items, as permitted by the permissions system.\nTargetID may be any agent or an object in the same region. If TargetID is an object, the items are passed directly to the object inventory (no folder is created). - llGetRot + llGiveMoney - energy - 10.0 - sleep - 0.0 - return - rotation arguments - - tooltip - Returns the rotation relative to the region's axes.\nReturns the rotation. - - llGetScale - + + + AvatarID + + tooltip + + type + key + + + + Amount + + tooltip + + type + integer + + + energy - 10.0 - sleep - 0.0 + 10 return - vector - arguments - + integer + sleep + 0 tooltip - Returns the scale of the prim.\nReturns a vector that is the scale (dimensions) of the prim. + Transfers Amount of L$ from script owner to AvatarID.\nThis call will silently fail if PERMISSION_DEBIT has not been granted. - llGetScriptName + llGodLikeRezObject + arguments + + + InventoryItemID + + tooltip + + type + key + + + + Position + + tooltip + + type + vector + + + energy - 10.0 - sleep - 0.0 + 10 + god-mode + 1 return - string - arguments - + void + sleep + 0 tooltip - Returns the name of the script that this function is used in.\nReturns the name of this script. + Rez directly off of a UUID if owner has god-bit set. - llGetScriptState + llGround - energy - 10.0 - sleep - 0.0 - return - integer arguments - ScriptName + Offset - type - string tooltip - + + type + vector - tooltip - Returns TRUE if the script named is running.\nReturns TRUE if ScriptName is running. - - llGetSimStats - energy - 0 - sleep - 0 + 10 return float + sleep + 0 + tooltip + Returns the ground height at the object position + offset.\nReturns the ground height at the object's position + Offset. + + llGroundContour + arguments - StatType + Offset - type - integer tooltip - Statistic type. Currently only SIM_STAT_PCT_CHARS_STEPPED is supported. + + type + vector - tooltip - Returns a float that is the requested statistic. - - llGetSimulatorHostname - energy - 10.0 - sleep - 10.0 + 10 return - string - arguments - - tooltip - Returns the host-name of the machine which the script is running on.\nFor example, "sim225.agni.lindenlab.com". - - llGetSPMaxMemory - - energy - + vector sleep - 0.0 - return - integer - arguments - + 0 tooltip - Returns the maximum used memory for the current script. Only valid after using PROFILE_SCRIPT_MEMORY. Non-mono scripts always use 16k.\nReturns the integer of the most bytes used while llScriptProfiler was last active. + Returns the ground contour direction below the object position + Offset.\nReturns the ground contour at the object's position + Offset. - llGetStartParameter + llGroundNormal + arguments + + + Offset + + tooltip + + type + vector + + + energy - 10.0 - sleep - 0.0 + 10 return - integer - arguments - + vector + sleep + 0 tooltip - Returns an integer that is the script rez parameter.\nIf the object was rezzed by an agent, this function returns 0. + Returns the ground normal below the object position + offset.\nReturns the ground contour at the object's position + Offset. - llGetStaticPath + llGroundRepel - energy - 10.0 - sleep - 0.0 - return - list arguments - Start + Height - type - vector tooltip - Starting position. + Distance above the ground. + type + float - End + Water - type - vector tooltip - Ending position. + Boolean, if TRUE then hover above water too. + type + integer - Radius + Tau + tooltip + Seconds to critically damp in. type float - tooltip - Radius of the character that the path is for, between 0.125m and 5.0m. + + energy + 10 + return + void + sleep + 0 + tooltip + + Critically damps to height if within height * 0.5 of level (either above ground level or above the higher of land and water if water == TRUE).\nCritically damps to fHeight if within fHeight * 0.5 of ground or water level.\n + The height is above ground level if iWater is FALSE or above the higher of land and water if iWater is TRUE.\n + Do not use with vehicles. Only works in physics-enabled objects. + + + llGroundSlope + + arguments + - Parameters + Offset - type - list tooltip - Currently only accepts the parameter CHARACTER_TYPE; the options are identical to those used for llCreateCharacter. The default value is CHARACTER_TYPE_NONE. + + type + vector + energy + 10 + return + vector + sleep + 0 tooltip - + Returns the ground slope below the object position + Offset.\nReturns the ground slope at the object position + Offset. - llGetStatus + llHMAC - energy - 10.0 - sleep - 0.0 - return - integer arguments - StatusFlag + Key + tooltip + The PEM-formatted key for the hash digest. type - integer + string + + + + Message + tooltip - A STATUS_* flag + The message to be hashed. + type + string + + + + Algorithm + + tooltip + The digest algorithm: md5, sha1, sha224, sha256, sha384, sha512. + type + string - tooltip - Returns boolean value of the specified status (e.g. STATUS_PHANTOM) of the object the script is attached to. - - llGetSubString - energy - 10.0 - sleep - 0.0 + 10 return string + sleep + 0 + tooltip + Returns the base64-encoded hashed message authentication code (HMAC), of Message using PEM-formatted Key and digest Algorithm (md5, sha1, sha224, sha256, sha384, sha512). + + llHTTPRequest + arguments - String + URL + tooltip + A valid HTTP/HTTPS URL. type string + + + + Parameters + tooltip - + Configuration parameters, specified as HTTP_* flag-value pairs. + type + list - Start + Body + tooltip + Contents of the request. type - integer + string + + + + energy + 10 + return + key + sleep + 0 + tooltip + Sends an HTTP request to the specified URL with the Body of the request and Parameters.\nReturns a key that is a handle identifying the HTTP request made. + + llHTTPResponse + + arguments + + + HTTPRequestID + tooltip - + A valid HTTP request key. + type + key - End + Status + tooltip + HTTP Status (200, 400, 404, etc.). type integer + + + + Body + tooltip - + Contents of the response. + type + string - tooltip - Returns a sub-string from String, in a range specified by the Start and End indicies (inclusive).\nUsing negative numbers for Start and/or End causes the index to count backwards from the length of the string, so 0, -1 would capture the entire string.\nIf Start is greater than End, the sub string is the exclusion of the entries. - - llGetSunDirection - energy - 10.0 - sleep - 0.0 + 10 return - vector - arguments - + void + sleep + 0 tooltip - Returns a normalized vector of the direction of the sun in the region.\nReturns the sun's direction on the simulator. + Responds to an incoming HTTP request which was triggerd by an http_request event within the script. HTTPRequestID specifies the request to respond to (this ID is supplied in the http_request event handler). Status and Body specify the status code and message to respond with. - llGetTexture + llHash + arguments + + + value + + tooltip + + type + string + + + energy - 10.0 - sleep - 0.0 + 10 return - string + integer + sleep + 0 + tooltip + Calculates the 32bit hash value for the provided string. + + llInsertString + arguments - Face + TargetVariable + + tooltip + + type + string + + + + Position + tooltip + type integer + + + + SourceVariable + tooltip - + + type + string + energy + 10 + return + string + sleep + 0 tooltip - Returns a string that is the texture on face (the inventory name if it is a texture in the prim's inventory, otherwise the key).\nReturns the texture of a face, if it is found in object inventory, its key otherwise. + Inserts SourceVariable into TargetVariable at Position, and returns the result.\nInserts SourceVariable into TargetVariable at Position and returns the result. Note this does not alter TargetVariable. - llGetTextureOffset + llInstantMessage - energy - 10.0 - sleep - 0.0 - return - vector arguments - Face + AvatarID + tooltip + type - integer + key + + + + Text + tooltip - + + type + string + energy + 10 + return + void + sleep + 2 tooltip - Returns the texture offset of face in the x and y components of a vector. + IMs Text to the user identified.\nSend Text to the user as an instant message. - llGetTextureRot + llIntegerToBase64 - energy - 10.0 - sleep - 0.0 - return - float arguments - Face + Value + tooltip + type integer - tooltip - + energy + 10 + return + string + sleep + 0 tooltip - Returns the texture rotation of side. + Returns a string that is a Base64 big endian encode of Value.\nEncodes the Value as an 8-character Base64 string. - llGetTextureScale + llIsFriend - energy - 10.0 - sleep - 0.0 - return - vector arguments - Face + agent_id - type - integer tooltip - + Agent ID of another agent in the region. + type + key - tooltip - Returns the texture scale of side in the x and y components of a vector.\nReturns the texture scale of a side in the x and y components of a vector. - - llGetTime - - energy - 10.0 - sleep - 0.0 - return - float - arguments - - tooltip - Returns the time in seconds since the last region reset, script reset, or call to either llResetTime or llGetAndResetTime. - - llGetTimeOfDay - energy - 10.0 - sleep - 0.0 + 10 return - float - arguments - - tooltip - Returns the time in seconds since Second Life midnight or since region up-time, whichever is smaller.\nThe Second Life day cycle is 4 hours. - - llGetTimestamp - - energy - 10.0 + integer sleep - 0.0 - return - string - arguments - + 0 tooltip - Returns a time-stamp (UTC time zone) in the format: YYYY-MM-DDThh:mm:ss.ff..fZ. + Returns TRUE if avatar ID is a friend of the script owner. - llGetTorque + llJson2List - energy - 10.0 - sleep - 0.0 - return - vector arguments - - tooltip - Returns the torque (if the script is physical).\nReturns a vector that is the torque (if the script is physical). - - llGetUnixTime - + + + JSON + + tooltip + + type + string + + + energy - 10.0 - sleep - 0.0 + 10 return - integer - arguments - - tooltip - Returns the number of seconds elapsed since 00:00 hours, Jan 1, 1970 UTC from the system clock. - - llGetUsedMemory - - energy - 10.0 + list sleep - 0.0 - return - integer - arguments - + 0 tooltip - Returns the current used memory for the current script. Non-mono scripts always use 16K.\nReturns the integer of the number of bytes of memory currently in use by the script. Non-mono scripts always use 16K. + Converts the top level of the JSON string to a list. - llGetUsername + llJsonGetValue - energy - 10.0 - sleep - 0.0 - return - string arguments - AvatarID + JSON + tooltip + type - key + string + + + + Specifiers + tooltip - + + type + list - tooltip - Returns the username of an avatar, if the avatar is connected to the current region, or if the name has been cached. Otherwise, returns an empty string. Use llRequestUsername if the avatar may be absent from the region. - - llGetVel - energy - 10.0 - sleep - 0.0 + 10 return - vector - arguments - - tooltip - Returns the velocity of the object.\nReturns a vector that is the velocity of the object. - - llGetWallclock - - energy - 10.0 + string sleep - 0.0 - return - float - arguments - + 0 tooltip - Returns the time in seconds since midnight California Pacific time (PST/PDT).\nReturns the time in seconds since simulator's time-zone midnight (Pacific Time). + Gets the value indicated by Specifiers from the JSON string. - llGiveInventory + llJsonSetValue - energy - 10.0 - sleep - 0.0 - return - void arguments - TargetID + JSON + tooltip + type - key + string + + + + Specifiers + tooltip - + + type + list - InventoryItem + Value + tooltip + type string - tooltip - + energy + 10 + return + string + sleep + 0 tooltip - Give InventoryItem to destination represented by TargetID, as permitted by the permissions system.\nTargetID may be any agent or an object in the same region. + Returns a new JSON string that is the JSON given with the Value indicated by Specifiers set to Value. - llGiveInventoryList + llJsonValueType - energy - 10.0 - sleep - 3.0 - return - void arguments - TargetID + JSON - type - key tooltip - - - - - FolderName - + type string - tooltip - - InventoryItems + Specifiers + tooltip + type list - tooltip - + energy + 10 + return + string + sleep + 0 tooltip - Give InventoryItems to destination (represented by TargetID) as a new folder of items, as permitted by the permissions system.\nTargetID may be any agent or an object in the same region. If TargetID is an object, the items are passed directly to the object inventory (no folder is created). + Returns the type constant (JSON_*) for the value in JSON indicated by Specifiers. - llGiveMoney + llKey2Name - energy - 10.0 - sleep - 0.0 - return - integer arguments - AvatarID + ID - type - key tooltip - - - - - Amount - + Avatar or rezzed prim UUID. type - integer - tooltip - + key + energy + 10 + return + string + sleep + 0 tooltip - Transfers Amount of L$ from script owner to AvatarID.\nThis call will silently fail if PERMISSION_DEBIT has not been granted. + Returns the name of the prim or avatar specified by ID. The ID must be a valid rezzed prim or avatar key in the current simulator, otherwise an empty string is returned.\nFor avatars, the returned name is the legacy name - llGodLikeRezObject + llKeyCountKeyValue - god-mode - true + arguments + energy - 10.0 - sleep - 0.0 + 10 return - void + key + sleep + 0 + tooltip + + Starts an asychronous transaction the request the number of keys in the data store. The dataserver callback will be executed with the key returned from this call and a string describing the result. The result is commma-delimited list. The first item is an integer specifying if the transaction succeeded (1) or not (0). In the failure case, the second item will be an integer corresponding to one of the XP_ERROR_... constants. In the success case the second item will the the number of keys in the system. + + + llKeysKeyValue + arguments - InventoryItemID + First - type - key tooltip - + Index of the first key to return. + type + integer - Position + Count - type - vector tooltip - + The number of keys to return. + type + integer + energy + 10 + return + key + sleep + 0 tooltip - Rez directly off of a UUID if owner has god-bit set. + + Starts an asychronous transaction the request a number of keys from the data store. The dataserver callback will be executed with the key returned from this call and a string describing the result. The result is commma-delimited list. The first item is an integer specifying if the transaction succeeded (1) or not (0). In the failure case, the second item will be an integer corresponding to one of the XP_ERROR_... constants. The error XP_ERROR_KEY_NOT_FOUND is returned if First is greater than or equal to the number of keys in the data store. In the success case the subsequent items will be the keys requested. The number of keys returned may be less than requested if the return value is too large or if there is not enough keys remaining. The order keys are returned is not guaranteed but is stable between subsequent calls as long as no keys are added or removed. Because the keys are returned in a comma-delimited list it is not recommended to use commas in key names if this function is used. + - llGround + llLinear2sRGB - energy - 10.0 - sleep - 0.0 - return - float arguments - Offset + color + tooltip + A color in the linear colorspace. type vector - tooltip - - tooltip - Returns the ground height at the object position + offset.\nReturns the ground height at the object's position + Offset. - - llGroundContour - energy - 10.0 - sleep - 0.0 + 10 return vector + sleep + 0 + tooltip + Converts a color from the linear colorspace to sRGB. + + llLinkAdjustSoundVolume + arguments - Offset + LinkNumber + tooltip + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag type - vector + integer + + + + Volume + tooltip - + The volume to set. + type + float + energy + 10 + return + void + sleep + 0 tooltip - Returns the ground contour direction below the object position + Offset.\nReturns the ground contour at the object's position + Offset. + Adjusts the volume (0.0 - 1.0) of the currently playing sound attached to the link.\nThis function has no effect on sounds started with llTriggerSound. - llGroundNormal + llLinkParticleSystem - energy - 10.0 - sleep - 0.0 - return - vector arguments - Offset + LinkNumber + tooltip + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag type - vector + integer + + + + Rules + tooltip - + Particle system rules list in the format [ rule1, data1, rule2, data2 . . . ruleN, dataN ] + type + list - tooltip - Returns the ground normal below the object position + offset.\nReturns the ground contour at the object's position + Offset. - - llGroundRepel - energy - 10.0 - sleep - 0.0 + 10 return void + sleep + 0 + tooltip + Creates a particle system in prim LinkNumber based on Rules. An empty list removes a particle system from object.\nList format is [ rule-1, data-1, rule-2, data-2 ... rule-n, data-n ].\nThis is identical to llParticleSystem except that it applies to a specified linked prim and not just the prim the script is in. + + llLinkPlaySound + arguments - Height + LinkNumber - type - float tooltip - Distance above the ground. + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag + type + integer - Water + Sound - type - integer tooltip - Boolean, if TRUE then hover above water too. + + type + string - Tau + Volume + tooltip + type float + + + + Flags + tooltip - Seconds to critically damp in. + + type + integer + energy + 10 + return + void + sleep + 0 tooltip - Critically damps to height if within height * 0.5 of level (either above ground level or above the higher of land and water if water == TRUE).\nCritically damps to fHeight if within fHeight * 0.5 of ground or water level.\n - The height is above ground level if iWater is FALSE or above the higher of land and water if iWater is TRUE.\n - Do not use with vehicles. Only works in physics-enabled objects. + Plays Sound, once or looping, at Volume (0.0 - 1.0). The sound may be attached to the link or triggered at its location.\nOnly one sound may be attached to an object at a time, and attaching a new sound or calling llStopSound will stop the previously attached sound. - llGroundSlope + llLinkSetSoundQueueing - energy - 10.0 - sleep - 0.0 - return - vector arguments - Offset + LinkNumber + tooltip + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag type - vector + integer + + + + QueueEnable + tooltip - + Boolean, sound queuing for the linked prim: TRUE enables, FALSE disables (default). + type + integer + energy + 10 + return + void + sleep + 0 tooltip - Returns the ground slope below the object position + Offset.\nReturns the ground slope at the object position + Offset. + Limits radius for audibility of scripted sounds (both attached and triggered) to distance Radius around the link. - llHTTPRequest + llLinkSetSoundRadius - energy - 10.0 - sleep - 0.0 - return - key arguments - URL + LinkNumber - type - string tooltip - A valid HTTP/HTTPS URL. - - - - Parameters - + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag type - list - tooltip - Configuration parameters, specified as HTTP_* flag-value pairs. + integer - Body + radius - type - string tooltip - Contents of the request. + Maximum distance that sounds can be heard. + type + float - tooltip - Sends an HTTP request to the specified URL with the Body of the request and Parameters.\nReturns a key that is a handle identifying the HTTP request made. - - llHTTPResponse - energy - 10.0 - sleep - 0.0 + 10 return void + sleep + 0 + tooltip + Limits radius for audibility of scripted sounds (both attached and triggered) to distance Radius around the link. + + llLinkSitTarget + arguments - HTTPRequestID + LinkNumber - type - key tooltip - A valid HTTP request key. + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag of the prim. + type + integer - Status + Offset - type - integer tooltip - HTTP Status (200, 400, 404, etc.). + Position for the sit target, relative to the prim's position. + type + vector - Body + Rotation - type - string tooltip - Contents of the response. + Rotation (relative to the prim's rotation) for the avatar. + type + rotation + energy + 10 + return + void + sleep + 0 tooltip - Responds to an incoming HTTP request which was triggerd by an http_request event within the script. HTTPRequestID specifies the request to respond to (this ID is supplied in the http_request event handler). Status and Body specify the status code and message to respond with. + Set the sit location for the linked prim(s). If Offset == <0,0,0> clear it.\nSet the sit location for the linked prim(s). The sit location is relative to the prim's position and rotation. - llInsertString + llLinkStopSound - energy - 10.0 - sleep - 0.0 - return - string arguments - TargetVariable + LinkNumber - type - string tooltip - - - - - Position - + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag type integer - tooltip - - - - - SourceVariable - - type - string - tooltip - + energy + 10 + return + void + sleep + 0 tooltip - Inserts SourceVariable into TargetVariable at Position, and returns the result.\nInserts SourceVariable into TargetVariable at Position and returns the result. Note this does not alter TargetVariable. + Stops playback of the currently attached sound on a link. - llInstantMessage + llLinksetDataAvailable + arguments + energy - 10.0 - sleep - 2.0 + 10 return - void + integer + sleep + 0 + tooltip + Returns the number of bytes remaining in the linkset's datastore. + + llLinksetDataCountFound + arguments - AvatarID + search - type - key tooltip - - - - - Text - + A regex search string to match against keys in the datastore. type string - tooltip - + energy + 10 + return + integer + sleep + 0 tooltip - IMs Text to the user identified.\nSend Text to the user as an instant message. + Returns the number of keys matching the regular expression passed in the search parameter. - llIntegerToBase64 + llLinksetDataCountKeys + arguments + energy - 10.0 - sleep - 0.0 + 10 return - string + integer + sleep + 0 + tooltip + Returns the number of keys in the linkset's datastore. + + llLinksetDataDelete + arguments - Value + name - type - integer tooltip - + Key to delete from the linkset's datastore. + type + string + energy + 10 + return + integer + sleep + 0 tooltip - Returns a string that is a Base64 big endian encode of Value.\nEncodes the Value as an 8-character Base64 string. + Deletes a name:value pair from the linkset's datastore. - llJson2List + llLinksetDataDeleteFound - energy - 0.0 - sleep - 0.0 - return - list arguments - JSON + search + tooltip + A regex search string to match against keys in the datastore. type string + + + + pass + tooltip - + The pass phrase used to protect key value pairs in the linkset data + type + string + energy + 10 + return + list + sleep + 0 tooltip - Converts the top level of the JSON string to a list. + Deletes all key value pairs in the linkset data where the key matches the regular expression in search. Returns a list consisting of [ #deleted, #not deleted ]. - llJsonGetValue + llLinksetDataDeleteProtected - energy - 0.0 - sleep - 0.0 - return - string arguments - JSON + name + tooltip + Key to delete from the linkset's datastore. type string - tooltip - - Specifiers + pass - type - list tooltip - + Pass phrase to access protected data. + type + string + energy + 10 + return + integer + sleep + 0 tooltip - Gets the value indicated by Specifiers from the JSON string. + Deletes a name:value pair from the linkset's datastore. - llJsonSetValue + llLinksetDataFindKeys - energy - 0.0 - sleep - 0.0 - return - string arguments - JSON + search + tooltip + A regex search string to match against keys in the datastore. type string - tooltip - - Specifiers + start - type - list tooltip - + First entry to return. 0 for start of list. + type + integer - Value + count - type - string tooltip - + Number of entries to return. Less than 1 for all keys. + type + integer + energy + 10 + return + list + sleep + 0 tooltip - Returns a new JSON string that is the JSON given with the Value indicated by Specifiers set to Value. + Returns a list of keys from the linkset's data store matching the search parameter. - llJsonValueType + llLinksetDataListKeys - energy - 0.0 - sleep - 0.0 - return - string arguments - JSON + start - type - string tooltip - + First entry to return. 0 for start of list. + type + integer - Specifiers + count - type - list tooltip - + Number of entries to return. Less than 1 for all keys. + type + integer + energy + 10 + return + list + sleep + 0 tooltip - Returns the type constant (JSON_*) for the value in JSON indicated by Specifiers. + Returns a list of all keys in the linkset datastore. - llKey2Name + llLinksetDataRead - energy - 10.0 - sleep - 0.0 - return - string arguments - ID + name - type - key tooltip - Avatar or rezzed prim UUID. + Key to retrieve from the linkset's datastore. + type + string - tooltip - Returns the name of the prim or avatar specified by ID. The ID must be a valid rezzed prim or avatar key in the current simulator, otherwise an empty string is returned.\nFor avatars, the returned name is the legacy name - - llKeyCountKeyValue - energy - 10.0 - sleep - 0.0 + 10 return - key - arguments - + string + sleep + 0 tooltip - - Starts an asychronous transaction the request the number of keys in the data store. The dataserver callback will be executed with the key returned from this call and a string describing the result. The result is commma-delimited list. The first item is an integer specifying if the transaction succeeded (1) or not (0). In the failure case, the second item will be an integer corresponding to one of the XP_ERROR_... constants. In the success case the second item will the the number of keys in the system. - + Returns the value stored for a key in the linkset. - llKeysKeyValue + llLinksetDataReadProtected - energy - 10.0 - sleep - 0.0 - return - key arguments - - First - - type - integer - tooltip - Index of the first key to return. - - - - Count - - type - integer - tooltip - The number of keys to return. - - + + name + + tooltip + Key to retrieve from the linkset's datastore. + type + string + + + + pass + + tooltip + Pass phrase to access protected data. + type + string + + + energy + 10 + return + string + sleep + 0 tooltip - - Starts an asychronous transaction the request a number of keys from the data store. The dataserver callback will be executed with the key returned from this call and a string describing the result. The result is commma-delimited list. The first item is an integer specifying if the transaction succeeded (1) or not (0). In the failure case, the second item will be an integer corresponding to one of the XP_ERROR_... constants. The error XP_ERROR_KEY_NOT_FOUND is returned if First is greater than or equal to the number of keys in the data store. In the success case the subsequent items will be the keys requested. The number of keys returned may be less than requested if the return value is too large or if there is not enough keys remaining. The order keys are returned is not guaranteed but is stable between subsequent calls as long as no keys are added or removed. Because the keys are returned in a comma-delimited list it is not recommended to use commas in key names if this function is used. - + Returns the value stored for a key in the linkset. - llLinkParticleSystem + llLinksetDataReset + arguments + energy - 10.0 - sleep - 0.0 + 10 return void + sleep + 0 + tooltip + Resets the linkset's data store, erasing all key-value pairs. + + llLinksetDataWrite + arguments - LinkNumber + name - type - integer tooltip - Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag + key for the name:value pair. + type + string - Rules + value - type - list tooltip - Particle system rules list in the format [ rule1, data1, rule2, data2 . . . ruleN, dataN ] + value to store in the linkset's datastore. + type + string + energy + 10 + return + integer + sleep + 0 tooltip - Creates a particle system in prim LinkNumber based on Rules. An empty list removes a particle system from object.\nList format is [ rule-1, data-1, rule-2, data-2 ... rule-n, data-n ].\nThis is identical to llParticleSystem except that it applies to a specified linked prim and not just the prim the script is in. + Sets a name:value pair in the linkset's datastore - llLinkSitTarget + llLinksetDataWriteProtected - energy - 10.0 - sleep - 0.0 - return - void arguments - LinkNumber + name - type - integer tooltip - Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag of the prim. + key for the name:value pair. + type + string - Offset + value - type - vector tooltip - Position for the sit target, relative to the prim's position. + value to store in the linkset's datastore. + type + string - Rotation + pass - type - rotation tooltip - Rotation (relative to the prim's rotation) for the avatar. + Pass phrase to access protected data. + type + string + energy + 10 + return + integer + sleep + 0 tooltip - Set the sit location for the linked prim(s). If Offset == <0,0,0> clear it.\nSet the sit location for the linked prim(s). The sit location is relative to the prim's position and rotation. + Sets a name:value pair in the linkset's datastore llList2CSV - energy - 10.0 - sleep - 0.0 - return - string arguments ListVariable + tooltip + type list - tooltip - + energy + 10 + return + string + sleep + 0 tooltip Creates a string of comma separated values from the list.\nCreate a string of comma separated values from the specified list. llList2Float - energy - 10.0 - sleep - 0.0 - return - float arguments ListVariable + tooltip + type list - tooltip - Index + tooltip + type integer - tooltip - + energy + 10 + return + float + sleep + 0 tooltip Copies the float at Index in the list.\nReturns the value at Index in the specified list. If Index describes a location not in the list, or the value cannot be type-cast to a float, then zero is returned. llList2Integer - energy - 10.0 - sleep - 0.0 - return - integer arguments ListVariable + tooltip + type list - tooltip - Index + tooltip + type integer - tooltip - + energy + 10 + return + integer + sleep + 0 tooltip Copies the integer at Index in the list.\nReturns the value at Index in the specified list. If Index describes a location not in the list, or the value cannot be type-cast to an integer, then zero is returned. llList2Json - energy - 0 - sleep - 0 - return - string arguments JsonType - type - string tooltip Type is JSON_ARRAY or JSON_OBJECT. + type + string Values - type - list tooltip List of values to convert. + type + list + energy + 10 + return + string + sleep + 0 tooltip Converts either a strided list of key:value pairs to a JSON_OBJECT, or a list of values to a JSON_ARRAY. llList2Key - energy - 10.0 - sleep - 0.0 - return - key arguments ListVariable + tooltip + type list - tooltip - Index + tooltip + type integer - tooltip - + energy + 10 + return + key + sleep + 0 tooltip Copies the key at Index in the list.\nReturns the value at Index in the specified list. If Index describes a location not in the list, or the value cannot be type-cast to a key, then null string is returned. llList2List + arguments + + + ListVariable + + tooltip + + type + list + + + + Start + + tooltip + + type + integer + + + + End + + tooltip + + type + integer + + + energy - 10.0 - sleep - 0.0 + 10 return list + sleep + 0 + tooltip + Returns a subset of entries from ListVariable, in a range specified by the Start and End indicies (inclusive).\nUsing negative numbers for Start and/or End causes the index to count backwards from the length of the string, so 0, -1 would capture the entire string.\nIf Start is greater than End, the sub string is the exclusion of the entries. + + llList2ListSlice + arguments ListVariable + tooltip + type list - tooltip - Start + tooltip + type integer - tooltip - End + tooltip + + type + integer + + + + Stride + + tooltip + type integer + + + + slice_index + tooltip - + + type + integer + energy + 10 + return + list + sleep + 0 tooltip - Returns a subset of entries from ListVariable, in a range specified by the Start and End indicies (inclusive).\nUsing negative numbers for Start and/or End causes the index to count backwards from the length of the string, so 0, -1 would capture the entire string.\nIf Start is greater than End, the sub string is the exclusion of the entries. + Returns a subset of entries from ListVariable, in a range specified by Start and End indices (inclusive) return the slice_index element of each stride.\n Using negative numbers for Start and/or End causes the index to count backwards from the length of the list. (e.g. 0, -1 captures entire list)\nIf slice_index is less than 0, it is counted backwards from the end of the stride.\n Stride must be a positive integer > 0 or an empy list is returned. If slice_index falls outside range of stride, an empty list is returned. slice_index is zero-based. (e.g. A stride of 2 has valid indices 0,1) llList2ListStrided - energy - 10.0 - sleep - 0.0 - return - list arguments ListVariable + tooltip + type list - tooltip - Start + tooltip + type integer - tooltip - End + tooltip + type integer - tooltip - Stride + tooltip + type integer - tooltip - + energy + 10 + return + list + sleep + 0 tooltip Copies the strided slice of the list from Start to End.\nReturns a copy of the strided slice of the specified list from Start to End. llList2Rot - energy - 10.0 - sleep - 0.0 - return - rotation arguments ListVariable + tooltip + type list - tooltip - Index + tooltip + type integer - tooltip - + energy + 10 + return + rotation + sleep + 0 tooltip Copies the rotation at Index in the list.\nReturns the value at Index in the specified list. If Index describes a location not in the list, or the value cannot be type-cast to rotation, thenZERO_ROTATION is returned. llList2String - energy - 10.0 - sleep - 0.0 - return - string arguments ListVariable + tooltip + type list - tooltip - Index + tooltip + type integer - tooltip - + energy + 10 + return + string + sleep + 0 tooltip Copies the string at Index in the list.\nReturns the value at Index in the specified list as a string. If Index describes a location not in the list then null string is returned. llList2Vector - energy - 10.0 - sleep - 0.0 - return - vector arguments ListVariable + tooltip + type list - tooltip - Index + tooltip + type integer - tooltip - + energy + 10 + return + vector + sleep + 0 tooltip Copies the vector at Index in the list.\nReturns the value at Index in the specified list. If Index describes a location not in the list, or the value cannot be type-cast to a vector, then ZERO_VECTOR is returned. - llListen + llListFindList - energy - 10.0 - sleep - 0.0 - return - integer arguments - Channel + ListVariable - type - integer tooltip - - - - - SpeakersName - + type - string - tooltip - + list - SpeakersID + Find - type - key tooltip - - - - - Text - + type - string - tooltip - + list + energy + 10 + return + integer + sleep + 0 tooltip - Creates a listen callback for Text on Channel from SpeakersName and SpeakersID (SpeakersName, SpeakersID, and/or Text can be empty) and returns an identifier that can be used to deactivate or remove the listen.\nNon-empty values for SpeakersName, SpeakersID, and Text will filter the results accordingly, while empty strings and NULL_KEY will not filter the results, for string and key parameters respectively.\nPUBLIC_CHANNEL is the public chat channel that all avatars see as chat text. DEBUG_CHANNEL is the script debug channel, and is also visible to nearby avatars. All other channels are are not sent to avatars, but may be used to communicate with scripts. + Returns the index of the first instance of Find in ListVariable. Returns -1 if not found.\nReturns the position of the first instance of the Find list in the ListVariable. Returns -1 if not found. - llListenControl + llListFindListNext - energy - 10.0 - sleep - 0.0 - return - void arguments - ChannelHandle + ListVariable - type - integer tooltip - + + type + list - Active + Find - type - integer tooltip - + + type + list - - tooltip - Makes a listen event callback active or inactive. Pass in the value returned from llListen to the iChannelHandle parameter to specify which listener you are controlling.\nUse boolean values to specify Active - - llListenRemove - - energy - 10.0 - sleep - 0.0 - return - void - arguments - - ChannelHandle + Instance + tooltip + type integer - tooltip - - tooltip - Removes a listen event callback. Pass in the value returned from llListen to the iChannelHandle parameter to specify which listener to remove. - - llListFindList - energy - 10.0 - sleep - 0.0 + 10 return integer + sleep + 0 + tooltip + Returns the index of the nth instance of Find in ListVariable. Returns -1 if not found. + + llListFindStrided + arguments ListVariable + tooltip + + type + list + + + + Find + + tooltip + type list + + + + Start + tooltip - + + type + integer - Find + End + tooltip + type - list + integer + + + + Stride + tooltip - + + type + integer + energy + 10 + return + integer + sleep + 0 tooltip - Returns the index of the first instance of Find in ListVariable. Returns -1 if not found.\nReturns the position of the first instance of the Find list in the ListVariable. Returns -1 if not found. + Returns the index of the first instance of Find in ListVariable. Returns -1 if not found.\nReturns the position of the first instance of the Find list in the ListVariable after the start index and before the end index. Steps through ListVariable by stride. Returns -1 if not found. llListInsertList - energy - 10.0 - sleep - 0.0 - return - list arguments Target + tooltip + type list - tooltip - ListVariable + tooltip + type list - tooltip - Position + tooltip + type integer - tooltip - + energy + 10 + return + list + sleep + 0 tooltip Returns a list that contains all the elements from Target but with the elements from ListVariable inserted at Position start.\nReturns a new list, created by inserting ListVariable into the Target list at Position. Note this does not alter the Target. llListRandomize - energy - 10.0 - sleep - 0.0 - return - list arguments ListVariable + tooltip + type list - tooltip - Stride + tooltip + type integer - tooltip - + energy + 10 + return + list + sleep + 0 tooltip Returns a version of the input ListVariable which has been randomized by blocks of size Stride.\nIf the remainder from the length of the list, divided by the stride is non-zero, this function does not randomize the list. llListReplaceList - energy - 10.0 - sleep - 0.0 - return - list arguments Target + tooltip + type list - tooltip - ListVariable + tooltip + type list - tooltip - Start + tooltip + type integer - tooltip - End + tooltip + type integer - tooltip - + energy + 10 + return + list + sleep + 0 tooltip Returns a list that is Target with Start through End removed and ListVariable inserted at Start.\nReturns a list replacing the slice of the Target list from Start to End with the specified ListVariable. Start and End are inclusive, so 0, 1 would replace the first two entries and 0, 0 would replace only the first list entry. llListSort + arguments + + + ListVariable + + tooltip + List to sort. + type + list + + + + Stride + + tooltip + Stride length. + type + integer + + + + Ascending + + tooltip + Boolean. TRUE = result in ascending order, FALSE = result in descending order. + type + integer + + + energy - 10.0 - sleep - 0.0 + 10 return list + sleep + 0 + tooltip + Returns the specified list, sorted into blocks of stride in ascending order (if Ascending is TRUE, otherwise descending). Note that sort only works if the first entry of each block is the same datatype. + + llListSortStrided + arguments ListVariable - type - list tooltip List to sort. + type + list Stride - type - integer tooltip Stride length. + type + integer - Ascending + Sortkey + tooltip + The zero based element within the stride to use as the sort key type integer + + + + Ascending + tooltip Boolean. TRUE = result in ascending order, FALSE = result in descending order. + type + integer + energy + 10 + return + list + sleep + 0 tooltip - Returns the specified list, sorted into blocks of stride in ascending order (if Ascending is TRUE, otherwise descending). Note that sort only works if the first entry of each block is the same datatype. + Returns the specified list, sorted by the specified element into blocks of stride in ascending order (if Ascending is TRUE, otherwise descending). Note that sort only works if the first entry of each block is the same datatype. llListStatistics + arguments + + + Operation + + tooltip + One of LIST_STAT_* values + type + integer + + + + ListVariable + + tooltip + Variable to analyze. + type + list + + + energy - 10.0 - sleep - 0.0 + 10 return float + sleep + 0 + tooltip + Performs a statistical aggregate function, specified by a LIST_STAT_* constant, on ListVariables.\nThis function allows a script to perform a statistical operation as defined by operation on a list composed of integers and floats. + + llListen + arguments - Operation + Channel + tooltip + type integer + + + + SpeakersName + tooltip - One of LIST_STAT_* values + + type + string - ListVariable + SpeakersID + tooltip + type - list + key + + + + Text + tooltip - Variable to analyze. + + type + string + energy + 10 + return + integer + sleep + 0 tooltip - Performs a statistical aggregate function, specified by a LIST_STAT_* constant, on ListVariables.\nThis function allows a script to perform a statistical operation as defined by operation on a list composed of integers and floats. + Creates a listen callback for Text on Channel from SpeakersName and SpeakersID (SpeakersName, SpeakersID, and/or Text can be empty) and returns an identifier that can be used to deactivate or remove the listen.\nNon-empty values for SpeakersName, SpeakersID, and Text will filter the results accordingly, while empty strings and NULL_KEY will not filter the results, for string and key parameters respectively.\nPUBLIC_CHANNEL is the public chat channel that all avatars see as chat text. DEBUG_CHANNEL is the script debug channel, and is also visible to nearby avatars. All other channels are are not sent to avatars, but may be used to communicate with scripts. - llLoadURL + llListenControl + arguments + + + ChannelHandle + + tooltip + + type + integer + + + + Active + + tooltip + + type + integer + + + energy - 10.0 + 10 + return + void sleep - 0.1 + 0 + tooltip + Makes a listen event callback active or inactive. Pass in the value returned from llListen to the iChannelHandle parameter to specify which listener you are controlling.\nUse boolean values to specify Active + + llListenRemove + + arguments + + + ChannelHandle + + tooltip + + type + integer + + + + energy + 10 return void + sleep + 0 + tooltip + Removes a listen event callback. Pass in the value returned from llListen to the iChannelHandle parameter to specify which listener to remove. + + llLoadURL + arguments AvatarID + tooltip + type key - tooltip - Text + tooltip + type string - tooltip - URL + tooltip + type string - tooltip - + energy + 10 + return + void + sleep + 0.1000000000000000055511151 tooltip Shows dialog to avatar AvatarID offering to load web page at URL. If user clicks yes, launches their web browser.\nllLoadURL displays a dialogue box to the user, offering to load the specified web page using the default web browser. - llLog - - energy - 10.0 - sleep - 0.0 - return - float + llLog + arguments Value + tooltip + type float - tooltip - + energy + 10 + return + float + sleep + 0 tooltip Returns the natural logarithm of Value. Returns zero if Value <= 0.\nReturns the base e (natural) logarithm of the specified Value. llLog10 - energy - 10.0 - sleep - 0.0 - return - float arguments Value + tooltip + type float - tooltip - + energy + 10 + return + float + sleep + 0 tooltip Returns the base 10 logarithm of Value. Returns zero if Value <= 0.\nReturns the base 10 (common) logarithm of the specified Value. llLookAt - energy - 10.0 - sleep - 0.0 - return - void arguments Target + tooltip + type vector - tooltip - Strength + tooltip + type float - tooltip - Damping + tooltip + type float - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Cause object name to point its forward axis towards Target, at a force controlled by Strength and Damping.\nGood Strength values are around half the mass of the object and good Damping values are less than 1/10th of the Strength.\nAsymmetrical shapes require smaller Damping. A Strength of 0.0 cancels the look at. llLoopSound - energy - 10.0 - sleep - 0.0 - return - void arguments Sound + tooltip + type string - tooltip - Volume + tooltip + type float - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Plays specified Sound, looping indefinitely, at Volume (0.0 - 1.0).\nOnly one sound may be attached to an object at a time.\nA second call to llLoopSound with the same key will not restart the sound, but the new volume will be used. This allows control over the volume of already playing sounds.\nSetting the volume to 0 is not the same as calling llStopSound; a sound with 0 volume will continue to loop.\nTo restart the sound from the beginning, call llStopSound before calling llLoopSound again. llLoopSoundMaster - energy - 10.0 - sleep - 0.0 - return - void arguments Sound + tooltip + type string - tooltip - Volume + tooltip + type float - tooltip - + energy + 10 + return + void + sleep + 0 tooltip - Plays attached Sound, looping at volume (0.0 - 1.0), and declares it a sync master.\nBehaviour is identical to llLoopSound, with the addition of marking the source as a "Sync Master", causing "Slave" sounds to sync to it. If there are multiple masters within a viewers interest area, the most audible one (a function of both distance and volume) will win out as the master.\nThe use of multiple masters within a small area is unlikely to produce the desired effect. + Plays attached Sound, looping at volume (0.0 - 1.0), and declares it a sync master.\nBehaviour is identical to llLoopSound, with the addition of marking the source as a "Sync Master", causing "Slave" sounds to sync to it. If there are multiple masters within a viewers interest area, the most audible one (a function of both distance and volume) will win out as the master.\nThe use of multiple masters within a small area is unlikely to produce the desired effect. llLoopSoundSlave - energy - 10.0 - sleep - 0.0 - return - void arguments Sound + tooltip + type string - tooltip - Volume + tooltip + type float - tooltip - + energy + 10 + return + void + sleep + 0 tooltip - Plays attached sound looping at volume (0.0 - 1.0), synced to most audible sync master.\nBehaviour is identical to llLoopSound, unless there is a "Sync Master" present.\nIf a Sync Master is already playing the Slave sound will begin playing from the same point the master is in its loop synchronizing the loop points of both sounds.\nIf a Sync Master is started when the Slave is already playing, the Slave will skip to the correct position to sync with the Master. + Plays attached sound looping at volume (0.0 - 1.0), synced to most audible sync master.\nBehaviour is identical to llLoopSound, unless there is a "Sync Master" present.\nIf a Sync Master is already playing the Slave sound will begin playing from the same point the master is in its loop synchronizing the loop points of both sounds.\nIf a Sync Master is started when the Slave is already playing, the Slave will skip to the correct position to sync with the Master. - llMakeExplosion + llMD5String - deprecated - true + arguments + + + Text + + tooltip + + type + string + + + + Nonce + + tooltip + + type + integer + + + energy - 10.0 - sleep - 0.1 + 10 return - void + string + sleep + 0 + tooltip + Returns a string of 32 hex characters that is an RSA Data Security Inc., MD5 Message-Digest Algorithm of Text with Nonce used as the salt.\nReturns a 32-character hex string. (128-bit in binary.) + + llMakeExplosion + arguments Particles + tooltip + type integer - tooltip - Scale + tooltip + type float - tooltip - Velocity + tooltip + type float - tooltip - Lifetime + tooltip + type float - tooltip - Arc + tooltip + type float - tooltip - Texture + tooltip + type string - tooltip - Offset + tooltip + type vector - tooltip - + deprecated + 1 + energy + 10 + return + void + sleep + 0.1000000000000000055511151 tooltip Make a round explosion of particles. Deprecated: Use llParticleSystem instead.\nMake a round explosion of particles using texture from the objects inventory. Deprecated: Use llParticleSystem instead. llMakeFire - deprecated - true - energy - 10.0 - sleep - 0.1 - return - void arguments Particles + tooltip + type integer - tooltip - Scale + tooltip + type float - tooltip - Velocity + tooltip + type float - tooltip - Lifetime + tooltip + type float - tooltip - Arc + tooltip + type float - tooltip - Texture + tooltip + type string - tooltip - Offset + tooltip + type vector - tooltip - + deprecated + 1 + energy + 10 + return + void + sleep + 0.1000000000000000055511151 tooltip Make fire like particles. Deprecated: Use llParticleSystem instead.\nMake fire particles using texture from the objects inventory. Deprecated: Use llParticleSystem instead. llMakeFountain - deprecated - true - energy - 10.0 - sleep - 0.1 - return - void arguments Particles + tooltip + type integer - tooltip - Scale + tooltip + type float - tooltip - Velocity + tooltip + type float - tooltip - Lifetime + tooltip + type float - tooltip - Arc + tooltip + type float - tooltip - Bounce + tooltip + type integer - tooltip - Texture + tooltip + type string - tooltip - Offset + tooltip + type vector - tooltip - Bounce_Offset + tooltip + type float - tooltip - + deprecated + 1 + energy + 10 + return + void + sleep + 0.1000000000000000055511151 tooltip Make a fountain of particles. Deprecated: Use llParticleSystem instead.\nMake a fountain of particles using texture from the objects inventory. Deprecated: Use llParticleSystem instead. llMakeSmoke - deprecated - true - energy - 10.0 - sleep - 0.1 - return - void arguments Particles + tooltip + type integer - tooltip - Scale + tooltip + type float - tooltip - Velocity + tooltip + type float - tooltip - Lifetime + tooltip + type float - tooltip - Arc + tooltip + type float - tooltip - Texture + tooltip + type string - tooltip - Offset + tooltip + type vector - tooltip - + deprecated + 1 + energy + 10 + return + void + sleep + 0.1000000000000000055511151 tooltip Make smoke like particles. Deprecated: Use llParticleSystem instead.\nMake smoky particles using texture from the objects inventory. Deprecated: Use llParticleSystem instead. llManageEstateAccess - energy - - sleep - - return - integer arguments Action - type - integer tooltip One of the ESTATE_ACCESS_ALLOWED_* actions. + type + integer AvatarID - type - key tooltip UUID of the avatar or group to act upon. + type + key + energy + 10 + return + integer + sleep + 0 tooltip - Adds or removes agents from the estate's agent access or ban lists, or groups to the estate's group access list. Action is one of the ESTATE_ACCESS_ALLOWED_* operations to perform.\nReturns an integer representing a boolean, TRUE if the call was successful; FALSE if throttled, invalid action, invalid or null id or object owner is not allowed to manage the estate.\nThe object owner is notified of any changes, unless PERMISSION_SILENT_ESTATE_MANAGEMENT has been granted to the script. + Adds or removes agents from the estate's agent access or ban lists, or groups to the estate's group access list. Action is one of the ESTATE_ACCESS_ALLOWED_* operations to perform.\nReturns an integer representing a boolean, TRUE if the call was successful; FALSE if throttled, invalid action, invalid or null id or object owner is not allowed to manage the estate.\nThe object owner is notified of any changes, unless PERMISSION_SILENT_ESTATE_MANAGEMENT has been granted to the script. - llMapDestination + llMapBeacon - energy - 10.0 - sleep - 1.0 - return - void arguments RegionName + tooltip + Region in which to show the beacon. type string - tooltip - Position + tooltip + Position within region to show the beacon. type vector - tooltip - - Direction + Options - type - vector tooltip - + Options + type + list + energy + 10 + return + void + sleep + 1 tooltip - Opens world map for avatar who touched is is wearing the script, centred on RegionName with Position highlighted. Only works for scripts attached to avatar, or during touch events.\nDirection currently has no effect. + Displays an in world beacon and optionally opens world map for avatar who touched the object or is wearing the script, centered on RegionName with Position highlighted. Only works for scripts attached to avatar, or during touch events. - llMD5String + llMapDestination - energy - 10.0 - sleep - 0.0 - return - string arguments - Text + RegionName + tooltip + type string + + + + Position + tooltip - + + type + vector - Nonce + Direction - type - integer tooltip - + + type + vector + energy + 10 + return + void + sleep + 1 tooltip - Returns a string of 32 hex characters that is an RSA Data Security Inc., MD5 Message-Digest Algorithm of Text with Nonce used as the salt.\nReturns a 32-character hex string. (128-bit in binary.) + Opens world map for avatar who touched is is wearing the script, centred on RegionName with Position highlighted. Only works for scripts attached to avatar, or during touch events.\nDirection currently has no effect. llMessageLinked - energy - 10.0 - sleep - 0.0 - return - void arguments LinkNumber + tooltip + type integer - tooltip - Number + tooltip + type integer - tooltip - Text + tooltip + type string - tooltip - ID + tooltip + type key - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Sends Number, Text, and ID to members of the link set identified by LinkNumber.\nLinkNumber is either a linked number (available through llGetLinkNumber) or a LINK_* constant. llMinEventDelay - energy - 10.0 - sleep - 0.0 - return - void arguments Delay + tooltip + type float - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Set the minimum time between events being handled. - llModifyLand + llModPow - energy - 10.0 - sleep - 0.0 - return - void arguments - Action + Value + tooltip + type integer - tooltip - LAND_LEVEL, LAND_RAISE, LAND_LOWER, LAND_SMOOTH, LAND_NOISE or LAND_REVERT - Area + Power + tooltip + type integer + + + + Modulus + tooltip - 0, 1, 2 (2m x 2m, 4m x 4m, or 8m x 8m) + + type + integer - tooltip - Modify land with action (LAND_LEVEL, LAND_RAISE, LAND_LOWER, LAND_SMOOTH, LAND_NOISE, LAND_REVERT) on size (0, 1, 2, corresponding to 2m x 2m, 4m x 4m, 8m x 8m). - - llModPow - energy - 10.0 - sleep - 1.0 + 10 return integer + sleep + 0 + tooltip + Returns a Value raised to the Power, mod Modulus. ((a**b)%c) b is capped at 0xFFFF (16 bits).\nReturns (Value ^ Power) % Modulus. (Value raised to the Power, Modulus). Value is capped at 0xFFFF (16 bits). + + llModifyLand + arguments - Value + Action - type - integer tooltip - - - - - Power - + LAND_LEVEL, LAND_RAISE, LAND_LOWER, LAND_SMOOTH, LAND_NOISE or LAND_REVERT type integer - tooltip - - Modulus + Area + tooltip + 0, 1, 2 (2m x 2m, 4m x 4m, or 8m x 8m) type integer - tooltip - + energy + 10 + return + void + sleep + 0 tooltip - Returns a Value raised to the Power, mod Modulus. ((a**b)%c) b is capped at 0xFFFF (16 bits).\nReturns (Value ^ Power) % Modulus. (Value raised to the Power, Modulus). Value is capped at 0xFFFF (16 bits). + Modify land with action (LAND_LEVEL, LAND_RAISE, LAND_LOWER, LAND_SMOOTH, LAND_NOISE, LAND_REVERT) on size (0, 1, 2, corresponding to 2m x 2m, 4m x 4m, 8m x 8m). llMoveToTarget - energy - 10.0 - sleep - 0.0 - return - void arguments Target + tooltip + type vector - tooltip - Tau + tooltip + type float - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Critically damp to Target in Tau seconds (if the script is physical).\nCritically damp to position target in tau-seconds if the script is physical. Good tau-values are greater than 0.2. A tau of 0.0 stops the critical damping. - llNavigateTo + llName2Key + arguments + + + Name + + tooltip + Name of agent in region to look up. + type + string + + + energy - - sleep - + 10 return - void + key + sleep + 0 + tooltip + Look up Agent ID for the named agent in the region. + + llNavigateTo + arguments Location - type - vector tooltip Region coordinates for the character to navigate to. + type + vector Options - type - list tooltip List of parameters to control the type of path-finding used. Currently only FORCE_DIRECT_PATH supported. + type + list + energy + 10 + return + void + sleep + 0 tooltip Navigate to destination.\nDirects an object to travel to a defined position in the region or adjacent regions. llOffsetTexture - energy - 10.0 - sleep - 0.2 - return - void arguments OffsetS + tooltip + type float - tooltip - OffsetT + tooltip + type float - tooltip - Face + tooltip + type integer - tooltip - + energy + 10 + return + void + sleep + 0.2000000000000000111022302 tooltip Sets the texture S and T offsets for the chosen Face.\nIf Face is ALL_SIDES this function sets the texture offsets for all faces. + llOpenFloater + + arguments + + + floater_name + + tooltip + Identifier for floater to open + type + string + + + + url + + tooltip + URL to pass to floater + type + string + + + + params + + tooltip + Parameters to apply to open floater + type + list + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the value for header for request_id.\nReturns a string that is the value of the Header for HTTPRequestID. + llOpenRemoteDataChannel + arguments + deprecated - true + 1 energy - 10.0 - sleep - 1.0 + 10 return void - arguments - + sleep + 1 tooltip - Requests a channel to listen for XML-RPC calls. (Deprecated: XML-RPC should not be used. Use http-in instead.)\nWill trigger a remote_data event with type = REMOTE_DATA_CHANNEL and a channel ID (key) once it is available.\nThis channel ID must be referenced in the XML-RPC call to the script (from the internet) -- so the key must somehow get to the external XML-RPC client. + This function is deprecated. - llOverMyLand + llOrd + arguments + + + value + + tooltip + The string to convert to Unicode. + type + string + + + + index + + tooltip + Index of character to convert to unicode. + type + integer + + + energy - 10.0 - sleep - 0.0 + 10 return integer + sleep + 0 + tooltip + Returns the unicode value of the indicated character in the string. + + llOverMyLand + arguments ID + tooltip + type key - tooltip - + energy + 10 + return + integer + sleep + 0 tooltip Returns TRUE if id ID over land owned by the script owner, otherwise FALSE.\nReturns TRUE if key ID is over land owned by the object owner, FALSE otherwise. llOwnerSay - energy - 10.0 - sleep - 0.0 - return - void arguments Text + tooltip + type string - tooltip - + energy + 10 + return + void + sleep + 0 tooltip - says Text to owner only (if owner is in region).\nSays Text to the owner of the object running the script, if the owner has been within the object's simulator since logging into Second Life, regardless of where they may be in-world. + says Text to owner only (if owner is in region).\nSays Text to the owner of the object running the script, if the owner has been within the object's simulator since logging into Second Life, regardless of where they may be in-world. llParcelMediaCommandList - energy - 10.0 - sleep - 2.0 - return - void arguments CommandList - type - list tooltip A list of PARCEL_MEDIA_COMMAND_* flags and their parameters + type + list + energy + 10 + return + void + sleep + 2 tooltip Controls the playback of multimedia resources on a parcel or for an agent, via one or more PARCEL_MEDIA_COMMAND_* arguments specified in CommandList. llParcelMediaQuery - energy - 10.0 - sleep - 2.0 - return - list arguments QueryList + tooltip + type list - tooltip - + energy + 10 + return + list + sleep + 2 tooltip Queries the media properties of the parcel containing the script, via one or more PARCEL_MEDIA_COMMAND_* arguments specified in CommandList.\nThis function will only work if the script is contained within an object owned by the land-owner (or if the land is owned by a group, only if the object has been deeded to the group). llParseString2List - energy - 10.0 - sleep - 0.0 - return - list arguments Text + tooltip + type string - tooltip - Separators + tooltip + type list - tooltip - Spacers + tooltip + type list - tooltip - + energy + 10 + return + list + sleep + 0 tooltip Converts Text into a list, discarding Separators, keeping Spacers (Separators and Spacers must be lists of strings, maximum of 8 each).\nSeparators and Spacers are lists of strings with a maximum of 8 entries each. llParseStringKeepNulls - energy - 10.0 - sleep - 0.0 - return - list arguments Text + tooltip + type string - tooltip - Separators + tooltip + type list - tooltip - Spacers + tooltip + type list - tooltip - + energy + 10 + return + list + sleep + 0 tooltip Breaks Text into a list, discarding separators, keeping spacers, keeping any null values generated. (separators and spacers must be lists of strings, maximum of 8 each).\nllParseStringKeepNulls works almost exactly like llParseString2List, except that if a null is found it will add a null-string instead of discarding it like llParseString2List does. llParticleSystem - energy - 10.0 - sleep - 0.0 - return - void arguments Parameters + tooltip + type list - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Creates a particle system in the prim the script is attached to, based on Parameters. An empty list removes a particle system from object.\nList format is [ rule-1, data-1, rule-2, data-2 ... rule-n, data-n ]. llPassCollisions - energy - 10.0 - sleep - 0.0 - return - void arguments Pass - type - integer tooltip Boolean, if TRUE, collisions are passed from children on to parents. + type + integer + energy + 10 + return + void + sleep + 0 tooltip Configures how collision events are passed to scripts in the linkset.\nIf Pass == TRUE, collisions involving collision-handling scripted child prims are also passed on to the root prim. If Pass == FALSE (default behavior), such collisions will only trigger events in the affected child prim. llPassTouches - energy - 10.0 - sleep - 0.0 - return - void arguments Pass - type - integer tooltip Boolean, if TRUE, touches are passed from children on to parents. + type + integer + energy + 10 + return + void + sleep + 0 tooltip Configures how touch events are passed to scripts in the linkset.\nIf Pass == TRUE, touches involving touch-handling scripted child prims are also passed on to the root prim. If Pass == FALSE (default behavior), such touches will only trigger events in the affected child prim. llPatrolPoints - energy - - sleep - - return - void arguments Points - type - list tooltip A list of vectors for the character to travel through sequentially. The list must contain at least two entries. + type + list Options - type - list tooltip No options available at this time. + type + list + energy + 10 + return + void + sleep + 0 tooltip Patrol a list of points.\nSets the points for a character (llCreateCharacter) to patrol along. llPlaySound + arguments + + + Sound + + tooltip + + type + string + + + + Volume + + tooltip + + type + float + + + energy - 10.0 + 10 + return + void sleep - 0.0 + 0 + tooltip + Plays Sound once, at Volume (0.0 - 1.0) and attached to the object.\nOnly one sound may be attached to an object at a time, and attaching a new sound or calling llStopSound will stop the previously attached sound.\nA second call to llPlaySound with the same sound will not restart the sound, but the new volume will be used, which allows control over the volume of already playing sounds.\nTo restart the sound from the beginning, call llStopSound before calling llPlaySound again. + + llPlaySoundSlave + + arguments + + + Sound + + tooltip + + type + string + + + + Volume + + tooltip + + type + float + + + + energy + 10 return void + sleep + 0 + tooltip + Plays attached Sound once, at Volume (0.0 - 1.0), synced to next loop of most audible sync master.\nBehaviour is identical to llPlaySound, unless there is a "Sync Master" present. If a Sync Master is already playing, the Slave sound will not be played until the Master hits its loop point and returns to the beginning.\nllPlaySoundSlave will play the sound exactly once; if it is desired to have the sound play every time the Master loops, either use llLoopSoundSlave with extra silence padded on the end of the sound or ensure that llPlaySoundSlave is called at least once per loop of the Master. + + llPow + + arguments + + + Value + + tooltip + + type + float + + + + Exponent + + tooltip + + type + float + + + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the Value raised to the power Exponent, or returns 0 and triggers Math Error for imaginary results.\nReturns the Value raised to the Exponent. + + llPreloadSound + arguments Sound + tooltip + type string + + + + energy + 10 + return + void + sleep + 1 + tooltip + Causes nearby viewers to preload the Sound from the object's inventory.\nThis is intended to prevent delays in starting new sounds when called upon. + + llPursue + + arguments + + + TargetID + + tooltip + Agent or object to pursue. + type + key + + + + Options + + tooltip + Parameters for pursuit. + type + list + + + + energy + 10 + return + void + sleep + 0 + tooltip + Chase after a target.\nCauses the character (llCharacter) to pursue the target defined by TargetID. + + llPushObject + + arguments + + + ObjectID + + tooltip + + type + key + + + + Impulse + + tooltip + + type + vector + + + + AngularImpulse + + tooltip + + type + vector + + + + Local + tooltip - + + type + integer + + energy + 10 + return + void + sleep + 0 + tooltip + Applies Impulse and AngularImpulse to ObjectID.\nApplies the supplied impulse and angular impulse to the object specified. + + llReadKeyValue + + arguments + - Volume + Key - type - float tooltip - + + type + string + energy + 10 + return + key + sleep + 0 tooltip - Plays Sound once, at Volume (0.0 - 1.0) and attached to the object.\nOnly one sound may be attached to an object at a time, and attaching a new sound or calling llStopSound will stop the previously attached sound.\nA second call to llPlaySound with the same sound will not restart the sound, but the new volume will be used, which allows control over the volume of already playing sounds.\nTo restart the sound from the beginning, call llStopSound before calling llPlaySound again. + + Starts an asychronous transaction to retrieve the value associated with the key given. Will fail with XP_ERROR_KEY_NOT_FOUND if the key does not exist. The dataserver callback will be executed with the key returned from this call and a string describing the result. The result is a two element commma-delimited list. The first item is an integer specifying if the transaction succeeded (1) or not (0). In the failure case, the second item will be an integer corresponding to one of the XP_ERROR_... constants. In the success case the second item will be the value associated with the key. + - llPlaySoundSlave + llRefreshPrimURL + arguments + energy - 10.0 - sleep - 0.0 + 10 return void + sleep + 20 + tooltip + Reloads the web page shown on the sides of the object. + + llRegionSay + arguments - Sound + Channel - type - string tooltip - + Any integer value except zero. + type + integer - Volume + Text - type - float tooltip - + Message to be transmitted. + type + string + energy + 10 + return + void + sleep + 0 tooltip - Plays attached Sound once, at Volume (0.0 - 1.0), synced to next loop of most audible sync master.\nBehaviour is identical to llPlaySound, unless there is a "Sync Master" present. If a Sync Master is already playing, the Slave sound will not be played until the Master hits its loop point and returns to the beginning.\nllPlaySoundSlave will play the sound exactly once; if it is desired to have the sound play every time the Master loops, either use llLoopSoundSlave with extra silence padded on the end of the sound or ensure that llPlaySoundSlave is called at least once per loop of the Master. + Broadcasts Text to entire region on Channel (except for channel 0). - llPow + llRegionSayTo - energy - 10.0 - sleep - 0.0 - return - float arguments - Value + TargetID - type - float tooltip - + Avatar or object to say to. + type + key - Exponent + Channel + tooltip + Output channel, any integer value. type - float + integer + + + + Text + tooltip - + Message to be transmitted. + type + string - tooltip - Returns the Value raised to the power Exponent, or returns 0 and triggers Math Error for imaginary results.\nReturns the Value raised to the Exponent. - - llPreloadSound - energy - 10.0 - sleep - 1.0 + 10 return void + sleep + 0 + tooltip + Says Text, on Channel, to avatar or object indicated by TargetID (if within region).\nIf TargetID is an avatar and Channel is nonzero, Text can be heard by any attachment on the avatar. + + llReleaseCamera + arguments - Sound + AvatarID - type - string tooltip - + + type + key + deprecated + 1 + energy + 10 + return + void + sleep + 0 tooltip - Causes nearby viewers to preload the Sound from the object's inventory.\nThis is intended to prevent delays in starting new sounds when called upon. + Return camera to agent.\nDeprecated: Use llClearCameraParams instead. - llPursue + llReleaseControls + arguments + energy - - sleep - + 10 return void + sleep + 0 + tooltip + Stop taking inputs.\nStop taking inputs from the avatar. + + llReleaseURL + arguments - TargetID + URL - type - key tooltip - Agent or object to pursue. - - - - Options - + URL to release. type - list - tooltip - Parameters for pursuit. + string - tooltip - Chase after a target.\nCauses the character (llCharacter) to pursue the target defined by TargetID. - - llPushObject - energy - 10.0 - sleep - 0.0 + 10 return void + sleep + 0 + tooltip + Releases the specified URL, which was previously obtained using llRequestURL. Once released, the URL will no longer be usable. + + llRemoteDataReply + arguments - ObjectID + ChannelID + tooltip + type key - tooltip - - Impulse + MessageID - type - vector tooltip - + + type + key - AngularImpulse + sData - type - vector tooltip - + String data to send + type + string - Local + iData + tooltip + Integer data to send type integer - tooltip - - tooltip - Applies Impulse and AngularImpulse to ObjectID.\nApplies the supplied impulse and angular impulse to the object specified. - - llReadKeyValue - + deprecated + 1 energy - 10.0 - sleep - 0.0 + 10 return - key - arguments - - - Key - - type - string - tooltip - - - - + void + sleep + 3 tooltip - - Starts an asychronous transaction to retrieve the value associated with the key given. Will fail with XP_ERROR_KEY_NOT_FOUND if the key does not exist. The dataserver callback will be executed with the key returned from this call and a string describing the result. The result is a two element commma-delimited list. The first item is an integer specifying if the transaction succeeded (1) or not (0). In the failure case, the second item will be an integer corresponding to one of the XP_ERROR_... constants. In the success case the second item will be the value associated with the key. - + This function is deprecated. - llRefreshPrimURL + llRemoteDataSetRegion + arguments + + deprecated + 1 energy - 10.0 - sleep - 20.0 + 10 return void - arguments - + sleep + 0 tooltip - Reloads the web page shown on the sides of the object. + This function is deprecated. - llRegionSay + llRemoteLoadScriptPin - energy - 10.0 - sleep - 0.0 - return - void arguments - Channel + ObjectID - type - integer tooltip - Any integer value except zero. + Target prim to attempt copying into. + type + key - Text + ScriptName + tooltip + Name of the script in current inventory to copy. type string - tooltip - Message to be transmitted. - - tooltip - Broadcasts Text to entire region on Channel (except for channel 0). - - llRegionSayTo - - energy - 10.0 - sleep - 0.0 - return - void - arguments - - TargetID + PIN - type - key tooltip - Avatar or object to say to. + Integer set on target prim as a Personal Information Number code. + type + integer - Channel + Running + tooltip + If the script should be set running in the target prim. type integer - tooltip - Output channel, any integer value. - Text + StartParameter + tooltip + Integer. Parameter passed to the script if set to be running. type - string + integer + + + + energy + 10 + return + void + sleep + 3 + tooltip + If the owner of the object containing this script can modify the object identified by the specified object key, and if the PIN matches the PIN previously set using llSetRemoteScriptAccessPin (on the target prim), then the script will be copied into target. Running is a boolean specifying whether the script should be enabled once copied into the target object. + + llRemoveFromLandBanList + + arguments + + + AvatarID + tooltip - Message to be transmitted. + + type + key - tooltip - Says Text, on Channel, to avatar or object indicated by TargetID (if within region).\nIf TargetID is an avatar and Channel is nonzero, Text can be heard by any attachment on the avatar. - - llReleaseCamera - - deprecated - true energy - 10.0 - sleep - 0.0 + 10 return void + sleep + 0.1000000000000000055511151 + tooltip + Remove avatar from the land ban list.\nRemove specified avatar from the land parcel ban list. + + llRemoveFromLandPassList + arguments AvatarID + tooltip + type key - tooltip - - tooltip - Return camera to agent.\nDeprecated: Use llClearCameraParams instead. - - llReleaseControls - energy - 10.0 - sleep - 0.0 + 10 return void - arguments - + sleep + 0.1000000000000000055511151 tooltip - Stop taking inputs.\nStop taking inputs from the avatar. + Remove avatar from the land pass list.\nRemove specified avatar from the land parcel pass list. - llReleaseURL + llRemoveInventory - energy - 10.0 - sleep - 0.0 - return - void arguments - URL + InventoryItem + tooltip + type string - tooltip - URL to release. - tooltip - Releases the specified URL, which was previously obtained using llRequestURL. Once released, the URL will no longer be usable. - - llRemoteDataReply - - deprecated - true energy - 10.0 - sleep - 3.0 + 10 return void + sleep + 0 + tooltip + Remove the named inventory item.\nRemove the named inventory item from the object inventory. + + llRemoveVehicleFlags + arguments - ChannelID + Vehiclelags - type - key tooltip - + + type + integer + + energy + 10 + return + void + sleep + 0 + tooltip + Removes the enabled bits in 'flags'.\nSets the vehicle flags to FALSE. Valid parameters can be found in the vehicle flags constants section. + + llReplaceAgentEnvironment + + arguments + - MessageID + agent_id + tooltip + type key - tooltip - - sData + transition - type - string tooltip - String data to send + + type + float - iData + environment - type - integer tooltip - Integer data to send + + type + string - tooltip - Send an XML-RPC reply to MessageID on ChannelID with payload of string sData and integer iData. Deprecated: Use HTTP functions/events instead.\nThe size of sData is limited to 254 characters. - - llRemoteDataSetRegion - - deprecated - true energy - 10.0 - sleep - 0.0 + 10 return - void - arguments - + integer + sleep + 0 tooltip - Deprecated: Use HTTP functions/events instead.\nIf an object using remote data channels changes regions, you must call this function to re-register the remote data channels.\nYou do not need to make this call if you don't change regions. + Replaces the entire environment for an agent. Must be used as part of an experience. - llRemoteLoadScriptPin + llReplaceEnvironment - energy - 10.0 - sleep - 3.0 - return - void arguments - ObjectID + position - type - key tooltip - Target prim to attempt copying into. + Location of parcel to change. Use <-1, -1, -1> for entire region. + type + vector - ScriptName + environment + tooltip + + Name of inventory item, or UUID of environment resource to apply. + Use NULL_KEY or empty string to remove environment. + type string - tooltip - Name of the script in current inventory to copy. - PIN + track_no + tooltip + Elevation zone of where to apply environment. Use -1 for all. type integer - tooltip - Integer set on target prim as a Personal Information Number code. - Running + day_length + tooltip + Length of day cycle for this parcel or region. -1 to leave unchanged. type integer - tooltip - If the script should be set running in the target prim. - StartParameter + day_offset + tooltip + Offset from GMT for the day cycle on this parcel or region. -1 to leave unchanged. type integer - tooltip - Integer. Parameter passed to the script if set to be running. + energy + 10 + return + integer + sleep + 0 tooltip - If the owner of the object containing this script can modify the object identified by the specified object key, and if the PIN matches the PIN previously set using llSetRemoteScriptAccessPin (on the target prim), then the script will be copied into target. Running is a boolean specifying whether the script should be enabled once copied into the target object. + Replaces the environment for a parcel or region. - llRemoveFromLandBanList + llReplaceSubString - energy - 10.0 - sleep - 0.0 - return - void arguments - AvatarID + InitialString - type - key tooltip - + The original string in which to hunt for substring matches. + type + string - - tooltip - Remove avatar from the land ban list.\nRemove specified avatar from the land parcel ban list. - - llRemoveFromLandPassList - - energy - 10.0 - sleep - 0.0 - return - void - arguments - - AvatarID + SubString - type - key tooltip - + The original substring to find. + type + string - - tooltip - Remove avatar from the land pass list.\nRemove specified avatar from the land parcel pass list. - - llRemoveInventory - - energy - 10.0 - sleep - 0.0 - return - void - arguments - - InventoryItem + NewSubString + tooltip + The new substring used to replace. type string - tooltip - - - tooltip - Remove the named inventory item.\nRemove the named inventory item from the object inventory. - - llRemoveVehicleFlags - - energy - 10.0 - sleep - 0.0 - return - void - arguments - - Vehiclelags + Count + tooltip + The max number of replacements to make. Zero Count means "replace all". Positive Count moves left to right. Negative moves right to left. type integer - tooltip - + energy + 10 + return + string + sleep + 0 tooltip - Removes the enabled bits in 'flags'.\nSets the vehicle flags to FALSE. Valid parameters can be found in the vehicle flags constants section. + Searches InitialString and replaces instances of SubString with NewSubString. Zero Count means "replace all". Positive Count moves left to right. Negative moves right to left. llRequestAgentData - energy - 10.0 - sleep - 0.1 - return - key arguments AvatarID + tooltip + type key - tooltip - Data + tooltip + type integer - tooltip - + energy + 10 + return + key + sleep + 0.1000000000000000055511151 tooltip Requests data about AvatarID. When data is available the dataserver event will be raised.\nThis function requests data about an avatar. If and when the information is collected, the dataserver event is triggered with the key returned from this function passed in the requested parameter. See the agent data constants (DATA_*) for details about valid values of data and what each will return in the dataserver event. llRequestDisplayName - energy - 10.0 - sleep - 0.0 - return - key arguments AvatarID - type - key tooltip Avatar UUID + type + key + energy + 10 + return + key + sleep + 0 tooltip Requests the display name of the agent. When the display name is available the dataserver event will be raised.\nThe avatar identified does not need to be in the same region or online at the time of the request.\nReturns a key that is used to identify the dataserver event when it is raised. llRequestExperiencePermissions - energy - 10.0 - sleep - 0.0 - return - void arguments - - AgentID - - type - key - tooltip - - - - - unused - - type - string - tooltip - Not used, should be "" - - + + AgentID + + tooltip + + type + key + + + + unused + + tooltip + Not used, should be "" + type + string + + + energy + 10 + return + void + sleep + 0 tooltip Ask the agent for permission to participate in an experience. This request is similar to llRequestPermissions with the following permissions: PERMISSION_TAKE_CONTROLS, PERMISSION_TRIGGER_ANIMATION, PERMISSION_ATTACH, PERMISSION_TRACK_CAMERA, PERMISSION_CONTROL_CAMERA and PERMISSION_TELEPORT. However, unlike llRequestPermissions the decision to allow or block the request is persistent and applies to all scripts using the experience grid wide. Subsequent calls to llRequestExperiencePermissions from scripts in the experience will receive the same response automatically with no user interaction. One of experience_permissions or experience_permissions_denied will be generated in response to this call. Outstanding permission requests will be lost if the script is derezzed, moved to another region or reset. @@ -14842,3967 +19494,4479 @@ llRequestInventoryData - energy - 10.0 - sleep - 1.0 - return - key arguments InventoryItem + tooltip + type string - tooltip - - tooltip - Requests data for the named InventoryItem.\nWhen data is available, the dataserver event will be raised with the key returned from this function in the requested parameter.\nThe only request currently implemented is to request data from landmarks, where the data returned is in the form "<float, float, float>" which can be cast to a vector. This position is in region local coordinates. - - llRequestPermissions - energy - 10.0 - sleep - 0.0 + 10 return - void + key + sleep + 1 + tooltip + Requests data for the named InventoryItem.\nWhen data is available, the dataserver event will be raised with the key returned from this function in the requested parameter.\nThe only request currently implemented is to request data from landmarks, where the data returned is in the form "<float, float, float>" which can be cast to a vector. This position is in region local coordinates. + + llRequestPermissions + arguments AvatarID + tooltip + type key - tooltip - PermissionMask + tooltip + type integer - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Ask AvatarID to allow the script to perform certain actions, specified in the PermissionMask bitmask. PermissionMask should be one or more PERMISSION_* constants. Multiple permissions can be requested simultaneously by ORing the constants together. Many of the permissions requests can only go to object owner.\nThis call will not stop script execution. If the avatar grants the requested permissions, the run_time_permissions event will be called. llRequestSecureURL + arguments + energy - 10.0 - sleep - 0.0 + 10 return key - arguments - + sleep + 0 tooltip Requests one HTTPS:// (SSL) URL for use by this object. The http_request event is triggered with results.\nReturns a key that is the handle used for identifying the request in the http_request event. llRequestSimulatorData - energy - 10.0 - sleep - 1.0 - return - key arguments RegionName + tooltip + type string - tooltip - Data + tooltip + type integer - tooltip - + energy + 10 + return + key + sleep + 1 tooltip Requests the specified Data about RegionName. When the specified data is available, the dataserver event is raised.\nData should use one of the DATA_SIM_* constants.\nReturns a dataserver query ID and triggers the dataserver event when data is found. llRequestURL + arguments + energy - 10.0 - sleep - 0.0 + 10 return key - arguments - + sleep + 0 tooltip Requests one HTTP:// URL for use by this script. The http_request event is triggered with the result of the request.\nReturns a key that is the handle used for identifying the result in the http_request event. - llRequestUsername + llRequestUserKey + arguments + + + Name + + tooltip + Name of agent to look up. + type + string + + + energy - 10.0 - sleep - 0.0 + 10 return key + sleep + 0 + tooltip + Look up Agent ID for the named agent using a historical name. + + llRequestUsername + arguments AvatarID + tooltip + type key - tooltip - + energy + 10 + return + key + sleep + 0 tooltip Requests single-word user-name of an avatar. When data is available the dataserver event will be raised.\nRequests the user-name of the identified agent. When the user-name is available the dataserver event is raised.\nThe agent identified does not need to be in the same region or online at the time of the request.\nReturns a key that is used to identify the dataserver event when it is raised. llResetAnimationOverride - energy - 0 - sleep - 0 - return - void arguments AnimationState + tooltip + type string - tooltip - + energy + 10 + return + void + sleep + 0 tooltip - Resets the animation of the specified animation state to the default value.\nIf animation state equals "ALL", then all animation states are reset. + Resets the animation of the specified animation state to the default value.\nIf animation state equals "ALL", then all animation states are reset. llResetLandBanList + arguments + energy - 10.0 - sleep - 0.0 + 10 return void - arguments - + sleep + 0.1000000000000000055511151 tooltip Removes all residents from the land ban list. llResetLandPassList + arguments + energy - 10.0 - sleep - 0.0 + 10 return void - arguments - + sleep + 0.1000000000000000055511151 tooltip Removes all residents from the land access/pass list. llResetOtherScript - energy - 10.0 - sleep - 0.0 - return - void arguments ScriptName + tooltip + type string - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Resets the named script. llResetScript + arguments + energy - 10.0 - sleep - 0.0 + 10 return void - arguments - + sleep + 0 tooltip Resets the script. llResetTime + arguments + energy - 10.0 - sleep - 0.0 + 10 return void - arguments - + sleep + 0 tooltip Sets the time to zero.\nSets the internal timer to zero. llReturnObjectsByID - energy - 10.0 - sleep - 0.0 - return - integer arguments ObjectIDs - type - list tooltip List of object UUIDs to be returned. + type + list + energy + 10 + return + integer + sleep + 0 tooltip Return objects using their UUIDs.\nRequires the PERMISSION_RETURN_OBJECTS permission and that the script owner owns the parcel the returned objects are in, or is an estate manager or region owner. llReturnObjectsByOwner - energy - 10.0 - sleep - 0.0 - return - integer arguments ID + tooltip + Object owner's UUID. type key - tooltip - Object owner's UUID. Scope + tooltip + type integer - tooltip - + energy + 10 + return + integer + sleep + 0 tooltip Return objects based upon their owner and a scope of parcel, parcel owner, or region.\nRequires the PERMISSION_RETURN_OBJECTS permission and that the script owner owns the parcel the returned objects are in, or is an estate manager or region owner. llRezAtRoot - energy - 200.0 - sleep - 0.1 - return - void arguments InventoryItem + tooltip + type string - tooltip - Position + tooltip + type vector - tooltip - Velocity + tooltip + type vector - tooltip - Rotation + tooltip + type rotation - tooltip - StartParameter + tooltip + type integer - tooltip - - tooltip - Instantiate owner's InventoryItem at Position with Velocity, Rotation and with StartParameter. The last selected root object's location will be set to Position.\nCreates object's inventory item at the given Position, with Velocity, Rotation, and StartParameter. - - llRezObject - energy 200 - sleep - 0.1 return void + sleep + 0.1000000000000000055511151 + tooltip + Instantiate owner's InventoryItem at Position with Velocity, Rotation and with StartParameter. The last selected root object's location will be set to Position.\nCreates object's inventory item at the given Position, with Velocity, Rotation, and StartParameter. + + llRezObject + arguments InventoryItem + tooltip + type string - tooltip - Position + tooltip + type vector - tooltip - Velocity + tooltip + type vector - tooltip - Rotation + tooltip + type rotation - tooltip - StartParameter + tooltip + type integer - tooltip - + energy + 200 + return + void + sleep + 0.1000000000000000055511151 tooltip - Instantiate owners InventoryItem at Position with Velocity, Rotation and with start StartParameter.\nCreates object's inventory item at Position with Velocity and Rotation supplied. The StartParameter value will be available to the newly created object in the on_rez event or through the llGetStartParameter function.\nThe Velocity parameter is ignored if the rezzed object is not physical. + Instantiate owners InventoryItem at Position with Velocity, Rotation and with start StartParameter.\nCreates object's inventory item at Position with Velocity and Rotation supplied. The StartParameter value will be available to the newly created object in the on_rez event or through the llGetStartParameter function.\nThe Velocity parameter is ignored if the rezzed object is not physical. - llRot2Angle + llRezObjectWithParams - energy - 10.0 - sleep - 0.0 - return - float arguments - Rotation + InventoryItem + tooltip + type - rotation + string + + + + Parms + tooltip - + + type + list + energy + 200 + return + key + sleep + 0.1000000000000000055511151 tooltip - Returns the rotation angle represented by Rotation.\nReturns the angle represented by the Rotation. + Instantiate owner's InventoryItem with the given parameters. - llRot2Axis + llRot2Angle - energy - 10.0 - sleep - 0.0 - return - vector arguments Rotation + tooltip + type rotation - tooltip - + energy + 10 + return + float + sleep + 0 tooltip - Returns the rotation axis represented by Rotation.\nReturns the axis represented by the Rotation. + Returns the rotation angle represented by Rotation.\nReturns the angle represented by the Rotation. - llRot2Euler + llRot2Axis - energy - 10.0 - sleep - 0.0 - return - vector arguments Rotation + tooltip + type rotation - tooltip - - tooltip - Returns the Euler representation (roll, pitch, yaw) of Rotation.\nReturns the Euler Angle representation of the Rotation. - - llRot2Fwd - energy - 10.0 - sleep - 0.0 + 10 return vector + sleep + 0 + tooltip + Returns the rotation axis represented by Rotation.\nReturns the axis represented by the Rotation. + + llRot2Euler + arguments Rotation + tooltip + type rotation - tooltip - - tooltip - Returns the forward vector defined by Rotation.\nReturns the forward axis represented by the Rotation. - - llRot2Left - energy - 10.0 - sleep - 0.0 + 10 return vector + sleep + 0 + tooltip + Returns the Euler representation (roll, pitch, yaw) of Rotation.\nReturns the Euler Angle representation of the Rotation. + + llRot2Fwd + arguments Rotation + tooltip + type rotation - tooltip - - tooltip - Returns the left vector defined by Rotation.\nReturns the left axis represented by the Rotation. - - llRot2Up - energy - 10.0 - sleep - 0.0 + 10 return vector + sleep + 0 + tooltip + Returns the forward vector defined by Rotation.\nReturns the forward axis represented by the Rotation. + + llRot2Left + arguments Rotation + tooltip + type rotation - tooltip - + energy + 10 + return + vector + sleep + 0 tooltip - Returns the up vector defined by Rotation.\nReturns the up axis represented by the Rotation. + Returns the left vector defined by Rotation.\nReturns the left axis represented by the Rotation. - llRotateTexture + llRot2Up - energy - 10.0 - sleep - 0.2 - return - void arguments - Radians + Rotation - type - float tooltip - - - - - Face - + type - integer - tooltip - + rotation + energy + 10 + return + vector + sleep + 0 tooltip - Sets the texture rotation for the specified Face to angle Radians.\nIf Face is ALL_SIDES, rotates the texture of all sides. + Returns the up vector defined by Rotation.\nReturns the up axis represented by the Rotation. llRotBetween - energy - 10.0 - sleep - 0.0 - return - rotation arguments Vector1 + tooltip + type vector - tooltip - Vector2 + tooltip + type vector - tooltip - + energy + 10 + return + rotation + sleep + 0 tooltip Returns the rotation to rotate Vector1 to Vector2.\nReturns the rotation needed to rotate Vector1 to Vector2. llRotLookAt - energy - 10.0 - sleep - 0.0 - return - void arguments Rotation + tooltip + type rotation - tooltip - Strength + tooltip + type float - tooltip - Damping + tooltip + type float - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Cause object to rotate to Rotation, with a force function defined by Strength and Damping parameters. Good strength values are around half the mass of the object and good damping values are less than 1/10th of the strength.\nAsymmetrical shapes require smaller damping.\nA strength of 0.0 cancels the look at. llRotTarget - energy - 10.0 - sleep - 0.0 - return - integer arguments Rotation + tooltip + type rotation - tooltip - LeeWay + tooltip + type float - tooltip - + energy + 10 + return + integer + sleep + 0 tooltip Set rotations with error of LeeWay radians as a rotational target, and return an ID for the rotational target.\nThe returned number is a handle that can be used in at_rot_target and llRotTargetRemove. llRotTargetRemove - energy - 10.0 - sleep - 0.0 - return - void arguments Handle + tooltip + type integer - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Removes rotational target number.\nRemove rotational target indicated by the handle. - llRound + llRotateTexture + arguments + + + Radians + + tooltip + + type + float + + + + Face + + tooltip + + type + integer + + + energy - 10.0 - sleep - 0.0 + 10 return - integer + void + sleep + 0.2000000000000000111022302 + tooltip + Sets the texture rotation for the specified Face to angle Radians.\nIf Face is ALL_SIDES, rotates the texture of all sides. + + llRound + arguments Value + tooltip + type float - tooltip - + energy + 10 + return + integer + sleep + 0 tooltip Returns Value rounded to the nearest integer.\nReturns the Value rounded to the nearest integer. - llSameGroup + llSHA1String + arguments + + + Text + + tooltip + + type + string + + + energy - 10.0 + 10 + return + string sleep - 0.0 + 0 + tooltip + Returns a string of 40 hex characters that is the SHA1 security hash of text. + + llSHA256String + + arguments + + + text + + tooltip + + type + string + + + + energy + 10 return - integer + string + sleep + 0 + tooltip + Returns a string of 64 hex characters that is the SHA256 security hash of text. + + llSameGroup + arguments ID + tooltip + type key - tooltip - + energy + 10 + return + integer + sleep + 0 tooltip Returns TRUE if avatar ID is in the same region and has the same active group, otherwise FALSE.\nReturns TRUE if the object or agent identified is in the same simulator and has the same active group as this object. Otherwise, returns FALSE. llSay - energy - 10.0 - sleep - 0.0 - return - void arguments Channel - type - integer tooltip Channel to use to say text on. + type + integer Text - type - string tooltip Text to say. + type + string + energy + 10 + return + void + sleep + 0 tooltip Says Text on Channel.\nThis chat method has a range of 20m radius.\nPUBLIC_CHANNEL is the public chat channel that all avatars see as chat text. DEBUG_CHANNEL is the script debug channel, and is also visible to nearby avatars. All other channels are are not sent to avatars, but may be used to communicate with scripts. llScaleByFactor - energy - 10.0 - sleep - 0.0 - return - integer arguments ScalingFactor - type - float tooltip The multiplier to be used with the prim sizes and their local positions. + type + float + energy + 10 + return + integer + sleep + 0 tooltip Attempts to resize the entire object by ScalingFactor, maintaining the size-position ratios of the prims.\n\nResizing is subject to prim scale limits and linkability limits. This function can not resize the object if the linkset is physical, a pathfinding character, in a keyframed motion, or if resizing would cause the parcel to overflow.\nReturns a boolean (an integer) TRUE if it succeeds, FALSE if it fails. llScaleTexture - energy - 10.0 - sleep - 0.2 - return - void arguments Horizontal + tooltip + type float - tooltip - Vertical + tooltip + type float - tooltip - Face + tooltip + type integer - tooltip - + energy + 10 + return + void + sleep + 0.2000000000000000111022302 tooltip Sets the diffuse texture Horizontal and Vertical repeats on Face of the prim the script is attached to.\nIf Face == ALL_SIDES, all sides are set in one call.\nNegative values for horizontal and vertical will flip the texture. llScriptDanger - energy - 10.0 - sleep - 0.0 - return - integer arguments Position + tooltip + type vector - tooltip - + energy + 10 + return + integer + sleep + 0 tooltip - Returns TRUE if Position is over public land, sandbox land, land that doesn't allow everyone to edit and build, or land that doesn't allow outside scripts.\nReturns true if the position is over public land, land that doesn't allow everyone to edit and build, or land that doesn't allow outside scripts. + Returns TRUE if Position is over public land, sandbox land, land that doesn't allow everyone to edit and build, or land that doesn't allow outside scripts.\nReturns true if the position is over public land, land that doesn't allow everyone to edit and build, or land that doesn't allow outside scripts. llScriptProfiler - energy - 10.0 - sleep - 0.0 - return - void arguments State - type - integer tooltip PROFILE_NONE or PROFILE_SCRIPT_MEMORY flags to control the state. + type + integer + energy + 10 + return + void + sleep + 0 tooltip Enables or disables script profiling options. Currently only supports PROFILE_SCRIPT_MEMORY (Mono only) and PROFILE_NONE.\nMay significantly reduce script performance. llSendRemoteData - deprecated - true - energy - 10.0 - sleep - 3.0 - return - key arguments ChannelID + tooltip + type key - tooltip - Destination + tooltip + type string - tooltip - Value + tooltip + type integer - tooltip - Text + tooltip + type string - tooltip - + deprecated + 1 + energy + 10 + return + key + sleep + 3 tooltip - Deprecated: use HTTP functions and events instead.\nSends an XML-RPC request to Destination through ChannelID with payload of ChannelID (in a string), integer Value and string Text.\nReturns a key that is the message_id for the resulting remote_data events. + This function is deprecated. llSensor - energy - 10.0 - sleep - 0.0 - return - void arguments Name - type - string tooltip Object or avatar name. + type + string ID - type - key tooltip Object or avatar UUID. + type + key Type - type - integer tooltip Bit-field mask of AGENT, AGENT_BY_LEGACY_NAME, AGENT_BY_USERNAME, ACTIVE, PASSIVE, and/or SCRIPTED + type + integer Range - type - float tooltip Distance to scan. 0.0 - 96.0m. + type + float Arc - type - float tooltip Angle, in radians, from the local x-axis of the prim to scan. + type + float + energy + 10 + return + void + sleep + 0 tooltip Performs a single scan for Name and ID with Type (AGENT, ACTIVE, PASSIVE, and/or SCRIPTED) within Range meters and Arc radians of forward vector.\nSpecifying a blank Name, 0 Type, or NULL_KEY ID will prevent filtering results based on that parameter. A range of 0.0 does not perform a scan.\nResults are returned in the sensor and no_sensor events. llSensorRemove + arguments + energy - 10.0 - sleep - 0.0 + 10 return void - arguments - + sleep + 0 tooltip removes sensor.\nRemoves the sensor set by llSensorRepeat. llSensorRepeat - energy - 10.0 - sleep - 0.0 - return - void arguments Name - type - string tooltip Object or avatar name. + type + string ID - type - key tooltip Object or avatar UUID. + type + key Type - type - integer tooltip Bit-field mask of AGENT, AGENT_BY_LEGACY_NAME, AGENT_BY_USERNAME, ACTIVE, PASSIVE, and/or SCRIPTED + type + integer Range - type - float tooltip Distance to scan. 0.0 - 96.0m. + type + float Arc - type - float tooltip Angle, in radians, from the local x-axis of the prim to scan. + type + float Rate - type - float tooltip Period, in seconds, between scans. + type + float + energy + 10 + return + void + sleep + 0 tooltip Initiates a periodic scan every Rate seconds, for Name and ID with Type (AGENT, ACTIVE, PASSIVE, and/or SCRIPTED) within Range meters and Arc radians of forward vector.\nSpecifying a blank Name, 0 Type, or NULL_KEY ID will prevent filtering results based on that parameter. A range of 0.0 does not perform a scan.\nResults are returned in the sensor and no_sensor events. - llSetAlpha + llSetAgentEnvironment + arguments + + + agent_id + + tooltip + Agent to receive new environment settings. + type + key + + + + transition + + tooltip + Number of seconds over which to apply new settings. + type + float + + + + Settings + + tooltip + List of environment settings to replace for agent. + type + list + + + energy - 10.0 + 10 + return + integer sleep - 0.0 + 0 + tooltip + Sets an agent's environmental values to the specified values. Must be used as part of an experience. + + llSetAgentRot + + arguments + + + rot + + tooltip + Rotation to turn the avatar to face. + type + rotation + + + + flags + + tooltip + flags + type + integer + + + + energy + 10 return void + sleep + 0 + tooltip + Sets the avatar rotation to the given value. + + llSetAlpha + arguments Opacity + tooltip + type float - tooltip - Face + tooltip + type integer - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Sets the alpha (opacity) of Face.\nSets the alpha (opacity) value for Face. If Face is ALL_SIDES, sets the alpha for all faces. The alpha value is interpreted as an opacity percentage (1.0 is fully opaque, and 0.2 is mostly transparent). This function will clamp alpha values less than 0.1 to 0.1 and greater than 1.0 to 1. llSetAngularVelocity - energy - - sleep - 0.0 - return - void arguments AngVel - type - vector tooltip The angular velocity to set the object to. + type + vector Local - type - integer tooltip If TRUE, the AngVel is treated as a local directional vector instead of a regional directional vector. + type + integer + energy + 10 + return + void + sleep + 0 tooltip - Sets an object's angular velocity to AngVel, in local coordinates if Local == TRUE (if the script is physical).\nHas no effect on non-physical objects. + Sets an object's angular velocity to AngVel, in local coordinates if Local == TRUE (if the script is physical).\nHas no effect on non-physical objects. llSetAnimationOverride - energy - 0 - sleep - 0 - return - void arguments AnimationState + tooltip + type string - tooltip - AnimationName + tooltip + type string - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Sets the animation (in object inventory) that will play for the given animation state.\nTo use this function the script must obtain the PERMISSION_OVERRIDE_ANIMATIONS permission. llSetBuoyancy - energy - 10.0 - sleep - 0.0 - return - void arguments Buoyancy + tooltip + type float - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Set the tasks buoyancy (0 is none, < 1.0 sinks, 1.0 floats, > 1.0 rises).\nSet the object buoyancy. A value of 0 is none, less than 1.0 sinks, 1.0 floats, and greater than 1.0 rises. llSetCameraAtOffset - energy - 10.0 - sleep - 0.0 - return - void arguments Offset + tooltip + type vector - tooltip - + energy + 10 + return + void + sleep + 0 tooltip - Sets the camera used in this object, at offset, if an avatar sits on it.\nSets the offset that an avatar's camera will be moved to if the avatar sits on the object. + Sets the camera used in this object, at offset, if an avatar sits on it.\nSets the offset that an avatar's camera will be moved to if the avatar sits on the object. llSetCameraEyeOffset - energy - 10.0 - sleep - 0.0 - return - void arguments Offset + tooltip + type vector - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Sets the camera eye offset used in this object if an avatar sits on it. llSetCameraParams - energy - 10.0 - sleep - 0.0 - return - void arguments Parameters + tooltip + type list - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Sets multiple camera parameters at once. List format is [ rule-1, data-1, rule-2, data-2 . . . rule-n, data-n ]. llSetClickAction - energy - 10.0 - sleep - 0.0 - return - void arguments Action - type - integer tooltip A CLICK_ACTION_* flag + type + integer + energy + 10 + return + void + sleep + 0 tooltip Sets the action performed when a prim is clicked upon. llSetColor - energy - 10.0 - sleep - 0.0 - return - void arguments Color + tooltip + type vector - tooltip - Face + tooltip + type integer - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Sets the color, for the face.\nSets the color of the side specified. If Face is ALL_SIDES, sets the color on all faces. llSetContentType - energy - - sleep - - return - void arguments HTTPRequestID + tooltip + A valid http_request() key type key + + + + ContentType + tooltip - A valid http_request() key + Media type to use with any following llHTTPResponse(HTTPRequestID, ...) + type + integer + + energy + 10 + return + void + sleep + 0 + tooltip + Set the media type of an LSL HTTP server response to ContentType.\nHTTPRequestID must be a valid http_request ID. ContentType must be one of the CONTENT_TYPE_* constants. + + llSetDamage + + arguments + - ContentType + Damage - type - integer tooltip - Media type to use with any following llHTTPResponse(HTTPRequestID, ...) + + type + float - tooltip - Set the media type of an LSL HTTP server response to ContentType.\nHTTPRequestID must be a valid http_request ID. ContentType must be one of the CONTENT_TYPE_* constants. - - llSetDamage - energy - 10.0 - sleep - 0.0 + 10 return void + sleep + 0 + tooltip + Sets the amount of damage that will be done to an avatar that this task hits. Task will be killed.\nSets the amount of damage that will be done to an avatar that this object hits. This object will be destroyed on damaging an avatar, and no collision event is triggered. + + llSetEnvironment + arguments - Damage + Position + tooltip + Location within the region. type - float + vector + + + + EnvParams + tooltip - + List of environment settings to change for the specified parcel location. + type + list + energy + 10 + return + integer + sleep + 0 tooltip - Sets the amount of damage that will be done to an avatar that this task hits. Task will be killed.\nSets the amount of damage that will be done to an avatar that this object hits. This object will be destroyed on damaging an avatar, and no collision event is triggered. + Returns a string with the requested data about the region. llSetForce - energy - 10.0 - sleep - 0.0 - return - void arguments Force - type - vector tooltip Directional force. + type + vector Local - type - integer tooltip Boolean, if TRUE uses local axis, if FALSE uses region axis. + type + integer + energy + 10 + return + void + sleep + 0 tooltip Sets Force on object, in object-local coordinates if Local == TRUE (otherwise, the region reference frame is used).\nOnly works on physical objects. llSetForceAndTorque - energy - 10.0 - sleep - 0.0 - return - void arguments Force - type - vector tooltip Directional force. + type + vector Torque - type - vector tooltip Torque force. + type + vector Local - type - integer tooltip Boolean, if TRUE uses local axis, if FALSE uses region axis. + type + integer + energy + 10 + return + void + sleep + 0 tooltip Sets the Force and Torque of object, in object-local coordinates if Local == TRUE (otherwise, the region reference frame is used).\nOnly works on physical objects. - llSetHoverHeight + llSetGroundTexture + arguments + + + Changes + + tooltip + A list of ground texture properties to change. + type + list + + + energy - 10.0 - sleep - 0.0 + 10 return - void + integer + sleep + 0 + tooltip + Changes terrain texture properties in the region. + + llSetHoverHeight + arguments Height - type - float tooltip Distance above the ground. + type + float Water - type - integer tooltip Boolean, if TRUE then hover above water too. + type + integer Tau - type - float tooltip Seconds to critically damp in. + type + float + energy + 10 + return + void + sleep + 0 tooltip Critically damps a physical object to a Height (either above ground level or above the higher of land and water if water == TRUE).\nDo not use with vehicles. Use llStopHover to stop hovering. llSetInventoryPermMask - god-mode - true - energy - 10.0 - sleep - 0.0 - return - void arguments InventoryItem + tooltip + An item in the prim's inventory type string - tooltip - An item in the prim's inventory PermissionFlag - type - integer tooltip MASK_* flag + type + integer PermissionMask - type - integer tooltip Permission bit-field (PERM_* flags) + type + integer + energy + 10 + god-mode + 1 + return + void + sleep + 0 tooltip Sets the given permission mask to the new value on the inventory item. llSetKeyframedMotion - energy - - sleep - - return - void arguments Keyframes - type - list tooltip Strided keyframe list of the form: position, orientation, time. Each keyframe is interpreted relative to the previous transform of the object. + type + list Options + tooltip + type list - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Requests that a non-physical object be key-framed according to key-frame list.\nSpecify a list of times, positions, and orientations to be followed by an object. The object will be smoothly moved between key-frames by the simulator. Collisions with other non-physical or key-framed objects will be ignored (no script events will fire and collision processing will not occur). Collisions with physical objects will be computed and reported, but the key-framed object will be unaffected by those collisions.\nKeyframes is a strided list containing positional, rotational, and time data for each step in the motion. Options is a list containing optional arguments and parameters (specified by KFM_* constants). llSetLinkAlpha - energy - 10.0 - sleep - 0.0 - return - void arguments LinkNumber + tooltip + type integer - tooltip - Opacity + tooltip + type float - tooltip - Face + tooltip + type integer - tooltip - + energy + 10 + return + void + sleep + 0 tooltip If a prim exists in the link chain at LinkNumber, set Face to Opacity.\nSets the Face, on the linked prim specified, to the Opacity. llSetLinkCamera - energy - 10.0 - sleep - 0.0 - return - void arguments LinkNumber - type - integer tooltip Prim link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag + type + integer EyeOffset + tooltip + Offset, relative to the object's centre and expressed in local coordinates, that the camera looks from. type vector - tooltip - Offset, relative to the object's centre and expressed in local coordinates, that the camera looks from. LookOffset + tooltip + Offset, relative to the object's centre and expressed in local coordinates, that the camera looks toward. type vector - tooltip - Offset, relative to the object's centre and expressed in local coordinates, that the camera looks toward. + energy + 10 + return + void + sleep + 0 tooltip Sets the camera eye offset, and the offset that camera is looking at, for avatars that sit on the linked prim. llSetLinkColor + arguments + + + LinkNumber + + tooltip + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag. + type + integer + + + + Color + + tooltip + Color in RGB <R.R, G.G, B.B> + type + vector + + + + Face + + tooltip + Side number or ALL_SIDES. + type + integer + + + energy - 10.0 - sleep - 0.0 + 10 return void + sleep + 0 + tooltip + If a task exists in the link chain at LinkNumber, set the Face to color.\nSets the color of the linked child's side, specified by LinkNumber. + + llSetLinkMedia + + arguments + + + Link + + tooltip + Link number (0: unlinked, 1: root prim, >1: child prims). + type + integer + + + + Face + + tooltip + Face number. + type + integer + + + + Parameters + + tooltip + A set of name/value pairs (in no particular order) + type + list + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Set the media parameters for a particular face on linked prim, specified by Link. Returns an integer that is a STATUS_* flag which details the success/failure of the operation(s).\nMediaParameters is a set of name/value pairs in no particular order. Parameters not specified are unchanged, or if new media is added then set to the default specified. + + llSetLinkPrimitiveParams + arguments LinkNumber + tooltip + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag type integer - tooltip - Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag. - Color + Parameters - type - vector tooltip - Color in RGB <R.R, G.G, B.B> - - - - Face - + type - integer - tooltip - Side number or ALL_SIDES. + list + energy + 10 + return + void + sleep + 0.2000000000000000111022302 tooltip - If a task exists in the link chain at LinkNumber, set the Face to color.\nSets the color of the linked child's side, specified by LinkNumber. + Set primitive parameters for LinkNumber based on Parameters.\nSets the parameters (or properties) of any linked prim in one step. - llSetLinkMedia + llSetLinkPrimitiveParamsFast - energy - 0.0 - sleep - 0.0 - return - integer arguments - Link + LinkNumber - type - integer tooltip - Link number (0: unlinked, 1: root prim, >1: child prims). - - - - Face - + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag type integer - tooltip - Face number. Parameters + tooltip + type list - tooltip - A set of name/value pairs (in no particular order) - tooltip - Set the media parameters for a particular face on linked prim, specified by Link. Returns an integer that is a STATUS_* flag which details the success/failure of the operation(s).\nMediaParameters is a set of name/value pairs in no particular order. Parameters not specified are unchanged, or if new media is added then set to the default specified. - - llSetLinkPrimitiveParams - energy - 10.0 - sleep - 0.2 + 10 return void + sleep + 0 + tooltip + Set primitive parameters for LinkNumber based on Parameters, without a delay.\nSet parameters for link number, from the list of Parameters, with no built-in script sleep. This function is identical to llSetLinkPrimitiveParams, except without the delay. + + llSetLinkRenderMaterial + arguments LinkNumber + tooltip + type integer - tooltip - Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag - Parameters + RenderMaterial + tooltip + type - list + string + + + + Face + tooltip - + + type + integer - tooltip - Set primitive parameters for LinkNumber based on Parameters.\nSets the parameters (or properties) of any linked prim in one step. - - llSetLinkPrimitiveParamsFast - energy - 10.0 - sleep - 0.0 + 10 return void + sleep + 0.2000000000000000111022302 + tooltip + Sets the Render Material of Face on a linked prim, specified by LinkNumber. Render Materail may be a UUID or name of a material in prim inventory. + + llSetLinkSitFlags + arguments LinkNumber + tooltip + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag. type integer - tooltip - Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag - Parameters + Flags - type - list tooltip - + The new set of sit flags to apply to the specified prims in this linkset. + type + integer + energy + 10 + return + void + sleep + 0 tooltip - Set primitive parameters for LinkNumber based on Parameters, without a delay.\nSet parameters for link number, from the list of Parameters, with no built-in script sleep. This function is identical to llSetLinkPrimitiveParams, except without the delay. + Returns the sit flags set on the specified prim in a linkset. llSetLinkTexture - energy - 10.0 - sleep - 0.2 - return - void arguments LinkNumber + tooltip + type integer - tooltip - Texture + tooltip + type string - tooltip - Face + tooltip + type integer - tooltip - + energy + 10 + return + void + sleep + 0.2000000000000000111022302 tooltip Sets the Texture of Face on a linked prim, specified by LinkNumber. Texture may be a UUID or name of a texture in prim inventory. llSetLinkTextureAnim - energy - 10.0 - sleep - 0.0 - return - void arguments LinkNumber - type - integer tooltip Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag to effect + type + integer Mode - type - integer tooltip Bitmask of animation options. + type + integer Face - type - integer tooltip Specifies which object face to animate or ALL_SIDES. + type + integer SizeX - type - integer tooltip Horizontal frames (ignored for ROTATE and SCALE). + type + integer SizeY - type - integer tooltip Vertical frames (ignored for ROTATE and SCALE). + type + integer Start - type - float tooltip Start position/frame number (or radians for ROTATE). + type + float Length - type - float tooltip Specifies the animation duration, in frames (or radians for ROTATE). + type + float Rate - type - float tooltip Specifies the animation playback rate, in frames per second (must be greater than zero). + type + float + energy + 10 + return + void + sleep + 0 tooltip Animates a texture on the prim specified by LinkNumber, by setting the texture scale and offset.\nMode is a bitmask of animation options.\nFace specifies which object face to animate.\nSizeX and SizeY specify the number of horizontal and vertical frames.Start specifes the animation start point.\nLength specifies the animation duration.\nRate specifies the animation playback rate. llSetLocalRot - energy - 10.0 - sleep - 0.2 - return - void arguments Rotation + tooltip + type rotation - tooltip - + energy + 10 + return + void + sleep + 0.2000000000000000111022302 tooltip Sets the rotation of a child prim relative to the root prim. llSetMemoryLimit - energy - 10.0 - sleep - 0.0 - return - integer arguments Limit - type - integer tooltip The amount to reserve, which must be less than the allowed maximum (currently 64KB) and not already have been exceeded. + type + integer + energy + 10 + return + integer + sleep + 0 tooltip Requests Limit bytes to be reserved for this script.\nReturns TRUE or FALSE indicating whether the limit was set successfully.\nThis function has no effect if the script is running in the LSO VM. llSetObjectDesc - energy - 10.0 - sleep - 0.0 - return - void arguments Description + tooltip + type string - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Sets the description of the prim to Description.\nThe description field is limited to 127 characters. llSetObjectName - energy - 10.0 - sleep - 0.0 - return - void arguments Name + tooltip + type string - tooltip - + energy + 10 + return + void + sleep + 0 tooltip - Sets the prim's name to Name. + Sets the prim's name to Name. llSetObjectPermMask - god-mode - true - energy - 10.0 - sleep - 0.0 - return - void arguments PermissionFlag - type - integer tooltip MASK_* flag + type + integer PermissionMask - type - integer tooltip Permission bit-field (PERM_* flags) + type + integer + energy + 10 + god-mode + 1 + return + void + sleep + 0 tooltip Sets the specified PermissionFlag permission to the value specified by PermissionMask on the object the script is attached to. llSetParcelMusicURL - energy - 10.0 - sleep - 2.0 - return - void arguments URL + tooltip + type string - tooltip - + energy + 10 + return + void + sleep + 2 tooltip Sets the streaming audio URL for the parcel the object is on.\nThe object must be owned by the owner of the parcel; if the parcel is group owned the object must be owned by that group. llSetPayPrice - energy - 10.0 - sleep - 0.0 - return - void arguments Price - type - integer tooltip The default price shown in the textu input field. + type + integer QuickButtons + tooltip + Specifies the 4 payment values shown in the payment dialog's buttons (or PAY_HIDE). type list - tooltip - Specifies the 4 payment values shown in the payment dialog's buttons (or PAY_HIDE). + energy + 10 + return + void + sleep + 0 tooltip - Sets the default amount when someone chooses to pay this object.\nPrice is the default price shown in the textu input field. QuickButtons specifies the 4 payment values shown in the payment dialog's buttons.\nInput field and buttons may be hidden with PAY_HIDE constant, and may be set to their default values using PAY_DEFAULT. + Sets the default amount when someone chooses to pay this object.\nPrice is the default price shown in the textu input field. QuickButtons specifies the 4 payment values shown in the payment dialog's buttons.\nInput field and buttons may be hidden with PAY_HIDE constant, and may be set to their default values using PAY_DEFAULT. llSetPhysicsMaterial - energy - - sleep - - return - void arguments MaterialBits - type - integer tooltip A bitmask specifying which of the parameters in the other arguments should be applied to the object. + type + integer GravityMultiplier + tooltip + type float - tooltip - Restitution + tooltip + type float - tooltip - Friction + tooltip + type float - tooltip - Density + tooltip + type float - tooltip - + energy + 10 + return + void + sleep + 0 tooltip - Sets the selected parameters of the object's physics behavior.\nMaterialBits is a bitmask specifying which of the parameters in the other arguments should be applied to the object. GravityMultiplier, Restitution, Friction, and Density are the possible parameters to manipulate. + Sets the selected parameters of the object's physics behavior.\nMaterialBits is a bitmask specifying which of the parameters in the other arguments should be applied to the object. GravityMultiplier, Restitution, Friction, and Density are the possible parameters to manipulate. llSetPos - energy - 10.0 - sleep - 0.2 - return - void arguments Position - type - vector tooltip Region coordinates to move to (within 10m). + type + vector - tooltip - If the object is not physical, this function sets the position of the prim.\nIf the script is in a child prim, Position is treated as root relative and the link-set is adjusted.\nIf the prim is the root prim, the entire object is moved (up to 10m) to Position in region coordinates. - - llSetPrimitiveParams - energy - 10.0 - sleep - 0.2 + 10 return void - arguments - - - Parameters - - type - list - tooltip - A list of changes. - - - + sleep + 0.2000000000000000111022302 tooltip - This function changes the many properties (or "parameters") of a prim in one operation. Parameters is a list of changes. + If the object is not physical, this function sets the position of the prim.\nIf the script is in a child prim, Position is treated as root relative and the link-set is adjusted.\nIf the prim is the root prim, the entire object is moved (up to 10m) to Position in region coordinates. llSetPrimMediaParams - energy - 10.0 - sleep - 1.0 - return - integer arguments Face - type - integer tooltip Face number + type + integer MediaParameters - type - list tooltip A set of name/value pairs (in no particular order) + type + list + energy + 10 + return + integer + sleep + 1 tooltip Sets the MediaParameters for a particular Face on the prim. Returns an integer that is a STATUS_* flag which details the success/failure of the operation(s).\nMediaParameters is a set of name/value pairs in no particular order. Parameters not specified are unchanged, or if new media is added then set to the default specified. llSetPrimURL - deprecated - true - energy - 10.0 - sleep - 20.0 - return - void arguments URL + tooltip + type string - tooltip - + deprecated + 1 + energy + 10 + return + void + sleep + 20 tooltip Deprecated: Use llSetPrimMediaParams instead. - llSetRegionPos + llSetPrimitiveParams + arguments + + + Parameters + + tooltip + A list of changes. + type + list + + + energy - 0.0 - sleep - 0.0 + 10 return - integer + void + sleep + 0.2000000000000000111022302 + tooltip + This function changes the many properties (or "parameters") of a prim in one operation. Parameters is a list of changes. + + llSetRegionPos + arguments Position - type - vector tooltip Vector. The location to move to, in region coordinates. + type + vector + energy + 10 + return + integer + sleep + 0 tooltip Attempts to move the object so that the root prim is within 0.1m of Position.\nReturns an integer boolean, TRUE if the object is successfully placed within 0.1 m of Position, FALSE otherwise.\nPosition may be any location within the region or up to 10m across a region border.\nIf the position is below ground, it will be set to the ground level at that x,y location. llSetRemoteScriptAccessPin - energy - 10.0 - sleep - 0.2 - return - void arguments PIN + tooltip + type integer - tooltip - + energy + 10 + return + void + sleep + 0.2000000000000000111022302 tooltip If PIN is set to a non-zero number, the task will accept remote script loads via llRemoteLoadScriptPin() if it passes in the correct PIN. Othersise, llRemoteLoadScriptPin() is ignored. - llSetRot + llSetRenderMaterial + arguments + + + Material + + tooltip + + type + string + + + + Face + + tooltip + + type + integer + + + energy - 10.0 - sleep - 0.2 + 10 return void + sleep + 0.2000000000000000111022302 + tooltip + Applies Render Material to Face of prim.\nRender Material may be a UUID or name of a material in prim inventory.\nIf Face is ALL_SIDES, set the render material on all faces. + + llSetRot + arguments Rotation + tooltip + type rotation - tooltip - + energy + 10 + return + void + sleep + 0.2000000000000000111022302 tooltip If the object is not physical, this function sets the rotation of the prim.\nIf the script is in a child prim, Rotation is treated as root relative and the link-set is adjusted.\nIf the prim is the root prim, the entire object is rotated to Rotation in the global reference frame. llSetScale - energy - 10.0 - sleep - 0.0 - return - void arguments Scale + tooltip + type vector - tooltip - + energy + 10 + return + void + sleep + 0 tooltip - Sets the prim's scale (size) to Scale. + Sets the prim's scale (size) to Scale. llSetScriptState - energy - 10.0 - sleep - 0.0 - return - void arguments ScriptName + tooltip + type string - tooltip - Running + tooltip + type integer - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Enable or disable the script Running state of Script in the prim. llSetSitText - energy - 10.0 - sleep - 0.0 - return - void arguments Text + tooltip + type string - tooltip - + energy + 10 + return + void + sleep + 0 tooltip - Displays Text rather than 'Sit' in the viewer's context menu. + Displays Text rather than 'Sit' in the viewer's context menu. llSetSoundQueueing - energy - 10.0 - sleep - 0.0 - return - void arguments QueueEnable - type - integer tooltip Boolean, sound queuing: TRUE enables, FALSE disables (default). + type + integer + energy + 10 + return + void + sleep + 0 tooltip Sets whether successive calls to llPlaySound, llLoopSound, etc., (attached sounds) interrupt the currently playing sound.\nThe default for objects is FALSE. Setting this value to TRUE will make the sound wait until the current playing sound reaches its end. The queue is one level deep. llSetSoundRadius - energy - 10.0 - sleep - 0.0 - return - void arguments Radius - type - float tooltip Maximum distance that sounds can be heard. + type + float + energy + 10 + return + void + sleep + 0 tooltip Limits radius for audibility of scripted sounds (both attached and triggered) to distance Radius. llSetStatus - energy - 10.0 - sleep - 0.0 - return - void arguments Status + tooltip + type integer - tooltip - Value + tooltip + type integer - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Sets object status specified in Status bitmask (e.g. STATUS_PHYSICS|STATUS_PHANTOM) to boolean Value.\nFor a full list of STATUS_* constants, see wiki documentation. llSetText - energy - 10.0 - sleep - 0.0 - return - void arguments Text + tooltip + type string - tooltip - Color + tooltip + type vector - tooltip - Opacity + tooltip + type float - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Causes Text to float above the prim, using the specified Color and Opacity. llSetTexture - energy - 10.0 - sleep - 0.2 - return - void arguments Texture + tooltip + type string - tooltip - Face + tooltip + type integer - tooltip - + energy + 10 + return + void + sleep + 0.2000000000000000111022302 tooltip Applies Texture to Face of prim.\nTexture may be a UUID or name of a texture in prim inventory.\nIf Face is ALL_SIDES, set the texture on all faces. llSetTextureAnim - energy - 10.0 - sleep - 0.0 - return - void arguments Mode - type - integer tooltip Mask of Mode flags. + type + integer Face - type - integer tooltip Face number or ALL_SIDES. + type + integer SizeX - type - integer tooltip Horizontal frames (ignored for ROTATE and SCALE). + type + integer SizeY - type - integer tooltip Vertical frames (ignored for ROTATE and SCALE). + type + integer Start - type - float tooltip Start position/frame number (or radians for ROTATE). + type + float Length - type - float tooltip number of frames to display (or radians for ROTATE). + type + float Rate - type - float tooltip Frames per second (must not greater than zero). + type + float + energy + 10 + return + void + sleep + 0 tooltip Animates a texture by setting the texture scale and offset.\nMode is a bitmask of animation options.\nFace specifies which object face to animate.\nSizeX and SizeY specify the number of horizontal and vertical frames.Start specifes the animation start point.\nLength specifies the animation duration.\nRate specifies the animation playback rate. llSetTimerEvent - energy - 10.0 - sleep - 0.0 - return - void arguments Rate + tooltip + type float - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Causes the timer event to be triggered every Rate seconds.\n Passing in 0.0 stops further timer events. llSetTorque - energy - 10.0 - sleep - 0.0 - return - void arguments Torque - type - vector tooltip Torque force. + type + vector Local - type - integer tooltip Boolean, if TRUE uses local axis, if FALSE uses region axis. + type + integer + energy + 10 + return + void + sleep + 0 tooltip - Sets the Torque acting on the script's object, in object-local coordinates if Local == TRUE (otherwise, the region reference frame is used).\nOnly works on physical objects. + Sets the Torque acting on the script's object, in object-local coordinates if Local == TRUE (otherwise, the region reference frame is used).\nOnly works on physical objects. llSetTouchText - energy - 10.0 - sleep - 0.0 - return - void arguments Text + tooltip + type string - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Displays Text in the viewer context menu that acts on a touch. llSetVehicleFlags - energy - 10.0 - sleep - 0.0 - return - void arguments Flags + tooltip + type integer - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Enables the vehicle flags specified in the Flags bitmask.\nValid parameters can be found in the wiki documentation. llSetVehicleFloatParam - energy - 10.0 - sleep - 0.0 - return - void arguments ParameterName + tooltip + type integer - tooltip - ParameterValue + tooltip + type float - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Sets a vehicle float parameter.\nValid parameters can be found in the wiki documentation. llSetVehicleRotationParam - energy - 10.0 - sleep - 0.0 - return - void arguments ParameterName + tooltip + type integer - tooltip - ParameterValue + tooltip + type rotation - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Sets a vehicle rotation parameter.\nValid parameters can be found in the wiki documentation. llSetVehicleType - energy - 10.0 - sleep - 0.0 - return - void arguments Type + tooltip + type integer - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Activates the vehicle action on the object with vehicle preset Type.\nValid Types and an explanation of their characteristics can be found in wiki documentation. llSetVehicleVectorParam - energy - 10.0 - sleep - 0.0 - return - void arguments ParameterName + tooltip + type integer - tooltip - ParameterValue + tooltip + type vector - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Sets a vehicle vector parameter.\nValid parameters can be found in the wiki documentation. llSetVelocity - energy - - sleep - 0.0 - return - void arguments Velocity - type - vector tooltip The velocity to apply. + type + vector Local - type - integer tooltip If TRUE, the Velocity is treated as a local directional vector instead of a regional directional vector. + type + integer + energy + 10 + return + void + sleep + 0 tooltip - If the object is physics-enabled, sets the object's linear velocity to Velocity.\nIf Local==TRUE, Velocity is treated as a local directional vector; otherwise, Velocity is treated as a global directional vector. + If the object is physics-enabled, sets the object's linear velocity to Velocity.\nIf Local==TRUE, Velocity is treated as a local directional vector; otherwise, Velocity is treated as a global directional vector. - llSHA1String + llShout - energy - 10.0 - sleep - 0.0 - return - string arguments + + Channel + + tooltip + + type + integer + + Text + tooltip + type string - tooltip - - tooltip - Returns a string of 40 hex characters that is the SHA1 security Hash of Text. - - llShout - energy - 10.0 - sleep - 0.0 + 10 return void + sleep + 0 + tooltip + Shouts Text on Channel.\nThis chat method has a range of 100m radius.\nPUBLIC_CHANNEL is the public chat channel that all avatars see as chat text. DEBUG_CHANNEL is the script debug channel, and is also visible to nearby avatars. All other channels are are not sent to avatars, but may be used to communicate with scripts. + + llSignRSA + arguments - Channel + PrivateKey - type - integer tooltip - + The PEM-formatted private key + type + string - Text + Message + tooltip + The message contents to sign type string + + + + Algorithm + tooltip - + The digest algorithnm to use: sha1, sha224, sha256, sha384, sha512 + type + string + energy + 10 + return + string + sleep + 0 tooltip - Shouts Text on Channel.\nThis chat method has a range of 100m radius.\nPUBLIC_CHANNEL is the public chat channel that all avatars see as chat text. DEBUG_CHANNEL is the script debug channel, and is also visible to nearby avatars. All other channels are are not sent to avatars, but may be used to communicate with scripts. + Returns the base64-encoded RSA signature of Message using PEM-formatted PrivateKey and digest Algorithm (sha1, sha224, sha256, sha384, sha512). llSin - energy - 10.0 - sleep - 0.0 - return - float arguments Theta + tooltip + type float - tooltip - + energy + 10 + return + float + sleep + 0 tooltip Returns the sine of Theta (Theta in radians). - llSitTarget + llSitOnLink + arguments + + + AvatarID + + tooltip + + type + key + + + + LinkID + + tooltip + + type + integer + + + energy - 10.0 - sleep - 0.0 + 10 return - void + integer + sleep + 0 + tooltip + If agent identified by AvatarID is participating in the experience, sit them on the specified link's sit target. + + llSitTarget + arguments Offset + tooltip + type vector - tooltip - Rotation + tooltip + type rotation - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Set the sit location for this object. If offset == ZERO_VECTOR, clears the sit target. llSleep - energy - 0 - sleep - 0.0 - return - void arguments Time + tooltip + type float - tooltip - + energy + 0 + return + void + sleep + 0 tooltip Put script to sleep for Time seconds. llSound - deprecated - true - energy - 10.0 - sleep - 0.0 - return - void arguments Sound + tooltip + type string - tooltip - Volume + tooltip + type float - tooltip - Queue + tooltip + type integer - tooltip - Loop + tooltip + type integer - tooltip - + deprecated + 1 + energy + 10 + return + void + sleep + 0 tooltip Deprecated: Use llPlaySound instead.\nPlays Sound at Volume and specifies whether the sound should loop and/or be enqueued. llSoundPreload - deprecated - true - energy - 10.0 - sleep - 0.0 - return - void arguments Sound + tooltip + type string - tooltip - + deprecated + 1 + energy + 10 + return + void + sleep + 0 tooltip Deprecated: Use llPreloadSound instead.\nPreloads a sound on viewers within range. llSqrt - energy - 10.0 - sleep - 0.0 - return - float arguments Value + tooltip + type float - tooltip - + energy + 10 + return + float + sleep + 0 tooltip Returns the square root of Value.\nTriggers a math runtime error for imaginary results (if Value < 0.0). llStartAnimation + arguments + + + Animation + + tooltip + + type + string + + + energy - 10.0 - sleep - 0.0 + 10 return void + sleep + 0 + tooltip + This function plays the specified animation from playing on the avatar who received the script's most recent permissions request.\nAnimation may be an animation in task inventory or a built-in animation.\nRequires PERMISSION_TRIGGER_ANIMATION. + + llStartObjectAnimation + arguments Animation + tooltip + type string - tooltip - + energy + 10 + return + void + sleep + 0 tooltip - This function plays the specified animation from playing on the avatar who received the script's most recent permissions request.\nAnimation may be an animation in task inventory or a built-in animation.\nRequires PERMISSION_TRIGGER_ANIMATION. + This function plays the specified animation on the rigged mesh object associated with the current script.\nAnimation may be an animation in task inventory or a built-in animation.\n llStopAnimation - energy - 10.0 - sleep - 0.0 - return - void arguments Animation + tooltip + type string - tooltip - + energy + 10 + return + void + sleep + 0 tooltip - This function stops the specified animation on the avatar who received the script's most recent permissions request.\nAnimation may be an animation in task inventory, a built-in animation, or the uuid of an animation.\nRequires PERMISSION_TRIGGER_ANIMATION. + This function stops the specified animation on the avatar who received the script's most recent permissions request.\nAnimation may be an animation in task inventory, a built-in animation, or the uuid of an animation.\nRequires PERMISSION_TRIGGER_ANIMATION. llStopHover + arguments + energy - 10.0 - sleep - 0.0 + 10 return void - arguments - + sleep + 0 tooltip Stop hovering to a height (due to llSetHoverHeight()). llStopLookAt + arguments + energy - 10.0 - sleep - 0.0 + 10 return void - arguments - + sleep + 0 tooltip Stop causing object to point at a target (due to llLookAt() or llRotLookAt()). llStopMoveToTarget + arguments + energy - 10.0 - sleep - 0.0 + 10 return void - arguments - + sleep + 0 tooltip Stops critically damped motion (due to llMoveToTarget()). - llStopSound + llStopObjectAnimation + arguments + + + Animation + + tooltip + + type + string + + + energy - 10.0 - sleep - 0.0 + 10 return void + sleep + 0 + tooltip + This function stops the specified animation on the rigged mesh object associated with the current script.\nAnimation may be an animation in task inventory, a built-in animation, or the uuid of an animation.\n + + llStopSound + arguments - + + energy + 10 + return + void + sleep + 0 tooltip Stops playback of the currently attached sound. llStringLength - energy - 10.0 - sleep - 0.0 - return - integer arguments Text + tooltip + type string - tooltip - + energy + 10 + return + integer + sleep + 0 tooltip Returns an integer that is the number of characters in Text (not counting the null). llStringToBase64 - energy - 10.0 - sleep - 0.0 - return - string arguments Text + tooltip + type string - tooltip - + energy + 10 + return + string + sleep + 0 tooltip Returns the string Base64 representation of the input string. llStringTrim - energy - 10.0 - sleep - 0.0 - return - string arguments Text - type - string tooltip String to trim + type + string TrimType - type - integer tooltip STRING_TRIM_HEAD, STRING_TRIM_TAIL, or STRING_TRIM. + type + integer + energy + 10 + return + string + sleep + 0 tooltip Outputs a string, eliminating white-space from the start and/or end of the input string Text.\nValid options for TrimType:\nSTRING_TRIM_HEAD: trim all leading spaces in Text\nSTRING_TRIM_TAIL: trim all trailing spaces in Text\nSTRING_TRIM: trim all leading and trailing spaces in Text. llSubStringIndex - energy - 10.0 - sleep - 0.0 - return - integer arguments Text + tooltip + type string - tooltip - Sequence + tooltip + type string - tooltip - + energy + 10 + return + integer + sleep + 0 tooltip Returns an integer that is the index in Text where string pattern Sequence first appears. Returns -1 if not found. llTakeCamera - deprecated - true - energy - 10.0 - sleep - 0.0 - return - void arguments AvatarID + tooltip + type key - tooltip - + deprecated + 1 + energy + 10 + return + void + sleep + 0 tooltip Deprecated: Use llSetCameraParams instead. llTakeControls - energy - 10.0 - sleep - 0.0 - return - void arguments Controls - type - integer tooltip Bit-field of CONTROL_* flags. + type + integer Accept - type - integer tooltip Boolean, determines whether control events are generated. + type + integer PassOn - type - integer tooltip Boolean, determines whether controls are disabled. + type + integer + energy + 10 + return + void + sleep + 0 tooltip Take controls from the agent the script has permissions for.\nIf (Accept == (Controls & input)), send input to the script. PassOn determines whether Controls also perform their normal functions.\nRequires the PERMISSION_TAKE_CONTROLS permission to run. llTan - energy - 10.0 - sleep - 0.0 - return - float arguments Theta + tooltip + type float - tooltip - + energy + 10 + return + float + sleep + 0 tooltip Returns the tangent of Theta (Theta in radians). llTarget - energy - 10.0 - sleep - 0.0 - return - integer arguments Position + tooltip + type vector - tooltip - Range + tooltip + type float - tooltip - + energy + 10 + return + integer + sleep + 0 tooltip This function is to have the script know when it has reached a position.\nIt registers a Position with a Range that triggers at_target and not_at_target events continuously until unregistered. llTargetOmega - energy - 10.0 - sleep - 0.0 - return - void arguments Axis + tooltip + type vector - tooltip - SpinRate + tooltip + type float - tooltip - Gain + tooltip + type float - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Attempt to spin at SpinRate with strength Gain on Axis.\nA spin rate of 0.0 cancels the spin. This function always works in object-local coordinates. llTargetRemove + arguments + + + Target + + tooltip + + type + integer + + + energy - 10.0 - sleep - 0.0 + 10 return void + sleep + 0 + tooltip + Removes positional target Handle registered with llTarget. + + llTargetedEmail + arguments Target + tooltip + + type + integer + + + + Subject + + tooltip + type - integer + string + + + + Text + tooltip - + + type + string + energy + 10 + return + void + sleep + 20 tooltip - Removes positional target Handle registered with llTarget. + Sends an email with Subject and Message to the owner or creator of an object . llTeleportAgent - energy - 0 - sleep - 0 - return - void arguments AvatarID - type - key tooltip UUID of avatar. + type + key LandmarkName - type - string tooltip Name of landmark (in object contents), or empty string, to use. + type + string Position - type - vector tooltip If no landmark was provided, the position within the current region to teleport the avatar to. + type + vector LookAtPoint - type - vector tooltip The position within the target region that the avatar should be turned to face upon arrival. + type + vector + energy + 10 + return + void + sleep + 0 tooltip - Requests a teleport of avatar to a landmark stored in the object's inventory. If no landmark is provided (an empty string), the avatar is teleported to the location position in the current region. In either case, the avatar is turned to face the position given by look_at in local coordinates.\nRequires the PERMISSION_TELEPORT permission. This function can only teleport the owner of the object. + Requests a teleport of avatar to a landmark stored in the object's inventory. If no landmark is provided (an empty string), the avatar is teleported to the location position in the current region. In either case, the avatar is turned to face the position given by look_at in local coordinates.\nRequires the PERMISSION_TELEPORT permission. This function can only teleport the owner of the object. llTeleportAgentGlobalCoords - energy - 0 - sleep - 0 - return - void arguments AvatarID - type - key tooltip UUID of avatar. + type + key GlobalPosition - type - vector tooltip Global coordinates of the destination region. Can be retrieved by using llRequestSimulatorData(region_name, DATA_SIM_POS). + type + vector RegionPosition - type - vector tooltip The position within the target region to teleport the avatar to, if no landmark was provided. + type + vector LookAtPoint - type - vector tooltip The position within the target region that the avatar should be turned to face upon arrival. + type + vector + energy + 10 + return + void + sleep + 0 tooltip Teleports an agent to the RegionPosition local coordinates within a region which is specified by the GlobalPosition global coordinates. The agent lands facing the position defined by LookAtPoint local coordinates.\nRequires the PERMISSION_TELEPORT permission. This function can only teleport the owner of the object. llTeleportAgentHome - energy - 100.0 - sleep - 5.0 - return - void arguments AvatarID + tooltip + type key - tooltip - + energy + 100 + return + void + sleep + 5 tooltip - Teleport agent over the owner's land to agent's home location. + Teleport agent over the owner's land to agent's home location. llTextBox - energy - 10.0 - sleep - 1.0 - return - void arguments AvatarID + tooltip + type key - tooltip - Text + tooltip + type string - tooltip - Channel + tooltip + type integer - tooltip - + energy + 10 + return + void + sleep + 1 tooltip - Opens a dialog for the specified avatar with message Text, which contains a text box for input. Any text that is entered is said on the specified Channel (as if by the avatar) when the "OK" button is clicked. + Opens a dialog for the specified avatar with message Text, which contains a text box for input. Any text that is entered is said on the specified Channel (as if by the avatar) when the "OK" button is clicked. llToLower - energy - 10.0 - sleep - 0.0 - return - string arguments Text + tooltip + type string - tooltip - + energy + 10 + return + string + sleep + 0 tooltip Returns a string that is Text with all lower-case characters. llToUpper - energy - 10.0 - sleep - 0.0 - return - string arguments Text + tooltip + type string - tooltip - + energy + 10 + return + string + sleep + 0 tooltip Returns a string that is Text with all upper-case characters. llTransferLindenDollars - energy - 10.0 - sleep - 0.0 - return - key arguments AvatarID + tooltip + type key - tooltip - Amount + tooltip + type integer - tooltip - + energy + 10 + return + key + sleep + 0 tooltip Transfer Amount of linden dollars (L$) from script owner to AvatarID. Returns a key to a corresponding transaction_result event for the success of the transfer.\nAttempts to send the amount of money to the specified avatar, and trigger a transaction_result event identified by the returned key. - llTriggerSound + llTransferOwnership + arguments + + + AgentID + + tooltip + An agent in the region. + type + key + + + + Flags + + tooltip + Flags to control type of inventory transfer. + type + integer + + + + Params + + tooltip + Extra parameters to llTransferOwnership. None are defined at this time. + type + list + + + energy - 10.0 - sleep - 0.0 + 10 return - void + integer + sleep + 0 + tooltip + Transfers ownership of an object, or a copy of the object to a new agent. + + llTriggerSound + arguments Sound + tooltip + type string - tooltip - Volume + tooltip + type float - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Plays Sound at Volume (0.0 - 1.0), centered at but not attached to object.\nThere is no limit to the number of triggered sounds which can be generated by an object, and calling llTriggerSound does not affect the attached sounds created by llPlaySound and llLoopSound. This is very useful for things like collision noises, explosions, etc. There is no way to stop or alter the volume of a sound triggered by this function. llTriggerSoundLimited - energy - 10.0 - sleep - 0.0 - return - void arguments Sound + tooltip + type string - tooltip - Volume + tooltip + type float - tooltip - TNE + tooltip + type vector - tooltip - BSW + tooltip + type vector - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Plays Sound at Volume (0.0 - 1.0), centered at but not attached to object, limited to axis-aligned bounding box defined by vectors top-north-east (TNE) and bottom-south-west (BSW).\nThere is no limit to the number of triggered sounds which can be generated by an object, and calling llTriggerSound does not affect the attached sounds created by llPlaySound and llLoopSound. This is very useful for things like collision noises, explosions, etc. There is no way to stop or alter the volume of a sound triggered by this function. - llUnescapeURL + llUnSit - energy - 10.0 - sleep - 0.0 - return - string arguments - URL + AvatarID - type - string tooltip - + + type + key - tooltip - Returns the string that is the URL unescaped, replacing "%20" with spaces, etc., version of URL.\nThis function can output raw UTF-8 strings. - - llUnSit - energy - 10.0 - sleep - 0.0 + 10 return void + sleep + 0 + tooltip + If agent identified by AvatarID is sitting on the object the script is attached to or is over land owned by the objects owner, the agent is forced to stand up. + + llUnescapeURL + arguments - AvatarID + URL - type - key tooltip - + + type + string + energy + 10 + return + string + sleep + 0 tooltip - If agent identified by AvatarID is sitting on the object the script is attached to or is over land owned by the objects owner, the agent is forced to stand up. + Returns the string that is the URL unescaped, replacing "%20" with spaces, etc., version of URL.\nThis function can output raw UTF-8 strings. llUpdateCharacter + arguments + + + Options + + tooltip + Character configuration options. Takes the same constants as llCreateCharacter(). + type + list + + + energy - 10.0 - sleep - 0.0 + 10 return void + sleep + 0 + tooltip + Updates settings for a pathfinding character. + + llUpdateKeyValue + arguments - Options + Key + + tooltip + + type + string + + + + Value + + tooltip + + type + string + + + + Checked + tooltip + type - list + integer + + + + OriginalValue + tooltip - Character configuration options. Takes the same constants as llCreateCharacter(). + + type + string - tooltip - Updates settings for a pathfinding character. - - llUpdateKeyValue - energy - 10.0 - sleep - 0.0 + 10 return key - arguments - - - Key - - type - string - tooltip - - - - - Value - - type - string - tooltip - - - - - Checked - - type - integer - tooltip - - - - - OriginalValue - - type - string - tooltip - - - - + sleep + 0 tooltip Starts an asychronous transaction to update the value associated with the key given. The dataserver callback will be executed with the key returned from this call and a string describing the result. The result is a two element commma-delimited list. The first item is an integer specifying if the transaction succeeded (1) or not (0). In the failure case, the second item will be an integer corresponding to one of the XP_ERROR_... constants. In the success case the second item will be the value associated with the key. If Checked is 1 the existing value in the data store must match the OriginalValue passed or XP_ERROR_RETRY_UPDATE will be returned. If Checked is 0 the key will be created if necessary. @@ -18810,349 +23974,419 @@ llVecDist - energy - 10.0 - sleep - 0.0 - return - float arguments Location1 + tooltip + type vector - tooltip - Location2 + tooltip + type vector - tooltip - + energy + 10 + return + float + sleep + 0 tooltip Returns the distance between Location1 and Location2. llVecMag - energy - 10.0 - sleep - 0.0 - return - float arguments Vector + tooltip + type vector - tooltip - + energy + 10 + return + float + sleep + 0 tooltip Returns the magnitude of the vector. llVecNorm - energy - 10.0 - sleep - 0.0 - return - vector arguments Vector + tooltip + type vector - tooltip - + energy + 10 + return + vector + sleep + 0 tooltip Returns normalized vector. - llVolumeDetect + llVerifyRSA + arguments + + + PublicKey + + tooltip + The PEM-formatted public key for signature verifiation. + type + string + + + + Message + + tooltip + The message that was signed. + type + string + + + + Signature + + tooltip + The base64-formatted signature of the message. + type + string + + + + Algorithm + + tooltip + The digest algorithm: sha1, sha224, sha256, sha384, sha512. + type + string + + + energy - 10.0 - sleep - 0.0 + 10 return - void + integer + sleep + 0 + tooltip + Returns TRUE if PublicKey, Message, and Algorithm produce the same base64-formatted Signature. + + llVolumeDetect + arguments DetectEnabled - type - integer tooltip TRUE enables, FALSE disables. + type + integer + energy + 10 + return + void + sleep + 0 tooltip If DetectEnabled = TRUE, object becomes phantom but triggers collision_start and collision_end events when other objects start and stop interpenetrating.\nIf another object (including avatars) interpenetrates it, it will get a collision_start event.\nWhen an object stops interpenetrating, a collision_end event is generated. While the other is inter-penetrating, collision events are NOT generated. llWanderWithin - energy - 10.0 - sleep - 0.0 - return - void arguments Origin - type - vector tooltip Central point to wander about. + type + vector Area - type - vector tooltip Half-extents of an area the character may wander within. (i.e., it can wander from the specified origin by up to +/-Distance.x in x, +/-Distance.y in y, etc.) + type + vector Options - type - list tooltip No options available at this time. + type + list + energy + 10 + return + void + sleep + 0 tooltip Wander within a specified volume.\nSets a character to wander about a central spot within a specified area. llWater - energy - 10.0 - sleep - 0.0 - return - float arguments Offset + tooltip + type vector - tooltip - + energy + 10 + return + float + sleep + 0 tooltip Returns the water height below the object position + Offset. llWhisper - energy - 10.0 - sleep - 0.0 - return - void arguments Channel + tooltip + type integer - tooltip - Text + tooltip + type string - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Whispers Text on Channel.\nThis chat method has a range of 10m radius.\nPUBLIC_CHANNEL is the public chat channel that all avatars see as chat text. DEBUG_CHANNEL is the script debug channel, and is also visible to nearby avatars. All other channels are are not sent to avatars, but may be used to communicate with scripts. llWind - energy - 10.0 - sleep - 0.0 - return - vector arguments Offset + tooltip + type vector - tooltip - + energy + 10 + return + vector + sleep + 0 tooltip Returns the wind velocity at the object position + Offset. - llXorBase64 + llWorldPosToHUD + arguments + + + world_pos + + tooltip + The world-frame position to project into HUD space + type + vector + + + energy - 10.0 - sleep - 0.0 + 10 return - string + vector + sleep + 0 + tooltip + Returns the local position that would put the origin of a HUD object directly over world_pos as viewed by the current camera. + + llXorBase64 + arguments Text1 + tooltip + type string - tooltip - Text2 + tooltip + type string - tooltip - + energy + 10 + return + string + sleep + 0 tooltip Performs an exclusive OR on two Base64 strings and returns a Base64 string. Text2 repeats if it is shorter than Text1. llXorBase64Strings - deprecated - true - energy - 10.0 - sleep - 0.3 - return - string arguments Text1 + tooltip + type string - tooltip - Text2 + tooltip + type string - tooltip - + deprecated + 1 + energy + 10 + return + string + sleep + 0.2999999999999999888977698 tooltip Deprecated: Please use llXorBase64 instead.\nIncorrectly performs an exclusive OR on two Base64 strings and returns a Base64 string. Text2 repeats if it is shorter than Text1.\nRetained for backwards compatibility. llXorBase64StringsCorrect - deprecated - true - energy - 10.0 - sleep - 0.0 - return - string arguments Text1 + tooltip + type string - tooltip - Text2 + tooltip + type string - tooltip - - tooltip - Deprecated: Please use llXorBase64 instead.\nCorrectly (unless nulls are present) performs an exclusive OR on two Base64 strings and returns a Base64 string.\nText2 repeats if it is shorter than Text1. - - llGetMinScaleFactor - + deprecated + 1 energy - 10.0 - sleep - 0.0 + 10 return - float - arguments - + string + sleep + 0 tooltip - Returns the smallest multiplicative uniform scale factor that can be successfully applied (via llScaleByFactor()) to the object without violating prim size or linkability rules. + Deprecated: Please use llXorBase64 instead.\nCorrectly (unless nulls are present) performs an exclusive OR on two Base64 strings and returns a Base64 string.\nText2 repeats if it is shorter than Text1. - llGetMaxScaleFactor + llsRGB2Linear + arguments + + + srgb + + tooltip + A color in the sRGB colorspace. + type + vector + + + energy - 10.0 - sleep - 0.0 + 10 return - float - arguments - + vector + sleep + 0 tooltip - Returns the largest multiplicative uniform scale factor that can be successfully applied (via llScaleByFactor()) to the object without violating prim size or linkability rules. + Converts a color from the sRGB to the linear colorspace. llsd-lsl-syntax-version diff --git a/indra/newview/app_settings/keywords_lua_default.xml b/indra/newview/app_settings/keywords_lua_default.xml new file mode 100644 index 00000000000..97e5a1d3558 --- /dev/null +++ b/indra/newview/app_settings/keywords_lua_default.xml @@ -0,0 +1,29294 @@ + + + + controls + + do + + tooltip + Lua do block: do ... end + + if + + tooltip + Lua if statement: if condition then ... end + + then + + tooltip + Lua then keyword: introduces the block executed when an if condition is true. + + else + + tooltip + Lua else keyword: specifies the alternative block in an if/else statement. + + elseif + + tooltip + Lua elseif keyword: provides an additional conditional branch in an if statement. + + end + + tooltip + Lua end keyword: closes control structures like if, do, while, for, and function. + + for + + tooltip + Lua for loop: for var = start, end, step do ... end + + goto + + tooltip + Lua goto statement: jumps to a specified label. + + return + + tooltip + Lua return statement: returns a value from a function. + + while + + tooltip + Lua while loop: while condition do ... end + + repeat + + tooltip + Lua repeat loop: repeat ... until condition + + until + + tooltip + Lua until keyword: ends a repeat loop by testing a condition. + + function + + tooltip + Lua function keyword: begins a function definition. + + break + + tooltip + Lua break statement: exits the nearest loop. + + local + + tooltip + Lua local keyword: declares a local variable or function. + + in + + tooltip + Lua in keyword: used in generic for loops to iterate over elements. + + not + + tooltip + Lua not operator: performs logical negation. + + and + + tooltip + Lua and operator: performs logical conjunction. + + or + + tooltip + Lua or operator: performs logical disjunction. + + + types + + boolean + + tooltip + Boolean: represents a true or false value. + + number + + tooltip + Double‑precision floating point number. + + string + + tooltip + Text data (UTF‑8). + + table + + tooltip + Collection of key‑value pairs. + + thread + + tooltip + Represents a coroutine. + + userdata + + tooltip + Opaque external data. + + vector + + tooltip + A vector is a data type that contains a set of three float values.\nVectors are used to represent colors (RGB), positions, and directions/velocities. + + uuid + + tooltip + A 128‑bit unique identifier formatted as 36 hexadecimal characters (8‑4‑4‑4‑12), e.g. "A822FF2B-FF02-461D-B45D-DCD10A2DE0C2". + + + constants + + + nil + + tooltip + Lua nil: represents the absence of a useful value. + + true + + tooltip + Lua true: Boolean true value. + + false + + tooltip + Lua false: Boolean false value. + + + ACTIVE + + tooltip + Objects in world that are running a script or currently physically moving. + type + integer + value + 0x2 + + AGENT + + tooltip + Objects in world that are agents. + type + integer + value + 0x1 + + AGENT_ALWAYS_RUN + + tooltip + + type + integer + value + 0x1000 + + AGENT_ATTACHMENTS + + tooltip + The agent has attachments. + type + integer + value + 0x2 + + AGENT_AUTOMATED + + tooltip + The agent has been identified as a scripted agent + type + integer + value + 0x4000 + + AGENT_AUTOPILOT + + tooltip + + type + integer + value + 0x2000 + + AGENT_AWAY + + tooltip + + type + integer + value + 0x40 + + AGENT_BUSY + + tooltip + + type + integer + value + 0x800 + + AGENT_BY_LEGACY_NAME + + tooltip + + type + integer + value + 0x1 + + AGENT_BY_USERNAME + + tooltip + + type + integer + value + 0x10 + + AGENT_CROUCHING + + tooltip + + type + integer + value + 0x400 + + AGENT_FLOATING_VIA_SCRIPTED_ATTACHMENT + + tooltip + The agent is floating via scripted attachment. + type + integer + value + 0x8000 + + AGENT_FLYING + + tooltip + The agent is flying. + type + integer + value + 0x1 + + AGENT_IN_AIR + + tooltip + + type + integer + value + 0x100 + + AGENT_LIST_PARCEL + + tooltip + Agents on the same parcel where the script is running. + type + integer + value + 1 + + AGENT_LIST_PARCEL_OWNER + + tooltip + Agents on any parcel in the region where the parcel owner is the same as the owner of the parcel under the scripted object. + type + integer + value + 2 + + AGENT_LIST_REGION + + tooltip + All agents in the region. + type + integer + value + 4 + + AGENT_MOUSELOOK + + tooltip + + type + integer + value + 0x8 + + AGENT_ON_OBJECT + + tooltip + + type + integer + value + 0x20 + + AGENT_SCRIPTED + + tooltip + The agent has scripted attachments. + type + integer + value + 0x4 + + AGENT_SITTING + + tooltip + + type + integer + value + 0x10 + + AGENT_TYPING + + tooltip + + type + integer + value + 0x200 + + AGENT_WALKING + + tooltip + + type + integer + value + 0x80 + + ALL_SIDES + + tooltip + + type + integer + value + -1 + + ANIM_ON + + tooltip + Texture animation is on. + type + integer + value + 0x1 + + ATTACH_ANY_HUD + + tooltip + Filtering for any HUD attachment. + type + integer + value + -1 + + ATTACH_AVATAR_CENTER + + tooltip + Attach to the avatar's geometric centre. + type + integer + value + 40 + + ATTACH_BACK + + tooltip + Attach to the avatar's back. + type + integer + value + 9 + + ATTACH_BELLY + + tooltip + Attach to the avatar's belly. + type + integer + value + 28 + + ATTACH_CHEST + + tooltip + Attach to the avatar's chest. + type + integer + value + 1 + + ATTACH_CHIN + + tooltip + Attach to the avatar's chin. + type + integer + value + 12 + + ATTACH_FACE_JAW + + tooltip + Attach to the avatar's jaw. + type + integer + value + 47 + + ATTACH_FACE_LEAR + + tooltip + Attach to the avatar's left ear (extended). + type + integer + value + 48 + + ATTACH_FACE_LEYE + + tooltip + Attach to the avatar's left eye (extended). + type + integer + value + 50 + + ATTACH_FACE_REAR + + tooltip + Attach to the avatar's right ear (extended). + type + integer + value + 49 + + ATTACH_FACE_REYE + + tooltip + Attach to the avatar's right eye (extended). + type + integer + value + 51 + + ATTACH_FACE_TONGUE + + tooltip + Attach to the avatar's tongue. + type + integer + value + 52 + + ATTACH_GROIN + + tooltip + Attach to the avatar's groin. + type + integer + value + 53 + + ATTACH_HEAD + + tooltip + Attach to the avatar's head. + type + integer + value + 2 + + ATTACH_HIND_LFOOT + + tooltip + Attach to the avatar's left hind foot. + type + integer + value + 54 + + ATTACH_HIND_RFOOT + + tooltip + Attach to the avatar's right hind foot. + type + integer + value + 55 + + ATTACH_HUD_BOTTOM + + tooltip + + type + integer + value + 37 + + ATTACH_HUD_BOTTOM_LEFT + + tooltip + + type + integer + value + 36 + + ATTACH_HUD_BOTTOM_RIGHT + + tooltip + + type + integer + value + 38 + + ATTACH_HUD_CENTER_1 + + tooltip + + type + integer + value + 35 + + ATTACH_HUD_CENTER_2 + + tooltip + + type + integer + value + 31 + + ATTACH_HUD_TOP_CENTER + + tooltip + + type + integer + value + 33 + + ATTACH_HUD_TOP_LEFT + + tooltip + + type + integer + value + 34 + + ATTACH_HUD_TOP_RIGHT + + tooltip + + type + integer + value + 32 + + ATTACH_LEAR + + tooltip + Attach to the avatar's left ear. + type + integer + value + 13 + + ATTACH_LEFT_PEC + + tooltip + Attach to the avatar's left pectoral. + type + integer + value + 29 + + ATTACH_LEYE + + tooltip + Attach to the avatar's left eye. + type + integer + value + 15 + + ATTACH_LFOOT + + tooltip + Attach to the avatar's left foot. + type + integer + value + 7 + + ATTACH_LHAND + + tooltip + Attach to the avatar's left hand. + type + integer + value + 5 + + ATTACH_LHAND_RING1 + + tooltip + Attach to the avatar's left ring finger. + type + integer + value + 41 + + ATTACH_LHIP + + tooltip + Attach to the avatar's left hip. + type + integer + value + 25 + + ATTACH_LLARM + + tooltip + Attach to the avatar's left lower arm. + type + integer + value + 21 + + ATTACH_LLLEG + + tooltip + Attach to the avatar's lower left leg. + type + integer + value + 27 + + ATTACH_LPEC + + deprecated + 1 + tooltip + Attach to the avatar's right pectoral. (Deprecated, use ATTACH_RIGHT_PEC) + type + integer + value + 30 + + ATTACH_LSHOULDER + + tooltip + Attach to the avatar's left shoulder. + type + integer + value + 3 + + ATTACH_LUARM + + tooltip + Attach to the avatar's left upper arm. + type + integer + value + 20 + + ATTACH_LULEG + + tooltip + Attach to the avatar's lower upper leg. + type + integer + value + 26 + + ATTACH_LWING + + tooltip + Attach to the avatar's left wing. + type + integer + value + 45 + + ATTACH_MOUTH + + tooltip + Attach to the avatar's mouth. + type + integer + value + 11 + + ATTACH_NECK + + tooltip + Attach to the avatar's neck. + type + integer + value + 39 + + ATTACH_NOSE + + tooltip + Attach to the avatar's nose. + type + integer + value + 17 + + ATTACH_PELVIS + + tooltip + Attach to the avatar's pelvis. + type + integer + value + 10 + + ATTACH_REAR + + tooltip + Attach to the avatar's right ear. + type + integer + value + 14 + + ATTACH_REYE + + tooltip + Attach to the avatar's right eye. + type + integer + value + 16 + + ATTACH_RFOOT + + tooltip + Attach to the avatar's right foot. + type + integer + value + 8 + + ATTACH_RHAND + + tooltip + Attach to the avatar's right hand. + type + integer + value + 6 + + ATTACH_RHAND_RING1 + + tooltip + Attach to the avatar's right ring finger. + type + integer + value + 42 + + ATTACH_RHIP + + tooltip + Attach to the avatar's right hip. + type + integer + value + 22 + + ATTACH_RIGHT_PEC + + tooltip + Attach to the avatar's right pectoral. + type + integer + value + 30 + + ATTACH_RLARM + + tooltip + Attach to the avatar's right lower arm. + type + integer + value + 19 + + ATTACH_RLLEG + + tooltip + Attach to the avatar's right lower leg. + type + integer + value + 24 + + ATTACH_RPEC + + deprecated + 1 + tooltip + Attach to the avatar's left pectoral. (deprecated, use ATTACH_LEFT_PEC) + type + integer + value + 29 + + ATTACH_RSHOULDER + + tooltip + Attach to the avatar's right shoulder. + type + integer + value + 4 + + ATTACH_RUARM + + tooltip + Attach to the avatar's right upper arm. + type + integer + value + 18 + + ATTACH_RULEG + + tooltip + Attach to the avatar's right upper leg. + type + integer + value + 23 + + ATTACH_RWING + + tooltip + Attach to the avatar's right wing. + type + integer + value + 46 + + ATTACH_TAIL_BASE + + tooltip + Attach to the avatar's tail base. + type + integer + value + 43 + + ATTACH_TAIL_TIP + + tooltip + Attach to the avatar's tail tip. + type + integer + value + 44 + + AVOID_CHARACTERS + + tooltip + + type + integer + value + 1 + + AVOID_DYNAMIC_OBSTACLES + + tooltip + + type + integer + value + 2 + + AVOID_NONE + + tooltip + + type + integer + value + 0 + + BEACON_MAP + + tooltip + Cause llMapBeacon to optionally display and focus the world map on the avatar's viewer. + type + integer + value + 1 + + CAMERA_ACTIVE + + tooltip + + type + integer + value + 12 + + CAMERA_BEHINDNESS_ANGLE + + tooltip + + type + integer + value + 8 + + CAMERA_BEHINDNESS_LAG + + tooltip + + type + integer + value + 9 + + CAMERA_DISTANCE + + tooltip + + type + integer + value + 7 + + CAMERA_FOCUS + + tooltip + + type + integer + value + 17 + + CAMERA_FOCUS_LAG + + tooltip + + type + integer + value + 6 + + CAMERA_FOCUS_LOCKED + + tooltip + + type + integer + value + 22 + + CAMERA_FOCUS_OFFSET + + tooltip + + type + integer + value + 1 + + CAMERA_FOCUS_THRESHOLD + + tooltip + + type + integer + value + 11 + + CAMERA_PITCH + + tooltip + + type + integer + value + 0 + + CAMERA_POSITION + + tooltip + + type + integer + value + 13 + + CAMERA_POSITION_LAG + + tooltip + + type + integer + value + 5 + + CAMERA_POSITION_LOCKED + + tooltip + + type + integer + value + 21 + + CAMERA_POSITION_THRESHOLD + + tooltip + + type + integer + value + 10 + + CHANGED_ALLOWED_DROP + + tooltip + The object inventory has changed because an item was added through the llAllowInventoryDrop interface. + type + integer + value + 0x40 + + CHANGED_COLOR + + tooltip + The object color has changed. + type + integer + value + 0x2 + + CHANGED_INVENTORY + + tooltip + The object inventory has changed. + type + integer + value + 0x1 + + CHANGED_LINK + + tooltip + The object has linked or its links were broken. + type + integer + value + 0x20 + + CHANGED_MEDIA + + tooltip + + type + integer + value + 0x800 + + CHANGED_OWNER + + tooltip + + type + integer + value + 0x80 + + CHANGED_REGION + + tooltip + + type + integer + value + 0x100 + + CHANGED_REGION_START + + tooltip + + type + integer + value + 0x400 + + CHANGED_RENDER_MATERIAL + + tooltip + The render material has changed. + type + integer + value + 0x1000 + + CHANGED_SCALE + + tooltip + The object scale (size) has changed. + type + integer + value + 0x8 + + CHANGED_SHAPE + + tooltip + The object base shape has changed, e.g., a box to a cylinder. + type + integer + value + 0x4 + + CHANGED_TELEPORT + + tooltip + + type + integer + value + 0x200 + + CHANGED_TEXTURE + + tooltip + The texture offset, scale rotation, or simply the object texture has changed. + type + integer + value + 0x10 + + CHARACTER_ACCOUNT_FOR_SKIPPED_FRAMES + + tooltip + If set to false, character will not attempt to catch up on lost time when pathfinding performance is low, potentially providing more reliable movement (albeit while potentially appearing to be more stuttery). Default is true to match pre-existing behavior. + type + integer + value + 14 + + CHARACTER_AVOIDANCE_MODE + + tooltip + Allows you to specify that a character should not try to avoid other characters, should not try to avoid dynamic obstacles (relatively fast moving objects and avatars), or both. + type + integer + value + 5 + + CHARACTER_CMD_JUMP + + tooltip + Makes the character jump. Requires an additional parameter, the height to jump, between 0.1m and 2.0m. This must be provided as the first element of the llExecCharacterCmd option list. + type + integer + value + 0x01 + + CHARACTER_CMD_SMOOTH_STOP + + tooltip + + type + integer + value + 2 + + CHARACTER_CMD_STOP + + tooltip + Stops any current pathfinding operation. + type + integer + value + 0x00 + + CHARACTER_DESIRED_SPEED + + tooltip + Speed of pursuit in meters per second. + type + integer + value + 1 + + CHARACTER_DESIRED_TURN_SPEED + + tooltip + The character's maximum speed while turning about the Z axis. - Note that this is only loosely enforced. + type + integer + value + 12 + + CHARACTER_LENGTH + + tooltip + Set collision capsule length - cannot be less than two times the radius. + type + integer + value + 3 + + CHARACTER_MAX_ACCEL + + tooltip + The character's maximum acceleration rate. + type + integer + value + 8 + + CHARACTER_MAX_DECEL + + tooltip + The character's maximum deceleration rate. + type + integer + value + 9 + + CHARACTER_MAX_SPEED + + tooltip + The character's maximum speed. + type + integer + value + 13 + + CHARACTER_MAX_TURN_RADIUS + + tooltip + The character's turn radius when travelling at CHARACTER_MAX_TURN_SPEED. + type + integer + value + 10 + + CHARACTER_ORIENTATION + + tooltip + Valid options are: VERTICAL, HORIZONTAL. + type + integer + value + 4 + + CHARACTER_RADIUS + + tooltip + Set collision capsule radius. + type + integer + value + 2 + + CHARACTER_STAY_WITHIN_PARCEL + + tooltip + Determines whether a character can leave its starting parcel.\nTakes a boolean parameter. If TRUE, the character cannot voluntarilly leave the parcel, but can return to it. + type + integer + value + 15 + + CHARACTER_TYPE + + tooltip + Specifies which walk-ability coefficient will be used by this character. + type + integer + value + 6 + + CHARACTER_TYPE_A + + tooltip + + type + integer + value + 0 + + CHARACTER_TYPE_B + + tooltip + + type + integer + value + 1 + + CHARACTER_TYPE_C + + tooltip + + type + integer + value + 2 + + CHARACTER_TYPE_D + + tooltip + + type + integer + value + 3 + + CHARACTER_TYPE_NONE + + tooltip + + type + integer + value + 4 + + CLICK_ACTION_BUY + + tooltip + When the prim is clicked, the buy dialog is opened. + type + integer + value + 2 + + CLICK_ACTION_DISABLED + + tooltip + No click action. No touches detected or passed. + type + integer + value + 8 + + CLICK_ACTION_IGNORE + + tooltip + No click action. Object is invisible to the mouse. + type + integer + value + 9 + + CLICK_ACTION_NONE + + tooltip + Performs the default action: when the prim is clicked, touch events are triggered. + type + integer + value + 0 + + CLICK_ACTION_OPEN + + tooltip + When the prim is clicked, the object inventory dialog is opened. + type + integer + value + 4 + + CLICK_ACTION_OPEN_MEDIA + + tooltip + When the prim is touched, the web media dialog is opened. + type + integer + value + 6 + + CLICK_ACTION_PAY + + tooltip + When the prim is clicked, the pay dialog is opened. + type + integer + value + 3 + + CLICK_ACTION_PLAY + + tooltip + When the prim is clicked, html-on-a-prim is enabled? + type + integer + value + 5 + + CLICK_ACTION_SIT + + tooltip + When the prim is clicked, the avatar sits upon it. + type + integer + value + 1 + + CLICK_ACTION_TOUCH + + tooltip + When the prim is clicked, touch events are triggered. + type + integer + value + 0 + + CLICK_ACTION_ZOOM + + tooltip + Zoom in on object when clicked. + type + integer + value + 7 + + COMBAT_CHANNEL + + tooltip + COMBAT_CHANNEL is an integer constant that, when passed to llRegionSay will add the message to the combat log. A script with a chat listen active on COMBAT_CHANNEL may also monitor the combat log. + type + integer + value + 2147483646 + + COMBAT_LOG_ID + + tooltip + + type + string + value + 45e0fcfa-2268-4490-a51c-3e51bdfe80d1 + + CONTENT_TYPE_ATOM + + tooltip + "application/atom+xml" + type + integer + value + 4 + + CONTENT_TYPE_FORM + + tooltip + "application/x-www-form-urlencoded" + type + integer + value + 7 + + CONTENT_TYPE_HTML + + tooltip + "text/html", only valid for embedded browsers on content owned by the person viewing. Falls back to "text/plain" otherwise. + type + integer + value + 1 + + CONTENT_TYPE_JSON + + tooltip + "application/json" + type + integer + value + 5 + + CONTENT_TYPE_LLSD + + tooltip + "application/llsd+xml" + type + integer + value + 6 + + CONTENT_TYPE_RSS + + tooltip + "application/rss+xml" + type + integer + value + 8 + + CONTENT_TYPE_TEXT + + tooltip + "text/plain" + type + integer + value + 0 + + CONTENT_TYPE_XHTML + + tooltip + "application/xhtml+xml" + type + integer + value + 3 + + CONTENT_TYPE_XML + + tooltip + "application/xml" + type + integer + value + 2 + + CONTROL_BACK + + tooltip + Test for the avatar move back control. + type + integer + value + 0x2 + + CONTROL_DOWN + + tooltip + Test for the avatar move down control. + type + integer + value + 0x20 + + CONTROL_FWD + + tooltip + Test for the avatar move forward control. + type + integer + value + 0x1 + + CONTROL_LBUTTON + + tooltip + Test for the avatar left button control. + type + integer + value + 0x10000000 + + CONTROL_LEFT + + tooltip + Test for the avatar move left control. + type + integer + value + 0x4 + + CONTROL_ML_LBUTTON + + tooltip + Test for the avatar left button control while in mouse look. + type + integer + value + 0x40000000 + + CONTROL_RIGHT + + tooltip + Test for the avatar move right control. + type + integer + value + 0x8 + + CONTROL_ROT_LEFT + + tooltip + Test for the avatar rotate left control. + type + integer + value + 0x100 + + CONTROL_ROT_RIGHT + + tooltip + Test for the avatar rotate right control. + type + integer + value + 0x200 + + CONTROL_UP + + tooltip + Test for the avatar move up control. + type + integer + value + 0x10 + + DAMAGEABLE + + tooltip + Objects in world that are able to process damage. + type + integer + value + 0x20 + + DAMAGE_TYPE_ACID + + tooltip + Damage caused by a caustic substance, such as acid + type + integer + value + 1 + + DAMAGE_TYPE_BLUDGEONING + + tooltip + Damage caused by a blunt object, such as a club. + type + integer + value + 2 + + DAMAGE_TYPE_COLD + + tooltip + Damage inflicted by exposure to extreme cold + type + integer + value + 3 + + DAMAGE_TYPE_ELECTRIC + + tooltip + Damage caused by electricity. + type + integer + value + 4 + + DAMAGE_TYPE_EMOTIONAL + + tooltip + + type + integer + value + 14 + + DAMAGE_TYPE_FIRE + + tooltip + Damage inflicted by exposure to heat or flames. + type + integer + value + 5 + + DAMAGE_TYPE_FORCE + + tooltip + Damage inflicted by a great force or impact. + type + integer + value + 6 + + DAMAGE_TYPE_GENERIC + + tooltip + Generic or legacy damage. + type + integer + value + 0 + + DAMAGE_TYPE_IMPACT + + tooltip + System damage generated by imapact with land or a prim. + type + integer + value + -1 + + DAMAGE_TYPE_NECROTIC + + tooltip + Damage caused by a direct assault on life-force + type + integer + value + 7 + + DAMAGE_TYPE_PIERCING + + tooltip + Damage caused by a piercing object such as a bullet, spear, or arrow. + type + integer + value + 8 + + DAMAGE_TYPE_POISON + + tooltip + Damage caused by poison. + type + integer + value + 9 + + DAMAGE_TYPE_PSYCHIC + + tooltip + Damage caused by a direct assault on the mind. + type + integer + value + 10 + + DAMAGE_TYPE_RADIANT + + tooltip + Damage caused by radiation or extreme light. + type + integer + value + 11 + + DAMAGE_TYPE_SLASHING + + tooltip + Damage caused by a slashing object such as a sword or axe. + type + integer + value + 12 + + DAMAGE_TYPE_SONIC + + tooltip + Damage caused by loud noises, like a Crash Worship concert. + type + integer + value + 13 + + DATA_BORN + + tooltip + The date the agent was born, returned in ISO 8601 format of YYYY-MM-DD. + type + integer + value + 3 + + DATA_NAME + + tooltip + The name of the agent. + type + integer + value + 2 + + DATA_ONLINE + + tooltip + TRUE for online, FALSE for offline. + type + integer + value + 1 + + DATA_PAYINFO + + tooltip + + type + integer + value + 8 + + DATA_RATING + + tooltip + + Returns the agent ratings as a comma separated string of six integers. They are: + 1) Positive rated behaviour + 2) Negative rated behaviour + 3) Positive rated appearance + 4) Negative rated appearance + 5) Positive rated building + 6) Negative rated building + + type + integer + value + 4 + + DATA_SIM_POS + + tooltip + + type + integer + value + 5 + + DATA_SIM_RATING + + tooltip + + type + integer + value + 7 + + DATA_SIM_STATUS + + tooltip + + type + integer + value + 6 + + DEBUG_CHANNEL + + tooltip + DEBUG_CHANNEL is an integer constant that, when passed to llSay, llWhisper, or llShout as a channel parameter, will print text to the Script Warning/Error Window. + type + integer + value + 2147483647 + + DEG_TO_RAD + + tooltip + + 0.017453293 - Number of radians per degree. + You can use this to convert degrees to radians by multiplying the degrees by this number. + + type + float + value + 0.017453293 + + DENSITY + + tooltip + Used with llSetPhysicsMaterial to enable the density value. Must be between 1.0 and 22587.0 (in Kg/m^3 -- see if you can figure out what 22587 represents) + type + integer + value + 1 + + DEREZ_DIE + + tooltip + Causes the object to immediately die. + type + integer + value + 0 + + DEREZ_MAKE_TEMP + + tooltip + The object is made temporary and will be cleaned up at some later timer. + type + integer + value + 1 + + ENVIRONMENT_DAYINFO + + tooltip + Day length, offset and progression. + type + integer + value + 200 + + ENV_INVALID_AGENT + + tooltip + Could not find agent with the specified ID + type + integer + value + -4 + + ENV_INVALID_RULE + + tooltip + Attempted to change an unknown property. + type + integer + value + -5 + + ENV_NOT_EXPERIENCE + + tooltip + Attempt to change environments outside an experience. + type + integer + value + -1 + + ENV_NO_ENVIRONMENT + + tooltip + Could not find environmental settings in object inventory. + type + integer + value + -3 + + ENV_NO_EXPERIENCE_LAND + + tooltip + The experience has not been enabled on this land. + type + integer + value + -7 + + ENV_NO_EXPERIENCE_PERMISSION + + tooltip + Agent has not granted permission to change environments. + type + integer + value + -2 + + ENV_NO_PERMISSIONS + + tooltip + Script does not have permission to modify environment. + type + integer + value + -9 + + ENV_THROTTLE + + tooltip + Could not validate values for environment. + type + integer + value + -8 + + ENV_VALIDATION_FAIL + + tooltip + Could not validate values for environment. + type + integer + value + -6 + + EOF + + tooltip + Indicates the last line of a notecard was read. + type + string + value + \\n\\n\\n + + ERR_GENERIC + + tooltip + + type + integer + value + -1 + + ERR_MALFORMED_PARAMS + + tooltip + + type + integer + value + -3 + + ERR_PARCEL_PERMISSIONS + + tooltip + + type + integer + value + -2 + + ERR_RUNTIME_PERMISSIONS + + tooltip + + type + integer + value + -4 + + ERR_THROTTLED + + tooltip + + type + integer + value + -5 + + ESTATE_ACCESS_ALLOWED_AGENT_ADD + + tooltip + Add the agent to this estate's Allowed Residents list. + type + integer + value + 4 + + ESTATE_ACCESS_ALLOWED_AGENT_REMOVE + + tooltip + Remove the agent from this estate's Allowed Residents list. + type + integer + value + 8 + + ESTATE_ACCESS_ALLOWED_GROUP_ADD + + tooltip + Add the group to this estate's Allowed groups list. + type + integer + value + 16 + + ESTATE_ACCESS_ALLOWED_GROUP_REMOVE + + tooltip + Remove the group from this estate's Allowed groups list. + type + integer + value + 32 + + ESTATE_ACCESS_BANNED_AGENT_ADD + + tooltip + Add the agent to this estate's Banned residents list. + type + integer + value + 64 + + ESTATE_ACCESS_BANNED_AGENT_REMOVE + + tooltip + Remove the agent from this estate's Banned residents list. + type + integer + value + 128 + + FALSE + + tooltip + An integer constant for boolean comparisons. Has the value '0'. + type + integer + value + 0 + + FILTER_FLAGS + + tooltip + Flags to control returned attachments. + type + integer + value + 2 + + FILTER_FLAG_HUDS + + tooltip + Include HUDs with matching experience. + type + integer + value + 0x0001 + + FILTER_INCLUDE + + tooltip + Include attachment point. + type + integer + value + 1 + + FORCE_DIRECT_PATH + + tooltip + Makes character navigate in a straight line toward position. May be set to TRUE or FALSE. + type + integer + value + 1 + + FRICTION + + tooltip + Used with llSetPhysicsMaterial to enable the friction value. Must be between 0.0 and 255.0 + type + integer + value + 2 + + GAME_CONTROL_AXIS_LEFTX + + tooltip + + type + integer + value + 0 + + GAME_CONTROL_AXIS_LEFTY + + tooltip + + type + integer + value + 1 + + GAME_CONTROL_AXIS_RIGHTX + + tooltip + + type + integer + value + 2 + + GAME_CONTROL_AXIS_RIGHTY + + tooltip + + type + integer + value + 3 + + GAME_CONTROL_AXIS_TRIGGERLEFT + + tooltip + + type + integer + value + 4 + + GAME_CONTROL_AXIS_TRIGGERRIGHT + + tooltip + + type + integer + value + 5 + + GAME_CONTROL_BUTTON_A + + tooltip + + type + integer + value + 0x1 + + GAME_CONTROL_BUTTON_B + + tooltip + + type + integer + value + 0x2 + + GAME_CONTROL_BUTTON_BACK + + tooltip + + type + integer + value + 0x10 + + GAME_CONTROL_BUTTON_DPAD_DOWN + + tooltip + + type + integer + value + 0x1000 + + GAME_CONTROL_BUTTON_DPAD_LEFT + + tooltip + + type + integer + value + 0x2000 + + GAME_CONTROL_BUTTON_DPAD_RIGHT + + tooltip + + type + integer + value + 0x4000 + + GAME_CONTROL_BUTTON_DPAD_UP + + tooltip + + type + integer + value + 0x800 + + GAME_CONTROL_BUTTON_GUIDE + + tooltip + + type + integer + value + 0x20 + + GAME_CONTROL_BUTTON_LEFTSHOULDER + + tooltip + + type + integer + value + 0x200 + + GAME_CONTROL_BUTTON_LEFTSTICK + + tooltip + + type + integer + value + 0x80 + + GAME_CONTROL_BUTTON_MISC1 + + tooltip + + type + integer + value + 0x8000 + + GAME_CONTROL_BUTTON_PADDLE1 + + tooltip + + type + integer + value + 0x10000 + + GAME_CONTROL_BUTTON_PADDLE2 + + tooltip + + type + integer + value + 0x20000 + + GAME_CONTROL_BUTTON_PADDLE3 + + tooltip + + type + integer + value + 0x40000 + + GAME_CONTROL_BUTTON_PADDLE4 + + tooltip + + type + integer + value + 0x80000 + + GAME_CONTROL_BUTTON_RIGHTSHOULDER + + tooltip + + type + integer + value + 0x400 + + GAME_CONTROL_BUTTON_RIGHTSTICK + + tooltip + + type + integer + value + 0x100 + + GAME_CONTROL_BUTTON_START + + tooltip + + type + integer + value + 0x40 + + GAME_CONTROL_BUTTON_TOUCHPAD + + tooltip + + type + integer + value + 0x100000 + + GAME_CONTROL_BUTTON_X + + tooltip + + type + integer + value + 0x4 + + GAME_CONTROL_BUTTON_Y + + tooltip + + type + integer + value + 0x8 + + GCNP_RADIUS + + tooltip + + type + integer + value + 0 + + GCNP_STATIC + + tooltip + + type + integer + value + 1 + + GRAVITY_MULTIPLIER + + tooltip + Used with llSetPhysicsMaterial to enable the gravity multiplier value. Must be between -1.0 and +28.0 + type + integer + value + 8 + + HORIZONTAL + + tooltip + + type + integer + value + 1 + + HTTP_ACCEPT + + tooltip + + Provide a string value to be included in the HTTP + accepts header value. This replaces the default Second Life HTTP accepts header. + + type + integer + value + 8 + + HTTP_BODY_MAXLENGTH + + tooltip + + type + integer + value + 2 + + HTTP_BODY_TRUNCATED + + tooltip + + type + integer + value + 0 + + HTTP_CUSTOM_HEADER + + tooltip + Add an extra custom HTTP header to the request. The first string is the name of the parameter to change, e.g. "Pragma", and the second string is the value, e.g. "no-cache". Up to 8 custom headers may be configured per request. Note that certain headers, such as the default headers, are blocked for security reasons. + type + integer + value + 5 + + HTTP_EXTENDED_ERROR + + tooltip + Report extended error information through http_response event. + type + integer + value + 9 + + HTTP_METHOD + + tooltip + + type + integer + value + 0 + + HTTP_MIMETYPE + + tooltip + + type + integer + value + 1 + + HTTP_PRAGMA_NO_CACHE + + tooltip + Allows enabling/disbling of the "Pragma: no-cache" header.\nUsage: [HTTP_PRAGMA_NO_CACHE, integer SendHeader]. When SendHeader is TRUE, the "Pragma: no-cache" header is sent by the script. This matches the default behavior. When SendHeader is FALSE, no "Pragma" header is sent by the script. + type + integer + value + 6 + + HTTP_USER_AGENT + + tooltip + + Provide a string value to be included in the HTTP + User-Agent header value. This is appended to the default value. + + type + integer + value + 7 + + HTTP_VERBOSE_THROTTLE + + tooltip + + type + integer + value + 4 + + HTTP_VERIFY_CERT + + tooltip + + type + integer + value + 3 + + IMG_USE_BAKED_AUX1 + + tooltip + + type + string + value + 9742065b-19b5-297c-858a-29711d539043 + + IMG_USE_BAKED_AUX2 + + tooltip + + type + string + value + 03642e83-2bd1-4eb9-34b4-4c47ed586d2d + + IMG_USE_BAKED_AUX3 + + tooltip + + type + string + value + edd51b77-fc10-ce7a-4b3d-011dfc349e4f + + IMG_USE_BAKED_EYES + + tooltip + + type + string + value + 52cc6bb6-2ee5-e632-d3ad-50197b1dcb8a + + IMG_USE_BAKED_HAIR + + tooltip + + type + string + value + 09aac1fb-6bce-0bee-7d44-caac6dbb6c63 + + IMG_USE_BAKED_HEAD + + tooltip + + type + string + value + 5a9f4a74-30f2-821c-b88d-70499d3e7183 + + IMG_USE_BAKED_LEFTARM + + tooltip + + type + string + value + ff62763f-d60a-9855-890b-0c96f8f8cd98 + + IMG_USE_BAKED_LEFTLEG + + tooltip + + type + string + value + 8e915e25-31d1-cc95-ae08-d58a47488251 + + IMG_USE_BAKED_LOWER + + tooltip + + type + string + value + 24daea5f-0539-cfcf-047f-fbc40b2786ba + + IMG_USE_BAKED_SKIRT + + tooltip + + type + string + value + 43529ce8-7faa-ad92-165a-bc4078371687 + + IMG_USE_BAKED_UPPER + + tooltip + + type + string + value + ae2de45c-d252-50b8-5c6e-19f39ce79317 + + INVENTORY_ALL + + tooltip + + type + integer + value + -1 + + INVENTORY_ANIMATION + + tooltip + + type + integer + value + 20 + + INVENTORY_BODYPART + + tooltip + + type + integer + value + 13 + + INVENTORY_CLOTHING + + tooltip + + type + integer + value + 5 + + INVENTORY_GESTURE + + tooltip + + type + integer + value + 21 + + INVENTORY_LANDMARK + + tooltip + + type + integer + value + 3 + + INVENTORY_MATERIAL + + tooltip + + type + integer + value + 57 + + INVENTORY_NONE + + tooltip + + type + integer + value + -1 + + INVENTORY_NOTECARD + + tooltip + + type + integer + value + 7 + + INVENTORY_OBJECT + + tooltip + + type + integer + value + 6 + + INVENTORY_SCRIPT + + tooltip + + type + integer + value + 10 + + INVENTORY_SETTING + + tooltip + + type + integer + value + 56 + + INVENTORY_SOUND + + tooltip + + type + integer + value + 1 + + INVENTORY_TEXTURE + + tooltip + + type + integer + value + 0 + + JSON_APPEND + + tooltip + + type + integer + value + -1 + + JSON_ARRAY + + tooltip + + type + string + value + \\ufdd2 + + JSON_DELETE + + tooltip + + type + string + value + \\ufdd8 + + JSON_FALSE + + tooltip + + type + string + value + \\ufdd7 + + JSON_INVALID + + tooltip + + type + string + value + \\ufdd0 + + JSON_NULL + + tooltip + + type + string + value + \\ufdd5 + + JSON_NUMBER + + tooltip + + type + string + value + \\ufdd3 + + JSON_OBJECT + + tooltip + + type + string + value + \\ufdd1 + + JSON_STRING + + tooltip + + type + string + value + \\ufdd4 + + JSON_TRUE + + tooltip + + type + string + value + \\ufdd6 + + KFM_CMD_PAUSE + + tooltip + For use with KFM_COMMAND. + type + integer + value + 2 + + KFM_CMD_PLAY + + tooltip + For use with KFM_COMMAND. + type + integer + value + 0 + + KFM_CMD_STOP + + tooltip + For use with KFM_COMMAND. + type + integer + value + 1 + + KFM_COMMAND + + tooltip + + type + integer + value + 0 + + KFM_DATA + + tooltip + + type + integer + value + 2 + + KFM_FORWARD + + tooltip + For use with KFM_MODE. + type + integer + value + 0 + + KFM_LOOP + + tooltip + For use with KFM_MODE. + type + integer + value + 1 + + KFM_MODE + + tooltip + + type + integer + value + 1 + + KFM_PING_PONG + + tooltip + For use with KFM_MODE. + type + integer + value + 2 + + KFM_REVERSE + + tooltip + For use with KFM_MODE. + type + integer + value + 3 + + KFM_ROTATION + + tooltip + For use with KFM_DATA. + type + integer + value + 1 + + KFM_TRANSLATION + + tooltip + For use with KFM_DATA. + type + integer + value + 2 + + LAND_LARGE_BRUSH + + tooltip + Use a large brush size.\nNOTE: This value is incorrect, a large brush should be 2. + type + integer + value + 3 + + LAND_LEVEL + + tooltip + Action to level the land. + type + integer + value + 0 + + LAND_LOWER + + tooltip + Action to lower the land. + type + integer + value + 2 + + LAND_MEDIUM_BRUSH + + tooltip + Use a medium brush size.\nNOTE: This value is incorrect, a medium brush should be 1. + type + integer + value + 2 + + LAND_NOISE + + tooltip + + type + integer + value + 4 + + LAND_RAISE + + tooltip + Action to raise the land. + type + integer + value + 1 + + LAND_REVERT + + tooltip + + type + integer + value + 5 + + LAND_SMALL_BRUSH + + tooltip + Use a small brush size.\nNOTE: This value is incorrect, a small brush should be 0. + type + integer + value + 1 + + LAND_SMOOTH + + tooltip + + type + integer + value + 3 + + LINKSETDATA_DELETE + + tooltip + A name:value pair has been removed from the linkset datastore. + type + integer + value + 2 + + LINKSETDATA_EMEMORY + + tooltip + A name:value pair was too large to write to the linkset datastore. + type + integer + value + 1 + + LINKSETDATA_ENOKEY + + tooltip + The key supplied was empty. + type + integer + value + 2 + + LINKSETDATA_EPROTECTED + + tooltip + The name:value pair has been protected from overwrite in the linkset datastore. + type + integer + value + 3 + + LINKSETDATA_MULTIDELETE + + tooltip + A CSV list of names removed from the linkset datastore. + type + integer + value + 3 + + LINKSETDATA_NOTFOUND + + tooltip + The named key was not found in the datastore. + type + integer + value + 4 + + LINKSETDATA_NOUPDATE + + tooltip + The value written to a name in the keystore is the same as the value already there. + type + integer + value + 5 + + LINKSETDATA_OK + + tooltip + The name:value pair was written to the datastore. + type + integer + value + 0 + + LINKSETDATA_RESET + + tooltip + The linkset datastore has been reset. + type + integer + value + 0 + + LINKSETDATA_UPDATE + + tooltip + A name:value pair in the linkset datastore has been changed or created. + type + integer + value + 1 + + LINK_ALL_CHILDREN + + tooltip + This targets every object except the root in the linked set. + type + integer + value + -3 + + LINK_ALL_OTHERS + + tooltip + This targets every object in the linked set except the object with the script. + type + integer + value + -2 + + LINK_ROOT + + tooltip + This targets the root of the linked set. + type + integer + value + 1 + + LINK_SET + + tooltip + This targets every object in the linked set. + type + integer + value + -1 + + LINK_THIS + + tooltip + The link number of the prim containing the script. + type + integer + value + -4 + + LIST_STAT_GEOMETRIC_MEAN + + tooltip + + type + integer + value + 9 + + LIST_STAT_MAX + + tooltip + + type + integer + value + 2 + + LIST_STAT_MEAN + + tooltip + + type + integer + value + 3 + + LIST_STAT_MEDIAN + + tooltip + + type + integer + value + 4 + + LIST_STAT_MIN + + tooltip + + type + integer + value + 1 + + LIST_STAT_NUM_COUNT + + tooltip + + type + integer + value + 8 + + LIST_STAT_RANGE + + tooltip + + type + integer + value + 0 + + LIST_STAT_STD_DEV + + tooltip + + type + integer + value + 5 + + LIST_STAT_SUM + + tooltip + + type + integer + value + 6 + + LIST_STAT_SUM_SQUARES + + tooltip + + type + integer + value + 7 + + LOOP + + tooltip + Loop the texture animation. + type + integer + value + 0x2 + + MASK_BASE + + tooltip + + type + integer + value + 0 + + MASK_COMBINED + + tooltip + Fold permissions for object inventory into results. + type + integer + value + 0x10 + + MASK_EVERYONE + + tooltip + + type + integer + value + 3 + + MASK_GROUP + + tooltip + + type + integer + value + 2 + + MASK_NEXT + + tooltip + + type + integer + value + 4 + + MASK_OWNER + + tooltip + + type + integer + value + 1 + + NAK + + tooltip + Indicates a notecard read was attempted and the notecard was not yet cached on the server. + type + string + value + \\n\\x15\\n + + NULL_KEY + + tooltip + + type + string + value + 00000000-0000-0000-0000-000000000000 + + OBJECT_ACCOUNT_LEVEL + + tooltip + Retrieves the account level of an avatar.\nReturns 0 when the avatar has a basic account,\n 1 when the avatar has a premium account,\n 10 when the avatar has a premium plus account,\n or -1 if the object is not an avatar. + type + integer + value + 41 + + OBJECT_ANIMATED_COUNT + + tooltip + This is a flag used with llGetObjectDetails to get the number of associated animated objects + type + integer + value + 39 + + OBJECT_ANIMATED_SLOTS_AVAILABLE + + tooltip + This is a flag used with llGetObjectDetails to get the number of additional animated object attachments allowed. + type + integer + value + 40 + + OBJECT_ATTACHED_POINT + + tooltip + Gets the attachment point to which the object is attached.\nReturns 0 if the object is not an attachment (or is an avatar, etc). + type + integer + value + 19 + + OBJECT_ATTACHED_SLOTS_AVAILABLE + + tooltip + Returns the number of attachment slots available.\nReturns 0 if the object is not an avatar or none are available. + type + integer + value + 35 + + OBJECT_BODY_SHAPE_TYPE + + tooltip + This is a flag used with llGetObjectDetails to get the body type of the avatar, based on shape data.\nIf no data is available, -1.0 is returned.\nThis is normally between 0 and 1.0, with 0.5 and larger considered 'male' + type + integer + value + 26 + + OBJECT_CHARACTER_TIME + + tooltip + Units in seconds + type + integer + value + 17 + + OBJECT_CLICK_ACTION + + tooltip + This is a flag used with llGetObjectDetails to get the click action.\nThe default is 0 + type + integer + value + 28 + + OBJECT_CREATION_TIME + + tooltip + This is a flag used with llGetObjectDetails to get the time this object was created + type + integer + value + 36 + + OBJECT_CREATOR + + tooltip + Gets the object's creator key. If id is an avatar, a NULL_KEY is returned. + type + integer + value + 8 + + OBJECT_DAMAGE + + tooltip + Gets the damage value assigned to this object. + type + integer + value + 51 + + OBJECT_DAMAGE_TYPE + + tooltip + Gets the damage type, if any, assigned to this object. + type + integer + value + 52 + + OBJECT_DESC + + tooltip + Gets the object's description. If id is an avatar, an empty string is returned. + type + integer + value + 2 + + OBJECT_GROUP + + tooltip + Gets the prims's group key. If id is an avatar, a NULL_KEY is returned. + type + integer + value + 7 + + OBJECT_GROUP_TAG + + tooltip + Gets the agent's current group role tag. If id is an object, an empty is returned. + type + integer + value + 33 + + OBJECT_HEALTH + + tooltip + Gets current health value for the object. + type + integer + value + 50 + + OBJECT_HOVER_HEIGHT + + tooltip + This is a flag used with llGetObjectDetails to get hover height of the avatar\nIf no data is available, 0.0 is returned. + type + integer + value + 25 + + OBJECT_LAST_OWNER_ID + + tooltip + Gets the object's last owner ID. + type + integer + value + 27 + + OBJECT_LINK_NUMBER + + tooltip + Gets the object's link number or 0 if unlinked. + type + integer + value + 46 + + OBJECT_MASS + + tooltip + Get the object's mass + type + integer + value + 43 + + OBJECT_MATERIAL + + tooltip + Get an object's material setting. + type + integer + value + 42 + + OBJECT_NAME + + tooltip + Gets the object's name. + type + integer + value + 1 + + OBJECT_OMEGA + + tooltip + Gets an object's angular velocity. + type + integer + value + 29 + + OBJECT_OWNER + + tooltip + Gets an object's owner's key. If id is group owned, a NULL_KEY is returned. + type + integer + value + 6 + + OBJECT_PATHFINDING_TYPE + + tooltip + Returns the pathfinding setting of any object in the region. It returns an integer matching one of the OPT_* constants. + type + integer + value + 20 + + OBJECT_PERMS + + tooltip + Gets the objects permissions + type + integer + value + 53 + + OBJECT_PERMS_COMBINED + + tooltip + Gets the object's permissions including any inventory. + type + integer + value + 54 + + OBJECT_PHANTOM + + tooltip + Returns boolean, detailing if phantom is enabled or disabled on the object.\nIf id is an avatar or attachment, 0 is returned. + type + integer + value + 22 + + OBJECT_PHYSICS + + tooltip + Returns boolean, detailing if physics is enabled or disabled on the object.\nIf id is an avatar or attachment, 0 is returned. + type + integer + value + 21 + + OBJECT_PHYSICS_COST + + tooltip + + type + integer + value + 16 + + OBJECT_POS + + tooltip + Gets the object's position in region coordinates. + type + integer + value + 3 + + OBJECT_PRIM_COUNT + + tooltip + Gets the prim count of the object. The script and target object must be owned by the same owner + type + integer + value + 30 + + OBJECT_PRIM_EQUIVALENCE + + tooltip + + type + integer + value + 13 + + OBJECT_RENDER_WEIGHT + + tooltip + This is a flag used with llGetObjectDetails to get the Avatar_Rendering_Cost of an avatar, based on values reported by nearby viewers.\nIf no data is available, -1 is returned.\nThe maximum render weight stored by the simulator is 500000. When called against an object, 0 is returned. + type + integer + value + 24 + + OBJECT_RETURN_PARCEL + + tooltip + + type + integer + value + 1 + + OBJECT_RETURN_PARCEL_OWNER + + tooltip + + type + integer + value + 2 + + OBJECT_RETURN_REGION + + tooltip + + type + integer + value + 4 + + OBJECT_REZZER_KEY + + tooltip + + type + integer + value + 32 + + OBJECT_REZ_TIME + + tooltip + Get the time when an object was rezzed. + type + integer + value + 45 + + OBJECT_ROOT + + tooltip + Gets the id of the root prim of the object requested.\nIf id is an avatar, return the id of the root prim of the linkset the avatar is sitting on (or the avatar's own id if the avatar is not sitting on an object within the region). + type + integer + value + 18 + + OBJECT_ROT + + tooltip + Gets the object's rotation. + type + integer + value + 4 + + OBJECT_RUNNING_SCRIPT_COUNT + + tooltip + + type + integer + value + 9 + + OBJECT_SCALE + + tooltip + Gets the object's size. + type + integer + value + 47 + + OBJECT_SCRIPT_MEMORY + + tooltip + + type + integer + value + 11 + + OBJECT_SCRIPT_TIME + + tooltip + + type + integer + value + 12 + + OBJECT_SELECT_COUNT + + tooltip + This is a flag used with llGetObjectDetails to get the number of avatars selecting any part of the object + type + integer + value + 37 + + OBJECT_SERVER_COST + + tooltip + + type + integer + value + 14 + + OBJECT_SIT_COUNT + + tooltip + This is a flag used with llGetObjectDetails to get the number of avatars sitting on the object + type + integer + value + 38 + + OBJECT_STREAMING_COST + + tooltip + + type + integer + value + 15 + + OBJECT_TEMP_ATTACHED + + tooltip + Returns boolean, indicating if object is a temp attachment. + type + integer + value + 34 + + OBJECT_TEMP_ON_REZ + + tooltip + Returns boolean, detailing if temporary is enabled or disabled on the object. + type + integer + value + 23 + + OBJECT_TEXT + + tooltip + Gets an objects hover text. + type + integer + value + 44 + + OBJECT_TEXT_ALPHA + + tooltip + Gets the alpha of an objects hover text. + type + integer + value + 49 + + OBJECT_TEXT_COLOR + + tooltip + Gets the color of an objects hover text. + type + integer + value + 48 + + OBJECT_TOTAL_INVENTORY_COUNT + + tooltip + Gets the total inventory count of the object. The script and target object must be owned by the same owner + type + integer + value + 31 + + OBJECT_TOTAL_SCRIPT_COUNT + + tooltip + + type + integer + value + 10 + + OBJECT_UNKNOWN_DETAIL + + tooltip + + type + integer + value + -1 + + OBJECT_VELOCITY + + tooltip + Gets the object's velocity. + type + integer + value + 5 + + OPT_AVATAR + + tooltip + Returned for avatars. + type + integer + value + 1 + + OPT_CHARACTER + + tooltip + Returned for pathfinding characters. + type + integer + value + 2 + + OPT_EXCLUSION_VOLUME + + tooltip + Returned for exclusion volumes. + type + integer + value + 6 + + OPT_LEGACY_LINKSET + + tooltip + Returned for movable obstacles, movable phantoms, physical, and volumedetect objects. + type + integer + value + 0 + + OPT_MATERIAL_VOLUME + + tooltip + Returned for material volumes. + type + integer + value + 5 + + OPT_OTHER + + tooltip + Returned for attachments, Linden trees, and grass. + type + integer + value + -1 + + OPT_STATIC_OBSTACLE + + tooltip + Returned for static obstacles. + type + integer + value + 4 + + OPT_WALKABLE + + tooltip + Returned for walkable objects. + type + integer + value + 3 + + PARCEL_COUNT_GROUP + + tooltip + + type + integer + value + 2 + + PARCEL_COUNT_OTHER + + tooltip + + type + integer + value + 3 + + PARCEL_COUNT_OWNER + + tooltip + + type + integer + value + 1 + + PARCEL_COUNT_SELECTED + + tooltip + + type + integer + value + 4 + + PARCEL_COUNT_TEMP + + tooltip + + type + integer + value + 5 + + PARCEL_COUNT_TOTAL + + tooltip + + type + integer + value + 0 + + PARCEL_DETAILS_AREA + + tooltip + The parcel's area, in square meters. (5 chars.). + type + integer + value + 4 + + PARCEL_DETAILS_DESC + + tooltip + The description of the parcel. (127 chars). + type + integer + value + 1 + + PARCEL_DETAILS_FLAGS + + tooltip + Flags set on the parcel + type + integer + value + 12 + + PARCEL_DETAILS_GROUP + + tooltip + The parcel group's key. (36 chars.). + type + integer + value + 3 + + PARCEL_DETAILS_ID + + tooltip + The parcel's key. (36 chars.). + type + integer + value + 5 + + PARCEL_DETAILS_LANDING_LOOKAT + + tooltip + Lookat vector set for teleport routing. + type + integer + value + 10 + + PARCEL_DETAILS_LANDING_POINT + + tooltip + The parcel's landing point, if any. + type + integer + value + 9 + + PARCEL_DETAILS_NAME + + tooltip + The name of the parcel. (63 chars.). + type + integer + value + 0 + + PARCEL_DETAILS_OWNER + + tooltip + The parcel owner's key. (36 chars.). + type + integer + value + 2 + + PARCEL_DETAILS_PRIM_CAPACITY + + tooltip + The parcel's prim capacity. + type + integer + value + 7 + + PARCEL_DETAILS_PRIM_USED + + tooltip + The number of prims used on this parcel. + type + integer + value + 8 + + PARCEL_DETAILS_SCRIPT_DANGER + + tooltip + There are restrictions on this parcel that may impact script execution. + type + integer + value + 13 + + PARCEL_DETAILS_SEE_AVATARS + + tooltip + The parcel's avatar visibility setting. (1 char.). + type + integer + value + 6 + + PARCEL_DETAILS_TP_ROUTING + + tooltip + Parcel's teleport routing setting. + type + integer + value + 11 + + PARCEL_FLAG_ALLOW_ALL_OBJECT_ENTRY + + tooltip + + type + integer + value + 0x08000000 + + PARCEL_FLAG_ALLOW_CREATE_GROUP_OBJECTS + + tooltip + + type + integer + value + 0x4000000 + + PARCEL_FLAG_ALLOW_CREATE_OBJECTS + + tooltip + + type + integer + value + 0x40 + + PARCEL_FLAG_ALLOW_DAMAGE + + tooltip + + type + integer + value + 0x20 + + PARCEL_FLAG_ALLOW_FLY + + tooltip + + type + integer + value + 0x1 + + PARCEL_FLAG_ALLOW_GROUP_OBJECT_ENTRY + + tooltip + + type + integer + value + 0x10000000 + + PARCEL_FLAG_ALLOW_GROUP_SCRIPTS + + tooltip + + type + integer + value + 0x2000000 + + PARCEL_FLAG_ALLOW_LANDMARK + + tooltip + + type + integer + value + 0x8 + + PARCEL_FLAG_ALLOW_SCRIPTS + + tooltip + + type + integer + value + 0x2 + + PARCEL_FLAG_ALLOW_TERRAFORM + + tooltip + + type + integer + value + 0x10 + + PARCEL_FLAG_LOCAL_SOUND_ONLY + + tooltip + + type + integer + value + 0x8000 + + PARCEL_FLAG_RESTRICT_PUSHOBJECT + + tooltip + + type + integer + value + 0x200000 + + PARCEL_FLAG_USE_ACCESS_GROUP + + tooltip + + type + integer + value + 0x100 + + PARCEL_FLAG_USE_ACCESS_LIST + + tooltip + + type + integer + value + 0x200 + + PARCEL_FLAG_USE_BAN_LIST + + tooltip + + type + integer + value + 0x400 + + PARCEL_FLAG_USE_LAND_PASS_LIST + + tooltip + + type + integer + value + 0x800 + + PARCEL_MEDIA_COMMAND_AGENT + + tooltip + + type + integer + value + 7 + + PARCEL_MEDIA_COMMAND_AUTO_ALIGN + + tooltip + + type + integer + value + 9 + + PARCEL_MEDIA_COMMAND_DESC + + tooltip + Use this to get or set the parcel media description. + type + integer + value + 12 + + PARCEL_MEDIA_COMMAND_LOOP + + tooltip + + type + integer + value + 3 + + PARCEL_MEDIA_COMMAND_LOOP_SET + + tooltip + Used to get or set the parcel's media looping variable. + type + integer + value + 13 + + PARCEL_MEDIA_COMMAND_PAUSE + + tooltip + + type + integer + value + 1 + + PARCEL_MEDIA_COMMAND_PLAY + + tooltip + + type + integer + value + 2 + + PARCEL_MEDIA_COMMAND_SIZE + + tooltip + Use this to get or set the parcel media pixel resolution. + type + integer + value + 11 + + PARCEL_MEDIA_COMMAND_STOP + + tooltip + + type + integer + value + 0 + + PARCEL_MEDIA_COMMAND_TEXTURE + + tooltip + + type + integer + value + 4 + + PARCEL_MEDIA_COMMAND_TIME + + tooltip + + type + integer + value + 6 + + PARCEL_MEDIA_COMMAND_TYPE + + tooltip + Use this to get or set the parcel media MIME type (e.g. "text/html"). + type + integer + value + 10 + + PARCEL_MEDIA_COMMAND_UNLOAD + + tooltip + + type + integer + value + 8 + + PARCEL_MEDIA_COMMAND_URL + + tooltip + + type + integer + value + 5 + + PASSIVE + + tooltip + Static in-world objects. + type + integer + value + 0x4 + + PASS_ALWAYS + + tooltip + Always pass the event. + type + integer + value + 1 + + PASS_IF_NOT_HANDLED + + tooltip + Pass the event if there is no script handling the event in the prim. + type + integer + value + 0 + + PASS_NEVER + + tooltip + Always pass the event. + type + integer + value + 2 + + PATROL_PAUSE_AT_WAYPOINTS + + tooltip + + type + integer + value + 0 + + PAYMENT_INFO_ON_FILE + + tooltip + + type + integer + value + 1 + + PAYMENT_INFO_USED + + tooltip + + type + integer + value + 2 + + PAY_DEFAULT + + tooltip + + type + integer + value + -2 + + PAY_HIDE + + tooltip + + type + integer + value + -1 + + PERMISSION_ATTACH + + tooltip + If this permission is enabled, the object can successfully call llAttachToAvatar to attach to the given avatar. + type + integer + value + 0x20 + + PERMISSION_CHANGE_JOINTS + + tooltip + (not yet implemented) + type + integer + value + 0x100 + + PERMISSION_CHANGE_LINKS + + tooltip + If this permission is enabled, the object can successfully call llCreateLink, llBreakLink, and llBreakAllLinks to change links to other objects. + type + integer + value + 0x80 + + PERMISSION_CHANGE_PERMISSIONS + + tooltip + (not yet implemented) + type + integer + value + 0x200 + + PERMISSION_CONTROL_CAMERA + + tooltip + + type + integer + value + 0x800 + + PERMISSION_DEBIT + + tooltip + If this permission is enabled, the object can successfully call llGiveMoney or llTransferLindenDollars to debit the owners account. + type + integer + value + 0x2 + + PERMISSION_OVERRIDE_ANIMATIONS + + tooltip + Permission to override default animations. + type + integer + value + 0x8000 + + PERMISSION_RELEASE_OWNERSHIP + + tooltip + (not yet implemented) + type + integer + value + 0x40 + + PERMISSION_REMAP_CONTROLS + + tooltip + (not yet implemented) + type + integer + value + 0x8 + + PERMISSION_RETURN_OBJECTS + + tooltip + + type + integer + value + 65536 + + PERMISSION_SILENT_ESTATE_MANAGEMENT + + tooltip + A script with this permission does not notify the object owner when it modifies estate access rules via llManageEstateAccess. + type + integer + value + 0x4000 + + PERMISSION_TAKE_CONTROLS + + tooltip + If this permission enabled, the object can successfully call the llTakeControls libray call. + type + integer + value + 0x4 + + PERMISSION_TELEPORT + + tooltip + + type + integer + value + 0x1000 + + PERMISSION_TRACK_CAMERA + + tooltip + + type + integer + value + 0x400 + + PERMISSION_TRIGGER_ANIMATION + + tooltip + If this permission is enabled, the object can successfully call llStartAnimation for the avatar that owns this. + type + integer + value + 0x10 + + PERM_ALL + + tooltip + + type + integer + value + 0x7FFFFFFF + + PERM_COPY + + tooltip + + type + integer + value + 0x8000 + + PERM_MODIFY + + tooltip + + type + integer + value + 0x4000 + + PERM_MOVE + + tooltip + + type + integer + value + 0x80000 + + PERM_TRANSFER + + tooltip + + type + integer + value + 0x2000 + + PI + + tooltip + 3.14159265 - The number of radians in a semi-circle. + type + float + value + 3.14159265 + + PING_PONG + + tooltip + Play animation going forwards, then backwards. + type + integer + value + 0x8 + + PI_BY_TWO + + tooltip + 1.57079633 - The number of radians in a quarter circle. + type + float + value + 1.57079633 + + PRIM_ALLOW_UNSIT + + tooltip + Prim parameter for restricting manual standing for seated avatars in an experience.\nIgnored if the avatar was not seated via a call to llSitOnLink. + type + integer + value + 39 + + PRIM_ALPHA_MODE + + tooltip + Prim parameter for materials using integer face, integer alpha_mode, integer alpha_cutoff.\nDefines how the alpha channel of the diffuse texture should be rendered.\nValid options for alpha_mode are PRIM_ALPHA_MODE_BLEND, _NONE, _MASK, and _EMISSIVE.\nalpha_cutoff is used only for PRIM_ALPHA_MODE_MASK. + type + integer + value + 38 + + PRIM_ALPHA_MODE_BLEND + + tooltip + Prim parameter setting for PRIM_ALPHA_MODE.\nIndicates that the diffuse texture's alpha channel should be rendered as alpha-blended. + type + integer + value + 1 + + PRIM_ALPHA_MODE_EMISSIVE + + tooltip + Prim parameter setting for PRIM_ALPHA_MODE.\nIndicates that the diffuse texture's alpha channel should be rendered as an emissivity mask. + type + integer + value + 3 + + PRIM_ALPHA_MODE_MASK + + tooltip + Prim parameter setting for PRIM_ALPHA_MODE.\nIndicates that the diffuse texture's alpha channel should be rendered as fully opaque for alpha values above alpha_cutoff and fully transparent otherwise. + type + integer + value + 2 + + PRIM_ALPHA_MODE_NONE + + tooltip + Prim parameter setting for PRIM_ALPHA_MODE.\nIndicates that the diffuse texture's alpha channel should be ignored. + type + integer + value + 0 + + PRIM_BUMP_BARK + + tooltip + + type + integer + value + 4 + + PRIM_BUMP_BLOBS + + tooltip + + type + integer + value + 12 + + PRIM_BUMP_BRICKS + + tooltip + + type + integer + value + 5 + + PRIM_BUMP_BRIGHT + + tooltip + + type + integer + value + 1 + + PRIM_BUMP_CHECKER + + tooltip + + type + integer + value + 6 + + PRIM_BUMP_CONCRETE + + tooltip + + type + integer + value + 7 + + PRIM_BUMP_DARK + + tooltip + + type + integer + value + 2 + + PRIM_BUMP_DISKS + + tooltip + + type + integer + value + 10 + + PRIM_BUMP_GRAVEL + + tooltip + + type + integer + value + 11 + + PRIM_BUMP_LARGETILE + + tooltip + + type + integer + value + 14 + + PRIM_BUMP_NONE + + tooltip + + type + integer + value + 0 + + PRIM_BUMP_SHINY + + tooltip + + type + integer + value + 19 + + PRIM_BUMP_SIDING + + tooltip + + type + integer + value + 13 + + PRIM_BUMP_STONE + + tooltip + + type + integer + value + 9 + + PRIM_BUMP_STUCCO + + tooltip + + type + integer + value + 15 + + PRIM_BUMP_SUCTION + + tooltip + + type + integer + value + 16 + + PRIM_BUMP_TILE + + tooltip + + type + integer + value + 8 + + PRIM_BUMP_WEAVE + + tooltip + + type + integer + value + 17 + + PRIM_BUMP_WOOD + + tooltip + + type + integer + value + 3 + + PRIM_CAST_SHADOWS + + deprecated + 1 + tooltip + + type + integer + value + 24 + + PRIM_CLICK_ACTION + + tooltip + + type + integer + value + 43 + + PRIM_COLLISION_SOUND + + tooltip + Collision sound uuid and volume for this prim + type + integer + value + 53 + + PRIM_COLOR + + tooltip + + type + integer + value + 18 + + PRIM_DAMAGE + + tooltip + Damage and damage type assigned to this prim. + type + integer + value + 51 + + PRIM_DESC + + tooltip + + type + integer + value + 28 + + PRIM_FLEXIBLE + + tooltip + + type + integer + value + 21 + + PRIM_FULLBRIGHT + + tooltip + + type + integer + value + 20 + + PRIM_GLOW + + tooltip + PRIM_GLOW is used to get or set the glow status of the face. + type + integer + value + 25 + + PRIM_GLTF_ALPHA_MODE_BLEND + + tooltip + Prim parameter setting for PRIM_GLTF_BASE_COLOR alpha mode "BLEND". + type + integer + value + 1 + + PRIM_GLTF_ALPHA_MODE_MASK + + tooltip + Prim parameter setting for PRIM_GLTF_BASE_COLOR alpha mode "MASK". + type + integer + value + 2 + + PRIM_GLTF_ALPHA_MODE_OPAQUE + + tooltip + Prim parameter setting for PRIM_GLTF_BASE_COLOR alpha mode "OPAQUE". + type + integer + value + 0 + + PRIM_GLTF_BASE_COLOR + + tooltip + Prim parameter for materials using integer face, string texture, vector repeats, vector offsets, float rotation_in_radians, vector color, integer alpha_mode, integer alpha_cutoff, boolean double_sided.\nValid options for alpha_mode are PRIM_ALPHA_MODE_BLEND, _NONE, and _MASK.\nalpha_cutoff is used only for PRIM_ALPHA_MODE_MASK. + type + integer + value + 48 + + PRIM_GLTF_EMISSIVE + + tooltip + Prim parameter for GLTF materials using integer face, string texture, vector repeats, vector offsets, float rotation_in_radians, vector color + type + integer + value + 46 + + PRIM_GLTF_METALLIC_ROUGHNESS + + tooltip + Prim parameter for GLTF materials using integer face, string texture, vector repeats, vector offsets, float rotation_in_radians, float metallic_factor, float roughness_factor + type + integer + value + 47 + + PRIM_GLTF_NORMAL + + tooltip + Prim parameter for GLTF materials using integer face, string texture, vector repeats, vector offsets, float rotation_in_radians + type + integer + value + 45 + + PRIM_HEALTH + + tooltip + Health value for this prim + type + integer + value + 52 + + PRIM_HOLE_CIRCLE + + tooltip + + type + integer + value + 0x10 + + PRIM_HOLE_DEFAULT + + tooltip + + type + integer + value + 0x00 + + PRIM_HOLE_SQUARE + + tooltip + + type + integer + value + 0x20 + + PRIM_HOLE_TRIANGLE + + tooltip + + type + integer + value + 0x30 + + PRIM_LINK_TARGET + + tooltip + + type + integer + value + 34 + + PRIM_MATERIAL + + tooltip + + type + integer + value + 2 + + PRIM_MATERIAL_FLESH + + tooltip + + type + integer + value + 4 + + PRIM_MATERIAL_GLASS + + tooltip + + type + integer + value + 2 + + PRIM_MATERIAL_LIGHT + + tooltip + + type + integer + value + 7 + + PRIM_MATERIAL_METAL + + tooltip + + type + integer + value + 1 + + PRIM_MATERIAL_PLASTIC + + tooltip + + type + integer + value + 5 + + PRIM_MATERIAL_RUBBER + + tooltip + + type + integer + value + 6 + + PRIM_MATERIAL_STONE + + tooltip + + type + integer + value + 0 + + PRIM_MATERIAL_WOOD + + tooltip + + type + integer + value + 3 + + PRIM_MEDIA_ALT_IMAGE_ENABLE + + tooltip + Boolean. Gets/Sets the default image state (the image that the user sees before a piece of media is active) for the chosen face. The default image is specified by Second Life's server for that media type. + type + integer + value + 0 + + PRIM_MEDIA_AUTO_LOOP + + tooltip + Boolean. Gets/Sets whether auto-looping is enabled. + type + integer + value + 4 + + PRIM_MEDIA_AUTO_PLAY + + tooltip + Boolean. Gets/Sets whether the media auto-plays when a Resident can view it. + type + integer + value + 5 + + PRIM_MEDIA_AUTO_SCALE + + tooltip + Boolean. Gets/Sets whether auto-scaling is enabled. Auto-scaling forces the media to the full size of the texture. + type + integer + value + 6 + + PRIM_MEDIA_AUTO_ZOOM + + tooltip + Boolean. Gets/Sets whether clicking the media triggers auto-zoom and auto-focus on the media. + type + integer + value + 7 + + PRIM_MEDIA_CONTROLS + + tooltip + Integer. Gets/Sets the style of controls. Can be either PRIM_MEDIA_CONTROLS_STANDARD or PRIM_MEDIA_CONTROLS_MINI. + type + integer + value + 1 + + PRIM_MEDIA_CONTROLS_MINI + + tooltip + Mini web navigation controls; does not include an address bar. + type + integer + value + 1 + + PRIM_MEDIA_CONTROLS_STANDARD + + tooltip + Standard web navigation controls. + type + integer + value + 0 + + PRIM_MEDIA_CURRENT_URL + + tooltip + String. Gets/Sets the current url displayed on the chosen face. Changing this URL causes navigation. 1024 characters Maximum. + type + integer + value + 2 + + PRIM_MEDIA_FIRST_CLICK_INTERACT + + tooltip + Boolean. Gets/Sets whether the first click interaction is enabled. + type + integer + value + 8 + + PRIM_MEDIA_HEIGHT_PIXELS + + tooltip + Integer. Gets/Sets the height of the media in pixels. + type + integer + value + 10 + + PRIM_MEDIA_HOME_URL + + tooltip + String. Gets/Sets the home URL for the chosen face. 1024 characters maximum. + type + integer + value + 3 + + PRIM_MEDIA_MAX_HEIGHT_PIXELS + + tooltip + + type + integer + value + 2048 + + PRIM_MEDIA_MAX_URL_LENGTH + + tooltip + + type + integer + value + 1024 + + PRIM_MEDIA_MAX_WHITELIST_COUNT + + tooltip + + type + integer + value + 64 + + PRIM_MEDIA_MAX_WHITELIST_SIZE + + tooltip + + type + integer + value + 1024 + + PRIM_MEDIA_MAX_WIDTH_PIXELS + + tooltip + + type + integer + value + 2048 + + PRIM_MEDIA_PARAM_MAX + + tooltip + + type + integer + value + 14 + + PRIM_MEDIA_PERMS_CONTROL + + tooltip + Integer. Gets/Sets the permissions mask that control who can see the media control bar above the object:: PRIM_MEDIA_PERM_ANYONE, PRIM_MEDIA_PERM_GROUP, PRIM_MEDIA_PERM_NONE, PRIM_MEDIA_PERM_OWNER + type + integer + value + 14 + + PRIM_MEDIA_PERMS_INTERACT + + tooltip + Integer. Gets/Sets the permissions mask that control who can interact with the object: PRIM_MEDIA_PERM_ANYONE, PRIM_MEDIA_PERM_GROUP, PRIM_MEDIA_PERM_NONE, PRIM_MEDIA_PERM_OWNER + type + integer + value + 13 + + PRIM_MEDIA_PERM_ANYONE + + tooltip + + type + integer + value + 4 + + PRIM_MEDIA_PERM_GROUP + + tooltip + + type + integer + value + 2 + + PRIM_MEDIA_PERM_NONE + + tooltip + + type + integer + value + 0 + + PRIM_MEDIA_PERM_OWNER + + tooltip + + type + integer + value + 1 + + PRIM_MEDIA_WHITELIST + + tooltip + String. Gets/Sets the white-list as a string of escaped, comma-separated URLs. This string can hold up to 64 URLs or 1024 characters, whichever comes first. + type + integer + value + 12 + + PRIM_MEDIA_WHITELIST_ENABLE + + tooltip + Boolean. Gets/Sets whether navigation is restricted to URLs in PRIM_MEDIA_WHITELIST. + type + integer + value + 11 + + PRIM_MEDIA_WIDTH_PIXELS + + tooltip + Integer. Gets/Sets the width of the media in pixels. + type + integer + value + 9 + + PRIM_NAME + + tooltip + + type + integer + value + 27 + + PRIM_NORMAL + + tooltip + Prim parameter for materials using integer face, string texture, vector repeats, vector offsets, float rotation_in_radians + type + integer + value + 37 + + PRIM_OMEGA + + tooltip + + type + integer + value + 32 + + PRIM_PHANTOM + + tooltip + + type + integer + value + 5 + + PRIM_PHYSICS + + tooltip + + type + integer + value + 3 + + PRIM_PHYSICS_SHAPE_CONVEX + + tooltip + Use the convex hull of the prim shape for physics (this is the default for mesh objects). + type + integer + value + 2 + + PRIM_PHYSICS_SHAPE_NONE + + tooltip + Ignore this prim in the physics shape. NB: This cannot be applied to the root prim. + type + integer + value + 1 + + PRIM_PHYSICS_SHAPE_PRIM + + tooltip + Use the normal prim shape for physics (this is the default for all non-mesh objects). + type + integer + value + 0 + + PRIM_PHYSICS_SHAPE_TYPE + + tooltip + + Allows you to set the physics shape type of a prim via lsl. Permitted values are: + PRIM_PHYSICS_SHAPE_NONE, PRIM_PHYSICS_SHAPE_PRIM, PRIM_PHYSICS_SHAPE_CONVEX + + type + integer + value + 30 + + PRIM_POINT_LIGHT + + tooltip + + type + integer + value + 23 + + PRIM_POSITION + + tooltip + + type + integer + value + 6 + + PRIM_POS_LOCAL + + tooltip + + type + integer + value + 33 + + PRIM_PROJECTOR + + tooltip + + type + integer + value + 42 + + PRIM_REFLECTION_PROBE + + tooltip + Allows you to configure the object as a custom-placed reflection probe, for image-based lighting (IBL). Only objects in the influence volume of the reflection probe object are affected. + type + integer + value + 44 + + PRIM_REFLECTION_PROBE_BOX + + tooltip + This is a flag option used with llGetPrimitiveParams and related functions when the parameter is PRIM_REFLECTION_PROBE. When set, the reflection probe is a box. When unset, the reflection probe is a sphere. + type + integer + value + 1 + + PRIM_REFLECTION_PROBE_DYNAMIC + + tooltip + This is a flag option used with llGetPrimitiveParams and related functions when the parameter is PRIM_REFLECTION_PROBE. When set, the reflection probe includes avatars in IBL effects. When unset, the reflection probe excludes avatars. + type + integer + value + 2 + + PRIM_REFLECTION_PROBE_MIRROR + + tooltip + This is a flag option used with llGetPrimitiveParams and related functions when the parameter is PRIM_REFLECTION_PROBE. When set, the reflection probe acts as a mirror. + type + integer + value + 4 + + PRIM_RENDER_MATERIAL + + tooltip + + type + integer + value + 49 + + PRIM_ROTATION + + tooltip + + type + integer + value + 8 + + PRIM_ROT_LOCAL + + tooltip + + type + integer + value + 29 + + PRIM_SCRIPTED_SIT_ONLY + + tooltip + Prim parameter for restricting manual sitting on this prim.\nSitting must be initiated via call to llSitOnLink. + type + integer + value + 40 + + PRIM_SCULPT_FLAG_ANIMESH + + tooltip + Mesh is animated. + type + integer + value + 32 + + PRIM_SCULPT_FLAG_INVERT + + tooltip + Render inside out (inverts the normals). + type + integer + value + 64 + + PRIM_SCULPT_FLAG_MIRROR + + tooltip + Render an X axis mirror of the sculpty. + type + integer + value + 128 + + PRIM_SCULPT_TYPE_CYLINDER + + tooltip + + type + integer + value + 4 + + PRIM_SCULPT_TYPE_MASK + + tooltip + + type + integer + value + 7 + + PRIM_SCULPT_TYPE_MESH + + tooltip + + type + integer + value + 5 + + PRIM_SCULPT_TYPE_PLANE + + tooltip + + type + integer + value + 3 + + PRIM_SCULPT_TYPE_SPHERE + + tooltip + + type + integer + value + 1 + + PRIM_SCULPT_TYPE_TORUS + + tooltip + + type + integer + value + 2 + + PRIM_SHINY_HIGH + + tooltip + + type + integer + value + 3 + + PRIM_SHINY_LOW + + tooltip + + type + integer + value + 1 + + PRIM_SHINY_MEDIUM + + tooltip + + type + integer + value + 2 + + PRIM_SHINY_NONE + + tooltip + + type + integer + value + 0 + + PRIM_SIT_FLAGS + + tooltip + + type + integer + value + 50 + + PRIM_SIT_TARGET + + tooltip + + type + integer + value + 41 + + PRIM_SIZE + + tooltip + + type + integer + value + 7 + + PRIM_SLICE + + tooltip + + type + integer + value + 35 + + PRIM_SPECULAR + + tooltip + Prim parameter for materials using integer face, string texture, vector repeats, vector offsets, float rotation_in_radians, vector color, integer glossy, integer environment + type + integer + value + 36 + + PRIM_TEMP_ON_REZ + + tooltip + + type + integer + value + 4 + + PRIM_TEXGEN + + tooltip + + type + integer + value + 22 + + PRIM_TEXGEN_DEFAULT + + tooltip + + type + integer + value + 0 + + PRIM_TEXGEN_PLANAR + + tooltip + + type + integer + value + 1 + + PRIM_TEXT + + tooltip + + type + integer + value + 26 + + PRIM_TEXTURE + + tooltip + + type + integer + value + 17 + + PRIM_TYPE + + tooltip + + type + integer + value + 9 + + PRIM_TYPE_BOX + + tooltip + + type + integer + value + 0 + + PRIM_TYPE_CYLINDER + + tooltip + + type + integer + value + 1 + + PRIM_TYPE_PRISM + + tooltip + + type + integer + value + 2 + + PRIM_TYPE_RING + + tooltip + + type + integer + value + 6 + + PRIM_TYPE_SCULPT + + tooltip + + type + integer + value + 7 + + PRIM_TYPE_SPHERE + + tooltip + + type + integer + value + 3 + + PRIM_TYPE_TORUS + + tooltip + + type + integer + value + 4 + + PRIM_TYPE_TUBE + + tooltip + + type + integer + value + 5 + + PROFILE_NONE + + tooltip + Disables profiling + type + integer + value + 0 + + PROFILE_SCRIPT_MEMORY + + tooltip + Enables memory profiling + type + integer + value + 1 + + PSYS_PART_BF_DEST_COLOR + + tooltip + + type + integer + value + 2 + + PSYS_PART_BF_ONE + + tooltip + + type + integer + value + 0 + + PSYS_PART_BF_ONE_MINUS_DEST_COLOR + + tooltip + + type + integer + value + 4 + + PSYS_PART_BF_ONE_MINUS_SOURCE_ALPHA + + tooltip + + type + integer + value + 9 + + PSYS_PART_BF_ONE_MINUS_SOURCE_COLOR + + tooltip + + type + integer + value + 5 + + PSYS_PART_BF_SOURCE_ALPHA + + tooltip + + type + integer + value + 7 + + PSYS_PART_BF_SOURCE_COLOR + + tooltip + + type + integer + value + 3 + + PSYS_PART_BF_ZERO + + tooltip + + type + integer + value + 1 + + PSYS_PART_BLEND_FUNC_DEST + + tooltip + + type + integer + value + 25 + + PSYS_PART_BLEND_FUNC_SOURCE + + tooltip + + type + integer + value + 24 + + PSYS_PART_BOUNCE_MASK + + tooltip + Particles bounce off of a plane at the objects Z height. + type + integer + value + 0x4 + + PSYS_PART_EMISSIVE_MASK + + tooltip + The particle glows. + type + integer + value + 0x100 + + PSYS_PART_END_ALPHA + + tooltip + A float which determines the ending alpha of the object. + type + integer + value + 4 + + PSYS_PART_END_COLOR + + tooltip + A vector <r, g, b> which determines the ending color of the object. + type + integer + value + 3 + + PSYS_PART_END_GLOW + + tooltip + + type + integer + value + 27 + + PSYS_PART_END_SCALE + + tooltip + A vector <sx, sy, z>, which is the ending size of the particle billboard in meters (z is ignored). + type + integer + value + 6 + + PSYS_PART_FLAGS + + tooltip + Each particle that is emitted by the particle system is simulated based on the following flags. To use multiple flags, bitwise or (|) them together. + type + integer + value + 0 + + PSYS_PART_FOLLOW_SRC_MASK + + tooltip + The particle position is relative to the source objects position. + type + integer + value + 0x10 + + PSYS_PART_FOLLOW_VELOCITY_MASK + + tooltip + The particle orientation is rotated so the vertical axis faces towards the particle velocity. + type + integer + value + 0x20 + + PSYS_PART_INTERP_COLOR_MASK + + tooltip + Interpolate both the color and alpha from the start value to the end value. + type + integer + value + 0x1 + + PSYS_PART_INTERP_SCALE_MASK + + tooltip + Interpolate the particle scale from the start value to the end value. + type + integer + value + 0x2 + + PSYS_PART_MAX_AGE + + tooltip + Age in seconds of a particle at which it dies. + type + integer + value + 7 + + PSYS_PART_RIBBON_MASK + + tooltip + + type + integer + value + 0x400 + + PSYS_PART_START_ALPHA + + tooltip + A float which determines the starting alpha of the object. + type + integer + value + 2 + + PSYS_PART_START_COLOR + + tooltip + A vector <r.r, g.g, b.b> which determines the starting color of the object. + type + integer + value + 1 + + PSYS_PART_START_GLOW + + tooltip + + type + integer + value + 26 + + PSYS_PART_START_SCALE + + tooltip + A vector <sx, sy, z>, which is the starting size of the particle billboard in meters (z is ignored). + type + integer + value + 5 + + PSYS_PART_TARGET_LINEAR_MASK + + tooltip + + type + integer + value + 0x80 + + PSYS_PART_TARGET_POS_MASK + + tooltip + The particle heads towards the location of the target object as defined by PSYS_SRC_TARGET_KEY. + type + integer + value + 0x40 + + PSYS_PART_WIND_MASK + + tooltip + Particles have their velocity damped towards the wind velocity. + type + integer + value + 0x8 + + PSYS_SRC_ACCEL + + tooltip + A vector <x, y, z> which is the acceleration to apply on particles. + type + integer + value + 8 + + PSYS_SRC_ANGLE_BEGIN + + tooltip + Area in radians specifying where particles will NOT be created (for ANGLE patterns) + type + integer + value + 22 + + PSYS_SRC_ANGLE_END + + tooltip + Area in radians filled with particles (for ANGLE patterns) (if lower than PSYS_SRC_ANGLE_BEGIN, acts as PSYS_SRC_ANGLE_BEGIN itself, and PSYS_SRC_ANGLE_BEGIN acts as PSYS_SRC_ANGLE_END). + type + integer + value + 23 + + PSYS_SRC_BURST_PART_COUNT + + tooltip + How many particles to release in a burst. + type + integer + value + 15 + + PSYS_SRC_BURST_RADIUS + + tooltip + What distance from the center of the object to create the particles. + type + integer + value + 16 + + PSYS_SRC_BURST_RATE + + tooltip + How often to release a particle burst (float seconds). + type + integer + value + 13 + + PSYS_SRC_BURST_SPEED_MAX + + tooltip + Maximum speed that a particle should be moving. + type + integer + value + 18 + + PSYS_SRC_BURST_SPEED_MIN + + tooltip + Minimum speed that a particle should be moving. + type + integer + value + 17 + + PSYS_SRC_INNERANGLE + + tooltip + + Specifies the inner angle of the arc created by the PSYS_SRC_PATTERN_ANGLE or PSYS_SRC_PATTERN_ANGLE_CONE source pattern. + The area specified will NOT have particles in it. + + type + integer + value + 10 + + PSYS_SRC_MAX_AGE + + tooltip + How long this particle system should last, 0.0 means forever. + type + integer + value + 19 + + PSYS_SRC_OMEGA + + tooltip + Sets the angular velocity to rotate the axis that SRC_PATTERN_ANGLE and SRC_PATTERN_ANGLE_CONE use. + type + integer + value + 21 + + PSYS_SRC_OUTERANGLE + + tooltip + + Specifies the outer angle of the arc created by the PSYS_SRC_PATTERN_ANGLE or PSYS_SRC_PATTERN_ANGLE_CONE source pattern. + The area between the outer and inner angle will be filled with particles. + + type + integer + value + 11 + + PSYS_SRC_PATTERN + + tooltip + + The pattern which is used to generate particles. + Use one of the following values: PSYS_SRC_PATTERN Values. + + type + integer + value + 9 + + PSYS_SRC_PATTERN_ANGLE + + tooltip + Shoot particles across a 2 dimensional area defined by the arc created from PSYS_SRC_OUTERANGLE. There will be an open area defined by PSYS_SRC_INNERANGLE within the larger arc. + type + integer + value + 0x04 + + PSYS_SRC_PATTERN_ANGLE_CONE + + tooltip + Shoot particles out in a 3 dimensional cone with an outer arc of PSYS_SRC_OUTERANGLE and an inner open area defined by PSYS_SRC_INNERANGLE. + type + integer + value + 0x08 + + PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY + + tooltip + + type + integer + value + 0x10 + + PSYS_SRC_PATTERN_DROP + + tooltip + Drop particles at the source position. + type + integer + value + 0x01 + + PSYS_SRC_PATTERN_EXPLODE + + tooltip + Shoot particles out in all directions, using the burst parameters. + type + integer + value + 0x02 + + PSYS_SRC_TARGET_KEY + + tooltip + The key of a target object to move towards if PSYS_PART_TARGET_POS_MASK is enabled. + type + integer + value + 20 + + PSYS_SRC_TEXTURE + + tooltip + An asset name for the texture to use for the particles. + type + integer + value + 12 + + PUBLIC_CHANNEL + + tooltip + PUBLIC_CHANNEL is an integer constant that, when passed to llSay, llWhisper, or llShout as a channel parameter, will print text to the publicly heard chat channel. + type + integer + value + 0 + + PURSUIT_FUZZ_FACTOR + + tooltip + Selects a random destination near the offset. + type + integer + value + 3 + + PURSUIT_GOAL_TOLERANCE + + tooltip + + type + integer + value + 5 + + PURSUIT_INTERCEPT + + tooltip + Define whether the character attempts to predict the target's location. + type + integer + value + 4 + + PURSUIT_OFFSET + + tooltip + Go to a position offset from the target. + type + integer + value + 1 + + PU_EVADE_HIDDEN + + tooltip + Triggered when an llEvade character thinks it has hidden from its pursuer. + type + integer + value + 0x07 + + PU_EVADE_SPOTTED + + tooltip + Triggered when an llEvade character switches from hiding to running + type + integer + value + 0x08 + + PU_FAILURE_DYNAMIC_PATHFINDING_DISABLED + + tooltip + + type + integer + value + 10 + + PU_FAILURE_INVALID_GOAL + + tooltip + Goal is not on the navigation-mesh and cannot be reached. + type + integer + value + 0x03 + + PU_FAILURE_INVALID_START + + tooltip + Character cannot navigate from the current location - e.g., the character is off the navmesh or too high above it. + type + integer + value + 0x02 + + PU_FAILURE_NO_NAVMESH + + tooltip + This is a fatal error reported to a character when there is no navmesh for the region. This usually indicates a server failure and users should file a bug report and include the time and region in which they received this message. + type + integer + value + 0x09 + + PU_FAILURE_NO_VALID_DESTINATION + + tooltip + There is no good place for the character to go - e.g., it is patrolling and all the patrol points are now unreachable. + type + integer + value + 0x06 + + PU_FAILURE_OTHER + + tooltip + + type + integer + value + 1000000 + + PU_FAILURE_PARCEL_UNREACHABLE + + tooltip + + type + integer + value + 11 + + PU_FAILURE_TARGET_GONE + + tooltip + Target (for llPursue or llEvade) can no longer be tracked - e.g., it left the region or is an avatar that is now more than about 30m outside the region. + type + integer + value + 0x05 + + PU_FAILURE_UNREACHABLE + + tooltip + Goal is no longer reachable for some reason - e.g., an obstacle blocks the path. + type + integer + value + 0x04 + + PU_GOAL_REACHED + + tooltip + Character has reached the goal and will stop or choose a new goal (if wandering). + type + integer + value + 0x01 + + PU_SLOWDOWN_DISTANCE_REACHED + + tooltip + Character is near current goal. + type + integer + value + 0x00 + + RAD_TO_DEG + + tooltip + 57.2957795 - Number of degrees per radian. You can use this number to convert radians to degrees by multiplying the radians by this number. + type + float + value + 57.2957795 + + RCERR_CAST_TIME_EXCEEDED + + tooltip + + type + integer + value + -3 + + RCERR_SIM_PERF_LOW + + tooltip + + type + integer + value + -2 + + RCERR_UNKNOWN + + tooltip + + type + integer + value + -1 + + RC_DATA_FLAGS + + tooltip + + type + integer + value + 2 + + RC_DETECT_PHANTOM + + tooltip + + type + integer + value + 1 + + RC_GET_LINK_NUM + + tooltip + + type + integer + value + 4 + + RC_GET_NORMAL + + tooltip + + type + integer + value + 1 + + RC_GET_ROOT_KEY + + tooltip + + type + integer + value + 2 + + RC_MAX_HITS + + tooltip + + type + integer + value + 3 + + RC_REJECT_AGENTS + + tooltip + + type + integer + value + 1 + + RC_REJECT_LAND + + tooltip + + type + integer + value + 8 + + RC_REJECT_NONPHYSICAL + + tooltip + + type + integer + value + 4 + + RC_REJECT_PHYSICAL + + tooltip + + type + integer + value + 2 + + RC_REJECT_TYPES + + tooltip + + type + integer + value + 0 + + REGION_FLAG_ALLOW_DAMAGE + + tooltip + + type + integer + value + 0x1 + + REGION_FLAG_ALLOW_DIRECT_TELEPORT + + tooltip + + type + integer + value + 0x100000 + + REGION_FLAG_BLOCK_FLY + + tooltip + + type + integer + value + 0x80000 + + REGION_FLAG_BLOCK_FLYOVER + + tooltip + + type + integer + value + 0x8000000 + + REGION_FLAG_BLOCK_TERRAFORM + + tooltip + + type + integer + value + 0x40 + + REGION_FLAG_DISABLE_COLLISIONS + + tooltip + + type + integer + value + 0x1000 + + REGION_FLAG_DISABLE_PHYSICS + + tooltip + + type + integer + value + 0x4000 + + REGION_FLAG_FIXED_SUN + + tooltip + + type + integer + value + 0x10 + + REGION_FLAG_RESTRICT_PUSHOBJECT + + tooltip + + type + integer + value + 0x400000 + + REGION_FLAG_SANDBOX + + tooltip + + type + integer + value + 0x100 + + REMOTE_DATA_CHANNEL + + tooltip + + type + integer + value + 1 + + REMOTE_DATA_REPLY + + tooltip + + type + integer + value + 3 + + REMOTE_DATA_REQUEST + + tooltip + + type + integer + value + 2 + + REQUIRE_LINE_OF_SIGHT + + tooltip + Define whether the character needs a line-of-sight to give chase. + type + integer + value + 2 + + RESTITUTION + + tooltip + Used with llSetPhysicsMaterial to enable the density value. Must be between 0.0 and 1.0 + type + integer + value + 4 + + REVERSE + + tooltip + Play animation in reverse direction. + type + integer + value + 0x4 + + REZ_ACCEL + + tooltip + Acceleration forced applied to the rezzed object. [vector force, integer rel] + type + integer + value + 5 + + REZ_DAMAGE + + tooltip + Damage applied by the object when it collides with an agent. [float damage] + type + integer + value + 8 + + REZ_DAMAGE_TYPE + + tooltip + Set the damage type applied when this object collides. + type + integer + value + 12 + + REZ_FLAGS + + tooltip + Rez flags to set on the newly rezzed object. [integer flags] + type + integer + value + 1 + + REZ_FLAG_BLOCK_GRAB_OBJECT + + tooltip + Prevent grabbing the object. + type + integer + value + 0x0080 + + REZ_FLAG_DIE_ON_COLLIDE + + tooltip + Object will die after its first collision. + type + integer + value + 0x0008 + + REZ_FLAG_DIE_ON_NOENTRY + + tooltip + Object will die if it attempts to enter a parcel that it can not. + type + integer + value + 0x0010 + + REZ_FLAG_NO_COLLIDE_FAMILY + + tooltip + Object will not trigger collision events with other objects created by the same rezzer. + type + integer + value + 0x0040 + + REZ_FLAG_NO_COLLIDE_OWNER + + tooltip + Object will not trigger collision events with its owner. + type + integer + value + 0x0020 + + REZ_FLAG_PHANTOM + + tooltip + Make the object phantom on rez. + type + integer + value + 0x0004 + + REZ_FLAG_PHYSICAL + + tooltip + Make the object physical on rez. + type + integer + value + 0x0002 + + REZ_FLAG_TEMP + + tooltip + Flag the object as temp on rez. + type + integer + value + 0x0001 + + REZ_LOCK_AXES + + tooltip + Prevent the object from rotating around some axes. [vector locks] + type + integer + value + 11 + + REZ_OMEGA + + tooltip + Omega applied to the rezzed object. [vector axis, integer rel, float spin, float gain] + type + integer + value + 7 + + REZ_PARAM + + tooltip + Integer value to pass to the object as its rez parameter. [integer param] + type + integer + value + 0 + + REZ_PARAM_STRING + + tooltip + A string value to pass to the object as its rez parameter. [string param] + type + integer + value + 13 + + REZ_POS + + tooltip + Position at which to rez the new object. [vector position, integer rel, integer atroot] + type + integer + value + 2 + + REZ_ROT + + tooltip + Rotation applied to newly rezzed object. [rotation rot, integer rel] + type + integer + value + 3 + + REZ_SOUND + + tooltip + Sound attached to the rezzed object. [string name, float volume, integer loop] + type + integer + value + 9 + + REZ_SOUND_COLLIDE + + tooltip + Sound played by the object on a collision. [string name, float volume] + type + integer + value + 10 + + REZ_VEL + + tooltip + Initial velocity of rezzed object. [vector vel, integer rel, integer inherit] + type + integer + value + 4 + + ROTATE + + tooltip + Animate texture rotation. + type + integer + value + 0x20 + + SCALE + + tooltip + Animate the texture scale. + type + integer + value + 0x40 + + SCRIPTED + + tooltip + Scripted in-world objects. + type + integer + value + 0x8 + + SIM_STAT_ACTIVE_SCRIPT_COUNT + + tooltip + Number of active scripts. + type + integer + value + 12 + + SIM_STAT_AGENT_COUNT + + tooltip + Number of agents in region. + type + integer + value + 10 + + SIM_STAT_AGENT_MS + + tooltip + Time spent in 'agent' segment of simulation frame. + type + integer + value + 7 + + SIM_STAT_AGENT_UPDATES + + tooltip + Agent updates per second. + type + integer + value + 2 + + SIM_STAT_AI_MS + + tooltip + Time spent on AI step. + type + integer + value + 26 + + SIM_STAT_ASSET_DOWNLOADS + + tooltip + Pending asset download count. + type + integer + value + 15 + + SIM_STAT_ASSET_UPLOADS + + tooltip + Pending asset upload count. + type + integer + value + 16 + + SIM_STAT_CHILD_AGENT_COUNT + + tooltip + Number of child agents in region. + type + integer + value + 11 + + SIM_STAT_FRAME_MS + + tooltip + Total frame time. + type + integer + value + 3 + + SIM_STAT_IMAGE_MS + + tooltip + Time spent in 'image' segment of simulation frame. + type + integer + value + 8 + + SIM_STAT_IO_PUMP_MS + + tooltip + Pump IO time. + type + integer + value + 24 + + SIM_STAT_NET_MS + + tooltip + Time spent in 'network' segment of simulation frame. + type + integer + value + 4 + + SIM_STAT_OTHER_MS + + tooltip + Time spent in 'other' segment of simulation frame. + type + integer + value + 5 + + SIM_STAT_PACKETS_IN + + tooltip + Packets in per second. + type + integer + value + 13 + + SIM_STAT_PACKETS_OUT + + tooltip + Packets out per second. + type + integer + value + 14 + + SIM_STAT_PCT_CHARS_STEPPED + + tooltip + Returns the % of pathfinding characters skipped each frame, averaged over the last minute.\nThe returned value corresponds to the "Characters Updated" stat in the viewer's Statistics Bar. + type + integer + value + 0 + + SIM_STAT_PHYSICS_FPS + + tooltip + Physics simulation FPS. + type + integer + value + 1 + + SIM_STAT_PHYSICS_MS + + tooltip + Time spent in 'physics' segment of simulation frame. + type + integer + value + 6 + + SIM_STAT_PHYSICS_OTHER_MS + + tooltip + Physics other time. + type + integer + value + 20 + + SIM_STAT_PHYSICS_SHAPE_MS + + tooltip + Physics shape update time. + type + integer + value + 19 + + SIM_STAT_PHYSICS_STEP_MS + + tooltip + Physics step time. + type + integer + value + 18 + + SIM_STAT_SCRIPT_EPS + + tooltip + Script events per second. + type + integer + value + 21 + + SIM_STAT_SCRIPT_MS + + tooltip + Time spent in 'script' segment of simulation frame. + type + integer + value + 9 + + SIM_STAT_SCRIPT_RUN_PCT + + tooltip + Percent of scripts run during frame. + type + integer + value + 25 + + SIM_STAT_SLEEP_MS + + tooltip + Time spent sleeping. + type + integer + value + 23 + + SIM_STAT_SPARE_MS + + tooltip + Spare time left after frame. + type + integer + value + 22 + + SIM_STAT_UNACKED_BYTES + + tooltip + Total unacknowledged bytes. + type + integer + value + 17 + + SIT_FLAG_ALLOW_UNSIT + + tooltip + The prim allows a seated avatar to stand up. + type + integer + value + 0x0002 + + SIT_FLAG_NO_COLLIDE + + tooltip + The seated avatar's hit box is disabled when seated on this prim. + type + integer + value + 0x0010 + + SIT_FLAG_NO_DAMAGE + + tooltip + Damage will not be forwarded to an avatar seated on this prim. + type + integer + value + 0x0020 + + SIT_FLAG_SCRIPTED_ONLY + + tooltip + An avatar may not manually sit on this prim. + type + integer + value + 0x0004 + + SIT_FLAG_SIT_TARGET + + tooltip + The prim has an explicitly set sit target. + type + integer + value + 0x0001 + + SIT_INVALID_AGENT + + tooltip + Avatar ID did not specify a valid avatar. + type + integer + value + -4 + + SIT_INVALID_LINK + + tooltip + Link ID did not specify a valid prim in the linkset or resolved to multiple prims. + type + integer + value + -5 + + SIT_INVALID_OBJECT + + tooltip + Attempt to force an avatar to sit on an attachment or other invalid target. + type + integer + value + -7 + + SIT_NOT_EXPERIENCE + + tooltip + Attempt to force an avatar to sit outside an experience. + type + integer + value + -1 + + SIT_NO_ACCESS + + tooltip + Avatar does not have access to the parcel containing the target linkset of the forced sit. + type + integer + value + -6 + + SIT_NO_EXPERIENCE_PERMISSION + + tooltip + Avatar has not granted permission to force sits. + type + integer + value + -2 + + SIT_NO_SIT_TARGET + + tooltip + No available sit target in linkset for forced sit. + type + integer + value + -3 + + SKY_AMBIENT + + tooltip + The ambient color of the environment + type + integer + value + 0 + + SKY_BLUE + + tooltip + Blue settings for environment + type + integer + value + 22 + + SKY_CLOUDS + + tooltip + Settings controlling cloud density and configuration + type + integer + value + 2 + + SKY_CLOUD_TEXTURE + + tooltip + Texture ID used by clouds + type + integer + value + 19 + + SKY_DOME + + tooltip + Sky dome information. + type + integer + value + 4 + + SKY_GAMMA + + tooltip + The gamma value applied to the scene. + type + integer + value + 5 + + SKY_GLOW + + tooltip + Glow color applied to the sun and moon. + type + integer + value + 6 + + SKY_HAZE + + tooltip + Haze settings for environment + type + integer + value + 23 + + SKY_LIGHT + + tooltip + Miscellaneous lighting values. + type + integer + value + 8 + + SKY_MOON + + tooltip + Environmental moon details. + type + integer + value + 9 + + SKY_MOON_TEXTURE + + tooltip + Environmental moon texture. + type + integer + value + 20 + + SKY_PLANET + + tooltip + Planet information used in rendering the sky. + type + integer + value + 10 + + SKY_REFLECTION_PROBE_AMBIANCE + + tooltip + Settings the ambience of the reflection probe. + type + integer + value + 24 + + SKY_REFRACTION + + tooltip + Sky refraction parameters for rainbows and optical effects. + type + integer + value + 11 + + SKY_STAR_BRIGHTNESS + + tooltip + Brightness value for the stars. + type + integer + value + 13 + + SKY_SUN + + tooltip + Detailed sun information + type + integer + value + 14 + + SKY_SUN_TEXTURE + + tooltip + Environmental sun texture + type + integer + value + 21 + + SKY_TEXTURE_DEFAULTS + + tooltip + Is the environment using the default textures. + type + integer + value + 1 + + SKY_TRACKS + + tooltip + Track elevations for this region. + type + integer + value + 15 + + SMOOTH + + tooltip + Slide in the X direction, instead of playing separate frames. + type + integer + value + 0x10 + + SOUND_LOOP + + tooltip + Sound will loop until stopped. + type + integer + value + 0x01 + + SOUND_PLAY + + tooltip + Sound will play normally. + type + integer + value + 0x00 + + SOUND_SYNC + + tooltip + Sound will be synchronized with the nearest master. + type + integer + value + 0x04 + + SOUND_TRIGGER + + tooltip + Sound will be triggered at the prim's location and not attached. + type + integer + value + 0x02 + + SQRT2 + + tooltip + 1.41421356 - The square root of 2. + type + float + value + 1.41421356 + + STATUS_BLOCK_GRAB + + tooltip + Controls whether the object can be grabbed.\nA grab is the default action when in third person, and is available as the hand tool in build mode. This is useful for physical objects that you don't want other people to be able to trivially disturb. The default is FALSE + type + integer + value + 0x40 + + STATUS_BLOCK_GRAB_OBJECT + + tooltip + Prevent click-and-drag movement on all prims in the object. + type + integer + value + 0x400 + + STATUS_BOUNDS_ERROR + + tooltip + Argument(s) passed to function had a bounds error. + type + integer + value + 1002 + + STATUS_CAST_SHADOWS + + tooltip + + type + integer + value + 0x200 + + STATUS_DIE_AT_EDGE + + tooltip + Controls whether the object is returned to the owners inventory if it wanders off the edge of the world.\nIt is useful to set this status TRUE for things like bullets or rockets. The default is TRUE + type + integer + value + 0x80 + + STATUS_DIE_AT_NO_ENTRY + + tooltip + Controls whether the object dies if it attempts to enter a parcel that does not allow object entry or does not have enough capacity.\nIt is useful to set this status TRUE for things like bullets or rockets. The default is FALSE + type + integer + value + 0x800 + + STATUS_INTERNAL_ERROR + + tooltip + An internal error occurred. + type + integer + value + 1999 + + STATUS_MALFORMED_PARAMS + + tooltip + Function was called with malformed parameters. + type + integer + value + 1000 + + STATUS_NOT_FOUND + + tooltip + Object or other item was not found. + type + integer + value + 1003 + + STATUS_NOT_SUPPORTED + + tooltip + Feature not supported. + type + integer + value + 1004 + + STATUS_OK + + tooltip + Result of function call was a success. + type + integer + value + 0 + + STATUS_PHANTOM + + tooltip + Controls/indicates whether the object collides or not.\nSetting the value to TRUE makes the object non-colliding with all objects. It is a good idea to use this for most objects that move or rotate, but are non-physical. It is also useful for simulating volumetric lighting. The default is FALSE. + type + integer + value + 0x10 + + STATUS_PHYSICS + + tooltip + Controls/indicates whether the object moves physically.\nThis controls the same flag that the UI check-box for Physical controls. The default is FALSE. + type + integer + value + 0x1 + + STATUS_RETURN_AT_EDGE + + tooltip + + type + integer + value + 0x100 + + STATUS_ROTATE_X + + tooltip + + type + integer + value + 0x2 + + STATUS_ROTATE_Y + + tooltip + + type + integer + value + 0x4 + + STATUS_ROTATE_Z + + tooltip + + Controls/indicates whether the object can physically rotate around + the specific axis or not. This flag has no meaning + for non-physical objects. Set the value to FALSE + if you want to disable rotation around that axis. The + default is TRUE for a physical object. + A useful example to think about when visualizing + the effect is a sit-and-spin device. They spin around the + Z axis (up) but not around the X or Y axis. + + type + integer + value + 0x8 + + STATUS_SANDBOX + + tooltip + + Controls/indicates whether the object can cross region boundaries + and move more than 20 meters from its creation + point. The default if FALSE. + + type + integer + value + 0x20 + + STATUS_TYPE_MISMATCH + + tooltip + Argument(s) passed to function had a type mismatch. + type + integer + value + 1001 + + STATUS_WHITELIST_FAILED + + tooltip + Whitelist Failed. + type + integer + value + 2001 + + STRING_TRIM + + tooltip + + type + integer + value + 0x03 + + STRING_TRIM_HEAD + + tooltip + + type + integer + value + 0x01 + + STRING_TRIM_TAIL + + tooltip + + type + integer + value + 0x02 + + TARGETED_EMAIL_OBJECT_OWNER + + tooltip + Send email to the owner of the object + type + integer + value + 0x02 + + TARGETED_EMAIL_ROOT_CREATOR + + tooltip + Send email to the creator of the root object + type + integer + value + 0x01 + + TERRAIN_DETAIL_1 + + tooltip + + type + integer + value + 0 + + TERRAIN_DETAIL_2 + + tooltip + + type + integer + value + 1 + + TERRAIN_DETAIL_3 + + tooltip + + type + integer + value + 2 + + TERRAIN_DETAIL_4 + + tooltip + + type + integer + value + 3 + + TERRAIN_HEIGHT_RANGE_NE + + tooltip + + type + integer + value + 7 + + TERRAIN_HEIGHT_RANGE_NW + + tooltip + + type + integer + value + 6 + + TERRAIN_HEIGHT_RANGE_SE + + tooltip + + type + integer + value + 5 + + TERRAIN_HEIGHT_RANGE_SW + + tooltip + + type + integer + value + 4 + + TERRAIN_PBR_OFFSET_1 + + tooltip + + type + integer + value + 16 + + TERRAIN_PBR_OFFSET_2 + + tooltip + + type + integer + value + 17 + + TERRAIN_PBR_OFFSET_3 + + tooltip + + type + integer + value + 18 + + TERRAIN_PBR_OFFSET_4 + + tooltip + + type + integer + value + 19 + + TERRAIN_PBR_ROTATION_1 + + tooltip + + type + integer + value + 12 + + TERRAIN_PBR_ROTATION_2 + + tooltip + + type + integer + value + 13 + + TERRAIN_PBR_ROTATION_3 + + tooltip + + type + integer + value + 14 + + TERRAIN_PBR_ROTATION_4 + + tooltip + + type + integer + value + 15 + + TERRAIN_PBR_SCALE_1 + + tooltip + + type + integer + value + 8 + + TERRAIN_PBR_SCALE_2 + + tooltip + + type + integer + value + 9 + + TERRAIN_PBR_SCALE_3 + + tooltip + + type + integer + value + 10 + + TERRAIN_PBR_SCALE_4 + + tooltip + + type + integer + value + 11 + + TEXTURE_BLANK + + tooltip + + type + string + value + 5748decc-f629-461c-9a36-a35a221fe21f + + TEXTURE_DEFAULT + + tooltip + + type + string + value + 89556747-24cb-43ed-920b-47caed15465f + + TEXTURE_MEDIA + + tooltip + + type + string + value + 8b5fec65-8d8d-9dc5-cda8-8fdf2716e361 + + TEXTURE_PLYWOOD + + tooltip + + type + string + value + 89556747-24cb-43ed-920b-47caed15465f + + TEXTURE_TRANSPARENT + + tooltip + + type + string + value + 8dcd4a48-2d37-4909-9f78-f7a9eb4ef903 + + TOUCH_INVALID_FACE + + tooltip + + type + integer + value + -1 + + TOUCH_INVALID_TEXCOORD + + tooltip + + type + vector + value + <-1.0, -1.0, 0.0> + + TOUCH_INVALID_VECTOR + + tooltip + + type + vector + value + <0.0, 0.0, 0.0> + + TP_ROUTING_BLOCKED + + tooltip + Direct teleporting is blocked on this parcel. + type + integer + value + 0 + + TP_ROUTING_FREE + + tooltip + Teleports are unrestricted on this parcel. + type + integer + value + 2 + + TP_ROUTING_LANDINGP + + tooltip + Teleports are routed to a landing point if set on this parcel. + type + integer + value + 1 + + TRANSFER_BAD_OPTS + + tooltip + Invalid inventory options. + type + integer + value + -1 + + TRANSFER_BAD_ROOT + + tooltip + The root path specified in TRANSFER_DEST contained an invalid directory or was reduced to nothing. + type + integer + value + -5 + + TRANSFER_DEST + + tooltip + The root folder to transfer inventory into. + type + integer + value + 0 + + TRANSFER_FLAGS + + tooltip + Flags to control the behavior of inventory transfer. + type + integer + value + 1 + + TRANSFER_FLAG_COPY + + tooltip + Gives a copy of the object being transfered. Implies TRANSFER_FLAG_TAKE. + type + integer + value + 0x0004 + + TRANSFER_FLAG_RESERVED + + tooltip + Reserved for future expansion. + type + integer + value + 0x0001 + + TRANSFER_FLAG_TAKE + + tooltip + On a successful transfer, automatically takes the object into inventory. + type + integer + value + 0x0002 + + TRANSFER_NO_ATTACHMENT + + tooltip + Can not transfer ownership of an attached object. + type + integer + value + -7 + + TRANSFER_NO_ITEMS + + tooltip + No items in the inventory list are eligible for transfer. + type + integer + value + -4 + + TRANSFER_NO_PERMS + + tooltip + The object does not have transfer permissions. + type + integer + value + -6 + + TRANSFER_NO_TARGET + + tooltip + Could not find the receiver in the current region. + type + integer + value + -2 + + TRANSFER_OK + + tooltip + Inventory transfer offer was successfully made. + type + integer + value + 0 + + TRANSFER_THROTTLE + + tooltip + Inventory throttle hit. + type + integer + value + -3 + + TRAVERSAL_TYPE + + tooltip + One of TRAVERSAL_TYPE_FAST, TRAVERSAL_TYPE_SLOW, and TRAVERSAL_TYPE_NONE. + type + integer + value + 7 + + TRAVERSAL_TYPE_FAST + + tooltip + + type + integer + value + 1 + + TRAVERSAL_TYPE_NONE + + tooltip + + type + integer + value + 2 + + TRAVERSAL_TYPE_SLOW + + tooltip + + type + integer + value + 0 + + TRUE + + tooltip + An integer constant for boolean comparisons. Has the value '1'. + type + integer + value + 1 + + TWO_PI + + tooltip + 6.28318530 - The radians of a circle. + type + float + value + 6.28318530 + + TYPE_FLOAT + + tooltip + The list entry is a float. + type + integer + value + 2 + + TYPE_INTEGER + + tooltip + The list entry is an integer. + type + integer + value + 1 + + TYPE_INVALID + + tooltip + The list entry is invalid. + type + integer + value + 0 + + TYPE_KEY + + tooltip + The list entry is a key. + type + integer + value + 4 + + TYPE_ROTATION + + tooltip + The list entry is a rotation. + type + integer + value + 6 + + TYPE_STRING + + tooltip + The list entry is a string. + type + integer + value + 3 + + TYPE_VECTOR + + tooltip + The list entry is a vector. + type + integer + value + 5 + + URL_REQUEST_DENIED + + tooltip + + type + string + value + URL_REQUEST_DENIED + + URL_REQUEST_GRANTED + + tooltip + + type + string + value + URL_REQUEST_GRANTED + + VEHICLE_ANGULAR_DEFLECTION_EFFICIENCY + + tooltip + A slider between minimum (0.0) and maximum (1.0) deflection of angular orientation. That is, its a simple scalar for modulating the strength of angular deflection such that the vehicles preferred axis of motion points toward its real velocity. + type + integer + value + 32 + + VEHICLE_ANGULAR_DEFLECTION_TIMESCALE + + tooltip + The time-scale for exponential success of linear deflection deflection. Its another way to specify the strength of the vehicles tendency to reorient itself so that its preferred axis of motion agrees with its true velocity. + type + integer + value + 33 + + VEHICLE_ANGULAR_FRICTION_TIMESCALE + + tooltip + + A vector of timescales for exponential decay of the vehicles angular velocity about its preferred axes of motion (at, left, up). + Range = [0.07, inf) seconds for each element of the vector. + + type + integer + value + 17 + + VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE + + tooltip + The timescale for exponential decay of the angular motors magnitude. + type + integer + value + 35 + + VEHICLE_ANGULAR_MOTOR_DIRECTION + + tooltip + The direction and magnitude (in preferred frame) of the vehicles angular motor.The vehicle will accelerate (or decelerate if necessary) to match its velocity to its motor. + type + integer + value + 19 + + VEHICLE_ANGULAR_MOTOR_TIMESCALE + + tooltip + The timescale for exponential approach to full angular motor velocity. + type + integer + value + 34 + + VEHICLE_BANKING_EFFICIENCY + + tooltip + A slider between anti (-1.0), none (0.0), and maxmum (1.0) banking strength. + type + integer + value + 38 + + VEHICLE_BANKING_MIX + + tooltip + A slider between static (0.0) and dynamic (1.0) banking. "Static" means the banking scales only with the angle of roll, whereas "dynamic" is a term that also scales with the vehicles linear speed. + type + integer + value + 39 + + VEHICLE_BANKING_TIMESCALE + + tooltip + The timescale for banking to exponentially approach its maximum effect. This is another way to scale the strength of the banking effect, however it affects the term that is proportional to the difference between what the banking behavior is trying to do, and what the vehicle is actually doing. + type + integer + value + 40 + + VEHICLE_BUOYANCY + + tooltip + A slider between minimum (0.0) and maximum anti-gravity (1.0). + type + integer + value + 27 + + VEHICLE_FLAG_BLOCK_INTERFERENCE + + tooltip + Prevent other scripts from pushing vehicle. + type + integer + value + 0x400 + + VEHICLE_FLAG_CAMERA_DECOUPLED + + tooltip + + type + integer + value + 0x200 + + VEHICLE_FLAG_HOVER_GLOBAL_HEIGHT + + tooltip + Hover at global height. + type + integer + value + 0x10 + + VEHICLE_FLAG_HOVER_TERRAIN_ONLY + + tooltip + Ignore water height when hovering. + type + integer + value + 0x8 + + VEHICLE_FLAG_HOVER_UP_ONLY + + tooltip + Hover does not push down. Use this flag for hovering vehicles that should be able to jump above their hover height. + type + integer + value + 0x20 + + VEHICLE_FLAG_HOVER_WATER_ONLY + + tooltip + Ignore terrain height when hovering. + type + integer + value + 0x4 + + VEHICLE_FLAG_LIMIT_MOTOR_UP + + tooltip + Prevents ground vehicles from motoring into the sky. + type + integer + value + 0x40 + + VEHICLE_FLAG_LIMIT_ROLL_ONLY + + tooltip + For vehicles with vertical attractor that want to be able to climb/dive, for instance, aeroplanes that want to use the banking feature. + type + integer + value + 0x2 + + VEHICLE_FLAG_MOUSELOOK_BANK + + tooltip + + type + integer + value + 0x100 + + VEHICLE_FLAG_MOUSELOOK_STEER + + tooltip + + type + integer + value + 0x80 + + VEHICLE_FLAG_NO_DEFLECTION_UP + + tooltip + This flag prevents linear deflection parallel to world z-axis. This is useful for preventing ground vehicles with large linear deflection, like bumper cars, from climbing their linear deflection into the sky. + type + integer + value + 0x1 + + VEHICLE_FLAG_NO_FLY_UP + + deprecated + 1 + tooltip + Old, changed to VEHICLE_FLAG_NO_DEFLECTION_UP + type + integer + value + 0x1 + + VEHICLE_HOVER_EFFICIENCY + + tooltip + A slider between minimum (0.0 = bouncy) and maximum (1.0 = fast as possible) damped motion of the hover behavior. + type + integer + value + 25 + + VEHICLE_HOVER_HEIGHT + + tooltip + The height (above the terrain or water, or global) at which the vehicle will try to hover. + type + integer + value + 24 + + VEHICLE_HOVER_TIMESCALE + + tooltip + Period of time (in seconds) for the vehicle to achieve its hover height. + type + integer + value + 26 + + VEHICLE_LINEAR_DEFLECTION_EFFICIENCY + + tooltip + A slider between minimum (0.0) and maximum (1.0) deflection of linear velocity. That is, its a simple scalar for modulating the strength of linear deflection. + type + integer + value + 28 + + VEHICLE_LINEAR_DEFLECTION_TIMESCALE + + tooltip + The timescale for exponential success of linear deflection deflection. It is another way to specify how much time it takes for the vehicles linear velocity to be redirected to its preferred axis of motion. + type + integer + value + 29 + + VEHICLE_LINEAR_FRICTION_TIMESCALE + + tooltip + + A vector of timescales for exponential decay of the vehicles linear velocity along its preferred axes of motion (at, left, up). + Range = [0.07, inf) seconds for each element of the vector. + + type + integer + value + 16 + + VEHICLE_LINEAR_MOTOR_DECAY_TIMESCALE + + tooltip + The timescale for exponential decay of the linear motors magnitude. + type + integer + value + 31 + + VEHICLE_LINEAR_MOTOR_DIRECTION + + tooltip + + The direction and magnitude (in preferred frame) of the vehicles linear motor. The vehicle will accelerate (or decelerate if necessary) to match its velocity to its motor. + Range of magnitude = [0, 30] meters/second. + + type + integer + value + 18 + + VEHICLE_LINEAR_MOTOR_OFFSET + + tooltip + + type + integer + value + 20 + + VEHICLE_LINEAR_MOTOR_TIMESCALE + + tooltip + The timescale for exponential approach to full linear motor velocity. + type + integer + value + 30 + + VEHICLE_REFERENCE_FRAME + + tooltip + A rotation of the vehicles preferred axes of motion and orientation (at, left, up) with respect to the vehicles local frame (x, y, z). + type + integer + value + 44 + + VEHICLE_TYPE_AIRPLANE + + tooltip + Uses linear deflection for lift, no hover, and banking to turn.\nSee http://wiki.secondlife.com/wiki/VEHICLE_TYPE_AIRPLANE + type + integer + value + 4 + + VEHICLE_TYPE_BALLOON + + tooltip + Hover, and friction, but no deflection.\nSee http://wiki.secondlife.com/wiki/VEHICLE_TYPE_BALLOON + type + integer + value + 5 + + VEHICLE_TYPE_BOAT + + tooltip + Hovers over water with lots of friction and some anglar deflection.\nSee http://wiki.secondlife.com/wiki/VEHICLE_TYPE_BOAT + type + integer + value + 3 + + VEHICLE_TYPE_CAR + + tooltip + Another vehicle that bounces along the ground but needs the motors to be driven from external controls or timer events.\nSee http://wiki.secondlife.com/wiki/VEHICLE_TYPE_CAR + type + integer + value + 2 + + VEHICLE_TYPE_NONE + + tooltip + + type + integer + value + 0 + + VEHICLE_TYPE_SLED + + tooltip + Simple vehicle that bumps along the ground, and likes to move along its local x-axis.\nSee http://wiki.secondlife.com/wiki/VEHICLE_TYPE_SLED + type + integer + value + 1 + + VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY + + tooltip + A slider between minimum (0.0 = wobbly) and maximum (1.0 = firm as possible) stability of the vehicle to keep itself upright. + type + integer + value + 36 + + VEHICLE_VERTICAL_ATTRACTION_TIMESCALE + + tooltip + The period of wobble, or timescale for exponential approach, of the vehicle to rotate such that its preferred "up" axis is oriented along the worlds "up" axis. + type + integer + value + 37 + + VERTICAL + + tooltip + + type + integer + value + 0 + + WANDER_PAUSE_AT_WAYPOINTS + + tooltip + + type + integer + value + 0 + + WATER_BLUR_MULTIPLIER + + tooltip + Blur factor. + type + integer + value + 100 + + WATER_FOG + + tooltip + Fog properties when underwater. + type + integer + value + 101 + + WATER_FRESNEL + + tooltip + Fresnel scattering applied to the surface of the water. + type + integer + value + 102 + + WATER_NORMAL_SCALE + + tooltip + Scaling applied to the water normal map. + type + integer + value + 104 + + WATER_NORMAL_TEXTURE + + tooltip + Normal map used for environmental waves. + type + integer + value + 107 + + WATER_REFRACTION + + tooltip + Refraction factors when looking through the surface of the water. + type + integer + value + 105 + + WATER_TEXTURE_DEFAULTS + + tooltip + Is the environment using the default wave map. + type + integer + value + 103 + + WATER_WAVE_DIRECTION + + tooltip + Vectors for the directions of the waves. + type + integer + value + 106 + + XP_ERROR_EXPERIENCES_DISABLED + + tooltip + The region currently has experiences disabled. + type + integer + value + 2 + + XP_ERROR_EXPERIENCE_DISABLED + + tooltip + The experience owner has temporarily disabled the experience. + type + integer + value + 8 + + XP_ERROR_EXPERIENCE_SUSPENDED + + tooltip + The experience has been suspended by Linden Customer Support. + type + integer + value + 9 + + XP_ERROR_INVALID_EXPERIENCE + + tooltip + The script is associated with an experience that no longer exists. + type + integer + value + 7 + + XP_ERROR_INVALID_PARAMETERS + + tooltip + One of the string arguments was too big to fit in the key-value store. + type + integer + value + 3 + + XP_ERROR_KEY_NOT_FOUND + + tooltip + The requested key does not exist. + type + integer + value + 14 + + XP_ERROR_MATURITY_EXCEEDED + + tooltip + The content rating of the experience exceeds that of the region. + type + integer + value + 16 + + XP_ERROR_NONE + + tooltip + No error was detected. + type + integer + value + 0 + + XP_ERROR_NOT_FOUND + + tooltip + The sim was unable to verify the validity of the experience. Retrying after a short wait is advised. + type + integer + value + 6 + + XP_ERROR_NOT_PERMITTED + + tooltip + This experience is not allowed to run by the requested agent. + type + integer + value + 4 + + XP_ERROR_NOT_PERMITTED_LAND + + tooltip + This experience is not allowed to run on the current region. + type + integer + value + 17 + + XP_ERROR_NO_EXPERIENCE + + tooltip + This script is not associated with an experience. + type + integer + value + 5 + + XP_ERROR_QUOTA_EXCEEDED + + tooltip + An attempted write data to the key-value store failed due to the data quota being met. + type + integer + value + 11 + + XP_ERROR_REQUEST_PERM_TIMEOUT + + tooltip + Request timed out; permissions not modified. + type + integer + value + 18 + + XP_ERROR_RETRY_UPDATE + + tooltip + A checked update failed due to an out of date request. + type + integer + value + 15 + + XP_ERROR_STORAGE_EXCEPTION + + tooltip + Unable to communicate with the key-value store. + type + integer + value + 13 + + XP_ERROR_STORE_DISABLED + + tooltip + The key-value store is currently disabled on this region. + type + integer + value + 12 + + XP_ERROR_THROTTLED + + tooltip + The call failed due to too many recent calls. + type + integer + value + 1 + + XP_ERROR_UNKNOWN_ERROR + + tooltip + Other unknown error. + type + integer + value + 10 + + ZERO_ROTATION + + tooltip + + type + rotation + value + <0.0, 0.0, 0.0, 1.0> + + ZERO_VECTOR + + tooltip + + type + vector + value + <0.0, 0.0, 0.0> + + default + + tooltip + + All scripts must have a default state, which is the first state entered when the script starts. + If another state is defined before the default state, the compiler will report a syntax error. + + + + events + + at_rot_target + + arguments + + + TargetNumber + + tooltip + + type + integer + + + + TargetRotation + + tooltip + + type + rotation + + + + CurrentRotation + + tooltip + + type + rotation + + + + tooltip + This event is triggered when a script comes within a defined angle of a target rotation. The range and rotation, are set by a call to llRotTarget. + + at_target + + arguments + + + TargetNumber + + tooltip + + type + integer + + + + TargetPosition + + tooltip + + type + vector + + + + CurrentPosition + + tooltip + + type + vector + + + + tooltip + This event is triggered when the scripted object comes within a defined range of the target position, defined by the llTarget function call. + + attach + + arguments + + + AvatarID + + tooltip + + type + key + + + + tooltip + This event is triggered whenever an object is attached or detached from an avatar. If it is attached, the key of the avatar it is attached to is passed in, otherwise NULL_KEY is. + + changed + + arguments + + + Changed + + tooltip + + type + integer + + + + tooltip + Triggered when various events change the object. The change argument will be a bit-field of CHANGED_* constants. + + collision + + arguments + + + NumberOfCollisions + + tooltip + + type + integer + + + + tooltip + + This event is raised while another object, or avatar, is colliding with the object the script is attached to. + The number of detected objects is passed to the script. Information on those objects may be gathered via the llDetected* functions. + + + collision_end + + arguments + + + NumberOfCollisions + + tooltip + + type + integer + + + + tooltip + + This event is raised when another object, or avatar, stops colliding with the object the script is attached to. + The number of detected objects is passed to the script. Information on those objects may be gathered via the llDetected* library functions. + + + collision_start + + arguments + + + NumberOfCollisions + + tooltip + + type + integer + + + + tooltip + + This event is raised when another object, or avatar, starts colliding with the object the script is attached to. + The number of detected objects is passed to the script. Information on those objects may be gathered via the llDetected* library functions. + + + control + + arguments + + + AvatarID + + tooltip + + type + key + + + + Levels + + tooltip + + type + integer + + + + Edges + + tooltip + + type + integer + + + + tooltip + + Once a script has the ability to grab control inputs from the avatar, this event will be used to pass the commands into the script. + The levels and edges are bit-fields of control constants. + + + dataserver + + arguments + + + RequestID + + tooltip + + type + key + + + + Data + + tooltip + + type + string + + + + tooltip + + This event is triggered when the requested data is returned to the script. + Data may be requested by the llRequestAgentData, llRequestInventoryData, and llGetNotecardLine function calls, for example. + + + email + + arguments + + + Time + + tooltip + + type + string + + + + Address + + tooltip + + type + string + + + + Subject + + tooltip + + type + string + + + + Body + + tooltip + + type + string + + + + NumberRemaining + + tooltip + + type + integer + + + + tooltip + + This event is triggered when an email sent to this script arrives. + The number remaining tells how many more emails are known to be still pending. + + + experience_permissions + + arguments + + + agent_id + + tooltip + ID of the agent approving permission for the Experience. + type + key + + + + tooltip + Triggered when an agent has approved an experience permissions request. + + experience_permissions_denied + + arguments + + + agent_id + + tooltip + ID of the agent denying permission for the Experience. + type + key + + + + Reason + + tooltip + One of the XP_ERROR_... constants describing the reason why the Experience permissions were denied for the agent. + type + integer + + + + tooltip + Describes why the Experience permissions were denied for the agent. + + final_damage + + arguments + + + count + + tooltip + The number of damage events queued. + type + integer + + + + tooltip + Triggered as damage is applied to an avatar or task, after all on_damage events have been processed. + + game_control + + arguments + + + id + + tooltip + UUID of avatar supplying input + type + key + + + + buttons + + tooltip + 32-bit mask of buttons pressed + type + integer + + + + axes + + tooltip + Six float values in range [-1, 1] + type + list + + + + tooltip + This event is raised when game controller input changes. + + http_request + + arguments + + + HTTPRequestID + + tooltip + + type + key + + + + HTTPMethod + + tooltip + + type + string + + + + Body + + tooltip + + type + string + + + + tooltip + Triggered when task receives an HTTP request. + + http_response + + arguments + + + HTTPRequestID + + tooltip + + type + key + + + + Status + + tooltip + + type + integer + + + + Metadata + + tooltip + + type + list + + + + Body + + tooltip + + type + string + + + + tooltip + This event handler is invoked when an HTTP response is received for a pending llHTTPRequest request or if a pending request fails or times out. + + land_collision + + arguments + + + Position + + tooltip + + type + vector + + + + tooltip + This event is raised when the object the script is attached to is colliding with the ground. + + land_collision_end + + arguments + + + Position + + tooltip + + type + vector + + + + tooltip + This event is raised when the object the script is attached to stops colliding with the ground. + + land_collision_start + + arguments + + + Position + + tooltip + + type + vector + + + + tooltip + This event is raised when the object the script is attached to begins to collide with the ground. + + link_message + + arguments + + + SendersLink + + tooltip + + type + integer + + + + Value + + tooltip + + type + integer + + + + Text + + tooltip + + type + string + + + + ID + + tooltip + + type + key + + + + tooltip + Triggered when object receives a link message via llMessageLinked function call. + + linkset_data + + arguments + + + action + + tooltip + + type + integer + + + + name + + tooltip + + type + string + + + + value + + tooltip + + type + string + + + + tooltip + Triggered when a script modifies the linkset datastore. + + listen + + arguments + + + Channel + + tooltip + + type + integer + + + + Name + + tooltip + + type + string + + + + ID + + tooltip + + type + key + + + + Text + + tooltip + + type + string + + + + tooltip + + This event is raised whenever a chat message matching the constraints set in the llListen command is received. The name and ID of the speaker, as well as the message, are passed in as parameters. + Channel 0 is the public chat channel that all avatars see as chat text. Channels 1 through 2,147,483,648 are private channels that are not sent to avatars but other scripts can listen on those channels. + + + money + + arguments + + + Payer + + tooltip + + type + key + + + + Amount + + tooltip + + type + integer + + + + tooltip + This event is triggered when a resident has given an amount of Linden dollars to the object. + + moving_end + + arguments + + tooltip + Triggered whenever an object with this script stops moving. + + moving_start + + arguments + + tooltip + Triggered whenever an object with this script starts moving. + + no_sensor + + arguments + + tooltip + This event is raised when sensors are active, via the llSensor function call, but are not sensing anything. + + not_at_rot_target + + arguments + + tooltip + When a target is set via the llRotTarget function call, but the script is outside the specified angle this event is raised. + + not_at_target + + arguments + + tooltip + When a target is set via the llTarget library call, but the script is outside the specified range this event is raised. + + object_rez + + arguments + + + RezzedObjectsID + + tooltip + + type + key + + + + tooltip + Triggered when an object rezzes another object from its inventory via the llRezObject, or similar, functions. The id is the globally unique key for the object rezzed. + + on_damage + + arguments + + + count + + tooltip + The number of damage events queued. + type + integer + + + + tooltip + Triggered when an avatar or object receives damage. + + on_death + + arguments + + tooltip + Triggered when an avatar reaches 0 health. + + on_rez + + arguments + + + StartParameter + + tooltip + + type + integer + + + + tooltip + Triggered whenever an object is rezzed from inventory or by another object. The start parameter is passed in from the llRezObject call, or zero if from inventory. + + path_update + + arguments + + + Type + + tooltip + + type + integer + + + + Reserved + + tooltip + + type + list + + + + tooltip + This event is called to inform the script of changes within the object's path-finding status. + + remote_data + + arguments + + + EventType + + tooltip + + type + integer + + + + ChannelID + + tooltip + + type + key + + + + MessageID + + tooltip + + type + key + + + + Sender + + tooltip + + type + string + + + + IData + + tooltip + + type + integer + + + + SData + + tooltip + + type + string + + + + tooltip + This event is deprecated. + + run_time_permissions + + arguments + + + PermissionFlags + + tooltip + + type + integer + + + + tooltip + + Scripts need permission from either the owner or the avatar they wish to act on before they may perform certain functions, such as debiting money from their owners account, triggering an animation on an avatar, or capturing control inputs. The llRequestPermissions library function is used to request these permissions and the various permissions integer constants can be supplied. + The integer returned to this event handler contains the current set of permissions flags, so if permissions equal 0 then no permissions are set. + + + sensor + + arguments + + + NumberDetected + + tooltip + + type + integer + + + + tooltip + + This event is raised whenever objects matching the constraints of the llSensor command are detected. + The number of detected objects is passed to the script in the parameter. Information on those objects may be gathered via the llDetected* functions. + + + state_entry + + arguments + + tooltip + The state_entry event occurs whenever a new state is entered, including at program start, and is always the first event handled. + + state_exit + + arguments + + tooltip + The state_exit event occurs whenever the state command is used to transition to another state. It is handled before the new states state_entry event. + + timer + + arguments + + tooltip + This event is raised at regular intervals set by the llSetTimerEvent library function. + + touch + + arguments + + + NumberOfTouches + + tooltip + + type + integer + + + + tooltip + + This event is raised while a user is touching the object the script is attached to. + The number of touching objects is passed to the script in the parameter. + Information on those objects may be gathered via the llDetected* library functions. + + + touch_end + + arguments + + + NumberOfTouches + + tooltip + + type + integer + + + + tooltip + + This event is raised when a user stops touching the object the script is attached to. The number of touches is passed to the script in the parameter. + Information on those objects may be gathered via the llDetected* library functions. + + + touch_start + + arguments + + + NumberOfTouches + + tooltip + + type + integer + + + + tooltip + + This event is raised when a user first touches the object the script is attached to. The number of touches is passed to the script in the parameter. + Information on those objects may be gathered via the llDetected() library functions. + + + transaction_result + + arguments + + + RequestID + + tooltip + + type + key + + + + Success + + tooltip + + type + integer + + + + Message + + tooltip + + type + string + + + + tooltip + Triggered by llTransferMoney() function. + + + functions + + + assert + + arguments + + + value + + tooltip + The value to check for truthiness. + type + any + + + + message + + tooltip + Optional error message to display if the value is not truthy. + type + string? + + + + energy + 10 + return + any + sleep + 0 + tooltip + Checks if the value is truthy; if not, raises an error with the optional message. + + error + + arguments + + + obj + + tooltip + The error object to raise. + type + any + + + + level + + tooltip + Optional level to attribute the error to in the call stack. + type + number? + + + + energy + 10 + return + void + sleep + 0 + tooltip + Raises an error with the specified object and optional call stack level. + + gcinfo + + energy + 10 + return + number + sleep + 0 + tooltip + Returns the total heap size in kilobytes. + + getfenv + + arguments + + + target + + tooltip + Optional function or stack index to get the environment table for. + type + (function | number)? + + + + energy + 10 + return + table + sleep + 0 + tooltip + Returns the environment table for the specified function or stack index. + + getmetatable + + arguments + + + obj + + tooltip + The object to get the metatable for. + type + any + + + + energy + 10 + return + table? + sleep + 0 + tooltip + Returns the metatable for the specified object. + + next + + arguments + + + t + + tooltip + The table to traverse. + type + table + + + + i + + tooltip + Optional key to start traversal after. + type + any? + + + + energy + 10 + return + (any, any)? + sleep + 0 + tooltip + Returns the next key-value pair in the table traversal order. + + newproxy + + arguments + + + mt + + tooltip + Optional boolean to create a modifiable metatable. + type + boolean? + + + + energy + 10 + return + userdata + sleep + 0 + tooltip + Creates a new untyped userdata object with an optional metatable. + + print + + arguments + + + args + + tooltip + Arguments to print to standard output. + type + ...any + + + + energy + 10 + return + void + sleep + 0 + tooltip + Prints all arguments to standard output using Tab as a separator. + + rawequal + + arguments + + + a + + tooltip + First object to compare. + type + any + + + + b + + tooltip + Second object to compare. + type + any + + + + energy + 10 + return + boolean + sleep + 0 + tooltip + Returns true if a and b have the same type and value. + + rawget + + arguments + + + t + + tooltip + The table to perform the lookup on. + type + table + + + + k + + tooltip + The key to look up in the table. + type + any + + + + energy + 10 + return + any? + sleep + 0 + tooltip + Performs a table lookup bypassing metatables. + + rawset + + arguments + + + t + + tooltip + The table to assign the value to. + type + table + + + + k + + tooltip + The key to assign the value to. + type + any + + + + v + + tooltip + The value to assign. + type + any + + + + energy + 10 + return + void + sleep + 0 + tooltip + Assigns a value to a table field bypassing metatables. + + select + + arguments + + + i + + tooltip + The index or '#' to count arguments. + type + string | number + + + + args + + tooltip + The arguments to select from. + type + ...any + + + + energy + 10 + return + any + sleep + 0 + tooltip + Returns a subset of arguments or the number of arguments. + + setfenv + + arguments + + + target + + tooltip + The function or stack index to set the environment for. + type + function | number + + + + env + + tooltip + The environment table to set. + type + table + + + + energy + 10 + return + void + sleep + 0 + tooltip + Changes the environment table for the specified function or stack index. + + setmetatable + + arguments + + + t + + tooltip + The table to set the metatable for. + type + table + + + + mt + + tooltip + The metatable to set. + type + table? + + + + energy + 10 + return + void + sleep + 0 + tooltip + Changes the metatable for the given table. + + tonumber + + arguments + + + s + + tooltip + The string to convert to a number. + type + string + + + + base + + tooltip + Optional base for the conversion. + type + number? + + + + energy + 10 + return + number? + sleep + 0 + tooltip + Converts the input string to a number in the specified base. + + tostring + + arguments + + + obj + + tooltip + The object to convert to a string. + type + any + + + + energy + 10 + return + string + sleep + 0 + tooltip + Converts the input object to a string. + + type + + arguments + + + obj + + tooltip + The object to get the type of. + type + any + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the type of the object as a string. + + typeof + + arguments + + + obj + + tooltip + The object to get the type of. + type + any + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the type of the object, including custom userdata types. + + ipairs + + arguments + + + t + + tooltip + The table to iterate over. + type + table + + + + energy + 10 + return + iterator + sleep + 0 + tooltip + Returns an iterator for numeric key-value pairs in the table. + + pairs + + arguments + + + t + + tooltip + The table to iterate over. + type + table + + + + energy + 10 + return + iterator + sleep + 0 + tooltip + Returns an iterator for all key-value pairs in the table. + + pcall + + arguments + + + f + + tooltip + A function to be called. + type + function + + + + args + + tooltip + Arguments to pass to the function. + type + variadic + + + + energy + 10 + return + boolean, variadic + sleep + 0 + tooltip + Calls function f with parameters args, returning success and function results or an error. + + xpcall + + arguments + + + f + + tooltip + A function to be called. + type + function + + + + e + + tooltip + Error handler function. + type + function + + + + args + + tooltip + Arguments to pass to the function. + type + variadic + + + + energy + 10 + return + boolean, variadic + sleep + 0 + tooltip + Calls function f with parameters args, handling errors with e if they occur. + + unpack + + arguments + + + a + + tooltip + Array from which to extract values. + type + array + + + + f + + tooltip + Starting index (optional, defaults to 1). + type + number + + + + t + + tooltip + Ending index (optional, defaults to #a). + type + number + + + + energy + 10 + return + variadic + sleep + 0 + tooltip + Returns values from an array in the specified index range. + + + math + + energy + -1.0 + tooltip + math namespace. + + math.abs + + arguments + + + n + + tooltip + A number. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns the absolute value of n. + + math.acos + + arguments + + + n + + tooltip + A number in the range [-1, 1]. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns the arc cosine of n in radians. + + math.asin + + arguments + + + n + + tooltip + A number in the range [-1, 1]. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns the arc sine of n in radians. + + math.atan2 + + arguments + + + y + + tooltip + The y-coordinate. + type + number + + + + x + + tooltip + The x-coordinate. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns the arc tangent of y/x in radians. + + math.atan + + arguments + + + n + + tooltip + A number. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns the arc tangent of n in radians. + + math.ceil + + arguments + + + n + + tooltip + A number. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Rounds n upwards to the next integer boundary. + + math.cosh + + arguments + + + n + + tooltip + A number to compute the hyperbolic cosine of. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns the hyperbolic cosine of n. + + math.cos + + arguments + + + n + + tooltip + An angle in radians. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns the cosine of n. + + math.deg + + arguments + + + n + + tooltip + A value in radians. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Converts n from radians to degrees. + + math.exp + + arguments + + + n + + tooltip + A number to compute e^n. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns the base-e exponent of n. + + math.floor + + arguments + + + n + + tooltip + A number to round down. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Rounds n down to the previous integer. + + math.fmod + + arguments + + + x + + tooltip + The dividend. + type + number + + + + y + + tooltip + The divisor. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns the remainder of x modulo y, rounded towards zero. + + math.frexp + + arguments + + + n + + tooltip + A number to split into significand and exponent. + type + number + + + + energy + 10 + return + array + sleep + 0 + tooltip + Splits n into a significand and exponent. + + math.ldexp + + arguments + + + s + + tooltip + The significand. + type + number + + + + e + + tooltip + The exponent. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns s * 2^e. + + math.lerp + + arguments + + + a + + tooltip + Start value. + type + number + + + + b + + tooltip + End value. + type + number + + + + t + + tooltip + Interpolation factor. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Linearly interpolates between a and b using factor t. + + math.log10 + + arguments + + + n + + tooltip + A number to compute base-10 logarithm. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns base-10 logarithm of n. + + math.log + + arguments + + + n + + tooltip + A number to compute logarithm. + type + number + + + + base + + tooltip + Base of the logarithm (default is e). + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns logarithm of n in the given base. + + math.max + + arguments + + + list + + tooltip + A list of numbers to find the maximum from. + type + array + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns the maximum value in the given list. + + math.min + + arguments + + + list + + tooltip + A list of numbers to find the minimum from. + type + array + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns the minimum value in the given list. + + math.modf + + arguments + + + n + + tooltip + A number to split into integer and fractional parts. + type + number + + + + energy + 10 + return + array + sleep + 0 + tooltip + Returns the integer and fractional parts of n. + + math.pow + + arguments + + + x + + tooltip + Base value. + type + number + + + + y + + tooltip + Exponent value. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns x raised to the power of y. + + math.rad + + arguments + + + n + + tooltip + A value in degrees. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Converts n from degrees to radians. + + math.random + + arguments + + + min + + tooltip + Minimum value of the range (optional). + type + number + + + + max + + tooltip + Maximum value of the range (optional). + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns a random number within the given range. + + math.randomseed + + arguments + + + seed + + tooltip + Seed for the random number generator. + type + number + + + + energy + 10 + return + void + sleep + 0 + tooltip + Sets the seed for the random number generator. + + math.sinh + + arguments + + + n + + tooltip + A number to compute the hyperbolic sine of. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns the hyperbolic sine of n. + + math.sin + + arguments + + + n + + tooltip + An angle in radians. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns the sine of n. + + math.sqrt + + arguments + + + n + + tooltip + A number to compute the square root of. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns the square root of n. + + math.tanh + + arguments + + + n + + tooltip + A number to compute the hyperbolic tangent of. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns the hyperbolic tangent of n. + + math.tan + + arguments + + + n + + tooltip + An angle in radians. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns the tangent of n. + + math.noise + + arguments + + + x + + tooltip + X coordinate for the noise function. + type + number + + + + y + + tooltip + Y coordinate for the noise function (optional). + type + number + + + + z + + tooltip + Z coordinate for the noise function (optional). + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns Perlin noise value for the point (x, y, z). + + math.clamp + + arguments + + + n + + tooltip + The value to be clamped. + type + number + + + + min + + tooltip + Minimum allowable value. + type + number + + + + max + + tooltip + Maximum allowable value. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns n clamped between min and max. + + math.sign + + arguments + + + n + + tooltip + A number to get the sign of. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns -1 if n is negative, 1 if positive, and 0 if zero. + + math.round + + arguments + + + n + + tooltip + A number to round to the nearest integer. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Rounds n to the nearest integer. + + + table + + energy + -1.0 + tooltip + table namespace. + + table.concat + + arguments + + + a + + tooltip + Array of strings. + type + array + + + + sep + + tooltip + Separator string. + type + string + + + + f + + tooltip + Starting index. + type + integer + + + + t + + tooltip + Ending index. + type + integer + + + + energy + 10 + return + string + sleep + 0 + tooltip + Concatenates elements of an array with an optional separator. + + table.foreach + + arguments + + + t + + tooltip + Table to iterate over. + type + table + + + + f + + tooltip + Function applied to each key-value pair. + type + function + + + + energy + 10 + return + various + sleep + 0 + tooltip + Iterates over all key-value pairs in a table. + + table.getn + + arguments + + + t + + tooltip + Table whose length is determined. + type + table + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the number of elements in a table. + + table.maxn + + arguments + + + t + + tooltip + Table to search for the maximum numeric key. + type + table + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the highest numeric key in a table. + + table.insert + + arguments + + + t + + tooltip + Table to insert into. + type + table + + + + i + + tooltip + Position to insert at. + type + integer + + + + v + + tooltip + Value to insert. + type + various + + + + energy + 10 + return + void + sleep + 0 + tooltip + Inserts a value at a specific index in a table. + + table.remove + + arguments + + + t + + tooltip + Table to remove from. + type + table + + + + i + + tooltip + Position to remove. + type + integer + + + + energy + 10 + return + various + sleep + 0 + tooltip + Removes an element from a table at a given index. + + table.sort + + arguments + + + t + + tooltip + Table to be sorted. + type + table + + + + f + + tooltip + Comparison function. + type + function + + + + energy + 10 + return + void + sleep + 0 + tooltip + Sorts a table in ascending order. + + table.pack + + arguments + + + args + + tooltip + Variable arguments. + type + varargs + + + + energy + 10 + return + table + sleep + 0 + tooltip + Packs multiple arguments into a table. + + table.unpack + + arguments + + + a + + tooltip + Table to unpack. + type + table + + + + f + + tooltip + Starting index. + type + integer + + + + t + + tooltip + Ending index. + type + integer + + + + energy + 10 + return + varargs + sleep + 0 + tooltip + Returns unpacked values from a table within a specified range. + + table.move + + arguments + + + a + + tooltip + Source table. + type + table + + + + f + + tooltip + Starting index. + type + integer + + + + t + + tooltip + Ending index. + type + integer + + + + d + + tooltip + Destination index. + type + integer + + + + tt + + tooltip + Optional target table. + type + table + + + + energy + 10 + return + table + sleep + 0 + tooltip + Moves elements from one table to another or within the same table. + + table.create + + arguments + + + n + + tooltip + Number of elements. + type + integer + + + + v + + tooltip + Value to prefill elements with. + type + various + + + + energy + 10 + return + table + sleep + 0 + tooltip + Creates a table with preallocated elements. + + table.find + + arguments + + + t + + tooltip + Table to search in. + type + table + + + + v + + tooltip + Value to find. + type + various + + + + init + + tooltip + Starting index for search. + type + integer + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Finds the first occurrence of a value in a table and returns its index. + + table.clear + + arguments + + + t + + tooltip + Table to clear. + type + table + + + + energy + 10 + return + void + sleep + 0 + tooltip + Clears all elements from a table while keeping its capacity. + + table.freeze + + arguments + + + t + + tooltip + Table to freeze. + type + table + + + + energy + 10 + return + table + sleep + 0 + tooltip + Freezes a table, preventing modifications. + + table.isfrozen + + arguments + + + t + + tooltip + Table to check. + type + table + + + + energy + 10 + return + boolean + sleep + 0 + tooltip + Returns true if a table is frozen. + + table.clone + + arguments + + + t + + tooltip + Table to clone. + type + table + + + + energy + 10 + return + table + sleep + 0 + tooltip + Creates a shallow copy of a table. + + + string + + energy + -1.0 + tooltip + string namespace. + + string.byte + + arguments + + + s + + tooltip + Input string. + type + string + + + + f + + tooltip + Starting index (optional). + type + number + + + + t + + tooltip + Ending index (optional). + type + number + + + + energy + 10 + return + number... + sleep + 0 + tooltip + Returns the numeric code of every byte in the input string within the given range. + + string.char + + arguments + + + args + + tooltip + Byte values to convert to string. + type + number... + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns a string containing characters for the given byte values. + + string.find + + arguments + + + s + + tooltip + Input string. + type + string + + + + p + + tooltip + Pattern to search for. + type + string + + + + init + + tooltip + Starting position (optional). + type + number + + + + plain + + tooltip + Perform raw search (optional). + type + boolean + + + + energy + 10 + return + number?, number?, string... + sleep + 0 + tooltip + Finds an instance of the pattern in the string. + + string.format + + arguments + + + s + + tooltip + Format string. + type + string + + + + args + + tooltip + Values to format. + type + any... + + + + energy + 10 + return + string + sleep + 0 + tooltip + Formats input values into a string using printf-style format specifiers. + + string.len + + arguments + + + s + + tooltip + Input string. + type + string + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns the number of bytes in the string. + + string.lower + + arguments + + + s + + tooltip + Input string. + type + string + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns a lowercase version of the input string. + + string.upper + + arguments + + + s + + tooltip + Input string. + type + string + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns an uppercase version of the input string. + + string.match + + arguments + + + s + + tooltip + Input string. + type + string + + + + p + + tooltip + Pattern to match. + type + string + + + + init + + tooltip + Starting position (optional). + type + number + + + + energy + 10 + return + string... + sleep + 0 + tooltip + Finds and returns matches for a pattern in the input string. + + string.rep + + arguments + + + s + + tooltip + Input string. + type + string + + + + n + + tooltip + Number of times to repeat the string. + type + number + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the input string repeated a given number of times. + + string.reverse + + arguments + + + s + + tooltip + Input string. + type + string + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the input string with bytes in reverse order. + + string.sub + + arguments + + + s + + tooltip + Input string. + type + string + + + + f + + tooltip + Start index. + type + number + + + + t + + tooltip + End index (optional). + type + number + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns a substring from the given range. + + string.gsub + + arguments + + + s + + tooltip + Input string. + type + string + + + + p + + tooltip + Pattern to replace. + type + string + + + + f + + tooltip + Replacement string, function, or table. + type + function | table | string + + + + maxs + + tooltip + Maximum replacements (optional). + type + number + + + + energy + 10 + return + string, number + sleep + 0 + tooltip + Performs pattern-based substitution in a string. + + string.pack + + arguments + + + f + + tooltip + Pack format string. + type + string + + + + args + + tooltip + Values to encode. + type + any... + + + + energy + 10 + return + string + sleep + 0 + tooltip + Packs values into a binary string. + + string.unpack + + arguments + + + f + + tooltip + Pack format string. + type + string + + + + s + + tooltip + Encoded string. + type + string + + + + energy + 10 + return + any... + sleep + 0 + tooltip + Decodes a binary string using a pack format. + + + coroutine + + energy + -1.0 + tooltip + coroutine namespace. + + coroutine.create + + arguments + + + f + + tooltip + A function to be executed by the new coroutine. + type + function + + + + energy + 10 + return + thread + sleep + 0 + tooltip + Returns a new coroutine that, when resumed, will run function f. + + coroutine.running + + arguments + + energy + 10 + return + thread? + sleep + 0 + tooltip + Returns the currently running coroutine, or nil if running in the main coroutine. + + coroutine.status + + arguments + + + co + + tooltip + The coroutine to check status of. + type + thread + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the status of the coroutine: "running", "suspended", "normal", or "dead". + + coroutine.wrap + + arguments + + + f + + tooltip + A function to execute in a coroutine. + type + function + + + + energy + 10 + return + function + sleep + 0 + tooltip + Creates a coroutine and returns a function that resumes it. + + coroutine.yield + + arguments + + + args + + tooltip + Values to pass to the resuming code. + type + variadic + + + + energy + 10 + return + variadic + sleep + 0 + tooltip + Yields the current coroutine, passing arguments to the resuming code. + + coroutine.isyieldable + + arguments + + energy + 10 + return + boolean + sleep + 0 + tooltip + Returns true if the coroutine can yield. + + coroutine.resume + + arguments + + + co + + tooltip + The coroutine to resume. + type + thread + + + + args + + tooltip + Arguments to pass to the coroutine. + type + variadic + + + + energy + 10 + return + (boolean, variadic) + sleep + 0 + tooltip + Resumes a coroutine, returning true and results if successful, or false and an error. + + coroutine.close + + arguments + + + co + + tooltip + The coroutine to close. + type + thread + + + + energy + 10 + return + (boolean, any?) + sleep + 0 + tooltip + Closes a coroutine, returning true if successful or false and an error. + + + bit32 + + energy + -1.0 + tooltip + bit32 library functions. + + bit32.arshift + + arguments + + + n + + tooltip + Number to shift. + type + number + + + + i + + tooltip + Number of bits to shift. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Shifts n by i bits to the right. If i is negative, a left shift is performed. + + bit32.band + + arguments + + + args + + tooltip + Numbers to perform bitwise AND on. + type + array + + + + energy + 10 + return + number + sleep + 0 + tooltip + Performs a bitwise AND operation on input numbers. + + bit32.bnot + + arguments + + + n + + tooltip + Number to negate. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns the bitwise negation of the input number. + + utf8 + + energy + -1.0 + tooltip + UTF-8 library functions. + + utf8.offset + + arguments + + + s + + tooltip + Input string. + type + string + + + + n + + tooltip + Character position. + type + number + + + + i + + tooltip + Starting position (optional). + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns the byte offset of the nth Unicode codepoint in string s. + + utf8.char + + arguments + + + args + + tooltip + Unicode codepoints. + type + array + + + + energy + 10 + return + string + sleep + 0 + tooltip + Creates a string from Unicode codepoints. + + utf8.codepoint + + arguments + + + s + + tooltip + Input string. + type + string + + + + i + + tooltip + Starting position (optional). + type + number + + + + j + + tooltip + Ending position (optional). + type + number + + + + energy + 10 + return + array + sleep + 0 + tooltip + Returns the Unicode codepoints in the specified range of string s. + + utf8.len + + arguments + + + s + + tooltip + Input string. + type + string + + + + i + + tooltip + Starting position (optional). + type + number + + + + j + + tooltip + Ending position (optional). + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns the number of Unicode codepoints in the specified range of string s. + + utf8.codes + + arguments + + + s + + tooltip + Input string. + type + string + + + + energy + 10 + return + iterator + sleep + 0 + tooltip + Returns an iterator that produces the byte offset and Unicode codepoint for each character in string s. + + + os + + energy + -1.0 + tooltip + os namespace. + + os.clock + + arguments + + energy + 10 + return + number + sleep + 0 + tooltip + Returns a high-precision timestamp in seconds for measuring durations. + + os.date + + arguments + + + s + + tooltip + Optional format string for the date representation. + type + string + + + + t + + tooltip + Optional timestamp to format; defaults to the current time. + type + number + + + + energy + 10 + return + table|string + sleep + 0 + tooltip + Returns a table or string representation of the time based on the provided format. + + os.difftime + + arguments + + + a + + tooltip + First timestamp value. + type + number + + + + b + + tooltip + Second timestamp value. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns the difference in seconds between two timestamps. + + os.time + + arguments + + + t + + tooltip + Optional table with date/time fields; returns the corresponding Unix timestamp. + type + table + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns the current Unix timestamp or the timestamp of the given date. + + + debug + + energy + -1.0 + tooltip + debug namespace. + + debug.info + + arguments + + + co + + tooltip + Optional thread or function reference. + type + thread|function|number + + + + level + + tooltip + Stack level or function reference for inspection. + type + number + + + + s + + tooltip + String specifying requested information. + type + string + + + + energy + 10 + return + any + sleep + 0 + tooltip + Returns information about a stack frame or function based on specified format. + + debug.traceback + + arguments + + + co + + tooltip + Optional thread reference for traceback. + type + thread + + + + msg + + tooltip + Optional message prepended to the traceback. + type + string + + + + level + + tooltip + Optional stack level to start traceback. + type + number + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns a human-readable call stack starting from the specified level. + + debug.getinfo + + arguments + + + thread + + tooltip + Optional thread whose stack frame is being inspected. + type + thread + + + + function + + tooltip + Function reference or stack level number. + type + function|number + + + + what + + tooltip + String specifying which fields to retrieve. + type + string + + + + energy + 10 + return + table + sleep + 0 + tooltip + Returns a table containing debug information about a function or stack frame. + + debug.getlocal + + arguments + + + level + + tooltip + Stack level number. + type + number + + + + index + + tooltip + Index of the local variable. + type + number + + + + energy + 10 + return + string|any + sleep + 0 + tooltip + Returns the name and value of a local variable at the specified stack level. + + debug.setlocal + + arguments + + + level + + tooltip + Stack level number. + type + number + + + + index + + tooltip + Index of the local variable. + type + number + + + + value + + tooltip + New value for the local variable. + type + any + + + + energy + 10 + return + boolean + sleep + 0 + tooltip + Sets the value of a local variable at the specified stack level. + + debug.getupvalue + + arguments + + + function + + tooltip + Function whose upvalues are being retrieved. + type + function + + + + index + + tooltip + Index of the upvalue. + type + number + + + + energy + 10 + return + string|any + sleep + 0 + tooltip + Returns the name and value of an upvalue for a given function. + + debug.setupvalue + + arguments + + + function + + tooltip + Function whose upvalues are being modified. + type + function + + + + index + + tooltip + Index of the upvalue. + type + number + + + + value + + tooltip + New value for the upvalue. + type + any + + + + energy + 10 + return + string + sleep + 0 + tooltip + Sets the value of an upvalue for a given function. + + debug.getmetatable + + arguments + + + value + + tooltip + Value whose metatable is retrieved. + type + any + + + + energy + 10 + return + table|nil + sleep + 0 + tooltip + Returns the metatable of the given value, if any. + + debug.setmetatable + + arguments + + + value + + tooltip + Value whose metatable is to be set. + type + any + + + + metatable + + tooltip + Table to be set as the new metatable. + type + table|nil + + + + energy + 10 + return + any + sleep + 0 + tooltip + Sets the metatable for a given value. + + + buffer + + energy + -1.0 + tooltip + buffer namespace. + + buffer.create + + arguments + + + size + + tooltip + Size of the buffer to create. + type + number + + + + energy + 10 + return + buffer + sleep + 0 + tooltip + Creates a buffer of the requested size with all bytes initialized to 0. + + buffer.fromstring + + arguments + + + str + + tooltip + String to initialize the buffer with. + type + string + + + + energy + 10 + return + buffer + sleep + 0 + tooltip + Creates a buffer initialized to the contents of the string. + + buffer.tostring + + arguments + + + b + + tooltip + Buffer to convert to a string. + type + buffer + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the buffer data as a string. + + buffer.len + + arguments + + + b + + tooltip + Buffer to get the size of. + type + buffer + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns the size of the buffer in bytes. + + buffer.readi8 + + arguments + + + b + + tooltip + Buffer to read from. + type + buffer + + + + offset + + tooltip + Byte offset to read from. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Reads a signed 8-bit integer from the buffer at the given offset. + + buffer.writei8 + + arguments + + + b + + tooltip + Buffer to write to. + type + buffer + + + + offset + + tooltip + Byte offset to write at. + type + number + + + + value + + tooltip + Value to write. + type + number + + + + energy + 10 + return + void + sleep + 0 + tooltip + Writes a signed 8-bit integer to the buffer at the given offset. + + buffer.readstring + + arguments + + + b + + tooltip + Buffer to read from. + type + buffer + + + + offset + + tooltip + Byte offset to start reading. + type + number + + + + count + + tooltip + Number of bytes to read. + type + number + + + + energy + 10 + return + string + sleep + 0 + tooltip + Reads a string of the given length from the buffer at the specified offset. + + buffer.copy + + arguments + + + target + + tooltip + Target buffer to copy into. + type + buffer + + + + targetOffset + + tooltip + Offset in target buffer. + type + number + + + + source + + tooltip + Source buffer to copy from. + type + buffer + + + + sourceOffset + + tooltip + Offset in source buffer (optional). + type + number + + + + count + + tooltip + Number of bytes to copy (optional). + type + number + + + + energy + 10 + return + void + sleep + 0 + tooltip + Copies bytes from the source buffer into the target buffer. + + buffer.fill + + arguments + + + b + + tooltip + Buffer to fill. + type + buffer + + + + offset + + tooltip + Byte offset to start filling. + type + number + + + + value + + tooltip + Value to fill with. + type + number + + + + count + + tooltip + Number of bytes to fill (optional). + type + number + + + + energy + 10 + return + void + sleep + 0 + tooltip + Fills the buffer with the specified value starting at the given offset. + + buffer.readu8 + + arguments + + + b + + tooltip + Buffer to read from. + type + buffer + + + + offset + + tooltip + Byte offset to read from. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Reads an unsigned 8-bit integer from the buffer at the given offset. + + buffer.writeu8 + + arguments + + + b + + tooltip + Buffer to write to. + type + buffer + + + + offset + + tooltip + Byte offset to write at. + type + number + + + + value + + tooltip + Value to write. + type + number + + + + energy + 10 + return + void + sleep + 0 + tooltip + Writes an unsigned 8-bit integer to the buffer at the given offset. + + buffer.readi16 + + arguments + + + b + + tooltip + Buffer to read from. + type + buffer + + + + offset + + tooltip + Byte offset to read from. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Reads a signed 16-bit integer from the buffer at the given offset. + + buffer.writei16 + + arguments + + + b + + tooltip + Buffer to write to. + type + buffer + + + + offset + + tooltip + Byte offset to write at. + type + number + + + + value + + tooltip + Value to write. + type + number + + + + energy + 10 + return + void + sleep + 0 + tooltip + Writes a signed 16-bit integer to the buffer at the given offset. + + buffer.readf32 + + arguments + + + b + + tooltip + Buffer to read from. + type + buffer + + + + offset + + tooltip + Byte offset to read from. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Reads a 32-bit floating-point number from the buffer at the given offset. + + buffer.writef32 + + arguments + + + b + + tooltip + Buffer to write to. + type + buffer + + + + offset + + tooltip + Byte offset to write at. + type + number + + + + value + + tooltip + Value to write. + type + number + + + + energy + 10 + return + void + sleep + 0 + tooltip + Writes a 32-bit floating-point number to the buffer at the given offset. + + buffer.readf64 + + arguments + + + b + + tooltip + Buffer to read from. + type + buffer + + + + offset + + tooltip + Byte offset to read from. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Reads a 64-bit floating-point number from the buffer at the given offset. + + buffer.writef64 + + arguments + + + b + + tooltip + Buffer to write to. + type + buffer + + + + offset + + tooltip + Byte offset to write at. + type + number + + + + value + + tooltip + Value to write. + type + number + + + + energy + 10 + return + void + sleep + 0 + tooltip + Writes a 64-bit floating-point number to the buffer at the given offset. + + buffer.readu16 + + arguments + + + b + + tooltip + Buffer to read from. + type + buffer + + + + offset + + tooltip + Byte offset to read from. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Reads an unsigned 16-bit integer from the buffer at the given offset. + + buffer.writeu16 + + arguments + + + b + + tooltip + Buffer to write to. + type + buffer + + + + offset + + tooltip + Byte offset to write at. + type + number + + + + value + + tooltip + Value to write. + type + number + + + + energy + 10 + return + void + sleep + 0 + tooltip + Writes an unsigned 16-bit integer to the buffer at the given offset. + + buffer.readi32 + + arguments + + + b + + tooltip + Buffer to read from. + type + buffer + + + + offset + + tooltip + Byte offset to read from. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Reads a signed 32-bit integer from the buffer at the given offset. + + buffer.writei32 + + arguments + + + b + + tooltip + Buffer to write to. + type + buffer + + + + offset + + tooltip + Byte offset to write at. + type + number + + + + value + + tooltip + Value to write. + type + number + + + + energy + 10 + return + void + sleep + 0 + tooltip + Writes a signed 32-bit integer to the buffer at the given offset. + + buffer.readu32 + + arguments + + + b + + tooltip + Buffer to read from. + type + buffer + + + + offset + + tooltip + Byte offset to read from. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Reads an unsigned 32-bit integer from the buffer at the given offset. + + buffer.writeu32 + + arguments + + + b + + tooltip + Buffer to write to. + type + buffer + + + + offset + + tooltip + Byte offset to write at. + type + number + + + + value + + tooltip + Value to write. + type + number + + + + energy + 10 + return + void + sleep + 0 + tooltip + Writes an unsigned 32-bit integer to the buffer at the given offset. + + buffer.readstring + + arguments + + + b + + tooltip + Buffer to read from. + type + buffer + + + + offset + + tooltip + Byte offset to start reading. + type + number + + + + count + + tooltip + Number of bytes to read. + type + number + + + + energy + 10 + return + string + sleep + 0 + tooltip + Reads a string of the given length from the buffer at the specified offset. + + buffer.writestring + + arguments + + + b + + tooltip + Buffer to write to. + type + buffer + + + + offset + + tooltip + Byte offset to write at. + type + number + + + + value + + tooltip + String to write. + type + string + + + + count + + tooltip + Number of bytes to write (optional). + type + number + + + + energy + 10 + return + void + sleep + 0 + tooltip + Writes data from a string into the buffer at the specified offset. + + buffer.copy + + arguments + + + target + + tooltip + Target buffer to copy into. + type + buffer + + + + targetOffset + + tooltip + Offset in target buffer. + type + number + + + + source + + tooltip + Source buffer to copy from. + type + buffer + + + + sourceOffset + + tooltip + Offset in source buffer (optional). + type + number + + + + count + + tooltip + Number of bytes to copy (optional). + type + number + + + + energy + 10 + return + void + sleep + 0 + tooltip + Copies bytes from the source buffer into the target buffer. + + + vector + + energy + -1.0 + tooltip + vector namespace. + + vector.zero + + energy + 10 + return + vector + sleep + 0 + tooltip + Constant vector with all components set to 0. + + vector.one + + energy + 10 + return + vector + sleep + 0 + tooltip + Constant vector with all components set to 1. + + vector.create + + arguments + + + x + + tooltip + X component of the vector. + type + number + + + + y + + tooltip + Y component of the vector. + type + number + + + + z + + tooltip + Z component of the vector. + type + number + + + + w + + tooltip + W component of the vector (optional, defaults to 0 in 4-wide mode). + type + number + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Creates a new vector with the given component values. + + vector.magnitude + + arguments + + + vec + + tooltip + Input vector. + type + vector + + + + energy + 10 + return + number + sleep + 0 + tooltip + Calculates the magnitude of a given vector. + + vector.normalize + + arguments + + + vec + + tooltip + Input vector. + type + vector + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Computes the unit vector of a given vector. + + vector.cross + + arguments + + + vec1 + + tooltip + First input vector. + type + vector + + + + vec2 + + tooltip + Second input vector. + type + vector + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Computes the cross product of two vectors. + + vector.dot + + arguments + + + vec1 + + tooltip + First input vector. + type + vector + + + + vec2 + + tooltip + Second input vector. + type + vector + + + + energy + 10 + return + number + sleep + 0 + tooltip + Computes the dot product of two vectors. + + vector.angle + + arguments + + + vec1 + + tooltip + First input vector. + type + vector + + + + vec2 + + tooltip + Second input vector. + type + vector + + + + axis + + tooltip + Axis to determine the sign of the angle (optional). + type + vector + + + + energy + 10 + return + number + sleep + 0 + tooltip + Computes the angle between two vectors in radians. + + vector.floor + + arguments + + + vec + + tooltip + Input vector. + type + vector + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Applies math.floor to each component of the vector. + + vector.ceil + + arguments + + + vec + + tooltip + Input vector. + type + vector + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Applies math.ceil to each component of the vector. + + vector.abs + + arguments + + + vec + + tooltip + Input vector. + type + vector + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Applies math.abs to each component of the vector. + + vector.sign + + arguments + + + vec + + tooltip + Input vector. + type + vector + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Applies math.sign to each component of the vector. + + vector.clamp + + arguments + + + vec + + tooltip + Input vector to be clamped. + type + vector + + + + min + + tooltip + Minimum vector value. + type + vector + + + + max + + tooltip + Maximum vector value. + type + vector + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Clamps each component of the vector between min and max values. + + vector.max + + arguments + + + vectors + + tooltip + Multiple input vectors. + type + array of vector + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Computes the component-wise maximum of multiple vectors. + + vector.min + + arguments + + + vectors + + tooltip + Multiple input vectors. + type + array of vector + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Computes the component-wise minimum of multiple vectors. + + ll + + + energy + -1.0 + tooltip + ll namespace. + + ll.Abs + + arguments + + + Value + + tooltip + An integer value. + type + integer + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the absolute (positive) version of Value. + + ll.Acos + + arguments + + + Value + + tooltip + A floating-point value. + type + float + + + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the arc-cosine of Value, in radians. + + ll.AddToLandBanList + + arguments + + + ID + + tooltip + Agent UUID to add to ban-list. + type + key + + + + Hours + + tooltip + Period, in hours, to ban the avatar for. + type + float + + + + energy + 10 + return + void + sleep + 0.1000000000000000055511151 + tooltip + Add avatar ID to the parcel ban list for the specified number of Hours.\nA value of 0 for Hours will add the agent indefinitely.\nThe smallest value that Hours will accept is 0.01; anything smaller will be seen as 0.\nWhen values that small are used, it seems the function bans in approximately 30 second increments (Probably 36 second increments, as 0.01 of an hour is 36 seconds).\nResidents teleporting to a parcel where they are banned will be redirected to a neighbouring parcel. + + ll.AddToLandPassList + + arguments + + + ID + + tooltip + Agent UUID to add to pass-list. + type + key + + + + Hours + + tooltip + Period, in hours, to allow the avatar for. + type + float + + + + energy + 10 + return + void + sleep + 0.1000000000000000055511151 + tooltip + Add avatar ID to the land pass list, for a duration of Hours. + + ll.AdjustDamage + + arguments + + + Number + + tooltip + Damage event index to modify. + type + integer + + + + Damage + + tooltip + New damage amount to apply on this event. + type + float + + + + energy + 10 + return + void + sleep + 0 + tooltip + Changes the amount of damage to be delivered by this damage event. + + ll.AdjustSoundVolume + + arguments + + + Volume + + tooltip + The volume to set. + type + float + + + + energy + 10 + return + void + sleep + 0.1000000000000000055511151 + tooltip + Adjusts the volume (0.0 - 1.0) of the currently playing attached sound.\nThis function has no effect on sounds started with llTriggerSound. + + ll.AgentInExperience + + arguments + + + AgentID + + tooltip + + type + key + + + + energy + 10 + return + integer + sleep + 0 + tooltip + + Returns TRUE if the agent is in the Experience and the Experience can run in the current location. + + + ll.AllowInventoryDrop + + arguments + + + Flag + + tooltip + Boolean, If TRUE allows anyone to drop inventory on prim, FALSE revokes. + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + If Flag == TRUE, users without object modify permissions can still drop inventory items into the object. + + ll.AngleBetween + + arguments + + + Rot1 + + tooltip + First rotation. + type + rotation + + + + Rot2 + + tooltip + Second rotation. + type + rotation + + + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the angle, in radians, between rotations Rot1 and Rot2. + + ll.ApplyImpulse + + arguments + + + Force + + tooltip + Amount of impulse force to apply. + type + vector + + + + Local + + tooltip + Boolean, if TRUE, force is treated as a local directional vector instead of region directional vector. + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Applies impulse to the object.\nIf Local == TRUE, apply the Force in local coordinates; otherwise, apply the Force in global coordinates.\nThis function only works on physical objects. + + ll.ApplyRotationalImpulse + + arguments + + + Force + + tooltip + Amount of impulse force to apply. + type + vector + + + + Local + + tooltip + Boolean, if TRUE, uses local axis, if FALSE, uses region axis. + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Applies rotational impulse to the object.\nIf Local == TRUE, apply the Force in local coordinates; otherwise, apply the Force in global coordinates.\nThis function only works on physical objects. + + ll.Asin + + arguments + + + Value + + tooltip + A floating-point value. + type + float + + + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the arc-sine, in radians, of Value. + + ll.Atan2 + + arguments + + + y + + tooltip + A floating-point value. + type + float + + + + x + + tooltip + A floating-point value. + type + float + + + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the arc-tangent2 of y, x. + + ll.AttachToAvatar + + arguments + + + AttachmentPoint + + tooltip + + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Attach to avatar at point AttachmentPoint.\nRequires the PERMISSION_ATTACH runtime permission. + + ll.AttachToAvatarTemp + + arguments + + + AttachPoint + + tooltip + Valid attachment point or ATTACH_* constant. + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Follows the same convention as llAttachToAvatar, with the exception that the object will not create new inventory for the user, and will disappear on detach or disconnect. + + ll.AvatarOnLinkSitTarget + + arguments + + + LinkNumber + + tooltip + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag. + type + integer + + + + energy + 10 + return + key + sleep + 0 + tooltip + If an avatar is sitting on the link's sit target, return the avatar's key, NULL_KEY otherwise.\nReturns a key that is the UUID of the user seated on the specified link's prim. + + ll.AvatarOnSitTarget + + arguments + + energy + 10 + return + key + sleep + 0 + tooltip + If an avatar is seated on the sit target, returns the avatar's key, otherwise NULL_KEY.\nThis only will detect avatars sitting on sit targets defined with llSitTarget. + + ll.Axes2Rot + + arguments + + + Forward + + tooltip + Forward/Back part of rotation. + type + vector + + + + Left + + tooltip + Left/Right part of rotation. + type + vector + + + + Up + + tooltip + Up/Down part of rotation. + type + vector + + + + energy + 10 + return + rotation + sleep + 0 + tooltip + Returns the rotation represented by coordinate axes Forward, Left, and Up. + + ll.AxisAngle2Rot + + arguments + + + Axis + + tooltip + Axis. + type + vector + + + + Angle + + tooltip + Angle in radians. + type + float + + + + energy + 10 + return + rotation + sleep + 0 + tooltip + Returns the rotation that is a generated Angle about Axis. + + ll.Base64ToInteger + + arguments + + + Text + + tooltip + + type + string + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns an integer that is the Text, Base64 decoded as a big endian integer.\nReturns zero if Text is longer then 8 characters. If Text contains fewer then 6 characters, the return value is unpredictable. + + ll.Base64ToString + + arguments + + + Text + + tooltip + + type + string + + + + energy + 10 + return + string + sleep + 0 + tooltip + Converts a Base64 string to a conventional string.\nIf the conversion creates any unprintable characters, they are converted to question marks. + + ll.BreakAllLinks + + arguments + + energy + 10 + return + void + sleep + 0 + tooltip + De-links all prims in the link set (requires permission PERMISSION_CHANGE_LINKS be set). + + ll.BreakLink + + arguments + + + LinkNumber + + tooltip + + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + De-links the prim with the given link number (requires permission PERMISSION_CHANGE_LINKS be set). + + ll.CSV2List + + arguments + + + Text + + tooltip + + type + string + + + + energy + 10 + return + list + sleep + 0 + tooltip + Create a list from a string of comma separated values specified in Text. + + ll.CastRay + + arguments + + + Start + + tooltip + + type + vector + + + + End + + tooltip + + type + vector + + + + Options + + tooltip + + type + list + + + + energy + 10 + return + list + sleep + 0 + tooltip + Casts a ray into the physics world from 'start' to 'end' and returns data according to details in Options.\nReports collision data for intersections with objects.\nReturn value: [UUID_1, {link_number_1}, hit_position_1, {hit_normal_1}, UUID_2, {link_number_2}, hit_position_2, {hit_normal_2}, ... , status_code] where {} indicates optional data. + + ll.Ceil + + arguments + + + Value + + tooltip + + type + float + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns smallest integer value >= Value. + + ll.Char + + arguments + + + value + + tooltip + Unicode value to convert into a string. + type + integer + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns a single character string that is the representation of the unicode value. + + ll.ClearCameraParams + + arguments + + energy + 10 + return + void + sleep + 0 + tooltip + Resets all camera parameters to default values and turns off scripted camera control. + + ll.ClearLinkMedia + + arguments + + + Link + + tooltip + + type + integer + + + + Face + + tooltip + + type + integer + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Clears (deletes) the media and all parameters from the given Face on the linked prim.\nReturns an integer that is a STATUS_* flag, which details the success/failure of the operation. + + ll.ClearPrimMedia + + arguments + + + Face + + tooltip + Number of side to clear. + type + integer + + + + energy + 10 + return + integer + sleep + 1 + tooltip + Clears (deletes) the media and all parameters from the given Face.\nReturns an integer that is a STATUS_* flag which details the success/failure of the operation. + + ll.CloseRemoteDataChannel + + arguments + + + ChannelID + + tooltip + + type + key + + + + energy + 10 + return + void + sleep + 1 + tooltip + This function is deprecated. + + ll.Cloud + + arguments + + + Offset + + tooltip + + type + vector + + + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the cloud density at the object's position + Offset. + + ll.CollisionFilter + + arguments + + + ObjectName + + tooltip + + type + string + + + + ObjectID + + tooltip + + type + key + + + + Accept + + tooltip + If TRUE, only accept collisions with ObjectName name AND ObjectID (either is optional), otherwise with objects not ObjectName AND ObjectID. + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Specify an empty string or NULL_KEY for Accept, to not filter on the corresponding parameter. + + ll.CollisionSound + + arguments + + + ImpactSound + + tooltip + + type + string + + + + ImpactVolume + + tooltip + + type + float + + + + energy + 10 + return + void + sleep + 0 + tooltip + Suppress default collision sounds, replace default impact sounds with ImpactSound.\nThe ImpactSound must be in the object inventory.\nSupply an empty string to suppress collision sounds. + + ll.CollisionSprite + + arguments + + + ImpactSprite + + tooltip + + type + string + + + + energy + 10 + return + void + sleep + 0 + tooltip + Suppress default collision sprites, replace default impact sprite with ImpactSprite; found in the object inventory (empty string to just suppress). + + ll.ComputeHash + + arguments + + + Message + + tooltip + The message to be hashed. + type + string + + + + Algorithm + + tooltip + The digest algorithm: md5, sha1, sha224, sha256, sha384, sha512. + type + string + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns hex-encoded Hash string of Message using digest Algorithm. + + ll.Cos + + arguments + + + Theta + + tooltip + + type + float + + + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the cosine of Theta (Theta in radians). + + ll.CreateCharacter + + arguments + + + Options + + tooltip + + type + list + + + + energy + 10 + return + void + sleep + 0 + tooltip + Convert link-set to AI/Physics character.\nCreates a path-finding entity, known as a "character", from the object containing the script. Required to activate use of path-finding functions.\nOptions is a list of key/value pairs. + + ll.CreateKeyValue + + arguments + + + Key + + tooltip + + type + string + + + + Value + + tooltip + + type + string + + + + energy + 10 + return + key + sleep + 0 + tooltip + + Starts an asychronous transaction to create a key-value pair. Will fail with XP_ERROR_STORAGE_EXCEPTION if the key already exists. The dataserver callback will be executed with the key returned from this call and a string describing the result. The result is a two element commma-delimited list. The first item is an integer specifying if the transaction succeeded (1) or not (0). In the failure case, the second item will be an integer corresponding to one of the XP_ERROR_... constants. In the success case the second item will be the value passed to the function. + + + ll.CreateLink + + arguments + + + TargetPrim + + tooltip + Object UUID that is in the same region. + type + key + + + + Parent + + tooltip + If FALSE, then TargetPrim becomes the root. If TRUE, then the script's object becomes the root. + type + integer + + + + energy + 10 + return + void + sleep + 0.1000000000000000055511151 + tooltip + Attempt to link the object the script is in, to target (requires permission PERMISSION_CHANGE_LINKS be set).\nRequires permission PERMISSION_CHANGE_LINKS be set. + + ll.Damage + + arguments + + + target + + tooltip + Agent or task to receive damage. + type + key + + + + damage + + tooltip + Damage amount to inflict on this target. + type + float + + + + type + + tooltip + Damage type to inflict on this target. + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Generates a damage event on the targeted agent or task. + + ll.DataSizeKeyValue + + arguments + + energy + 10 + return + key + sleep + 0 + tooltip + + Starts an asychronous transaction the request the used and total amount of data allocated for the Experience. The dataserver callback will be executed with the key returned from this call and a string describing the result. The result is commma-delimited list. The first item is an integer specifying if the transaction succeeded (1) or not (0). In the failure case, the second item will be an integer corresponding to one of the XP_ERROR_... constants. In the success case the second item will be the the amount in use and the third item will be the total available. + + + ll.DeleteCharacter + + arguments + + energy + 10 + return + void + sleep + 0 + tooltip + Convert link-set from AI/Physics character to Physics object.\nConvert the current link-set back to a standard object, removing all path-finding properties. + + ll.DeleteKeyValue + + arguments + + + Key + + tooltip + + type + string + + + + energy + 10 + return + key + sleep + 0 + tooltip + + Starts an asychronous transaction to delete a key-value pair. The dataserver callback will be executed with the key returned from this call and a string describing the result. The result is a two element commma-delimited list. The first item is an integer specifying if the transaction succeeded (1) or not (0). In the failure case, the second item will be an integer corresponding to one of the XP_ERROR_... constants. In the success case the second item will be the value associated with the key. + + + ll.DeleteSubList + + arguments + + + Source + + tooltip + + type + list + + + + Start + + tooltip + + type + integer + + + + End + + tooltip + + type + integer + + + + energy + 10 + return + list + sleep + 0 + tooltip + Removes the slice from start to end and returns the remainder of the list.\nRemove a slice from the list and return the remainder, start and end are inclusive.\nUsing negative numbers for start and/or end causes the index to count backwards from the length of the list, so 0, -1 would delete the entire list.\nIf Start is larger than End the list deleted is the exclusion of the entries; so 6, 4 would delete the entire list except for the 5th. list entry. + + ll.DeleteSubString + + arguments + + + Source + + tooltip + + type + string + + + + Start + + tooltip + + type + integer + + + + End + + tooltip + + type + integer + + + + energy + 10 + return + string + sleep + 0 + tooltip + Removes the indicated sub-string and returns the result.\nStart and End are inclusive.\nUsing negative numbers for Start and/or End causes the index to count backwards from the length of the string, so 0, -1 would delete the entire string.\nIf Start is larger than End, the sub-string is the exclusion of the entries; so 6, 4 would delete the entire string except for the 5th. character. + + ll.DerezObject + + arguments + + + ID + + tooltip + The ID of an object in the region. + type + key + + + + flags + + tooltip + Flags for derez behavior. + type + integer + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Derezzes an object previously rezzed by a script in this region. Returns TRUE on success or FALSE if the object could not be derezzed. + + ll.DetachFromAvatar + + arguments + + energy + 10 + return + void + sleep + 0 + tooltip + Remove the object containing the script from the avatar. + + ll.DetectedDamage + + arguments + + + Number + + tooltip + + type + integer + + + + energy + 10 + return + list + sleep + 0 + tooltip + Returns a list containing the current damage for the event, the damage type and the original damage delivered. + + ll.DetectedGrab + + arguments + + + Number + + tooltip + + type + integer + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the grab offset of a user touching the object.\nReturns <0.0, 0.0, 0.0> if Number is not a valid object. + + ll.DetectedGroup + + arguments + + + Number + + tooltip + + type + integer + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns TRUE if detected object or agent Number has the same user group active as this object.\nIt will return FALSE if the object or agent is in the group, but the group is not active. + + ll.DetectedKey + + arguments + + + Number + + tooltip + + type + integer + + + + energy + 10 + return + key + sleep + 0 + tooltip + Returns the key of detected object or avatar number.\nReturns NULL_KEY if Number is not a valid index. + + ll.DetectedLinkNumber + + arguments + + + Number + + tooltip + + type + integer + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the link position of the triggered event for touches and collisions only.\n0 for a non-linked object, 1 for the root of a linked object, 2 for the first child, etc. + + ll.DetectedName + + arguments + + + Number + + tooltip + + type + integer + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the name of detected object or avatar number.\nReturns the name of detected object number.\nReturns empty string if Number is not a valid index. + + ll.DetectedOwner + + arguments + + + Number + + tooltip + + type + integer + + + + energy + 10 + return + key + sleep + 0 + tooltip + Returns the key of detected object's owner.\nReturns invalid key if Number is not a valid index. + + ll.DetectedPos + + arguments + + + Number + + tooltip + + type + integer + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the position of detected object or avatar number.\nReturns <0.0, 0.0, 0.0> if Number is not a valid index. + + ll.DetectedRezzer + + arguments + + + Number + + tooltip + + type + integer + + + + energy + 10 + return + key + sleep + 0 + tooltip + Returns the key for the rezzer of the detected object. + + ll.DetectedRot + + arguments + + + Number + + tooltip + + type + integer + + + + energy + 10 + return + rotation + sleep + 0 + tooltip + Returns the rotation of detected object or avatar number.\nReturns <0.0, 0.0, 0.0, 1.0> if Number is not a valid offset. + + ll.DetectedTouchBinormal + + arguments + + + Index + + tooltip + Index of detection information + type + integer + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the surface bi-normal for a triggered touch event.\nReturns a vector that is the surface bi-normal (tangent to the surface) where the touch event was triggered. + + ll.DetectedTouchFace + + arguments + + + Index + + tooltip + Index of detection information + type + integer + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the index of the face where the avatar clicked in a triggered touch event. + + ll.DetectedTouchNormal + + arguments + + + Index + + tooltip + Index of detection information + type + integer + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the surface normal for a triggered touch event.\nReturns a vector that is the surface normal (perpendicular to the surface) where the touch event was triggered. + + ll.DetectedTouchPos + + arguments + + + Index + + tooltip + Index of detected information + type + integer + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the position, in region coordinates, where the object was touched in a triggered touch event.\nUnless it is a HUD, in which case it returns the position relative to the attach point. + + ll.DetectedTouchST + + arguments + + + Index + + tooltip + Index of detection information + type + integer + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns a vector that is the surface coordinates where the prim was touched.\nThe X and Y vector positions contain the horizontal (S) and vertical (T) face coordinates respectively.\nEach component is in the interval [0.0, 1.0].\nTOUCH_INVALID_TEXCOORD is returned if the surface coordinates cannot be determined (e.g. when the viewer does not support this function). + + ll.DetectedTouchUV + + arguments + + + Index + + tooltip + Index of detection information + type + integer + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns a vector that is the texture coordinates for where the prim was touched.\nThe X and Y vector positions contain the U and V face coordinates respectively.\nTOUCH_INVALID_TEXCOORD is returned if the touch UV coordinates cannot be determined (e.g. when the viewer does not support this function). + + ll.DetectedType + + arguments + + + Number + + tooltip + + type + integer + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the type (AGENT, ACTIVE, PASSIVE, SCRIPTED) of detected object.\nReturns 0 if number is not a valid index.\nNote that number is a bit-field, so comparisons need to be a bitwise checked. e.g.:\ninteger iType = llDetectedType(0);\n{\n // ...do stuff with the agent\n} + + ll.DetectedVel + + arguments + + + Number + + tooltip + + type + integer + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the velocity of the detected object Number.\nReturns<0.0, 0.0, 0.0> if Number is not a valid offset. + + ll.Dialog + + arguments + + + AvatarID + + tooltip + + type + key + + + + Text + + tooltip + + type + string + + + + Buttons + + tooltip + + type + list + + + + Channel + + tooltip + + type + integer + + + + energy + 10 + return + void + sleep + 1 + tooltip + + Shows a dialog box on the avatar's screen with the message.\n + Up to 12 strings in the list form buttons.\n + If a button is clicked, the name is chatted on Channel.\nOpens a "notify box" in the given avatars screen displaying the message.\n + Up to twelve buttons can be specified in a list of strings. When the user clicks a button, the name of the button is said on the specified channel.\n + Channels work just like llSay(), so channel 0 can be heard by everyone.\n + The chat originates at the object's position, not the avatar's position, even though it is said as the avatar (uses avatar's UUID and Name etc.).\n + Examples:\n + llDialog(who, "Are you a boy or a girl?", [ "Boy", "Girl" ], -4913);\n + llDialog(who, "This shows only an OK button.", [], -192);\n + llDialog(who, "This chats so you can 'hear' it.", ["Hooray"], 0); + + + ll.Die + + arguments + + energy + 0 + return + void + sleep + 0 + tooltip + Delete the object which holds the script. + + ll.DumpList2String + + arguments + + + Source + + tooltip + + type + list + + + + Separator + + tooltip + + type + string + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the list as a single string, using Separator between the entries.\nWrite the list out as a single string, using Separator between values. + + ll.EdgeOfWorld + + arguments + + + Position + + tooltip + + type + vector + + + + Direction + + tooltip + + type + vector + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Checks to see whether the border hit by Direction from Position is the edge of the world (has no neighboring region).\nReturns TRUE if the line along Direction from Position hits the edge of the world in the current simulator, returns FALSE if that edge crosses into another simulator. + + ll.EjectFromLand + + arguments + + + AvatarID + + tooltip + + type + key + + + + energy + 10 + return + void + sleep + 0 + tooltip + Ejects AvatarID from land that you own.\nEjects AvatarID from land that the object owner (group or resident) owns. + + ll.Email + + arguments + + + Address + + tooltip + + type + string + + + + Subject + + tooltip + + type + string + + + + Text + + tooltip + + type + string + + + + energy + 10 + return + void + sleep + 20 + tooltip + Sends email to Address with Subject and Message.\nSends an email to Address with Subject and Message. + + ll.EscapeURL + + arguments + + + URL + + tooltip + + type + string + + + + energy + 10 + return + string + sleep + 0 + tooltip + + Returns an escaped/encoded version of url, replacing spaces with %20 etc.\nReturns the string that is the URL-escaped version of URL (replacing spaces with %20, etc.).\n + This function returns the UTF-8 encoded escape codes for selected characters. + + + ll.Euler2Rot + + arguments + + + Vector + + tooltip + + type + vector + + + + energy + 10 + return + rotation + sleep + 0 + tooltip + Returns the rotation representation of the Euler angles.\nReturns the rotation represented by the Euler Angle. + + ll.Evade + + arguments + + + TargetID + + tooltip + Agent or object to evade. + type + key + + + + Options + + tooltip + No options yet. + type + list + + + + energy + 10 + return + void + sleep + 0 + tooltip + Evade a specified target.\nCharacters will (roughly) try to hide from their pursuers if there is a good hiding spot along their fleeing path. Hiding means no direct line of sight from the head of the character (centre of the top of its physics bounding box) to the head of its pursuer and no direct path between the two on the navigation-mesh. + + ll.ExecCharacterCmd + + arguments + + + Command + + tooltip + Command to send. + type + integer + + + + Options + + tooltip + Height for CHARACTER_CMD_JUMP. + type + list + + + + energy + 10 + return + void + sleep + 0 + tooltip + Execute a character command.\nSend a command to the path system.\nCurrently only supports stopping the current path-finding operation or causing the character to jump. + + ll.Fabs + + arguments + + + Value + + tooltip + + type + float + + + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the positive version of Value.\nReturns the absolute value of Value. + + ll.FindNotecardTextCount + + arguments + + + NotecardName + + tooltip + + type + string + + + + Pattern + + tooltip + Regex pattern to find in the notecard text. + type + string + + + + Options + + tooltip + A list of options to control the search. Included for future expansion, should be [] + type + list + + + + energy + 10 + return + key + sleep + 0 + tooltip + + Searches the text of a cached notecard for lines containing the given pattern and returns the + number of matches found through a dataserver event. + + + ll.FindNotecardTextSync + + arguments + + + NotecardName + + tooltip + + type + string + + + + Pattern + + tooltip + Regex pattern to find in the notecard text. + type + string + + + + StartMatch + + tooltip + The number of matches to skip before returning values. + type + integer + + + + Count + + tooltip + The maximum number of matches to return. If 0 this function will return the first 64 matches found. + type + integer + + + + Options + + tooltip + A list of options to control the search. Included for future expansion, should be [] + type + list + + + + energy + 10 + return + list + sleep + 0 + tooltip + + Searches the text of a cached notecard for lines containing the given pattern. + Returns a list of line numbers and column where a match is found. If the notecard is not in + the cache it returns a list containing a single entry of NAK. If no matches are found an + empty list is returned. + + + ll.FleeFrom + + arguments + + + Source + + tooltip + Global coordinate from which to flee. + type + vector + + + + Distance + + tooltip + Distance in meters to flee from the source. + type + float + + + + Options + + tooltip + No options available at this time. + type + list + + + + energy + 10 + return + void + sleep + 0 + tooltip + Flee from a point.\nDirects a character (llCreateCharacter) to keep away from a defined position in the region or adjacent regions. + + ll.Floor + + arguments + + + Value + + tooltip + + type + float + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns largest integer value <= Value. + + ll.ForceMouselook + + arguments + + + Enable + + tooltip + Boolean, if TRUE when an avatar sits on the prim, the avatar will be forced into mouse-look mode.\nFALSE is the default setting and will undo a previously set TRUE or do nothing. + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + If Enable is TRUE any avatar that sits on this object is forced into mouse-look mode.\nAfter calling this function with Enable set to TRUE, any agent sitting down on the prim will be forced into mouse-look.\nJust like llSitTarget, this changes a permanent property of the prim (not the object) and needs to be reset by calling this function with Enable set to FALSE in order to disable it. + + ll.Frand + + arguments + + + Magnitude + + tooltip + + type + float + + + + energy + 10 + return + float + sleep + 0 + tooltip + Returns a pseudo random number in the range [0, Magnitude] or [Magnitude, 0].\nReturns a pseudo-random number between [0, Magnitude]. + + ll.GenerateKey + + arguments + + energy + 10 + return + key + sleep + 0 + tooltip + Generates a key (SHA-1 hash) using UUID generation to create a unique key.\nAs the UUID produced is versioned, it should never return a value of NULL_KEY.\nThe specific UUID version is an implementation detail that has changed in the past and may change again in the future. Do not depend upon the UUID that is returned to be version 5 SHA-1 hash. + + ll.GetAccel + + arguments + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the acceleration of the object relative to the region's axes.\nGets the acceleration of the object. + + ll.GetAgentInfo + + arguments + + + AvatarID + + tooltip + + type + key + + + + energy + 10 + return + integer + sleep + 0 + tooltip + + Returns an integer bit-field containing the agent information about id.\n + Returns AGENT_FLYING, AGENT_ATTACHMENTS, AGENT_SCRIPTED, AGENT_SITTING, AGENT_ON_OBJECT, AGENT_MOUSELOOK, AGENT_AWAY, AGENT_BUSY, AGENT_TYPING, AGENT_CROUCHING, AGENT_ALWAYS_RUN, AGENT_WALKING, AGENT_IN_AIR and/or AGENT_FLOATING_VIA_SCRIPTED_ATTACHMENT.\nReturns information about the given agent ID as a bit-field of agent info constants. + + + ll.GetAgentLanguage + + arguments + + + AvatarID + + tooltip + + type + key + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the language code of the preferred interface language of the avatar.\nReturns a string that is the language code of the preferred interface language of the resident. + + ll.GetAgentList + + arguments + + + Scope + + tooltip + The scope (region, parcel, parcel same owner) to return agents for. + type + integer + + + + Options + + tooltip + List of options to apply. Current unused. + type + list + + + + energy + 10 + return + list + sleep + 0 + tooltip + Requests a list of agents currently in the region, limited by the scope parameter.\nReturns a list [key UUID-0, key UUID-1, ..., key UUID-n] or [string error_msg] - returns avatar keys for all agents in the region limited to the area(s) specified by scope + + ll.GetAgentSize + + arguments + + + AvatarID + + tooltip + + type + key + + + + energy + 10 + return + vector + sleep + 0 + tooltip + If the avatar is in the same region, returns the size of the bounding box of the requested avatar by id, otherwise returns ZERO_VECTOR.\nIf the agent is in the same region as the object, returns the size of the avatar. + + ll.GetAlpha + + arguments + + + Face + + tooltip + + type + integer + + + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the alpha value of Face.\nReturns the 'alpha' of the given face. If face is ALL_SIDES the value returned is the mean average of all faces. + + ll.GetAndResetTime + + arguments + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the script time in seconds and then resets the script timer to zero.\nGets the time in seconds since starting and resets the time to zero. + + ll.GetAnimation + + arguments + + + AvatarID + + tooltip + + type + key + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the name of the currently playing locomotion animation for the avatar id.\nReturns the currently playing animation for the specified avatar ID. + + ll.GetAnimationList + + arguments + + + AvatarID + + tooltip + + type + key + + + + energy + 10 + return + list + sleep + 0 + tooltip + Returns a list of keys of playing animations for an avatar.\nReturns a list of keys of all playing animations for the specified avatar ID. + + ll.GetAnimationOverride + + arguments + + + AnimationState + + tooltip + + type + string + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns a string that is the name of the animation that is used for the specified animation state\nTo use this function the script must obtain either the PERMISSION_OVERRIDE_ANIMATIONS or PERMISSION_TRIGGER_ANIMATION permission (automatically granted to attached objects). + + ll.GetAttached + + arguments + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the object's attachment point, or 0 if not attached. + + ll.GetAttachedList + + arguments + + + ID + + tooltip + Avatar to get attachments + type + key + + + + energy + 10 + return + list + sleep + 0 + tooltip + Returns a list of keys of all visible (not HUD) attachments on the avatar identified by the ID argument + + ll.GetAttachedListFiltered + + arguments + + + AgentID + + tooltip + An agent in the region. + type + key + + + + Options + + tooltip + A list of option for inventory transfer. + type + list + + + + energy + 10 + return + list + sleep + 0 + tooltip + Retrieves a list of attachments on an avatar. + + ll.GetBoundingBox + + arguments + + + ID + + tooltip + + type + key + + + + energy + 10 + return + list + sleep + 0 + tooltip + Returns the bounding box around the object (including any linked prims) relative to its root prim, as a list in the format [ (vector) min_corner, (vector) max_corner ]. + + ll.GetCameraAspect + + arguments + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the current camera aspect ratio (width / height) of the agent who has granted the scripted object PERMISSION_TRACK_CAMERA permissions. If no permissions have been granted: it returns zero. + + ll.GetCameraFOV + + arguments + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the current camera field of view of the agent who has granted the scripted object PERMISSION_TRACK_CAMERA permissions. If no permissions have been granted: it returns zero. + + ll.GetCameraPos + + arguments + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the current camera position for the agent the task has permissions for.\nReturns the position of the camera, of the user that granted the script PERMISSION_TRACK_CAMERA. If no user has granted the permission, it returns ZERO_VECTOR. + + ll.GetCameraRot + + arguments + + energy + 10 + return + rotation + sleep + 0 + tooltip + Returns the current camera orientation for the agent the task has permissions for. If no user has granted the PERMISSION_TRACK_CAMERA permission, returns ZERO_ROTATION. + + ll.GetCenterOfMass + + arguments + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the prim's centre of mass (unless called from the root prim, where it returns the object's centre of mass). + + ll.GetClosestNavPoint + + arguments + + + Point + + tooltip + A point in region-local space. + type + vector + + + + Options + + tooltip + No options at this time. + type + list + + + + energy + 10 + return + list + sleep + 0 + tooltip + Get the closest navigable point to the point provided.\nThe function accepts a point in region-local space (like all the other path-finding methods) and returns either an empty list or a list containing a single vector which is the closest point on the navigation-mesh to the point provided. + + ll.GetColor + + arguments + + + Face + + tooltip + + type + integer + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the color on Face.\nReturns the color of Face as a vector of red, green, and blue values between 0 and 1. If face is ALL_SIDES the color returned is the mean average of each channel. + + ll.GetCreator + + arguments + + energy + 10 + return + key + sleep + 0 + tooltip + Returns a key for the creator of the prim.\nReturns the key of the object's original creator. Similar to llGetOwner. + + ll.GetDate + + arguments + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the current date in the UTC time zone in the format YYYY-MM-DD.\nReturns the current UTC date as YYYY-MM-DD. + + ll.GetDayLength + + arguments + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the number of seconds in a day on this parcel. + + ll.GetDayOffset + + arguments + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the number of seconds in a day is offset from midnight in this parcel. + + ll.GetDisplayName + + arguments + + + AvatarID + + tooltip + Avatar UUID that is in the same region, or is otherwise known to the region. + type + key + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the display name of an avatar, if the avatar is connected to the current region, or if the name has been cached. Otherwise, returns an empty string. Use llRequestDisplayName if the avatar may be absent from the region. + + ll.GetEnergy + + arguments + + energy + 10 + return + float + sleep + 0 + tooltip + Returns how much energy is in the object as a percentage of maximum. + + ll.GetEnv + + arguments + + + DataRequest + + tooltip + The type of data to request. Any other string will cause an empty string to be returned. + type + string + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns a string with the requested data about the region. + + ll.GetEnvironment + + arguments + + + Position + + tooltip + Location within the region. + type + vector + + + + EnvParams + + tooltip + List of environment settings requested for the specified parcel location. + type + list + + + + energy + 10 + return + list + sleep + 0 + tooltip + Returns a string with the requested data about the region. + + ll.GetExperienceDetails + + arguments + + + ExperienceID + + tooltip + May be NULL_KEY to retrieve the details for the script's Experience + type + key + + + + energy + 10 + return + list + sleep + 0 + tooltip + + Returns a list with the following Experience properties: [Experience Name, Owner ID, Group ID, Experience ID, State, State Message]. State is an integer corresponding to one of the constants XP_ERROR_... and State Message is the string returned by llGetExperienceErrorMessage for that integer. + + + ll.GetExperienceErrorMessage + + arguments + + + Error + + tooltip + An Experience error code to translate. + type + integer + + + + energy + 10 + return + string + sleep + 0 + tooltip + + Returns a string describing the error code passed or the string corresponding with XP_ERROR_UNKNOWN_ERROR if the value is not a valid Experience error code. + + + ll.GetForce + + arguments + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the force (if the script is physical).\nReturns the current force if the script is physical. + + ll.GetFreeMemory + + arguments + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the number of free bytes of memory the script can use.\nReturns the available free space for the current script. This is inaccurate with LSO. + + ll.GetFreeURLs + + arguments + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the number of available URLs for the current script.\nReturns an integer that is the number of available URLs. + + ll.GetGMTclock + + arguments + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the time in seconds since midnight GMT.\nGets the time in seconds since midnight in GMT/UTC. + + ll.GetGeometricCenter + + arguments + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the vector that is the geometric center of the object relative to the root prim. + + ll.GetHTTPHeader + + arguments + + + HTTPRequestID + + tooltip + A valid HTTP request key + type + key + + + + Header + + tooltip + Header value name + type + string + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the value for header for request_id.\nReturns a string that is the value of the Header for HTTPRequestID. + + ll.GetHealth + + arguments + + + ID + + tooltip + The ID of an agent or object in the region. + type + key + + + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the current health of an avatar or object in the region. + + ll.GetInventoryAcquireTime + + arguments + + + InventoryItem + + tooltip + Name of item in prim inventory. + type + string + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the time at which the item was placed into this prim's inventory as a timestamp. + + ll.GetInventoryCreator + + arguments + + + InventoryItem + + tooltip + + type + string + + + + energy + 10 + return + key + sleep + 0 + tooltip + Returns a key for the creator of the inventory item.\nThis function returns the UUID of the creator of item. If item is not found in inventory, the object says "No item named 'name'". + + ll.GetInventoryDesc + + arguments + + + InventoryItem + + tooltip + + type + string + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the item description of the item in inventory. If item is not found in inventory, the object says "No item named 'name'" to the debug channel and returns an empty string. + + ll.GetInventoryKey + + arguments + + + InventoryItem + + tooltip + + type + string + + + + energy + 10 + return + key + sleep + 0 + tooltip + Returns the key that is the UUID of the inventory named.\nReturns the key of the inventory named. + + ll.GetInventoryName + + arguments + + + InventoryType + + tooltip + Inventory item type + type + integer + + + + Index + + tooltip + Index number of inventory item. + type + integer + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the name of the inventory item of a given type, specified by index number.\nUse the inventory constants INVENTORY_* to specify the type. + + ll.GetInventoryNumber + + arguments + + + InventoryType + + tooltip + Inventory item type + type + integer + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the quantity of items of a given type (INVENTORY_* flag) in the prim's inventory.\nUse the inventory constants INVENTORY_* to specify the type. + + ll.GetInventoryPermMask + + arguments + + + InventoryItem + + tooltip + Inventory item name. + type + string + + + + BitMask + + tooltip + MASK_BASE, MASK_OWNER, MASK_GROUP, MASK_EVERYONE or MASK_NEXT + type + integer + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the requested permission mask for the inventory item.\nReturns the requested permission mask for the inventory item defined by InventoryItem. If item is not in the object's inventory, llGetInventoryPermMask returns FALSE and causes the object to say "No item named '<item>'", where "<item>" is item. + + ll.GetInventoryType + + arguments + + + InventoryItem + + tooltip + + type + string + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the type of the named inventory item.\nLike all inventory functions, llGetInventoryType is case-sensitive. + + ll.GetKey + + arguments + + energy + 10 + return + key + sleep + 0 + tooltip + Returns the key of the prim the script is attached to.\nGet the key for the object which has this script. + + ll.GetLandOwnerAt + + arguments + + + Position + + tooltip + + type + vector + + + + energy + 10 + return + key + sleep + 0 + tooltip + Returns the key of the land owner, returns NULL_KEY if public.\nReturns the key of the land owner at Position, or NULL_KEY if public. + + ll.GetLinkKey + + arguments + + + LinkNumber + + tooltip + + type + integer + + + + energy + 10 + return + key + sleep + 0 + tooltip + Returns the key of the linked prim LinkNumber.\nReturns the key of LinkNumber in the link set. + + ll.GetLinkMedia + + arguments + + + LinkNumber + + tooltip + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag + type + integer + + + + Face + + tooltip + The prim's side number + type + integer + + + + Parameters + + tooltip + A list of PRIM_* property constants to return values of. + type + list + + + + energy + 10 + return + list + sleep + 0 + tooltip + Get the media parameters for a particular face on linked prim, given the desired list of parameter names. Returns a list of values in the order requested. Returns an empty list if no media exists on the face. + + ll.GetLinkName + + arguments + + + LinkNumber + + tooltip + + type + integer + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the name of LinkNumber in a link set.\nReturns the name of LinkNumber the link set. + + ll.GetLinkNumber + + arguments + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the link number of the prim containing the script (0 means not linked, 1 the prim is the root, 2 the prim is the first child, etc.).\nReturns the link number of the prim containing the script. 0 means no link, 1 the root, 2 for first child, etc. + + ll.GetLinkNumberOfSides + + arguments + + + LinkNumber + + tooltip + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag. + type + integer + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the number of sides of the specified linked prim.\nReturns an integer that is the number of faces (or sides) of the prim link. + + ll.GetLinkPrimitiveParams + + arguments + + + LinkNumber + + tooltip + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag. + type + integer + + + + Parameters + + tooltip + PRIM_* flags. + type + list + + + + energy + 10 + return + list + sleep + 0 + tooltip + Returns the list of primitive attributes requested in the Parameters list for LinkNumber.\nPRIM_* flags can be broken into three categories, face flags, prim flags, and object flags.\n* Supplying a prim or object flag will return that flags attributes.\n* Face flags require the user to also supply a face index parameter. + + ll.GetLinkSitFlags + + arguments + + + LinkNumber + + tooltip + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag. + type + integer + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the sit flags set on the specified prim in a linkset. + + ll.GetListEntryType + + arguments + + + ListVariable + + tooltip + + type + list + + + + Index + + tooltip + + type + integer + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the type of the index entry in the list (TYPE_INTEGER, TYPE_FLOAT, TYPE_STRING, TYPE_KEY, TYPE_VECTOR, TYPE_ROTATION, or TYPE_INVALID if index is off list).\nReturns the type of the variable at Index in ListVariable. + + ll.GetListLength + + arguments + + + ListVariable + + tooltip + + type + list + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the number of elements in the list.\nReturns the number of elements in ListVariable. + + ll.GetLocalPos + + arguments + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the position relative to the root.\nReturns the local position of a child object relative to the root. + + ll.GetLocalRot + + arguments + + energy + 10 + return + rotation + sleep + 0 + tooltip + Returns the rotation local to the root.\nReturns the local rotation of a child object relative to the root. + + ll.GetMass + + arguments + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the mass of object that the script is attached to.\nReturns the scripted object's mass. When called from a script in a link-set, the parent will return the sum of the link-set weights, while a child will return just its own mass. When called from a script inside an attachment, this function will return the mass of the avatar it's attached to, not its own. + + ll.GetMassMKS + + arguments + + energy + 10 + return + float + sleep + 0 + tooltip + Acts as llGetMass(), except that the units of the value returned are Kg. + + ll.GetMaxScaleFactor + + arguments + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the largest multiplicative uniform scale factor that can be successfully applied (via llScaleByFactor()) to the object without violating prim size or linkability rules. + + ll.GetMemoryLimit + + arguments + + energy + 10 + return + integer + sleep + 0 + tooltip + Get the maximum memory a script can use, in bytes. + + ll.GetMinScaleFactor + + arguments + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the smallest multiplicative uniform scale factor that can be successfully applied (via llScaleByFactor()) to the object without violating prim size or linkability rules. + + ll.GetMoonDirection + + arguments + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns a normalized vector of the direction of the moon in the parcel.\nReturns the moon's direction on the simulator in the parcel. + + ll.GetMoonRotation + + arguments + + energy + 10 + return + rotation + sleep + 0 + tooltip + Returns the rotation applied to the moon in the parcel. + + ll.GetNextEmail + + arguments + + + Address + + tooltip + + type + string + + + + Subject + + tooltip + + type + string + + + + energy + 10 + return + void + sleep + 0 + tooltip + Fetch the next queued email with that matches the given address and/or subject, via the email event.\nIf the parameters are blank, they are not used for filtering. + + ll.GetNotecardLine + + arguments + + + NotecardName + + tooltip + + type + string + + + + LineNumber + + tooltip + + type + integer + + + + energy + 10 + return + key + sleep + 0.1000000000000000055511151 + tooltip + Returns LineNumber from NotecardName via the dataserver event. The line index starts at zero.\nIf the requested line is passed the end of the note-card the dataserver event will return the constant EOF string.\nThe key returned by this function is a unique identifier which will be supplied to the dataserver event in the requested parameter. + + ll.GetNotecardLineSync + + arguments + + + NotecardName + + tooltip + + type + string + + + + LineNumber + + tooltip + + type + integer + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns LineNumber from NotecardName. The line index starts at zero.\nIf the requested line is past the end of the note-card the return value will be set to the constant EOF string.\nIf the note-card is not cached on the simulator the return value is the NAK string. + + ll.GetNumberOfNotecardLines + + arguments + + + NotecardName + + tooltip + + type + string + + + + energy + 10 + return + key + sleep + 0.1000000000000000055511151 + tooltip + Returns the number of lines contained within a notecard via the dataserver event.\nThe key returned by this function is a query ID for identifying the dataserver reply. + + ll.GetNumberOfPrims + + arguments + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the number of prims in a link set the script is attached to.\nReturns the number of prims in (and avatars seated on) the object the script is in. + + ll.GetNumberOfSides + + arguments + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the number of faces (or sides) of the prim.\nReturns the number of sides of the prim which has the script. + + ll.GetObjectAnimationNames + + arguments + + energy + 10 + return + list + sleep + 0 + tooltip + Returns a list of names of playing animations for an object.\nReturns a list of names of all playing animations for the current object. + + ll.GetObjectDesc + + arguments + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the description of the prim the script is attached to.\nReturns the description of the scripted object/prim. You can set the description using llSetObjectDesc. + + ll.GetObjectDetails + + arguments + + + ID + + tooltip + Prim or avatar UUID that is in the same region. + type + key + + + + Parameters + + tooltip + List of OBJECT_* flags. + type + list + + + + energy + 10 + return + list + sleep + 0 + tooltip + Returns a list of object details specified in the Parameters list for the object or avatar in the region with key ID.\nParameters are specified by the OBJECT_* constants. + + ll.GetObjectLinkKey + + arguments + + + id + + tooltip + UUID of prim + type + key + + + + link_no + + tooltip + Link number to retrieve + type + integer + + + + energy + 10 + return + key + sleep + 0 + tooltip + Returns the key of the linked prim link_no in a linkset.\nReturns the key of link_no in the link set specified by id. + + ll.GetObjectMass + + arguments + + + ID + + tooltip + + type + key + + + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the mass of the avatar or object in the region.\nGets the mass of the object or avatar corresponding to ID. + + ll.GetObjectName + + arguments + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the name of the prim which the script is attached to.\nReturns the name of the prim (not object) which contains the script. + + ll.GetObjectPermMask + + arguments + + + Category + + tooltip + Category is one of MASK_BASE, MASK_OWNER, MASK_GROUP, MASK_EVERYONE, or MASK_NEXT + type + integer + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the permission mask of the requested category for the object. + + ll.GetObjectPrimCount + + arguments + + + ObjectID + + tooltip + + type + key + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the total number of prims for an object in the region.\nReturns the prim count for any object id in the same region. + + ll.GetOmega + + arguments + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the rotation velocity in radians per second.\nReturns a vector that is the rotation velocity of the object in radians per second. + + ll.GetOwner + + arguments + + energy + 10 + return + key + sleep + 0 + tooltip + Returns the object owner's UUID.\nReturns the key for the owner of the object. + + ll.GetOwnerKey + + arguments + + + ObjectID + + tooltip + + type + key + + + + energy + 10 + return + key + sleep + 0 + tooltip + Returns the owner of ObjectID.\nReturns the key for the owner of object ObjectID. + + ll.GetParcelDetails + + arguments + + + Position + + tooltip + Location within the region. + type + vector + + + + ParcelDetails + + tooltip + List of details requested for the specified parcel location. + type + list + + + + energy + 10 + return + list + sleep + 0 + tooltip + Returns a list of parcel details specified in the ParcelDetails list for the parcel at Position.\nParameters is one or more of: PARCEL_DETAILS_NAME, _DESC, _OWNER, _GROUP, _AREA, _ID, _SEE_AVATARS.\nReturns a list that is the parcel details specified in ParcelDetails (in the same order) for the parcel at Position. + + ll.GetParcelFlags + + arguments + + + Position + + tooltip + + type + vector + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns a mask of the parcel flags (PARCEL_FLAG_*) for the parcel that includes the point Position.\nReturns a bit-field specifying the parcel flags (PARCEL_FLAG_*) for the parcel at Position. + + ll.GetParcelMaxPrims + + arguments + + + Position + + tooltip + Region coordinates (z is ignored) of parcel. + type + vector + + + + SimWide + + tooltip + Boolean. If FALSE then the return is the maximum prims supported by the parcel. If TRUE then it is the combined number of prims on all parcels in the region owned by the specified parcel's owner. + type + integer + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the maximum number of prims allowed on the parcel at Position for a given scope.\nThe scope may be set to an individual parcel or the combined resources of all parcels with the same ownership in the region. + + ll.GetParcelMusicURL + + arguments + + energy + 10 + return + string + sleep + 0 + tooltip + Gets the streaming audio URL for the parcel object is on.\nThe object owner, avatar or group, must also be the land owner. + + ll.GetParcelPrimCount + + arguments + + + Position + + tooltip + Region coordinates of parcel to query. + type + vector + + + + Category + + tooltip + A PARCEL_COUNT_* flag. + type + integer + + + + SimWide + + tooltip + Boolean. If FALSE then the return is the maximum prims supported by the parcel. If TRUE then it is the combined number of prims on all parcels in the region owned by the specified parcel's owner. + type + integer + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the number of prims on the parcel at Position of the given category.\nCategories: PARCEL_COUNT_TOTAL, _OWNER, _GROUP, _OTHER, _SELECTED, _TEMP.\nReturns the number of prims used on the parcel at Position which are in Category.\nIf SimWide is TRUE, it returns the total number of objects for all parcels with matching ownership in the category specified.\nIf SimWide is FALSE, it returns the number of objects on this specific parcel in the category specified + + ll.GetParcelPrimOwners + + arguments + + + Position + + tooltip + + type + vector + + + + energy + 10 + return + list + sleep + 2 + tooltip + Returns a list of up to 100 residents who own objects on the parcel at Position, with per-owner land impact totals.\nRequires owner-like permissions for the parcel, and for the script owner to be present in the region.\nThe list is formatted as [ key agentKey1, integer agentLI1, key agentKey2, integer agentLI2, ... ], sorted by agent key.\nThe integers are the combined land impacts of the objects owned by the corresponding agents. + + ll.GetPermissions + + arguments + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns an integer bitmask of the permissions that have been granted to the script. Individual permissions can be determined using a bit-wise "and" operation against the PERMISSION_* constants + + ll.GetPermissionsKey + + arguments + + energy + 10 + return + key + sleep + 0 + tooltip + Returns the key of the avatar that last granted or declined permissions to the script.\nReturns NULL_KEY if permissions were never granted or declined. + + ll.GetPhysicsMaterial + + arguments + + energy + 10 + return + list + sleep + 0 + tooltip + Returns a list of the form [float gravity_multiplier, float restitution, float friction, float density]. + + ll.GetPos + + arguments + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the position of the task in region coordinates.\nReturns the vector position of the task in region coordinates. + + ll.GetPrimMediaParams + + arguments + + + Face + + tooltip + face number + type + integer + + + + Parameters + + tooltip + One or more PRIM_MEDIA_* flags + type + list + + + + energy + 10 + return + list + sleep + 1 + tooltip + Returns the media parameters for a particular face on an object, given the desired list of parameter names, in the order requested. Returns an empty list if no media exists on the face. + + ll.GetPrimitiveParams + + arguments + + + Parameters + + tooltip + PRIM_* flags and face parameters + type + list + + + + energy + 10 + return + list + sleep + 0.2000000000000000111022302 + tooltip + Returns the primitive parameters specified in the parameters list.\nReturns primitive parameters specified in the Parameters list. + + ll.GetRegionAgentCount + + arguments + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the number of avatars in the region.\nReturns an integer that is the number of avatars in the region. + + ll.GetRegionCorner + + arguments + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns a vector, in meters, that is the global location of the south-west corner of the region which the object is in.\nReturns the Region-Corner of the simulator containing the task. The region-corner is a vector (values in meters) representing distance from the first region. + + ll.GetRegionDayLength + + arguments + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the number of seconds in a day in this region. + + ll.GetRegionDayOffset + + arguments + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the number of seconds in a day is offset from midnight in this parcel. + + ll.GetRegionFPS + + arguments + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the mean region frames per second. + + ll.GetRegionFlags + + arguments + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the region flags (REGION_FLAG_*) for the region the object is in.\nReturns a bit-field specifying the region flags (REGION_FLAG_*) for the region the object is in. + + ll.GetRegionMoonDirection + + arguments + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns a normalized vector of the direction of the moon in the region.\nReturns the moon's direction on the simulator. + + ll.GetRegionMoonRotation + + arguments + + energy + 10 + return + rotation + sleep + 0 + tooltip + Returns the rotation applied to the moon in the region. + + ll.GetRegionName + + arguments + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the current region name. + + ll.GetRegionSunDirection + + arguments + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns a normalized vector of the direction of the sun in the region.\nReturns the sun's direction on the simulator. + + ll.GetRegionSunRotation + + arguments + + energy + 10 + return + rotation + sleep + 0 + tooltip + Returns the rotation applied to the sun in the region. + + ll.GetRegionTimeDilation + + arguments + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the current time dilation as a float between 0.0 (full dilation) and 1.0 (no dilation).\nReturns the current time dilation as a float between 0.0 and 1.0. + + ll.GetRegionTimeOfDay + + arguments + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the time in seconds since environmental midnight for the entire region. + + ll.GetRenderMaterial + + arguments + + + Face + + tooltip + + type + integer + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns a string that is the render material on face (the inventory name if it is a material in the prim's inventory, otherwise the key).\nReturns the render material of a face, if it is found in object inventory, its key otherwise. + + ll.GetRootPosition + + arguments + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the position (in region coordinates) of the root prim of the object which the script is attached to.\nThis is used to allow a child prim to determine where the root is. + + ll.GetRootRotation + + arguments + + energy + 10 + return + rotation + sleep + 0 + tooltip + Returns the rotation (relative to the region) of the root prim of the object which the script is attached to.\nGets the global rotation of the root object of the object script is attached to. + + ll.GetRot + + arguments + + energy + 10 + return + rotation + sleep + 0 + tooltip + Returns the rotation relative to the region's axes.\nReturns the rotation. + + ll.GetSPMaxMemory + + arguments + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the maximum used memory for the current script. Only valid after using PROFILE_SCRIPT_MEMORY. Non-mono scripts always use 16k.\nReturns the integer of the most bytes used while llScriptProfiler was last active. + + ll.GetScale + + arguments + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the scale of the prim.\nReturns a vector that is the scale (dimensions) of the prim. + + ll.GetScriptName + + arguments + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the name of the script that this function is used in.\nReturns the name of this script. + + ll.GetScriptState + + arguments + + + ScriptName + + tooltip + + type + string + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns TRUE if the script named is running.\nReturns TRUE if ScriptName is running. + + ll.GetSimStats + + arguments + + + StatType + + tooltip + Statistic type. + type + integer + + + + energy + 10 + return + float + sleep + 0 + tooltip + Returns a float that is the requested statistic. + + ll.GetSimulatorHostname + + arguments + + energy + 10 + return + string + sleep + 10 + tooltip + Returns the host-name of the machine which the script is running on.\nFor example, "sim225.agni.lindenlab.com". + + ll.GetStartParameter + + arguments + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns an integer that is the script rez parameter.\nIf the object was rezzed by an agent, this function returns 0. + + ll.GetStartString + + arguments + + energy + 10 + return + string + sleep + 0 + tooltip + Returns an string that is the value passed to llRezObjectWithParams with REZ_PARAM_STRING.\nIf the object was rezzed by an agent, this function returns an empty string. + + ll.GetStaticPath + + arguments + + + Start + + tooltip + Starting position. + type + vector + + + + End + + tooltip + Ending position. + type + vector + + + + Radius + + tooltip + Radius of the character that the path is for, between 0.125m and 5.0m. + type + float + + + + Parameters + + tooltip + Currently only accepts the parameter CHARACTER_TYPE; the options are identical to those used for llCreateCharacter. The default value is CHARACTER_TYPE_NONE. + type + list + + + + energy + 10 + return + list + sleep + 0 + tooltip + + + ll.GetStatus + + arguments + + + StatusFlag + + tooltip + A STATUS_* flag + type + integer + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns boolean value of the specified status (e.g. STATUS_PHANTOM) of the object the script is attached to. + + ll.GetSubString + + arguments + + + String + + tooltip + + type + string + + + + Start + + tooltip + + type + integer + + + + End + + tooltip + + type + integer + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns a sub-string from String, in a range specified by the Start and End indicies (inclusive).\nUsing negative numbers for Start and/or End causes the index to count backwards from the length of the string, so 0, -1 would capture the entire string.\nIf Start is greater than End, the sub string is the exclusion of the entries. + + ll.GetSunDirection + + arguments + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns a normalized vector of the direction of the sun in the parcel.\nReturns the sun's direction on the simulator in the parcel. + + ll.GetSunRotation + + arguments + + energy + 10 + return + rotation + sleep + 0 + tooltip + Returns the rotation applied to the sun in the parcel. + + ll.GetTexture + + arguments + + + Face + + tooltip + + type + integer + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns a string that is the texture on face (the inventory name if it is a texture in the prim's inventory, otherwise the key).\nReturns the texture of a face, if it is found in object inventory, its key otherwise. + + ll.GetTextureOffset + + arguments + + + Face + + tooltip + + type + integer + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the texture offset of face in the x and y components of a vector. + + ll.GetTextureRot + + arguments + + + Face + + tooltip + + type + integer + + + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the texture rotation of side. + + ll.GetTextureScale + + arguments + + + Face + + tooltip + + type + integer + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the texture scale of side in the x and y components of a vector.\nReturns the texture scale of a side in the x and y components of a vector. + + ll.GetTime + + arguments + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the time in seconds since the last region reset, script reset, or call to either llResetTime or llGetAndResetTime. + + ll.GetTimeOfDay + + arguments + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the time in seconds since environmental midnight on the parcel. + + ll.GetTimestamp + + arguments + + energy + 10 + return + string + sleep + 0 + tooltip + Returns a time-stamp (UTC time zone) in the format: YYYY-MM-DDThh:mm:ss.ff..fZ. + + ll.GetTorque + + arguments + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the torque (if the script is physical).\nReturns a vector that is the torque (if the script is physical). + + ll.GetUnixTime + + arguments + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the number of seconds elapsed since 00:00 hours, Jan 1, 1970 UTC from the system clock. + + ll.GetUsedMemory + + arguments + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the current used memory for the current script. Non-mono scripts always use 16K.\nReturns the integer of the number of bytes of memory currently in use by the script. Non-mono scripts always use 16K. + + ll.GetUsername + + arguments + + + AvatarID + + tooltip + + type + key + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the username of an avatar, if the avatar is connected to the current region, or if the name has been cached. Otherwise, returns an empty string. Use llRequestUsername if the avatar may be absent from the region. + + ll.GetVel + + arguments + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the velocity of the object.\nReturns a vector that is the velocity of the object. + + ll.GetVisualParams + + arguments + + + ID + + tooltip + Avatar UUID in the same region. + type + key + + + + Parameters + + tooltip + List of visual parameter IDs. + type + list + + + + energy + 10 + return + list + sleep + 0 + tooltip + Returns a list of the current value for each requested visual parameter. + + ll.GetWallclock + + arguments + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the time in seconds since midnight California Pacific time (PST/PDT).\nReturns the time in seconds since simulator's time-zone midnight (Pacific Time). + + ll.GiveAgentInventory + + arguments + + + AgentID + + tooltip + An agent in the region. + type + key + + + + FolderName + + tooltip + Folder name to give to the agent. + type + string + + + + InventoryItems + + tooltip + Inventory items to give to the agent. + type + list + + + + Options + + tooltip + A list of option for inventory transfer. + type + list + + + + energy + 10 + return + integer + sleep + 3 + tooltip + Give InventoryItems to the specified agent as a new folder of items, as permitted by the permissions system. The target must be an agent. + + ll.GiveInventory + + arguments + + + TargetID + + tooltip + + type + key + + + + InventoryItem + + tooltip + + type + string + + + + energy + 10 + return + void + sleep + 0 + tooltip + Give InventoryItem to destination represented by TargetID, as permitted by the permissions system.\nTargetID may be any agent or an object in the same region. + + ll.GiveInventoryList + + arguments + + + TargetID + + tooltip + + type + key + + + + FolderName + + tooltip + + type + string + + + + InventoryItems + + tooltip + + type + list + + + + energy + 10 + return + void + sleep + 3 + tooltip + Give InventoryItems to destination (represented by TargetID) as a new folder of items, as permitted by the permissions system.\nTargetID may be any agent or an object in the same region. If TargetID is an object, the items are passed directly to the object inventory (no folder is created). + + ll.GiveMoney + + arguments + + + AvatarID + + tooltip + + type + key + + + + Amount + + tooltip + + type + integer + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Transfers Amount of L$ from script owner to AvatarID.\nThis call will silently fail if PERMISSION_DEBIT has not been granted. + + ll.GodLikeRezObject + + arguments + + + InventoryItemID + + tooltip + + type + key + + + + Position + + tooltip + + type + vector + + + + energy + 10 + god-mode + 1 + return + void + sleep + 0 + tooltip + Rez directly off of a UUID if owner has god-bit set. + + ll.Ground + + arguments + + + Offset + + tooltip + + type + vector + + + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the ground height at the object position + offset.\nReturns the ground height at the object's position + Offset. + + ll.GroundContour + + arguments + + + Offset + + tooltip + + type + vector + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the ground contour direction below the object position + Offset.\nReturns the ground contour at the object's position + Offset. + + ll.GroundNormal + + arguments + + + Offset + + tooltip + + type + vector + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the ground normal below the object position + offset.\nReturns the ground contour at the object's position + Offset. + + ll.GroundRepel + + arguments + + + Height + + tooltip + Distance above the ground. + type + float + + + + Water + + tooltip + Boolean, if TRUE then hover above water too. + type + integer + + + + Tau + + tooltip + Seconds to critically damp in. + type + float + + + + energy + 10 + return + void + sleep + 0 + tooltip + + Critically damps to height if within height * 0.5 of level (either above ground level or above the higher of land and water if water == TRUE).\nCritically damps to fHeight if within fHeight * 0.5 of ground or water level.\n + The height is above ground level if iWater is FALSE or above the higher of land and water if iWater is TRUE.\n + Do not use with vehicles. Only works in physics-enabled objects. + + + ll.GroundSlope + + arguments + + + Offset + + tooltip + + type + vector + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the ground slope below the object position + Offset.\nReturns the ground slope at the object position + Offset. + + ll.HMAC + + arguments + + + Key + + tooltip + The PEM-formatted key for the hash digest. + type + string + + + + Message + + tooltip + The message to be hashed. + type + string + + + + Algorithm + + tooltip + The digest algorithm: md5, sha1, sha224, sha256, sha384, sha512. + type + string + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the base64-encoded hashed message authentication code (HMAC), of Message using PEM-formatted Key and digest Algorithm (md5, sha1, sha224, sha256, sha384, sha512). + + ll.HTTPRequest + + arguments + + + URL + + tooltip + A valid HTTP/HTTPS URL. + type + string + + + + Parameters + + tooltip + Configuration parameters, specified as HTTP_* flag-value pairs. + type + list + + + + Body + + tooltip + Contents of the request. + type + string + + + + energy + 10 + return + key + sleep + 0 + tooltip + Sends an HTTP request to the specified URL with the Body of the request and Parameters.\nReturns a key that is a handle identifying the HTTP request made. + + ll.HTTPResponse + + arguments + + + HTTPRequestID + + tooltip + A valid HTTP request key. + type + key + + + + Status + + tooltip + HTTP Status (200, 400, 404, etc.). + type + integer + + + + Body + + tooltip + Contents of the response. + type + string + + + + energy + 10 + return + void + sleep + 0 + tooltip + Responds to an incoming HTTP request which was triggerd by an http_request event within the script. HTTPRequestID specifies the request to respond to (this ID is supplied in the http_request event handler). Status and Body specify the status code and message to respond with. + + ll.Hash + + arguments + + + value + + tooltip + + type + string + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Calculates the 32bit hash value for the provided string. + + ll.InsertString + + arguments + + + TargetVariable + + tooltip + + type + string + + + + Position + + tooltip + + type + integer + + + + SourceVariable + + tooltip + + type + string + + + + energy + 10 + return + string + sleep + 0 + tooltip + Inserts SourceVariable into TargetVariable at Position, and returns the result.\nInserts SourceVariable into TargetVariable at Position and returns the result. Note this does not alter TargetVariable. + + ll.InstantMessage + + arguments + + + AvatarID + + tooltip + + type + key + + + + Text + + tooltip + + type + string + + + + energy + 10 + return + void + sleep + 2 + tooltip + IMs Text to the user identified.\nSend Text to the user as an instant message. + + ll.IntegerToBase64 + + arguments + + + Value + + tooltip + + type + integer + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns a string that is a Base64 big endian encode of Value.\nEncodes the Value as an 8-character Base64 string. + + ll.IsFriend + + arguments + + + agent_id + + tooltip + Agent ID of another agent in the region. + type + key + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns TRUE if avatar ID is a friend of the script owner. + + ll.Json2List + + arguments + + + JSON + + tooltip + + type + string + + + + energy + 10 + return + list + sleep + 0 + tooltip + Converts the top level of the JSON string to a list. + + ll.JsonGetValue + + arguments + + + JSON + + tooltip + + type + string + + + + Specifiers + + tooltip + + type + list + + + + energy + 10 + return + string + sleep + 0 + tooltip + Gets the value indicated by Specifiers from the JSON string. + + ll.JsonSetValue + + arguments + + + JSON + + tooltip + + type + string + + + + Specifiers + + tooltip + + type + list + + + + Value + + tooltip + + type + string + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns a new JSON string that is the JSON given with the Value indicated by Specifiers set to Value. + + ll.JsonValueType + + arguments + + + JSON + + tooltip + + type + string + + + + Specifiers + + tooltip + + type + list + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the type constant (JSON_*) for the value in JSON indicated by Specifiers. + + ll.Key2Name + + arguments + + + ID + + tooltip + Avatar or rezzed prim UUID. + type + key + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the name of the prim or avatar specified by ID. The ID must be a valid rezzed prim or avatar key in the current simulator, otherwise an empty string is returned.\nFor avatars, the returned name is the legacy name + + ll.KeyCountKeyValue + + arguments + + energy + 10 + return + key + sleep + 0 + tooltip + + Starts an asychronous transaction the request the number of keys in the data store. The dataserver callback will be executed with the key returned from this call and a string describing the result. The result is commma-delimited list. The first item is an integer specifying if the transaction succeeded (1) or not (0). In the failure case, the second item will be an integer corresponding to one of the XP_ERROR_... constants. In the success case the second item will the the number of keys in the system. + + + ll.KeysKeyValue + + arguments + + + First + + tooltip + Index of the first key to return. + type + integer + + + + Count + + tooltip + The number of keys to return. + type + integer + + + + energy + 10 + return + key + sleep + 0 + tooltip + + Starts an asychronous transaction the request a number of keys from the data store. The dataserver callback will be executed with the key returned from this call and a string describing the result. The result is commma-delimited list. The first item is an integer specifying if the transaction succeeded (1) or not (0). In the failure case, the second item will be an integer corresponding to one of the XP_ERROR_... constants. The error XP_ERROR_KEY_NOT_FOUND is returned if First is greater than or equal to the number of keys in the data store. In the success case the subsequent items will be the keys requested. The number of keys returned may be less than requested if the return value is too large or if there is not enough keys remaining. The order keys are returned is not guaranteed but is stable between subsequent calls as long as no keys are added or removed. Because the keys are returned in a comma-delimited list it is not recommended to use commas in key names if this function is used. + + + ll.Linear2sRGB + + arguments + + + color + + tooltip + A color in the linear colorspace. + type + vector + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Converts a color from the linear colorspace to sRGB. + + ll.LinkAdjustSoundVolume + + arguments + + + LinkNumber + + tooltip + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag + type + integer + + + + Volume + + tooltip + The volume to set. + type + float + + + + energy + 10 + return + void + sleep + 0 + tooltip + Adjusts the volume (0.0 - 1.0) of the currently playing sound attached to the link.\nThis function has no effect on sounds started with llTriggerSound. + + ll.LinkParticleSystem + + arguments + + + LinkNumber + + tooltip + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag + type + integer + + + + Rules + + tooltip + Particle system rules list in the format [ rule1, data1, rule2, data2 . . . ruleN, dataN ] + type + list + + + + energy + 10 + return + void + sleep + 0 + tooltip + Creates a particle system in prim LinkNumber based on Rules. An empty list removes a particle system from object.\nList format is [ rule-1, data-1, rule-2, data-2 ... rule-n, data-n ].\nThis is identical to llParticleSystem except that it applies to a specified linked prim and not just the prim the script is in. + + ll.LinkPlaySound + + arguments + + + LinkNumber + + tooltip + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag + type + integer + + + + Sound + + tooltip + + type + string + + + + Volume + + tooltip + + type + float + + + + Flags + + tooltip + + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Plays Sound, once or looping, at Volume (0.0 - 1.0). The sound may be attached to the link or triggered at its location.\nOnly one sound may be attached to an object at a time, and attaching a new sound or calling llStopSound will stop the previously attached sound. + + ll.LinkSetSoundQueueing + + arguments + + + LinkNumber + + tooltip + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag + type + integer + + + + QueueEnable + + tooltip + Boolean, sound queuing for the linked prim: TRUE enables, FALSE disables (default). + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Limits radius for audibility of scripted sounds (both attached and triggered) to distance Radius around the link. + + ll.LinkSetSoundRadius + + arguments + + + LinkNumber + + tooltip + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag + type + integer + + + + radius + + tooltip + Maximum distance that sounds can be heard. + type + float + + + + energy + 10 + return + void + sleep + 0 + tooltip + Limits radius for audibility of scripted sounds (both attached and triggered) to distance Radius around the link. + + ll.LinkSitTarget + + arguments + + + LinkNumber + + tooltip + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag of the prim. + type + integer + + + + Offset + + tooltip + Position for the sit target, relative to the prim's position. + type + vector + + + + Rotation + + tooltip + Rotation (relative to the prim's rotation) for the avatar. + type + rotation + + + + energy + 10 + return + void + sleep + 0 + tooltip + Set the sit location for the linked prim(s). If Offset == <0,0,0> clear it.\nSet the sit location for the linked prim(s). The sit location is relative to the prim's position and rotation. + + ll.LinkStopSound + + arguments + + + LinkNumber + + tooltip + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Stops playback of the currently attached sound on a link. + + ll.LinksetDataAvailable + + arguments + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the number of bytes remaining in the linkset's datastore. + + ll.LinksetDataCountFound + + arguments + + + search + + tooltip + A regex search string to match against keys in the datastore. + type + string + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the number of keys matching the regular expression passed in the search parameter. + + ll.LinksetDataCountKeys + + arguments + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the number of keys in the linkset's datastore. + + ll.LinksetDataDelete + + arguments + + + name + + tooltip + Key to delete from the linkset's datastore. + type + string + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Deletes a name:value pair from the linkset's datastore. + + ll.LinksetDataDeleteFound + + arguments + + + search + + tooltip + A regex search string to match against keys in the datastore. + type + string + + + + pass + + tooltip + The pass phrase used to protect key value pairs in the linkset data + type + string + + + + energy + 10 + return + list + sleep + 0 + tooltip + Deletes all key value pairs in the linkset data where the key matches the regular expression in search. Returns a list consisting of [ #deleted, #not deleted ]. + + ll.LinksetDataDeleteProtected + + arguments + + + name + + tooltip + Key to delete from the linkset's datastore. + type + string + + + + pass + + tooltip + Pass phrase to access protected data. + type + string + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Deletes a name:value pair from the linkset's datastore. + + ll.LinksetDataFindKeys + + arguments + + + search + + tooltip + A regex search string to match against keys in the datastore. + type + string + + + + start + + tooltip + First entry to return. 0 for start of list. + type + integer + + + + count + + tooltip + Number of entries to return. Less than 1 for all keys. + type + integer + + + + energy + 10 + return + list + sleep + 0 + tooltip + Returns a list of keys from the linkset's data store matching the search parameter. + + ll.LinksetDataListKeys + + arguments + + + start + + tooltip + First entry to return. 0 for start of list. + type + integer + + + + count + + tooltip + Number of entries to return. Less than 1 for all keys. + type + integer + + + + energy + 10 + return + list + sleep + 0 + tooltip + Returns a list of all keys in the linkset datastore. + + ll.LinksetDataRead + + arguments + + + name + + tooltip + Key to retrieve from the linkset's datastore. + type + string + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the value stored for a key in the linkset. + + ll.LinksetDataReadProtected + + arguments + + + name + + tooltip + Key to retrieve from the linkset's datastore. + type + string + + + + pass + + tooltip + Pass phrase to access protected data. + type + string + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the value stored for a key in the linkset. + + ll.LinksetDataReset + + arguments + + energy + 10 + return + void + sleep + 0 + tooltip + Resets the linkset's data store, erasing all key-value pairs. + + ll.LinksetDataWrite + + arguments + + + name + + tooltip + key for the name:value pair. + type + string + + + + value + + tooltip + value to store in the linkset's datastore. + type + string + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Sets a name:value pair in the linkset's datastore + + ll.LinksetDataWriteProtected + + arguments + + + name + + tooltip + key for the name:value pair. + type + string + + + + value + + tooltip + value to store in the linkset's datastore. + type + string + + + + pass + + tooltip + Pass phrase to access protected data. + type + string + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Sets a name:value pair in the linkset's datastore + + ll.List2CSV + + arguments + + + ListVariable + + tooltip + + type + list + + + + energy + 10 + return + string + sleep + 0 + tooltip + Creates a string of comma separated values from the list.\nCreate a string of comma separated values from the specified list. + + ll.List2Float + + arguments + + + ListVariable + + tooltip + + type + list + + + + Index + + tooltip + + type + integer + + + + energy + 10 + return + float + sleep + 0 + tooltip + Copies the float at Index in the list.\nReturns the value at Index in the specified list. If Index describes a location not in the list, or the value cannot be type-cast to a float, then zero is returned. + + ll.List2Integer + + arguments + + + ListVariable + + tooltip + + type + list + + + + Index + + tooltip + + type + integer + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Copies the integer at Index in the list.\nReturns the value at Index in the specified list. If Index describes a location not in the list, or the value cannot be type-cast to an integer, then zero is returned. + + ll.List2Json + + arguments + + + JsonType + + tooltip + Type is JSON_ARRAY or JSON_OBJECT. + type + string + + + + Values + + tooltip + List of values to convert. + type + list + + + + energy + 10 + return + string + sleep + 0 + tooltip + Converts either a strided list of key:value pairs to a JSON_OBJECT, or a list of values to a JSON_ARRAY. + + ll.List2Key + + arguments + + + ListVariable + + tooltip + + type + list + + + + Index + + tooltip + + type + integer + + + + energy + 10 + return + key + sleep + 0 + tooltip + Copies the key at Index in the list.\nReturns the value at Index in the specified list. If Index describes a location not in the list, or the value cannot be type-cast to a key, then null string is returned. + + ll.List2List + + arguments + + + ListVariable + + tooltip + + type + list + + + + Start + + tooltip + + type + integer + + + + End + + tooltip + + type + integer + + + + energy + 10 + return + list + sleep + 0 + tooltip + Returns a subset of entries from ListVariable, in a range specified by the Start and End indicies (inclusive).\nUsing negative numbers for Start and/or End causes the index to count backwards from the length of the string, so 0, -1 would capture the entire string.\nIf Start is greater than End, the sub string is the exclusion of the entries. + + ll.List2ListSlice + + arguments + + + ListVariable + + tooltip + + type + list + + + + Start + + tooltip + + type + integer + + + + End + + tooltip + + type + integer + + + + Stride + + tooltip + + type + integer + + + + slice_index + + tooltip + + type + integer + + + + energy + 10 + return + list + sleep + 0 + tooltip + Returns a subset of entries from ListVariable, in a range specified by Start and End indices (inclusive) return the slice_index element of each stride.\n Using negative numbers for Start and/or End causes the index to count backwards from the length of the list. (e.g. 0, -1 captures entire list)\nIf slice_index is less than 0, it is counted backwards from the end of the stride.\n Stride must be a positive integer > 0 or an empy list is returned. If slice_index falls outside range of stride, an empty list is returned. slice_index is zero-based. (e.g. A stride of 2 has valid indices 0,1) + + ll.List2ListStrided + + arguments + + + ListVariable + + tooltip + + type + list + + + + Start + + tooltip + + type + integer + + + + End + + tooltip + + type + integer + + + + Stride + + tooltip + + type + integer + + + + energy + 10 + return + list + sleep + 0 + tooltip + Copies the strided slice of the list from Start to End.\nReturns a copy of the strided slice of the specified list from Start to End. + + ll.List2Rot + + arguments + + + ListVariable + + tooltip + + type + list + + + + Index + + tooltip + + type + integer + + + + energy + 10 + return + rotation + sleep + 0 + tooltip + Copies the rotation at Index in the list.\nReturns the value at Index in the specified list. If Index describes a location not in the list, or the value cannot be type-cast to rotation, thenZERO_ROTATION is returned. + + ll.List2String + + arguments + + + ListVariable + + tooltip + + type + list + + + + Index + + tooltip + + type + integer + + + + energy + 10 + return + string + sleep + 0 + tooltip + Copies the string at Index in the list.\nReturns the value at Index in the specified list as a string. If Index describes a location not in the list then null string is returned. + + ll.List2Vector + + arguments + + + ListVariable + + tooltip + + type + list + + + + Index + + tooltip + + type + integer + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Copies the vector at Index in the list.\nReturns the value at Index in the specified list. If Index describes a location not in the list, or the value cannot be type-cast to a vector, then ZERO_VECTOR is returned. + + ll.ListFindList + + arguments + + + ListVariable + + tooltip + + type + list + + + + Find + + tooltip + + type + list + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the index of the first instance of Find in ListVariable. Returns -1 if not found.\nReturns the position of the first instance of the Find list in the ListVariable. Returns -1 if not found. + + ll.ListFindListNext + + arguments + + + ListVariable + + tooltip + + type + list + + + + Find + + tooltip + + type + list + + + + Instance + + tooltip + + type + integer + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the index of the nth instance of Find in ListVariable. Returns -1 if not found. + + ll.ListFindStrided + + arguments + + + ListVariable + + tooltip + + type + list + + + + Find + + tooltip + + type + list + + + + Start + + tooltip + + type + integer + + + + End + + tooltip + + type + integer + + + + Stride + + tooltip + + type + integer + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the index of the first instance of Find in ListVariable. Returns -1 if not found.\nReturns the position of the first instance of the Find list in the ListVariable after the start index and before the end index. Steps through ListVariable by stride. Returns -1 if not found. + + ll.ListInsertList + + arguments + + + Target + + tooltip + + type + list + + + + ListVariable + + tooltip + + type + list + + + + Position + + tooltip + + type + integer + + + + energy + 10 + return + list + sleep + 0 + tooltip + Returns a list that contains all the elements from Target but with the elements from ListVariable inserted at Position start.\nReturns a new list, created by inserting ListVariable into the Target list at Position. Note this does not alter the Target. + + ll.ListRandomize + + arguments + + + ListVariable + + tooltip + + type + list + + + + Stride + + tooltip + + type + integer + + + + energy + 10 + return + list + sleep + 0 + tooltip + Returns a version of the input ListVariable which has been randomized by blocks of size Stride.\nIf the remainder from the length of the list, divided by the stride is non-zero, this function does not randomize the list. + + ll.ListReplaceList + + arguments + + + Target + + tooltip + + type + list + + + + ListVariable + + tooltip + + type + list + + + + Start + + tooltip + + type + integer + + + + End + + tooltip + + type + integer + + + + energy + 10 + return + list + sleep + 0 + tooltip + Returns a list that is Target with Start through End removed and ListVariable inserted at Start.\nReturns a list replacing the slice of the Target list from Start to End with the specified ListVariable. Start and End are inclusive, so 0, 1 would replace the first two entries and 0, 0 would replace only the first list entry. + + ll.ListSort + + arguments + + + ListVariable + + tooltip + List to sort. + type + list + + + + Stride + + tooltip + Stride length. + type + integer + + + + Ascending + + tooltip + Boolean. TRUE = result in ascending order, FALSE = result in descending order. + type + integer + + + + energy + 10 + return + list + sleep + 0 + tooltip + Returns the specified list, sorted into blocks of stride in ascending order (if Ascending is TRUE, otherwise descending). Note that sort only works if the first entry of each block is the same datatype. + + ll.ListSortStrided + + arguments + + + ListVariable + + tooltip + List to sort. + type + list + + + + Stride + + tooltip + Stride length. + type + integer + + + + Sortkey + + tooltip + The zero based element within the stride to use as the sort key + type + integer + + + + Ascending + + tooltip + Boolean. TRUE = result in ascending order, FALSE = result in descending order. + type + integer + + + + energy + 10 + return + list + sleep + 0 + tooltip + Returns the specified list, sorted by the specified element into blocks of stride in ascending order (if Ascending is TRUE, otherwise descending). Note that sort only works if the first entry of each block is the same datatype. + + ll.ListStatistics + + arguments + + + Operation + + tooltip + One of LIST_STAT_* values + type + integer + + + + ListVariable + + tooltip + Variable to analyze. + type + list + + + + energy + 10 + return + float + sleep + 0 + tooltip + Performs a statistical aggregate function, specified by a LIST_STAT_* constant, on ListVariables.\nThis function allows a script to perform a statistical operation as defined by operation on a list composed of integers and floats. + + ll.Listen + + arguments + + + Channel + + tooltip + + type + integer + + + + SpeakersName + + tooltip + + type + string + + + + SpeakersID + + tooltip + + type + key + + + + Text + + tooltip + + type + string + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Creates a listen callback for Text on Channel from SpeakersName and SpeakersID (SpeakersName, SpeakersID, and/or Text can be empty) and returns an identifier that can be used to deactivate or remove the listen.\nNon-empty values for SpeakersName, SpeakersID, and Text will filter the results accordingly, while empty strings and NULL_KEY will not filter the results, for string and key parameters respectively.\nPUBLIC_CHANNEL is the public chat channel that all avatars see as chat text. DEBUG_CHANNEL is the script debug channel, and is also visible to nearby avatars. All other channels are are not sent to avatars, but may be used to communicate with scripts. + + ll.ListenControl + + arguments + + + ChannelHandle + + tooltip + + type + integer + + + + Active + + tooltip + + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Makes a listen event callback active or inactive. Pass in the value returned from llListen to the iChannelHandle parameter to specify which listener you are controlling.\nUse boolean values to specify Active + + ll.ListenRemove + + arguments + + + ChannelHandle + + tooltip + + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Removes a listen event callback. Pass in the value returned from llListen to the iChannelHandle parameter to specify which listener to remove. + + ll.LoadURL + + arguments + + + AvatarID + + tooltip + + type + key + + + + Text + + tooltip + + type + string + + + + URL + + tooltip + + type + string + + + + energy + 10 + return + void + sleep + 0.1000000000000000055511151 + tooltip + Shows dialog to avatar AvatarID offering to load web page at URL. If user clicks yes, launches their web browser.\nllLoadURL displays a dialogue box to the user, offering to load the specified web page using the default web browser. + + ll.Log + + arguments + + + Value + + tooltip + + type + float + + + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the natural logarithm of Value. Returns zero if Value <= 0.\nReturns the base e (natural) logarithm of the specified Value. + + ll.Log10 + + arguments + + + Value + + tooltip + + type + float + + + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the base 10 logarithm of Value. Returns zero if Value <= 0.\nReturns the base 10 (common) logarithm of the specified Value. + + ll.LookAt + + arguments + + + Target + + tooltip + + type + vector + + + + Strength + + tooltip + + type + float + + + + Damping + + tooltip + + type + float + + + + energy + 10 + return + void + sleep + 0 + tooltip + Cause object name to point its forward axis towards Target, at a force controlled by Strength and Damping.\nGood Strength values are around half the mass of the object and good Damping values are less than 1/10th of the Strength.\nAsymmetrical shapes require smaller Damping. A Strength of 0.0 cancels the look at. + + ll.LoopSound + + arguments + + + Sound + + tooltip + + type + string + + + + Volume + + tooltip + + type + float + + + + energy + 10 + return + void + sleep + 0 + tooltip + Plays specified Sound, looping indefinitely, at Volume (0.0 - 1.0).\nOnly one sound may be attached to an object at a time.\nA second call to llLoopSound with the same key will not restart the sound, but the new volume will be used. This allows control over the volume of already playing sounds.\nSetting the volume to 0 is not the same as calling llStopSound; a sound with 0 volume will continue to loop.\nTo restart the sound from the beginning, call llStopSound before calling llLoopSound again. + + ll.LoopSoundMaster + + arguments + + + Sound + + tooltip + + type + string + + + + Volume + + tooltip + + type + float + + + + energy + 10 + return + void + sleep + 0 + tooltip + Plays attached Sound, looping at volume (0.0 - 1.0), and declares it a sync master.\nBehaviour is identical to llLoopSound, with the addition of marking the source as a "Sync Master", causing "Slave" sounds to sync to it. If there are multiple masters within a viewers interest area, the most audible one (a function of both distance and volume) will win out as the master.\nThe use of multiple masters within a small area is unlikely to produce the desired effect. + + ll.LoopSoundSlave + + arguments + + + Sound + + tooltip + + type + string + + + + Volume + + tooltip + + type + float + + + + energy + 10 + return + void + sleep + 0 + tooltip + Plays attached sound looping at volume (0.0 - 1.0), synced to most audible sync master.\nBehaviour is identical to llLoopSound, unless there is a "Sync Master" present.\nIf a Sync Master is already playing the Slave sound will begin playing from the same point the master is in its loop synchronizing the loop points of both sounds.\nIf a Sync Master is started when the Slave is already playing, the Slave will skip to the correct position to sync with the Master. + + ll.MD5String + + arguments + + + Text + + tooltip + + type + string + + + + Nonce + + tooltip + + type + integer + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns a string of 32 hex characters that is an RSA Data Security Inc., MD5 Message-Digest Algorithm of Text with Nonce used as the salt.\nReturns a 32-character hex string. (128-bit in binary.) + + ll.MakeExplosion + + arguments + + + Particles + + tooltip + + type + integer + + + + Scale + + tooltip + + type + float + + + + Velocity + + tooltip + + type + float + + + + Lifetime + + tooltip + + type + float + + + + Arc + + tooltip + + type + float + + + + Texture + + tooltip + + type + string + + + + Offset + + tooltip + + type + vector + + + + deprecated + 1 + energy + 10 + return + void + sleep + 0.1000000000000000055511151 + tooltip + Make a round explosion of particles. Deprecated: Use llParticleSystem instead.\nMake a round explosion of particles using texture from the objects inventory. Deprecated: Use llParticleSystem instead. + + ll.MakeFire + + arguments + + + Particles + + tooltip + + type + integer + + + + Scale + + tooltip + + type + float + + + + Velocity + + tooltip + + type + float + + + + Lifetime + + tooltip + + type + float + + + + Arc + + tooltip + + type + float + + + + Texture + + tooltip + + type + string + + + + Offset + + tooltip + + type + vector + + + + deprecated + 1 + energy + 10 + return + void + sleep + 0.1000000000000000055511151 + tooltip + Make fire like particles. Deprecated: Use llParticleSystem instead.\nMake fire particles using texture from the objects inventory. Deprecated: Use llParticleSystem instead. + + ll.MakeFountain + + arguments + + + Particles + + tooltip + + type + integer + + + + Scale + + tooltip + + type + float + + + + Velocity + + tooltip + + type + float + + + + Lifetime + + tooltip + + type + float + + + + Arc + + tooltip + + type + float + + + + Bounce + + tooltip + + type + integer + + + + Texture + + tooltip + + type + string + + + + Offset + + tooltip + + type + vector + + + + Bounce_Offset + + tooltip + + type + float + + + + deprecated + 1 + energy + 10 + return + void + sleep + 0.1000000000000000055511151 + tooltip + Make a fountain of particles. Deprecated: Use llParticleSystem instead.\nMake a fountain of particles using texture from the objects inventory. Deprecated: Use llParticleSystem instead. + + ll.MakeSmoke + + arguments + + + Particles + + tooltip + + type + integer + + + + Scale + + tooltip + + type + float + + + + Velocity + + tooltip + + type + float + + + + Lifetime + + tooltip + + type + float + + + + Arc + + tooltip + + type + float + + + + Texture + + tooltip + + type + string + + + + Offset + + tooltip + + type + vector + + + + deprecated + 1 + energy + 10 + return + void + sleep + 0.1000000000000000055511151 + tooltip + Make smoke like particles. Deprecated: Use llParticleSystem instead.\nMake smoky particles using texture from the objects inventory. Deprecated: Use llParticleSystem instead. + + ll.ManageEstateAccess + + arguments + + + Action + + tooltip + One of the ESTATE_ACCESS_ALLOWED_* actions. + type + integer + + + + AvatarID + + tooltip + UUID of the avatar or group to act upon. + type + key + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Adds or removes agents from the estate's agent access or ban lists, or groups to the estate's group access list. Action is one of the ESTATE_ACCESS_ALLOWED_* operations to perform.\nReturns an integer representing a boolean, TRUE if the call was successful; FALSE if throttled, invalid action, invalid or null id or object owner is not allowed to manage the estate.\nThe object owner is notified of any changes, unless PERMISSION_SILENT_ESTATE_MANAGEMENT has been granted to the script. + + ll.MapBeacon + + arguments + + + RegionName + + tooltip + Region in which to show the beacon. + type + string + + + + Position + + tooltip + Position within region to show the beacon. + type + vector + + + + Options + + tooltip + Options + type + list + + + + energy + 10 + return + void + sleep + 1 + tooltip + Displays an in world beacon and optionally opens world map for avatar who touched the object or is wearing the script, centered on RegionName with Position highlighted. Only works for scripts attached to avatar, or during touch events. + + ll.MapDestination + + arguments + + + RegionName + + tooltip + + type + string + + + + Position + + tooltip + + type + vector + + + + Direction + + tooltip + + type + vector + + + + energy + 10 + return + void + sleep + 1 + tooltip + Opens world map for avatar who touched is is wearing the script, centred on RegionName with Position highlighted. Only works for scripts attached to avatar, or during touch events.\nDirection currently has no effect. + + ll.MessageLinked + + arguments + + + LinkNumber + + tooltip + + type + integer + + + + Number + + tooltip + + type + integer + + + + Text + + tooltip + + type + string + + + + ID + + tooltip + + type + key + + + + energy + 10 + return + void + sleep + 0 + tooltip + Sends Number, Text, and ID to members of the link set identified by LinkNumber.\nLinkNumber is either a linked number (available through llGetLinkNumber) or a LINK_* constant. + + ll.MinEventDelay + + arguments + + + Delay + + tooltip + + type + float + + + + energy + 10 + return + void + sleep + 0 + tooltip + Set the minimum time between events being handled. + + ll.ModPow + + arguments + + + Value + + tooltip + + type + integer + + + + Power + + tooltip + + type + integer + + + + Modulus + + tooltip + + type + integer + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns a Value raised to the Power, mod Modulus. ((a**b)%c) b is capped at 0xFFFF (16 bits).\nReturns (Value ^ Power) % Modulus. (Value raised to the Power, Modulus). Value is capped at 0xFFFF (16 bits). + + ll.ModifyLand + + arguments + + + Action + + tooltip + LAND_LEVEL, LAND_RAISE, LAND_LOWER, LAND_SMOOTH, LAND_NOISE or LAND_REVERT + type + integer + + + + Area + + tooltip + 0, 1, 2 (2m x 2m, 4m x 4m, or 8m x 8m) + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Modify land with action (LAND_LEVEL, LAND_RAISE, LAND_LOWER, LAND_SMOOTH, LAND_NOISE, LAND_REVERT) on size (0, 1, 2, corresponding to 2m x 2m, 4m x 4m, 8m x 8m). + + ll.MoveToTarget + + arguments + + + Target + + tooltip + + type + vector + + + + Tau + + tooltip + + type + float + + + + energy + 10 + return + void + sleep + 0 + tooltip + Critically damp to Target in Tau seconds (if the script is physical).\nCritically damp to position target in tau-seconds if the script is physical. Good tau-values are greater than 0.2. A tau of 0.0 stops the critical damping. + + ll.Name2Key + + arguments + + + Name + + tooltip + Name of agent in region to look up. + type + string + + + + energy + 10 + return + key + sleep + 0 + tooltip + Look up Agent ID for the named agent in the region. + + ll.NavigateTo + + arguments + + + Location + + tooltip + Region coordinates for the character to navigate to. + type + vector + + + + Options + + tooltip + List of parameters to control the type of path-finding used. Currently only FORCE_DIRECT_PATH supported. + type + list + + + + energy + 10 + return + void + sleep + 0 + tooltip + Navigate to destination.\nDirects an object to travel to a defined position in the region or adjacent regions. + + ll.OffsetTexture + + arguments + + + OffsetS + + tooltip + + type + float + + + + OffsetT + + tooltip + + type + float + + + + Face + + tooltip + + type + integer + + + + energy + 10 + return + void + sleep + 0.2000000000000000111022302 + tooltip + Sets the texture S and T offsets for the chosen Face.\nIf Face is ALL_SIDES this function sets the texture offsets for all faces. + + ll.OpenFloater + + arguments + + + floater_name + + tooltip + Identifier for floater to open + type + string + + + + url + + tooltip + URL to pass to floater + type + string + + + + params + + tooltip + Parameters to apply to open floater + type + list + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the value for header for request_id.\nReturns a string that is the value of the Header for HTTPRequestID. + + ll.OpenRemoteDataChannel + + arguments + + deprecated + 1 + energy + 10 + return + void + sleep + 1 + tooltip + This function is deprecated. + + ll.Ord + + arguments + + + value + + tooltip + The string to convert to Unicode. + type + string + + + + index + + tooltip + Index of character to convert to unicode. + type + integer + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the unicode value of the indicated character in the string. + + ll.OverMyLand + + arguments + + + ID + + tooltip + + type + key + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns TRUE if id ID over land owned by the script owner, otherwise FALSE.\nReturns TRUE if key ID is over land owned by the object owner, FALSE otherwise. + + ll.OwnerSay + + arguments + + + Text + + tooltip + + type + string + + + + energy + 10 + return + void + sleep + 0 + tooltip + says Text to owner only (if owner is in region).\nSays Text to the owner of the object running the script, if the owner has been within the object's simulator since logging into Second Life, regardless of where they may be in-world. + + ll.ParcelMediaCommandList + + arguments + + + CommandList + + tooltip + A list of PARCEL_MEDIA_COMMAND_* flags and their parameters + type + list + + + + energy + 10 + return + void + sleep + 2 + tooltip + Controls the playback of multimedia resources on a parcel or for an agent, via one or more PARCEL_MEDIA_COMMAND_* arguments specified in CommandList. + + ll.ParcelMediaQuery + + arguments + + + QueryList + + tooltip + + type + list + + + + energy + 10 + return + list + sleep + 2 + tooltip + Queries the media properties of the parcel containing the script, via one or more PARCEL_MEDIA_COMMAND_* arguments specified in CommandList.\nThis function will only work if the script is contained within an object owned by the land-owner (or if the land is owned by a group, only if the object has been deeded to the group). + + ll.ParseString2List + + arguments + + + Text + + tooltip + + type + string + + + + Separators + + tooltip + + type + list + + + + Spacers + + tooltip + + type + list + + + + energy + 10 + return + list + sleep + 0 + tooltip + Converts Text into a list, discarding Separators, keeping Spacers (Separators and Spacers must be lists of strings, maximum of 8 each).\nSeparators and Spacers are lists of strings with a maximum of 8 entries each. + + ll.ParseStringKeepNulls + + arguments + + + Text + + tooltip + + type + string + + + + Separators + + tooltip + + type + list + + + + Spacers + + tooltip + + type + list + + + + energy + 10 + return + list + sleep + 0 + tooltip + Breaks Text into a list, discarding separators, keeping spacers, keeping any null values generated. (separators and spacers must be lists of strings, maximum of 8 each).\nllParseStringKeepNulls works almost exactly like llParseString2List, except that if a null is found it will add a null-string instead of discarding it like llParseString2List does. + + ll.ParticleSystem + + arguments + + + Parameters + + tooltip + + type + list + + + + energy + 10 + return + void + sleep + 0 + tooltip + Creates a particle system in the prim the script is attached to, based on Parameters. An empty list removes a particle system from object.\nList format is [ rule-1, data-1, rule-2, data-2 ... rule-n, data-n ]. + + ll.PassCollisions + + arguments + + + Pass + + tooltip + Boolean, if TRUE, collisions are passed from children on to parents. + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Configures how collision events are passed to scripts in the linkset.\nIf Pass == TRUE, collisions involving collision-handling scripted child prims are also passed on to the root prim. If Pass == FALSE (default behavior), such collisions will only trigger events in the affected child prim. + + ll.PassTouches + + arguments + + + Pass + + tooltip + Boolean, if TRUE, touches are passed from children on to parents. + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Configures how touch events are passed to scripts in the linkset.\nIf Pass == TRUE, touches involving touch-handling scripted child prims are also passed on to the root prim. If Pass == FALSE (default behavior), such touches will only trigger events in the affected child prim. + + ll.PatrolPoints + + arguments + + + Points + + tooltip + A list of vectors for the character to travel through sequentially. The list must contain at least two entries. + type + list + + + + Options + + tooltip + No options available at this time. + type + list + + + + energy + 10 + return + void + sleep + 0 + tooltip + Patrol a list of points.\nSets the points for a character (llCreateCharacter) to patrol along. + + ll.PlaySound + + arguments + + + Sound + + tooltip + + type + string + + + + Volume + + tooltip + + type + float + + + + energy + 10 + return + void + sleep + 0 + tooltip + Plays Sound once, at Volume (0.0 - 1.0) and attached to the object.\nOnly one sound may be attached to an object at a time, and attaching a new sound or calling llStopSound will stop the previously attached sound.\nA second call to llPlaySound with the same sound will not restart the sound, but the new volume will be used, which allows control over the volume of already playing sounds.\nTo restart the sound from the beginning, call llStopSound before calling llPlaySound again. + + ll.PlaySoundSlave + + arguments + + + Sound + + tooltip + + type + string + + + + Volume + + tooltip + + type + float + + + + energy + 10 + return + void + sleep + 0 + tooltip + Plays attached Sound once, at Volume (0.0 - 1.0), synced to next loop of most audible sync master.\nBehaviour is identical to llPlaySound, unless there is a "Sync Master" present. If a Sync Master is already playing, the Slave sound will not be played until the Master hits its loop point and returns to the beginning.\nllPlaySoundSlave will play the sound exactly once; if it is desired to have the sound play every time the Master loops, either use llLoopSoundSlave with extra silence padded on the end of the sound or ensure that llPlaySoundSlave is called at least once per loop of the Master. + + ll.Pow + + arguments + + + Value + + tooltip + + type + float + + + + Exponent + + tooltip + + type + float + + + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the Value raised to the power Exponent, or returns 0 and triggers Math Error for imaginary results.\nReturns the Value raised to the Exponent. + + ll.PreloadSound + + arguments + + + Sound + + tooltip + + type + string + + + + energy + 10 + return + void + sleep + 1 + tooltip + Causes nearby viewers to preload the Sound from the object's inventory.\nThis is intended to prevent delays in starting new sounds when called upon. + + ll.Pursue + + arguments + + + TargetID + + tooltip + Agent or object to pursue. + type + key + + + + Options + + tooltip + Parameters for pursuit. + type + list + + + + energy + 10 + return + void + sleep + 0 + tooltip + Chase after a target.\nCauses the character (llCharacter) to pursue the target defined by TargetID. + + ll.PushObject + + arguments + + + ObjectID + + tooltip + + type + key + + + + Impulse + + tooltip + + type + vector + + + + AngularImpulse + + tooltip + + type + vector + + + + Local + + tooltip + + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Applies Impulse and AngularImpulse to ObjectID.\nApplies the supplied impulse and angular impulse to the object specified. + + ll.ReadKeyValue + + arguments + + + Key + + tooltip + + type + string + + + + energy + 10 + return + key + sleep + 0 + tooltip + + Starts an asychronous transaction to retrieve the value associated with the key given. Will fail with XP_ERROR_KEY_NOT_FOUND if the key does not exist. The dataserver callback will be executed with the key returned from this call and a string describing the result. The result is a two element commma-delimited list. The first item is an integer specifying if the transaction succeeded (1) or not (0). In the failure case, the second item will be an integer corresponding to one of the XP_ERROR_... constants. In the success case the second item will be the value associated with the key. + + + ll.RefreshPrimURL + + arguments + + energy + 10 + return + void + sleep + 20 + tooltip + Reloads the web page shown on the sides of the object. + + ll.RegionSay + + arguments + + + Channel + + tooltip + Any integer value except zero. + type + integer + + + + Text + + tooltip + Message to be transmitted. + type + string + + + + energy + 10 + return + void + sleep + 0 + tooltip + Broadcasts Text to entire region on Channel (except for channel 0). + + ll.RegionSayTo + + arguments + + + TargetID + + tooltip + Avatar or object to say to. + type + key + + + + Channel + + tooltip + Output channel, any integer value. + type + integer + + + + Text + + tooltip + Message to be transmitted. + type + string + + + + energy + 10 + return + void + sleep + 0 + tooltip + Says Text, on Channel, to avatar or object indicated by TargetID (if within region).\nIf TargetID is an avatar and Channel is nonzero, Text can be heard by any attachment on the avatar. + + ll.ReleaseCamera + + arguments + + + AvatarID + + tooltip + + type + key + + + + deprecated + 1 + energy + 10 + return + void + sleep + 0 + tooltip + Return camera to agent.\nDeprecated: Use llClearCameraParams instead. + + ll.ReleaseControls + + arguments + + energy + 10 + return + void + sleep + 0 + tooltip + Stop taking inputs.\nStop taking inputs from the avatar. + + ll.ReleaseURL + + arguments + + + URL + + tooltip + URL to release. + type + string + + + + energy + 10 + return + void + sleep + 0 + tooltip + Releases the specified URL, which was previously obtained using llRequestURL. Once released, the URL will no longer be usable. + + ll.RemoteDataReply + + arguments + + + ChannelID + + tooltip + + type + key + + + + MessageID + + tooltip + + type + key + + + + sData + + tooltip + String data to send + type + string + + + + iData + + tooltip + Integer data to send + type + integer + + + + deprecated + 1 + energy + 10 + return + void + sleep + 3 + tooltip + This function is deprecated. + + ll.RemoteDataSetRegion + + arguments + + deprecated + 1 + energy + 10 + return + void + sleep + 0 + tooltip + This function is deprecated. + + ll.RemoteLoadScriptPin + + arguments + + + ObjectID + + tooltip + Target prim to attempt copying into. + type + key + + + + ScriptName + + tooltip + Name of the script in current inventory to copy. + type + string + + + + PIN + + tooltip + Integer set on target prim as a Personal Information Number code. + type + integer + + + + Running + + tooltip + If the script should be set running in the target prim. + type + integer + + + + StartParameter + + tooltip + Integer. Parameter passed to the script if set to be running. + type + integer + + + + energy + 10 + return + void + sleep + 3 + tooltip + If the owner of the object containing this script can modify the object identified by the specified object key, and if the PIN matches the PIN previously set using llSetRemoteScriptAccessPin (on the target prim), then the script will be copied into target. Running is a boolean specifying whether the script should be enabled once copied into the target object. + + ll.RemoveFromLandBanList + + arguments + + + AvatarID + + tooltip + + type + key + + + + energy + 10 + return + void + sleep + 0.1000000000000000055511151 + tooltip + Remove avatar from the land ban list.\nRemove specified avatar from the land parcel ban list. + + ll.RemoveFromLandPassList + + arguments + + + AvatarID + + tooltip + + type + key + + + + energy + 10 + return + void + sleep + 0.1000000000000000055511151 + tooltip + Remove avatar from the land pass list.\nRemove specified avatar from the land parcel pass list. + + ll.RemoveInventory + + arguments + + + InventoryItem + + tooltip + + type + string + + + + energy + 10 + return + void + sleep + 0 + tooltip + Remove the named inventory item.\nRemove the named inventory item from the object inventory. + + ll.RemoveVehicleFlags + + arguments + + + Vehiclelags + + tooltip + + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Removes the enabled bits in 'flags'.\nSets the vehicle flags to FALSE. Valid parameters can be found in the vehicle flags constants section. + + ll.ReplaceAgentEnvironment + + arguments + + + agent_id + + tooltip + + type + key + + + + transition + + tooltip + + type + float + + + + environment + + tooltip + + type + string + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Replaces the entire environment for an agent. Must be used as part of an experience. + + ll.ReplaceEnvironment + + arguments + + + position + + tooltip + Location of parcel to change. Use <-1, -1, -1> for entire region. + type + vector + + + + environment + + tooltip + + Name of inventory item, or UUID of environment resource to apply. + Use NULL_KEY or empty string to remove environment. + + type + string + + + + track_no + + tooltip + Elevation zone of where to apply environment. Use -1 for all. + type + integer + + + + day_length + + tooltip + Length of day cycle for this parcel or region. -1 to leave unchanged. + type + integer + + + + day_offset + + tooltip + Offset from GMT for the day cycle on this parcel or region. -1 to leave unchanged. + type + integer + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Replaces the environment for a parcel or region. + + ll.ReplaceSubString + + arguments + + + InitialString + + tooltip + The original string in which to hunt for substring matches. + type + string + + + + SubString + + tooltip + The original substring to find. + type + string + + + + NewSubString + + tooltip + The new substring used to replace. + type + string + + + + Count + + tooltip + The max number of replacements to make. Zero Count means "replace all". Positive Count moves left to right. Negative moves right to left. + type + integer + + + + energy + 10 + return + string + sleep + 0 + tooltip + Searches InitialString and replaces instances of SubString with NewSubString. Zero Count means "replace all". Positive Count moves left to right. Negative moves right to left. + + ll.RequestAgentData + + arguments + + + AvatarID + + tooltip + + type + key + + + + Data + + tooltip + + type + integer + + + + energy + 10 + return + key + sleep + 0.1000000000000000055511151 + tooltip + Requests data about AvatarID. When data is available the dataserver event will be raised.\nThis function requests data about an avatar. If and when the information is collected, the dataserver event is triggered with the key returned from this function passed in the requested parameter. See the agent data constants (DATA_*) for details about valid values of data and what each will return in the dataserver event. + + ll.RequestDisplayName + + arguments + + + AvatarID + + tooltip + Avatar UUID + type + key + + + + energy + 10 + return + key + sleep + 0 + tooltip + Requests the display name of the agent. When the display name is available the dataserver event will be raised.\nThe avatar identified does not need to be in the same region or online at the time of the request.\nReturns a key that is used to identify the dataserver event when it is raised. + + ll.RequestExperiencePermissions + + arguments + + + AgentID + + tooltip + + type + key + + + + unused + + tooltip + Not used, should be "" + type + string + + + + energy + 10 + return + void + sleep + 0 + tooltip + + Ask the agent for permission to participate in an experience. This request is similar to llRequestPermissions with the following permissions: PERMISSION_TAKE_CONTROLS, PERMISSION_TRIGGER_ANIMATION, PERMISSION_ATTACH, PERMISSION_TRACK_CAMERA, PERMISSION_CONTROL_CAMERA and PERMISSION_TELEPORT. However, unlike llRequestPermissions the decision to allow or block the request is persistent and applies to all scripts using the experience grid wide. Subsequent calls to llRequestExperiencePermissions from scripts in the experience will receive the same response automatically with no user interaction. One of experience_permissions or experience_permissions_denied will be generated in response to this call. Outstanding permission requests will be lost if the script is derezzed, moved to another region or reset. + + + ll.RequestInventoryData + + arguments + + + InventoryItem + + tooltip + + type + string + + + + energy + 10 + return + key + sleep + 1 + tooltip + Requests data for the named InventoryItem.\nWhen data is available, the dataserver event will be raised with the key returned from this function in the requested parameter.\nThe only request currently implemented is to request data from landmarks, where the data returned is in the form "<float, float, float>" which can be cast to a vector. This position is in region local coordinates. + + ll.RequestPermissions + + arguments + + + AvatarID + + tooltip + + type + key + + + + PermissionMask + + tooltip + + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Ask AvatarID to allow the script to perform certain actions, specified in the PermissionMask bitmask. PermissionMask should be one or more PERMISSION_* constants. Multiple permissions can be requested simultaneously by ORing the constants together. Many of the permissions requests can only go to object owner.\nThis call will not stop script execution. If the avatar grants the requested permissions, the run_time_permissions event will be called. + + ll.RequestSecureURL + + arguments + + energy + 10 + return + key + sleep + 0 + tooltip + Requests one HTTPS:// (SSL) URL for use by this object. The http_request event is triggered with results.\nReturns a key that is the handle used for identifying the request in the http_request event. + + ll.RequestSimulatorData + + arguments + + + RegionName + + tooltip + + type + string + + + + Data + + tooltip + + type + integer + + + + energy + 10 + return + key + sleep + 1 + tooltip + Requests the specified Data about RegionName. When the specified data is available, the dataserver event is raised.\nData should use one of the DATA_SIM_* constants.\nReturns a dataserver query ID and triggers the dataserver event when data is found. + + ll.RequestURL + + arguments + + energy + 10 + return + key + sleep + 0 + tooltip + Requests one HTTP:// URL for use by this script. The http_request event is triggered with the result of the request.\nReturns a key that is the handle used for identifying the result in the http_request event. + + ll.RequestUserKey + + arguments + + + Name + + tooltip + Name of agent to look up. + type + string + + + + energy + 10 + return + key + sleep + 0 + tooltip + Look up Agent ID for the named agent using a historical name. + + ll.RequestUsername + + arguments + + + AvatarID + + tooltip + + type + key + + + + energy + 10 + return + key + sleep + 0 + tooltip + Requests single-word user-name of an avatar. When data is available the dataserver event will be raised.\nRequests the user-name of the identified agent. When the user-name is available the dataserver event is raised.\nThe agent identified does not need to be in the same region or online at the time of the request.\nReturns a key that is used to identify the dataserver event when it is raised. + + ll.ResetAnimationOverride + + arguments + + + AnimationState + + tooltip + + type + string + + + + energy + 10 + return + void + sleep + 0 + tooltip + Resets the animation of the specified animation state to the default value.\nIf animation state equals "ALL", then all animation states are reset. + + ll.ResetLandBanList + + arguments + + energy + 10 + return + void + sleep + 0.1000000000000000055511151 + tooltip + Removes all residents from the land ban list. + + ll.ResetLandPassList + + arguments + + energy + 10 + return + void + sleep + 0.1000000000000000055511151 + tooltip + Removes all residents from the land access/pass list. + + ll.ResetOtherScript + + arguments + + + ScriptName + + tooltip + + type + string + + + + energy + 10 + return + void + sleep + 0 + tooltip + Resets the named script. + + ll.ResetScript + + arguments + + energy + 10 + return + void + sleep + 0 + tooltip + Resets the script. + + ll.ResetTime + + arguments + + energy + 10 + return + void + sleep + 0 + tooltip + Sets the time to zero.\nSets the internal timer to zero. + + ll.ReturnObjectsByID + + arguments + + + ObjectIDs + + tooltip + List of object UUIDs to be returned. + type + list + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Return objects using their UUIDs.\nRequires the PERMISSION_RETURN_OBJECTS permission and that the script owner owns the parcel the returned objects are in, or is an estate manager or region owner. + + ll.ReturnObjectsByOwner + + arguments + + + ID + + tooltip + Object owner's UUID. + type + key + + + + Scope + + tooltip + + type + integer + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Return objects based upon their owner and a scope of parcel, parcel owner, or region.\nRequires the PERMISSION_RETURN_OBJECTS permission and that the script owner owns the parcel the returned objects are in, or is an estate manager or region owner. + + ll.RezAtRoot + + arguments + + + InventoryItem + + tooltip + + type + string + + + + Position + + tooltip + + type + vector + + + + Velocity + + tooltip + + type + vector + + + + Rotation + + tooltip + + type + rotation + + + + StartParameter + + tooltip + + type + integer + + + + energy + 200 + return + void + sleep + 0.1000000000000000055511151 + tooltip + Instantiate owner's InventoryItem at Position with Velocity, Rotation and with StartParameter. The last selected root object's location will be set to Position.\nCreates object's inventory item at the given Position, with Velocity, Rotation, and StartParameter. + + ll.RezObject + + arguments + + + InventoryItem + + tooltip + + type + string + + + + Position + + tooltip + + type + vector + + + + Velocity + + tooltip + + type + vector + + + + Rotation + + tooltip + + type + rotation + + + + StartParameter + + tooltip + + type + integer + + + + energy + 200 + return + void + sleep + 0.1000000000000000055511151 + tooltip + Instantiate owners InventoryItem at Position with Velocity, Rotation and with start StartParameter.\nCreates object's inventory item at Position with Velocity and Rotation supplied. The StartParameter value will be available to the newly created object in the on_rez event or through the llGetStartParameter function.\nThe Velocity parameter is ignored if the rezzed object is not physical. + + ll.RezObjectWithParams + + arguments + + + InventoryItem + + tooltip + + type + string + + + + Parms + + tooltip + + type + list + + + + energy + 200 + return + key + sleep + 0.1000000000000000055511151 + tooltip + Instantiate owner's InventoryItem with the given parameters. + + ll.Rot2Angle + + arguments + + + Rotation + + tooltip + + type + rotation + + + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the rotation angle represented by Rotation.\nReturns the angle represented by the Rotation. + + ll.Rot2Axis + + arguments + + + Rotation + + tooltip + + type + rotation + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the rotation axis represented by Rotation.\nReturns the axis represented by the Rotation. + + ll.Rot2Euler + + arguments + + + Rotation + + tooltip + + type + rotation + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the Euler representation (roll, pitch, yaw) of Rotation.\nReturns the Euler Angle representation of the Rotation. + + ll.Rot2Fwd + + arguments + + + Rotation + + tooltip + + type + rotation + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the forward vector defined by Rotation.\nReturns the forward axis represented by the Rotation. + + ll.Rot2Left + + arguments + + + Rotation + + tooltip + + type + rotation + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the left vector defined by Rotation.\nReturns the left axis represented by the Rotation. + + ll.Rot2Up + + arguments + + + Rotation + + tooltip + + type + rotation + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the up vector defined by Rotation.\nReturns the up axis represented by the Rotation. + + ll.RotBetween + + arguments + + + Vector1 + + tooltip + + type + vector + + + + Vector2 + + tooltip + + type + vector + + + + energy + 10 + return + rotation + sleep + 0 + tooltip + Returns the rotation to rotate Vector1 to Vector2.\nReturns the rotation needed to rotate Vector1 to Vector2. + + ll.RotLookAt + + arguments + + + Rotation + + tooltip + + type + rotation + + + + Strength + + tooltip + + type + float + + + + Damping + + tooltip + + type + float + + + + energy + 10 + return + void + sleep + 0 + tooltip + Cause object to rotate to Rotation, with a force function defined by Strength and Damping parameters. Good strength values are around half the mass of the object and good damping values are less than 1/10th of the strength.\nAsymmetrical shapes require smaller damping.\nA strength of 0.0 cancels the look at. + + ll.RotTarget + + arguments + + + Rotation + + tooltip + + type + rotation + + + + LeeWay + + tooltip + + type + float + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Set rotations with error of LeeWay radians as a rotational target, and return an ID for the rotational target.\nThe returned number is a handle that can be used in at_rot_target and llRotTargetRemove. + + ll.RotTargetRemove + + arguments + + + Handle + + tooltip + + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Removes rotational target number.\nRemove rotational target indicated by the handle. + + ll.RotateTexture + + arguments + + + Radians + + tooltip + + type + float + + + + Face + + tooltip + + type + integer + + + + energy + 10 + return + void + sleep + 0.2000000000000000111022302 + tooltip + Sets the texture rotation for the specified Face to angle Radians.\nIf Face is ALL_SIDES, rotates the texture of all sides. + + ll.Round + + arguments + + + Value + + tooltip + + type + float + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns Value rounded to the nearest integer.\nReturns the Value rounded to the nearest integer. + + ll.SHA1String + + arguments + + + Text + + tooltip + + type + string + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns a string of 40 hex characters that is the SHA1 security hash of text. + + ll.SHA256String + + arguments + + + text + + tooltip + + type + string + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns a string of 64 hex characters that is the SHA256 security hash of text. + + ll.SameGroup + + arguments + + + ID + + tooltip + + type + key + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns TRUE if avatar ID is in the same region and has the same active group, otherwise FALSE.\nReturns TRUE if the object or agent identified is in the same simulator and has the same active group as this object. Otherwise, returns FALSE. + + ll.Say + + arguments + + + Channel + + tooltip + Channel to use to say text on. + type + integer + + + + Text + + tooltip + Text to say. + type + string + + + + energy + 10 + return + void + sleep + 0 + tooltip + Says Text on Channel.\nThis chat method has a range of 20m radius.\nPUBLIC_CHANNEL is the public chat channel that all avatars see as chat text. DEBUG_CHANNEL is the script debug channel, and is also visible to nearby avatars. All other channels are are not sent to avatars, but may be used to communicate with scripts. + + ll.ScaleByFactor + + arguments + + + ScalingFactor + + tooltip + The multiplier to be used with the prim sizes and their local positions. + type + float + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Attempts to resize the entire object by ScalingFactor, maintaining the size-position ratios of the prims.\n\nResizing is subject to prim scale limits and linkability limits. This function can not resize the object if the linkset is physical, a pathfinding character, in a keyframed motion, or if resizing would cause the parcel to overflow.\nReturns a boolean (an integer) TRUE if it succeeds, FALSE if it fails. + + ll.ScaleTexture + + arguments + + + Horizontal + + tooltip + + type + float + + + + Vertical + + tooltip + + type + float + + + + Face + + tooltip + + type + integer + + + + energy + 10 + return + void + sleep + 0.2000000000000000111022302 + tooltip + Sets the diffuse texture Horizontal and Vertical repeats on Face of the prim the script is attached to.\nIf Face == ALL_SIDES, all sides are set in one call.\nNegative values for horizontal and vertical will flip the texture. + + ll.ScriptDanger + + arguments + + + Position + + tooltip + + type + vector + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns TRUE if Position is over public land, sandbox land, land that doesn't allow everyone to edit and build, or land that doesn't allow outside scripts.\nReturns true if the position is over public land, land that doesn't allow everyone to edit and build, or land that doesn't allow outside scripts. + + ll.ScriptProfiler + + arguments + + + State + + tooltip + PROFILE_NONE or PROFILE_SCRIPT_MEMORY flags to control the state. + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Enables or disables script profiling options. Currently only supports PROFILE_SCRIPT_MEMORY (Mono only) and PROFILE_NONE.\nMay significantly reduce script performance. + + ll.SendRemoteData + + arguments + + + ChannelID + + tooltip + + type + key + + + + Destination + + tooltip + + type + string + + + + Value + + tooltip + + type + integer + + + + Text + + tooltip + + type + string + + + + deprecated + 1 + energy + 10 + return + key + sleep + 3 + tooltip + This function is deprecated. + + ll.Sensor + + arguments + + + Name + + tooltip + Object or avatar name. + type + string + + + + ID + + tooltip + Object or avatar UUID. + type + key + + + + Type + + tooltip + Bit-field mask of AGENT, AGENT_BY_LEGACY_NAME, AGENT_BY_USERNAME, ACTIVE, PASSIVE, and/or SCRIPTED + type + integer + + + + Range + + tooltip + Distance to scan. 0.0 - 96.0m. + type + float + + + + Arc + + tooltip + Angle, in radians, from the local x-axis of the prim to scan. + type + float + + + + energy + 10 + return + void + sleep + 0 + tooltip + Performs a single scan for Name and ID with Type (AGENT, ACTIVE, PASSIVE, and/or SCRIPTED) within Range meters and Arc radians of forward vector.\nSpecifying a blank Name, 0 Type, or NULL_KEY ID will prevent filtering results based on that parameter. A range of 0.0 does not perform a scan.\nResults are returned in the sensor and no_sensor events. + + ll.SensorRemove + + arguments + + energy + 10 + return + void + sleep + 0 + tooltip + removes sensor.\nRemoves the sensor set by llSensorRepeat. + + ll.SensorRepeat + + arguments + + + Name + + tooltip + Object or avatar name. + type + string + + + + ID + + tooltip + Object or avatar UUID. + type + key + + + + Type + + tooltip + Bit-field mask of AGENT, AGENT_BY_LEGACY_NAME, AGENT_BY_USERNAME, ACTIVE, PASSIVE, and/or SCRIPTED + type + integer + + + + Range + + tooltip + Distance to scan. 0.0 - 96.0m. + type + float + + + + Arc + + tooltip + Angle, in radians, from the local x-axis of the prim to scan. + type + float + + + + Rate + + tooltip + Period, in seconds, between scans. + type + float + + + + energy + 10 + return + void + sleep + 0 + tooltip + Initiates a periodic scan every Rate seconds, for Name and ID with Type (AGENT, ACTIVE, PASSIVE, and/or SCRIPTED) within Range meters and Arc radians of forward vector.\nSpecifying a blank Name, 0 Type, or NULL_KEY ID will prevent filtering results based on that parameter. A range of 0.0 does not perform a scan.\nResults are returned in the sensor and no_sensor events. + + ll.SetAgentEnvironment + + arguments + + + agent_id + + tooltip + Agent to receive new environment settings. + type + key + + + + transition + + tooltip + Number of seconds over which to apply new settings. + type + float + + + + Settings + + tooltip + List of environment settings to replace for agent. + type + list + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Sets an agent's environmental values to the specified values. Must be used as part of an experience. + + ll.SetAgentRot + + arguments + + + rot + + tooltip + Rotation to turn the avatar to face. + type + rotation + + + + flags + + tooltip + flags + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Sets the avatar rotation to the given value. + + ll.SetAlpha + + arguments + + + Opacity + + tooltip + + type + float + + + + Face + + tooltip + + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Sets the alpha (opacity) of Face.\nSets the alpha (opacity) value for Face. If Face is ALL_SIDES, sets the alpha for all faces. The alpha value is interpreted as an opacity percentage (1.0 is fully opaque, and 0.2 is mostly transparent). This function will clamp alpha values less than 0.1 to 0.1 and greater than 1.0 to 1. + + ll.SetAngularVelocity + + arguments + + + AngVel + + tooltip + The angular velocity to set the object to. + type + vector + + + + Local + + tooltip + If TRUE, the AngVel is treated as a local directional vector instead of a regional directional vector. + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Sets an object's angular velocity to AngVel, in local coordinates if Local == TRUE (if the script is physical).\nHas no effect on non-physical objects. + + ll.SetAnimationOverride + + arguments + + + AnimationState + + tooltip + + type + string + + + + AnimationName + + tooltip + + type + string + + + + energy + 10 + return + void + sleep + 0 + tooltip + Sets the animation (in object inventory) that will play for the given animation state.\nTo use this function the script must obtain the PERMISSION_OVERRIDE_ANIMATIONS permission. + + ll.SetBuoyancy + + arguments + + + Buoyancy + + tooltip + + type + float + + + + energy + 10 + return + void + sleep + 0 + tooltip + Set the tasks buoyancy (0 is none, < 1.0 sinks, 1.0 floats, > 1.0 rises).\nSet the object buoyancy. A value of 0 is none, less than 1.0 sinks, 1.0 floats, and greater than 1.0 rises. + + ll.SetCameraAtOffset + + arguments + + + Offset + + tooltip + + type + vector + + + + energy + 10 + return + void + sleep + 0 + tooltip + Sets the camera used in this object, at offset, if an avatar sits on it.\nSets the offset that an avatar's camera will be moved to if the avatar sits on the object. + + ll.SetCameraEyeOffset + + arguments + + + Offset + + tooltip + + type + vector + + + + energy + 10 + return + void + sleep + 0 + tooltip + Sets the camera eye offset used in this object if an avatar sits on it. + + ll.SetCameraParams + + arguments + + + Parameters + + tooltip + + type + list + + + + energy + 10 + return + void + sleep + 0 + tooltip + Sets multiple camera parameters at once. List format is [ rule-1, data-1, rule-2, data-2 . . . rule-n, data-n ]. + + ll.SetClickAction + + arguments + + + Action + + tooltip + A CLICK_ACTION_* flag + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Sets the action performed when a prim is clicked upon. + + ll.SetColor + + arguments + + + Color + + tooltip + + type + vector + + + + Face + + tooltip + + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Sets the color, for the face.\nSets the color of the side specified. If Face is ALL_SIDES, sets the color on all faces. + + ll.SetContentType + + arguments + + + HTTPRequestID + + tooltip + A valid http_request() key + type + key + + + + ContentType + + tooltip + Media type to use with any following llHTTPResponse(HTTPRequestID, ...) + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Set the media type of an LSL HTTP server response to ContentType.\nHTTPRequestID must be a valid http_request ID. ContentType must be one of the CONTENT_TYPE_* constants. + + ll.SetDamage + + arguments + + + Damage + + tooltip + + type + float + + + + energy + 10 + return + void + sleep + 0 + tooltip + Sets the amount of damage that will be done to an avatar that this task hits. Task will be killed.\nSets the amount of damage that will be done to an avatar that this object hits. This object will be destroyed on damaging an avatar, and no collision event is triggered. + + ll.SetEnvironment + + arguments + + + Position + + tooltip + Location within the region. + type + vector + + + + EnvParams + + tooltip + List of environment settings to change for the specified parcel location. + type + list + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns a string with the requested data about the region. + + ll.SetForce + + arguments + + + Force + + tooltip + Directional force. + type + vector + + + + Local + + tooltip + Boolean, if TRUE uses local axis, if FALSE uses region axis. + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Sets Force on object, in object-local coordinates if Local == TRUE (otherwise, the region reference frame is used).\nOnly works on physical objects. + + ll.SetForceAndTorque + + arguments + + + Force + + tooltip + Directional force. + type + vector + + + + Torque + + tooltip + Torque force. + type + vector + + + + Local + + tooltip + Boolean, if TRUE uses local axis, if FALSE uses region axis. + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Sets the Force and Torque of object, in object-local coordinates if Local == TRUE (otherwise, the region reference frame is used).\nOnly works on physical objects. + + ll.SetGroundTexture + + arguments + + + Changes + + tooltip + A list of ground texture properties to change. + type + list + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Changes terrain texture properties in the region. + + ll.SetHoverHeight + + arguments + + + Height + + tooltip + Distance above the ground. + type + float + + + + Water + + tooltip + Boolean, if TRUE then hover above water too. + type + integer + + + + Tau + + tooltip + Seconds to critically damp in. + type + float + + + + energy + 10 + return + void + sleep + 0 + tooltip + Critically damps a physical object to a Height (either above ground level or above the higher of land and water if water == TRUE).\nDo not use with vehicles. Use llStopHover to stop hovering. + + ll.SetInventoryPermMask + + arguments + + + InventoryItem + + tooltip + An item in the prim's inventory + type + string + + + + PermissionFlag + + tooltip + MASK_* flag + type + integer + + + + PermissionMask + + tooltip + Permission bit-field (PERM_* flags) + type + integer + + + + energy + 10 + god-mode + 1 + return + void + sleep + 0 + tooltip + Sets the given permission mask to the new value on the inventory item. + + ll.SetKeyframedMotion + + arguments + + + Keyframes + + tooltip + Strided keyframe list of the form: position, orientation, time. Each keyframe is interpreted relative to the previous transform of the object. + type + list + + + + Options + + tooltip + + type + list + + + + energy + 10 + return + void + sleep + 0 + tooltip + Requests that a non-physical object be key-framed according to key-frame list.\nSpecify a list of times, positions, and orientations to be followed by an object. The object will be smoothly moved between key-frames by the simulator. Collisions with other non-physical or key-framed objects will be ignored (no script events will fire and collision processing will not occur). Collisions with physical objects will be computed and reported, but the key-framed object will be unaffected by those collisions.\nKeyframes is a strided list containing positional, rotational, and time data for each step in the motion. Options is a list containing optional arguments and parameters (specified by KFM_* constants). + + ll.SetLinkAlpha + + arguments + + + LinkNumber + + tooltip + + type + integer + + + + Opacity + + tooltip + + type + float + + + + Face + + tooltip + + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + If a prim exists in the link chain at LinkNumber, set Face to Opacity.\nSets the Face, on the linked prim specified, to the Opacity. + + ll.SetLinkCamera + + arguments + + + LinkNumber + + tooltip + Prim link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag + type + integer + + + + EyeOffset + + tooltip + Offset, relative to the object's centre and expressed in local coordinates, that the camera looks from. + type + vector + + + + LookOffset + + tooltip + Offset, relative to the object's centre and expressed in local coordinates, that the camera looks toward. + type + vector + + + + energy + 10 + return + void + sleep + 0 + tooltip + Sets the camera eye offset, and the offset that camera is looking at, for avatars that sit on the linked prim. + + ll.SetLinkColor + + arguments + + + LinkNumber + + tooltip + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag. + type + integer + + + + Color + + tooltip + Color in RGB <R.R, G.G, B.B> + type + vector + + + + Face + + tooltip + Side number or ALL_SIDES. + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + If a task exists in the link chain at LinkNumber, set the Face to color.\nSets the color of the linked child's side, specified by LinkNumber. + + ll.SetLinkMedia + + arguments + + + Link + + tooltip + Link number (0: unlinked, 1: root prim, >1: child prims). + type + integer + + + + Face + + tooltip + Face number. + type + integer + + + + Parameters + + tooltip + A set of name/value pairs (in no particular order) + type + list + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Set the media parameters for a particular face on linked prim, specified by Link. Returns an integer that is a STATUS_* flag which details the success/failure of the operation(s).\nMediaParameters is a set of name/value pairs in no particular order. Parameters not specified are unchanged, or if new media is added then set to the default specified. + + ll.SetLinkPrimitiveParams + + arguments + + + LinkNumber + + tooltip + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag + type + integer + + + + Parameters + + tooltip + + type + list + + + + energy + 10 + return + void + sleep + 0.2000000000000000111022302 + tooltip + Set primitive parameters for LinkNumber based on Parameters.\nSets the parameters (or properties) of any linked prim in one step. + + ll.SetLinkPrimitiveParamsFast + + arguments + + + LinkNumber + + tooltip + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag + type + integer + + + + Parameters + + tooltip + + type + list + + + + energy + 10 + return + void + sleep + 0 + tooltip + Set primitive parameters for LinkNumber based on Parameters, without a delay.\nSet parameters for link number, from the list of Parameters, with no built-in script sleep. This function is identical to llSetLinkPrimitiveParams, except without the delay. + + ll.SetLinkRenderMaterial + + arguments + + + LinkNumber + + tooltip + + type + integer + + + + RenderMaterial + + tooltip + + type + string + + + + Face + + tooltip + + type + integer + + + + energy + 10 + return + void + sleep + 0.2000000000000000111022302 + tooltip + Sets the Render Material of Face on a linked prim, specified by LinkNumber. Render Materail may be a UUID or name of a material in prim inventory. + + ll.SetLinkSitFlags + + arguments + + + LinkNumber + + tooltip + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag. + type + integer + + + + Flags + + tooltip + The new set of sit flags to apply to the specified prims in this linkset. + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Returns the sit flags set on the specified prim in a linkset. + + ll.SetLinkTexture + + arguments + + + LinkNumber + + tooltip + + type + integer + + + + Texture + + tooltip + + type + string + + + + Face + + tooltip + + type + integer + + + + energy + 10 + return + void + sleep + 0.2000000000000000111022302 + tooltip + Sets the Texture of Face on a linked prim, specified by LinkNumber. Texture may be a UUID or name of a texture in prim inventory. + + ll.SetLinkTextureAnim + + arguments + + + LinkNumber + + tooltip + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag to effect + type + integer + + + + Mode + + tooltip + Bitmask of animation options. + type + integer + + + + Face + + tooltip + Specifies which object face to animate or ALL_SIDES. + type + integer + + + + SizeX + + tooltip + Horizontal frames (ignored for ROTATE and SCALE). + type + integer + + + + SizeY + + tooltip + Vertical frames (ignored for ROTATE and SCALE). + type + integer + + + + Start + + tooltip + Start position/frame number (or radians for ROTATE). + type + float + + + + Length + + tooltip + Specifies the animation duration, in frames (or radians for ROTATE). + type + float + + + + Rate + + tooltip + Specifies the animation playback rate, in frames per second (must be greater than zero). + type + float + + + + energy + 10 + return + void + sleep + 0 + tooltip + Animates a texture on the prim specified by LinkNumber, by setting the texture scale and offset.\nMode is a bitmask of animation options.\nFace specifies which object face to animate.\nSizeX and SizeY specify the number of horizontal and vertical frames.Start specifes the animation start point.\nLength specifies the animation duration.\nRate specifies the animation playback rate. + + ll.SetLocalRot + + arguments + + + Rotation + + tooltip + + type + rotation + + + + energy + 10 + return + void + sleep + 0.2000000000000000111022302 + tooltip + Sets the rotation of a child prim relative to the root prim. + + ll.SetMemoryLimit + + arguments + + + Limit + + tooltip + The amount to reserve, which must be less than the allowed maximum (currently 64KB) and not already have been exceeded. + type + integer + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Requests Limit bytes to be reserved for this script.\nReturns TRUE or FALSE indicating whether the limit was set successfully.\nThis function has no effect if the script is running in the LSO VM. + + ll.SetObjectDesc + + arguments + + + Description + + tooltip + + type + string + + + + energy + 10 + return + void + sleep + 0 + tooltip + Sets the description of the prim to Description.\nThe description field is limited to 127 characters. + + ll.SetObjectName + + arguments + + + Name + + tooltip + + type + string + + + + energy + 10 + return + void + sleep + 0 + tooltip + Sets the prim's name to Name. + + ll.SetObjectPermMask + + arguments + + + PermissionFlag + + tooltip + MASK_* flag + type + integer + + + + PermissionMask + + tooltip + Permission bit-field (PERM_* flags) + type + integer + + + + energy + 10 + god-mode + 1 + return + void + sleep + 0 + tooltip + Sets the specified PermissionFlag permission to the value specified by PermissionMask on the object the script is attached to. + + ll.SetParcelMusicURL + + arguments + + + URL + + tooltip + + type + string + + + + energy + 10 + return + void + sleep + 2 + tooltip + Sets the streaming audio URL for the parcel the object is on.\nThe object must be owned by the owner of the parcel; if the parcel is group owned the object must be owned by that group. + + ll.SetPayPrice + + arguments + + + Price + + tooltip + The default price shown in the textu input field. + type + integer + + + + QuickButtons + + tooltip + Specifies the 4 payment values shown in the payment dialog's buttons (or PAY_HIDE). + type + list + + + + energy + 10 + return + void + sleep + 0 + tooltip + Sets the default amount when someone chooses to pay this object.\nPrice is the default price shown in the textu input field. QuickButtons specifies the 4 payment values shown in the payment dialog's buttons.\nInput field and buttons may be hidden with PAY_HIDE constant, and may be set to their default values using PAY_DEFAULT. + + ll.SetPhysicsMaterial + + arguments + + + MaterialBits + + tooltip + A bitmask specifying which of the parameters in the other arguments should be applied to the object. + type + integer + + + + GravityMultiplier + + tooltip + + type + float + + + + Restitution + + tooltip + + type + float + + + + Friction + + tooltip + + type + float + + + + Density + + tooltip + + type + float + + + + energy + 10 + return + void + sleep + 0 + tooltip + Sets the selected parameters of the object's physics behavior.\nMaterialBits is a bitmask specifying which of the parameters in the other arguments should be applied to the object. GravityMultiplier, Restitution, Friction, and Density are the possible parameters to manipulate. + + ll.SetPos + + arguments + + + Position + + tooltip + Region coordinates to move to (within 10m). + type + vector + + + + energy + 10 + return + void + sleep + 0.2000000000000000111022302 + tooltip + If the object is not physical, this function sets the position of the prim.\nIf the script is in a child prim, Position is treated as root relative and the link-set is adjusted.\nIf the prim is the root prim, the entire object is moved (up to 10m) to Position in region coordinates. + + ll.SetPrimMediaParams + + arguments + + + Face + + tooltip + Face number + type + integer + + + + MediaParameters + + tooltip + A set of name/value pairs (in no particular order) + type + list + + + + energy + 10 + return + integer + sleep + 1 + tooltip + Sets the MediaParameters for a particular Face on the prim. Returns an integer that is a STATUS_* flag which details the success/failure of the operation(s).\nMediaParameters is a set of name/value pairs in no particular order. Parameters not specified are unchanged, or if new media is added then set to the default specified. + + ll.SetPrimURL + + arguments + + + URL + + tooltip + + type + string + + + + deprecated + 1 + energy + 10 + return + void + sleep + 20 + tooltip + Deprecated: Use llSetPrimMediaParams instead. + + ll.SetPrimitiveParams + + arguments + + + Parameters + + tooltip + A list of changes. + type + list + + + + energy + 10 + return + void + sleep + 0.2000000000000000111022302 + tooltip + This function changes the many properties (or "parameters") of a prim in one operation. Parameters is a list of changes. + + ll.SetRegionPos + + arguments + + + Position + + tooltip + Vector. The location to move to, in region coordinates. + type + vector + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Attempts to move the object so that the root prim is within 0.1m of Position.\nReturns an integer boolean, TRUE if the object is successfully placed within 0.1 m of Position, FALSE otherwise.\nPosition may be any location within the region or up to 10m across a region border.\nIf the position is below ground, it will be set to the ground level at that x,y location. + + ll.SetRemoteScriptAccessPin + + arguments + + + PIN + + tooltip + + type + integer + + + + energy + 10 + return + void + sleep + 0.2000000000000000111022302 + tooltip + If PIN is set to a non-zero number, the task will accept remote script loads via llRemoteLoadScriptPin() if it passes in the correct PIN. Othersise, llRemoteLoadScriptPin() is ignored. + + ll.SetRenderMaterial + + arguments + + + Material + + tooltip + + type + string + + + + Face + + tooltip + + type + integer + + + + energy + 10 + return + void + sleep + 0.2000000000000000111022302 + tooltip + Applies Render Material to Face of prim.\nRender Material may be a UUID or name of a material in prim inventory.\nIf Face is ALL_SIDES, set the render material on all faces. + + ll.SetRot + + arguments + + + Rotation + + tooltip + + type + rotation + + + + energy + 10 + return + void + sleep + 0.2000000000000000111022302 + tooltip + If the object is not physical, this function sets the rotation of the prim.\nIf the script is in a child prim, Rotation is treated as root relative and the link-set is adjusted.\nIf the prim is the root prim, the entire object is rotated to Rotation in the global reference frame. + + ll.SetScale + + arguments + + + Scale + + tooltip + + type + vector + + + + energy + 10 + return + void + sleep + 0 + tooltip + Sets the prim's scale (size) to Scale. + + ll.SetScriptState + + arguments + + + ScriptName + + tooltip + + type + string + + + + Running + + tooltip + + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Enable or disable the script Running state of Script in the prim. + + ll.SetSitText + + arguments + + + Text + + tooltip + + type + string + + + + energy + 10 + return + void + sleep + 0 + tooltip + Displays Text rather than 'Sit' in the viewer's context menu. + + ll.SetSoundQueueing + + arguments + + + QueueEnable + + tooltip + Boolean, sound queuing: TRUE enables, FALSE disables (default). + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Sets whether successive calls to llPlaySound, llLoopSound, etc., (attached sounds) interrupt the currently playing sound.\nThe default for objects is FALSE. Setting this value to TRUE will make the sound wait until the current playing sound reaches its end. The queue is one level deep. + + ll.SetSoundRadius + + arguments + + + Radius + + tooltip + Maximum distance that sounds can be heard. + type + float + + + + energy + 10 + return + void + sleep + 0 + tooltip + Limits radius for audibility of scripted sounds (both attached and triggered) to distance Radius. + + ll.SetStatus + + arguments + + + Status + + tooltip + + type + integer + + + + Value + + tooltip + + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Sets object status specified in Status bitmask (e.g. STATUS_PHYSICS|STATUS_PHANTOM) to boolean Value.\nFor a full list of STATUS_* constants, see wiki documentation. + + ll.SetText + + arguments + + + Text + + tooltip + + type + string + + + + Color + + tooltip + + type + vector + + + + Opacity + + tooltip + + type + float + + + + energy + 10 + return + void + sleep + 0 + tooltip + Causes Text to float above the prim, using the specified Color and Opacity. + + ll.SetTexture + + arguments + + + Texture + + tooltip + + type + string + + + + Face + + tooltip + + type + integer + + + + energy + 10 + return + void + sleep + 0.2000000000000000111022302 + tooltip + Applies Texture to Face of prim.\nTexture may be a UUID or name of a texture in prim inventory.\nIf Face is ALL_SIDES, set the texture on all faces. + + ll.SetTextureAnim + + arguments + + + Mode + + tooltip + Mask of Mode flags. + type + integer + + + + Face + + tooltip + Face number or ALL_SIDES. + type + integer + + + + SizeX + + tooltip + Horizontal frames (ignored for ROTATE and SCALE). + type + integer + + + + SizeY + + tooltip + Vertical frames (ignored for ROTATE and SCALE). + type + integer + + + + Start + + tooltip + Start position/frame number (or radians for ROTATE). + type + float + + + + Length + + tooltip + number of frames to display (or radians for ROTATE). + type + float + + + + Rate + + tooltip + Frames per second (must not greater than zero). + type + float + + + + energy + 10 + return + void + sleep + 0 + tooltip + Animates a texture by setting the texture scale and offset.\nMode is a bitmask of animation options.\nFace specifies which object face to animate.\nSizeX and SizeY specify the number of horizontal and vertical frames.Start specifes the animation start point.\nLength specifies the animation duration.\nRate specifies the animation playback rate. + + ll.SetTimerEvent + + arguments + + + Rate + + tooltip + + type + float + + + + energy + 10 + return + void + sleep + 0 + tooltip + Causes the timer event to be triggered every Rate seconds.\n Passing in 0.0 stops further timer events. + + ll.SetTorque + + arguments + + + Torque + + tooltip + Torque force. + type + vector + + + + Local + + tooltip + Boolean, if TRUE uses local axis, if FALSE uses region axis. + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Sets the Torque acting on the script's object, in object-local coordinates if Local == TRUE (otherwise, the region reference frame is used).\nOnly works on physical objects. + + ll.SetTouchText + + arguments + + + Text + + tooltip + + type + string + + + + energy + 10 + return + void + sleep + 0 + tooltip + Displays Text in the viewer context menu that acts on a touch. + + ll.SetVehicleFlags + + arguments + + + Flags + + tooltip + + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Enables the vehicle flags specified in the Flags bitmask.\nValid parameters can be found in the wiki documentation. + + ll.SetVehicleFloatParam + + arguments + + + ParameterName + + tooltip + + type + integer + + + + ParameterValue + + tooltip + + type + float + + + + energy + 10 + return + void + sleep + 0 + tooltip + Sets a vehicle float parameter.\nValid parameters can be found in the wiki documentation. + + ll.SetVehicleRotationParam + + arguments + + + ParameterName + + tooltip + + type + integer + + + + ParameterValue + + tooltip + + type + rotation + + + + energy + 10 + return + void + sleep + 0 + tooltip + Sets a vehicle rotation parameter.\nValid parameters can be found in the wiki documentation. + + ll.SetVehicleType + + arguments + + + Type + + tooltip + + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Activates the vehicle action on the object with vehicle preset Type.\nValid Types and an explanation of their characteristics can be found in wiki documentation. + + ll.SetVehicleVectorParam + + arguments + + + ParameterName + + tooltip + + type + integer + + + + ParameterValue + + tooltip + + type + vector + + + + energy + 10 + return + void + sleep + 0 + tooltip + Sets a vehicle vector parameter.\nValid parameters can be found in the wiki documentation. + + ll.SetVelocity + + arguments + + + Velocity + + tooltip + The velocity to apply. + type + vector + + + + Local + + tooltip + If TRUE, the Velocity is treated as a local directional vector instead of a regional directional vector. + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + If the object is physics-enabled, sets the object's linear velocity to Velocity.\nIf Local==TRUE, Velocity is treated as a local directional vector; otherwise, Velocity is treated as a global directional vector. + + ll.Shout + + arguments + + + Channel + + tooltip + + type + integer + + + + Text + + tooltip + + type + string + + + + energy + 10 + return + void + sleep + 0 + tooltip + Shouts Text on Channel.\nThis chat method has a range of 100m radius.\nPUBLIC_CHANNEL is the public chat channel that all avatars see as chat text. DEBUG_CHANNEL is the script debug channel, and is also visible to nearby avatars. All other channels are are not sent to avatars, but may be used to communicate with scripts. + + ll.SignRSA + + arguments + + + PrivateKey + + tooltip + The PEM-formatted private key + type + string + + + + Message + + tooltip + The message contents to sign + type + string + + + + Algorithm + + tooltip + The digest algorithnm to use: sha1, sha224, sha256, sha384, sha512 + type + string + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the base64-encoded RSA signature of Message using PEM-formatted PrivateKey and digest Algorithm (sha1, sha224, sha256, sha384, sha512). + + ll.Sin + + arguments + + + Theta + + tooltip + + type + float + + + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the sine of Theta (Theta in radians). + + ll.SitOnLink + + arguments + + + AvatarID + + tooltip + + type + key + + + + LinkID + + tooltip + + type + integer + + + + energy + 10 + return + integer + sleep + 0 + tooltip + If agent identified by AvatarID is participating in the experience, sit them on the specified link's sit target. + + ll.SitTarget + + arguments + + + Offset + + tooltip + + type + vector + + + + Rotation + + tooltip + + type + rotation + + + + energy + 10 + return + void + sleep + 0 + tooltip + Set the sit location for this object. If offset == ZERO_VECTOR, clears the sit target. + + ll.Sleep + + arguments + + + Time + + tooltip + + type + float + + + + energy + 0 + return + void + sleep + 0 + tooltip + Put script to sleep for Time seconds. + + ll.Sound + + arguments + + + Sound + + tooltip + + type + string + + + + Volume + + tooltip + + type + float + + + + Queue + + tooltip + + type + integer + + + + Loop + + tooltip + + type + integer + + + + deprecated + 1 + energy + 10 + return + void + sleep + 0 + tooltip + Deprecated: Use llPlaySound instead.\nPlays Sound at Volume and specifies whether the sound should loop and/or be enqueued. + + ll.SoundPreload + + arguments + + + Sound + + tooltip + + type + string + + + + deprecated + 1 + energy + 10 + return + void + sleep + 0 + tooltip + Deprecated: Use llPreloadSound instead.\nPreloads a sound on viewers within range. + + ll.Sqrt + + arguments + + + Value + + tooltip + + type + float + + + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the square root of Value.\nTriggers a math runtime error for imaginary results (if Value < 0.0). + + ll.StartAnimation + + arguments + + + Animation + + tooltip + + type + string + + + + energy + 10 + return + void + sleep + 0 + tooltip + This function plays the specified animation from playing on the avatar who received the script's most recent permissions request.\nAnimation may be an animation in task inventory or a built-in animation.\nRequires PERMISSION_TRIGGER_ANIMATION. + + ll.StartObjectAnimation + + arguments + + + Animation + + tooltip + + type + string + + + + energy + 10 + return + void + sleep + 0 + tooltip + This function plays the specified animation on the rigged mesh object associated with the current script.\nAnimation may be an animation in task inventory or a built-in animation.\n + + ll.StopAnimation + + arguments + + + Animation + + tooltip + + type + string + + + + energy + 10 + return + void + sleep + 0 + tooltip + This function stops the specified animation on the avatar who received the script's most recent permissions request.\nAnimation may be an animation in task inventory, a built-in animation, or the uuid of an animation.\nRequires PERMISSION_TRIGGER_ANIMATION. + + ll.StopHover + + arguments + + energy + 10 + return + void + sleep + 0 + tooltip + Stop hovering to a height (due to llSetHoverHeight()). + + ll.StopLookAt + + arguments + + energy + 10 + return + void + sleep + 0 + tooltip + Stop causing object to point at a target (due to llLookAt() or llRotLookAt()). + + ll.StopMoveToTarget + + arguments + + energy + 10 + return + void + sleep + 0 + tooltip + Stops critically damped motion (due to llMoveToTarget()). + + ll.StopObjectAnimation + + arguments + + + Animation + + tooltip + + type + string + + + + energy + 10 + return + void + sleep + 0 + tooltip + This function stops the specified animation on the rigged mesh object associated with the current script.\nAnimation may be an animation in task inventory, a built-in animation, or the uuid of an animation.\n + + ll.StopSound + + arguments + + energy + 10 + return + void + sleep + 0 + tooltip + Stops playback of the currently attached sound. + + ll.StringLength + + arguments + + + Text + + tooltip + + type + string + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns an integer that is the number of characters in Text (not counting the null). + + ll.StringToBase64 + + arguments + + + Text + + tooltip + + type + string + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the string Base64 representation of the input string. + + ll.StringTrim + + arguments + + + Text + + tooltip + String to trim + type + string + + + + TrimType + + tooltip + STRING_TRIM_HEAD, STRING_TRIM_TAIL, or STRING_TRIM. + type + integer + + + + energy + 10 + return + string + sleep + 0 + tooltip + Outputs a string, eliminating white-space from the start and/or end of the input string Text.\nValid options for TrimType:\nSTRING_TRIM_HEAD: trim all leading spaces in Text\nSTRING_TRIM_TAIL: trim all trailing spaces in Text\nSTRING_TRIM: trim all leading and trailing spaces in Text. + + ll.SubStringIndex + + arguments + + + Text + + tooltip + + type + string + + + + Sequence + + tooltip + + type + string + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns an integer that is the index in Text where string pattern Sequence first appears. Returns -1 if not found. + + ll.TakeCamera + + arguments + + + AvatarID + + tooltip + + type + key + + + + deprecated + 1 + energy + 10 + return + void + sleep + 0 + tooltip + Deprecated: Use llSetCameraParams instead. + + ll.TakeControls + + arguments + + + Controls + + tooltip + Bit-field of CONTROL_* flags. + type + integer + + + + Accept + + tooltip + Boolean, determines whether control events are generated. + type + integer + + + + PassOn + + tooltip + Boolean, determines whether controls are disabled. + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Take controls from the agent the script has permissions for.\nIf (Accept == (Controls & input)), send input to the script. PassOn determines whether Controls also perform their normal functions.\nRequires the PERMISSION_TAKE_CONTROLS permission to run. + + ll.Tan + + arguments + + + Theta + + tooltip + + type + float + + + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the tangent of Theta (Theta in radians). + + ll.Target + + arguments + + + Position + + tooltip + + type + vector + + + + Range + + tooltip + + type + float + + + + energy + 10 + return + integer + sleep + 0 + tooltip + This function is to have the script know when it has reached a position.\nIt registers a Position with a Range that triggers at_target and not_at_target events continuously until unregistered. + + ll.TargetOmega + + arguments + + + Axis + + tooltip + + type + vector + + + + SpinRate + + tooltip + + type + float + + + + Gain + + tooltip + + type + float + + + + energy + 10 + return + void + sleep + 0 + tooltip + Attempt to spin at SpinRate with strength Gain on Axis.\nA spin rate of 0.0 cancels the spin. This function always works in object-local coordinates. + + ll.TargetRemove + + arguments + + + Target + + tooltip + + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Removes positional target Handle registered with llTarget. + + ll.TargetedEmail + + arguments + + + Target + + tooltip + + type + integer + + + + Subject + + tooltip + + type + string + + + + Text + + tooltip + + type + string + + + + energy + 10 + return + void + sleep + 20 + tooltip + Sends an email with Subject and Message to the owner or creator of an object . + + ll.TeleportAgent + + arguments + + + AvatarID + + tooltip + UUID of avatar. + type + key + + + + LandmarkName + + tooltip + Name of landmark (in object contents), or empty string, to use. + type + string + + + + Position + + tooltip + If no landmark was provided, the position within the current region to teleport the avatar to. + type + vector + + + + LookAtPoint + + tooltip + The position within the target region that the avatar should be turned to face upon arrival. + type + vector + + + + energy + 10 + return + void + sleep + 0 + tooltip + Requests a teleport of avatar to a landmark stored in the object's inventory. If no landmark is provided (an empty string), the avatar is teleported to the location position in the current region. In either case, the avatar is turned to face the position given by look_at in local coordinates.\nRequires the PERMISSION_TELEPORT permission. This function can only teleport the owner of the object. + + ll.TeleportAgentGlobalCoords + + arguments + + + AvatarID + + tooltip + UUID of avatar. + type + key + + + + GlobalPosition + + tooltip + Global coordinates of the destination region. Can be retrieved by using llRequestSimulatorData(region_name, DATA_SIM_POS). + type + vector + + + + RegionPosition + + tooltip + The position within the target region to teleport the avatar to, if no landmark was provided. + type + vector + + + + LookAtPoint + + tooltip + The position within the target region that the avatar should be turned to face upon arrival. + type + vector + + + + energy + 10 + return + void + sleep + 0 + tooltip + Teleports an agent to the RegionPosition local coordinates within a region which is specified by the GlobalPosition global coordinates. The agent lands facing the position defined by LookAtPoint local coordinates.\nRequires the PERMISSION_TELEPORT permission. This function can only teleport the owner of the object. + + ll.TeleportAgentHome + + arguments + + + AvatarID + + tooltip + + type + key + + + + energy + 100 + return + void + sleep + 5 + tooltip + Teleport agent over the owner's land to agent's home location. + + ll.TextBox + + arguments + + + AvatarID + + tooltip + + type + key + + + + Text + + tooltip + + type + string + + + + Channel + + tooltip + + type + integer + + + + energy + 10 + return + void + sleep + 1 + tooltip + Opens a dialog for the specified avatar with message Text, which contains a text box for input. Any text that is entered is said on the specified Channel (as if by the avatar) when the "OK" button is clicked. + + ll.ToLower + + arguments + + + Text + + tooltip + + type + string + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns a string that is Text with all lower-case characters. + + ll.ToUpper + + arguments + + + Text + + tooltip + + type + string + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns a string that is Text with all upper-case characters. + + ll.TransferLindenDollars + + arguments + + + AvatarID + + tooltip + + type + key + + + + Amount + + tooltip + + type + integer + + + + energy + 10 + return + key + sleep + 0 + tooltip + Transfer Amount of linden dollars (L$) from script owner to AvatarID. Returns a key to a corresponding transaction_result event for the success of the transfer.\nAttempts to send the amount of money to the specified avatar, and trigger a transaction_result event identified by the returned key. + + ll.TransferOwnership + + arguments + + + AgentID + + tooltip + An agent in the region. + type + key + + + + Flags + + tooltip + Flags to control type of inventory transfer. + type + integer + + + + Params + + tooltip + Extra parameters to llTransferOwnership. None are defined at this time. + type + list + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Transfers ownership of an object, or a copy of the object to a new agent. + + ll.TriggerSound + + arguments + + + Sound + + tooltip + + type + string + + + + Volume + + tooltip + + type + float + + + + energy + 10 + return + void + sleep + 0 + tooltip + Plays Sound at Volume (0.0 - 1.0), centered at but not attached to object.\nThere is no limit to the number of triggered sounds which can be generated by an object, and calling llTriggerSound does not affect the attached sounds created by llPlaySound and llLoopSound. This is very useful for things like collision noises, explosions, etc. There is no way to stop or alter the volume of a sound triggered by this function. + + ll.TriggerSoundLimited + + arguments + + + Sound + + tooltip + + type + string + + + + Volume + + tooltip + + type + float + + + + TNE + + tooltip + + type + vector + + + + BSW + + tooltip + + type + vector + + + + energy + 10 + return + void + sleep + 0 + tooltip + Plays Sound at Volume (0.0 - 1.0), centered at but not attached to object, limited to axis-aligned bounding box defined by vectors top-north-east (TNE) and bottom-south-west (BSW).\nThere is no limit to the number of triggered sounds which can be generated by an object, and calling llTriggerSound does not affect the attached sounds created by llPlaySound and llLoopSound. This is very useful for things like collision noises, explosions, etc. There is no way to stop or alter the volume of a sound triggered by this function. + + ll.UnSit + + arguments + + + AvatarID + + tooltip + + type + key + + + + energy + 10 + return + void + sleep + 0 + tooltip + If agent identified by AvatarID is sitting on the object the script is attached to or is over land owned by the objects owner, the agent is forced to stand up. + + ll.UnescapeURL + + arguments + + + URL + + tooltip + + type + string + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the string that is the URL unescaped, replacing "%20" with spaces, etc., version of URL.\nThis function can output raw UTF-8 strings. + + ll.UpdateCharacter + + arguments + + + Options + + tooltip + Character configuration options. Takes the same constants as llCreateCharacter(). + type + list + + + + energy + 10 + return + void + sleep + 0 + tooltip + Updates settings for a pathfinding character. + + ll.UpdateKeyValue + + arguments + + + Key + + tooltip + + type + string + + + + Value + + tooltip + + type + string + + + + Checked + + tooltip + + type + integer + + + + OriginalValue + + tooltip + + type + string + + + + energy + 10 + return + key + sleep + 0 + tooltip + + Starts an asychronous transaction to update the value associated with the key given. The dataserver callback will be executed with the key returned from this call and a string describing the result. The result is a two element commma-delimited list. The first item is an integer specifying if the transaction succeeded (1) or not (0). In the failure case, the second item will be an integer corresponding to one of the XP_ERROR_... constants. In the success case the second item will be the value associated with the key. If Checked is 1 the existing value in the data store must match the OriginalValue passed or XP_ERROR_RETRY_UPDATE will be returned. If Checked is 0 the key will be created if necessary. + + + ll.VecDist + + arguments + + + Location1 + + tooltip + + type + vector + + + + Location2 + + tooltip + + type + vector + + + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the distance between Location1 and Location2. + + ll.VecMag + + arguments + + + Vector + + tooltip + + type + vector + + + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the magnitude of the vector. + + ll.VecNorm + + arguments + + + Vector + + tooltip + + type + vector + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns normalized vector. + + ll.VerifyRSA + + arguments + + + PublicKey + + tooltip + The PEM-formatted public key for signature verifiation. + type + string + + + + Message + + tooltip + The message that was signed. + type + string + + + + Signature + + tooltip + The base64-formatted signature of the message. + type + string + + + + Algorithm + + tooltip + The digest algorithm: sha1, sha224, sha256, sha384, sha512. + type + string + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns TRUE if PublicKey, Message, and Algorithm produce the same base64-formatted Signature. + + ll.VolumeDetect + + arguments + + + DetectEnabled + + tooltip + TRUE enables, FALSE disables. + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + If DetectEnabled = TRUE, object becomes phantom but triggers collision_start and collision_end events when other objects start and stop interpenetrating.\nIf another object (including avatars) interpenetrates it, it will get a collision_start event.\nWhen an object stops interpenetrating, a collision_end event is generated. While the other is inter-penetrating, collision events are NOT generated. + + ll.WanderWithin + + arguments + + + Origin + + tooltip + Central point to wander about. + type + vector + + + + Area + + tooltip + Half-extents of an area the character may wander within. (i.e., it can wander from the specified origin by up to +/-Distance.x in x, +/-Distance.y in y, etc.) + type + vector + + + + Options + + tooltip + No options available at this time. + type + list + + + + energy + 10 + return + void + sleep + 0 + tooltip + Wander within a specified volume.\nSets a character to wander about a central spot within a specified area. + + ll.Water + + arguments + + + Offset + + tooltip + + type + vector + + + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the water height below the object position + Offset. + + ll.Whisper + + arguments + + + Channel + + tooltip + + type + integer + + + + Text + + tooltip + + type + string + + + + energy + 10 + return + void + sleep + 0 + tooltip + Whispers Text on Channel.\nThis chat method has a range of 10m radius.\nPUBLIC_CHANNEL is the public chat channel that all avatars see as chat text. DEBUG_CHANNEL is the script debug channel, and is also visible to nearby avatars. All other channels are are not sent to avatars, but may be used to communicate with scripts. + + ll.Wind + + arguments + + + Offset + + tooltip + + type + vector + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the wind velocity at the object position + Offset. + + ll.WorldPosToHUD + + arguments + + + world_pos + + tooltip + The world-frame position to project into HUD space + type + vector + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the local position that would put the origin of a HUD object directly over world_pos as viewed by the current camera. + + ll.XorBase64 + + arguments + + + Text1 + + tooltip + + type + string + + + + Text2 + + tooltip + + type + string + + + + energy + 10 + return + string + sleep + 0 + tooltip + Performs an exclusive OR on two Base64 strings and returns a Base64 string. Text2 repeats if it is shorter than Text1. + + ll.XorBase64Strings + + arguments + + + Text1 + + tooltip + + type + string + + + + Text2 + + tooltip + + type + string + + + + deprecated + 1 + energy + 10 + return + string + sleep + 0.2999999999999999888977698 + tooltip + Deprecated: Please use llXorBase64 instead.\nIncorrectly performs an exclusive OR on two Base64 strings and returns a Base64 string. Text2 repeats if it is shorter than Text1.\nRetained for backwards compatibility. + + ll.XorBase64StringsCorrect + + arguments + + + Text1 + + tooltip + + type + string + + + + Text2 + + tooltip + + type + string + + + + deprecated + 1 + energy + 10 + return + string + sleep + 0 + tooltip + Deprecated: Please use llXorBase64 instead.\nCorrectly (unless nulls are present) performs an exclusive OR on two Base64 strings and returns a Base64 string.\nText2 repeats if it is shorter than Text1. + + ll.sRGB2Linear + + arguments + + + srgb + + tooltip + A color in the sRGB colorspace. + type + vector + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Converts a color from the sRGB to the linear colorspace. + + + ll.sd-lsl-syntax-version + 2 + + + diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index d64f82d3036..f3c3b35d602 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -2469,16 +2469,16 @@ Value 0 - DisableMouseWarp + MouseWarpMode Comment - Disable warping of the mouse to the center of the screen during alt-zoom and mouse look. Useful with certain input devices, mouse sharing programs like Synergy, or running under Parallels. + Controls warping of the mouse to the center of the screen during alt-zoom and mouse look. Useful with certain input devices, mouse sharing programs like Synergy, or running under Parallels. 0 - automatic, 1 - on, 2 - off Persist 1 Type - Boolean + S32 Value - 0 + 1 DisableExternalBrowser @@ -4380,7 +4380,7 @@ Type F32 Value - 40.0 + 90.0 LogMessages @@ -7863,7 +7863,7 @@ RenderMaxOpenGLVersion Comment - Maximum OpenGL version to attempt use (minimum 3.1 maximum 4.6). Requires restart. + Maximum OpenGL version to attempt use (minimum 3.1 maximum 4.6). Requires restart. Windows only. Persist 1 Type @@ -9111,7 +9111,7 @@ RenderQualityPerformance Comment - Which graphics settings you've chosen + Which graphics settings you've chosen. Don't use this setting to change quality directly from debug settings. Persist 1 Type @@ -9119,7 +9119,18 @@ Value 1 - + DebugQualityPerformance + + Comment + Allows to change performance quality directly from debug settings. + Persist + 1 + Type + U32 + Value + 1 + + RenderReflectionDetail Comment @@ -10330,13 +10341,13 @@ SceneLoadRearMaxRadiusFraction Comment - a percentage of draw distance beyond which all objects outside of view frustum will be unloaded, regardless of pixel threshold + a fraction of draw distance beyond which all objects outside of view frustum will be unloaded, regardless of pixel threshold Persist 1 Type F32 Value - 75.0 + 0.75 SceneLoadRearPixelThreshold @@ -13036,9 +13047,9 @@ Use24HourClock Comment - 12 vs 24. At the moment only for region restart schedule floater + 12 vs 24. At the moment coverage is partial Persist - 0 + 1 Type Boolean Value @@ -13915,6 +13926,50 @@ Value + ExternalWebsocketSyncEnable + + Comment + Enables the Websocket JSONRPC server when doing external script editing. + Persist + 1 + Type + Boolean + Value + 1 + + ExternalWebsocketSyncPort + + Comment + Port that the JSONRPC server listens on when editing + Persist + 1 + Type + S32 + Value + 9020 + + ExternalWebsocketSyncLocal + + Comment + Should the JSONRPC server listen only for local connections. + Persist + 1 + Type + Boolean + Value + 1 + + ExternalWebsocketForwardDebug + + Comment + Forward messages and runtime errors for a script to JSONRPC client. + Persist + 1 + Type + Boolean + Value + 1 + YawFromMousePosition Comment @@ -16410,5 +16465,16 @@ Value 2 + ScriptEditorDisableSyntaxHighlight + + Comment + Disable syntax highlighting in script editor for performance testing + Persist + 1 + Type + Boolean + Value + 0 + diff --git a/indra/newview/app_settings/types_lua_default.xml b/indra/newview/app_settings/types_lua_default.xml new file mode 100644 index 00000000000..6b90804ab32 --- /dev/null +++ b/indra/newview/app_settings/types_lua_default.xml @@ -0,0 +1,1914 @@ + + + + version + 1.0.0 + typeAliases + + + name + numeric + definition + + kind + union + types + + boolean + number + + + + + name + uuid_like + definition + + kind + union + types + + string + uuid + + + + + name + list + definition + + kind + array + elementType + + kind + union + types + + string + number + vector + uuid + quaternion + boolean + + + + + + name + lljson_constant + definition + + kind + reference + name + number + + + + name + DetectedEventName + definition + + kind + literal-union + values + + + + + name + NonDetectedEventName + definition + + kind + literal-union + values + + + + + name + EventName + definition + + kind + union + types + + DetectedEventName + NonDetectedEventName + + + + + name + EventHandler + definition + + kind + function + parameters + + + type + any + variadic + true + + + returnType + () + + + + name + DetectedEventHandler + definition + + kind + function + parameters + + + type + + kind + array + elementType + DetectedEvent + + + + returnType + () + + + + name + LLEventsProto + definition + + kind + table + methods + + + name + eventNames + parameters + + + name + self + + + returnType + + kind + array + elementType + string + + + + name + listeners + parameters + + + name + self + + + name + eventName + type + EventName + + + returnType + + kind + array + elementType + EventHandler + + + + name + on + parameters + + + name + self + + + name + eventName + type + DetectedEventName + + + name + handler + type + DetectedEventHandler + + + returnType + EventHandler + overloads + + + name + on + parameters + + + name + self + + + name + eventName + type + NonDetectedEventName + + + name + handler + type + EventHandler + + + returnType + EventHandler + + + + + name + once + parameters + + + name + self + + + name + eventName + type + DetectedEventName + + + name + handler + type + DetectedEventHandler + + + returnType + EventHandler + overloads + + + name + once + parameters + + + name + self + + + name + eventName + type + NonDetectedEventName + + + name + handler + type + EventHandler + + + returnType + EventHandler + + + + + name + off + parameters + + + name + self + + + name + eventName + type + EventName + + + name + handler + type + EventHandler + + + returnType + boolean + + + + + + name + LLTimersProto + definition + + kind + table + methods + + + name + every + parameters + + + name + self + + + name + seconds + type + number + + + name + handler + type + + kind + function + parameters + + + type + any + variadic + true + + + returnType + () + + + + returnType + EventHandler + + + name + once + parameters + + + name + self + + + name + seconds + type + number + + + name + handler + type + + kind + function + parameters + + + type + any + variadic + true + + + returnType + () + + + + returnType + EventHandler + + + name + off + parameters + + + name + self + + + name + handler + type + EventHandler + + + returnType + boolean + + + + + + classes + + + name + uuid + properties + + + name + istruthy + type + boolean + comment + property to check if uuid is valid + + + methods + + + name + __tostring + parameters + + + name + self + + + returnType + string + comment + converts uuid to a string + + + + + name + quaternion + properties + + + name + x + type + number + comment + x property of quaternion + + + name + y + type + number + comment + y property of quaternion + + + name + z + type + number + comment + z property of quaternion + + + name + s + type + number + comment + s property of quaternion + + + methods + + + name + __mul + parameters + + + name + self + + + name + other + type + vector + + + returnType + vector + comment + multiply vector/quaternion by quaternion + overloads + + + name + __mul + parameters + + + name + self + + + name + other + type + quaternion + + + returnType + quaternion + comment + multiply vector/quaternion by quaternion + + + + + + + name + vector + properties + + + name + x + type + number + comment + x property of vector + + + name + y + type + number + comment + y property of vector + + + name + z + type + number + comment + z property of vector + + + methods + + + name + __mul + parameters + + + name + self + + + name + other + type + vector + + + returnType + vector + comment + multiply vector by number, vector, or quaternion + overloads + + + name + __mul + parameters + + + name + self + + + name + other + type + quaternion + + + returnType + vector + comment + multiply vector by number, vector, or quaternion + + + name + __mul + parameters + + + name + self + + + name + other + type + number + + + returnType + vector + comment + multiply vector by number, vector, or quaternion + + + + + name + __div + parameters + + + name + self + + + name + other + type + vector + + + returnType + vector + comment + divide vector by number, vector, or quaternion + overloads + + + name + __div + parameters + + + name + self + + + name + other + type + quaternion + + + returnType + vector + comment + divide vector by number, vector, or quaternion + + + name + __div + parameters + + + name + self + + + name + other + type + number + + + returnType + vector + comment + divide vector by number, vector, or quaternion + + + + + name + __idiv + parameters + + + name + self + + + name + other + type + vector + + + returnType + vector + comment + floor divide vector by number, vector, or quaternion + overloads + + + name + __idiv + parameters + + + name + self + + + name + other + type + quaternion + + + returnType + vector + comment + floor divide vector by number, vector, or quaternion + + + name + __idiv + parameters + + + name + self + + + name + other + type + number + + + returnType + vector + comment + floor divide vector by number, vector, or quaternion + + + + + name + __add + parameters + + + name + self + + + name + other + type + vector + + + returnType + vector + comment + add two vectors + + + name + __sub + parameters + + + name + self + + + name + other + type + vector + + + returnType + vector + comment + subtract vector from vector + + + name + __unm + parameters + + + name + self + + + returnType + vector + comment + negate a vector + + + + + name + DetectedEvent + properties + + + name + valid + type + boolean + + + name + index + type + number + + + name + can_change_damage + type + boolean + + + methods + + + + globalVariables + + + name + LLEvents + type + LLEventsProto + comment + LLEvents object + + + name + LLTimers + type + LLTimersProto + comment + LLTimers object + + + globalFunctions + + + name + uuid + parameters + + + name + str + type + string + + + returnType + uuid + comment + Creates a uuid from a string argument + + + name + toquaternion + parameters + + + name + str + type + string + + + returnType + + kind + union + types + + quaternion + nil + + + comment + Creates a quaternion from a string argument in format `<1,1,1,1>` Invalid strings will return `nil` #### Caveat Due to an old error from lsl strings that match upto the closing `>` are interpreted as valid So `<1,1,1,1` and `<1,1,1,1spoon` are both cast to `<1,1,1,1>` When testing if a string is a quaternion or a vector, you should test with `toquaternion` first. + + + name + tovector + parameters + + + name + str + type + string + + + returnType + + kind + union + types + + vector + nil + + + comment + Creates a vector from a string argument in format `<1,1,1>` Invalid strings will return `nil` #### Caveat Due to an old error from lsl strings that match upto the closing `>` are interpreted as valid So `<1,1,1`, `<1,1,1,1` and `<1,1,1spoon` are all cast to `<1,1,1>` When testing if a string is a quaternion or a vector, you should test with `toquaternion` first. + + + name + vector + parameters + + + name + x + type + number + + + name + y + type + number + + + name + z + type + number + + + returnType + vector + comment + Creates a vector from x,y,z + + + name + quaternion + parameters + + + name + x + type + number + + + name + y + type + number + + + name + z + type + number + + + name + s + type + number + + + returnType + quaternion + comment + Creates a quaternion from x,y,z,s + + + modules + + + name + bit32 + functions + + + name + arshift + parameters + + + name + n + type + number + + + name + i + type + number + + + returnType + number + comment + Shifts `n` by `i` bits to the right (if `i` is negative, a left shift is performed instead). The most significant bit of `n` is propagated during the shift. When `i` is larger than `31`, returns an integer with all bits set to the sign bit of `n`. When `i` is smaller than `-31`, `0` is returned + + + name + band + parameters + + + type + number + variadic + true + + + returnType + number + comment + Performs a bitwise and of all input numbers and returns the result. If the function is called with no arguments, an integer with all bits set to `1` is returned. + + + name + bnot + parameters + + + name + n + type + number + + + returnType + number + comment + Returns a bitwise negation of the input number. + + + name + bor + parameters + + + type + number + variadic + true + + + returnType + number + comment + Performs a bitwise or of all input numbers and returns the result. If the function is called with no arguments, `0` is returned. + + + name + btest + parameters + + + type + number + variadic + true + + + returnType + boolean + comment + Perform a bitwise and of all input numbers, and return `true` if the result is not `0`. If the function is called with no arguments, `true` is returned. + + + name + bxor + parameters + + + type + number + variadic + true + + + returnType + number + comment + Performs a bitwise xor (exclusive or) of all input numbers and returns the result. If the function is called with no arguments, `0` is returned. + + + name + byteswap + parameters + + + name + n + type + number + + + returnType + number + comment + Returns n with the order of the bytes swapped. + + + name + countlz + parameters + + + name + n + type + number + + + returnType + number + comment + Returns the number of consecutive zero bits in the 32-bit representation of `n` starting from the left-most (most significant) bit. Returns `32` if `n` is `0`. + + + name + countrz + parameters + + + name + n + type + number + + + returnType + number + comment + Returns the number of consecutive zero bits in the 32-bit representation of `n` starting from the right-most (least significant) bit. Returns `32` if `n` is `0`. + + + name + extract + parameters + + + name + n + type + number + + + name + f + type + number + + + name + w + type + number + + + returnType + number + comment + Extracts bits of `n` at position `f` with `a` width of `w`, and returns the resulting integer. `w` defaults to 1, so a two-argument version of extract returns the bit value at position `f`. Bits are indexed starting at `0`. Errors if `f` and `f+w-1` are not between `0` and `31`. + + + name + lrotate + parameters + + + name + n + type + number + + + name + i + type + number + + + returnType + number + comment + Rotates `n` to the left by `i` bits (if `i` is negative, a right rotate is performed instead) The bits that are shifted past the bit width are shifted back from the right. + + + name + lshift + parameters + + + name + n + type + number + + + name + i + type + number + + + returnType + number + comment + Shifts `n` to the left by `i` bits (if `i` is negative, a right shift is performed instead). When `i` is outside of `[-31..31]` range, returns `0`. + + + name + replace + parameters + + + name + n + type + number + + + name + r + type + number + + + name + f + type + number + + + name + w + type + number? + + + returnType + number + comment + Replaces bits of `n` at position `f` and width `w` with `r`, and returns the resulting integer. `w` defaults to `1`, so a three-argument version of replace changes one bit at position `f` to `r` (which should be `0` or `1`) and returns the result. Bits are indexed starting at `0`. Errors if `f` and `f+w-1` are not between `0` and `31`. + + + name + lrotate + parameters + + + name + n + type + number + + + name + i + type + number + + + returnType + number + comment + Rotates `n` to the left by `i` bits (if `i` is negative, a right rotate is performed instead) The bits that are shifted past the bit width are shifted back from the right. + + + name + rrotate + parameters + + + name + n + type + number + + + name + i + type + number + + + returnType + number + comment + Rotates `n` to the right by `i` bits (if `i` is negative, a left rotate is performed instead) The bits that are shifted past the bit width are shifted back from the left. + + + name + rshift + parameters + + + name + n + type + number + + + name + i + type + number + + + returnType + number + comment + Shifts `n` to the right by `i` bits (if `i` is negative, a left shift is performed instead). When `i` is outside of `[-31..31]` range, returns `0`. + + + + + name + lljson + properties + + + name + _NAME + type + "lljson" + comment + Name of the lljson table + + + name + _VERSION + type + string + comment + Version of the lljson library (based on the lua-cjson library) + + + name + array_mt + type + + kind + array + elementType + + + comment + Metatable for declaring table as an array for json encode + + + name + array_mt + type + + kind + array + elementType + + + comment + Metatable for declaring table as an empty array for json encode + + + name + empty_array + type + lljson_constant + comment + A constant to pass for an empty array to json encode + + + name + null + type + lljson_constant + comment + A constant to pass for null to json encode + + + functions + + + name + decode + parameters + + + name + json + type + string + + + returnType + + kind + union + types + + string + number + vector + uuid + quaternion + boolean + + kind + array + elementType + + + nil + + + comment + decode json string to lua value + + + name + encode + parameters + + + name + value + type + + kind + union + types + + string + number + vector + uuid + quaternion + boolean + + kind + array + elementType + + + nil + + + + + returnType + string + comment + encode lua value as json + + + + + name + llbase64 + functions + + + name + decode + parameters + + + name + base64 + type + string + + + returnType + string + comment + decode a base64 string, to a buffer or string + overloads + + + name + decode + parameters + + + name + base64 + type + string + + + name + asBuffer + type + true + + + returnType + buffer + + + name + decode + parameters + + + name + base64 + type + string + + + name + asBuffer + type + false + + + returnType + string + + + + + name + encode + parameters + + + name + value + type + + kind + union + types + + string + buffer + + + + + returnType + string + comment + encode a string or buffer to base64 + + + + + name + vector + properties + + + name + one + type + vector + comment + A one vector <1,1,1> + + + name + zero + type + vector + comment + A Zero vector <0,0,0> + + + functions + + + name + abs + parameters + + + name + vec + type + vector + + + returnType + vector + comment + Applies `math.abs` to every component of the input vector. + + + name + angle + parameters + + + name + vec1 + type + vector + + + name + vec2 + type + vector + + + name + axis + type + vector? + + + returnType + number + comment + Computes the angle between two vectors in radians. The axis, if specified, is used to determine the sign of the angle. + + + name + ceil + parameters + + + name + vec + type + vector + + + returnType + vector + comment + Applies `math.ceil` to every component of the input vector. + + + name + clamp + parameters + + + name + vec + type + vector + + + name + min + type + vector + + + name + max + type + vector + + + returnType + vector + comment + Applies `math.clamp` to every component of the input vector. + + + name + create + parameters + + + name + x + type + number + + + name + y + type + number + + + name + z + type + number + + + returnType + vector + comment + Creates a new vector with the given component values + + + name + cross + parameters + + + name + vec1 + type + vector + + + name + vec2 + type + vector + + + returnType + vector + comment + Computes the cross product of two vectors. + + + name + dot + parameters + + + name + vec1 + type + vector + + + name + vec2 + type + vector + + + returnType + number + comment + Computes the dot product of two vectors. + + + name + floor + parameters + + + name + vec + type + vector + + + returnType + vector + comment + Applies `math.floor` to every component of the input vector. + + + name + magnitude + parameters + + + name + vec + type + vector + + + returnType + number + comment + Calculates the magnitude of a given vector. + + + name + max + parameters + + + type + vector + variadic + true + + + returnType + vector + comment + Applies `math.max` to the corresponding components of the input vectors. + + + name + min + parameters + + + type + vector + variadic + true + + + returnType + vector + comment + Applies `math.min` to the corresponding components of the input vectors. + + + name + normalize + parameters + + + name + vec + type + vector + + + returnType + vector + comment + Computes the normalized version (unit vector) of a given vector. + + + name + sign + parameters + + + name + vec + type + vector + + + returnType + vector + comment + Applies `math.sign` to every component of the input vector. + + + + + + diff --git a/indra/newview/gltf/accessor.cpp b/indra/newview/gltf/accessor.cpp index 03f7331893f..f0ad3fa5944 100644 --- a/indra/newview/gltf/accessor.cpp +++ b/indra/newview/gltf/accessor.cpp @@ -158,6 +158,11 @@ bool Buffer::prep(Asset& asset) { std::string dir = gDirUtilp->getDirName(asset.mFilename); std::string bin_file = dir + gDirUtilp->getDirDelimiter() + mUri; + if (!gDirUtilp->fileExists(bin_file)) + { + // Characters might be escaped in the URI + bin_file = dir + gDirUtilp->getDirDelimiter() + LLURI::unescape(mUri); + } llifstream file(bin_file.c_str(), std::ios::binary); if (!file.is_open()) diff --git a/indra/newview/gltf/llgltfloader.cpp b/indra/newview/gltf/llgltfloader.cpp index dd1d3276833..4f8f80129d9 100644 --- a/indra/newview/gltf/llgltfloader.cpp +++ b/indra/newview/gltf/llgltfloader.cpp @@ -412,17 +412,14 @@ void LLGLTFLoader::processNodeHierarchy(S32 node_idx, std::map // Process this node's mesh if it has one if (node.mMesh >= 0 && node.mMesh < mGLTFAsset.mMeshes.size()) { - LLMatrix4 transformation; - material_map mats; - - LLModel* pModel = new LLModel(volume_params, 0.f); - const LL::GLTF::Mesh& mesh = mGLTFAsset.mMeshes[node.mMesh]; - - // Get base mesh name and track usage - std::string base_name = getLodlessLabel(mesh); + // Get base node name and track usage + // Potentially multiple nodes can reuse the same mesh and Collada used + // node name instead of mesh name, so for consistency use node name if + // avaliable, node index otherwise. + std::string base_name = getLodlessLabel(node); if (base_name.empty()) { - base_name = "mesh_" + std::to_string(node.mMesh); + base_name = "node_" + std::to_string(node_idx); } S32 instance_count = mesh_name_counts[base_name]++; @@ -433,6 +430,12 @@ void LLGLTFLoader::processNodeHierarchy(S32 node_idx, std::map base_name = base_name + "_copy_" + std::to_string(instance_count); } + LLMatrix4 transformation; + material_map mats; + + LLModel* pModel = new LLModel(volume_params, 0.f); + const LL::GLTF::Mesh& mesh = mGLTFAsset.mMeshes[node.mMesh]; + if (populateModelFromMesh(pModel, base_name, mesh, node, mats) && (LLModel::NO_ERRORS == pModel->getStatus()) && validate_model(pModel)) @@ -652,6 +655,14 @@ std::string LLGLTFLoader::processTexture(S32 texture_index, const std::string& t filename = filename.substr(pos + 1); } + std::string dir = gDirUtilp->getDirName(mFilename); + std::string full_path = dir + gDirUtilp->getDirDelimiter() + filename; + if (!gDirUtilp->fileExists(full_path) && filename.find("data:") == std::string::npos) + { + // Uri might be escaped + filename = LLURI::unescape(filename); + } + LL_INFOS("GLTF_IMPORT") << "Found texture: " << filename << " for material: " << material_name << LL_ENDL; LLSD args; @@ -1810,13 +1821,13 @@ size_t LLGLTFLoader::getSuffixPosition(const std::string &label) return -1; } -std::string LLGLTFLoader::getLodlessLabel(const LL::GLTF::Mesh& mesh) +std::string LLGLTFLoader::getLodlessLabel(const LL::GLTF::Node& node) { - size_t ext_pos = getSuffixPosition(mesh.mName); + size_t ext_pos = getSuffixPosition(node.mName); if (ext_pos != -1) { - return mesh.mName.substr(0, ext_pos); + return node.mName.substr(0, ext_pos); } - return mesh.mName; + return node.mName; } diff --git a/indra/newview/gltf/llgltfloader.h b/indra/newview/gltf/llgltfloader.h index e8b91996c78..7aa1a94c201 100644 --- a/indra/newview/gltf/llgltfloader.h +++ b/indra/newview/gltf/llgltfloader.h @@ -170,7 +170,7 @@ class LLGLTFLoader : public LLModelLoader void notifyUnsupportedExtension(bool unsupported); static size_t getSuffixPosition(const std::string& label); - static std::string getLodlessLabel(const LL::GLTF::Mesh& mesh); + static std::string getLodlessLabel(const LL::GLTF::Node& mesh); // bool mPreprocessGLTF; diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 085155714ad..e95d192f726 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -167,7 +167,7 @@ std::map LLTeleportRequest::sTeleportStatusName = { { kPending class LLTeleportRequestViaLandmark : public LLTeleportRequest { public: - LLTeleportRequestViaLandmark(const LLUUID &pLandmarkId); + LLTeleportRequestViaLandmark(const LLUUID &pLandmarkId, bool log = true); virtual ~LLTeleportRequestViaLandmark(); virtual void toOstream(std::ostream& os) const; @@ -179,6 +179,7 @@ class LLTeleportRequestViaLandmark : public LLTeleportRequest protected: inline const LLUUID &getLandmarkId() const {return mLandmarkId;}; + bool mLogOnDestruction = true; private: LLUUID mLandmarkId; @@ -5008,16 +5009,25 @@ void LLTeleportRequest::toOstream(std::ostream& os) const //----------------------------------------------------------------------------- // LLTeleportRequestViaLandmark //----------------------------------------------------------------------------- -LLTeleportRequestViaLandmark::LLTeleportRequestViaLandmark(const LLUUID &pLandmarkId) - : LLTeleportRequest(), - mLandmarkId(pLandmarkId) +LLTeleportRequestViaLandmark::LLTeleportRequestViaLandmark(const LLUUID &pLandmarkId, bool log) + : LLTeleportRequest() + , mLandmarkId(pLandmarkId) + , mLogOnDestruction(true) { - LL_INFOS("Teleport") << "LLTeleportRequestViaLandmark created, " << *this << LL_ENDL; + if (log) + { + // Workaround to not log twice for LLTeleportRequestViaLure, besides this wouldn't have logged fully. + LL_INFOS("Teleport") << "LLTeleportRequestViaLandmark created, " << *this << LL_ENDL; + } } LLTeleportRequestViaLandmark::~LLTeleportRequestViaLandmark() { - LL_INFOS("Teleport") << "~LLTeleportRequestViaLandmark, " << *this << LL_ENDL; + if (mLogOnDestruction) + { + // Workaround to not crash on toOstream for derived classes and to not log twice. + LL_INFOS("Teleport") << "~LLTeleportRequestViaLandmark, " << *this << LL_ENDL; + } } void LLTeleportRequestViaLandmark::toOstream(std::ostream& os) const @@ -5047,16 +5057,20 @@ void LLTeleportRequestViaLandmark::restartTeleport() // LLTeleportRequestViaLure //----------------------------------------------------------------------------- -LLTeleportRequestViaLure::LLTeleportRequestViaLure(const LLUUID &pLureId, bool pIsLureGodLike) - : LLTeleportRequestViaLandmark(pLureId), +LLTeleportRequestViaLure::LLTeleportRequestViaLure(const LLUUID& pLureId, bool pIsLureGodLike) + : LLTeleportRequestViaLandmark(pLureId, false), mIsLureGodLike(pIsLureGodLike) { - LL_INFOS("Teleport") << "LLTeleportRequestViaLure created" << LL_ENDL; + LL_INFOS("Teleport") << "LLTeleportRequestViaLure created: " << *this << LL_ENDL; } LLTeleportRequestViaLure::~LLTeleportRequestViaLure() { - LL_INFOS("Teleport") << "~LLTeleportRequestViaLure" << LL_ENDL; + if (mLogOnDestruction) + { + LL_INFOS("Teleport") << "~LLTeleportRequestViaLure: " << *this << LL_ENDL; + mLogOnDestruction = false; + } } void LLTeleportRequestViaLure::toOstream(std::ostream& os) const diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 25f5cbd78fc..a075b6f004d 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -538,6 +538,27 @@ LLInventoryItem* LLAgentWearables::getWearableInventoryItem(LLWearableType::ETyp return item; } +const S32 LLAgentWearables::getWearableIdxFromItem(const LLViewerInventoryItem* item) const +{ + if (!item) return -1; + if (!item->isWearableType()) return -1; + + LLWearableType::EType type = item->getWearableType(); + U32 wearable_count = getWearableCount(type); + if (0 == wearable_count) return -1; + + const LLUUID& asset_id = item->getAssetUUID(); + + for (U32 i = 0; i < wearable_count; ++i) + { + const LLViewerWearable* wearable = getViewerWearable(type, i); + if (!wearable) continue; + if (wearable->getAssetID() != asset_id) continue; + return i; + } + + return -1; +} const LLViewerWearable* LLAgentWearables::getWearableFromItemID(const LLUUID& item_id) const { const LLUUID& base_item_id = gInventory.getLinkedItemID(item_id); @@ -1471,7 +1492,7 @@ bool LLAgentWearables::moveWearable(const LLViewerInventoryItem* item, bool clos LLWearableType::EType type = item->getWearableType(); U32 wearable_count = getWearableCount(type); - if (0 == wearable_count) return false; + if (wearable_count < 2) return false; const LLUUID& asset_id = item->getAssetUUID(); diff --git a/indra/newview/llagentwearables.h b/indra/newview/llagentwearables.h index 3b8ff93c76c..1e118ffa98a 100644 --- a/indra/newview/llagentwearables.h +++ b/indra/newview/llagentwearables.h @@ -87,6 +87,7 @@ class LLAgentWearables : public LLInitClass, public LLWearable public: const LLUUID getWearableItemID(LLWearableType::EType type, U32 index /*= 0*/) const; const LLUUID getWearableAssetID(LLWearableType::EType type, U32 index /*= 0*/) const; + const S32 getWearableIdxFromItem(const LLViewerInventoryItem* item) const; const LLViewerWearable* getWearableFromItemID(const LLUUID& item_id) const; LLViewerWearable* getWearableFromItemID(const LLUUID& item_id); LLViewerWearable* getWearableFromAssetID(const LLUUID& asset_id); diff --git a/indra/newview/llappdelegate-objc.mm b/indra/newview/llappdelegate-objc.mm index b8fd3dc189f..af18dca1854 100644 --- a/indra/newview/llappdelegate-objc.mm +++ b/indra/newview/llappdelegate-objc.mm @@ -57,42 +57,42 @@ - (void) applicationWillFinishLaunching:(NSNotification *)notification - (void) applicationDidFinishLaunching:(NSNotification *)notification { - // Call constructViewer() first so our logging subsystem is in place. This - // risks missing crashes in the LLAppViewerMacOSX constructor, but for - // present purposes it's more important to get the startup sequence - // properly logged. - // Someday I would like to modify the logging system so that calls before - // it's initialized are cached in a std::ostringstream and then, once it's - // initialized, "played back" into whatever handlers have been set up. - constructViewer(); + // Call constructViewer() first so our logging subsystem is in place. This + // risks missing crashes in the LLAppViewerMacOSX constructor, but for + // present purposes it's more important to get the startup sequence + // properly logged. + // Someday I would like to modify the logging system so that calls before + // it's initialized are cached in a std::ostringstream and then, once it's + // initialized, "played back" into whatever handlers have been set up. + constructViewer(); #if defined(LL_BUGSPLAT) infos("bugsplat setup"); - // Engage BugsplatStartupManager *before* calling initViewer() to handle - // any crashes during initialization. - // https://www.bugsplat.com/docs/platforms/os-x#initialization - [BugsplatStartupManager sharedManager].autoSubmitCrashReport = YES; - [BugsplatStartupManager sharedManager].askUserDetails = NO; - [BugsplatStartupManager sharedManager].delegate = self; - [[BugsplatStartupManager sharedManager] start]; + // Engage BugsplatStartupManager *before* calling initViewer() to handle + // any crashes during initialization. + // https://www.bugsplat.com/docs/platforms/os-x#initialization + [BugsplatStartupManager sharedManager].autoSubmitCrashReport = YES; + [BugsplatStartupManager sharedManager].askUserDetails = NO; + [BugsplatStartupManager sharedManager].delegate = self; + [[BugsplatStartupManager sharedManager] start]; #endif infos("post-bugsplat setup"); - frameTimer = nil; + frameTimer = nil; - [self languageUpdated]; + [self languageUpdated]; - if (initViewer()) - { - // Set up recurring calls to oneFrame (repeating timer with timeout 0) - // until applicationShouldTerminate. - frameTimer = [NSTimer scheduledTimerWithTimeInterval:0.0 target:self - selector:@selector(oneFrame) userInfo:nil repeats:YES]; - } else { - exit(0); - } + if (initViewer()) + { + // Set up recurring calls to oneFrame (repeating timer with timeout 0) + // until applicationShouldTerminate. + frameTimer = [NSTimer scheduledTimerWithTimeInterval:0.0 target:self + selector:@selector(oneFrame) userInfo:nil repeats:YES]; + } else { + exit(0); + } - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(languageUpdated) name:@"NSTextInputContextKeyboardSelectionDidChangeNotification" object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(languageUpdated) name:@"NSTextInputContextKeyboardSelectionDidChangeNotification" object:nil]; // [[NSAppleEventManager sharedAppleEventManager] setEventHandler:self andSelector:@selector(handleGetURLEvent:withReplyEvent:) forEventClass:kInternetEventClass andEventID:kAEGetURL]; } @@ -110,74 +110,74 @@ - (void) handleGetURLEvent:(NSAppleEventDescriptor *)event withReplyEvent:(NSApp - (void) applicationDidBecomeActive:(NSNotification *)notification { - callWindowFocus(); + callWindowFocus(); } - (void) applicationDidResignActive:(NSNotification *)notification { - callWindowUnfocus(); + callWindowUnfocus(); } - (void) applicationDidHide:(NSNotification *)notification { - callWindowHide(); + callWindowHide(); } - (void) applicationDidUnhide:(NSNotification *)notification { - callWindowUnhide(); + callWindowUnhide(); } - (NSApplicationTerminateReply) applicationShouldTerminate:(NSApplication *)sender { - // run one frame to assess state - if (!pumpMainLoop()) - { - // pumpMainLoop() returns true when done, false if it wants to be - // called again. Since it returned false, do not yet cancel - // frameTimer. - handleQuit(); - [[NSApplication sharedApplication] stopModal]; - return NSTerminateCancel; - } else { - // pumpMainLoop() returned true: it's done. Okay, done with frameTimer. - [frameTimer release]; - cleanupViewer(); - return NSTerminateNow; - } + // run one frame to assess state + if (!pumpMainLoop()) + { + // pumpMainLoop() returns true when done, false if it wants to be + // called again. Since it returned false, do not yet cancel + // frameTimer. + handleQuit(); + [[NSApplication sharedApplication] stopModal]; + return NSTerminateCancel; + } else { + // pumpMainLoop() returned true: it's done. Okay, done with frameTimer. + [frameTimer release]; + cleanupViewer(); + return NSTerminateNow; + } } - (void) oneFrame { - bool appExiting = pumpMainLoop(); - if (appExiting) - { - // Once pumpMainLoop() reports that we're done, cancel frameTimer: - // stop the repetitive calls. - [frameTimer release]; - [[NSApplication sharedApplication] terminate:self]; - } + bool appExiting = pumpMainLoop(); + if (appExiting) + { + // Once pumpMainLoop() reports that we're done, cancel frameTimer: + // stop the repetitive calls. + [frameTimer release]; + [[NSApplication sharedApplication] terminate:self]; + } } - (void) showInputWindow:(bool)show withEvent:(NSEvent*)textEvent { - if (![self romanScript]) - { - if (show) - { - NSLog(@"Showing input window."); - [inputWindow makeKeyAndOrderFront:inputWindow]; + if (![self romanScript]) + { + if (show) + { + NSLog(@"Showing input window."); + [inputWindow makeKeyAndOrderFront:inputWindow]; if (textEvent != nil) { [[inputView inputContext] discardMarkedText]; [[inputView inputContext] handleEvent:textEvent]; } - } else { - NSLog(@"Hiding input window."); - [inputWindow orderOut:inputWindow]; - [window makeKeyAndOrderFront:window]; - } - } + } else { + NSLog(@"Hiding input window."); + [inputWindow orderOut:inputWindow]; + [window makeKeyAndOrderFront:window]; + } + } } // This will get called multiple times by NSNotificationCenter. @@ -187,15 +187,15 @@ - (void) showInputWindow:(bool)show withEvent:(NSEvent*)textEvent - (void) languageUpdated { - TISInputSourceRef currentInput = TISCopyCurrentKeyboardInputSource(); - CFArrayRef languages = (CFArrayRef)TISGetInputSourceProperty(currentInput, kTISPropertyInputSourceLanguages); - + TISInputSourceRef currentInput = TISCopyCurrentKeyboardInputSource(); + CFArrayRef languages = (CFArrayRef)TISGetInputSourceProperty(currentInput, kTISPropertyInputSourceLanguages); + #if 0 // In the event of ever needing to add new language sources, change this to 1 and watch the terminal for "languages:" - NSLog(@"languages: %@", TISGetInputSourceProperty(currentInput, kTISPropertyInputSourceLanguages)); + NSLog(@"languages: %@", TISGetInputSourceProperty(currentInput, kTISPropertyInputSourceLanguages)); #endif - - // Typically the language we want is going to be the very first result in the array. - currentInputLanguage = (NSString*)CFArrayGetValueAtIndex(languages, 0); + + // Typically the language we want is going to be the very first result in the array. + currentInputLanguage = (NSString*)CFArrayGetValueAtIndex(languages, 0); } - (bool) romanScript @@ -209,7 +209,7 @@ - (bool) romanScript return false; } } - + return true; } @@ -313,11 +313,11 @@ - (void)bugsplatStartupManagerWillSendCrashReport:(BugsplatStartupManager *)bugs // We "happen to know" that info[0].basename is "SecondLife.old" -- due to // the fact that BugsplatMac only notices a crash during the viewer run - // following the crash. + // following the crash. // The Bugsplat service doesn't respect the MIME type above when returning // the log data to a browser, so take this opportunity to rename the file // from .old to _log.txt - info[0].basename = + info[0].basename = boost::filesystem::path(info[0].pathname).stem().string() + "_log.txt"; infos("attachmentsForBugsplatStartupManager attaching log " + info[0].basename); @@ -373,7 +373,7 @@ - (void)sendEvent:(NSEvent *)event { [super sendEvent:event]; if ([event type] == NSEventTypeKeyUp && ([event modifierFlags] & NSEventModifierFlagCommand)) - { + { [[self keyWindow] sendEvent:event]; } } diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 6fa23727b1c..0d57b33a516 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1500,6 +1500,27 @@ void wear_on_avatar_cb(const LLUUID& inv_item, bool do_replace = false) } } +bool needs_to_replace(LLViewerInventoryItem* item_to_wear, bool & first_for_object, std::vector& first_for_type, bool replace) +{ + bool res = false; + LLAssetType::EType type = item_to_wear->getType(); + if (type == LLAssetType::AT_OBJECT) + { + res = first_for_object && replace; + first_for_object = false; + } + else if (type == LLAssetType::AT_CLOTHING) + { + LLWearableType::EType wtype = item_to_wear->getWearableType(); + if (wtype >= 0 && wtype < LLWearableType::WT_COUNT) + { + res = first_for_type[wtype] && replace; + first_for_type[wtype] = false; + } + } + return res; +} + void LLAppearanceMgr::wearItemsOnAvatar(const uuid_vec_t& item_ids_to_wear, bool do_update, bool replace, @@ -1508,7 +1529,8 @@ void LLAppearanceMgr::wearItemsOnAvatar(const uuid_vec_t& item_ids_to_wear, LL_DEBUGS("UIUsage") << "wearItemsOnAvatar" << LL_ENDL; LLUIUsage::instance().logCommand("Avatar.WearItem"); - bool first = true; + bool first_for_object = true; + std::vector first_for_type(LLWearableType::WT_COUNT, true); LLInventoryObject::const_object_list_t items_to_link; @@ -1516,9 +1538,6 @@ void LLAppearanceMgr::wearItemsOnAvatar(const uuid_vec_t& item_ids_to_wear, it != item_ids_to_wear.end(); ++it) { - replace = first && replace; - first = false; - const LLUUID& item_id_to_wear = *it; if (item_id_to_wear.isNull()) @@ -1537,8 +1556,9 @@ void LLAppearanceMgr::wearItemsOnAvatar(const uuid_vec_t& item_ids_to_wear, if (gInventory.isObjectDescendentOf(item_to_wear->getUUID(), gInventory.getLibraryRootFolderID())) { LL_DEBUGS("Avatar") << "inventory item in library, will copy and wear " - << item_to_wear->getName() << " id " << item_id_to_wear << LL_ENDL; - LLPointer cb = new LLBoostFuncInventoryCallback(boost::bind(wear_on_avatar_cb,_1,replace)); + << item_to_wear->getName() << " id " << item_id_to_wear << LL_ENDL; + bool replace_item = needs_to_replace(item_to_wear, first_for_object, first_for_type, replace); + LLPointer cb = new LLBoostFuncInventoryCallback(boost::bind(wear_on_avatar_cb, _1, replace_item)); copy_inventory_item(gAgent.getID(), item_to_wear->getPermissions().getOwner(), item_to_wear->getUUID(), LLUUID::null, std::string(), cb); continue; @@ -1576,7 +1596,8 @@ void LLAppearanceMgr::wearItemsOnAvatar(const uuid_vec_t& item_ids_to_wear, } LLWearableType::EType type = item_to_wear->getWearableType(); S32 wearable_count = gAgentWearables.getWearableCount(type); - if ((replace && wearable_count != 0) || !gAgentWearables.canAddWearable(type)) + bool replace_item = needs_to_replace(item_to_wear, first_for_object, first_for_type, replace); + if ((replace_item && wearable_count != 0) || !gAgentWearables.canAddWearable(type)) { LLUUID item_id = gAgentWearables.getWearableItemID(item_to_wear->getWearableType(), wearable_count-1); @@ -1605,7 +1626,13 @@ void LLAppearanceMgr::wearItemsOnAvatar(const uuid_vec_t& item_ids_to_wear, case LLAssetType::AT_OBJECT: { - rez_attachment(item_to_wear, NULL, replace); + // Note that this will replace only first attachment regardless of attachment point, + // so if user is wearing two items over other two on different attachment points, + // only one will be replaced. + // Unfortunately we have no way to determine attachment point from inventory item. + // We might want to forbid wearing multiple objects with replace option in future. + bool replace_item = needs_to_replace(item_to_wear, first_for_object, first_for_type, replace); + rez_attachment(item_to_wear, NULL, replace_item); } break; @@ -4218,37 +4245,54 @@ bool LLAppearanceMgr::moveWearable(LLViewerInventoryItem* item, bool closer_to_b if (item->getType() != LLAssetType::AT_CLOTHING) return false; if (!gInventory.isObjectDescendentOf(item->getUUID(), getCOF())) return false; + S32 pos = gAgentWearables.getWearableIdxFromItem(item); + if (pos < 0) return false; // Not found + + U32 count = gAgentWearables.getWearableCount(item->getWearableType()); + if (count < 2) return false; // Nothing to swap with + if (closer_to_body) + { + if (pos == 0) return false; // already first + } + else + { + if (pos == count - 1) return false; // already last + } + + U32 old_pos = (U32)pos; + U32 swap_with = closer_to_body ? old_pos - 1 : old_pos + 1; + LLUUID swap_item_id = gAgentWearables.getWearableItemID(item->getWearableType(), swap_with); + + // Find link item from item id. LLInventoryModel::cat_array_t cats; LLInventoryModel::item_array_t items; LLFindWearablesOfType filter_wearables_of_type(item->getWearableType()); gInventory.collectDescendentsIf(getCOF(), cats, items, true, filter_wearables_of_type); if (items.empty()) return false; - // We assume that the items have valid descriptions. - std::sort(items.begin(), items.end(), WearablesOrderComparator(item->getWearableType())); - - if (closer_to_body && items.front() == item) return false; - if (!closer_to_body && items.back() == item) return false; - - LLInventoryModel::item_array_t::iterator it = std::find(items.begin(), items.end(), item); - if (items.end() == it) return false; - - - //swapping descriptions - closer_to_body ? --it : ++it; - LLViewerInventoryItem* swap_item = *it; - if (!swap_item) return false; - std::string tmp = swap_item->getActualDescription(); - swap_item->setDescription(item->getActualDescription()); - item->setDescription(tmp); + LLViewerInventoryItem* swap_item = nullptr; + for (auto iter : items) + { + if (iter->getLinkedUUID() == swap_item_id) + { + swap_item = iter.get(); + break; + } + } + if (!swap_item) + { + return false; + } - // LL_DEBUGS("Inventory") << "swap, item " - // << ll_pretty_print_sd(item->asLLSD()) - // << " swap_item " - // << ll_pretty_print_sd(swap_item->asLLSD()) << LL_ENDL; + // Description is supposed to hold sort index, but user could have changed + // order rapidly and there might be a state mismatch between description + // and gAgentWearables, trust gAgentWearables over description. + // Generate new description. + std::string new_desc = build_order_string(item->getWearableType(), old_pos); + swap_item->setDescription(new_desc); + new_desc = build_order_string(item->getWearableType(), swap_with); + item->setDescription(new_desc); - // FIXME switch to use AISv3 where supported. - //items need to be updated on a dataserver item->setComplete(true); item->updateServer(false); gInventory.updateItem(item); diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 63d364eaa86..e1ed9f842d5 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -109,6 +109,7 @@ #include "lllocalbitmaps.h" #include "llperfstats.h" #include "llgltfmateriallist.h" +#include "llwebsocketmgr.h" // Linden library includes #include "llavatarnamecache.h" @@ -1265,6 +1266,7 @@ bool LLAppViewer::init() LLViewerCamera::createInstance(); LL::GLTFSceneManager::createInstance(); + gSavedSettings.setU32("DebugQualityPerformance", gSavedSettings.getU32("RenderQualityPerformance")); #if LL_WINDOWS if (!mSecondInstance) @@ -2397,7 +2399,6 @@ void LLAppViewer::initLoggingAndGetLastDuration() if (gDirUtilp->fileExists(user_data_path_cef_log)) { std::string user_data_path_cef_old = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "cef.old"); - LLFile::remove(user_data_path_cef_old, ENOENT); LLFile::rename(user_data_path_cef_log, user_data_path_cef_old); } } @@ -3944,8 +3945,15 @@ void LLAppViewer::processMarkerFiles() else if (marker_is_same_version) { // the file existed, is ours, and matched our version, so we can report on what it says - LL_INFOS("MarkerFile") << "Exec marker '"<< mMarkerFileName << "' found; last exec crashed" << LL_ENDL; + LL_INFOS("MarkerFile") << "Exec marker '"<< mMarkerFileName << "' found; last exec crashed or froze" << LL_ENDL; +#if LL_WINDOWS && LL_BUGSPLAT + // bugsplat will set correct state in bugsplatSendLog + // Might be more accurate to rename this one into 'unknown' + gLastExecEvent = LAST_EXEC_FROZE; +#else gLastExecEvent = LAST_EXEC_OTHER_CRASH; +#endif // LL_WINDOWS + } else { @@ -4194,7 +4202,7 @@ void LLAppViewer::earlyExit(const std::string& name, const LLSD& substitutions) // case where we need the viewer to exit without any need for notifications void LLAppViewer::earlyExitNoNotify() { - LL_WARNS() << "app_early_exit with no notification: " << LL_ENDL; + LL_WARNS() << "app_early_exit with no notification." << LL_ENDL; gDoDisconnect = true; finish_early_exit( LLSD(), LLSD() ); } @@ -4473,6 +4481,7 @@ void LLAppViewer::purgeCache() LLAppViewer::getTextureCache()->purgeCache(LL_PATH_CACHE); LLVOCache::getInstance()->removeCache(LL_PATH_CACHE); LLViewerShaderMgr::instance()->clearShaderCache(); + purgeCefStaleCaches(); gDirUtilp->deleteFilesInDir(gDirUtilp->getExpandedFilename(LL_PATH_CACHE, ""), "*"); } @@ -4754,6 +4763,11 @@ void LLAppViewer::idle() LLMortician::updateClass(); LLFilePickerThread::clearDead(); //calls LLFilePickerThread::notify() LLDirPickerThread::clearDead(); + + if (LLWebsocketMgr::instanceExists()) + { + LLWebsocketMgr::instance().update(); + } F32 dt_raw = idle_timer.getElapsedTimeAndResetF32(); LLGLTFMaterialList::flushUpdates(); @@ -5407,6 +5421,12 @@ void LLAppViewer::createErrorMarker(eLastExecEvent error_code) const } } +bool LLAppViewer::errorMarkerExists() const +{ + std::string error_marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, ERROR_MARKER_FILE_NAME); + return LLAPRFile::isExist(error_marker_file, NULL, LL_APR_RB); +} + void LLAppViewer::outOfMemorySoftQuit() { if (!mQuitRequested) @@ -5538,7 +5558,10 @@ void LLAppViewer::idleNetwork() add(LLStatViewer::NUM_NEW_OBJECTS, gObjectList.mNumNewObjects); // Retransmit unacknowledged packets. - gXferManager->retransmitUnackedPackets(); + if (gXferManager) + { + gXferManager->retransmitUnackedPackets(); + } gAssetStorage->checkForTimeouts(); gViewerThrottle.setBufferLoadRate(gMessageSystem->getBufferLoadRate()); gViewerThrottle.updateDynamicThrottle(); diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index 3afde6b9f57..4f2583cb164 100644 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -149,6 +149,12 @@ class LLAppViewer : public LLApp std::string getWindowTitle() const; // The window display name. void forceDisconnect(const std::string& msg); // Force disconnection, with a message to the user. + + // sendSimpleLogoutRequest does not create a marker file. + // Meant for lost network case, and for forced shutdowns, + // to at least attempt to remove the ghost from the world. + void sendSimpleLogoutRequest(); + void badNetworkHandler(); // Cause a crash state due to bad network packet. bool hasSavedFinalSnapshot() { return mSavedFinalSnapshot; } @@ -245,6 +251,7 @@ class LLAppViewer : public LLApp // Writes an error code into the error_marker file for use on next startup. void createErrorMarker(eLastExecEvent error_code) const; + bool errorMarkerExists() const; // Attempt a 'soft' quit with disconnect and saving of settings/cache. // Intended to be thread safe. @@ -311,10 +318,6 @@ class LLAppViewer : public LLApp void sendLogoutRequest(); void disconnectViewer(); - // Does not create a marker file. For lost network case, - // to at least attempt to remove the ghost from the world. - void sendSimpleLogoutRequest(); - // *FIX: the app viewer class should be some sort of singleton, no? // Perhaps its child class is the singleton and this should be an abstract base. static LLAppViewer* sInstance; diff --git a/indra/newview/llappviewermacosx-objc.mm b/indra/newview/llappviewermacosx-objc.mm index 2ea3f2f1713..96a6bc6edce 100644 --- a/indra/newview/llappviewermacosx-objc.mm +++ b/indra/newview/llappviewermacosx-objc.mm @@ -5,27 +5,27 @@ * $LicenseInfo:firstyear=2007&license=viewerlgpl$ * Second Life Viewer Source Code * Copyright (C) 2010, Linden Research, Inc. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; * version 2.1 of the License only. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * + * * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ - */ + */ #if !defined LL_DARWIN - #error "Use only with macOS" + #error "Use only with macOS" #endif #import diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index 6386d0636a2..64b506a3353 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -172,6 +172,22 @@ namespace << '/' << loc.mV[1] << '/' << loc.mV[2]))); } + + LLAppViewer* app = LLAppViewer::instance(); + if (!app->isSecondInstance() && !app->errorMarkerExists()) + { + // If marker doesn't exist, create a marker with 'other' code for next launch + // otherwise don't override existing file + // Any unmarked crashes will be considered as freezes + if (app->logoutRequestSent()) + { + app->createErrorMarker(LAST_EXEC_LOGOUT_CRASH); + } + else + { + app->createErrorMarker(LAST_EXEC_OTHER_CRASH); + } + } } // MDSCB_EXCEPTIONCODE return false; diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 1988e2072bc..c1af09ebc76 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -215,7 +215,8 @@ class LLChatHistoryHeader: public LLPanel LLUUID obj_id = mObjectData["object_id"]; if (obj_id.notNull()) { - return nullptr != gObjectList.findObject(mAvatarID); + LLViewerObject* object = gObjectList.findObject(obj_id); + return object && object->isReachable(); } return false; } @@ -441,6 +442,7 @@ class LLChatHistoryHeader: public LLPanel time_t current_time = time_corrected(); time_t message_time = (time_t)(current_time - LLFrameTimer::getElapsedSeconds() + mTime); + // Report abuse shouldn't use AM/PM, use 24-hour time time_string = "[" + LLTrans::getString("TimeMonth") + "]/[" + LLTrans::getString("TimeDay") + "]/[" + LLTrans::getString("TimeYear") + "] [" @@ -1117,7 +1119,11 @@ LLChatHistory::LLChatHistory(const LLChatHistory::Params& p) mEditor = LLUICtrlFactory::create(editor_params, this); mEditor->setIsFriendCallback(LLAvatarActions::isFriend); mEditor->setIsObjectBlockedCallback(boost::bind(&LLMuteList::isMuted, LLMuteList::getInstance(), _1, _2, 0)); - + mEditor->setIsObjectReachableCallback([](const LLUUID& obj_id) + { + LLViewerObject* object = gObjectList.findObject(obj_id); + return object && object->isReachable(); + }); } LLSD LLChatHistory::getValue() const diff --git a/indra/newview/llcompilequeue.cpp b/indra/newview/llcompilequeue.cpp index 552ea75559a..32d0f3fa1b4 100644 --- a/indra/newview/llcompilequeue.cpp +++ b/indra/newview/llcompilequeue.cpp @@ -122,9 +122,9 @@ namespace class LLQueuedScriptAssetUpload : public LLScriptAssetUpload { public: - LLQueuedScriptAssetUpload(LLUUID taskId, LLUUID itemId, LLUUID assetId, TargetType_t targetType, + LLQueuedScriptAssetUpload(LLUUID taskId, LLUUID itemId, LLUUID assetId, std::string compileTarget, bool isRunning, std::string scriptName, LLUUID queueId, LLUUID exerienceId, taskUploadFinish_f finish) : - LLScriptAssetUpload(taskId, itemId, targetType, isRunning, + LLScriptAssetUpload(taskId, itemId, compileTarget, isRunning, exerienceId, std::string(), finish, nullptr), mScriptName(scriptName), mQueueId(queueId) @@ -183,9 +183,7 @@ struct LLScriptQueueData // Default constructor LLFloaterScriptQueue::LLFloaterScriptQueue(const LLSD& key) : - LLFloater(key), - mDone(false), - mMono(false) + LLFloater(key) { } @@ -197,7 +195,7 @@ LLFloaterScriptQueue::~LLFloaterScriptQueue() bool LLFloaterScriptQueue::postBuild() { - childSetAction("close",onCloseBtn,this); + childSetAction("close", onCloseBtn, this); getChildView("close")->setEnabled(false); setVisible(true); return true; @@ -222,8 +220,8 @@ bool LLFloaterScriptQueue::start() LLStringUtil::format_map_t args; args["[START]"] = mStartString; - args["[COUNT]"] = llformat ("%d", mObjectList.size()); - buffer = getString ("Starting", args); + args["[COUNT]"] = llformat("%d", mObjectList.size()); + buffer = getString("Starting", args); getChild("queue output")->addSimpleElement(buffer, ADD_BOTTOM); @@ -276,8 +274,8 @@ bool LLFloaterCompileQueue::hasExperience( const LLUUID& id ) const return mExperienceIds.find(id) != mExperienceIds.end(); } -// //Attempt to record this asset ID. If it can not be inserted into the set -// //then it has already been processed so return false. +// Attempt to record this asset ID. If it can not be inserted into the set +// then it has already been processed so return false. void LLFloaterCompileQueue::handleHTTPResponse(std::string pumpName, const LLSD &expresult) { @@ -359,7 +357,7 @@ bool LLFloaterCompileQueue::processScript(LLHandle hfloat LLCheckedHandle floater(hfloater); // Dereferencing floater may fail. If they do they throw LLExeceptionStaleHandle. // which is caught in objectScriptProcessingQueueCoro - bool monocompile = floater->mMono; + std::string compile_target = floater->mCompileTarget; // Initial test to see if we can (or should) attempt to compile the script. LLInventoryItem *item = dynamic_cast(inventory); @@ -470,7 +468,7 @@ bool LLFloaterCompileQueue::processScript(LLHandle hfloat LLResourceUploadInfo::ptr_t uploadInfo(new LLQueuedScriptAssetUpload(object->getID(), inventory->getUUID(), assetId, - monocompile ? LLScriptAssetUpload::MONO : LLScriptAssetUpload::LSL2, + compile_target, true, inventory->getName(), LLUUID(), diff --git a/indra/newview/llcompilequeue.h b/indra/newview/llcompilequeue.h index 951d4800e8c..42af5b18812 100644 --- a/indra/newview/llcompilequeue.h +++ b/indra/newview/llcompilequeue.h @@ -55,7 +55,7 @@ class LLFloaterScriptQueue : public LLFloater/*, public LLVOInventoryListener*/ /*virtual*/ bool postBuild(); - void setMono(bool mono) { mMono = mono; } + void setCompileTarget(std::string target) { mCompileTarget = target; } // addObject() accepts an object id. void addObject(const LLUUID& id, std::string name); @@ -80,8 +80,8 @@ class LLFloaterScriptQueue : public LLFloater/*, public LLVOInventoryListener*/ protected: // UI - LLScrollListCtrl* mMessages; - LLButton* mCloseBtn; + LLScrollListCtrl* mMessages { nullptr }; + LLButton* mCloseBtn { nullptr }; // Object Queue struct ObjectData @@ -93,14 +93,13 @@ class LLFloaterScriptQueue : public LLFloater/*, public LLVOInventoryListener*/ object_data_list_t mObjectList; LLUUID mCurrentObjectID; - bool mDone; + bool mDone { false }; std::string mStartString; - bool mMono; + std::string mCompileTarget { "lsl2" }; typedef boost::function &, LLInventoryObject*, LLEventPump &)> fnQueueAction_t; static void objectScriptProcessingQueueCoro(std::string action, LLHandle hfloater, object_data_list_t objectList, fnQueueAction_t func); - }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/indra/newview/llconversationlog.cpp b/indra/newview/llconversationlog.cpp index cea68c1779a..65a068e08d3 100644 --- a/indra/newview/llconversationlog.cpp +++ b/indra/newview/llconversationlog.cpp @@ -118,11 +118,21 @@ const std::string LLConversation::createTimestamp(const U64Seconds& utc_time) LLSD substitution; substitution["datetime"] = (S32)utc_time.value(); - timeStr = "["+LLTrans::getString ("TimeMonth")+"]/[" - +LLTrans::getString ("TimeDay")+"]/[" - +LLTrans::getString ("TimeYear")+"] [" - +LLTrans::getString ("TimeHour")+"]:[" - +LLTrans::getString ("TimeMin")+"]"; + static bool use_24h = gSavedSettings.getBOOL("Use24HourClock"); + timeStr = "[" + LLTrans::getString("TimeMonth") + "]/[" + + LLTrans::getString("TimeDay") + "]/[" + + LLTrans::getString("TimeYear") + "] ["; + if (use_24h) + { + timeStr += LLTrans::getString("TimeHour") + "]:[" + + LLTrans::getString("TimeMin") + "]"; + } + else + { + timeStr += LLTrans::getString("TimeHour12") + "]:[" + + LLTrans::getString("TimeMin") + "] [" + + LLTrans::getString("TimeAMPM") + "]"; + } LLStringUtil::format (timeStr, substitution); diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp index bf593bff07e..69003f88fd5 100644 --- a/indra/newview/lldrawpoolbump.cpp +++ b/indra/newview/lldrawpoolbump.cpp @@ -802,7 +802,10 @@ void LLBumpImageList::onSourceStandardLoaded( bool success, LLViewerFetchedTextu } src_vi->setExplicitFormat(GL_RGBA, GL_RGBA); { - src_vi->createGLTexture(src_vi->getDiscardLevel(), nrm_image); + if (!src_vi->createGLTexture(src_vi->getDiscardLevel(), nrm_image)) + { + LL_WARNS() << "Failed to create bump image texture for image " << src_vi->getID() << LL_ENDL; + } } } } @@ -896,7 +899,10 @@ void LLBumpImageList::onSourceUpdated(LLViewerTexture* src, EBumpEffect bump_cod LLImageGL* src_img = src->getGLTexture(); LLImageGL* dst_img = bump->getGLTexture(); - dst_img->setSize(src->getWidth(), src->getHeight(), 4, 0); + if (!dst_img->setSize(src->getWidth(), src->getHeight(), 4, 0)) + { + LL_WARNS() << "Failed to setSize for image " << bump->getID() << LL_ENDL; + } dst_img->setUseMipMaps(true); dst_img->setDiscardLevel(0); dst_img->createGLTexture(); diff --git a/indra/newview/lleventpoll.cpp b/indra/newview/lleventpoll.cpp index c6fea1ba825..86c58a3497b 100644 --- a/indra/newview/lleventpoll.cpp +++ b/indra/newview/lleventpoll.cpp @@ -54,13 +54,6 @@ namespace Details void stop(); private: - // We will wait RETRY_SECONDS + (errorCount * RETRY_SECONDS_INC) before retrying after an error. - // This means we attempt to recover relatively quickly but back off giving more time to recover - // until we finally give up after MAX_EVENT_POLL_HTTP_ERRORS attempts. - static const F32 EVENT_POLL_ERROR_RETRY_SECONDS; - static const F32 EVENT_POLL_ERROR_RETRY_SECONDS_INC; - static const S32 MAX_EVENT_POLL_HTTP_ERRORS; - void eventPollCoro(std::string url); void handleMessage(const LLSD &content); @@ -76,9 +69,13 @@ namespace Details }; - const F32 LLEventPollImpl::EVENT_POLL_ERROR_RETRY_SECONDS = 15.f; // ~ half of a normal timeout. - const F32 LLEventPollImpl::EVENT_POLL_ERROR_RETRY_SECONDS_INC = 5.f; // ~ half of a normal timeout. - const S32 LLEventPollImpl::MAX_EVENT_POLL_HTTP_ERRORS = 10; // ~5 minutes, by the above rules. + // We will wait RETRY_SECONDS + (errorCount * RETRY_SECONDS_INC) before retrying after an error. + // This means we attempt to recover relatively quickly but back off giving more time to recover + // until we finally give up after MAX_EVENT_POLL_HTTP_ERRORS attempts. + constexpr F32 EVENT_POLL_ERROR_RETRY_SECONDS = 15.f; // ~ half of a normal timeout. + constexpr F32 EVENT_POLL_ERROR_RETRY_SECONDS_INC = 5.f; // ~ half of a normal timeout. + constexpr S32 MAX_EVENT_POLL_HTTP_ERRORS = 10; // ~5 minutes, by the above rules. + constexpr F64 MIN_SECONDS_PASSED = 10.0; // Minimum time we expect the server to hold the request. int LLEventPollImpl::sNextCounter = 1; @@ -151,11 +148,17 @@ namespace Details LLSD acknowledge; int errorCount = 0; int counter = mCounter; // saved on the stack for logging. + LLTimer message_time; LL_DEBUGS("LLEventPollImpl") << " <" << counter << "> entering coroutine." << LL_ENDL; mAdapter = httpAdapter; + // This is a loop with its own waitToRetry implementation, + // so disable retries. + LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + httpOpts->setRetries(0); + LL::WorkQueue::ptr_t main_queue = nullptr; // HACK -- grab the mainloop workqueue to move execution of the handler @@ -172,11 +175,13 @@ namespace Details request["ack"] = acknowledge; request["done"] = mDone; + message_time.reset(); + // LL_DEBUGS("LLEventPollImpl::eventPollCoro") << "<" << counter << "> request = " // << LLSDXMLStreamer(request) << LL_ENDL; LL_DEBUGS("LLEventPollImpl") << " <" << counter << "> posting and yielding." << LL_ENDL; - LLSD result = httpAdapter->postAndSuspend(mHttpRequest, url, request); + LLSD result = httpAdapter->postAndSuspend(mHttpRequest, url, request, httpOpts); // LL_DEBUGS("LLEventPollImpl::eventPollCoro") << "<" << counter << "> result = " // << LLSDXMLStreamer(result) << LL_ENDL; @@ -194,11 +199,30 @@ namespace Details if (!status) { - if (status == LLCore::HttpStatus(LLCore::HttpStatus::EXT_CURL_EASY, CURLE_OPERATION_TIMEDOUT)) - { // A standard timeout response we get this when there are no events. - LL_DEBUGS("LLEventPollImpl") << "All is very quiet on target server. It may have gone idle?" << LL_ENDL; - errorCount = 0; - continue; + if (status == LLCore::HttpStatus(LLCore::HttpStatus::EXT_CURL_EASY, CURLE_OPERATION_TIMEDOUT) // A standard timeout, no events. + || status == LLCore::HttpStatus(HTTP_BAD_GATEWAY) // An expected 'No events' case. + || status == LLCore::HttpStatus(HTTP_INTERNAL_ERROR) + || status == LLCore::HttpStatus(HTTP_SERVICE_UNAVAILABLE) + || status == LLCore::HttpStatus(HTTP_GATEWAY_TIME_OUT)) + { + if (message_time.getElapsedSeconds() < MIN_SECONDS_PASSED) + { + // Server is supposed to hold request for 20 to 30 seconds. + // If it didn't hold the request at least for 10s, treat as an error. + LL_WARNS("LLEventPollImpl") << "Response arrived too early, status: " << status.toTerseString() + << ", time passed: " << message_time.getElapsedSeconds() << LL_ENDL; + } + else + { + // Timeout, expected and means 'no events'. Request is to be re-issued immediately. + // Current definition of a timeout is any of : + // - libcurl easy 28 status code + // - Linden 499 special http status code + // - RFC - standard 502 - 504 http status codes + LL_DEBUGS("LLEventPollImpl") << "No events, from: " << mSenderIp <<" status: " << (S32)status.getStatus() << LL_ENDL; + errorCount = 0; + continue; + } } else if ((status == LLCore::HttpStatus(LLCore::HttpStatus::LLCORE, LLCore::HE_OP_CANCELED)) || (status == LLCore::HttpStatus(HTTP_NOT_FOUND))) @@ -206,13 +230,13 @@ namespace Details // some cases the server gets ahead of the viewer and will // return a 404 error (Not Found) before the cancel event // comes back in the queue - LL_WARNS("LLEventPollImpl") << "Canceling coroutine" << LL_ENDL; + LL_WARNS("LLEventPollImpl") << "<" << counter << "> Canceling coroutine, status: " << status.toTerseString() << LL_ENDL; break; } else if (!status.isHttpStatus()) { /// Some LLCore or LIBCurl error was returned. This is unlikely to be recoverable - LL_WARNS("LLEventPollImpl") << "Critical error from poll request returned from libraries. Canceling coroutine." << LL_ENDL; + LL_WARNS("LLEventPollImpl") << "<" << counter << "> Critical error from poll request returned from libraries. Canceling coroutine." << LL_ENDL; break; } LL_WARNS("LLEventPollImpl") << "<" << counter << "> Error result from LLCoreHttpUtil::HttpCoroHandler. Code " @@ -255,6 +279,10 @@ namespace Details LL_WARNS("LLEventPollImpl") << "< " << counter << "> Forcing disconnect due to stalled main region event poll." << LL_ENDL; LLAppViewer::instance()->forceDisconnect(LLTrans::getString("AgentLostConnection")); } + else + { + LL_WARNS("LLEventPollImpl") << "< " << counter << "> Stopping event poll for " << mSenderIp << " due to failures." << LL_ENDL; + } break; } } diff --git a/indra/newview/lleventpoll.h b/indra/newview/lleventpoll.h index bb407b3799c..ea186aa803a 100644 --- a/indra/newview/lleventpoll.h +++ b/indra/newview/lleventpoll.h @@ -40,7 +40,30 @@ namespace Details class LLEventPoll - ///< implements the viewer side of server-to-viewer pushed events. + ///< Implements the viewer side of server-to-viewer pushed events. + /// + /// This class implements the sole consumer of the EventQueueGet capability + /// and delivers data, including llsd-encoded llmessage payloads, from + /// simulator to viewer. + /// + /// https://wiki.secondlife.com/wiki/EventQueueGet + /// The wiki page is neither complete nor entirely correct. Request timeouts + /// became the de facto method of returning an empty event set to the viewer. + /// But the timeout behavior was never defined. It was simply whatever + /// behavior a given grid implementation implemented. + /// + /// In SL's case, the path may include reverse proxies, http caches, http and + /// socks proxies, transparent hijacking, and other horrors. A pitfall for + /// implementors. + /// + /// Current definition of a timeout is any of : + /// - libcurl easy 28 status code + /// - Linden 499 special http status code + /// - RFC - standard 502 - 504 http status codes + /// If requests are failing too quickly with the above errors, they are treated + /// as actual errors and not an empty payload. These will count towards a final + /// error declaration and can lead to disconnection from a simulator or the + /// entire grid. { public: LLEventPoll(const std::string& pollURL, const LLHost& sender); diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp index ba54d93c75f..9f3df54b056 100644 --- a/indra/newview/llfeaturemanager.cpp +++ b/indra/newview/llfeaturemanager.cpp @@ -404,8 +404,53 @@ F32 logExceptionBenchmark() } #endif +bool checkRDNA35() +{ + // This checks if we're running on an RDNA3.5 GPU. You're only going to see these on AMD's APUs. + // As of driver version 25, we're seeing stalls in some of our queries. + // This appears to be a driver bug, and appears to be specific RDNA3.5 APUs. + // There's multiples of these guys, so we just use this function to check if that GPU is on the list of known RDNA3.5 APUs. + // - Geenz 11/12/2025 + std::array rdna35GPUs = { + "8060S", + "8050S", + "8040S", + "860M", + "840M", + "890M", + "880M" + }; + + for (const auto& gpu_name : rdna35GPUs) + { + if (gGLManager.getRawGLString().find(gpu_name) != std::string::npos) + { + LL_WARNS("RenderInit") << "Detected AMD RDNA3.5 GPU (" << gpu_name << ")." << LL_ENDL; + return true; + } + } + + return false; +} + bool LLFeatureManager::loadGPUClass() { + // This is a hack for certain AMD GPUs in newer driver versions on certain APUs. + // These GPUs will show inconsistent freezes when attempting to run shader profiles against them. + // This is extremely problematic as it can lead to: + // - Login freezes + // - Inability to start the client + // - Completely random avatars triggering a freeze + // As a result, we filter out these GPUs for shader profiling. + // - Geenz 11/11/2025 + + if (gGLManager.getRawGLString().find("Radeon") != std::string::npos && checkRDNA35() && gGLManager.mDriverVersionVendorString.find("25.") != std::string::npos) + { + LL_WARNS("RenderInit") << "Detected AMD RDNA3.5 GPU on a known bad driver; disabling shader profiling to prevent freezes." << LL_ENDL; + mSkipProfiling = true; + LLGLSLShader::sCanProfile = false; + } + if (!gSavedSettings.getBOOL("SkipBenchmark")) { F32 class1_gbps = gSavedSettings.getF32("RenderClass1MemoryBandwidth"); @@ -465,7 +510,7 @@ bool LLFeatureManager::loadGPUClass() } #if LL_WINDOWS - const F32Gigabytes MIN_PHYSICAL_MEMORY(2); + const F32Gigabytes MIN_PHYSICAL_MEMORY(8); LLMemory::updateMemoryInfo(); F32Gigabytes physical_mem = LLMemory::getMaxMemKB(); diff --git a/indra/newview/llfeaturemanager.h b/indra/newview/llfeaturemanager.h index 22de6afbaed..d04b89cb60c 100644 --- a/indra/newview/llfeaturemanager.h +++ b/indra/newview/llfeaturemanager.h @@ -123,6 +123,7 @@ class LLFeatureManager : public LLFeatureList, public LLSingleton mNormalTexture; LLPointer mMetallicRoughnessTexture; LLPointer mEmissiveTexture; + void clearFetchedTextures(); std::set mTextureEntires; diff --git a/indra/newview/llfilepicker_mac.mm b/indra/newview/llfilepicker_mac.mm index 978069457ce..6cb7c4ad51c 100644 --- a/indra/newview/llfilepicker_mac.mm +++ b/indra/newview/llfilepicker_mac.mm @@ -1,25 +1,25 @@ -/** +/** * @file llfilepicker_mac.cpp * @brief OS-specific file picker * * $LicenseInfo:firstyear=2001&license=viewerlgpl$ * Second Life Viewer Source Code * Copyright (C) 2010, Linden Research, Inc. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; * version 2.1 of the License only. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * + * * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ @@ -32,15 +32,15 @@ NSOpenPanel *init_panel(const std::vector* allowed_types, unsigned int flags) { int i; - + NSOpenPanel *panel = [NSOpenPanel openPanel]; NSMutableArray *fileTypes = nil; - - + + if ( allowed_types && !allowed_types->empty()) { fileTypes = [[NSMutableArray alloc] init]; - + for (i=0;isize();++i) { [fileTypes addObject: @@ -48,7 +48,7 @@ encoding:[NSString defaultCStringEncoding]]]; } } - + //[panel setMessage:@"Import one or more files or directories."]; [panel setAllowsMultipleSelection: ( (flags & F_MULTIPLE)?true:false ) ]; [panel setCanChooseDirectories: ( (flags & F_DIRECTORY)?true:false ) ]; @@ -56,7 +56,7 @@ [panel setResolvesAliases: true]; [panel setCanChooseFiles: ( (flags & F_FILE)?true:false )]; [panel setTreatsFilePackagesAsDirectories: ( flags & F_NAV_SUPPORT ) ]; - + if (fileTypes) { [panel setAllowedFileTypes:fileTypes]; @@ -77,7 +77,7 @@ std::unique_ptr> outfiles; @autoreleasepool - { + { int result; //Aura TODO: We could init a small window and release it at the end of this routine //for a modeless interface. @@ -85,17 +85,17 @@ NSOpenPanel *panel = init_panel(allowed_types,flags); result = [panel runModal]; - + if (result == NSModalResponseOK) { NSArray *filesToOpen = [panel URLs]; int i, count = [filesToOpen count]; - + if (count > 0) { outfiles.reset(new std::vector); } - + for (i=0; i* allowed_types, { @autoreleasepool - { + { // Note: might need to return and save this panel // so that it does not close immediately NSOpenPanel *panel = init_panel(allowed_types,flags); - + [panel beginWithCompletionHandler:^(NSModalResponse result) { std::vector outfiles; @@ -125,10 +125,10 @@ void doLoadDialogModeless(const std::vector* allowed_types, { NSArray *filesToOpen = [panel URLs]; int i, count = [filesToOpen count]; - + if (count > 0) { - + for (i=0; i* allowed_types, } } -std::unique_ptr doSaveDialog(const std::string* file, +std::unique_ptr doSaveDialog(const std::string* file, const std::string* type, const std::string* creator, const std::string* extension, @@ -157,18 +157,18 @@ void doLoadDialogModeless(const std::vector* allowed_types, { std::unique_ptr outfile; @autoreleasepool - { + { NSSavePanel *panel = [NSSavePanel savePanel]; - + NSString *extensionns = [NSString stringWithCString:extension->c_str() encoding:[NSString defaultCStringEncoding]]; NSArray *fileType = [extensionns componentsSeparatedByString:@","]; - + //[panel setMessage:@"Save Image File"]; [panel setTreatsFilePackagesAsDirectories: ( flags & F_NAV_SUPPORT ) ]; [panel setCanSelectHiddenExtension:true]; [panel setAllowedFileTypes:fileType]; NSString *fileName = [NSString stringWithCString:file->c_str() encoding:[NSString defaultCStringEncoding]]; - + NSURL* url = [NSURL fileURLWithPath:fileName]; [panel setNameFieldStringValue: fileName]; [panel setDirectoryURL: url]; @@ -193,39 +193,39 @@ void doSaveDialogModeless(const std::string* file, void *userdata) { @autoreleasepool { - NSSavePanel *panel = [NSSavePanel savePanel]; - - NSString *extensionns = [NSString stringWithCString:extension->c_str() encoding:[NSString defaultCStringEncoding]]; - NSArray *fileType = [extensionns componentsSeparatedByString:@","]; - - //[panel setMessage:@"Save Image File"]; - [panel setTreatsFilePackagesAsDirectories: ( flags & F_NAV_SUPPORT ) ]; - [panel setCanSelectHiddenExtension:true]; - [panel setAllowedFileTypes:fileType]; - NSString *fileName = [NSString stringWithCString:file->c_str() encoding:[NSString defaultCStringEncoding]]; - - NSURL* url = [NSURL fileURLWithPath:fileName]; - [panel setNameFieldStringValue: fileName]; - [panel setDirectoryURL: url]; - - - [panel beginWithCompletionHandler:^(NSModalResponse result) - { + NSSavePanel *panel = [NSSavePanel savePanel]; + + NSString *extensionns = [NSString stringWithCString:extension->c_str() encoding:[NSString defaultCStringEncoding]]; + NSArray *fileType = [extensionns componentsSeparatedByString:@","]; + + //[panel setMessage:@"Save Image File"]; + [panel setTreatsFilePackagesAsDirectories: ( flags & F_NAV_SUPPORT ) ]; + [panel setCanSelectHiddenExtension:true]; + [panel setAllowedFileTypes:fileType]; + NSString *fileName = [NSString stringWithCString:file->c_str() encoding:[NSString defaultCStringEncoding]]; + + NSURL* url = [NSURL fileURLWithPath:fileName]; + [panel setNameFieldStringValue: fileName]; + [panel setDirectoryURL: url]; + + + [panel beginWithCompletionHandler:^(NSModalResponse result) + { if (result == NSModalResponseOK) - { - NSURL* url = [panel URL]; - NSString* p = [url path]; - std::string outfile([p UTF8String]); - - callback(true, outfile, userdata); - } - else // cancel - { - std::string outfile; - callback(false, outfile, userdata); - } - }]; - } + { + NSURL* url = [panel URL]; + NSString* p = [url path]; + std::string outfile([p UTF8String]); + + callback(true, outfile, userdata); + } + else // cancel + { + std::string outfile; + callback(false, outfile, userdata); + } + }]; + } } #endif diff --git a/indra/newview/llfloateravatarwelcomepack.cpp b/indra/newview/llfloateravatarwelcomepack.cpp index 82e44d1398e..be384bf4d11 100644 --- a/indra/newview/llfloateravatarwelcomepack.cpp +++ b/indra/newview/llfloateravatarwelcomepack.cpp @@ -28,8 +28,10 @@ #include "llviewerprecompiledheaders.h" #include "llfloateravatarwelcomepack.h" -#include "lluictrlfactory.h" #include "llmediactrl.h" +#include "lluictrlfactory.h" +#include "llviewercontrol.h" +#include "llweb.h" LLFloaterAvatarWelcomePack::LLFloaterAvatarWelcomePack(const LLSD& key) : LLFloater(key) @@ -52,6 +54,10 @@ bool LLFloaterAvatarWelcomePack::postBuild() if (mAvatarPicker) { mAvatarPicker->clearCache(); + mAvatarPicker->setErrorPageURL(gSavedSettings.getString("GenericErrorPageURL")); + std::string url = gSavedSettings.getString("AvatarWelcomePack"); + url = LLWeb::expandURLSubstitutions(url, LLSD()); + mAvatarPicker->navigateTo(url, HTTP_CONTENT_TEXT_HTML); } return true; diff --git a/indra/newview/llfloaterdestinations.cpp b/indra/newview/llfloaterdestinations.cpp index fad9693e8f1..84fc4afcddf 100644 --- a/indra/newview/llfloaterdestinations.cpp +++ b/indra/newview/llfloaterdestinations.cpp @@ -28,7 +28,10 @@ #include "llviewerprecompiledheaders.h" #include "llfloaterdestinations.h" +#include "llmediactrl.h" #include "lluictrlfactory.h" +#include "llviewercontrol.h" +#include "llweb.h" LLFloaterDestinations::LLFloaterDestinations(const LLSD& key) @@ -43,6 +46,15 @@ LLFloaterDestinations::~LLFloaterDestinations() bool LLFloaterDestinations::postBuild() { enableResizeCtrls(true, true, false); + LLMediaCtrl* destinations = getChild("destination_guide_contents"); + destinations->setErrorPageURL(gSavedSettings.getString("GenericErrorPageURL")); + std::string url = gSavedSettings.getString("DestinationGuideURL"); + url = LLWeb::expandURLSubstitutions(url, LLSD()); + destinations->navigateTo(url, HTTP_CONTENT_TEXT_HTML); + + // If cookie is there, will set it now. Otherwise will have to wait for login completion + // which will also update destinations instance if it already exists. + LLViewerMedia::getInstance()->getOpenIDCookie(destinations); return true; } diff --git a/indra/newview/llfloaterdisplayname.cpp b/indra/newview/llfloaterdisplayname.cpp index 236aadfbc1b..4843a48e66b 100644 --- a/indra/newview/llfloaterdisplayname.cpp +++ b/indra/newview/llfloaterdisplayname.cpp @@ -56,6 +56,7 @@ class LLFloaterDisplayName : public LLFloater void onCacheSetName(bool success, const std::string& reason, const LLSD& content); + bool mIsLockedOut = false; }; LLFloaterDisplayName::LLFloaterDisplayName(const LLSD& key) : @@ -72,8 +73,8 @@ void LLFloaterDisplayName::onOpen(const LLSD& key) LLAvatarNameCache::get(gAgent.getID(), &av_name); F64 now_secs = LLDate::now().secondsSinceEpoch(); - - if (now_secs < av_name.mNextUpdate) + mIsLockedOut = now_secs < av_name.mNextUpdate; + if (mIsLockedOut) { // ...can't update until some time in the future F64 next_update_local_secs = @@ -167,18 +168,19 @@ void LLFloaterDisplayName::onReset() } getChild("display_name_editor")->setValue(av_name.getUserName()); - if (getChild("display_name_editor")->getEnabled()) + if (mIsLockedOut) { - // UI is enabled, fill the first field - getChild("display_name_confirm")->clear(); - getChild("display_name_confirm")->setFocus(true); + // UI is disabled. + // We should allow resetting even if user already + // set a display name, enable save button + getChild("display_name_confirm")->setValue(av_name.getUserName()); + getChild("save_btn")->setEnabled(true); } else { - // UI is disabled, looks like we should allow resetting - // even if user already set a display name, enable save button - getChild("display_name_confirm")->setValue(av_name.getUserName()); - getChild("save_btn")->setEnabled(true); + // UI is enabled, focus on the confirm field + getChild("display_name_confirm")->clear(); + getChild("display_name_confirm")->setFocus(true); } } diff --git a/indra/newview/llfloateremojipicker.cpp b/indra/newview/llfloateremojipicker.cpp index c5f4a2f0cf4..ab76f3473b4 100644 --- a/indra/newview/llfloateremojipicker.cpp +++ b/indra/newview/llfloateremojipicker.cpp @@ -377,6 +377,9 @@ void LLFloaterEmojiPicker::initialize() { if (!mHint.empty()) { + // Hack: Trying to open floater, search for a match, + // and hide floater immediately if no match found, + // instead of checking prior to opening hideFloater(); return; } @@ -406,6 +409,12 @@ void LLFloaterEmojiPicker::initialize() return; } + if (!mHint.empty() && getSoundFlags() == LLView::SILENT) + { + // Sounds were supressed + make_ui_sound("UISndWindowOpen"); + } + mGroups->setVisible(true); mPreview->setIcon(nullptr); showPreview(true); diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index d28c987414c..1825797159e 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -134,12 +134,15 @@ void LLFloaterFixedEnvironment::onClose(bool app_quitting) { doCloseInventoryFloater(app_quitting); - LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL); - LLEnvironment::instance().setCurrentEnvironmentSelection(LLEnvironment::ENV_LOCAL); - LLEnvironment::instance().clearEnvironment(LLEnvironment::ENV_EDIT); + if (!app_quitting) + { + LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL); + LLEnvironment::instance().setCurrentEnvironmentSelection(LLEnvironment::ENV_LOCAL); + LLEnvironment::instance().clearEnvironment(LLEnvironment::ENV_EDIT); - mSettings.reset(); - syncronizeTabs(); + mSettings.reset(); + syncronizeTabs(); + } } void LLFloaterFixedEnvironment::refresh() diff --git a/indra/newview/llfloaterimagepreview.cpp b/indra/newview/llfloaterimagepreview.cpp index 550c3adc270..c9248072732 100644 --- a/indra/newview/llfloaterimagepreview.cpp +++ b/indra/newview/llfloaterimagepreview.cpp @@ -267,6 +267,14 @@ void LLFloaterImagePreview::onBtnOK() LLPointer formatted = new LLImageJ2C; + if (mRawImagep->getWidth() * mRawImagep->getHeight() <= LL_IMAGE_REZ_LOSSLESS_CUTOFF * LL_IMAGE_REZ_LOSSLESS_CUTOFF) + { + if (gSavedSettings.getBOOL("LosslessJ2CUpload")) + { + formatted->setReversible(true); + } + } + if (formatted->encode(mRawImagep, 0.0f)) { LLFileSystem fmt_file(new_asset_id, LLAssetType::AT_TEXTURE, LLFileSystem::WRITE); diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index d821d9a4a56..a0f2dbe1972 100644 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -1698,6 +1698,11 @@ void LLFloaterIMContainer::showConversation(const LLUUID& session_id) if (session_floater) { session_floater->restoreFloater(); + if (session_floater->isTornOff() && session_floater->isMinimized()) + { + session_floater->setMinimized(false); + session_floater->setFocus(true); + } } } diff --git a/indra/newview/llfloaterimnearbychathandler.cpp b/indra/newview/llfloaterimnearbychathandler.cpp index c920a3c8989..3b0c19499a0 100644 --- a/indra/newview/llfloaterimnearbychathandler.cpp +++ b/indra/newview/llfloaterimnearbychathandler.cpp @@ -44,6 +44,7 @@ #include "llfloaterimcontainer.h" #include "llrootview.h" #include "lllayoutstack.h" +#include "llscripteditorws.h" //add LLFloaterIMNearbyChatHandler to LLNotificationsUI namespace using namespace LLNotificationsUI; @@ -335,6 +336,7 @@ void LLFloaterIMNearbyChatScreenChannel::addChat(LLSD& chat) { if (!gSavedSettings.getBOOL("ShowScriptErrors")) return; + if (gSavedSettings.getS32("ShowScriptErrorsLocation") == 1) return; } @@ -526,6 +528,15 @@ void LLFloaterIMNearbyChatHandler::processChat(const LLChat& chat_msg, if (!gSavedSettings.getBOOL("ShowScriptErrors")) return; + if (gSavedSettings.getBOOL("ExternalWebsocketSyncEnable") && gSavedSettings.getBOOL("ExternalWebsocketForwardDebug")) + { + LLScriptEditorWSServer::ptr_t server = LLScriptEditorWSServer::getServer(); + if (server) + { + server->forwardChatToIDE(chat_msg); + } + } + // don't process debug messages from not owned objects, see EXT-7762 if (gAgentID != chat_msg.mOwnerID) { @@ -545,6 +556,16 @@ void LLFloaterIMNearbyChatHandler::processChat(const LLChat& chat_msg, return; } } + else if ((chat_msg.mChatType == CHAT_TYPE_OWNER) && + gSavedSettings.getBOOL("ExternalWebsocketSyncEnable") && + gSavedSettings.getBOOL("ExternalWebsocketForwardDebug")) + { + LLScriptEditorWSServer::ptr_t server = LLScriptEditorWSServer::getServer(); + if (server) + { + server->forwardChatToIDE(chat_msg); + } + } nearby_chat->addMessage(chat_msg, true, args); diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp index e03422780aa..65c13797ac3 100644 --- a/indra/newview/llfloaterimsessiontab.cpp +++ b/indra/newview/llfloaterimsessiontab.cpp @@ -618,8 +618,19 @@ void LLFloaterIMSessionTab::deleteAllChildren() std::string LLFloaterIMSessionTab::appendTime() { - std::string timeStr = "[" + LLTrans::getString("TimeHour") + "]:" - "[" + LLTrans::getString("TimeMin") + "]"; + std::string timeStr; + static bool use_24h = gSavedSettings.getBOOL("Use24HourClock"); + if (use_24h) + { + timeStr = "[" + LLTrans::getString("TimeHour") + "]:" + "[" + LLTrans::getString("TimeMin") + "]"; + } + else + { + timeStr = "[" + LLTrans::getString("TimeHour12") + "]:" + "[" + LLTrans::getString("TimeMin") + "] [" + + LLTrans::getString("TimeAMPM") + "]"; + } LLSD substitution; substitution["datetime"] = (S32)time_corrected(); diff --git a/indra/newview/llfloaterinspect.cpp b/indra/newview/llfloaterinspect.cpp index 4f993ca0e11..c0fe7ad8962 100644 --- a/indra/newview/llfloaterinspect.cpp +++ b/indra/newview/llfloaterinspect.cpp @@ -220,7 +220,8 @@ void LLFloaterInspect::refresh() } time_t timestamp = (time_t) (obj->mCreationDate/1000000); - std::string timeStr = getString("timeStamp"); + static bool use_24h = gSavedSettings.getBOOL("Use24HourClock"); + std::string timeStr = use_24h ? getString("timeStamp") : getString("timeStampAMPM"); LLSD substitution; substitution["datetime"] = (S32) timestamp; LLStringUtil::format (timeStr, substitution); diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 52a3e78d041..5c5219bcdd9 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -733,7 +733,8 @@ void LLPanelLandGeneral::refresh() // Display claim date time_t claim_date = parcel->getClaimDate(); - std::string claim_date_str = getString("time_stamp_template"); + static bool use_24h = gSavedSettings.getBOOL("Use24HourClock"); + std::string claim_date_str = use_24h ? getString("time_stamp_template") : getString("time_stamp_template_ampm"); LLSD substitution; substitution["datetime"] = (S32) claim_date; LLStringUtil::format (claim_date_str, substitution); diff --git a/indra/newview/llfloatermarketplace.cpp b/indra/newview/llfloatermarketplace.cpp index 4abea64302b..7316d7617dd 100644 --- a/indra/newview/llfloatermarketplace.cpp +++ b/indra/newview/llfloatermarketplace.cpp @@ -46,9 +46,16 @@ void LLFloaterMarketplace::onClose(bool app_quitting) bool LLFloaterMarketplace::postBuild() { - LLFloaterWebContent::postBuild(); - mWebBrowser = getChild("marketplace_contents"); - mWebBrowser->addObserver(this); + if (!LLFloaterWebContent::postBuild()) + return false; + + mWebBrowser->setErrorPageURL(gSavedSettings.getString("GenericErrorPageURL")); + std::string url = gSavedSettings.getString("MarketplaceURL"); + mWebBrowser->navigateTo(url, HTTP_CONTENT_TEXT_HTML); + + // If cookie is there, will set it now, Otherwise will have to wait for login completion + // which will also update marketplace instance if it already exists. + LLViewerMedia::getInstance()->getOpenIDCookie(mWebBrowser); return true; } diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index f76f39222b9..ef29be8200c 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -1035,8 +1035,13 @@ void LLFloaterModelPreview::onPhysicsStageExecute(LLUICtrl* ctrl, void* data) gMeshRepo.mDecompThread->submitRequest(request); } } - - if (stage == "Decompose") + if (stage == "Analyze") + { + sInstance->setStatusMessage(sInstance->getString("decomposing")); + sInstance->childSetVisible("Analyze", false); + sInstance->childSetVisible("analyze_cancel", true); + } + else if (stage == "Decompose") { sInstance->setStatusMessage(sInstance->getString("decomposing")); sInstance->childSetVisible("Decompose", false); @@ -1137,6 +1142,7 @@ void LLFloaterModelPreview::initDecompControls() childSetCommitCallback("simplify_cancel", onPhysicsStageCancel, NULL); childSetCommitCallback("decompose_cancel", onPhysicsStageCancel, NULL); + childSetCommitCallback("analyze_cancel", onPhysicsStageCancel, NULL); childSetCommitCallback("physics_lod_combo", onPhysicsUseLOD, NULL); childSetCommitCallback("physics_browse", onPhysicsBrowse, NULL); @@ -2018,7 +2024,7 @@ void LLFloaterModelPreview::DecompRequest::completed() { //called from the main thread if (mContinue) { - mModel->setConvexHullDecomposition(mHull); + mModel->setConvexHullDecomposition(mHull, mHullMesh); if (sInstance) { diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 291f22d78fa..f537ae64245 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -346,6 +346,7 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key) mCommitCallbackRegistrar.add("Pref.RememberedUsernames", boost::bind(&LLFloaterPreference::onClickRememberedUsernames, this)); mCommitCallbackRegistrar.add("Pref.SpellChecker", boost::bind(&LLFloaterPreference::onClickSpellChecker, this)); mCommitCallbackRegistrar.add("Pref.Advanced", boost::bind(&LLFloaterPreference::onClickAdvanced, this)); + mCommitCallbackRegistrar.add("Pref.Scripting", boost::bind(&LLFloaterPreference::onClickScriptingPerfs, this)); sSkin = gSavedSettings.getString("SkinCurrent"); @@ -475,6 +476,8 @@ bool LLFloaterPreference::postBuild() getChild("log_path_string")->setEnabled(false); // make it read-only but selectable getChild("language_combobox")->setCommitCallback(boost::bind(&LLFloaterPreference::onLanguageChange, this)); + mTimeFormatCombobox = getChild("time_format_combobox"); + mTimeFormatCombobox->setCommitCallback(boost::bind(&LLFloaterPreference::onTimeFormatChange, this)); getChild("FriendIMOptions")->setCommitCallback(boost::bind(&LLFloaterPreference::onNotificationsChange, this,"FriendIMOptions")); getChild("NonFriendIMOptions")->setCommitCallback(boost::bind(&LLFloaterPreference::onNotificationsChange, this,"NonFriendIMOptions")); @@ -772,6 +775,17 @@ void LLFloaterPreference::onOpen(const LLSD& key) // Load (double-)click to walk/teleport settings. updateClickActionViews(); +#if LL_LINUX + // Lixux doesn't support automatic mode + LLComboBox* combo = getChild("double_click_action_combo"); + S32 mode = gSavedSettings.getS32("MouseWarpMode"); + if (mode == 0) + { + combo->setValue("1"); + } + combo->setEnabledByValue("0", false); +#endif + // Enabled/disabled popups, might have been changed by user actions // while preferences floater was closed. buildPopupLists(); @@ -1103,6 +1117,13 @@ void LLFloaterPreference::onLanguageChange() } } +void LLFloaterPreference::onTimeFormatChange() +{ + std::string val = mTimeFormatCombobox->getValue(); + gSavedSettings.setBOOL("Use24HourClock", val == "1"); + onLanguageChange(); +} + void LLFloaterPreference::onNotificationsChange(const std::string& OptionName) { mNotificationOptions[OptionName] = getChild(OptionName)->getSelectedItemLabel(); @@ -1318,6 +1339,8 @@ void LLFloaterPreference::refresh() advanced->refresh(); } updateClickActionViews(); + + mTimeFormatCombobox->selectByValue(gSavedSettings.getBOOL("Use24HourClock") ? "1" : "0"); } void LLFloaterPreference::onCommitWindowedMode() @@ -1356,6 +1379,7 @@ void LLFloaterPreference::onChangeQuality(const LLSD& data) } mLastQualityLevel = level; LLFeatureManager::getInstance()->setGraphicsLevel(level, true); + gSavedSettings.setU32("DebugQualityPerformance", level); refreshEnabledGraphics(); refresh(); } @@ -1825,6 +1849,11 @@ void LLFloaterPreference::onClickAdvanced() } } +void LLFloaterPreference::onClickScriptingPerfs() +{ + LLFloaterReg::showInstance("scripting_settings"); +} + void LLFloaterPreference::onClickActionChange() { updateClickActionControls(); diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index a784d502ef2..831a650c45f 100644 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -117,6 +117,7 @@ class LLFloaterPreference : public LLFloater, public LLAvatarPropertiesObserver, void onClickClearCache(); // Clear viewer texture cache, file cache on next startup void onClickBrowserClearCache(); // Clear web history and caches as well as viewer caches above void onLanguageChange(); + void onTimeFormatChange(); void onNotificationsChange(const std::string& OptionName); void onNameTagOpacityChange(const LLSD& newvalue); @@ -190,6 +191,7 @@ class LLFloaterPreference : public LLFloater, public LLAvatarPropertiesObserver, void onClickRenderExceptions(); void onClickAutoAdjustments(); void onClickAdvanced(); + void onClickScriptingPerfs(); void applyUIColor(LLUICtrl* ctrl, const LLSD& param); void getUIColor(LLUICtrl* ctrl, const LLSD& param); void onLogChatHistorySaved(); @@ -235,6 +237,7 @@ class LLFloaterPreference : public LLFloater, public LLAvatarPropertiesObserver, LLButton* mDeleteTranscriptsBtn = nullptr; LLButton* mEnablePopupBtn = nullptr; LLButton* mDisablePopupBtn = nullptr; + LLComboBox* mTimeFormatCombobox = nullptr; std::unique_ptr< ll::prefs::SearchData > mSearchData; bool mSearchDataDirty; diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 334f32d051c..5ec7e94fcc6 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -270,10 +270,12 @@ bool LLFloaterRegionInfo::postBuild() static LLCachedControl feature_pbr_terrain_transforms_enabled(gSavedSettings, "RenderTerrainPBRTransformsEnabled", false); if (!feature_pbr_terrain_transforms_enabled() || !feature_pbr_terrain_enabled()) { + LL_INFOS("Terrain") << "Building region terrain panel from panel_region_terrain.xml" << LL_ENDL; panel->buildFromFile("panel_region_terrain.xml"); } else { + LL_INFOS("Terrain") << "Building region terrain panel from panel_region_terrain_texture_transform.xml" << LL_ENDL; panel->buildFromFile("panel_region_terrain_texture_transform.xml"); } mTab->addTabPanel(panel); @@ -1490,6 +1492,11 @@ bool LLPanelRegionTerrainInfo::validateMaterials() const LLUUID& material_asset_id = material_ctrl->getImageAssetID(); llassert(material_asset_id.notNull()); if (material_asset_id.isNull()) { return false; } + if (material_asset_id == BLANK_MATERIAL_ASSET_ID) + { + // Default/Blank material is valid by default + continue; + } const LLFetchedGLTFMaterial* material = gGLTFMaterialList.getMaterial(material_asset_id); if (!material->isLoaded()) { @@ -1999,18 +2006,7 @@ void LLPanelRegionTerrainInfo::initMaterialCtrl(LLTextureCtrl*& ctrl, const std: ctrl->setCommitCallback( [this, index](LLUICtrl* ctrl, const LLSD& param) { - if (!mMaterialScaleUCtrl[index] - || !mMaterialScaleVCtrl[index] - || !mMaterialRotationCtrl[index] - || !mMaterialOffsetUCtrl[index] - || !mMaterialOffsetVCtrl[index]) return; - - mMaterialScaleUCtrl[index]->setValue(1.f); - mMaterialScaleVCtrl[index]->setValue(1.f); - mMaterialRotationCtrl[index]->setValue(0.f); - mMaterialOffsetUCtrl[index]->setValue(0.f); - mMaterialOffsetVCtrl[index]->setValue(0.f); - onChangeAnything(); + callbackMaterialCommit(index); }); } @@ -2098,6 +2094,25 @@ bool LLPanelRegionTerrainInfo::callbackBakeTerrain(const LLSD& notification, con return false; } +void LLPanelRegionTerrainInfo::callbackMaterialCommit(S32 index) +{ + // These can be null if 'transforms' panel was not inited + if (mMaterialScaleUCtrl[index] + && mMaterialScaleVCtrl[index] + && mMaterialRotationCtrl[index] + && mMaterialOffsetUCtrl[index] + && mMaterialOffsetVCtrl[index]) + { + mMaterialScaleUCtrl[index]->setValue(1.f); + mMaterialScaleVCtrl[index]->setValue(1.f); + mMaterialRotationCtrl[index]->setValue(0.f); + mMaterialOffsetUCtrl[index]->setValue(0.f); + mMaterialOffsetVCtrl[index]->setValue(0.f); + } + + onChangeAnything(); +} + ///////////////////////////////////////////////////////////////////////////// // LLPanelEstateInfo // diff --git a/indra/newview/llfloaterregioninfo.h b/indra/newview/llfloaterregioninfo.h index a8631c36ca6..0036df9c3d7 100644 --- a/indra/newview/llfloaterregioninfo.h +++ b/indra/newview/llfloaterregioninfo.h @@ -272,6 +272,7 @@ class LLPanelRegionTerrainInfo : public LLPanelRegionInfo static void onClickBakeTerrain(void*); bool callbackBakeTerrain(const LLSD& notification, const LLSD& response); bool callbackTextureHeights(const LLSD& notification, const LLSD& response); + void callbackMaterialCommit(S32 index); protected: bool sendUpdate() override; diff --git a/indra/newview/llfloaterscripting.cpp b/indra/newview/llfloaterscripting.cpp new file mode 100644 index 00000000000..0719ced58df --- /dev/null +++ b/indra/newview/llfloaterscripting.cpp @@ -0,0 +1,106 @@ +/** + * @file llfloaterscripting.cpp + * @brief Asset creation permission preferences. + * @author Jonathan Yap + * + * $LicenseInfo:firstyear=2001&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2025, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" +#include "llcheckboxctrl.h" +#include "llfloaterscripting.h" +#include "llviewercontrol.h" +#include "llviewerwindow.h" +#include "lluictrlfactory.h" +#include "llpermissions.h" +#include "llagent.h" +#include "llviewerregion.h" +#include "llnotificationsutil.h" +#include "llsdserialize.h" +#include "llvoavatar.h" +#include "llcorehttputil.h" +#include "lleventfilter.h" +#include "lleventcoro.h" +#include "llviewermenufile.h" +#include "llappviewer.h" + +namespace +{ + class LLEditorPicker : public LLFilePickerThread + { + public: + LLEditorPicker(LLFloaterScripting *floater): + LLFilePickerThread(LLFilePicker::FFLOAD_EXE) + { + mHandle = floater->getDerivedHandle(); + } + void notify(const std::vector& filenames) override + { + if (LLAppViewer::instance()->quitRequested()) + { + return; + } + + LLFloaterScripting* floater = mHandle.get(); + if (floater && !filenames.empty()) + { + floater->pickedEditor(filenames.front()); + } + } + + private: + LLHandle mHandle; + }; + +} + +LLFloaterScripting::LLFloaterScripting(const LLSD& seed) + : LLFloater(seed) +{ + mCommitCallbackRegistrar.add("ScriptingSettings.CLOSE", boost::bind(&LLFloaterScripting::onClickClose, this)); + mCommitCallbackRegistrar.add("ScriptingSettings.BROWSE", boost::bind(&LLFloaterScripting::onClickBrowse, this)); +} + +bool LLFloaterScripting::postBuild() +{ + refresh(); + return true; +} + +void LLFloaterScripting::onClickClose() +{ + closeFloater(); +} + +void LLFloaterScripting::onClickBrowse() +{ + (new LLEditorPicker(this))->getFile(); +} + +void LLFloaterScripting::pickedEditor(std::string_view editor) +{ + assert_main_thread(); + std::stringstream cmdline; + cmdline << "\"" << editor << "\" \"%s\""; + + gSavedSettings.setString("ExternalEditor", cmdline.str()); +} diff --git a/indra/newview/llfloaterscripting.h b/indra/newview/llfloaterscripting.h new file mode 100644 index 00000000000..ca7bd3e091a --- /dev/null +++ b/indra/newview/llfloaterscripting.h @@ -0,0 +1,49 @@ +/** + * @file llfloaterscripting.h + * @brief Asset creation permission preferences. + * @author Jonathan Yap + * + * $LicenseInfo:firstyear=2002&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2025, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#pragma once + +#include "llfloater.h" +#include "lleventcoro.h" +#include "llcoros.h" + +class LLFloaterScripting : public LLFloater +{ + friend class LLFloaterReg; + +public: + bool postBuild() override; + void onClickClose(); + void onClickBrowse(); + + void pickedEditor(std::string_view editor); + +private: + LLFloaterScripting(const LLSD& seed); + +}; + diff --git a/indra/newview/llfloatersearch.cpp b/indra/newview/llfloatersearch.cpp index 7ee1b88f05b..9b7a4e5134d 100644 --- a/indra/newview/llfloatersearch.cpp +++ b/indra/newview/llfloatersearch.cpp @@ -161,15 +161,20 @@ void LLFloaterSearch::initiateSearch(const LLSD& tokens) // Naviation to the calculated URL - we know it's HTML so we can // tell the media system not to bother with the MIME type check. - LLMediaCtrl* search_browser = findChild("search_contents"); - search_browser->navigateTo(url, HTTP_CONTENT_TEXT_HTML); + mWebBrowser->navigateTo(url, HTTP_CONTENT_TEXT_HTML); } bool LLFloaterSearch::postBuild() { - LLFloaterWebContent::postBuild(); - mWebBrowser = getChild("search_contents"); - mWebBrowser->addObserver(this); + if (!LLFloaterWebContent::postBuild()) + return false; + + mWebBrowser->setErrorPageURL(gSavedSettings.getString("GenericErrorPageURL")); + + // If cookie is there, will set it now, Otherwise will have to wait for login completion + // which will also update search instance if it already exists. + LLViewerMedia::getInstance()->getOpenIDCookie(mWebBrowser); + getChildView("address")->setEnabled(false); getChildView("popexternal")->setEnabled(false); diff --git a/indra/newview/llfloatertoybox.cpp b/indra/newview/llfloatertoybox.cpp index f6257dbd3da..5e3ec366d56 100644 --- a/indra/newview/llfloatertoybox.cpp +++ b/indra/newview/llfloatertoybox.cpp @@ -63,7 +63,7 @@ bool LLFloaterToybox::postBuild() mToolBar->setStartDragCallback(boost::bind(LLToolBarView::startDragTool,_1,_2,_3)); mToolBar->setHandleDragCallback(boost::bind(LLToolBarView::handleDragTool,_1,_2,_3,_4)); - mToolBar->setHandleDropCallback(boost::bind(LLToolBarView::handleDropTool,_1,_2,_3,_4)); + mToolBar->setHandleDropCallback(boost::bind(LLToolBarView::handleDropTool,_1,_2,_3,_4,_5)); mToolBar->setButtonEnterCallback(boost::bind(&LLFloaterToybox::onToolBarButtonEnter,this,_1)); // diff --git a/indra/newview/llfloaterurlentry.cpp b/indra/newview/llfloaterurlentry.cpp index 7651b2528f2..2f1857ec613 100644 --- a/indra/newview/llfloaterurlentry.cpp +++ b/indra/newview/llfloaterurlentry.cpp @@ -242,6 +242,16 @@ void LLFloaterURLEntry::getMediaTypeCoro(std::string url, LLHandle pa resolvedMimeType = mimeType; } } + else if (resultHeaders.has(HTTP_IN_HEADER_X_CONTENT_TYPE_OPTIONS)) + { + const std::string& val = resultHeaders[HTTP_IN_HEADER_X_CONTENT_TYPE_OPTIONS]; + if (val == HTTP_NOSNIFF) + { + // Doesn't permit 'sniffing' mime type, default to either html or plain + // If this doesn't work user will have to choose something manually. + resolvedMimeType = HTTP_CONTENT_TEXT_HTML; + } + } floaterUrlEntry->headerFetchComplete(status.getType(), resolvedMimeType); diff --git a/indra/newview/llgltfmateriallist.cpp b/indra/newview/llgltfmateriallist.cpp index 8da835ed7df..3e4aadc3815 100644 --- a/indra/newview/llgltfmateriallist.cpp +++ b/indra/newview/llgltfmateriallist.cpp @@ -359,6 +359,7 @@ void LLGLTFMaterialList::queueApply(const LLViewerObject* obj, S32 side, const L { if (asset_id.isNull() || override_json.empty()) { + // If there is no asset, there can't be an override queueApply(obj, side, asset_id); } else @@ -371,6 +372,7 @@ void LLGLTFMaterialList::queueApply(const LLViewerObject* obj, S32 side, const L { if (asset_id.isNull() || material_override == nullptr) { + // If there is no asset, there can't be an override queueApply(obj, side, asset_id); } else @@ -470,7 +472,7 @@ void LLGLTFMaterialList::flushUpdatesOnce(std::shared_ptr callba { data[i]["gltf_json"] = e.override_data->asJSON(); } - if (!e.override_json.empty()) + else if (!e.override_json.empty()) { data[i]["gltf_json"] = e.override_json; } diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index c1e80ba4f12..bda4afcc04b 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -809,6 +809,10 @@ void LLIMModel::LLIMSession::initVoiceChannel(const LLSD& voiceChannelInfo) { if (mVoiceChannel) { + if (!voiceChannelInfo.isMap()) + { + LL_WARNS() << "initVoiceChannel called without voiceChannelInfo" << LL_ENDL; + } if (mVoiceChannel->isThisVoiceChannel(voiceChannelInfo)) { return; diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 1e6c5cf04a8..e322d3ae284 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -4390,6 +4390,32 @@ void LLFolderBridge::pasteLinkFromClipboard() std::vector objects; LLClipboard::instance().pasteFromClipboard(objects); + if (objects.size() == 0) + { + LLClipboard::instance().setCutMode(false); + return; + } + + LLUUID& first_id = objects[0]; + LLInventoryItem* item = model->getItem(first_id); + if (item && item->getAssetUUID().isNull()) + { + if (item->getActualType() == LLAssetType::AT_NOTECARD) + { + // otehrwise AIS will return 'Cannot link to items with a NULL asset_id.' + LLNotificationsUtil::add("CantLinkNotecard"); + LLClipboard::instance().setCutMode(false); + return; + } + else if (item->getActualType() == LLAssetType::AT_MATERIAL) + { + LLNotificationsUtil::add("CantLinkMaterial"); + LLClipboard::instance().setCutMode(false); + return; + } + } + + LLPointer cb = NULL; LLInventoryPanel* panel = mInventoryPanel.get(); if (panel->getRootFolder()->isSingleFolderMode()) diff --git a/indra/newview/llinventorygallery.cpp b/indra/newview/llinventorygallery.cpp index a4cb6ea65d7..c54af7d9f14 100644 --- a/indra/newview/llinventorygallery.cpp +++ b/indra/newview/llinventorygallery.cpp @@ -2120,6 +2120,30 @@ void LLInventoryGallery::pasteAsLink() std::vector objects; LLClipboard::instance().pasteFromClipboard(objects); + if (objects.size() == 0) + { + LLClipboard::instance().setCutMode(false); + return; + } + + LLUUID& first_id = objects[0]; + LLInventoryItem* item = gInventory.getItem(first_id); + if (item && item->getAssetUUID().isNull()) + { + if (item->getActualType() == LLAssetType::AT_NOTECARD) + { + LLNotificationsUtil::add("CantLinkNotecard"); + LLClipboard::instance().setCutMode(false); + return; + } + else if (item->getActualType() == LLAssetType::AT_MATERIAL) + { + LLNotificationsUtil::add("CantLinkMaterial"); + LLClipboard::instance().setCutMode(false); + return; + } + } + bool paste_into_root = mSelectedItemIDs.empty(); for (LLUUID& dest : mSelectedItemIDs) { diff --git a/indra/newview/llinventorygallerymenu.cpp b/indra/newview/llinventorygallerymenu.cpp index e129a1296a3..eda93e3e79d 100644 --- a/indra/newview/llinventorygallerymenu.cpp +++ b/indra/newview/llinventorygallerymenu.cpp @@ -603,20 +603,23 @@ void LLInventoryGalleryContextMenu::updateMenuItemsVisibility(LLContextMenu* men bool has_children = false; bool is_full_perm_item = false; bool is_copyable = false; - LLViewerInventoryItem* selected_item = gInventory.getItem(selected_id); + + LLViewerInventoryCategory* selected_category = nullptr; + LLViewerInventoryItem* selected_item = nullptr; if(is_folder) { - LLInventoryCategory* category = gInventory.getCategory(selected_id); - if (category) + selected_category = dynamic_cast(obj); + if (selected_category) { - folder_type = category->getPreferredType(); + folder_type = selected_category->getPreferredType(); is_system_folder = LLFolderType::lookupIsProtectedType(folder_type); has_children = (gInventory.categoryHasChildren(selected_id) != LLInventoryModel::CHILDREN_NO); } } else { + selected_item = dynamic_cast(obj); if (selected_item) { is_full_perm_item = selected_item->getIsFullPerm(); @@ -735,8 +738,7 @@ void LLInventoryGalleryContextMenu::updateMenuItemsVisibility(LLContextMenu* men { if (is_agent_inventory && !is_inbox && !is_cof && !is_in_favorites && !is_outfits && !is_in_outfits) { - LLViewerInventoryCategory* category = gInventory.getCategory(selected_id); - if (!category || !LLFriendCardsManager::instance().isCategoryInFriendFolder(category)) + if (!selected_category || !LLFriendCardsManager::instance().isCategoryInFriendFolder(selected_category)) { items.push_back(std::string("New Folder")); } @@ -764,6 +766,22 @@ void LLInventoryGalleryContextMenu::updateMenuItemsVisibility(LLContextMenu* men if (inventory_linking) { items.push_back(std::string("Paste As Link")); + + if (selected_item) + { + if (!LLAssetType::lookupCanLink(selected_item->getActualType())) + { + disabled_items.push_back(std::string("Paste As Link")); + } + else if (gInventory.isObjectDescendentOf(selected_item->getUUID(), gInventory.getLibraryRootFolderID())) + { + disabled_items.push_back(std::string("Paste As Link")); + } + } + else if (selected_category && LLFolderType::lookupIsProtectedType(selected_category->getPreferredType())) + { + disabled_items.push_back(std::string("Paste As Link")); + } } } if (is_folder && is_agent_inventory) @@ -1020,9 +1038,8 @@ void LLInventoryGalleryContextMenu::updateMenuItemsVisibility(LLContextMenu* men { if (is_folder) { - LLViewerInventoryCategory* cat = gInventory.getCategory(selected_id); - if (cat - && !LLFolderType::lookupIsProtectedType(cat->getPreferredType()) + if (selected_category + && !LLFolderType::lookupIsProtectedType(selected_category->getPreferredType()) && gInventory.isObjectDescendentOf(selected_id, gInventory.getRootFolderID())) { can_list = true; diff --git a/indra/newview/llinventoryitemslist.cpp b/indra/newview/llinventoryitemslist.cpp index cfa37cc3ee2..73cc9536920 100644 --- a/indra/newview/llinventoryitemslist.cpp +++ b/indra/newview/llinventoryitemslist.cpp @@ -40,6 +40,10 @@ #include "llinventorymodel.h" #include "llviewerinventory.h" +bool LLInventoryItemsList::sListIdleRegistered = false; +LLInventoryItemsList::all_list_t LLInventoryItemsList::sAllLists; +LLInventoryItemsList::all_list_t::iterator LLInventoryItemsList::sAllListIter; + LLInventoryItemsList::Params::Params() {} @@ -55,13 +59,39 @@ LLInventoryItemsList::LLInventoryItemsList(const LLInventoryItemsList::Params& p setNoFilteredItemsMsg(LLTrans::getString("InventoryNoMatchingItems")); - gIdleCallbacks.addFunction(idle, this); + sAllLists.push_back(this); + sAllListIter = sAllLists.begin(); + + if (!sListIdleRegistered) + { + sAllListIter = sAllLists.begin(); + gIdleCallbacks.addFunction(idle, nullptr); + + LLEventPumps::instance().obtain("LLApp").listen( + "LLInventoryItemsList", + [](const LLSD& stat) + { + std::string status(stat["status"]); + if (status != "running") + { + // viewer is starting shutdown + gIdleCallbacks.deleteFunction(idle, nullptr); + } + return false; + }); + sListIdleRegistered = true; + } } // virtual LLInventoryItemsList::~LLInventoryItemsList() { - gIdleCallbacks.deleteFunction(idle, this); + auto it = std::find(sAllLists.begin(), sAllLists.end(), this); + if (it != sAllLists.end()) + { + sAllLists.erase(it); + sAllListIter = sAllLists.begin(); + } } void LLInventoryItemsList::refreshList(const LLInventoryModel::item_array_t item_array) @@ -111,25 +141,55 @@ void LLInventoryItemsList::updateSelection() mSelectTheseIDs.clear(); } -void LLInventoryItemsList::doIdle() +bool LLInventoryItemsList::doIdle() { - if (mRefreshState == REFRESH_COMPLETE) return; + if (mRefreshState == REFRESH_COMPLETE) return true; // done if (isInVisibleChain() || mForceRefresh || !getFilterSubString().empty()) { refresh(); mRefreshCompleteSignal(this, LLSD()); + return false; // keep going } + return true; // done } //static void LLInventoryItemsList::idle(void* user_data) { - LLInventoryItemsList* self = static_cast(user_data); - if ( self ) - { // Do the real idle - self->doIdle(); + if (sAllLists.empty()) + return; + + LL_PROFILE_ZONE_SCOPED; + + using namespace std::chrono; + auto start = steady_clock::now(); + const milliseconds time_limit = milliseconds(3); + const auto end_time = start + time_limit; + S32 max_update_count = 50; + + if (sAllListIter == sAllLists.end()) + { + sAllListIter = sAllLists.begin(); + } + + S32 updated = 0; + while (steady_clock::now() < end_time + && updated < max_update_count + && sAllListIter != sAllLists.end()) + { + LLInventoryItemsList* list = *sAllListIter; + // Refresh is split into multiple separate parts, + // so keep repeating it while there is time, until done. + // Todo: refresh() split is pointless now? + // Or still useful for large folders? + if (list->doIdle()) + { + // Item is done + ++sAllListIter; + updated++; + } } } @@ -141,6 +201,7 @@ void LLInventoryItemsList::refresh() { case REFRESH_ALL: { + LL_PROFILE_ZONE_NAMED("items_refresh_all"); mAddedItems.clear(); mRemovedItems.clear(); computeDifference(getIDs(), mAddedItems, mRemovedItems); @@ -163,6 +224,7 @@ void LLInventoryItemsList::refresh() } case REFRESH_LIST_ERASE: { + LL_PROFILE_ZONE_NAMED("items_refresh_erase"); uuid_vec_t::const_iterator it = mRemovedItems.begin(); for (; mRemovedItems.end() != it; ++it) { @@ -175,6 +237,7 @@ void LLInventoryItemsList::refresh() } case REFRESH_LIST_APPEND: { + LL_PROFILE_ZONE_NAMED("items_refresh_append"); static const unsigned ADD_LIMIT = 25; // Note: affects perfomance unsigned int nadded = 0; @@ -239,6 +302,7 @@ void LLInventoryItemsList::refresh() } case REFRESH_LIST_SORT: { + LL_PROFILE_ZONE_NAMED("items_refresh_sort"); // Filter, sort, rearrange and notify parent about shape changes filterItems(true, true); @@ -255,7 +319,10 @@ void LLInventoryItemsList::refresh() break; } default: - break; + { + mRefreshState = REFRESH_COMPLETE; + break; + } } setForceRefresh(mRefreshState != REFRESH_COMPLETE); diff --git a/indra/newview/llinventoryitemslist.h b/indra/newview/llinventoryitemslist.h index 9ebeb5e52b0..b20c27eec8b 100644 --- a/indra/newview/llinventoryitemslist.h +++ b/indra/newview/llinventoryitemslist.h @@ -59,7 +59,10 @@ class LLInventoryItemsList : public LLFlatListViewEx * Sets the flag indicating that the list needs to be refreshed even if it is * not currently visible. */ - void setForceRefresh(bool force_refresh) { mForceRefresh = force_refresh; } + void setForceRefresh(bool force_refresh) + { + mForceRefresh = force_refresh; + } /** * If refreshes when invisible. @@ -76,7 +79,7 @@ class LLInventoryItemsList : public LLFlatListViewEx * This is needed for example to filter items of the list hidden by closed * accordion tab. */ - virtual void doIdle(); // Real idle routine + bool doIdle(); // Real idle routine static void idle(void* user_data); // static glue to doIdle() protected: @@ -126,6 +129,12 @@ class LLInventoryItemsList : public LLFlatListViewEx bool mForceRefresh; commit_signal_t mRefreshCompleteSignal; + + // Update synchronization + typedef std::vector all_list_t; + static all_list_t sAllLists; + static all_list_t::iterator sAllListIter; + static bool sListIdleRegistered; }; #endif //LL_LLINVENTORYITEMSLIST_H diff --git a/indra/newview/lllocalbitmaps.cpp b/indra/newview/lllocalbitmaps.cpp index a99c9df0ff1..6e56aac270a 100644 --- a/indra/newview/lllocalbitmaps.cpp +++ b/indra/newview/lllocalbitmaps.cpp @@ -219,7 +219,10 @@ bool LLLocalBitmap::updateSelf(EUpdateType optional_firstupdate) LLPointer texture = new LLViewerFetchedTexture ("file://"+mFilename, FTT_LOCAL_FILE, mWorldID, LL_LOCAL_USE_MIPMAPS); - texture->createGLTexture(LL_LOCAL_DISCARD_LEVEL, raw_image); + if (!texture->createGLTexture(LL_LOCAL_DISCARD_LEVEL, raw_image)) + { + LL_WARNS() << "Failed to create GL texture for local bitmap: " << mFilename << " " << mWorldID << LL_ENDL; + } texture->ref(); gTextureList.addImage(texture, TEX_LIST_STANDARD); diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp index fa1f650113a..30ea255e244 100644 --- a/indra/newview/lllogchat.cpp +++ b/indra/newview/lllogchat.cpp @@ -80,8 +80,8 @@ const static std::string MULTI_LINE_PREFIX(" "); * * Note: "You" was used as an avatar names in viewers of previous versions */ -const static boost::regex TIMESTAMP_AND_STUFF("^(\\[\\d{4}/\\d{1,2}/\\d{1,2}\\s+\\d{1,2}:\\d{2}\\]\\s+|\\[\\d{1,2}:\\d{2}\\]\\s+)?(.*)$"); -const static boost::regex TIMESTAMP("^(\\[\\d{4}/\\d{1,2}/\\d{1,2}\\s+\\d{1,2}:\\d{2}\\]|\\[\\d{1,2}:\\d{2}\\]).*"); +const static boost::regex TIMESTAMP_AND_STUFF("^(\\[\\d{4}/\\d{1,2}/\\d{1,2}\\s+\\d{1,2}:\\d{2}\\s[AaPp][Mm]\\]\\s+|\\[\\d{4}/\\d{1,2}/\\d{1,2}\\s+\\d{1,2}:\\d{2}\\]\\s+|\\[\\d{1,2}:\\d{2}\\s[AaPp][Mm]\\]\\s+|\\[\\d{1,2}:\\d{2}\\]\\s+)?(.*)$"); +const static boost::regex TIMESTAMP("^(\\[\\d{4}/\\d{1,2}/\\d{1,2}\\s+\\d{1,2}:\\d{2}(\\s[AaPp][Mm])?\\]|\\[\\d{1,2}:\\d{2}(\\s[AaPp][Mm])?\\]).*"); /** * Regular expression suitable to match names like @@ -152,6 +152,10 @@ class LLLogChatTimeScanner: public LLSingleton void checkAndCutOffDate(std::string& time_str) { + if (time_str.size() < 10) // not enough space for a date + { + return; + } // Cuts off the "%Y/%m/%d" from string for todays timestamps. // Assume that passed string has at least "%H:%M" time format. date log_date(not_a_date_time); @@ -168,20 +172,12 @@ class LLLogChatTimeScanner: public LLSingleton if ( days_alive == zero_days ) { - // Yep, today's so strip "%Y/%m/%d" info - ptime stripped_time(not_a_date_time); - - mTimeStream.str(LLStringUtil::null); - mTimeStream << time_str; - mTimeStream >> stripped_time; - mTimeStream.clear(); - - time_str.clear(); - - mTimeStream.str(LLStringUtil::null); - mTimeStream << stripped_time; - mTimeStream >> time_str; - mTimeStream.clear(); + size_t pos = time_str.find_first_of(' '); + if (pos != std::string::npos) + { + time_str.erase(0, pos + 1); + LLStringUtil::trim(time_str); + } } LL_DEBUGS("LLChatLogParser") @@ -310,16 +306,22 @@ std::string LLLogChat::timestamp2LogString(U32 timestamp, bool withdate) std::string timeStr; if (withdate) { - timeStr = "[" + LLTrans::getString ("TimeYear") + "]/[" - + LLTrans::getString ("TimeMonth") + "]/[" - + LLTrans::getString ("TimeDay") + "] [" - + LLTrans::getString ("TimeHour") + "]:[" - + LLTrans::getString ("TimeMin") + "]"; + timeStr = "[" + LLTrans::getString("TimeYear") + "]/[" + + LLTrans::getString("TimeMonth") + "]/[" + + LLTrans::getString("TimeDay") + "] "; + } + + static bool use_24h = gSavedSettings.getBOOL("Use24HourClock"); + if (use_24h) + { + timeStr += "[" + LLTrans::getString("TimeHour") + "]:[" + + LLTrans::getString("TimeMin") + "]"; } else { - timeStr = "[" + LLTrans::getString("TimeHour") + "]:[" - + LLTrans::getString ("TimeMin")+"]"; + timeStr += "[" + LLTrans::getString("TimeHour12") + "]:[" + + LLTrans::getString("TimeMin") + "] [" + + LLTrans::getString("TimeAMPM") + "]"; } LLSD substitution; diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp index 4bffe7feac8..41cec4f074e 100644 --- a/indra/newview/lllogininstance.cpp +++ b/indra/newview/lllogininstance.cpp @@ -62,7 +62,7 @@ const S32 LOGIN_MAX_RETRIES = 0; // Viewer should not autmatically retry login const F32 LOGIN_SRV_TIMEOUT_MIN = 10; -const F32 LOGIN_SRV_TIMEOUT_MAX = 120; +const F32 LOGIN_SRV_TIMEOUT_MAX = 180; const F32 LOGIN_DNS_TIMEOUT_FACTOR = 0.9; // make DNS wait shorter then retry time class LLLoginInstance::Disposable { diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 8d5f94cdbb0..413f02b723e 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -256,6 +256,7 @@ // mDecompositionRequests mMutex rw.repo.mMutex, ro.repo.none [5] // mPhysicsShapeRequests mMutex rw.repo.mMutex, ro.repo.none [5] // mDecompositionQ mMutex rw.repo.mLoadedMutex, rw.main.mLoadedMutex [5] (was: [0]) +// mPhysicsQ mMutex rw.repo.mLoadedMutex, rw.main.mLoadedMutex [5] (was: [0]) // mHeaderReqQ mMutex ro.repo.none [5], rw.repo.mMutex, rw.any.mMutex // mLODReqQ mMutex ro.repo.none [5], rw.repo.mMutex, rw.any.mMutex // mUnavailableQ mMutex rw.repo.none [0], ro.main.none [5], rw.main.mLoadedMutex @@ -982,6 +983,12 @@ LLMeshRepoThread::~LLMeshRepoThread() mDecompositionQ.pop_front(); } + while (!mPhysicsQ.empty()) + { + delete mPhysicsQ.front(); + mPhysicsQ.pop_front(); + } + delete mHttpRequest; mHttpRequest = nullptr; delete mMutex; @@ -2565,12 +2572,12 @@ EMeshProcessingResult LLMeshRepoThread::physicsShapeReceived(const LLUUID& mesh_ { LLMutexLock lock(mLoadedMutex); - mDecompositionQ.push_back(d); + mPhysicsQ.push_back(d); } return MESH_OK; } -LLMeshUploadThread::LLMeshUploadThread(LLMeshUploadThread::instance_list& data, const LLMeshUploadThread::lod_sources_map_t& sources_list, +LLMeshUploadThread::LLMeshUploadThread(LLMeshUploadThread::instance_list_t& data, const LLMeshUploadThread::lod_sources_map_t& sources_list, LLVector3& scale, bool upload_textures, bool upload_skin, bool upload_joints, bool lock_scale_if_joint_position, const std::string & upload_url, LLUUID destination_folder_id, bool do_upload, @@ -2652,7 +2659,7 @@ void LLMeshUploadThread::DecompRequest::completed() void LLMeshUploadThread::preStart() { //build map of LLModel refs to instances for callbacks - for (instance_list::iterator iter = mInstanceList.begin(); iter != mInstanceList.end(); ++iter) + for (instance_list_t::iterator iter = mInstanceList.begin(); iter != mInstanceList.end(); ++iter) { mInstance[iter->mModel].push_back(*iter); } @@ -2701,6 +2708,179 @@ LLSD llsd_from_file(std::string filename) return result; } +void LLMeshUploadThread::packModelIntance( + LLModel* model, + LLMeshUploadThread::instance_list_t& instance_list, + std::string& model_name, + LLSD& res, + S32& mesh_num, + S32& texture_num, + S32& instance_num, + std::unordered_set& textures, + std::unordered_map texture_index, + std::unordered_map& mesh_index, + std::vector& texture_list_dest, + bool include_textures + ) +{ + LLMeshUploadData data; + data.mBaseModel = model; + + LLModelInstance& first_instance = *(instance_list.begin()); + for (S32 i = 0; i < 5; i++) + { + data.mModel[i] = first_instance.mLOD[i]; + } + + if (mesh_index.find(data.mBaseModel) == mesh_index.end()) + { + // Have not seen this model before - create a new mesh_list entry for it. + if (model_name.empty()) + { + model_name = data.mBaseModel->getName(); + } + + std::stringstream ostr; + + LLModel::Decomposition& decomp = + data.mModel[LLModel::LOD_PHYSICS].notNull() ? + data.mModel[LLModel::LOD_PHYSICS]->mPhysics : + data.mBaseModel->mPhysics; + + decomp.mBaseHull = mHullMap[data.mBaseModel]; + + LLSD mesh_header = LLModel::writeModel( + ostr, + data.mModel[LLModel::LOD_PHYSICS], + data.mModel[LLModel::LOD_HIGH], + data.mModel[LLModel::LOD_MEDIUM], + data.mModel[LLModel::LOD_LOW], + data.mModel[LLModel::LOD_IMPOSTOR], + decomp, + mUploadSkin, + mUploadJoints, + mLockScaleIfJointPosition, + LLModel::WRITE_BINARY, + false, + data.mBaseModel->mSubmodelID); + + data.mAssetData = ostr.str(); + std::string str = ostr.str(); + + res["mesh_list"][mesh_num] = LLSD::Binary(str.begin(), str.end()); + mesh_index[data.mBaseModel] = mesh_num; + mesh_num++; + } + + // For all instances that use this model + for (instance_list_t::iterator instance_iter = instance_list.begin(); + instance_iter != instance_list.end(); + ++instance_iter) + { + LLModelInstance& instance = *instance_iter; + + LLSD instance_entry; + + for (S32 i = 0; i < 5; i++) + { + data.mModel[i] = instance.mLOD[i]; + } + + LLVector3 pos, scale; + LLQuaternion rot; + LLMatrix4 transformation = instance.mTransform; + decomposeMeshMatrix(transformation, pos, rot, scale); + instance_entry["position"] = ll_sd_from_vector3(pos); + instance_entry["rotation"] = ll_sd_from_quaternion(rot); + instance_entry["scale"] = ll_sd_from_vector3(scale); + + instance_entry["material"] = LL_MCODE_WOOD; + if (model->mSubmodelID) + { + // Should it really be different? + instance_entry["physics_shape_type"] = (U8)(LLViewerObject::PHYSICS_SHAPE_NONE); + } + else + { + instance_entry["physics_shape_type"] = data.mModel[LLModel::LOD_PHYSICS].notNull() ? (U8)(LLViewerObject::PHYSICS_SHAPE_PRIM) : (U8)(LLViewerObject::PHYSICS_SHAPE_CONVEX_HULL); + } + instance_entry["mesh"] = mesh_index[data.mBaseModel]; + instance_entry["mesh_name"] = instance.mLabel; + + instance_entry["face_list"] = LLSD::emptyArray(); + + // We want to be able to allow more than 8 materials... + // + S32 end = llmin((S32)data.mBaseModel->mMaterialList.size(), instance.mModel->getNumVolumeFaces()); + + for (S32 face_num = 0; face_num < end; face_num++) + { + // multiple faces can reuse the same material + LLImportMaterial& material = instance.mMaterial[data.mBaseModel->mMaterialList[face_num]]; + LLSD face_entry = LLSD::emptyMap(); + + LLViewerFetchedTexture* texture = NULL; + + if (material.mDiffuseMapFilename.size()) + { + texture = FindViewerTexture(material); + } + + if ((texture != NULL) && + (textures.find(texture) == textures.end())) + { + textures.insert(texture); + } + + std::stringstream texture_str; + if (texture != NULL && include_textures && mUploadTextures) + { + if (texture->hasSavedRawImage()) + { + LLImageDataLock lock(texture->getSavedRawImage()); + + LLPointer upload_file = + LLViewerTextureList::convertToUploadFile(texture->getSavedRawImage()); + + if (!upload_file.isNull() && upload_file->getDataSize() && !upload_file->isBufferInvalid()) + { + texture_str.write((const char*)upload_file->getData(), upload_file->getDataSize()); + } + } + } + + if (texture != NULL && + mUploadTextures && + texture_index.find(texture) == texture_index.end()) + { + texture_index[texture] = texture_num; + std::string str = texture_str.str(); + res["texture_list"][texture_num] = LLSD::Binary(str.begin(), str.end()); + // store indexes for error handling; + texture_list_dest.push_back(material.mDiffuseMapFilename); + texture_num++; + } + + // Subset of TextureEntry fields. + if (texture != NULL && mUploadTextures) + { + face_entry["image"] = texture_index[texture]; + face_entry["scales"] = 1.0; + face_entry["scalet"] = 1.0; + face_entry["offsets"] = 0.0; + face_entry["offsett"] = 0.0; + face_entry["imagerot"] = 0.0; + } + face_entry["diffuse_color"] = ll_sd_from_color4(material.mDiffuseColor); + face_entry["fullbright"] = material.mFullbright; + instance_entry["face_list"][face_num] = face_entry; + } + + res["instance_list"][instance_num] = instance_entry; + instance_num++; + } +} + void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, std::vector& texture_list_dest, bool include_textures) { LLSD result; @@ -2734,6 +2914,7 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, std::vector& } S32 mesh_num = 0; S32 texture_num = 0; + S32 instance_num = 0; std::unordered_set textures; std::unordered_map texture_index; @@ -2741,7 +2922,34 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, std::vector& std::unordered_map mesh_index; std::string model_name; - S32 instance_num = 0; + // If server gets a m1, m2, m3, m4 list, m1 becomes the root + // and the rest go as m4, m3, m2 + // to counter that mInstance is sorted as m4, m3, m2, m1 + // and we grab m1 from the end and send it first + LLModel* root_model = nullptr; + for (instance_map_t::reverse_iterator iter = mInstance.rbegin(); iter != mInstance.rend(); ++iter) + { + if (iter->first->mSubmodelID) + { + // Submodel can't be root + continue; + } + root_model = iter->first; + packModelIntance( + iter->first, + iter->second, + model_name, + res, + mesh_num, + texture_num, + instance_num, + textures, + texture_index, + mesh_index, + texture_list_dest, + include_textures); + break; + } // Handle models, ignore submodels for now. // Probably should pre-sort by mSubmodelID instead of running twice. @@ -2749,319 +2957,53 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, std::vector& // deterministic order. for (auto& iter : mInstance) { - LLMeshUploadData data; - data.mBaseModel = iter.first; - - if (data.mBaseModel->mSubmodelID) + if (iter.first->mSubmodelID) { // These are handled below to insure correct parenting order on creation // due to map walking being based on model address (aka random) continue; } - - LLModelInstance& first_instance = *(iter.second.begin()); - for (S32 i = 0; i < 5; i++) - { - data.mModel[i] = first_instance.mLOD[i]; - } - - if (mesh_index.find(data.mBaseModel) == mesh_index.end()) - { - // Have not seen this model before - create a new mesh_list entry for it. - if (model_name.empty()) - { - model_name = data.mBaseModel->getName(); - } - - std::stringstream ostr; - - LLModel::Decomposition& decomp = - data.mModel[LLModel::LOD_PHYSICS].notNull() ? - data.mModel[LLModel::LOD_PHYSICS]->mPhysics : - data.mBaseModel->mPhysics; - - decomp.mBaseHull = mHullMap[data.mBaseModel]; - - LLSD mesh_header = LLModel::writeModel( - ostr, - data.mModel[LLModel::LOD_PHYSICS], - data.mModel[LLModel::LOD_HIGH], - data.mModel[LLModel::LOD_MEDIUM], - data.mModel[LLModel::LOD_LOW], - data.mModel[LLModel::LOD_IMPOSTOR], - decomp, - mUploadSkin, - mUploadJoints, - mLockScaleIfJointPosition, - LLModel::WRITE_BINARY, - false, - data.mBaseModel->mSubmodelID); - - data.mAssetData = ostr.str(); - std::string str = ostr.str(); - - res["mesh_list"][mesh_num] = LLSD::Binary(str.begin(),str.end()); - mesh_index[data.mBaseModel] = mesh_num; - mesh_num++; - } - - // For all instances that use this model - for (instance_list::iterator instance_iter = iter.second.begin(); - instance_iter != iter.second.end(); - ++instance_iter) + if (root_model == iter.first) { - - LLModelInstance& instance = *instance_iter; - - LLSD instance_entry; - - for (S32 i = 0; i < 5; i++) - { - data.mModel[i] = instance.mLOD[i]; - } - - LLVector3 pos, scale; - LLQuaternion rot; - LLMatrix4 transformation = instance.mTransform; - decomposeMeshMatrix(transformation,pos,rot,scale); - instance_entry["position"] = ll_sd_from_vector3(pos); - instance_entry["rotation"] = ll_sd_from_quaternion(rot); - instance_entry["scale"] = ll_sd_from_vector3(scale); - - instance_entry["material"] = LL_MCODE_WOOD; - instance_entry["physics_shape_type"] = data.mModel[LLModel::LOD_PHYSICS].notNull() ? (U8)(LLViewerObject::PHYSICS_SHAPE_PRIM) : (U8)(LLViewerObject::PHYSICS_SHAPE_CONVEX_HULL); - instance_entry["mesh"] = mesh_index[data.mBaseModel]; - instance_entry["mesh_name"] = instance.mLabel; - - instance_entry["face_list"] = LLSD::emptyArray(); - - // We want to be able to allow more than 8 materials... - // - S32 end = llmin((S32)data.mBaseModel->mMaterialList.size(), instance.mModel->getNumVolumeFaces()) ; - - for (S32 face_num = 0; face_num < end; face_num++) - { - // multiple faces can reuse the same material - LLImportMaterial& material = instance.mMaterial[data.mBaseModel->mMaterialList[face_num]]; - LLSD face_entry = LLSD::emptyMap(); - - LLViewerFetchedTexture *texture = NULL; - - if (material.mDiffuseMapFilename.size()) - { - texture = FindViewerTexture(material); - } - - if ((texture != NULL) && - (textures.find(texture) == textures.end())) - { - textures.insert(texture); - } - - std::stringstream texture_str; - if (texture != NULL && include_textures && mUploadTextures) - { - if (texture->hasSavedRawImage()) - { - LLImageDataLock lock(texture->getSavedRawImage()); - - LLPointer upload_file = - LLViewerTextureList::convertToUploadFile(texture->getSavedRawImage()); - - if (!upload_file.isNull() && upload_file->getDataSize() && !upload_file->isBufferInvalid()) - { - texture_str.write((const char*) upload_file->getData(), upload_file->getDataSize()); - } - } - } - - if (texture != NULL && - mUploadTextures && - texture_index.find(texture) == texture_index.end()) - { - texture_index[texture] = texture_num; - std::string str = texture_str.str(); - res["texture_list"][texture_num] = LLSD::Binary(str.begin(),str.end()); - // store indexes for error handling; - texture_list_dest.push_back(material.mDiffuseMapFilename); - texture_num++; - } - - // Subset of TextureEntry fields. - if (texture != NULL && mUploadTextures) - { - face_entry["image"] = texture_index[texture]; - face_entry["scales"] = 1.0; - face_entry["scalet"] = 1.0; - face_entry["offsets"] = 0.0; - face_entry["offsett"] = 0.0; - face_entry["imagerot"] = 0.0; - } - face_entry["diffuse_color"] = ll_sd_from_color4(material.mDiffuseColor); - face_entry["fullbright"] = material.mFullbright; - instance_entry["face_list"][face_num] = face_entry; - } - - res["instance_list"][instance_num] = instance_entry; - instance_num++; + // Reached root, root was already packed and is last non-submodel + break; } + packModelIntance( + iter.first, + iter.second, + model_name, + res, + mesh_num, + texture_num, + instance_num, + textures, + texture_index, + mesh_index, + texture_list_dest, + include_textures); } // Now handle the submodels. for (auto& iter : mInstance) { - LLMeshUploadData data; - data.mBaseModel = iter.first; - - if (!data.mBaseModel->mSubmodelID) + if (!iter.first->mSubmodelID) { // These were handled above already... - // continue; } - - LLModelInstance& first_instance = *(iter.second.begin()); - for (S32 i = 0; i < 5; i++) - { - data.mModel[i] = first_instance.mLOD[i]; - } - - if (mesh_index.find(data.mBaseModel) == mesh_index.end()) - { - // Have not seen this model before - create a new mesh_list entry for it. - if (model_name.empty()) - { - model_name = data.mBaseModel->getName(); - } - - std::stringstream ostr; - - LLModel::Decomposition& decomp = - data.mModel[LLModel::LOD_PHYSICS].notNull() ? - data.mModel[LLModel::LOD_PHYSICS]->mPhysics : - data.mBaseModel->mPhysics; - - decomp.mBaseHull = mHullMap[data.mBaseModel]; - - LLSD mesh_header = LLModel::writeModel( - ostr, - data.mModel[LLModel::LOD_PHYSICS], - data.mModel[LLModel::LOD_HIGH], - data.mModel[LLModel::LOD_MEDIUM], - data.mModel[LLModel::LOD_LOW], - data.mModel[LLModel::LOD_IMPOSTOR], - decomp, - mUploadSkin, - mUploadJoints, - mLockScaleIfJointPosition, - LLModel::WRITE_BINARY, - false, - data.mBaseModel->mSubmodelID); - - data.mAssetData = ostr.str(); - std::string str = ostr.str(); - - res["mesh_list"][mesh_num] = LLSD::Binary(str.begin(),str.end()); - mesh_index[data.mBaseModel] = mesh_num; - mesh_num++; - } - - // For all instances that use this model - for (instance_list::iterator instance_iter = iter.second.begin(); - instance_iter != iter.second.end(); - ++instance_iter) - { - - LLModelInstance& instance = *instance_iter; - - LLSD instance_entry; - - for (S32 i = 0; i < 5; i++) - { - data.mModel[i] = instance.mLOD[i]; - } - - LLVector3 pos, scale; - LLQuaternion rot; - LLMatrix4 transformation = instance.mTransform; - decomposeMeshMatrix(transformation,pos,rot,scale); - instance_entry["position"] = ll_sd_from_vector3(pos); - instance_entry["rotation"] = ll_sd_from_quaternion(rot); - instance_entry["scale"] = ll_sd_from_vector3(scale); - - instance_entry["material"] = LL_MCODE_WOOD; - instance_entry["physics_shape_type"] = (U8)(LLViewerObject::PHYSICS_SHAPE_NONE); - instance_entry["mesh"] = mesh_index[data.mBaseModel]; - - instance_entry["face_list"] = LLSD::emptyArray(); - - // We want to be able to allow more than 8 materials... - // - S32 end = llmin((S32)instance.mMaterial.size(), instance.mModel->getNumVolumeFaces()) ; - - for (S32 face_num = 0; face_num < end; face_num++) - { - LLImportMaterial& material = instance.mMaterial[data.mBaseModel->mMaterialList[face_num]]; - LLSD face_entry = LLSD::emptyMap(); - - LLViewerFetchedTexture *texture = NULL; - - if (material.mDiffuseMapFilename.size()) - { - texture = FindViewerTexture(material); - } - - if ((texture != NULL) && - (textures.find(texture) == textures.end())) - { - textures.insert(texture); - } - - std::stringstream texture_str; - if (texture != NULL && include_textures && mUploadTextures) - { - if (texture->hasSavedRawImage()) - { - LLImageDataLock lock(texture->getSavedRawImage()); - - LLPointer upload_file = - LLViewerTextureList::convertToUploadFile(texture->getSavedRawImage()); - - if (!upload_file.isNull() && upload_file->getDataSize()) - { - texture_str.write((const char*) upload_file->getData(), upload_file->getDataSize()); - } - } - } - - if (texture != NULL && - mUploadTextures && - texture_index.find(texture) == texture_index.end()) - { - texture_index[texture] = texture_num; - std::string str = texture_str.str(); - res["texture_list"][texture_num] = LLSD::Binary(str.begin(),str.end()); - texture_num++; - } - - // Subset of TextureEntry fields. - if (texture != NULL && mUploadTextures) - { - face_entry["image"] = texture_index[texture]; - face_entry["scales"] = 1.0; - face_entry["scalet"] = 1.0; - face_entry["offsets"] = 0.0; - face_entry["offsett"] = 0.0; - face_entry["imagerot"] = 0.0; - } - face_entry["diffuse_color"] = ll_sd_from_color4(material.mDiffuseColor); - face_entry["fullbright"] = material.mFullbright; - instance_entry["face_list"][face_num] = face_entry; - } - - res["instance_list"][instance_num] = instance_entry; - instance_num++; - } + packModelIntance( + iter.first, + iter.second, + model_name, + res, + mesh_num, + texture_num, + instance_num, + textures, + texture_index, + mesh_index, + texture_list_dest, + include_textures); } if (model_name.empty()) model_name = "mesh model"; @@ -3077,7 +3019,7 @@ void LLMeshUploadThread::generateHulls() { bool has_valid_requests = false ; - for (instance_map::iterator iter = mInstance.begin(); iter != mInstance.end(); ++iter) + for (instance_map_t::iterator iter = mInstance.begin(); iter != mInstance.end(); ++iter) { LLMeshUploadData data; data.mBaseModel = iter->first; @@ -3441,13 +3383,14 @@ void LLMeshRepoThread::notifyLoadedMeshes() } } - if (!mSkinInfoQ.empty() || !mSkinUnavailableQ.empty() || ! mDecompositionQ.empty()) + if (!mSkinInfoQ.empty() || !mSkinUnavailableQ.empty() || !mDecompositionQ.empty() || !mPhysicsQ.empty()) { if (mLoadedMutex->trylock()) { std::deque> skin_info_q; std::deque skin_info_unavail_q; std::list decomp_q; + std::list physics_q; if (! mSkinInfoQ.empty()) { @@ -3464,6 +3407,11 @@ void LLMeshRepoThread::notifyLoadedMeshes() decomp_q.swap(mDecompositionQ); } + if (!mPhysicsQ.empty()) + { + physics_q.swap(mPhysicsQ); + } + mLoadedMutex->unlock(); // Process the elements free of the lock @@ -3480,9 +3428,15 @@ void LLMeshRepoThread::notifyLoadedMeshes() while (! decomp_q.empty()) { - gMeshRepo.notifyDecompositionReceived(decomp_q.front()); + gMeshRepo.notifyDecompositionReceived(decomp_q.front(), false); decomp_q.pop_front(); } + + while (!physics_q.empty()) + { + gMeshRepo.notifyDecompositionReceived(physics_q.front(), true); + physics_q.pop_front(); + } } } @@ -4724,13 +4678,13 @@ void LLMeshRepository::notifySkinInfoUnavailable(const LLUUID& mesh_id) } } -void LLMeshRepository::notifyDecompositionReceived(LLModel::Decomposition* decomp) +void LLMeshRepository::notifyDecompositionReceived(LLModel::Decomposition* decomp, bool physics_mesh) { - decomposition_map::iterator iter = mDecompositionMap.find(decomp->mMeshID); + LLUUID decomp_id = decomp->mMeshID; // Copy to avoid invalidation in below deletion + decomposition_map::iterator iter = mDecompositionMap.find(decomp_id); if (iter == mDecompositionMap.end()) { //just insert decomp into map - mDecompositionMap[decomp->mMeshID] = decomp; - mLoadingDecompositions.erase(decomp->mMeshID); + mDecompositionMap[decomp_id] = decomp; sCacheBytesDecomps += decomp->sizeBytes(); } else @@ -4738,10 +4692,17 @@ void LLMeshRepository::notifyDecompositionReceived(LLModel::Decomposition* decom sCacheBytesDecomps -= iter->second->sizeBytes(); iter->second->merge(decomp); sCacheBytesDecomps += iter->second->sizeBytes(); - - mLoadingDecompositions.erase(decomp->mMeshID); delete decomp; } + + if (physics_mesh) + { + mLoadingPhysicsShapes.erase(decomp_id); + } + else + { + mLoadingDecompositions.erase(decomp_id); + } } void LLMeshRepository::notifyMeshLoaded(const LLVolumeParams& mesh_params, LLVolume* volume, S32 lod) @@ -4888,7 +4849,6 @@ void LLMeshRepository::fetchPhysicsShape(const LLUUID& mesh_id) std::unordered_set::iterator iter = mLoadingPhysicsShapes.find(mesh_id); if (iter == mLoadingPhysicsShapes.end()) { //no request pending for this skin info - // *FIXME: Nothing ever deletes entries, can't be right mLoadingPhysicsShapes.insert(mesh_id); mPendingPhysicsShapeRequests.push(mesh_id); } diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h index ab17b921d6c..01b51e753e2 100644 --- a/indra/newview/llmeshrepository.h +++ b/indra/newview/llmeshrepository.h @@ -521,6 +521,9 @@ class LLMeshRepoThread : public LLThread // list of completed Decomposition info requests std::list mDecompositionQ; + // list of completed Physics Mesh info requests + std::list mPhysicsQ; + //queue of requested headers std::queue mHeaderReqQ; @@ -668,11 +671,11 @@ class LLMeshUploadThread : public LLThread, public LLCore::HttpHandler LLPointer mFinalDecomp; volatile bool mPhysicsComplete; - typedef std::map, std::vector > hull_map; - hull_map mHullMap; + typedef std::map, std::vector > hull_map_t; + hull_map_t mHullMap; - typedef std::vector instance_list; - instance_list mInstanceList; + typedef std::vector instance_list_t; + instance_list_t mInstanceList; // Upload should happen in deterministic order, so sort instances by model name. struct LLUploadModelInstanceLess @@ -686,11 +689,11 @@ class LLMeshUploadThread : public LLThread, public LLCore::HttpHandler } // Note: probably can sort by mBaseModel->mSubmodelID here as well to avoid // running over the list twice in wholeModelToLLSD. - return a->mLabel < b->mLabel; + return a->mLabel > b->mLabel; } }; - typedef std::map, instance_list, LLUploadModelInstanceLess> instance_map; - instance_map mInstance; + typedef std::map, instance_list_t, LLUploadModelInstanceLess> instance_map_t; + instance_map_t mInstance; typedef std::map lod_sources_map_t; lod_sources_map_t mLodSources; @@ -709,7 +712,7 @@ class LLMeshUploadThread : public LLThread, public LLCore::HttpHandler std::string mWholeModelUploadURL; LLUUID mDestinationFolderId; - LLMeshUploadThread(instance_list& data, const lod_sources_map_t& sources_list, + LLMeshUploadThread(instance_list_t& data, const lod_sources_map_t& sources_list, LLVector3& scale, bool upload_textures, bool upload_skin, bool upload_joints, bool lock_scale_if_joint_position, const std::string & upload_url, @@ -745,6 +748,22 @@ class LLMeshUploadThread : public LLThread, public LLCore::HttpHandler static LLViewerFetchedTexture* FindViewerTexture(const LLImportMaterial& material); +protected: + void packModelIntance( + LLModel* model, + LLMeshUploadThread::instance_list_t& instance_list, + std::string& model_name, + LLSD& res, + S32& mesh_num, + S32& texture_num, + S32& instance_num, + std::unordered_set &textures, + std::unordered_map texture_index, + std::unordered_map& mesh_index, + std::vector& texture_list_dest, + bool include_textures + ); + private: LLHandle mFeeObserverHandle; LLHandle mUploadObserverHandle; @@ -855,7 +874,7 @@ class LLMeshRepository void notifyMeshUnavailable(const LLVolumeParams& mesh_params, S32 request_lod, S32 volume_lod); void notifySkinInfoReceived(LLMeshSkinInfo* info); void notifySkinInfoUnavailable(const LLUUID& info); - void notifyDecompositionReceived(LLModel::Decomposition* info); + void notifyDecompositionReceived(LLModel::Decomposition* info, bool physics_mesh); S32 getActualMeshLOD(const LLVolumeParams& mesh_params, S32 lod); static S32 getActualMeshLOD(LLMeshHeader& header, S32 lod); diff --git a/indra/newview/llmodelpreview.cpp b/indra/newview/llmodelpreview.cpp index e0649e1d88b..6b1fbdce4c3 100644 --- a/indra/newview/llmodelpreview.cpp +++ b/indra/newview/llmodelpreview.cpp @@ -576,7 +576,7 @@ void LLModelPreview::rebuildUploadData() for (U32 model_ind = 0; model_ind < mModel[lod].size(); ++model_ind) { bool found_model = false; - for (LLMeshUploadThread::instance_list::iterator iter = mUploadData.begin(); iter != mUploadData.end(); ++iter) + for (LLMeshUploadThread::instance_list_t::iterator iter = mUploadData.begin(); iter != mUploadData.end(); ++iter) { LLModelInstance& instance = *iter; if (instance.mLOD[lod] == mModel[lod][model_ind]) @@ -2209,7 +2209,7 @@ void LLModelPreview::updateStatusMessages() total_submeshes[i] = 0; } - for (LLMeshUploadThread::instance_list::iterator iter = mUploadData.begin(); iter != mUploadData.end(); ++iter) + for (LLMeshUploadThread::instance_list_t::iterator iter = mUploadData.begin(); iter != mUploadData.end(); ++iter) { LLModelInstance& instance = *iter; @@ -2626,7 +2626,16 @@ void LLModelPreview::updateStatusMessages() //enable = enable && !use_hull && fmp->childGetValue("physics_optimize").asBoolean(); //enable/disable "analysis" UI - LLPanel* panel = fmp->getChild("physics analysis"); +#if LL_HAVOK + LLPanel* panel = fmp->getChild("physics simplification"); + panel->setVisible(true); + + panel = fmp->getChild("physics analysis havok"); + panel->setVisible(true); +#else + LLPanel* panel = fmp->getChild("physics analysis vhacd"); + panel->setVisible(true); +#endif LLView* child = panel->getFirstChild(); while (child) { @@ -2650,6 +2659,8 @@ void LLModelPreview::updateStatusMessages() fmp->childSetVisible("simplify_cancel", false); fmp->childSetVisible("Decompose", true); fmp->childSetVisible("decompose_cancel", false); + fmp->childSetVisible("Analyze", true); + fmp->childSetVisible("analyze_cancel", false); if (phys_hulls > 0) { @@ -2659,6 +2670,7 @@ void LLModelPreview::updateStatusMessages() if (phys_tris || phys_hulls > 0) { fmp->childEnable("Decompose"); + fmp->childEnable("Analyze"); } } else @@ -3530,7 +3542,7 @@ bool LLModelPreview::render() if (!show_skin_weight) { - for (LLMeshUploadThread::instance_list::iterator iter = mUploadData.begin(); iter != mUploadData.end(); ++iter) + for (LLMeshUploadThread::instance_list_t::iterator iter = mUploadData.begin(); iter != mUploadData.end(); ++iter) { LLModelInstance& instance = *iter; @@ -3616,7 +3628,7 @@ bool LLModelPreview::render() gGL.blendFunc(LLRender::BF_SOURCE_ALPHA, LLRender::BF_ONE_MINUS_SOURCE_ALPHA); - for (LLMeshUploadThread::instance_list::iterator iter = mUploadData.begin(); iter != mUploadData.end(); ++iter) + for (LLMeshUploadThread::instance_list_t::iterator iter = mUploadData.begin(); iter != mUploadData.end(); ++iter) { LLModelInstance& instance = *iter; @@ -3738,7 +3750,7 @@ bool LLModelPreview::render() gGL.diffuseColor4f(1.f, 0.f, 0.f, 1.f); const LLVector4a scale(0.5f); - for (LLMeshUploadThread::instance_list::iterator iter = mUploadData.begin(); iter != mUploadData.end(); ++iter) + for (LLMeshUploadThread::instance_list_t::iterator iter = mUploadData.begin(); iter != mUploadData.end(); ++iter) { LLModelInstance& instance = *iter; diff --git a/indra/newview/llmodelpreview.h b/indra/newview/llmodelpreview.h index 7b3b699b33d..92ac2d1fafa 100644 --- a/indra/newview/llmodelpreview.h +++ b/indra/newview/llmodelpreview.h @@ -319,7 +319,7 @@ class LLModelPreview : public LLViewerDynamicTexture, public LLMutex, public LLH // Amount of triangles in original(base) model U32 mMaxTriangleLimit; - LLMeshUploadThread::instance_list mUploadData; + LLMeshUploadThread::instance_list_t mUploadData; std::set mTextureSet; LLLoadedCallbackEntry::source_callback_list_t mCallbackTextureList; diff --git a/indra/newview/llnotificationlistitem.cpp b/indra/newview/llnotificationlistitem.cpp index 5b8b28ebe60..9a33bcb1b96 100644 --- a/indra/newview/llnotificationlistitem.cpp +++ b/indra/newview/llnotificationlistitem.cpp @@ -38,6 +38,7 @@ #include "lluicolortable.h" #include "message.h" #include "llnotificationsutil.h" +#include "llviewercontrol.h" #include LLNotificationListItem::LLNotificationListItem(const Params& p) : LLPanel(p), @@ -133,10 +134,22 @@ std::string LLNotificationListItem::buildNotificationDate(const LLDate& time_sta default: timeStr = "[" + LLTrans::getString("TimeMonth") + "]/[" +LLTrans::getString("TimeDay")+"]/[" - +LLTrans::getString("TimeYear")+"] [" - +LLTrans::getString("TimeHour")+"]:[" - +LLTrans::getString("TimeMin")+"] [" - +LLTrans::getString("TimeTimezone")+"]"; + +LLTrans::getString("TimeYear")+"] ["; + + static bool use_24h = gSavedSettings.getBOOL("Use24HourClock"); + if (use_24h) + { + timeStr += LLTrans::getString("TimeHour") + "]:[" + + LLTrans::getString("TimeMin") + "] [" + + LLTrans::getString("TimeTimezone") + "]"; + } + else + { + timeStr += LLTrans::getString("TimeHour12") + "]:[" + + LLTrans::getString("TimeMin") + "] [" + + LLTrans::getString("TimeAMPM") + "] [" + + LLTrans::getString("TimeTimezone") + "]"; + } break; } LLSD substitution; diff --git a/indra/newview/lloutfitgallery.cpp b/indra/newview/lloutfitgallery.cpp index 3adee9fa165..8589afae06f 100644 --- a/indra/newview/lloutfitgallery.cpp +++ b/indra/newview/lloutfitgallery.cpp @@ -818,6 +818,7 @@ void LLOutfitGallery::getCurrentCategories(uuid_vec_t& vcur) void LLOutfitGallery::updateAddedCategory(LLUUID cat_id) { + LL_PROFILE_ZONE_SCOPED; LLViewerInventoryCategory *cat = gInventory.getCategory(cat_id); if (!cat) return; diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp index 4e594af432d..58cd9fab834 100644 --- a/indra/newview/lloutfitslist.cpp +++ b/indra/newview/lloutfitslist.cpp @@ -181,6 +181,7 @@ void LLOutfitsList::onOpen(const LLSD& info) void LLOutfitsList::updateAddedCategory(LLUUID cat_id) { + LL_PROFILE_ZONE_SCOPED; LLViewerInventoryCategory *cat = gInventory.getCategory(cat_id); if (!cat) return; @@ -251,7 +252,9 @@ void LLOutfitsList::updateAddedCategory(LLUUID cat_id) if (AISAPI::isAvailable() && LLInventoryModelBackgroundFetch::instance().folderFetchActive()) { - // for reliability just fetch it whole, linked items included + // For reliability just fetch it whole, linked items included + // Todo: list is not warrantied to exist once callback arrives + // Fix it! LLInventoryModelBackgroundFetch::instance().fetchFolderAndLinks(cat_id, [cat_id, list] { if (list) @@ -1059,6 +1062,7 @@ void LLOutfitListBase::onIdle(void* userdata) void LLOutfitListBase::onIdleRefreshList() { + LL_PROFILE_ZONE_SCOPED; if (LLAppViewer::instance()->quitRequested()) { mRefreshListState.CategoryUUID.setNull(); @@ -1072,7 +1076,7 @@ void LLOutfitListBase::onIdleRefreshList() return; } - const F64 MAX_TIME = 0.05f; + const F64 MAX_TIME = 0.005f; F64 curent_time = LLTimer::getTotalSeconds(); const F64 end_time = curent_time + MAX_TIME; diff --git a/indra/newview/llpanelcontents.cpp b/indra/newview/llpanelcontents.cpp index 7910bcb41db..bc99899c270 100644 --- a/indra/newview/llpanelcontents.cpp +++ b/indra/newview/llpanelcontents.cpp @@ -60,6 +60,7 @@ #include "llviewerwindow.h" #include "llworld.h" #include "llfloaterperms.h" +#include "llviewerassetupload.h" // // Imported globals @@ -220,12 +221,25 @@ void LLPanelContents::clearContents() // Static functions // +// See below comment in `onClickNewScript()` about this hack :( +static const std::string DEFAULT_SLUA_SCRIPT = R"( +function LLEvents.touch_start(detected) + ll.Say(0, "Touched.") +end + +local function main() + print("Hello, Avatar!") +end + +main() +)"; + // static void LLPanelContents::onClickNewScript(void *userdata) { const bool children_ok = true; LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getFirstRootObject(children_ok); - if(object) + if (object) { LLPermissions perm; perm.init(gAgent.getID(), gAgent.getID(), LLUUID::null, LLUUID::null); @@ -239,6 +253,101 @@ void LLPanelContents::onClickNewScript(void *userdata) PERM_MOVE | LLFloaterPerms::getNextOwnerPerms("Scripts")); std::string desc; LLViewerAssetType::generateDescriptionFor(LLAssetType::AT_LSL_TEXT, desc); + + // -------------------------------------------------------------------------------------------------- + // Begin hack + // + // The current state of the server doesn't allow specifying a default script template, + // so we have to update its code immediately after creation instead. + // + // Moreover, _PREHASH_RezScript has more complex server-side logic than _PREHASH_CreateInventoryItem, + // which changes the item's attributes, such as its name and UUID. The simplest way to mitigate this + // is to create a temporary item in the user's inventory, modify it as in create_inventory_item()'s + // callback, and then call _PREHASH_RezScript to move it into the object's inventory. + // + // This temporary workaround should be removed after a server-side fix. + // See https://github.com/secondlife/viewer/issues/3731 for more information. + // + LLViewerRegion* region = object->getRegion(); + if (region && region->simulatorFeaturesReceived()) + { + LLSD simulatorFeatures; + region->getSimulatorFeatures(simulatorFeatures); + if (simulatorFeatures["LuaScriptsEnabled"].asBoolean()) + { + if (std::string::size_type pos = desc.find("lsl2"); pos != std::string::npos) + { + desc.replace(pos, 4, "SLua"); + } + + auto scriptCreationCallback = [object](const LLUUID& inv_item) + { + if (!inv_item.isNull()) + { + LLViewerInventoryItem* item = gInventory.getItem(inv_item); + if (item) + { + auto scriptUploadFinished = [object, item](LLUUID itemId, LLUUID newAssetId, LLUUID newItemId, LLSD response) + { + LLPointer new_script = new LLViewerInventoryItem(item); + object->saveScript(new_script, true, true); + + // Delete the temporary item from the user's inventory after rezzing it in the object's inventory + ms_sleep(50); + LLMessageSystem* msg = gMessageSystem; + msg->newMessageFast(_PREHASH_RemoveInventoryItem); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + msg->nextBlockFast(_PREHASH_InventoryData); + msg->addUUIDFast(_PREHASH_ItemID, item->getUUID()); + gAgent.sendReliableMessage(); + + gInventory.deleteObject(item->getUUID()); + gInventory.notifyObservers(); + }; + + std::string url = gAgent.getRegion()->getCapability("UpdateScriptAgent"); + if (!url.empty()) + { + LLResourceUploadInfo::ptr_t uploadInfo(std::make_shared( + item->getUUID(), + "luau", + DEFAULT_SLUA_SCRIPT, + scriptUploadFinished, + nullptr)); + + LLViewerAssetUpload::EnqueueInventoryUpload(url, uploadInfo); + } + } + } + }; + LLPointer cb = new LLBoostFuncInventoryCallback(scriptCreationCallback); + + LLMessageSystem* msg = gMessageSystem; + msg->newMessageFast(_PREHASH_CreateInventoryItem); + msg->nextBlock(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + msg->nextBlock(_PREHASH_InventoryBlock); + msg->addU32Fast(_PREHASH_CallbackID, gInventoryCallbacks.registerCB(cb)); + msg->addUUIDFast(_PREHASH_FolderID, gInventory.getRootFolderID()); + msg->addUUIDFast(_PREHASH_TransactionID, LLTransactionID::tnull); + msg->addU32Fast(_PREHASH_NextOwnerMask, PERM_MOVE | PERM_TRANSFER); + msg->addS8Fast(_PREHASH_Type, LLAssetType::AT_LSL_TEXT); + msg->addS8Fast(_PREHASH_InvType, LLInventoryType::IT_LSL); + msg->addU8Fast(_PREHASH_WearableType, NO_INV_SUBTYPE); + msg->addStringFast(_PREHASH_Name, "New Script"); + msg->addStringFast(_PREHASH_Description, desc); + + gAgent.sendReliableMessage(); + return; + } + } + // + // End hack + // -------------------------------------------------------------------------------------------------- + LLPointer new_item = new LLViewerInventoryItem( LLUUID::null, diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index 3ab48f69c81..182b6489147 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -4721,7 +4721,6 @@ void LLPanelFace::onPasteTexture(LLViewerObject* objectp, S32 te) if (allow) { objectp->setRenderMaterialID(te, te_data["te"]["pbr"].asUUID(), false /*managing our own update*/); - tep->setGLTFRenderMaterial(nullptr); tep->setGLTFMaterialOverride(nullptr); if (te_data["te"].has("pbr_override")) @@ -4737,7 +4736,6 @@ void LLPanelFace::onPasteTexture(LLViewerObject* objectp, S32 te) else { objectp->setRenderMaterialID(te, LLUUID::null, false /*send in bulk later*/ ); - tep->setGLTFRenderMaterial(nullptr); tep->setGLTFMaterialOverride(nullptr); // blank out most override data on the server diff --git a/indra/newview/llpanellandmarkinfo.cpp b/indra/newview/llpanellandmarkinfo.cpp index 41373cd7f57..7596c0eba84 100644 --- a/indra/newview/llpanellandmarkinfo.cpp +++ b/indra/newview/llpanellandmarkinfo.cpp @@ -41,6 +41,7 @@ #include "lllandmarkactions.h" #include "llparcel.h" #include "llslurl.h" +#include "llviewercontrol.h" #include "llviewerinventory.h" #include "llviewerparcelmgr.h" #include "llviewerregion.h" @@ -326,7 +327,8 @@ void LLPanelLandmarkInfo::displayItemInfo(const LLInventoryItem* pItem) } else { - std::string timeStr = getString("acquired_date"); + static bool use_24h = gSavedSettings.getBOOL("Use24HourClock"); + std::string timeStr = use_24h ? getString("acquired_date") : getString("acquired_date_ampm"); LLSD substitution; substitution["datetime"] = (S32) time_utc; LLStringUtil::format (timeStr, substitution); diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index f90d6d5b3f6..a31a54bb670 100644 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -385,10 +385,7 @@ bool LLTaskInvFVBridge::removeItem() return true; } - LLSD payload; - payload["task_id"] = mPanel->getTaskUUID(); - payload["inventory_ids"].append(mUUID); - LLNotificationsUtil::add("RemoveItemWarn", LLSD(), payload, boost::bind(&remove_task_inventory_callback, _1, _2, mPanel)); + LLNotificationsUtil::add("CantModifyContentInNoModTask"); return false; } } @@ -411,13 +408,7 @@ void LLTaskInvFVBridge::removeBatch(std::vector& batch) if (!object->permModify()) { - LLSD payload; - payload["task_id"] = mPanel->getTaskUUID(); - for (LLFolderViewModelItem* item : batch) - { - payload["inventory_ids"].append(((LLTaskInvFVBridge*)item)->getUUID()); - } - LLNotificationsUtil::add("RemoveItemWarn", LLSD(), payload, boost::bind(&remove_task_inventory_callback, _1, _2, mPanel)); + LLNotificationsUtil::add("CantModifyContentInNoModTask"); } else { diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index b77ee2f4395..6ea9cd2b92f 100644 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -859,7 +859,7 @@ void LLPanelProfileSecondLife::resetData() resetLoading(); // Set default image and 1:1 dimensions for it - mSecondLifePic->setValue("Generic_Person_Large"); + mSecondLifePic->setValue(LLUUID()); LLRect imageRect = mSecondLifePicLayout->getRect(); mSecondLifePicLayout->reshape(imageRect.getWidth(), imageRect.getWidth()); diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp index 902412d359d..bfdfa68e01e 100644 --- a/indra/newview/llpanelteleporthistory.cpp +++ b/indra/newview/llpanelteleporthistory.cpp @@ -42,6 +42,7 @@ #include "llnotificationsutil.h" #include "lltextbox.h" #include "lltoggleablemenu.h" +#include "llviewercontrol.h" #include "llviewermenu.h" #include "lllandmarkactions.h" #include "llclipboard.h" @@ -215,8 +216,18 @@ std::string LLTeleportHistoryFlatItem::getTimestamp() // Only show timestamp for today and yesterday if(time_diff < seconds_today + seconds_in_day) { - timestamp = "[" + LLTrans::getString("TimeHour12")+"]:[" - + LLTrans::getString("TimeMin")+"] ["+ LLTrans::getString("TimeAMPM")+"]"; + static bool use_24h = gSavedSettings.getBOOL("Use24HourClock"); + if (use_24h) + { + timestamp = "[" + LLTrans::getString("TimeHour") + "]:[" + + LLTrans::getString("TimeMin") + "]"; + } + else + { + timestamp = "[" + LLTrans::getString("TimeHour12") + "]:[" + + LLTrans::getString("TimeMin") + "] [" + LLTrans::getString("TimeAMPM") + "]"; + } + LLSD substitution; substitution["datetime"] = (S32) date.secondsSinceEpoch(); LLStringUtil::format(timestamp, substitution); diff --git a/indra/newview/llpanelvoicedevicesettings.cpp b/indra/newview/llpanelvoicedevicesettings.cpp index 60877494e75..d8d6bcf5fd5 100644 --- a/indra/newview/llpanelvoicedevicesettings.cpp +++ b/indra/newview/llpanelvoicedevicesettings.cpp @@ -240,13 +240,38 @@ void LLPanelVoiceDeviceSettings::refresh() if(mCtrlInputDevices) { mCtrlInputDevices->removeall(); - mCtrlInputDevices->add(getLocalizedDeviceName(mInputDevice), mInputDevice, ADD_BOTTOM); + auto it = mLocalizedDeviceNames.find(mInputDevice); + if (it != mLocalizedDeviceNames.end()) + { + mCtrlInputDevices->add(getLocalizedDeviceName(mInputDevice), mInputDevice, ADD_BOTTOM); + } + else + { + // Display name generaly doesn't match value. + // Value is an id so it's not nessesary readable, + // might not even be valid (disconnected usb). + // Until we get the data, don't change the device, + // otherwise box might override the control. + // But show a readable placeholder. + // Combo is disabled so it's safe to show + // a placeholder. + mCtrlInputDevices->add(getString("device_not_loaded"), mInputDevice, ADD_BOTTOM); + } mCtrlInputDevices->setValue(mInputDevice); } if(mCtrlOutputDevices) { mCtrlOutputDevices->removeall(); - mCtrlOutputDevices->add(getLocalizedDeviceName(mOutputDevice), mOutputDevice, ADD_BOTTOM); + auto it = mLocalizedDeviceNames.find(mOutputDevice); + if (it != mLocalizedDeviceNames.end()) + { + mCtrlOutputDevices->add(getLocalizedDeviceName(mOutputDevice), mOutputDevice, ADD_BOTTOM); + } + else + { + // Don't change the device, only the label + mCtrlOutputDevices->add(getString("device_not_loaded"), mOutputDevice, ADD_BOTTOM); + } mCtrlOutputDevices->setValue(mOutputDevice); } } diff --git a/indra/newview/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp index 2fbdbeaf590..5916163f601 100644 --- a/indra/newview/llpanelvolume.cpp +++ b/indra/newview/llpanelvolume.cpp @@ -582,7 +582,7 @@ void LLPanelVolume::getState( ) bool enable_material = editable && single_volume && material_same; LLCachedControl edit_linked(gSavedSettings, "EditLinkedParts", false); - if (!enable_material && !edit_linked()) + if (!enable_material) { LLViewerObject* root = selection->getPrimaryObject(); while (root && !root->isAvatar() && root->getParent()) @@ -592,6 +592,10 @@ void LLPanelVolume::getState( ) { break; } + if (!parent->isSelected()) + { + break; + } root = parent; } if (root) diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index c2aa4925bd8..b3e53df6d88 100644 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -53,6 +53,7 @@ #include "llslider.h" #include "lltooldraganddrop.h" #include "llfilesystem.h" +#include "lllogchat.h" #include "llagent.h" #include "llmenugl.h" @@ -64,22 +65,12 @@ #include "llviewerobject.h" #include "llviewerobjectlist.h" #include "llviewerregion.h" -#include "llkeyboard.h" -#include "llscrollcontainer.h" -#include "llcheckboxctrl.h" #include "llscripteditor.h" -#include "llselectmgr.h" -#include "lltooldraganddrop.h" -#include "llscrolllistctrl.h" #include "lltextbox.h" -#include "llslider.h" -#include "lldir.h" -#include "llcombobox.h" #include "llviewerstats.h" #include "llviewerwindow.h" #include "lluictrlfactory.h" #include "llmediactrl.h" -#include "lluictrlfactory.h" #include "lltrans.h" #include "llviewercontrol.h" #include "llappviewer.h" @@ -90,20 +81,10 @@ #include "lltoggleablemenu.h" #include "llmenubutton.h" #include "llinventoryfunctions.h" +#include "llwebsocketmgr.h" +#include "llscripteditorws.h" +#include -const std::string HELLO_LSL = - "default\n" - "{\n" - " state_entry()\n" - " {\n" - " llSay(0, \"Hello, Avatar!\");\n" - " }\n" - "\n" - " touch_start(integer total_number)\n" - " {\n" - " llSay(0, \"Touched.\");\n" - " }\n" - "}\n"; const std::string HELP_LSL_PORTAL_TOPIC = "LSL_Portal"; const std::string DEFAULT_SCRIPT_NAME = "New Script"; // *TODO:Translate? @@ -119,6 +100,42 @@ static bool have_script_upload_cap(LLUUID& object_id) return object && (! object->getRegion()->getCapability("UpdateScriptTask").empty()); } +static bool have_lua_enabled(const LLUUID& object_id) +{ + LLViewerRegion* region = nullptr; + LLViewerObject* object = gObjectList.findObject(object_id); + if (object) + { + region = object->getRegion(); + } + else + { + region = gAgent.getRegion(); + } + + if (region && region->simulatorFeaturesReceived()) + { + LLSD simulatorFeatures; + region->getSimulatorFeatures(simulatorFeatures); + return simulatorFeatures["LuaScriptsEnabled"].asBoolean(); + } + + return false; +} + +// TEMPORARY: Quick check to see if the code is Lua +// since we don't have another way to determine the language yet +static bool is_lua_script(const std::string& code) +{ + // Check for LSL's signature "default" state pattern + std::regex lsl_pattern("\\s*default\\s*\\{"); + if (std::regex_search(code, lsl_pattern)) + return false; + + // "default" state not found, assuming it's Lua + return true; +} + /// --------------------------------------------------------------------------- /// LLLiveLSLFile /// --------------------------------------------------------------------------- @@ -373,9 +390,9 @@ LLScriptEdCore::LLScriptEdCore( LLScriptEdContainer* container, const std::string& sample, const LLHandle& floater_handle, - void (*load_callback)(void*), - void (*save_callback)(void*, bool), - void (*search_replace_callback) (void* userdata), + script_ed_callback_t load_callback, + save_callback_t save_callback, + script_ed_callback_t search_replace_callback, void* userdata, bool live, S32 bottom_pad) @@ -391,7 +408,6 @@ LLScriptEdCore::LLScriptEdCore( mLastHelpToken(NULL), mLiveHelpHistorySize(0), mEnableSave(false), - mLiveFile(NULL), mLive(live), mContainer(container), mHasScriptData(false), @@ -423,7 +439,6 @@ LLScriptEdCore::~LLScriptEdCore() } } - delete mLiveFile; if (mSyntaxIDConnection.connected()) { mSyntaxIDConnection.disconnect(); @@ -441,42 +456,37 @@ void LLLiveLSLEditor::experienceChanged() } } -void LLLiveLSLEditor::onViewProfile( LLUICtrl *ui, void* userdata ) +void LLLiveLSLEditor::onViewProfile() { - LLLiveLSLEditor* self = (LLLiveLSLEditor*)userdata; - - LLUUID id; - if(self->mExperienceEnabled->get()) + if (mExperienceEnabled->get()) { - id=self->mScriptEd->getAssociatedExperience(); - if(id.notNull()) + LLUUID id = mScriptEd->getAssociatedExperience(); + if (id.notNull()) { LLFloaterReg::showInstance("experience_profile", id, true); } } - } -void LLLiveLSLEditor::onToggleExperience( LLUICtrl *ui, void* userdata ) +void LLLiveLSLEditor::onToggleExperience() { - LLLiveLSLEditor* self = (LLLiveLSLEditor*)userdata; - LLUUID id; - if(self->mExperienceEnabled->get()) + if (mExperienceEnabled->get()) { - if(self->mScriptEd->getAssociatedExperience().isNull()) + if (mScriptEd->getAssociatedExperience().isNull()) { - id=self->mExperienceIds.beginArray()->asUUID(); + id = mExperienceIds.beginArray()->asUUID(); } } - if(id != self->mScriptEd->getAssociatedExperience()) + if (id != mScriptEd->getAssociatedExperience()) { - self->mScriptEd->enableSave(self->getIsModifiable()); + mScriptEd->enableSave(getIsModifiable()); } - self->mScriptEd->setAssociatedExperience(id); - self->updateExperiencePanel(); + mScriptEd->setAssociatedExperience(id); + + updateExperiencePanel(); } bool LLScriptEdCore::postBuild() @@ -501,6 +511,7 @@ bool LLScriptEdCore::postBuild() // Intialise keyword highlighting for the current simulator's version of LSL LLSyntaxIdLSL::getInstance()->initialize(); + LLSyntaxLua::getInstance()->initialize(); processKeywords(); mCommitCallbackRegistrar.add("FontSize.Set", boost::bind(&LLScriptEdCore::onChangeFontSize, this, _2)); @@ -510,14 +521,31 @@ bool LLScriptEdCore::postBuild() "menu_lsl_font_size.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); getChild("font_btn")->setMenu(context_menu, LLMenuButton::MP_BOTTOM_LEFT, true); + + bool lua_scripts_enabled = have_lua_enabled(LLUUID::null); + mCompileTarget = getChild("compile_target"); + if (LLScrollListItem* luau_item = mCompileTarget->findItemByValue("luau")) + { + luau_item->setEnabled(lua_scripts_enabled); + } + if (LLScrollListItem* lsl_luau_item = mCompileTarget->findItemByValue("lsl-luau")) + { + lsl_luau_item->setEnabled(lua_scripts_enabled); + } + return true; } void LLScriptEdCore::processKeywords() +{ + processKeywords(mEditor->getIsLuauLanguage()); +} + +void LLScriptEdCore::processKeywords(bool luau_language) { LL_DEBUGS("SyntaxLSL") << "Processing keywords" << LL_ENDL; mEditor->clearSegments(); - mEditor->initKeywords(); + mEditor->initKeywords(luau_language); mEditor->loadKeywords(); string_vec_t primary_keywords; @@ -536,6 +564,8 @@ void LLScriptEdCore::processKeywords() secondary_keywords.push_back( wstring_to_utf8str(token->getToken()) ); } } + + mFunctions->removeall(); for (string_vec_t::const_iterator iter = primary_keywords.begin(); iter!= primary_keywords.end(); ++iter) { @@ -691,13 +721,13 @@ bool LLScriptEdCore::writeToFile(const std::string& filename) void LLScriptEdCore::sync() { // Sync with external editor. - if (mLiveFile) + if (mContainer->mLiveFile) { - std::string tmp_file = mLiveFile->filename(); + std::string tmp_file = mContainer->mLiveFile->filename(); llstat s; if (LLFile::stat(tmp_file, &s) == 0) // file exists { - mLiveFile->ignoreNextUpdate(); + mContainer->mLiveFile->ignoreNextUpdate(); writeToFile(tmp_file); } } @@ -1083,15 +1113,21 @@ void LLScriptEdCore::doSave( bool close_after_save ) void LLScriptEdCore::openInExternalEditor() { - delete mLiveFile; // deletes file + //if (mContainer->mLiveFile) + //{ + // // If already open in an external editor, just return + // return; + //} // Generate a suitable filename std::string script_name = mScriptName; - std::string forbidden_chars = "<>:\"\\/|?*"; - for (std::string::iterator c = forbidden_chars.begin(); c != forbidden_chars.end(); c++) - { - script_name.erase(std::remove(script_name.begin(), script_name.end(), *c), script_name.end()); - } + + static const std::set forbidden_chars{ '<', '>', ':', '"', '\\', '/', '|', '?', '*' }; + script_name.erase( + std::remove_if(script_name.begin(), script_name.end(), [](char c) { + return forbidden_chars.contains(c); + }), script_name.end()); + std::string filename = mContainer->getTmpFileName(script_name); // Save the script to a temporary file. @@ -1105,9 +1141,18 @@ void LLScriptEdCore::openInExternalEditor() writeToFile(filename); } + if (mContainer->mLiveFile && mContainer->mLiveFile->filename() != filename) + { // The name may have changed if we changed the type of scipt being edited. + delete mContainer->mLiveFile; + mContainer->mLiveFile = NULL; + } // Start watching file changes. - mLiveFile = new LLLiveLSLFile(filename, boost::bind(&LLScriptEdContainer::onExternalChange, mContainer, _1)); - mLiveFile->addToEventTimer(); + if (!mContainer->mLiveFile) + { + mContainer->mLiveFile = new LLLiveLSLFile(filename, boost::bind(&LLScriptEdContainer::onExternalChange, mContainer, _1)); + mContainer->mLiveFile->addToEventTimer(); + } + mContainer->startWebsocketServer(); // Open it in external editor. { @@ -1376,15 +1421,15 @@ void LLLiveLSLEditor::updateExperiencePanel() mExperienceEnabled->setEnabled(false); mExperienceEnabled->setToolTip(getString("no_experiences")); } - getChild("view_profile")->setVisible(false); + mViewProfileButton->setVisible(false); } else { mExperienceEnabled->setToolTip(getString("experience_enabled")); mExperienceEnabled->setEnabled(getIsModifiable()); - mExperiences->setVisible(true); mExperienceEnabled->set(true); - getChild("view_profile")->setToolTip(getString("show_experience_profile")); + mExperiences->setVisible(true); + mViewProfileButton->setToolTip(getString("show_experience_profile")); buildExperienceList(); } } @@ -1453,7 +1498,7 @@ void LLLiveLSLEditor::buildExperienceList() mExperiences->setEnabled(true); mExperiences->sortByName(true); mExperiences->setCurrentByIndex(mExperiences->getCurrentIndex()); - getChild("view_profile")->setVisible(true); + mViewProfileButton->setVisible(true); } } @@ -1463,8 +1508,6 @@ void LLScriptEdCore::setAssociatedExperience( const LLUUID& experience_id ) mAssociatedExperience = experience_id; } - - void LLLiveLSLEditor::requestExperiences() { if (!getIsModifiable()) @@ -1503,11 +1546,42 @@ void LLLiveLSLEditor::receiveExperienceIds(LLSD result, LLHandlemEditor->getIsLuauLanguage() ? ".luau" : ".lsl"; + + if (script_name.empty()) + { + return std::string(LLFile::tmpdir()) + "sl_script_" + script_id_hash_str + script_extension; + } + else + { + return std::string(LLFile::tmpdir()) + "sl_script_" + script_name + "_" + script_id_hash_str + script_extension; + } +} + +std::string LLScriptEdContainer::getUniqueHash() const { // Take script inventory item id (within the object inventory) // to consideration so that it's possible to edit multiple scripts @@ -1515,18 +1589,65 @@ std::string LLScriptEdContainer::getTmpFileName(const std::string& script_name) std::string script_id = mObjectUUID.asString() + "_" + mItemUUID.asString(); // Use MD5 sum to make the file name shorter and not exceed maximum path length. - char script_id_hash_str[33]; /* Flawfinder: ignore */ - LLMD5 script_id_hash((const U8 *)script_id.c_str()); + char script_id_hash_str[33]; /* Flawfinder: ignore */ + LLMD5 script_id_hash((const U8*)script_id.c_str()); script_id_hash.hex_digest(script_id_hash_str); - if (script_name.empty()) + return std::string(script_id_hash_str); +} + +std::string LLScriptEdContainer::getErrorLogFileName(const std::string& script_path) +{ + if (script_path.empty()) { - return std::string(LLFile::tmpdir()) + "sl_script_" + script_id_hash_str + ".lsl"; + return std::string(); } - else + + return script_path + ".log"; +} + +bool LLScriptEdContainer::logErrorsToFile(const LLSD& compile_errors) +{ + if (!isOpenInExternalEditor()) + { + return false; + } + + std::string script_path = getTmpFileName(mScriptEd->mScriptName); + std::string log_path = getErrorLogFileName(script_path); + + llofstream file(log_path.c_str()); + if (!file.is_open()) + { + LL_WARNS() << "Unable to open error log file: " << log_path << LL_ENDL; + return false; + } + + // Write timestamp + std::string timestamp = LLLogChat::timestamp2LogString(0, true); + file << "// " << timestamp << "\n\n"; + + // Write errors + for (LLSD::array_const_iterator line = compile_errors.beginArray(); + line < compile_errors.endArray(); + line++) + { + std::string error_message = line->asString(); + LLStringUtil::stripNonprintable(error_message); + file << error_message << "\n"; + } + + file.close(); + + // Create a log file handler if we don't already have one, + // this is needed to delete the temporary log file properly + if (!mLiveLogFile && !log_path.empty()) { - return std::string(LLFile::tmpdir()) + "sl_script_" + script_name + "_" + script_id_hash_str + ".lsl"; + // Empty callback since we don't need to react to file changes + mLiveLogFile = new LLLiveLSLFile(log_path, [](const std::string& filename) { return true; }); } + + return true; } bool LLScriptEdContainer::onExternalChange(const std::string& filename) @@ -1556,6 +1677,63 @@ bool LLScriptEdContainer::handleKeyHere(KEY key, MASK mask) return true; } +void LLScriptEdContainer::startWebsocketServer() +{ + if (gSavedSettings.getBOOL("ExternalWebsocketSyncEnable")) + { + // Attempt to find an existing server + LLWebsocketMgr& wsmgr = LLWebsocketMgr::instance(); + LLScriptEditorWSServer::ptr_t server = + std::static_pointer_cast( + wsmgr.findServerByName(LLScriptEditorWSServer::DEFAULT_SERVER_NAME)); + + if (!server) + { // We couldn't find one, so create it + U16 server_port = static_cast(gSavedSettings.getS32("ExternalWebsocketSyncPort")); + bool server_localhost = gSavedSettings.getBOOL("ExternalWebsocketSyncLocal"); + server = std::make_shared(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(LLScriptEditorWSServer::DEFAULT_SERVER_NAME); + } + + if (!is_running && !server->isRunning()) + { // Failed to start the server + LL_WARNS() << "Failed to start script editor websocket server" << LL_ENDL; + return; + } + + std::string script_id_hash_str(getUniqueHash()); + server->subscribeScriptEditor(mObjectUUID, mItemUUID, mScriptEd->mScriptName, getHandle(), script_id_hash_str); + mWebSocketServer = server; + } +} + +void LLScriptEdContainer::unsubscribeScript() +{ + auto server = mWebSocketServer.lock(); + if (server) + { + std::string script_id_hash_str(getUniqueHash()); + server->sendUnsubscribeScriptEditor(script_id_hash_str); + server->unsubscribeEditor(script_id_hash_str); + } +} + +void LLScriptEdContainer::sendCompileResults(LLSD& params) +{ + auto server = mWebSocketServer.lock(); + if (server) + { + std::string script_id_hash_str(getUniqueHash()); + server->sendCompileResults(script_id_hash_str, params); + } +} + /// --------------------------------------------------------------------------- /// LLPreviewLSL /// --------------------------------------------------------------------------- @@ -1580,7 +1758,7 @@ void* LLPreviewLSL::createScriptEdPanel(void* userdata) self->mScriptEd = new LLScriptEdCore( self, - HELLO_LSL, + std::string(), self->getHandle(), LLPreviewLSL::onLoad, LLPreviewLSL::onSave, @@ -1624,6 +1802,9 @@ bool LLPreviewLSL::postBuild() childSetCommitCallback("desc", LLPreview::onText, this); getChild("desc")->setPrevalidate(&LLTextValidate::validateASCIIPrintableNoPipe); + mScriptEd->mCompileTarget = getChild("compile_target"); + mScriptEd->mCompileTarget->setCommitCallback([&](LLUICtrl*, const LLSD&) { onCompileTargetChanged(); }); + return LLPreview::postBuild(); } @@ -1649,6 +1830,15 @@ void LLPreviewLSL::callbackLSLCompileSucceeded() LL_INFOS() << "LSL Bytecode saved" << LL_ENDL; mScriptEd->mErrorList->setCommentText(LLTrans::getString("CompileSuccessful")); mScriptEd->mErrorList->setCommentText(LLTrans::getString("SaveComplete")); + + if (isOpenInExternalEditor()) + { + LLSD success_msg; + success_msg.append(LLTrans::getString("CompileSuccessful")); + success_msg.append(LLTrans::getString("SaveComplete")); + logErrorsToFile(success_msg); + } + closeIfNeeded(); } @@ -1668,6 +1858,12 @@ void LLPreviewLSL::callbackLSLCompileFailed(const LLSD& compile_errors) row["columns"][0]["font"] = "OCRA"; mScriptEd->mErrorList->addElement(row); } + + if (isOpenInExternalEditor()) + { + logErrorsToFile(compile_errors); + } + mScriptEd->selectFirstError(); closeIfNeeded(); } @@ -1718,12 +1914,6 @@ void LLPreviewLSL::loadAsset() getChildView("lock")->setVisible( !is_modifiable); mScriptEd->getChildView("Insert...")->setEnabled(is_modifiable); } - else - { - mScriptEd->setScriptText(std::string(HELLO_LSL), true); - mScriptEd->setEnableEditing(true); - mAssetStatus = PREVIEW_ASSET_LOADED; - } } @@ -1781,6 +1971,7 @@ void LLPreviewLSL::finishedLSLUpload(LLUUID itemId, LLSD response) { preview->callbackLSLCompileFailed(response["errors"]); } + preview->sendCompileResults(response); } } @@ -1804,6 +1995,12 @@ bool LLPreviewLSL::failedLSLUpload(LLUUID itemId, LLUUID taskId, LLSD response, LLSD errors; errors.append(LLTrans::getString("UploadFailed") + reason); preview->callbackLSLCompileFailed(errors); + + LLSD message; + message["compiled"] = false; + message["errors"] = errors; + preview->sendCompileResults(message); + return true; } @@ -1839,11 +2036,12 @@ void LLPreviewLSL::saveIfNeeded(bool sync /*= true*/) mPendingUploads++; if (!url.empty()) { + std::string compile_target(mScriptEd->mCompileTarget->getValue()); std::string buffer(mScriptEd->mEditor->getText()); LLUUID old_asset_id = inv_item->getAssetUUID().isNull() ? mScriptEd->getAssetID() : inv_item->getAssetUUID(); - LLResourceUploadInfo::ptr_t uploadInfo(std::make_shared(mItemUUID, buffer, + LLResourceUploadInfo::ptr_t uploadInfo(std::make_shared(mItemUUID, compile_target, buffer, [old_asset_id](LLUUID itemId, LLUUID, LLUUID, LLSD response) { LLFileSystem::removeFile(old_asset_id, LLAssetType::AT_LSL_TEXT); LLPreviewLSL::finishedLSLUpload(itemId, response); @@ -1855,6 +2053,11 @@ void LLPreviewLSL::saveIfNeeded(bool sync /*= true*/) } } +void LLPreviewLSL::onCompileTargetChanged() +{ + mScriptEd->processKeywords(mScriptEd->mCompileTarget->getValue().asString() == "luau"); +} + // static void LLPreviewLSL::onLoadComplete(const LLUUID& asset_uuid, LLAssetType::EType type, void* user_data, S32 status, LLExtStat ext_status) @@ -1896,6 +2099,12 @@ void LLPreviewLSL::onLoadComplete(const LLUUID& asset_uuid, LLAssetType::EType t preview->mScriptEd->setEnableEditing(is_modifiable); preview->mScriptEd->setAssetID(asset_uuid); preview->mAssetStatus = PREVIEW_ASSET_LOADED; + + // Temporary hack to determine if the script is LSL or SLua when loaded from the inventory. + bool is_lua = is_lua_script(std::string(buffer.begin(), buffer.end())); + preview->mScriptEd->mEditor->setLuauLanguage(is_lua); + preview->mScriptEd->mCompileTarget->setValue(is_lua ? "luau" : "lsl-luau"); + preview->mScriptEd->processKeywords(is_lua); } else { @@ -1933,7 +2142,7 @@ void* LLLiveLSLEditor::createScriptEdPanel(void* userdata) self->mScriptEd = new LLScriptEdCore( self, - HELLO_LSL, + std::string(), self->getHandle(), &LLLiveLSLEditor::onLoad, &LLLiveLSLEditor::onSave, @@ -1961,28 +2170,26 @@ LLLiveLSLEditor::LLLiveLSLEditor(const LLSD& key) : bool LLLiveLSLEditor::postBuild() { - childSetCommitCallback("running", LLLiveLSLEditor::onRunningCheckboxClicked, this); - getChildView("running")->setEnabled(false); - - childSetAction("Reset",&LLLiveLSLEditor::onReset,this); - getChildView("Reset")->setEnabled(true); - - mMonoCheckbox = getChild("mono"); - childSetCommitCallback("mono", &LLLiveLSLEditor::onMonoCheckboxClicked, this); - getChildView("mono")->setEnabled(true); - - mScriptEd->mEditor->makePristine(); - mScriptEd->mEditor->setFocus(true); + mResetButton = getChild("Reset"); + mResetButton->setClickedCallback([&](LLUICtrl*, const LLSD&) { onReset(); }); + mRunningCheckbox = getChild("running"); + mRunningCheckbox->setCommitCallback([&](LLUICtrl*, const LLSD&) { onRunningCheckboxClicked(); }); mExperiences = getChild("Experiences..."); - mExperiences->setCommitCallback(boost::bind(&LLLiveLSLEditor::experienceChanged, this)); + mExperiences->setCommitCallback([&](LLUICtrl*, const LLSD&) { experienceChanged(); }); mExperienceEnabled = getChild("enable_xp"); + mExperienceEnabled->setCommitCallback([&](LLUICtrl*, const LLSD&) { onToggleExperience(); }); - childSetCommitCallback("enable_xp", onToggleExperience, this); - childSetCommitCallback("view_profile", onViewProfile, this); + mViewProfileButton = getChild("view_profile"); + mViewProfileButton->setClickedCallback([&](LLUICtrl*, const LLSD&) { onViewProfile(); }); + mScriptEd->mEditor->makePristine(); + mScriptEd->mEditor->setFocus(true); + + mScriptEd->mCompileTarget = getChild("compile_target"); + mScriptEd->mCompileTarget->setCommitCallback([&](LLUICtrl*, const LLSD&) { onCompileTargetChanged(); }); return LLPreview::postBuild(); } @@ -1995,7 +2202,16 @@ void LLLiveLSLEditor::callbackLSLCompileSucceeded(const LLUUID& task_id, LL_DEBUGS() << "LSL Bytecode saved" << LL_ENDL; mScriptEd->mErrorList->setCommentText(LLTrans::getString("CompileSuccessful")); mScriptEd->mErrorList->setCommentText(LLTrans::getString("SaveComplete")); - getChild("running")->set(is_script_running); + + if (isOpenInExternalEditor()) + { + LLSD success_msg; + success_msg.append(LLTrans::getString("CompileSuccessful")); + success_msg.append(LLTrans::getString("SaveComplete")); + logErrorsToFile(success_msg); + } + + mRunningCheckbox->set(is_script_running); mIsSaving = false; closeIfNeeded(); } @@ -2004,6 +2220,7 @@ void LLLiveLSLEditor::callbackLSLCompileSucceeded(const LLUUID& task_id, void LLLiveLSLEditor::callbackLSLCompileFailed(const LLSD& compile_errors) { LL_DEBUGS() << "Compile failed!" << LL_ENDL; + for(LLSD::array_const_iterator line = compile_errors.beginArray(); line < compile_errors.endArray(); line++) @@ -2016,6 +2233,12 @@ void LLLiveLSLEditor::callbackLSLCompileFailed(const LLSD& compile_errors) row["columns"][0]["font"] = "OCRA"; mScriptEd->mErrorList->addElement(row); } + + if (isOpenInExternalEditor()) + { + logErrorsToFile(compile_errors); + } + mScriptEd->selectFirstError(); mIsSaving = false; closeIfNeeded(); @@ -2058,9 +2281,10 @@ void LLLiveLSLEditor::loadAsset() { mItem = new LLViewerInventoryItem(item); // request the text from the object - LLSD* user_data = new LLSD(); - user_data->with("taskid", mObjectUUID).with("itemid", mItemUUID); - gAssetStorage->getInvItemAsset(object->getRegion()->getHost(), + LLSD* user_data = new LLSD(); + user_data->with("taskid", mObjectUUID).with("itemid", mItemUUID); + gAssetStorage->getInvItemAsset( + object->getRegion()->getHost(), gAgent.getID(), gAgent.getSessionID(), item->getPermissions().getOwner(), @@ -2068,8 +2292,8 @@ void LLLiveLSLEditor::loadAsset() item->getUUID(), item->getAssetUUID(), item->getType(), - &LLLiveLSLEditor::onLoadComplete, - (void*)user_data, + LLLiveLSLEditor::onLoadComplete, + user_data, true); LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_GetScriptRunning); @@ -2108,26 +2332,6 @@ void LLLiveLSLEditor::loadAsset() */ } } - else - { - mScriptEd->setScriptText(std::string(HELLO_LSL), true); - mScriptEd->enableSave(false); - LLPermissions perm; - perm.init(gAgent.getID(), gAgent.getID(), LLUUID::null, gAgent.getGroupID()); - perm.initMasks(PERM_ALL, PERM_ALL, PERM_NONE, PERM_NONE, PERM_MOVE | PERM_TRANSFER); - mItem = new LLViewerInventoryItem(mItemUUID, - mObjectUUID, - perm, - LLUUID::null, - LLAssetType::AT_LSL_TEXT, - LLInventoryType::IT_LSL, - DEFAULT_SCRIPT_NAME, - DEFAULT_SCRIPT_DESC, - LLSaleInfo::DEFAULT, - LLInventoryItemFlags::II_FLAGS_NONE, - time_corrected()); - mAssetStatus = PREVIEW_ASSET_LOADED; - } requestExperiences(); } @@ -2203,14 +2407,9 @@ void LLLiveLSLEditor::loadScriptText(const LLUUID &uuid, LLAssetType::EType type } -void LLLiveLSLEditor::onRunningCheckboxClicked( LLUICtrl*, void* userdata ) +void LLLiveLSLEditor::onRunningCheckboxClicked() { - LLLiveLSLEditor* self = (LLLiveLSLEditor*) userdata; - LLViewerObject* object = gObjectList.findObject( self->mObjectUUID ); - LLCheckBoxCtrl* runningCheckbox = self->getChild("running"); - bool running = runningCheckbox->get(); - //self->mRunningCheckbox->get(); - if( object ) + if (LLViewerObject* object = gObjectList.findObject(mObjectUUID)) { LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_SetScriptRunning); @@ -2218,24 +2417,21 @@ void LLLiveLSLEditor::onRunningCheckboxClicked( LLUICtrl*, void* userdata ) msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); msg->nextBlockFast(_PREHASH_Script); - msg->addUUIDFast(_PREHASH_ObjectID, self->mObjectUUID); - msg->addUUIDFast(_PREHASH_ItemID, self->mItemUUID); - msg->addBOOLFast(_PREHASH_Running, running); + msg->addUUIDFast(_PREHASH_ObjectID, mObjectUUID); + msg->addUUIDFast(_PREHASH_ItemID, mItemUUID); + msg->addBOOLFast(_PREHASH_Running, mRunningCheckbox->get()); msg->sendReliable(object->getRegion()->getHost()); } else { - runningCheckbox->set(!running); + mRunningCheckbox->set(!mRunningCheckbox->get()); LLNotificationsUtil::add("CouldNotStartStopScript"); } } -void LLLiveLSLEditor::onReset(void *userdata) +void LLLiveLSLEditor::onReset() { - LLLiveLSLEditor* self = (LLLiveLSLEditor*) userdata; - - LLViewerObject* object = gObjectList.findObject( self->mObjectUUID ); - if(object) + if (LLViewerObject* object = gObjectList.findObject(mObjectUUID)) { LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_ScriptReset); @@ -2243,8 +2439,8 @@ void LLLiveLSLEditor::onReset(void *userdata) msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); msg->nextBlockFast(_PREHASH_Script); - msg->addUUIDFast(_PREHASH_ObjectID, self->mObjectUUID); - msg->addUUIDFast(_PREHASH_ItemID, self->mItemUUID); + msg->addUUIDFast(_PREHASH_ObjectID, mObjectUUID); + msg->addUUIDFast(_PREHASH_ItemID, mItemUUID); msg->sendReliable(object->getRegion()->getHost()); } else @@ -2256,34 +2452,33 @@ void LLLiveLSLEditor::onReset(void *userdata) void LLLiveLSLEditor::draw() { LLViewerObject* object = gObjectList.findObject(mObjectUUID); - LLCheckBoxCtrl* runningCheckbox = getChild( "running"); - if(object && mAskedForRunningInfo && mHaveRunningInfo) + if (object && mAskedForRunningInfo && mHaveRunningInfo) { - if(object->permAnyOwner()) + if (object->permAnyOwner()) { - runningCheckbox->setLabel(getString("script_running")); - runningCheckbox->setEnabled(!mIsSaving); + mRunningCheckbox->setLabel(getString("script_running")); + mRunningCheckbox->setEnabled(!mIsSaving); } else { - runningCheckbox->setLabel(getString("public_objects_can_not_run")); - runningCheckbox->setEnabled(false); + mRunningCheckbox->setLabel(getString("public_objects_can_not_run")); + mRunningCheckbox->setEnabled(false); // *FIX: Set it to false so that the ui is correct for // a box that is released to public. It could be // incorrect after a release/claim cycle, but will be // correct after clicking on it. - runningCheckbox->set(false); - mMonoCheckbox->set(false); + mRunningCheckbox->set(false); + mScriptEd->mCompileTarget->clear(); } } - else if(!object) + else if (!object) { // HACK: Display this information in the title bar. // Really ought to put in main window. setTitle(LLTrans::getString("ObjectOutOfRange")); - runningCheckbox->setEnabled(false); - mMonoCheckbox->setEnabled(false); + mRunningCheckbox->setEnabled(false); + mScriptEd->mCompileTarget->setEnabled(false); // object may have fallen out of range. mHaveRunningInfo = false; } @@ -2340,6 +2535,8 @@ void LLLiveLSLEditor::finishLSLUpload(LLUUID itemId, LLUUID taskId, LLUUID newAs { preview->callbackLSLCompileFailed(response["errors"]); } + response["is_running"] = isRunning; + preview->sendCompileResults(response); } } @@ -2390,7 +2587,7 @@ void LLLiveLSLEditor::saveIfNeeded(bool sync /*= true*/) mScriptEd->sync(); } - bool isRunning = getChild("running")->get(); + bool is_running = mRunningCheckbox->get(); getWindow()->incBusyCount(); mPendingUploads++; @@ -2398,17 +2595,18 @@ void LLLiveLSLEditor::saveIfNeeded(bool sync /*= true*/) if (!url.empty()) { + std::string compile_target(mScriptEd->mCompileTarget->getValue()); std::string buffer(mScriptEd->mEditor->getText()); LLUUID old_asset_id = mScriptEd->getAssetID(); LLResourceUploadInfo::ptr_t uploadInfo(std::make_shared(mObjectUUID, mItemUUID, - monoChecked() ? LLScriptAssetUpload::MONO : LLScriptAssetUpload::LSL2, - isRunning, mScriptEd->getAssociatedExperience(), buffer, - [isRunning, old_asset_id](LLUUID itemId, LLUUID taskId, LLUUID newAssetId, LLSD response) { - LLFileSystem::removeFile(old_asset_id, LLAssetType::AT_LSL_TEXT); - LLLiveLSLEditor::finishLSLUpload(itemId, taskId, newAssetId, response, isRunning); - }, - nullptr)); // needs failure handling? + compile_target, is_running, mScriptEd->getAssociatedExperience(), buffer, + [is_running, old_asset_id](LLUUID item_id, LLUUID task_id, LLUUID new_asset_id, LLSD response) + { + LLFileSystem::removeFile(old_asset_id, LLAssetType::AT_LSL_TEXT); + LLLiveLSLEditor::finishLSLUpload(item_id, task_id, new_asset_id, response, is_running); + }, + nullptr)); // needs failure handling? LLViewerAssetUpload::EnqueueInventoryUpload(url, uploadInfo); } @@ -2461,28 +2659,60 @@ void LLLiveLSLEditor::processScriptRunningReply(LLMessageSystem* msg, void**) if (LLLiveLSLEditor* instance = LLFloaterReg::findTypedInstance("preview_scriptedit", floater_key)) { instance->mHaveRunningInfo = true; + bool running; msg->getBOOLFast(_PREHASH_Script, _PREHASH_Running, running); - LLCheckBoxCtrl* runningCheckbox = instance->getChild("running"); - runningCheckbox->set(running); - bool mono; - msg->getBOOLFast(_PREHASH_Script, "Mono", mono); - LLCheckBoxCtrl* monoCheckbox = instance->getChild("mono"); - monoCheckbox->setEnabled(instance->getIsModifiable() && have_script_upload_cap(object_id)); - monoCheckbox->set(mono); + instance->mRunningCheckbox->set(running); + + bool mono = false, luau = false, luau_language = false; + msg->getBOOLFast(_PREHASH_Script, _PREHASH_Mono, mono); + msg->getBOOLFast(_PREHASH_Script, _PREHASH_Luau, luau); // Luau compiler is enabled + msg->getBOOLFast(_PREHASH_Script, _PREHASH_LuauLanguage, luau_language); + + std::string compile_target; + if (luau) + { + if (luau_language) + { + compile_target = "luau"; + } + else + { + compile_target = "lsl-luau"; // Luau compiler running in LSL compatibility mode + } + } + else if (mono) + { + compile_target = "mono"; + } + else + { + compile_target = "lsl2"; + } + + instance->mScriptEd->mCompileTarget->setValue(compile_target); + instance->mScriptEd->processKeywords(luau && luau_language); // Use Luau syntax highlighting for Luau scripts + + bool lua_scripts_enabled = have_lua_enabled(object_id); + if (LLScrollListItem* luau_item = instance->mScriptEd->mCompileTarget->findItemByValue("luau")) + { + luau_item->setEnabled(lua_scripts_enabled); + } + if (LLScrollListItem* lsl_luau_item = instance->mScriptEd->mCompileTarget->findItemByValue("lsl-luau")) + { + lsl_luau_item->setEnabled(lua_scripts_enabled); + } + + instance->mScriptEd->mCompileTarget->setEnabled(instance->getIsModifiable() && have_script_upload_cap(object_id)); } } -void LLLiveLSLEditor::onMonoCheckboxClicked(LLUICtrl*, void* userdata) +void LLLiveLSLEditor::onCompileTargetChanged() { - LLLiveLSLEditor* self = static_cast(userdata); - self->mMonoCheckbox->setEnabled(have_script_upload_cap(self->mObjectUUID)); - self->mScriptEd->enableSave(self->getIsModifiable()); -} + mScriptEd->mCompileTarget->setEnabled(have_script_upload_cap(mObjectUUID)); + mScriptEd->enableSave(getIsModifiable()); -bool LLLiveLSLEditor::monoChecked() const -{ - return mMonoCheckbox && mMonoCheckbox->getValue(); + mScriptEd->processKeywords(mScriptEd->mCompileTarget->getValue().asString() == "luau"); } void LLLiveLSLEditor::setAssociatedExperience( LLHandle editor, const LLSD& experience ) diff --git a/indra/newview/llpreviewscript.h b/indra/newview/llpreviewscript.h index 0bbe5402079..802d0e12fe6 100644 --- a/indra/newview/llpreviewscript.h +++ b/indra/newview/llpreviewscript.h @@ -54,6 +54,7 @@ class LLScriptEdContainer; class LLFloaterGotoLine; class LLFloaterExperienceProfile; class LLScriptMovedObserver; +class LLScriptEditorWSServer; class LLLiveLSLFile : public LLLiveFile { @@ -61,12 +62,12 @@ class LLLiveLSLFile : public LLLiveFile typedef boost::function change_callback_t; LLLiveLSLFile(std::string file_path, change_callback_t change_cb); - ~LLLiveLSLFile(); + ~LLLiveLSLFile() override; void ignoreNextUpdate() { mIgnoreNextUpdate = true; } protected: - /*virtual*/ bool loadFile(); + bool loadFile() override; change_callback_t mOnChangeCallback; bool mIgnoreNextUpdate; @@ -82,26 +83,34 @@ class LLScriptEdCore : public LLPanel friend class LLScriptEdContainer; friend class LLFloaterGotoLine; +public: + typedef boost::function script_ed_callback_t; + typedef boost::function save_callback_t; + protected: // Supposed to be invoked only by the container. LLScriptEdCore( LLScriptEdContainer* container, const std::string& sample, const LLHandle& floater_handle, - void (*load_callback)(void* userdata), - void (*save_callback)(void* userdata, bool close_after_save), - void (*search_replace_callback)(void* userdata), + script_ed_callback_t load_callback, + save_callback_t save_callback, + script_ed_callback_t search_replace_callback, void* userdata, bool live, S32 bottom_pad = 0); // pad below bottom row of buttons public: - ~LLScriptEdCore(); + ~LLScriptEdCore() override; void initMenu(); void processKeywords(); + void processKeywords(bool luau_language); + LLScriptEditor* getEditor() const { return mEditor; } + LLKeywords& getKeywords() const { return mEditor->getKeywords(); } + bool isLuauLanguage() const { return mEditor->getIsLuauLanguage(); } - virtual void draw(); - /*virtual*/ bool postBuild(); + void draw() override; + bool postBuild() override; bool canClose(); void setEnableEditing(bool enable); bool canLoadOrSaveToFile( void* userdata ); @@ -134,33 +143,32 @@ class LLScriptEdCore : public LLPanel static bool enableSaveToFileMenu(void* userdata); static bool enableLoadFromFileMenu(void* userdata); - virtual bool hasAccelerators() const { return true; } + bool hasAccelerators() const override { return true; } LLUUID getAssociatedExperience()const; void setAssociatedExperience( const LLUUID& experience_id ); - void setScriptName(const std::string& name){mScriptName = name;}; + void setScriptName(const std::string& name) { mScriptName = name; } - void setItemRemoved(bool script_removed){mScriptRemoved = script_removed;}; + void setItemRemoved(bool script_removed) { mScriptRemoved = script_removed; } void setAssetID( const LLUUID& asset_id){ mAssetID = asset_id; }; LLUUID getAssetID() const { return mAssetID; } - bool isFontSizeChecked(const LLSD &userdata); - void onChangeFontSize(const LLSD &size_name); + bool isFontSizeChecked(const LLSD &userdata); + void onChangeFontSize(const LLSD &size_name); + + bool handleKeyHere(KEY key, MASK mask) override; + void selectAll() { mEditor->selectAll(); } - virtual bool handleKeyHere(KEY key, MASK mask); - void selectAll() { mEditor->selectAll(); } + void enableSave(bool b) { mEnableSave = b; } + bool hasChanged() const; private: void onBtnDynamicHelp(); void onBtnUndoChanges(); - bool hasChanged() const; - void selectFirstError(); - void enableSave(bool b) {mEnableSave = b;} - protected: void deleteBridges(); void setHelpPage(const std::string& help_string); @@ -175,9 +183,9 @@ class LLScriptEdCore : public LLPanel std::string mSampleText; std::string mScriptName; LLScriptEditor* mEditor; - void (*mLoadCallback)(void* userdata); - void (*mSaveCallback)(void* userdata, bool close_after_save); - void (*mSearchReplaceCallback) (void* userdata); + script_ed_callback_t mLoadCallback; + save_callback_t mSaveCallback; + script_ed_callback_t mSearchReplaceCallback; void* mUserdata; LLComboBox *mFunctions; bool mForceClose; @@ -190,19 +198,18 @@ class LLScriptEdCore : public LLPanel S32 mLiveHelpHistorySize; bool mEnableSave; bool mHasScriptData; - LLLiveLSLFile* mLiveFile; LLUUID mAssociatedExperience; bool mScriptRemoved; bool mSaveDialogShown; LLUUID mAssetID; LLTextBox* mLineCol = nullptr; LLButton* mSaveBtn = nullptr; + LLComboBox* mCompileTarget = nullptr; LLScriptEdContainer* mContainer; // parent view -public: + public: boost::signals2::connection mSyntaxIDConnection; - }; class LLScriptEdContainer : public LLPreview @@ -211,15 +218,30 @@ class LLScriptEdContainer : public LLPreview public: LLScriptEdContainer(const LLSD& key); + ~LLScriptEdContainer() override; + + bool handleKeyHere(KEY key, MASK mask) override; - bool handleKeyHere(KEY key, MASK mask); + void startWebsocketServer(); + void unsubscribeScript(); + void sendCompileResults(LLSD&); + + LLScriptEdCore* getScriptEdCore() const { return mScriptEd; } protected: - std::string getTmpFileName(const std::string& script_name); + std::string getTmpFileName(const std::string& script_name) const; + std::string getUniqueHash() const; + std::string getErrorLogFileName(const std::string& script_path); bool onExternalChange(const std::string& filename); virtual void saveIfNeeded(bool sync = true) = 0; + bool logErrorsToFile(const LLSD& compile_errors); + bool isOpenInExternalEditor() const { return mLiveFile != nullptr; } LLScriptEdCore* mScriptEd; + LLLiveLSLFile* mLiveFile = nullptr; + LLLiveLSLFile* mLiveLogFile = nullptr; + + std::weak_ptr mWebSocketServer; }; // Used to view and edit an LSL script from your inventory. @@ -227,7 +249,7 @@ class LLPreviewLSL : public LLScriptEdContainer { public: LLPreviewLSL(const LLSD& key ); - ~LLPreviewLSL(); + ~LLPreviewLSL() override; LLUUID getScriptID() { return mItemUUID; } @@ -236,15 +258,16 @@ class LLPreviewLSL : public LLScriptEdContainer virtual void callbackLSLCompileSucceeded(); virtual void callbackLSLCompileFailed(const LLSD& compile_errors); - /*virtual*/ bool postBuild(); + bool postBuild() override; protected: - virtual void draw(); - virtual bool canClose(); + void draw() override; + bool canClose() override; void closeIfNeeded(); - virtual void loadAsset(); - /*virtual*/ void saveIfNeeded(bool sync = true); + void loadAsset() override; + void saveIfNeeded(bool sync = true) override; + void onCompileTargetChanged(); static void onSearchReplace(void* userdata); static void onLoad(void* userdata); @@ -265,10 +288,8 @@ class LLPreviewLSL : public LLScriptEdContainer S32 mPendingUploads; LLScriptMovedObserver* mItemObserver; - }; - // Used to view and edit an LSL script that is attached to an object. class LLLiveLSLEditor : public LLScriptEdContainer { @@ -276,7 +297,6 @@ class LLLiveLSLEditor : public LLScriptEdContainer public: LLLiveLSLEditor(const LLSD& key); - static void processScriptRunningReply(LLMessageSystem* msg, void**); virtual void callbackLSLCompileSucceeded(const LLUUID& task_id, @@ -284,13 +304,13 @@ class LLLiveLSLEditor : public LLScriptEdContainer bool is_script_running); virtual void callbackLSLCompileFailed(const LLSD& compile_errors); - /*virtual*/ bool postBuild(); + bool postBuild() override; void setIsNew() { mIsNew = true; } static void setAssociatedExperience( LLHandle editor, const LLSD& experience ); - static void onToggleExperience(LLUICtrl *ui, void* userdata); - static void onViewProfile(LLUICtrl *ui, void* userdata); + void onToggleExperience(); + void onViewProfile(); void setExperienceIds(const LLSD& experience_ids); void buildExperienceList(); @@ -300,15 +320,15 @@ class LLLiveLSLEditor : public LLScriptEdContainer void setObjectName(std::string name) { mObjectName = name; } + bool getIsModifiable() const { return mIsModifiable; } // Evaluated on load assert + private: - virtual bool canClose(); + bool canClose() override; void closeIfNeeded(); - virtual void draw(); - - virtual void loadAsset(); - /*virtual*/ void saveIfNeeded(bool sync = true); - bool monoChecked() const; + void draw() override; + void loadAsset() override; + void saveIfNeeded(bool sync = true) override; static void onSearchReplace(void* userdata); static void onLoad(void* userdata); @@ -317,14 +337,14 @@ class LLLiveLSLEditor : public LLScriptEdContainer static void onLoadComplete(const LLUUID& asset_uuid, LLAssetType::EType type, void* user_data, S32 status, LLExtStat ext_status); - static void onRunningCheckboxClicked(LLUICtrl*, void* userdata); - static void onReset(void* userdata); + void onRunningCheckboxClicked(); + void onReset(); void loadScriptText(const LLUUID &uuid, LLAssetType::EType type); static void* createScriptEdPanel(void* userdata); - static void onMonoCheckboxClicked(LLUICtrl*, void* userdata); + void onCompileTargetChanged(); static void finishLSLUpload(LLUUID itemId, LLUUID taskId, LLUUID newAssetId, LLSD response, bool isRunning); static void receiveExperienceIds(LLSD result, LLHandle parent); @@ -342,19 +362,17 @@ class LLLiveLSLEditor : public LLScriptEdContainer S32 mPendingUploads; bool mIsSaving; + bool mIsModifiable; - bool getIsModifiable() const { return mIsModifiable; } // Evaluated on load assert - - LLCheckBoxCtrl* mMonoCheckbox; - bool mIsModifiable; - - - LLComboBox* mExperiences; - LLCheckBoxCtrl* mExperienceEnabled; - LLSD mExperienceIds; + LLButton* mResetButton { nullptr }; + LLCheckBoxCtrl* mRunningCheckbox { nullptr }; + LLComboBox* mExperiences { nullptr }; + LLCheckBoxCtrl* mExperienceEnabled { nullptr }; + LLButton* mViewProfileButton { nullptr }; + LLSD mExperienceIds; LLHandle mExperienceProfile; - std::string mObjectName; + std::string mObjectName; }; #endif // LL_LLPREVIEWSCRIPT_H diff --git a/indra/newview/llscripteditor.cpp b/indra/newview/llscripteditor.cpp index 59cf3ac02b4..2a9dd73936c 100644 --- a/indra/newview/llscripteditor.cpp +++ b/indra/newview/llscripteditor.cpp @@ -45,7 +45,8 @@ LLScriptEditor::Params::Params() LLScriptEditor::LLScriptEditor(const Params& p) : LLTextEditor(p) , mShowLineNumbers(p.show_line_numbers), - mUseDefaultFontSize(p.default_font_size) + mUseDefaultFontSize(p.default_font_size), + mLuauLanguage(false) { if (mShowLineNumbers) { @@ -141,20 +142,24 @@ void LLScriptEditor::drawLineNumbers() } } -void LLScriptEditor::initKeywords() +void LLScriptEditor::initKeywords(bool luau_language) { - mKeywords.initialize(LLSyntaxIdLSL::getInstance()->getKeywordsXML()); + mKeywordsLua.initialize(LLSyntaxLua::getInstance()->getKeywordsXML(), true); + mKeywordsLSL.initialize(LLSyntaxIdLSL::getInstance()->getKeywordsXML(), false); + + mLuauLanguage = luau_language; + } void LLScriptEditor::loadKeywords() { LL_PROFILE_ZONE_SCOPED; - mKeywords.processTokens(); + getKeywords().processTokens(); LLStyleConstSP style = new LLStyle(LLStyle::Params().font(getScriptFont()).color(mDefaultColor.get())); segment_vec_t segment_list; - mKeywords.findSegments(&segment_list, getWText(), *this, style); + getKeywords().findSegments(&segment_list, getWText(), *this, style); mSegments.clear(); segment_set_t::iterator insert_it = mSegments.begin(); @@ -166,7 +171,7 @@ void LLScriptEditor::loadKeywords() void LLScriptEditor::updateSegments() { - if (mReflowIndex < S32_MAX && mKeywords.isLoaded() && mParseOnTheFly) + if (mReflowIndex < S32_MAX && getKeywords().isLoaded() && mParseOnTheFly) { LL_PROFILE_ZONE_SCOPED; @@ -174,7 +179,7 @@ void LLScriptEditor::updateSegments() // HACK: No non-ascii keywords for now segment_vec_t segment_list; - mKeywords.findSegments(&segment_list, getWText(), *this, style); + getKeywords().findSegments(&segment_list, getWText(), *this, style); clearSegments(); for (segment_vec_t::iterator list_it = segment_list.begin(); list_it != segment_list.end(); ++list_it) @@ -194,6 +199,21 @@ void LLScriptEditor::clearSegments() } } +LLKeywords::keyword_iterator_t LLScriptEditor::keywordsBegin() +{ + return getKeywords().begin(); +} + +LLKeywords::keyword_iterator_t LLScriptEditor::keywordsEnd() +{ + return getKeywords().end(); +} + +LLKeywords& LLScriptEditor::getKeywords() +{ + return mLuauLanguage ? mKeywordsLua : mKeywordsLSL; +} + // Most of this is shamelessly copied from LLTextBase void LLScriptEditor::drawSelectionBackground() { @@ -218,7 +238,6 @@ void LLScriptEditor::drawSelectionBackground() ++rect_it) { LLRect selection_rect = *rect_it; - selection_rect = *rect_it; selection_rect.translate(mVisibleTextRect.mLeft - content_display_rect.mLeft, mVisibleTextRect.mBottom - content_display_rect.mBottom); gl_rect_2d(selection_rect, selection_color); } diff --git a/indra/newview/llscripteditor.h b/indra/newview/llscripteditor.h index 1632ebe8341..2d98110f75a 100644 --- a/indra/newview/llscripteditor.h +++ b/indra/newview/llscripteditor.h @@ -41,17 +41,20 @@ class LLScriptEditor : public LLTextEditor Params(); }; - virtual ~LLScriptEditor() {}; + ~LLScriptEditor() override {}; // LLView override - virtual void draw(); - bool postBuild(); + void draw() override; + bool postBuild() override; - void initKeywords(); + void initKeywords(bool luau_language = false); void loadKeywords(); - /* virtual */ void clearSegments(); - LLKeywords::keyword_iterator_t keywordsBegin() { return mKeywords.begin(); } - LLKeywords::keyword_iterator_t keywordsEnd() { return mKeywords.end(); } + void clearSegments(); + LLKeywords::keyword_iterator_t keywordsBegin(); + LLKeywords::keyword_iterator_t keywordsEnd(); + LLKeywords& getKeywords(); + bool getIsLuauLanguage() { return mLuauLanguage; } + void setLuauLanguage(bool luau_language) { mLuauLanguage = luau_language; } static std::string getScriptFontSize(); LLFontGL* getScriptFont(); @@ -63,12 +66,13 @@ class LLScriptEditor : public LLTextEditor private: void drawLineNumbers(); - /* virtual */ void updateSegments(); - /* virtual */ void drawSelectionBackground(); - void loadKeywords(const std::string& filename_keywords, - const std::string& filename_colors); + void updateSegments() override; + void drawSelectionBackground() override; + + LLKeywords mKeywordsLua; + LLKeywords mKeywordsLSL; + bool mLuauLanguage; - LLKeywords mKeywords; bool mShowLineNumbers; bool mUseDefaultFontSize; }; diff --git a/indra/newview/llscripteditorws.cpp b/indra/newview/llscripteditorws.cpp new file mode 100644 index 00000000000..814157e86c2 --- /dev/null +++ b/indra/newview/llscripteditorws.cpp @@ -0,0 +1,830 @@ +/** + * @file llscripteditorws.cpp + * @brief JSON-RPC 2.0 WebSocket server implementation for external script editor integration + * + * $LicenseInfo:firstyear=2025&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2025, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" +#include "llscripteditorws.h" +#include "llpreviewscript.h" +#include "llappviewer.h" +#include "lltrans.h" +#include "lldate.h" +#include "llerror.h" +#include "lluuid.h" +#include "llversioninfo.h" +#include "llagent.h" +#include "llregex.h" +#include "llviewerobject.h" +#include "llviewerobjectlist.h" +#include "llchat.h" + +//======================================================================== +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; +} + +LLScriptEditorWSServer::ptr_t LLScriptEditorWSServer::getServer() +{ + if (!LLWebsocketMgr::instanceExists()) + { + return nullptr; + } + LLWebsocketMgr& wsmgr = LLWebsocketMgr::instance(); + return std::static_pointer_cast( + wsmgr.findServerByName(LLScriptEditorWSServer::DEFAULT_SERVER_NAME)); +} + + +LLWebsocketMgr::WSConnection::ptr_t LLScriptEditorWSServer::connectionFactory(LLWebsocketMgr::WSServer::ptr_t server, + LLWebsocketMgr::connection_h handle) +{ + auto connection = std::make_shared(server, handle); + mActiveConnections[connection->getConnectionID()] = connection; + + // Call setupConnectionMethods to register any global methods + setupConnectionMethods(connection); + + return connection; +} + +void LLScriptEditorWSServer::onStarted() +{ + LLSyntaxIdLSL& syntax_id_mgr = LLSyntaxIdLSL::instance(); + wptr_t that(std::static_pointer_cast(shared_from_this())); + + mLastSyntaxId = syntax_id_mgr.getSyntaxID(); + mLanguageChangeSignal = syntax_id_mgr.addSyntaxIDCallback( + [that]() + { + auto server = that.lock(); + if (server && server->isRunning()) + { + server->broadcastLanguageChange(); + } + }); +} + +void LLScriptEditorWSServer::onStopped() +{ + mLanguageChangeSignal.disconnect(); + mLastSyntaxId.setNull(); +} + +void LLScriptEditorWSServer::onConnectionOpened(const LLWebsocketMgr::WSConnection::ptr_t& connection) +{ + // Call parent class to handle JSON-RPC setup and standard methods + LLJSONRPCServer::onConnectionOpened(connection); + + LL_INFOS("ScriptEditorWS") << "New script editor client connected via JSON-RPC" << LL_ENDL; + +} + +void LLScriptEditorWSServer::onConnectionClosed(const LLWebsocketMgr::WSConnection::ptr_t& connection) +{ + // Call parent class to handle JSON-RPC cleanup + LLJSONRPCServer::onConnectionClosed(connection); + + LL_INFOS("ScriptEditorWS") << "Script editor client disconnected" << LL_ENDL; + + // Remove from active connections + auto script_connection = std::dynamic_pointer_cast(connection); + if (script_connection) + { + U32 connection_id = script_connection->getConnectionID(); + unsubscribeConnection(connection_id); + mActiveConnections.erase(connection_id); + + LL_DEBUGS("ScriptEditorWS") << "Removed connection from active connections. Total: " + << mActiveConnections.size() << LL_ENDL; + // TODO: When connections reach 0, stop the server after a timeout. + } +} + +bool LLScriptEditorWSServer::subscribeScriptEditor(const LLUUID& object_id, const LLUUID& item_id, std::string_view script_name, + const LLHandle& editor_handle, const std::string& script_id) +{ + if (!editor_handle.isDead()) + { + auto it = mSubscriptions.find(script_id); + if (it == mSubscriptions.end()) + { // Don't re-add if already subscribed + mSubscriptions.emplace(script_id, + LLScriptEditorWSServer::EditorSubscription(object_id, item_id, script_name, editor_handle)); + return false; + } + else + { // Update existing subscription with new editor handle + it->second.mEditorHandle = editor_handle; + } + return true; + } + return false; +} + +void LLScriptEditorWSServer::unsubscribeEditor(const std::string &script_id) +{ + auto it = mSubscriptions.find(script_id); + if (it != mSubscriptions.end()) + { + S32 connection_id = it->second.mConnectionID; + auto connection = it->second.mConnection.lock(); + mSubscriptions.erase(it); + ptrdiff_t count = std::count_if(mSubscriptions.begin(), mSubscriptions.end(), [connection_id](const auto& pair) { + return pair.second.mConnectionID == connection_id; + }); + if (connection && !count) + { // We have removed the last subscription, close the connection + LL_DEBUGS("ScriptEditorWS") << "Closing connection ID " << connection_id << + " as last subscription was removed" << LL_ENDL; + connection->sendDisconnect(LLScriptEditorWSConnection::REASON_EDITOR_CLOSED, "Editor closed"); + } + + } +} + +void LLScriptEditorWSServer::unsubscribeConnection(U32 connection_id) +{ + for (auto it = mSubscriptions.begin(); it != mSubscriptions.end(); ) + { + if (it->second.mConnectionID == connection_id) + { + LL_DEBUGS("ScriptEditorWS") << "Unsubscribing script " << it->first + << " from connection ID " << connection_id << LL_ENDL; + it = mSubscriptions.erase(it); + } + else + { + ++it; + } + } +} + +LLScriptEditorWSServer::SubscriptionError_t LLScriptEditorWSServer::updateScriptSubscription(const std::string &script_id, U32 connection_id) +{ + auto it = mSubscriptions.find(script_id); + if (it != mSubscriptions.end()) + { + if (it->second.mEditorHandle.isDead()) + { + unsubscribeEditor(script_id); + return SUBSCRIPTION_INVALID_EDITOR; + } + + auto con_it = mActiveConnections.find(connection_id); + if (con_it == mActiveConnections.end()) + { + return SUBSCRIPTION_INTERNAL_ERROR; + } + + if ((it->second.mConnectionID != 0) && !it->second.mConnection.expired() + && it->second.mConnection.lock()->isConnected()) + { + LL_WARNS("ScriptEditorWS") << "Script " << script_id << " is already subscribed on connection ID " << it->second.mConnectionID + << ", cannot subscribe again on connection ID " << connection_id << LL_ENDL; + // In the future we may want to support multiple connections per script. + // That would imply it was open in multiple editors. + return SUBSCRIPTION_ALREADY_SUBSCRIBED; + } + + it->second.mConnectionID = connection_id; + it->second.mConnection = con_it->second; + return SUBSCRIPTION_SUCCESS; + } + return SUBSCRIPTION_INVALID_SUBSCRIPTION; +} + + +LLHandle LLScriptEditorWSServer::findEditorForScript(const std::string& script_id) const +{ + auto it = mSubscriptions.find(script_id); + if (it != mSubscriptions.end()) + { + return it->second.mEditorHandle; + } + return LLHandle(); +} + +std::set LLScriptEditorWSServer::getActiveScripts() const +{ + std::set active_scripts; + for (const auto& [script_id, subinfo] : mSubscriptions) + { + if (!subinfo.mEditorHandle.isDead()) + { + active_scripts.insert(script_id); + } + } + return active_scripts; +} + +void LLScriptEditorWSServer::setupConnectionMethods(LLJSONRPCConnection::ptr_t connection) +{ + // Call parent class to register global JSON-RPC methods + LLJSONRPCServer::setupConnectionMethods(connection); + + // Cast to our specific connection type to access script editor functionality + auto script_connection = std::dynamic_pointer_cast(connection); + if (script_connection) + { + LL_DEBUGS("ScriptEditorWS") << "Setting up script editor connection methods" << LL_ENDL; + wptr_t that(std::static_pointer_cast(shared_from_this())); + + U32 connection_id = script_connection->getConnectionID(); + + script_connection->registerMethod("language.syntax.id", + [that](const std::string&, const LLSD&, const LLSD&) -> LLSD + { + auto server = that.lock(); + if (server) + { + return server->handleLanguageIdRequest(); + } + return LLSD(); + }); + script_connection->registerMethod("language.syntax", + [that](const std::string&, const LLSD&, const LLSD& params) + { + auto server = that.lock(); + if (server) + { + return server->handleSyntaxRequest(params); + } + return LLSD(); + }); + script_connection->registerMethod("script.subscribe", + [that, connection_id](const std::string&, const LLSD&, const LLSD& params) -> LLSD + { + auto server = that.lock(); + if (server) + { + return server->handleScriptSubscribe(connection_id, params); + } + return LLSD(); + }); + script_connection->registerMethod("script.unsubscribe", [](const std::string&, const LLSD&, const LLSD& params) -> LLSD + { // this is a notification, no response expected + return LLSD(); + }); + // script_connection->registerMethod("language.syntax", ) + } +} + +void LLScriptEditorWSServer::broadcastLanguageChange() +{ + LLUUID syntax_id = LLSyntaxIdLSL::instance().getSyntaxID(); + + if (syntax_id != mLastSyntaxId) + { + mLastSyntaxId = syntax_id; + LLSD params; + params["id"] = syntax_id; + + if (isRunning()) + { + broadcastNotification("language.syntax.change", params); + } + } +} + +LLSD LLScriptEditorWSServer::handleLanguageIdRequest() const +{ + LLSD response; + + response["id"] = mLastSyntaxId; + return response; +} + +LLSD LLScriptEditorWSServer::handleSyntaxRequest(const LLSD& params) const +{ + LLSD response(LLSD::emptyMap()); + std::string category = params["kind"].asString(); + + if (category.empty()) + { + response["error"] = "No syntax category specified"; + response["success"] = false; + return response; + } + + response["id"] = mLastSyntaxId; + if (category == "defs.lua") + { + response["defs"] = LLSyntaxLua::instance().getTypesXML(); + response["success"] = response["defs"].isDefined(); + } + else if (category == "defs.lsl") + { + response["defs"] = LLSyntaxIdLSL::instance().getKeywordsXML(); + response["success"] = response["defs"].isDefined(); + } + else + { + response["error"] = "Unknown syntax category requested"; + response["success"] = false; + } + return response; +} + +LLSD LLScriptEditorWSServer::handleScriptSubscribe(U32 connection_id, const LLSD& params) +{ + LLSD response(LLSD::emptyMap()); + + std::string script_id = params["script_id"].asString(); + std::string script_name = params["script_name"].asString(); + std::string language = params["script_language"].asString(); + + SubscriptionError_t result = updateScriptSubscription(script_id, connection_id); + + response["script_id"] = script_id; + response["success"] = (result == SUBSCRIPTION_SUCCESS); + response["status"] = result; + + LL_WARNS_IF(result != SUBSCRIPTION_SUCCESS, "ScriptEditorWS") + << "Script connect request for script " << script_id << " failed with status " << result << LL_ENDL; + switch (result) + { + case SUBSCRIPTION_SUCCESS: + response["message"] = "OK"; + break; + case SUBSCRIPTION_INVALID_EDITOR: + response["message"] = "Invalid editor handle"; + break; + case SUBSCRIPTION_INVALID_SUBSCRIPTION: + response["message"] = "No subscription found for script"; + break; + case SUBSCRIPTION_ALREADY_SUBSCRIBED: + response["message"] = "Script already subscribed"; + break; + case SUBSCRIPTION_INTERNAL_ERROR: + response["message"] = "Internal server error"; + break; + } + + if (result == SUBSCRIPTION_SUCCESS) + { + auto it = mSubscriptions.find(script_id); + if (it != mSubscriptions.end()) + { + LLViewerObject* object = gObjectList.findObject((*it).second.mObjectID); + response["object_id"] = (*it).second.mObjectID; + //response["object_name"] = object ? object->getName() : "Unknown"; + response["item_id"] = (*it).second.mItemID; + } + } + + return response; +} + +LLSD LLScriptEditorWSServer::handleScriptUnsubscribe(U32 connection_id, const LLSD& params) +{ + std::string script_id = params["script_id"].asString(); + + auto it = mSubscriptions.find(script_id); + if (it != mSubscriptions.end() && (it->second.mConnectionID == connection_id)) + { + unsubscribeEditor(script_id); + } + return LLSD(); +} + +void LLScriptEditorWSServer::notifyScript(const std::string& script_id, const std::string &method, const LLSD& message) const +{ + auto it = mSubscriptions.find(script_id); + if (it != mSubscriptions.end()) + { + auto connection = it->second.mConnection.lock(); + if (connection) + { + connection->notify(method, message); + } + } +} + + +void LLScriptEditorWSServer::sendUnsubscribeScriptEditor(const std::string& script_id) +{ + LLSD params; + params["script_id"] = script_id; + + notifyScript(script_id, "script.unsubscribe", params); +} + +void LLScriptEditorWSServer::sendCompileResults(const std::string &script_id, const LLSD &results) const +{ + LLHandle editor_handle = findEditorForScript(script_id); + if (editor_handle.isDead()) + { + return; + } + LLScriptEdContainer* editor = dynamic_cast(editor_handle.get()); + if (!editor) + { + return; + } + LLScriptEdCore* core = editor->getScriptEdCore(); + bool is_lua = core && (core->isLuauLanguage()); + + LLSD params; + params["script_id"] = script_id; + params["success"] = results["compiled"].asBoolean(); + params["running"] = results["is_running"].asBoolean(); + if (results.has("errors")) + { + params["errors"] = LLSD::emptyArray(); + + if (is_lua) + { // lua errors: ":line: message", line is 1-based + const static boost::regex lua_err_regex(R"(^[^:]*:(\d+): (.+)$)"); + + for (const auto& err : llsd::inArray(results["errors"])) + { + boost::smatch match; + LLSD err_entry; + + err_entry["column"] = 0; // TODO: Lua compiler does not provide column info + err_entry["level"] = "ERROR"; + + if (boost::regex_match(err.asString(), match, lua_err_regex)) + { + S32 line_number = std::stoi(match[1].str()); + std::string message = match[2].str(); + + err_entry["row"] = line_number; + err_entry["message"] = message; + } + else + { + err_entry["row"] = 0; + err_entry["message"] = err.asString(); + } + params["errors"].append(err_entry); + } + } + else + { // lsl errors: "(line, column) : SEVERITY : message", line and column are 0-based + static const boost::regex lsl_err_regex(R"(\((\d+), (\d+)\) : ([^:]+) : (.+))"); + + for (const auto& err : llsd::inArray(results["errors"])) + { + boost::smatch match; + LLSD err_entry; + + if (boost::regex_match(err.asString(), match, lsl_err_regex)) + { + S32 line_number = std::stoi(match[1].str()); + S32 col_number = std::stoi(match[2].str()); + std::string severity = match[3].str(); + std::string message = match[4].str(); + + err_entry["row"] = line_number + 1; + err_entry["column"] = col_number + 1; + err_entry["level"] = severity; + err_entry["message"] = message; + err_entry["format"] = "lsl"; + } + else + { + err_entry["row"] = 0; + err_entry["column"] = 0; + err_entry["level"] = "ERROR"; + err_entry["message"] = err.asString(); + err_entry["format"] = "lsl"; + } + params["errors"].append(err_entry); + } + } + } + + notifyScript(script_id, "script.compiled", params); +} + +void LLScriptEditorWSServer::forwardChatToIDE(const LLChat& chat_msg) const +{ + auto it = std::find_if(mSubscriptions.begin(), mSubscriptions.end(), + [&chat_msg](const auto& pair) { return (pair.second.mObjectID == chat_msg.mFromID); }); + + if (it == mSubscriptions.end()) + { // Not a script we are tracking + return; + } + + bool is_error = false; + std::string error_message; + std::string object_name; + std::string script_name; + S32 line_number = 0; + // We have at least one script from this object, we will forward the message to the IDE + // but first we need to see if it is a runtime error + std::vector lines = LLStringUtil::getTokens(chat_msg.mText, "\n"); + // If this is a runtime error, the first line will look like: " [script: