Difference between revisions of "LlGenerateKey"

From Second Life Wiki
Jump to navigation Jump to search
m (Removed reference to generateKey())
(gutted)
Line 1: Line 1:
{{LSL_Function
{{LSL_Function
|func=llGenerateKey
|func=llGenerateKey
|func_desc=Generates a key using Type 3 (MD5) UUID generation to create a unique key using region-name, object-key, service and variable.
|func_desc=Generates a key using Type 3 ([[MD5]]) [[UUID]] generation to create a unique key.
|return_type=key
|return_type=key
|Return_text=generated.
|Return_text=generated.
|p1_type=string|p1_name=service|p1_desc=The service, object, function, or whatever else this key may represent.
|mode
|p2_type=string|p2_name=variable|p2_desc=Any variable(s) relevant to the service that uniquely distinguish it.
|examples
|mode=pre-release
|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!
|cat1=Key
|cat1=Key
|cat2
|cat2
|history=*Library function [[GenerateKey]].
|history=*Inspired by the library function [[generateKey]].
}}{{LSLC{{#var:lang}}|Encryption|llGenerateKey}}
}}{{LSLC{{#var:lang}}|Encryption|llGenerateKey}}

Revision as of 21:32, 7 April 2012