aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Grid/UserServer/UserManager.cs
diff options
context:
space:
mode:
authorTeravus Ovares2008-01-02 00:54:50 +0000
committerTeravus Ovares2008-01-02 00:54:50 +0000
commit3738bc88999d4cf8060fa2535cb264e0cddcb8c7 (patch)
tree3e113c52cc51f7f8c7a43a938afcd27d6edb2579 /OpenSim/Grid/UserServer/UserManager.cs
parentFixed nant compile problem (diff)
downloadopensim-SC_OLD-3738bc88999d4cf8060fa2535cb264e0cddcb8c7.zip
opensim-SC_OLD-3738bc88999d4cf8060fa2535cb264e0cddcb8c7.tar.gz
opensim-SC_OLD-3738bc88999d4cf8060fa2535cb264e0cddcb8c7.tar.bz2
opensim-SC_OLD-3738bc88999d4cf8060fa2535cb264e0cddcb8c7.tar.xz
* Updates UserServer
* Updates OSG1UserServices * Friends list is now persistent in grid mode. * You can add, new friends and remove them
Diffstat (limited to '')
-rw-r--r--OpenSim/Grid/UserServer/UserManager.cs98
1 files changed, 97 insertions, 1 deletions
diff --git a/OpenSim/Grid/UserServer/UserManager.cs b/OpenSim/Grid/UserServer/UserManager.cs
index a50419e..c905ffe 100644
--- a/OpenSim/Grid/UserServer/UserManager.cs
+++ b/OpenSim/Grid/UserServer/UserManager.cs
@@ -87,10 +87,29 @@ namespace OpenSim.Grid.UserServer
87 responseData["lastname" + i.ToString()] = returnUsers[i].lastName; 87 responseData["lastname" + i.ToString()] = returnUsers[i].lastName;
88 } 88 }
89 response.Value = responseData; 89 response.Value = responseData;
90 90
91 return response; 91 return response;
92 } 92 }
93 93
94 public XmlRpcResponse FriendListItemListtoXmlRPCResponse(List<FriendListItem> returnUsers)
95 {
96 XmlRpcResponse response = new XmlRpcResponse();
97 Hashtable responseData = new Hashtable();
98 // Query Result Information
99
100 responseData["avcount"] = (string)returnUsers.Count.ToString();
101
102 for (int i = 0; i < returnUsers.Count; i++)
103 {
104 responseData["ownerID" + i.ToString()] = returnUsers[i].FriendListOwner.UUID.ToString();
105 responseData["friendID" + i.ToString()] = returnUsers[i].Friend.UUID.ToString();
106 responseData["ownerPerms" + i.ToString()] = returnUsers[i].FriendListOwnerPerms.ToString();
107 responseData["friendPerms" + i.ToString()] = returnUsers[i].FriendPerms.ToString();
108 }
109 response.Value = responseData;
110
111 return response;
112 }
94 /// <summary> 113 /// <summary>
95 /// Converts a user profile to an XML element which can be returned 114 /// Converts a user profile to an XML element which can be returned
96 /// </summary> 115 /// </summary>
@@ -151,6 +170,83 @@ namespace OpenSim.Grid.UserServer
151 return AvatarPickerListtoXmlRPCResponse(queryID, returnAvatar); 170 return AvatarPickerListtoXmlRPCResponse(queryID, returnAvatar);
152 } 171 }
153 172
173 public XmlRpcResponse XmlRpcResponseXmlRPCAddUserFriend(XmlRpcRequest request)
174 {
175 XmlRpcResponse response = new XmlRpcResponse();
176 Hashtable requestData = (Hashtable)request.Params[0];
177 Hashtable responseData = new Hashtable();
178 string returnString = "FALSE";
179 // Query Result Information
180
181 if (requestData.Contains("ownerID") && requestData.Contains("friendID") && requestData.Contains("friendPerms"))
182 {
183 // UserManagerBase.AddNewuserFriend
184 AddNewUserFriend(new LLUUID((string)requestData["ownerID"]), new LLUUID((string)requestData["friendID"]), (uint)Convert.ToInt32((string)requestData["friendPerms"]));
185 returnString = "TRUE";
186 }
187 responseData["returnString"] = returnString;
188 response.Value = responseData;
189 return response;
190 }
191
192 public XmlRpcResponse XmlRpcResponseXmlRPCRemoveUserFriend(XmlRpcRequest request)
193 {
194 XmlRpcResponse response = new XmlRpcResponse();
195 Hashtable requestData = (Hashtable)request.Params[0];
196 Hashtable responseData = new Hashtable();
197 string returnString = "FALSE";
198 // Query Result Information
199
200 if (requestData.Contains("ownerID") && requestData.Contains("friendID"))
201 {
202 // UserManagerBase.AddNewuserFriend
203 RemoveUserFriend(new LLUUID((string)requestData["ownerID"]), new LLUUID((string)requestData["friendID"]));
204 returnString = "TRUE";
205 }
206 responseData["returnString"] = returnString;
207 response.Value = responseData;
208 return response;
209
210 }
211
212 public XmlRpcResponse XmlRpcResponseXmlRPCUpdateUserFriendPerms(XmlRpcRequest request)
213 {
214 XmlRpcResponse response = new XmlRpcResponse();
215 Hashtable requestData = (Hashtable)request.Params[0];
216 Hashtable responseData = new Hashtable();
217 string returnString = "FALSE";
218
219
220
221 if (requestData.Contains("ownerID") && requestData.Contains("friendID") && requestData.Contains("friendPerms"))
222 {
223 UpdateUserFriendPerms(new LLUUID((string)requestData["ownerID"]), new LLUUID((string)requestData["friendID"]), (uint)Convert.ToInt32((string)requestData["friendPerms"]));
224 // UserManagerBase.
225 returnString = "TRUE";
226 }
227 responseData["returnString"] = returnString;
228 response.Value = responseData;
229 return response;
230 }
231
232 public XmlRpcResponse XmlRpcResponseXmlRPCGetUserFriendList(XmlRpcRequest request)
233 {
234 XmlRpcResponse response = new XmlRpcResponse();
235 Hashtable requestData = (Hashtable)request.Params[0];
236 Hashtable responseData = new Hashtable();
237
238 List<FriendListItem> returndata = new List<FriendListItem>();
239
240
241
242 if (requestData.Contains("ownerID"))
243 {
244 returndata = this.GetUserFriendList(new LLUUID((string)requestData["ownerID"]));
245 }
246
247 return FriendListItemListtoXmlRPCResponse(returndata);
248 }
249
154 public XmlRpcResponse XmlRPCGetUserMethodName(XmlRpcRequest request) 250 public XmlRpcResponse XmlRPCGetUserMethodName(XmlRpcRequest request)
155 { 251 {
156 XmlRpcResponse response = new XmlRpcResponse(); 252 XmlRpcResponse response = new XmlRpcResponse();