XMREngine.scriptdb

From Dreamnation
Revision as of 07:19, 7 April 2018 by Kunta (Talk | contribs)

Jump to: navigation, search

These methods are available as an alternative to using the OpenSim notecard access methods. They provide access to persistent storage that scripts can use to save information. The information is saved and retrieved as name/value pairs. The name is a string up to 233 characters and the value can be up to 65535 characters. Name/value pairs written by one script in an object can be accessed by any script in the object (including other linked prims). They cannot be accessed by other objects.

These methods access persistent storage as lists of lines, similar to the OpenSim notecard methods.

 Write the list as a series of lines to the named persistent data element.
   xmrScriptDBWriteLines (string name, list contents)
     Input:
       name = name of persistent element
       contents = list of lines to write to element
 Read a single line from an element written by xmrScriptDBWriteLines()
   string xmrScriptDBReadLine (string name, integer line, string notfound, string endoffile)
     Input:
       name = name as passed to xmrScriptDBWriteLines()
       line = line number (starting with 0)
       notfound = what string to return if there is no persistent element name found
       endoffile = what string to return if line is beyond end of list written
     Output:
       returns notfound, endoffile, or list element line from persistent element name
 Get the number of lines in an element written by xmrScriptDBWriteLines()
   integer xmrScriptDBNumLines (string name)
     Input:
       name = name as passed to xmrScriptDBWriteLines()
     Output:
       returns -1 if not found or number of lines if found
 Get list of all lines in an element written by xmrScriptDBWriteLines()
   list xmrScriptDBReadLines (string name, list notfound)
     Input:
       name = name as passwd to xmrScriptDBWriteLines()
       notfound = list to return if not found
     Output:
       returns notfound or list of lines in element

These methods access persistent storage as a single (possibly long and/or multi-lined) string

xmrScriptDBWrite (string name, string value)

string xmrScriptDBReadOne (string name, string notfound)

integer xmrScriptDBCount (string keylike)

list xmrScriptDBList (string keylike, integer limit, integer offset)

array xmrScriptDBReadMany (string keylike, integer limit, integer offset)

integer xmrScriptDBDelete (string keylike)