From 11c945a5651d8e55c6948df9a026ff3d85566b51 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 1 May 2019 01:35:45 +0100 Subject: add osLocalTeleportAgent(key agent, vector position, vector velocity, vector lookat, LSL_Integer flags). Velocity only works with ubOde but still not good. flags = bit field: 1 use velocity, 2 use lookat, 4 rotate avatar look in current velocity direction (ignored if 2 ie flag = 7 is same as 3). This bypasses most the unnecessary logic of osTeleportAgent, having usage same permissions. It may do region crossings(?). Experimental stage, feedbakc expected ;) --- .../ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 17 +++++++++++++++++ .../ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | 1 + .../Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | 5 +++++ 3 files changed, 23 insertions(+) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index c1c1eaf..a0f784e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -924,6 +924,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } // Teleport functions + public void osLocalTeleportAgent(LSL_Key agent, LSL_Types.Vector3 position, LSL_Types.Vector3 velocity, LSL_Types.Vector3 lookat, LSL_Integer flags) + { + UUID agentId; + if (!UUID.TryParse(agent, out agentId)) + return; + + ScenePresence presence = World.GetScenePresence(agentId); + if (presence == null || presence.IsDeleted || presence.IsInTransit) + return; + + Vector3 pos = presence.AbsolutePosition; + if (!checkAllowAgentTPbyLandOwner(agentId, pos)) + return; + + World.RequestLocalTeleport(presence, position, velocity, lookat, flags); + } + public void osTeleportAgent(string agent, string regionName, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) { // High because there is no security check. High griefer potential diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index ce6aaf8..194df36 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs @@ -150,6 +150,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces string osGetAgentIP(string agent); // Teleport commands + void osLocalTeleportAgent(LSL_Key agent, LSL_Types.Vector3 position, LSL_Types.Vector3 velocity, LSL_Types.Vector3 lookat, LSL_Integer flags); void osTeleportAgent(string agent, string regionName, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat); void osTeleportAgent(string agent, int regionX, int regionY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat); void osTeleportAgent(string agent, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index fd5142f..88ea9d5 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs @@ -247,6 +247,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase // Teleport Functions + public void osLocalTeleportAgent(LSL_Key agent, vector position, vector velocity, vector lookat, LSL_Integer flags) + { + m_OSSL_Functions.osLocalTeleportAgent(agent, position, velocity, lookat, flags); + } + public void osTeleportAgent(string agent, string regionName, vector position, vector lookat) { m_OSSL_Functions.osTeleportAgent(agent, regionName, position, lookat); -- cgit v1.1