diff options
author | lbsa71 | 2007-12-27 21:41:48 +0000 |
---|---|---|
committer | lbsa71 | 2007-12-27 21:41:48 +0000 |
commit | efd90b56b761219af6425b1c7a2cdd3b6ffb4de2 (patch) | |
tree | bf5b897e1e3c13211e3e2fc61d30508b94c928c0 /OpenSim/Region/Communications/OGS1/OGS1UserServices.cs | |
parent | * removed always true if (diff) | |
download | opensim-SC_OLD-efd90b56b761219af6425b1c7a2cdd3b6ffb4de2.zip opensim-SC_OLD-efd90b56b761219af6425b1c7a2cdd3b6ffb4de2.tar.gz opensim-SC_OLD-efd90b56b761219af6425b1c7a2cdd3b6ffb4de2.tar.bz2 opensim-SC_OLD-efd90b56b761219af6425b1c7a2cdd3b6ffb4de2.tar.xz |
* Optimized usings
* shortened references
* Removed redundant 'this'
* Normalized EOF
Diffstat (limited to 'OpenSim/Region/Communications/OGS1/OGS1UserServices.cs')
-rw-r--r-- | OpenSim/Region/Communications/OGS1/OGS1UserServices.cs | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs index c1e6ba6..3a2e138 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs | |||
@@ -30,6 +30,7 @@ using System; | |||
30 | using System.Collections; | 30 | using System.Collections; |
31 | using System.Collections.Generic; | 31 | using System.Collections.Generic; |
32 | using System.Net; | 32 | using System.Net; |
33 | using System.Text.RegularExpressions; | ||
33 | using libsecondlife; | 34 | using libsecondlife; |
34 | using Nwc.XmlRpc; | 35 | using Nwc.XmlRpc; |
35 | using OpenSim.Framework; | 36 | using OpenSim.Framework; |
@@ -50,7 +51,9 @@ namespace OpenSim.Region.Communications.OGS1 | |||
50 | { | 51 | { |
51 | if (data.Contains("error_type")) | 52 | if (data.Contains("error_type")) |
52 | { | 53 | { |
53 | MainLog.Instance.Warn("GRID", "Error sent by user server when trying to get user profile: (" + data["error_type"] + | 54 | MainLog.Instance.Warn("GRID", |
55 | "Error sent by user server when trying to get user profile: (" + | ||
56 | data["error_type"] + | ||
54 | "): " + data["error_desc"]); | 57 | "): " + data["error_desc"]); |
55 | return null; | 58 | return null; |
56 | } | 59 | } |
@@ -80,19 +83,19 @@ namespace OpenSim.Region.Communications.OGS1 | |||
80 | return userData; | 83 | return userData; |
81 | } | 84 | } |
82 | 85 | ||
83 | public List<AvatarPickerAvatar> ConvertXMLRPCDataToAvatarPickerList(LLUUID queryID,Hashtable data) | 86 | public List<AvatarPickerAvatar> ConvertXMLRPCDataToAvatarPickerList(LLUUID queryID, Hashtable data) |
84 | { | 87 | { |
85 | List<AvatarPickerAvatar> pickerlist = new List<AvatarPickerAvatar>(); | 88 | List<AvatarPickerAvatar> pickerlist = new List<AvatarPickerAvatar>(); |
86 | int pickercount = Convert.ToInt32((string)data["avcount"]); | 89 | int pickercount = Convert.ToInt32((string) data["avcount"]); |
87 | LLUUID respqueryID = new LLUUID((string)data["queryid"]); | 90 | LLUUID respqueryID = new LLUUID((string) data["queryid"]); |
88 | if (queryID == respqueryID) | 91 | if (queryID == respqueryID) |
89 | { | 92 | { |
90 | for (int i = 0; i < pickercount; i++) | 93 | for (int i = 0; i < pickercount; i++) |
91 | { | 94 | { |
92 | AvatarPickerAvatar apicker = new AvatarPickerAvatar(); | 95 | AvatarPickerAvatar apicker = new AvatarPickerAvatar(); |
93 | LLUUID avatarID = new LLUUID((string)data["avatarid" + i.ToString()]); | 96 | LLUUID avatarID = new LLUUID((string) data["avatarid" + i.ToString()]); |
94 | string firstname = (string)data["firstname" + i.ToString()]; | 97 | string firstname = (string) data["firstname" + i.ToString()]; |
95 | string lastname = (string)data["lastname" + i.ToString()]; | 98 | string lastname = (string) data["lastname" + i.ToString()]; |
96 | apicker.AvatarID = avatarID; | 99 | apicker.AvatarID = avatarID; |
97 | apicker.firstName = firstname; | 100 | apicker.firstName = firstname; |
98 | apicker.lastName = lastname; | 101 | apicker.lastName = lastname; |
@@ -114,18 +117,18 @@ namespace OpenSim.Region.Communications.OGS1 | |||
114 | public List<AvatarPickerAvatar> GenerateAgentPickerRequestResponse(LLUUID queryID, string query) | 117 | public List<AvatarPickerAvatar> GenerateAgentPickerRequestResponse(LLUUID queryID, string query) |
115 | { | 118 | { |
116 | List<AvatarPickerAvatar> pickerlist = new List<AvatarPickerAvatar>(); | 119 | List<AvatarPickerAvatar> pickerlist = new List<AvatarPickerAvatar>(); |
117 | System.Text.RegularExpressions.Regex objAlphaNumericPattern = new System.Text.RegularExpressions.Regex("[^a-zA-Z0-9 ]"); | 120 | Regex objAlphaNumericPattern = new Regex("[^a-zA-Z0-9 ]"); |
118 | try | 121 | try |
119 | { | 122 | { |
120 | Hashtable param = new Hashtable(); | 123 | Hashtable param = new Hashtable(); |
121 | param["queryid"] = (string)queryID.ToString(); | 124 | param["queryid"] = (string) queryID.ToString(); |
122 | param["avquery"] = objAlphaNumericPattern.Replace(query, ""); | 125 | param["avquery"] = objAlphaNumericPattern.Replace(query, ""); |
123 | IList parameters = new ArrayList(); | 126 | IList parameters = new ArrayList(); |
124 | parameters.Add(param); | 127 | parameters.Add(param); |
125 | XmlRpcRequest req = new XmlRpcRequest("get_avatar_picker_avatar", parameters); | 128 | XmlRpcRequest req = new XmlRpcRequest("get_avatar_picker_avatar", parameters); |
126 | XmlRpcResponse resp = req.Send(m_parent.NetworkServersInfo.UserURL, 3000); | 129 | XmlRpcResponse resp = req.Send(m_parent.NetworkServersInfo.UserURL, 3000); |
127 | Hashtable respData = (Hashtable)resp.Value; | 130 | Hashtable respData = (Hashtable) resp.Value; |
128 | pickerlist = ConvertXMLRPCDataToAvatarPickerList(queryID,respData); | 131 | pickerlist = ConvertXMLRPCDataToAvatarPickerList(queryID, respData); |
129 | } | 132 | } |
130 | catch (WebException e) | 133 | catch (WebException e) |
131 | { | 134 | { |
@@ -196,7 +199,7 @@ namespace OpenSim.Region.Communications.OGS1 | |||
196 | return profile; | 199 | return profile; |
197 | } | 200 | } |
198 | 201 | ||
199 | public UserProfileData SetupMasterUser(libsecondlife.LLUUID uuid) | 202 | public UserProfileData SetupMasterUser(LLUUID uuid) |
200 | { | 203 | { |
201 | UserProfileData data = GetUserProfile(uuid); | 204 | UserProfileData data = GetUserProfile(uuid); |
202 | if (data == null) | 205 | if (data == null) |
@@ -211,4 +214,4 @@ namespace OpenSim.Region.Communications.OGS1 | |||
211 | throw new Exception("The method or operation is not implemented."); | 214 | throw new Exception("The method or operation is not implemented."); |
212 | } | 215 | } |
213 | } | 216 | } |
214 | } | 217 | } \ No newline at end of file |