aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Server/Handlers
diff options
context:
space:
mode:
authorMelanie2012-03-22 20:38:49 +0000
committerMelanie2012-03-22 20:38:49 +0000
commit33818994810130117bae62ba2123bf8b55f181ea (patch)
treeeeb54ef00919abbd1a86b08a659570512856ac42 /OpenSim/Server/Handlers
parentRevert "Stop messing order of updates, destroing the defined order of the sel... (diff)
parentRework Diva's patch to simplify it (diff)
downloadopensim-SC-33818994810130117bae62ba2123bf8b55f181ea.zip
opensim-SC-33818994810130117bae62ba2123bf8b55f181ea.tar.gz
opensim-SC-33818994810130117bae62ba2123bf8b55f181ea.tar.bz2
opensim-SC-33818994810130117bae62ba2123bf8b55f181ea.tar.xz
Merge branch 'master' into careminster
Conflicts: OpenSim/Region/CoreModules/World/Land/LandObject.cs OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
Diffstat (limited to 'OpenSim/Server/Handlers')
-rw-r--r--OpenSim/Server/Handlers/Hypergrid/HGFriendsServerPostHandler.cs57
-rw-r--r--OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs1
2 files changed, 57 insertions, 1 deletions
diff --git a/OpenSim/Server/Handlers/Hypergrid/HGFriendsServerPostHandler.cs b/OpenSim/Server/Handlers/Hypergrid/HGFriendsServerPostHandler.cs
index ca566f2..8ef03e7 100644
--- a/OpenSim/Server/Handlers/Hypergrid/HGFriendsServerPostHandler.cs
+++ b/OpenSim/Server/Handlers/Hypergrid/HGFriendsServerPostHandler.cs
@@ -105,6 +105,9 @@ namespace OpenSim.Server.Handlers.Hypergrid
105 105
106 case "validate_friendship_offered": 106 case "validate_friendship_offered":
107 return ValidateFriendshipOffered(request); 107 return ValidateFriendshipOffered(request);
108
109 case "statusnotification":
110 return StatusNotification(request);
108 /* 111 /*
109 case "friendship_approved": 112 case "friendship_approved":
110 return FriendshipApproved(request); 113 return FriendshipApproved(request);
@@ -197,7 +200,6 @@ namespace OpenSim.Server.Handlers.Hypergrid
197 string message = string.Empty; 200 string message = string.Empty;
198 string name = string.Empty; 201 string name = string.Empty;
199 202
200 m_log.DebugFormat("[HGFRIENDS HANDLER]: Friendship offered");
201 if (!request.ContainsKey("FromID") || !request.ContainsKey("ToID")) 203 if (!request.ContainsKey("FromID") || !request.ContainsKey("ToID"))
202 return BoolResult(false); 204 return BoolResult(false);
203 205
@@ -229,6 +231,59 @@ namespace OpenSim.Server.Handlers.Hypergrid
229 return BoolResult(success); 231 return BoolResult(success);
230 } 232 }
231 233
234 byte[] StatusNotification(Dictionary<string, object> request)
235 {
236 UUID principalID = UUID.Zero;
237 if (request.ContainsKey("userID"))
238 UUID.TryParse(request["userID"].ToString(), out principalID);
239 else
240 {
241 m_log.WarnFormat("[HGFRIENDS HANDLER]: no userID in request to notify");
242 return FailureResult();
243 }
244
245 bool online = true;
246 if (request.ContainsKey("online"))
247 Boolean.TryParse(request["online"].ToString(), out online);
248 else
249 {
250 m_log.WarnFormat("[HGFRIENDS HANDLER]: no online in request to notify");
251 return FailureResult();
252 }
253
254 List<string> friends = new List<string>();
255 int i = 0;
256 foreach (KeyValuePair<string, object> kvp in request)
257 {
258 if (kvp.Key.Equals("friend_" + i.ToString()))
259 {
260 friends.Add(kvp.Value.ToString());
261 i++;
262 }
263 }
264
265 List<UUID> onlineFriends = m_TheService.StatusNotification(friends, principalID, online);
266
267 Dictionary<string, object> result = new Dictionary<string, object>();
268 if ((onlineFriends == null) || ((onlineFriends != null) && (onlineFriends.Count == 0)))
269 result["RESULT"] = "NULL";
270 else
271 {
272 i = 0;
273 foreach (UUID f in onlineFriends)
274 {
275 result["friend_" + i] = f.ToString();
276 i++;
277 }
278 }
279
280 string xmlString = ServerUtils.BuildXmlResponse(result);
281 //m_log.DebugFormat("[GRID HANDLER]: resp string: {0}", xmlString);
282 UTF8Encoding encoding = new UTF8Encoding();
283 return encoding.GetBytes(xmlString);
284
285 }
286
232 287
233 #endregion 288 #endregion
234 289
diff --git a/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs b/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs
index 9a0e27e..db62aaa 100644
--- a/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs
+++ b/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs
@@ -222,6 +222,7 @@ namespace OpenSim.Server.Handlers.Hypergrid
222 222
223 } 223 }
224 224
225 [Obsolete]
225 public XmlRpcResponse StatusNotification(XmlRpcRequest request, IPEndPoint remoteClient) 226 public XmlRpcResponse StatusNotification(XmlRpcRequest request, IPEndPoint remoteClient)
226 { 227 {
227 Hashtable hash = new Hashtable(); 228 Hashtable hash = new Hashtable();