Jump to content

Passing users UUID to another object


Patrick Playfair
 Share

You are about to reply to a thread that has been inactive for 2541 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I need to pass a users UUID to another object, and am doing so using RegionSay, with a listener in the other object.  According to the wiki... "Implicit conversion will happen automatically when supplying a string where a key is required."   I have doe this before I believe, but cannot find it anymore.  Below is the code I am using.  The llOwnerSay's were put in to help torubleshoot.  "message" does contain a UUID in string format, and I need to pass that as a key to llRequestExperiencePermissions.  Have tried several ways, the one blow is the most recent.  According to the wiki, key user = "xxxxxxxx-xxxx-xxxx--xxxxxxxxx" will work, but passing the message is not working for me.  Any Ideas?

 

listen(integer channel, string name, key id, string message)
        {
        if(channel==rChannel)
            {
            llListenRemove(handle);
            llOwnerSay("Received " + (string)channel + ", " + name + ", " + (string)id + ", " + message);
            key user = message);
            llRequestExperiencePermissions(user,"");  
            }
        else
            {
            llListenRemove(handle);
            llOwnerSay("Nothing, received " + (string)channel + ", " + name + ", " + (string)id + ", " + message);  
            llResetScript();
            } 
        }

 

Link to comment
Share on other sites

Under some circumstances, LSL implicitly converts strings to keys and under others it doesn't.   Since I can never remember which circumstances are which, I always cast strings into keys rather than hoping LSL will do it for me.

llRequestExperiencePermissions( (key) message); 

should work.

  • Like 1
Link to comment
Share on other sites

Never hurts to also evaluate for valid key with something like:

if ((key)message)

or even string trim of spaces and/or substring 36 digits:

key k = llGetSubString(llStringTrim(message,STRING_TRIM),0,35);
if (k)

I do this mainly with textbox entry as I've accidentally clicked enter after adding the key creating a newline or was copying the key from chat or a spreadsheet and included unwanted spaces.

  • Like 2
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2541 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...