diff options
author | Melanie | 2009-12-28 23:42:08 +0000 |
---|---|---|
committer | Melanie | 2009-12-28 23:42:08 +0000 |
commit | e0fc854f05b137c353196356e5b26d11b6ee6867 (patch) | |
tree | 9a1c0a29178a9f3e10b10f5e184f46bce1c61078 /OpenSim/Services/Connectors | |
parent | Add the second step of the friends migration to pull data from the old table ... (diff) | |
download | opensim-SC-e0fc854f05b137c353196356e5b26d11b6ee6867.zip opensim-SC-e0fc854f05b137c353196356e5b26d11b6ee6867.tar.gz opensim-SC-e0fc854f05b137c353196356e5b26d11b6ee6867.tar.bz2 opensim-SC-e0fc854f05b137c353196356e5b26d11b6ee6867.tar.xz |
Adding new fields and home location methid to presence. Adding cleanup
(deleting all but one presence record) on logout so that they don't pile up.
Diffstat (limited to 'OpenSim/Services/Connectors')
-rw-r--r-- | OpenSim/Services/Connectors/Presence/PresenceServiceConnector.cs | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/OpenSim/Services/Connectors/Presence/PresenceServiceConnector.cs b/OpenSim/Services/Connectors/Presence/PresenceServiceConnector.cs index 4ad457f..482862d 100644 --- a/OpenSim/Services/Connectors/Presence/PresenceServiceConnector.cs +++ b/OpenSim/Services/Connectors/Presence/PresenceServiceConnector.cs | |||
@@ -371,6 +371,52 @@ namespace OpenSim.Services.Connectors | |||
371 | } | 371 | } |
372 | 372 | ||
373 | 373 | ||
374 | public bool SetHomeLocation(string userID, UUID regionID, Vector3 position, Vector3 lookAt) | ||
375 | { | ||
376 | Dictionary<string, object> sendData = new Dictionary<string, object>(); | ||
377 | //sendData["SCOPEID"] = scopeID.ToString(); | ||
378 | sendData["VERSIONMIN"] = ProtocolVersions.ClientProtocolVersionMin.ToString(); | ||
379 | sendData["VERSIONMAX"] = ProtocolVersions.ClientProtocolVersionMax.ToString(); | ||
380 | sendData["METHOD"] = "sethome"; | ||
381 | |||
382 | sendData["UserID"] = userID; | ||
383 | sendData["RegionID"] = regionID.ToString(); | ||
384 | sendData["position"] = position.ToString(); | ||
385 | sendData["lookAt"] = lookAt.ToString(); | ||
386 | |||
387 | string reqString = ServerUtils.BuildQueryString(sendData); | ||
388 | // m_log.DebugFormat("[PRESENCE CONNECTOR]: queryString = {0}", reqString); | ||
389 | try | ||
390 | { | ||
391 | string reply = SynchronousRestFormsRequester.MakeRequest("POST", | ||
392 | m_ServerURI + "/presence", | ||
393 | reqString); | ||
394 | if (reply != string.Empty) | ||
395 | { | ||
396 | Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply); | ||
397 | |||
398 | if (replyData.ContainsKey("Result")) | ||
399 | { | ||
400 | if (replyData["Result"].ToString().ToLower() == "success") | ||
401 | return true; | ||
402 | else | ||
403 | return false; | ||
404 | } | ||
405 | else | ||
406 | m_log.DebugFormat("[PRESENCE CONNECTOR]: SetHomeLocation reply data does not contain result field"); | ||
407 | |||
408 | } | ||
409 | else | ||
410 | m_log.DebugFormat("[PRESENCE CONNECTOR]: SetHomeLocation received empty reply"); | ||
411 | } | ||
412 | catch (Exception e) | ||
413 | { | ||
414 | m_log.DebugFormat("[PRESENCE CONNECTOR]: Exception when contacting presence server: {0}", e.Message); | ||
415 | } | ||
416 | |||
417 | return false; | ||
418 | } | ||
419 | |||
374 | #endregion | 420 | #endregion |
375 | 421 | ||
376 | } | 422 | } |