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/Region/ScriptEngine/Shared/Api/Implementation | |
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/Region/ScriptEngine/Shared/Api/Implementation')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 29 |
1 files changed, 29 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 | { |