Introduction
Linksets may store up to 128KiB of data as key/value pairs available to LSL scripts. This data is attached to the root prim in the linkset and survives transfer, script reset and object copying, it does not count against the memory usage of any script. Once set, the only way to erase it is via either the llLinksetDataReset or the llLinksetDataDelete functions. Whenever a script successfully modifies the linkset data using the llLinksetDataReset, llLinksetDataWrite or llLinksetDataCreate functions a linkset_data event is fired in all scripts in the linkset describing the action taken and key name that was affected.
Linkset data is not visible outside of a linkset; a script may only access the linkset data for the linkset that it is running in. Linkset data is not applicable to avatars.
When merging two linksets, both with linkset data, the new root's data is preserved and the simulator makes an effort to move as many of the key value pairs from the old root to the new. If there is insufficient space for all data the simulator will discard some data from the old root. The data selected for preservation may be arbitrary.
Functions
Function: integer llLinksetDataWrite( string name, string value );
Creates or updates a key/value pair in the linksets datastore.
Returns an integer indicating success or failure. 0 is success, a positive number indicates failure.
• string
|
name
|
–
|
key name for data to be stored.
|
|
• string
|
value
|
–
|
String data to be associated with this key.
|
|
Caveats
If value is an empty string, the key is deleted from the linkset data.
Function: string llLinksetDataRead( string name );
Reads the value associated with a key from the linkset's key-value datastore.
Returns a string associated with the key. If the key does not exist, an empty string is returned.
• string
|
name
|
–
|
key name for data to be stored.key name for data to be read.
|
|
Function: llLinksetDataDelete( string name );
Removes a key value pair from the linkset's datastore.
• string
|
name
|
–
|
key name for data to be stored.key name for data to be read.which is the key name for data to be read.
|
|
Function: list llLinksetDataDeleteFound( string pattern, string pass );
finds and attempts to delete all keys in the data store that match pattern.
Returns a list
• string
|
pattern
|
–
|
A regular expression describing which keys to delete.
|
|
• string
|
pass
|
–
|
Optional pass phrase to delete protected keys.
|
|
Function: integer llLinksetDataCountFound( string pattern );
Returns the number of keys in the linkset datastore that match the pattern supplied in the pattern.
Returns an integer an integer Count of the keys in the datastore that match the supplied pattern.
• string
|
pattern
|
–
|
A regular expression describing which keys to delete.A regular expression describing which keys to return.
|
|
Function: list llLinksetDataListKeys( integer first, integer count );
Return a list of keys currently in use in the linkset data.
Returns a list of keys stored in the linkset data.
• integer
|
first
|
–
|
The (zero based) index of the first key to return.
|
|
• integer
|
count
|
–
|
The maximum number of key names to return in the list.
|
|
Function: list llLinksetDataFindKeys( string regex, integer first, integer count );
Return a list of keys the linkset data which match the expression passed to the function.
Returns a list of keys matching regex stored in the linkset data.
• string
|
regex
|
–
|
A regex expression to search for.
|
|
• integer
|
first
|
–
|
The (zero based) index of the first key to return.The (zero based) index of the first key to return.
|
|
• integer
|
count
|
–
|
The maximum number of key names to return in the list.The maximum number of key names to return in the list.
|
|
Events
Function: linkset_data( integer action, string name, string value );
• integer
|
action
|
–
|
The action taken on the linkset datastore. reset, update or delete.
|
|
• string
|
name
|
–
|
key name for data to be stored.key name for data to be read.which is the key name for data to be read.The name of key changed. Empty string for reset.
|
|
• string
|
value
|
–
|
String data to be associated with this key.The value associated with the key. Empty string for reset or delete.
|
|
Pages in category "LSL LinksetData"
The following 11 pages are in this category, out of 11 total.