From 13f85c9d8262f386d722969cd5222b05d123baa4 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Fri, 21 Dec 2007 19:00:07 +0000 Subject: * 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. --- OpenSim/Grid/UserServer/UserManager.cs | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/OpenSim/Grid/UserServer/UserManager.cs b/OpenSim/Grid/UserServer/UserManager.cs index 43239a0..be9e6f1 100644 --- a/OpenSim/Grid/UserServer/UserManager.cs +++ b/OpenSim/Grid/UserServer/UserManager.cs @@ -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(); -- cgit v1.1