From 50536c66a0f2e72d68df25c84a2286337dd9b357 Mon Sep 17 00:00:00 2001 From: Charles Krinke Date: Sun, 1 Feb 2009 17:41:33 +0000 Subject: Thank you kindly, TLaukkan (Tommil) for a patch that: Added osTeleportAgent with region coordinates to support hyper grid scripted teleports. --- .../Shared/Api/Implementation/OSSL_Api.cs | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 9e76ee2..3e7ffab 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -513,6 +513,35 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } } + // Teleport functions + public void osTeleportAgent(string agent, uint regionX, uint regionY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) + { + // High because there is no security check. High griefer potential + // + CheckThreatLevel(ThreatLevel.High, "osTeleportAgent"); + + ulong regionHandle = Util.UIntsToLong((regionX * (uint)Constants.RegionSize), (regionY * (uint)Constants.RegionSize)); + + m_host.AddScriptLPS(1); + UUID agentId = new UUID(); + if (UUID.TryParse(agent, out agentId)) + { + ScenePresence presence = World.GetScenePresence(agentId); + if (presence != null) + { + // agent must be over owners land to avoid abuse + if (m_host.OwnerID == World.GetLandOwner(presence.AbsolutePosition.X, presence.AbsolutePosition.Y)) + { + presence.ControllingClient.SendTeleportLocationStart(); + World.RequestTeleportLocation(presence.ControllingClient, regionHandle, + new Vector3((float)position.x, (float)position.y, (float)position.z), + new Vector3((float)lookat.x, (float)lookat.y, (float)lookat.z), (uint)TPFlags.ViaLocation); + ScriptSleep(5000); + } + } + } + } + public void osTeleportAgent(string agent, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) { osTeleportAgent(agent, World.RegionInfo.RegionName, position, lookat); -- cgit v1.1