Difference between revisions of "LlGenerateKey"

From Second Life Wiki
Jump to: navigation, search
m (make sure translations end up in the right categories)
m (Removed reference to generateKey())
Line 7: Line 7:
 
|p2_type=string|p2_name=variable|p2_desc=Any variable(s) relevant to the service that uniquely distinguish it.
 
|p2_type=string|p2_name=variable|p2_desc=Any variable(s) relevant to the service that uniquely distinguish it.
 
|mode=pre-release
 
|mode=pre-release
|examples=In a two-prim linked-set put the following script (adding generateKey where noted) into the child-prim:<lsl>integer requestID = 0;
+
|examples=In a two-prim linked-set put the following script into the child prim:<lsl>integer requestID = 0;
  
 
default {
 
default {

Revision as of 04:48, 6 April 2012

Emblem-important-red.png Pre-release Documentation Warning!

This function is not available yet. This documentation was written prior to its final release so it may not match the final implementation.

Summary

Function: key llGenerateKey( string service, string variable );

Generates a key using Type 3 (MD5) UUID generation to create a unique key using region-name, object-key, service and variable.
Returns the key generated.

• string service The service, object, function, or whatever else this key may represent.
• string variable Any variable(s) relevant to the service that uniquely distinguish it.

Examples

In a two-prim linked-set put the following script into the child prim:<lsl>integer requestID = 0;

default {

   touch_start(integer x) {
       llMessageLinked(
           LINK_ROOT, 
           1234, 
           "I am a request", 
           llGenerateKey("echo", (string)requestID++)
       );
   }
   link_message(integer x, integer y, string msg, key id) {
       if (y == 1234) 
           llOwnerSay("Request: " + (string)id + " = " + msg);
   }

}</lsl>And the following script in the root-prim:<lsl>default {

   link_message(integer x, integer y, string msg, key id) {
       if (y == 1234) // Echo, send straight back
           llMessageLinked(x, y, msg, id);
   }
}</lsl>Simply touch the child-prim to use, enjoy!

Deep Notes

History

Search JIRA for related Issues

Signature

function key llGenerateKey( string service, string variable );