From e243dd05193a1edcb16f52b2514c41de70ff8006 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 28 Jun 2017 02:19:27 +0100 Subject: put back getAgentIP bug restricted, script owner must be a Administrator (god) --- .../ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 18 ++++++++++++++++++ .../ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | 1 + .../ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | 5 +++++ 3 files changed, 24 insertions(+) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index a1fd7cd..b84065f 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -1097,6 +1097,24 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return result; } + public string osGetAgentIP(string agent) + { + CheckThreatLevel(); // user god is the restriction + if(!(World.Permissions.IsGod(m_host.OwnerID))) + return ""; + + UUID avatarID = (UUID)agent; + + m_host.AddScriptLPS(1); + if (World.Entities.ContainsKey((UUID)agent) && World.Entities[avatarID] is ScenePresence) + { + ScenePresence target = (ScenePresence)World.Entities[avatarID]; + return target.ControllingClient.RemoteEndPoint.Address.ToString(); + } + + // fall through case, just return nothing + return ""; + } // Adam's super super custom animation functions public void osAvatarPlayAnimation(string avatar, string animation) { diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index 6be3c3f..8f863af 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs @@ -145,6 +145,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces // Avatar Info Commands LSL_List osGetAgents(); + string osGetAgentIP(string agent); // Teleport commands void osTeleportAgent(string agent, string regionName, 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 f5d2a3a..42e7bfb 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs @@ -282,6 +282,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase return m_OSSL_Functions.osGetAgents(); } + public string osGetAgentIP(string agent) + { + return m_OSSL_Functions.osGetAgentIP(agent); + } + // Animation Functions public void osAvatarPlayAnimation(string avatar, string animation) -- cgit v1.1