From e0fc854f05b137c353196356e5b26d11b6ee6867 Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 28 Dec 2009 23:42:08 +0000 Subject: 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. --- .../Handlers/Presence/PresenceServerPostHandler.cs | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs') 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 return GetAgent(request); case "getagents": return GetAgents(request); + case "sethome": + return SetHome(request); } m_log.DebugFormat("[PRESENCE HANDLER]: unknown method request: {0}", method); } @@ -303,5 +305,32 @@ namespace OpenSim.Server.Handlers.Presence return ms.ToArray(); } + + byte[] SetHome(Dictionary request) + { + UUID region = UUID.Zero; + Vector3 position = new Vector3(128, 128, 70); + Vector3 look = Vector3.Zero; + + if (!request.ContainsKey("SessionID") || !request.ContainsKey("RegionID")) + return FailureResult(); + + string user = request["UserID"].ToString(); + + if (!UUID.TryParse(request["RegionID"].ToString(), out region)) + return FailureResult(); + + if (request.ContainsKey("position")) + Vector3.TryParse(request["position"].ToString(), out position); + + if (request.ContainsKey("lookAt")) + Vector3.TryParse(request["lookAt"].ToString(), out look); + + if (m_PresenceService.SetHomeLocation(user, region, position, look)) + return SuccessResult(); + + return FailureResult(); + } + } } -- cgit v1.1