aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Server
diff options
context:
space:
mode:
authorMelanie2009-12-28 23:42:08 +0000
committerMelanie2009-12-28 23:42:08 +0000
commite0fc854f05b137c353196356e5b26d11b6ee6867 (patch)
tree9a1c0a29178a9f3e10b10f5e184f46bce1c61078 /OpenSim/Server
parentAdd the second step of the friends migration to pull data from the old table ... (diff)
downloadopensim-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/Server')
-rw-r--r--OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs29
1 files changed, 29 insertions, 0 deletions
diff --git a/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs b/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs
index 580cb15..bb00a00 100644
--- a/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs
+++ b/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs
@@ -90,6 +90,8 @@ namespace OpenSim.Server.Handlers.Presence
90 return GetAgent(request); 90 return GetAgent(request);
91 case "getagents": 91 case "getagents":
92 return GetAgents(request); 92 return GetAgents(request);
93 case "sethome":
94 return SetHome(request);
93 } 95 }
94 m_log.DebugFormat("[PRESENCE HANDLER]: unknown method request: {0}", method); 96 m_log.DebugFormat("[PRESENCE HANDLER]: unknown method request: {0}", method);
95 } 97 }
@@ -303,5 +305,32 @@ namespace OpenSim.Server.Handlers.Presence
303 305
304 return ms.ToArray(); 306 return ms.ToArray();
305 } 307 }
308
309 byte[] SetHome(Dictionary<string, object> request)
310 {
311 UUID region = UUID.Zero;
312 Vector3 position = new Vector3(128, 128, 70);
313 Vector3 look = Vector3.Zero;
314
315 if (!request.ContainsKey("SessionID") || !request.ContainsKey("RegionID"))
316 return FailureResult();
317
318 string user = request["UserID"].ToString();
319
320 if (!UUID.TryParse(request["RegionID"].ToString(), out region))
321 return FailureResult();
322
323 if (request.ContainsKey("position"))
324 Vector3.TryParse(request["position"].ToString(), out position);
325
326 if (request.ContainsKey("lookAt"))
327 Vector3.TryParse(request["lookAt"].ToString(), out look);
328
329 if (m_PresenceService.SetHomeLocation(user, region, position, look))
330 return SuccessResult();
331
332 return FailureResult();
333 }
334
306 } 335 }
307} 336}