mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 20:05:33 +08:00
* refactor: move iar name hashing into a method
This commit is contained in:
@@ -104,6 +104,16 @@ namespace OpenSim.Framework.Communications
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Hash a profile name into a UUID
|
||||
/// </summary>
|
||||
/// <param name="name"></param>
|
||||
/// <returns></returns>
|
||||
public static UUID HashName(string name)
|
||||
{
|
||||
return new UUID(Utils.MD5(Encoding.Unicode.GetBytes(name)), 0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resolve an OSPI name by querying existing persistent user profiles. If there is no persistent user profile
|
||||
/// then a temporary user profile is inserted in the cache.
|
||||
@@ -133,7 +143,7 @@ namespace OpenSim.Framework.Communications
|
||||
UserProfileData tempUserProfile = new UserProfileData();
|
||||
tempUserProfile.FirstName = firstName;
|
||||
tempUserProfile.SurName = lastName;
|
||||
tempUserProfile.ID = new UUID(Utils.MD5(Encoding.Unicode.GetBytes(tempUserProfile.Name)), 0);
|
||||
tempUserProfile.ID = HashName(tempUserProfile.Name);
|
||||
|
||||
m_log.DebugFormat(
|
||||
"[OSP RESOLVER]: Adding temporary user profile for {0} {1}", tempUserProfile.Name, tempUserProfile.ID);
|
||||
|
||||
Reference in New Issue
Block a user