llRequestClientData

From Second Life Wiki
Revision as of 02:32, 2 October 2007 by Huney Jewell (talk | contribs) (Formatted using 'Function' template with parm mode=request (still not perfect @ Also and Categories))
Jump to navigation Jump to search
Emblem-important-yellow.png LSL Feature Request
The described function does not exist. This article is a feature request.

Summary

Function: key llRequestClientData( key id, integer data );

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 raised

• key id avatar UUID
• integer data DATA_* flag

Specification

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.


A: Here we go, entry now adapted. But only use the LSL Function template with parameter "|mode=request" for a function description on WishList. Else the template automatically adds the entry to the LSL function index, where this requested function already was listed before being corrected by this change!

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);
        }
    }
}

Deep Notes

Signature

//function key llRequestClientData( key id, integer data );