Difference between revisions of "LlRequestUserKey"

From Second Life Wiki
Jump to navigation Jump to search
m
 
(7 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{KBnote|This function is coming soon but is not yet available.}}
{{LSLC|Functions}}
{{LSL_Function
{{LSL_Function
|func=llRequestUserKey
|func=llRequestUserKey
Line 11: Line 11:
The agent being searched for with this function does not need to be signed on to Second Life.
The agent being searched for with this function does not need to be signed on to Second Life.
|spec
|spec
|caveats
|caveats=
* This function is throttled. The throttle is undocumented, but as of October 2018 the function appears to support bursts of up to 20 requests and sustained use at an average rate of 1.9 requests per second per owner, per region. (Meaning the throttle applies to all objects in the region with the same owner.) Once tripped, the function fails and says "Too many llRequestUserKey requests.  Throttled until average falls." on [[DEBUG_CHANNEL]].
* This function will return a NULL_KEY for any agent that has yet to log on to the grid the function is used on.
|examples=<source lang="lsl2">key name_key_query;
|examples=<source lang="lsl2">key name_key_query;
default
default
Line 17: Line 19:
   state_entry()
   state_entry()
   {
   {
       owner_name_query = llRequestUserKey("rider.linden");
       name_key_query = llRequestUserKey("rider.linden");
   }
   }


Line 32: Line 34:
|also
|also
|also_functions=
|also_functions=
{{LSL DefineRow||[[llName2Key]]}} to fetch avatar UUID by name.
{{LSL DefineRow||[[llRequestUsername]]|to translate a key to a name}}
{{LSL DefineRow||[[llName2Key]]|to fetch avatar UUID by name.}}
|notes=Names are always provided in the form <nowiki>"First[ Last]" or "first[.last]"</nowiki> (first name with an optional last name.) If the last name is omitted a last name of "Resident" is assumed. Case is not considered when resolving agent names.
|notes=Names are always provided in the form <nowiki>"First[ Last]" or "first[.last]"</nowiki> (first name with an optional last name.) If the last name is omitted a last name of "Resident" is assumed. Case is not considered when resolving agent names.
}}
}}

Latest revision as of 13:52, 27 February 2020

Summary

Function: key llRequestUserKey( string username );

Requests the Agent ID for the agent identified by name from the dataserver. The name given may be either the current name of an avatar or a historical name that has been used in the past. If no agent can be found with the supplied name this function returns the value NULL_KEY.

Returns a handle (a key) that can be used to identify the request when the dataserver event is raised.

The agent being searched for with this function does not need to be signed on to Second Life.
Returns a key

• string username the username of the avatar to retrieve the UUID of.

Caveats

  • This function is throttled. The throttle is undocumented, but as of October 2018 the function appears to support bursts of up to 20 requests and sustained use at an average rate of 1.9 requests per second per owner, per region. (Meaning the throttle applies to all objects in the region with the same owner.) Once tripped, the function fails and says "Too many llRequestUserKey requests. Throttled until average falls." on DEBUG_CHANNEL.
  • This function will return a NULL_KEY for any agent that has yet to log on to the grid the function is used on.

Examples

key name_key_query;
default
{
   state_entry()
   {
       name_key_query = llRequestUserKey("rider.linden");
   }

   dataserver(key queryid, string data) 
   {
       if ( name_key_query == queryid )
       {
           llSay(0, "The key for this user is : " + data);
       }
   }
}

Notes

Names are always provided in the form "First[ Last]" or "first[.last]" (first name with an optional last name.) If the last name is omitted a last name of "Resident" is assumed. Case is not considered when resolving agent names.

See Also

Functions

•  llRequestUsername to translate a key to a name
•  llName2Key to fetch avatar UUID by name.

Deep Notes

Signature

function key llRequestUserKey( string username );