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:
Oren Hurvitz
2015-08-07 11:34:52 +03:00
parent f218cbd29d
commit 2153a01cc7
2 changed files with 47 additions and 23 deletions

View File

@@ -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>