Difference between revisions of "LlRequestClientData"

From Second Life Wiki
Jump to navigation Jump to search
(See also: GetOperatingSystem GetViewerVersion etc. in LSL_To_Client_Communication)
(Edited according to LSL Function style *without* adding it to the active LSL Function List)
Line 1: Line 1:
See also: GetOperatingSystem GetViewerVersion etc. in [[LSL_To_Client_Communication]]
{{LSL Header}}__NOTOC__
 
<div id="box">
----
{{#vardefine:p_id_desc|avatar [[UUID]]}}
 
{{#vardefine:p_data_desc|DATA_* flag}}
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:
== Function: [[key]] llRequestClientData([[key]] {{LSL Param|id}}, [[integer]] {{LSL Param|data}}); ==
<div style="padding: 0.5em;">
Requests '''{{LSL Param|data}}''' about the client app of online agent '''{{LSL Param|id}}'''. When '''{{LSL Param|data}}''' is available the [[dataserver]] event will be raised
{|
{{LSL DefineRow|[[key]]|id|{{#var:p_id_desc}}}}
{{LSL DefineRow|[[integer]]|data|{{#var:p_data_desc}}}}
|}
<br/>
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 current or obsolete?
Line 14: Line 22:


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.
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.
 
----
{{#vardefine:p_data_desc|DATA_* flag}}{{LSL_Function
A: Here we are, entry now adapted. But '''don't''' use the [[Template:LSL_Function|LSL Function]] template for any description other than a real LSL function. The template '''automatically''' adds the entry to the LSL function list, where this wished function already was listed before being corrected by this change!
|func_id=155|func_sleep=0.1|func_energy=10.0
</div></div>
|func=llRequestAgentData
----
|return_type=key
<div id="box">
|p1_type=key|p1_name=id|p1_hover=avatar UUID|p1_desc=avatar {{HoverLink|UUID|Universally Unique Identifier}}
== Example ==
|p2_type=integer|p2_name=data
<div style="padding: 0.5em;">
|func_footnote
<pre>
|func_desc=Requests '''{{LSL Param|data}}''' about the client app of online agent '''id'''. When '''{{LSL Param|data}}''' is available the [[dataserver]] event will be raised
|return_text=that is used to identify the [[dataserver]] event when it is raise.
|spec
|caveats
|constants={{{!}} {{Prettytable}}
{{!}}- {{Hl2}}
! colspan="2" {{!}} {{LSL Param|data}} Constant
! Type
! colspan="4" {{!}} Description
{{!}}-
{{Template:LSL_Constants/llRequestAgentData}}
{{!}}}
|examples=<pre>
key owner_key;
key owner_key;
key client_name_query;
key client_name_query;
Line 53: Line 48:
         }
         }
     }
     }
}//~~~~
}
</pre>
</pre>
|helpers
</div></div>
|also_functions={{LSL DefineRow||[[llGetAgentInfo]]|}}
<div id="box">
{{LSL DefineRow||[[llRequestAgentData]]|}}
== See Also ==
|also_tests
<div style="padding: 0.5em">
|also_events={{LSL DefineRow||[[dataserver]]|}}
'''Articles'''
|also_articles
*Design Discussions: [[LSL_To_Client_Communication#GetOperatingSystem|Get Operating System]]
|notes
*Design Discussions: [[LSL_To_Client_Communication#GetOperatingSystem|Get Viewer Version ]]
|deprecated
[[Category:Design Discussions]]
|cat1=Dataserver
|cat2
|cat3
|cat4
}}

Revision as of 09:33, 17 September 2007


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

• key id avatar UUID
• integer data DATA_* flag


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 are, entry now adapted. But don't use the LSL Function template for any description other than a real LSL function. The template automatically adds the entry to the LSL function list, where this wished function already was listed before being corrected by this change!


Example

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

Articles