From 5164fa24110b0197c2d18dc824351d384b1b8582 Mon Sep 17 00:00:00 2001 From: Charles Krinke Date: Mon, 15 Sep 2008 14:32:02 +0000 Subject: Mantis#2197. Thank you kindly, Tyre, for a patch that: adds the new function osTeleportAgent(). --- .../ScriptEngine/Common/OSSL_BuilIn_Commands.cs | 30 +++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands.cs') diff --git a/OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands.cs index c6ded79..264a586 100644 --- a/OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands.cs @@ -32,7 +32,7 @@ using OpenSim.Framework.Console; using OpenSim.Region.Environment.Interfaces; using OpenSim.Region.Environment.Scenes; using OpenSim.Region.ScriptEngine.Common.ScriptEngineBase; - +using TPFlags = OpenSim.Framework.Constants.TeleportFlags; //using OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL; namespace OpenSim.Region.ScriptEngine.Common @@ -436,6 +436,34 @@ namespace OpenSim.Region.ScriptEngine.Common } } + // Teleport functions + public void osTeleportAgent(string agent, string regionName, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) + { + 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)) + { + World.RequestTeleportLocation(presence.ControllingClient, regionName, + 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); + } + // Adam's super super custom animation functions public void osAvatarPlayAnimation(string avatar, string animation) { -- cgit v1.1