Difference between revisions of "Category:LSL Avatar/Name"
(→Other names: minor clarification in comparison) |
m (I haven't seen that style on the wiki before.) |
||
Line 62: | Line 62: | ||
The default value of the Display Name depends upon the type of the account. For modern accounts, it is the first part of the Legacy Name (without the space and last name "Resident"; this is the same as the Username with capitalization used at registration time preserved). For legacy accounts, it is the full Legacy Name. | The default value of the Display Name depends upon the type of the account. For modern accounts, it is the first part of the Legacy Name (without the space and last name "Resident"; this is the same as the Username with capitalization used at registration time preserved). For legacy accounts, it is the full Legacy Name. | ||
<lsl>string | <lsl>string agentDefaultName(string agentUsername, string agentLegacyName) { | ||
agentDefaultName(string agentUsername, string agentLegacyName) { | |||
integer i = llStringLength(agentUsername); | integer i = llStringLength(agentUsername); | ||
if (i < llStringLength(agentLegacyName)) { | if (i < llStringLength(agentLegacyName)) { | ||
Line 78: | Line 77: | ||
[[Viewer URI Name Space]] apparently also defines something called a Complete Name, which seems to be just the Display Name made unique by appending the Username in parenthesis when the Display Name is not set to its default value (and just the Display Name when it is set to its default value). | [[Viewer URI Name Space]] apparently also defines something called a Complete Name, which seems to be just the Display Name made unique by appending the Username in parenthesis when the Display Name is not set to its default value (and just the Display Name when it is set to its default value). | ||
<lsl>string | <lsl>string agentCompleteName(string agentDisplayName, string agentUsername, string agentLegacyName) { | ||
agentCompleteName(string agentDisplayName, string agentUsername, string agentLegacyName) { | |||
if (agentDisplayName == agentDefaultName(agentUsername, agentLegacyName)) { | if (agentDisplayName == agentDefaultName(agentUsername, agentLegacyName)) { | ||
return agentDisplayName; | return agentDisplayName; | ||
Line 88: | Line 86: | ||
Some Second Life web pages (e.g., friends online: https://secondlife.com/my/account/friends.php or search results from: http://search.secondlife.com/) seem to return another form of naming similar to the Complete Name. This name is also just the Display Name made unique by appending a unique name in parenthesis when the Display Name is not set to its default value. The difference seems to be that the appended unique value is the default Display Name, instead of the Username, so this name always contains the default Display Name (with the current Display Name prepended). | Some Second Life web pages (e.g., friends online: https://secondlife.com/my/account/friends.php or search results from: http://search.secondlife.com/) seem to return another form of naming similar to the Complete Name. This name is also just the Display Name made unique by appending a unique name in parenthesis when the Display Name is not set to its default value. The difference seems to be that the appended unique value is the default Display Name, instead of the Username, so this name always contains the default Display Name (with the current Display Name prepended). | ||
<lsl>string | <lsl>string agentWebName(string agentDisplayName, string agentUsername, string agentLegacyName) { | ||
agentWebName(string agentDisplayName, string agentUsername, string agentLegacyName) { | |||
string agentDefaultName = agentDefaultName(agentUsername, agentLegacyName); | string agentDefaultName = agentDefaultName(agentUsername, agentLegacyName); | ||
if (agentDisplayName == agentDefaultName) { | if (agentDisplayName == agentDefaultName) { |
Revision as of 09:59, 19 June 2012
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Names
From an LSL standpoint avatars can have 3 different names.
Naming | Description | Unique | Get (in region) | Request (dataserver) | llSensor(Repeat) flags | detected events |
---|---|---|---|---|---|---|
Display Name | The name that is displayed on the screen. | No | llGetDisplayName | llRequestDisplayName | N/A | N/A |
Username | The name the users logs in with. | Yes | llGetUsername | llRequestUsername | AGENT_BY_USERNAME | N/A |
Legacy Name | An interface predating Display Names. | Yes | llKey2Name | llRequestAgentData | AGENT_BY_LEGACY_NAME | llDetectedName |
Naming | Modern | Legacy |
---|---|---|
Default Display Name | "FirstName" | "FirstName LastName" |
Username | "firstname" | "firstname.lastname" |
Legacy Name | "FirstName Resident" | "FirstName LastName" |
Modern and Legacy Accounts
- Modern accounts are created by choosing a user name, which consists of one name (no spaces).
- Legacy accounts were created by choosing two names: first and last names. These two names are used together to form the username.
To maintain compatibility with legacy scripts (that expect two names), modern accounts are given the legacy last name "Resident".
The default value of the Display Name depends upon the type of the account. For modern accounts, it is the first part of the Legacy Name (without the space and last name "Resident"; this is the same as the Username with capitalization used at registration time preserved). For legacy accounts, it is the full Legacy Name. <lsl>string agentDefaultName(string agentUsername, string agentLegacyName) {
integer i = llStringLength(agentUsername); if (i < llStringLength(agentLegacyName)) { // modern account return llDeleteSubString(agentLegacyName, i, -1); } else { // legacy account return agentLegacyName; }
} </lsl>
Other names
Viewer URI Name Space apparently also defines something called a Complete Name, which seems to be just the Display Name made unique by appending the Username in parenthesis when the Display Name is not set to its default value (and just the Display Name when it is set to its default value). <lsl>string agentCompleteName(string agentDisplayName, string agentUsername, string agentLegacyName) {
if (agentDisplayName == agentDefaultName(agentUsername, agentLegacyName)) { return agentDisplayName; } else { return agentDisplayName + " (" + agentUsername + ")"; }
}</lsl>
Some Second Life web pages (e.g., friends online: https://secondlife.com/my/account/friends.php or search results from: http://search.secondlife.com/) seem to return another form of naming similar to the Complete Name. This name is also just the Display Name made unique by appending a unique name in parenthesis when the Display Name is not set to its default value. The difference seems to be that the appended unique value is the default Display Name, instead of the Username, so this name always contains the default Display Name (with the current Display Name prepended). <lsl>string agentWebName(string agentDisplayName, string agentUsername, string agentLegacyName) {
string agentDefaultName = agentDefaultName(agentUsername, agentLegacyName); if (agentDisplayName == agentDefaultName) { return agentDisplayName; } else { return agentDisplayName + " (" + agentDefaultName + ")"; }
}</lsl>
Legacy-Name Only Functions
These functions only take Legacy Names and there are no alternative functions available.
- llCollisionFilter
- llListen - likewise the listen event only has a Legacy Name parameter.
FAQs
There are a couple of FAQs that go into much more detail about this:
- LSL FAQ: Display Names/LSL
- General FAQ: Display Names
Subcategories
This category has the following 5 subcategories, out of 5 total.
Pages in category "LSL Avatar/Name"
The following 9 pages are in this category, out of 9 total.