* Fixed UserServer crash when it's passed 00000000000000000000000000 as the UUID.

* It turns out that by proxy, this means that you won't have to look up people's UUID anymore in grid mode, If the UUID is LLUUID.Zero, it tries to look up avatar by name.
afrisby
Teravus Ovares 2007-12-21 19:00:07 +00:00
parent c4987f14e2
commit 13f85c9d82
1 changed files with 28 additions and 3 deletions

View File

@ -156,8 +156,22 @@ namespace OpenSim.Grid.UserServer
UserProfileData userProfile;
if (requestData.Contains("avatar_name"))
{
userProfile = GetUserProfile((string) requestData["avatar_name"]);
if (userProfile == null)
string query = (string)requestData["avatar_name"];
System.Text.RegularExpressions.Regex objAlphaNumericPattern = new System.Text.RegularExpressions.Regex("[^a-zA-Z0-9]");
string[] querysplit;
querysplit = query.Split(' ');
if (querysplit.Length == 2)
{
userProfile = GetUserProfile(querysplit[0],querysplit[1]);
if (userProfile == null)
{
return CreateUnknownUserErrorResponse();
}
}
else
{
return CreateUnknownUserErrorResponse();
}
@ -179,7 +193,18 @@ namespace OpenSim.Grid.UserServer
//CFK: Console.WriteLine("METHOD BY UUID CALLED");
if (requestData.Contains("avatar_uuid"))
{
userProfile = GetUserProfile((LLUUID) (string) requestData["avatar_uuid"]);
LLUUID guess = new LLUUID();
try
{
guess = new LLUUID((string)requestData["avatar_uuid"]);
userProfile = GetUserProfile(guess);
}
catch (System.FormatException)
{
return CreateUnknownUserErrorResponse();
}
if (userProfile == null)
{
return CreateUnknownUserErrorResponse();