Category talk:LSL Avatar/Name

From Second Life Wiki
Revision as of 13:49, 14 March 2011 by Kimm Paulino (talk | contribs) (Question about LegacyToUsername function)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Presumably, if one checks the size of the list created in the LegacyToUsername function, then it can cope with being given a username or a legacy name and still return the correct string?

i.e. the following ...

<lsl>string LegacyToUsername(string legacy) {

   list name = llParseString2List(llToLower(legacy), [" "],[]);
   if (llGetListLength(name) == 1)//no spaces, so is already a username
       return llList2String(name, 0);//string is already a username
   if(llList2String(name, 1) == "resident")//it's not a legacy account.
       return llList2String(name, 0);//first name is username
   return llDumpList2String(name, ".");

}</lsl>

Kimm Paulino 13:49, 14 March 2011 (PDT)