diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs')
-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 | { |