Category talk:LSL Avatar/Name

From Second Life Wiki
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)

I'm pretty sure the old version would have no issue with a username but the new version usernames will fall straight through. -- Strife (talk|contribs) 11:17, 19 June 2012 (PDT)