diff options
author | Sean Dague | 2009-02-26 22:37:02 +0000 |
---|---|---|
committer | Sean Dague | 2009-02-26 22:37:02 +0000 |
commit | 7f727bd33eef49b90c751d21ba8c69ef375f2cf7 (patch) | |
tree | 395462233a8c90c77f177570031ec60a4775351a /OpenSim | |
parent | Another change to how the CreateCommsManagerPlugin checks if it should be cre... (diff) | |
download | opensim-SC_OLD-7f727bd33eef49b90c751d21ba8c69ef375f2cf7.zip opensim-SC_OLD-7f727bd33eef49b90c751d21ba8c69ef375f2cf7.tar.gz opensim-SC_OLD-7f727bd33eef49b90c751d21ba8c69ef375f2cf7.tar.bz2 opensim-SC_OLD-7f727bd33eef49b90c751d21ba8c69ef375f2cf7.tar.xz |
This adds a new osGetAgentIP function with threat level set to High. It
isn't tested, but it doesn't break anything else. The reason for this
function is to let in world tools be used to coordiante out of world
network services that need access to client ip addresses.
Diffstat (limited to 'OpenSim')
3 files changed, 38 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 7834a83..e008ff4 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -30,6 +30,7 @@ using System.Collections; | |||
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using System.Runtime.Remoting.Lifetime; | 31 | using System.Runtime.Remoting.Lifetime; |
32 | using System.Text; | 32 | using System.Text; |
33 | using System.Net; | ||
33 | using OpenMetaverse; | 34 | using OpenMetaverse; |
34 | using Nini.Config; | 35 | using Nini.Config; |
35 | using OpenSim; | 36 | using OpenSim; |
@@ -548,6 +549,34 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
548 | osTeleportAgent(agent, World.RegionInfo.RegionName, position, lookat); | 549 | osTeleportAgent(agent, World.RegionInfo.RegionName, position, lookat); |
549 | } | 550 | } |
550 | 551 | ||
552 | // Functions that get information from the agent itself. | ||
553 | // | ||
554 | // osGetAgentIP - this is used to determine the IP address of | ||
555 | //the client. This is needed to help configure other in world | ||
556 | //resources based on the IP address of the clients connected. | ||
557 | //I think High is a good risk level for this, as it is an | ||
558 | //information leak. | ||
559 | public string osGetAgentIP(string agent) | ||
560 | { | ||
561 | CheckThreatLevel(ThreatLevel.High, "osGetAgentIP"); | ||
562 | |||
563 | UUID avatarID = (UUID)agent; | ||
564 | |||
565 | m_host.AddScriptLPS(1); | ||
566 | if (World.Entities.ContainsKey((UUID)agent) && World.Entities[avatarID] is ScenePresence) | ||
567 | { | ||
568 | ScenePresence target = (ScenePresence)World.Entities[avatarID]; | ||
569 | EndPoint ep = target.ControllingClient.GetClientInfo().userEP; | ||
570 | if (ep is IPEndPoint) | ||
571 | { | ||
572 | IPEndPoint ip = (IPEndPoint)ep; | ||
573 | return ip.Address.ToString(); | ||
574 | } | ||
575 | } | ||
576 | // fall through case, just return nothing | ||
577 | return ""; | ||
578 | } | ||
579 | |||
551 | // Adam's super super custom animation functions | 580 | // Adam's super super custom animation functions |
552 | public void osAvatarPlayAnimation(string avatar, string animation) | 581 | public void osAvatarPlayAnimation(string avatar, string animation) |
553 | { | 582 | { |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index 1150d76..c3c5cec 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | |||
@@ -67,6 +67,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces | |||
67 | void osSetParcelMediaURL(string url); | 67 | void osSetParcelMediaURL(string url); |
68 | void osSetPrimFloatOnWater(int floatYN); | 68 | void osSetPrimFloatOnWater(int floatYN); |
69 | 69 | ||
70 | // Avatar Info Commands | ||
71 | string osGetAgentIP(string agent); | ||
72 | |||
70 | // Teleport commands | 73 | // Teleport commands |
71 | void osTeleportAgent(string agent, string regionName, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat); | 74 | void osTeleportAgent(string agent, string regionName, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat); |
72 | void osTeleportAgent(string agent, uint regionX, uint regionY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat); | 75 | void osTeleportAgent(string agent, uint regionX, uint regionY, 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 6ba8b20..d8b9f1f 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | |||
@@ -143,6 +143,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
143 | m_OSSL_Functions.osTeleportAgent(agent, position, lookat); | 143 | m_OSSL_Functions.osTeleportAgent(agent, position, lookat); |
144 | } | 144 | } |
145 | 145 | ||
146 | // Avatar info functions | ||
147 | public string osGetAgentIP(string agent) | ||
148 | { | ||
149 | return m_OSSL_Functions.osGetAgentIP(agent); | ||
150 | } | ||
151 | |||
146 | // Animation Functions | 152 | // Animation Functions |
147 | 153 | ||
148 | public void osAvatarPlayAnimation(string avatar, string animation) | 154 | public void osAvatarPlayAnimation(string avatar, string animation) |