Difference between revisions of "LlLinksetDataWrite"

From Second Life Wiki
Jump to navigation Jump to search
Line 36: Line 36:
* When writing a protected name, the [[linkset_data]] event fires as normal, however the value parameter will be an empty string.
* When writing a protected name, the [[linkset_data]] event fires as normal, however the value parameter will be an empty string.
}}
}}
|caveats
|caveats=
* Events are only fired if the linkset's datastore is changed.
** Rewriting an existing value to a '''name:value''' pair returns LINKSETDATA_NOUPDATE.
** Writing an empty string to a nonexistent name in the datastore returns LINKSETDATA_NOTFOUND.
|helpers
|helpers
|also_functions=
|also_functions=

Revision as of 09:19, 26 October 2022

Summary

Summary: llLinksetDataWrite, llLinksetDataWriteProtected

The llLinksetDataWrite and llLinksetDataWriteProtected functions create or update a name:value pair in the linkset datastore. If value is an empty string, the pair is deleted.

This function returns 0 on success or an error code on failure.

When these function are called the linkset_data event is triggered in all scripts running in the linkset with an action of LINKSETDATA_UPDATE, or LINKSETDATA_DELETE if the pair is deleted.

The linkset datastore can contain up to 64k of data. Every pair written to the datastore consumes a number of bytes in the datastore equal to the length of name plus the length of value.

llLinksetDataWrite

Function: integer llLinksetDataWrite( string name, string value );

Creates or updates an unprotected name:value pair from the linkset's datastore.
Returns an integer success or failure code.

• string name The key of the name:value pair in the datastore to be updated or created.
• string value The value of the name:value pair.
All Issues ~ Search JIRA for related Bugs

llLinksetDataWriteProtected

Function: integer llLinksetDataWriteProtected( string name, string value, string pass );

Creates or updates an protected name:value pair from the linkset's datastore. Further attempts to read, write or update the name:value pair must use the protected versions of those functions and must supply the same string that was used in pass.
Returns an integer success or failure code.

• string name The key of the name:value pair in the datastore to be updated or created.The key of the name:value pair in the datastore to be updated or created.
• string value The value of the name:value pair.The value of the name:value pair.
• string pass A pass phrase used to protect the name:value pair.
Caveats
  • Protecting a name:value pair adds an additional 32 bytes to its size in the datastore.
  • When writing a protected name, the linkset_data event fires as normal, however the value parameter will be an empty string.
All Issues ~ Search JIRA for related Bugs

Constant Description
LINKSETDATA_OK 0 The name:value pair was written to the datastore.
LINKSETDATA_EMEMORY 1 A name:value pair was too large to write to the linkset datastore.
LINKSETDATA_ENOKEY 2 The name supplied to llLinksetDataWrite was empty.
LINKSETDATA_EPROTECTED 3 The name:value pair has been protected from overwrite in the linkset's datastore.
LINKSETDATA_NOTFOUND 4 The named key could not be found in the linkset's datastore when attempting to delete it.
LINKSETDATA_NOUPDATE 5 The name:value stored in the linkset was not changed by the write operation because the value stored matches the value written.

Caveats

  • Events are only fired if the linkset's datastore is changed.
    • Rewriting an existing value to a name:value pair returns LINKSETDATA_NOUPDATE.
    • Writing an empty string to a nonexistent name in the datastore returns LINKSETDATA_NOTFOUND.
All Issues ~ Search JIRA for related Bugs

Examples

Deep Notes

Search JIRA for related Issues

Signature

function integer llLinksetDataWrite( string name, string value );
function integer llLinksetDataWriteProtected( string name, string value, string pass );