llRequestClientData

From Second Life Wiki
Revision as of 07:08, 14 September 2007 by Ppaatt Lynagh (talk | contribs) (create llRequestClientData = distinguish Apple Mac OS X/ Linux/ Windows, distinguish Second Life/ LSL_EditorBugs etc.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

I'm wishing for a function that works like llRequestAgentData to tell me more of the environment in which my script is running. Something to answer questions like:

Q: Is the client app current or obsolete?

Q: Is the client app running on Apple Mac OS X/ Linux/ Windows, what? (Like Unix uname answers.)

Q: Is the world around me the one true Second Life world, or is it some emulation like the binary code only LSL-Editor of Windows?

I need this function to clarify bug reports, not so much to make the script do anything different, though certainly creators could choose to make scripts distinguish platforms otherwise, e.g., to refuse to run except in the glory that is the Mac OS X user interface.

Someone more skilled in wiki-editing than I could adapt the llRequestAgentData spec better here. Below you can see I began this effort, but I got stuck as soon as the editing grew too deeply geeky.

Summary

Function: key llRequestAgentData( key id, integer data );
0.1 Forced Delay
10.0 Energy

Requests data about the client app of online agent id. When data is available the dataserver event will be raised
Returns a key that is used to identify the dataserver event when it is raise.

• key id avatar UUID
• integer data DATA_* flag

data Constant Type Description
DATA_ONLINE 1 (integerboolean If the requested agent is online
DATA_NAME 2 string The requested agent's legacy name
DATA_BORN 3 string The account creation/"born on" date as a string in an ISO 8601 format of YYYY-MM-DD.
DATA_RATING 4 llCSV2List() Deprecated: Returns [0, 0, 0, 0, 0, 0]
Used to return: [pos_behavior, neg_behavior, pos_appearance, neg_appearance, pos_building, neg_building]
DATA_PAYINFO 8 (integermask Flag Description
PAYMENT_INFO_ON_FILE 0x1 If payment info is on file.
PAYMENT_INFO_USED 0x2 If payment info has been used.

Caveats

  • This function causes the script to sleep for 0.1 seconds.

Examples

key owner_key;
key client_name_query;
string client_name;

default
{
    state_entry()
    {
        owner_key = llGetOwner();
        client_name_query = llRequestClientData(owner_key, DATA_CLIENT_NAME);
    }
    dataserver(key queryid, string data)
    {
        if (client_name_query == queryid) {
            client_name = data;
            llOwnerSay("Bugs you see may be due to: " + client_name);
        }
    }
}//~~~~

See Also

Events

•  dataserver

Functions

•  llGetAgentInfo
•  llRequestAgentData

Deep Notes

Signature

function key llRequestAgentData( key id, integer data );