diff options
author | Justin Clark-Casey (justincc) | 2012-03-21 23:59:59 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-03-22 00:00:05 +0000 |
commit | 71ec84d77f440c9801462e1bda95a67f3386a19b (patch) | |
tree | 5819185495a439ca2c5f7455bd377b32332e1254 /OpenSim/Services/Connectors | |
parent | Instead of loading default avatar animations in both SLUtil and AvatarAnimati... (diff) | |
parent | Updated the UserAccountsClient a little bit, plus some more sanity checks on ... (diff) | |
download | opensim-SC-71ec84d77f440c9801462e1bda95a67f3386a19b.zip opensim-SC-71ec84d77f440c9801462e1bda95a67f3386a19b.tar.gz opensim-SC-71ec84d77f440c9801462e1bda95a67f3386a19b.tar.bz2 opensim-SC-71ec84d77f440c9801462e1bda95a67f3386a19b.tar.xz |
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Services/Connectors')
3 files changed, 61 insertions, 1 deletions
diff --git a/OpenSim/Services/Connectors/Hypergrid/HGFriendsServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/HGFriendsServiceConnector.cs index e3f3260..e984a54 100644 --- a/OpenSim/Services/Connectors/Hypergrid/HGFriendsServiceConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/HGFriendsServiceConnector.cs | |||
@@ -255,6 +255,58 @@ namespace OpenSim.Services.Connectors.Hypergrid | |||
255 | return false; | 255 | return false; |
256 | 256 | ||
257 | } | 257 | } |
258 | |||
259 | public List<UUID> StatusNotification(List<string> friends, UUID userID, bool online) | ||
260 | { | ||
261 | Dictionary<string, object> sendData = new Dictionary<string, object>(); | ||
262 | List<UUID> friendsOnline = new List<UUID>(); | ||
263 | |||
264 | sendData["METHOD"] = "statusnotification"; | ||
265 | sendData["userID"] = userID.ToString(); | ||
266 | sendData["online"] = online.ToString(); | ||
267 | int i = 0; | ||
268 | foreach (string s in friends) | ||
269 | { | ||
270 | sendData["friend_" + i.ToString()] = s; | ||
271 | i++; | ||
272 | } | ||
273 | |||
274 | string reply = string.Empty; | ||
275 | string uri = m_ServerURI + "/hgfriends"; | ||
276 | try | ||
277 | { | ||
278 | reply = SynchronousRestFormsRequester.MakeRequest("POST", | ||
279 | uri, | ||
280 | ServerUtils.BuildQueryString(sendData)); | ||
281 | } | ||
282 | catch (Exception e) | ||
283 | { | ||
284 | m_log.DebugFormat("[HGFRIENDS CONNECTOR]: Exception when contacting friends server at {0}: {1}", uri, e.Message); | ||
285 | return friendsOnline; | ||
286 | } | ||
287 | |||
288 | if (reply != string.Empty) | ||
289 | { | ||
290 | Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply); | ||
291 | |||
292 | // Here is the actual response | ||
293 | foreach (string key in replyData.Keys) | ||
294 | { | ||
295 | if (key.StartsWith("friend_") && replyData[key] != null) | ||
296 | { | ||
297 | UUID uuid; | ||
298 | if (UUID.TryParse(replyData[key].ToString(), out uuid)) | ||
299 | friendsOnline.Add(uuid); | ||
300 | } | ||
301 | } | ||
302 | } | ||
303 | else | ||
304 | m_log.DebugFormat("[HGFRIENDS CONNECTOR]: Received empty reply from remote StatusNotify"); | ||
305 | |||
306 | return friendsOnline; | ||
307 | |||
308 | } | ||
309 | |||
258 | #endregion | 310 | #endregion |
259 | } | 311 | } |
260 | } \ No newline at end of file | 312 | } \ No newline at end of file |
diff --git a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs index bf86035..2f263ae 100644 --- a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs | |||
@@ -417,6 +417,7 @@ namespace OpenSim.Services.Connectors.Hypergrid | |||
417 | GetBoolResponse(request, out reason); | 417 | GetBoolResponse(request, out reason); |
418 | } | 418 | } |
419 | 419 | ||
420 | [Obsolete] | ||
420 | public List<UUID> StatusNotification(List<string> friends, UUID userID, bool online) | 421 | public List<UUID> StatusNotification(List<string> friends, UUID userID, bool online) |
421 | { | 422 | { |
422 | Hashtable hash = new Hashtable(); | 423 | Hashtable hash = new Hashtable(); |
diff --git a/OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs b/OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs index 609dafe..6d5ce28 100644 --- a/OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs +++ b/OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs | |||
@@ -197,8 +197,15 @@ namespace OpenSim.Services.Connectors | |||
197 | 197 | ||
198 | Dictionary<string, object> structData = data.ToKeyValuePairs(); | 198 | Dictionary<string, object> structData = data.ToKeyValuePairs(); |
199 | 199 | ||
200 | foreach (KeyValuePair<string,object> kvp in structData) | 200 | foreach (KeyValuePair<string, object> kvp in structData) |
201 | { | ||
202 | if (kvp.Value == null) | ||
203 | { | ||
204 | m_log.DebugFormat("[ACCOUNTS CONNECTOR]: Null value for {0}", kvp.Key); | ||
205 | continue; | ||
206 | } | ||
201 | sendData[kvp.Key] = kvp.Value.ToString(); | 207 | sendData[kvp.Key] = kvp.Value.ToString(); |
208 | } | ||
202 | 209 | ||
203 | return SendAndGetBoolReply(sendData); | 210 | return SendAndGetBoolReply(sendData); |
204 | } | 211 | } |