aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs')
-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}