Difference between revisions of "Category talk:LSL Avatar/Name"

From Second Life Wiki
Jump to navigation Jump to search
(Question about LegacyToUsername function)
(No difference)

Revision as of 13:49, 14 March 2011

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)