mirror of
https://github.com/opensim/opensim.git
synced 2026-08-07 01:35:46 +08:00
Have osAvatarName2Key check the cache first, even for foreign users
Another change: removed the second call to userManager.AddUser(). UserManagementModule won't modify an existing record.
This commit is contained in:
@@ -2744,7 +2744,9 @@ namespace OpenSim.Framework
|
||||
#endregion
|
||||
|
||||
#region Universal User Identifiers
|
||||
/// <summary>
|
||||
|
||||
/// <summary>
|
||||
/// Attempts to parse a UUI into its components: UUID, name and URL.
|
||||
/// </summary>
|
||||
/// <param name="value">uuid[;endpoint[;first last[;secret]]]</param>
|
||||
/// <param name="uuid">the uuid part</param>
|
||||
@@ -2779,6 +2781,27 @@ namespace OpenSim.Framework
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// For foreign avatars, extracts their original name and Server URL from their First Name and Last Name.
|
||||
/// </summary>
|
||||
public static bool ParseForeignAvatarName(string firstname, string lastname,
|
||||
out string realFirstName, out string realLastName, out string serverURI)
|
||||
{
|
||||
realFirstName = realLastName = serverURI = string.Empty;
|
||||
|
||||
if (!lastname.Contains("@"))
|
||||
return false;
|
||||
|
||||
if (!firstname.Contains("."))
|
||||
return false;
|
||||
|
||||
realFirstName = firstname.Split('.')[0];
|
||||
realLastName = firstname.Split('.')[1];
|
||||
serverURI = new Uri("http://" + lastname.Replace("@", "")).ToString();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Produces a universal (HG) system-facing identifier given the information
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user