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.GenericGridServerConcept
parent
faca2a7ddc
commit
7f727bd33e
|
@ -30,6 +30,7 @@ using System.Collections;
|
|||
using System.Collections.Generic;
|
||||
using System.Runtime.Remoting.Lifetime;
|
||||
using System.Text;
|
||||
using System.Net;
|
||||
using OpenMetaverse;
|
||||
using Nini.Config;
|
||||
using OpenSim;
|
||||
|
@ -548,6 +549,34 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
osTeleportAgent(agent, World.RegionInfo.RegionName, position, lookat);
|
||||
}
|
||||
|
||||
// Functions that get information from the agent itself.
|
||||
//
|
||||
// osGetAgentIP - this is used to determine the IP address of
|
||||
//the client. This is needed to help configure other in world
|
||||
//resources based on the IP address of the clients connected.
|
||||
//I think High is a good risk level for this, as it is an
|
||||
//information leak.
|
||||
public string osGetAgentIP(string agent)
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.High, "osGetAgentIP");
|
||||
|
||||
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];
|
||||
EndPoint ep = target.ControllingClient.GetClientInfo().userEP;
|
||||
if (ep is IPEndPoint)
|
||||
{
|
||||
IPEndPoint ip = (IPEndPoint)ep;
|
||||
return ip.Address.ToString();
|
||||
}
|
||||
}
|
||||
// fall through case, just return nothing
|
||||
return "";
|
||||
}
|
||||
|
||||
// Adam's super super custom animation functions
|
||||
public void osAvatarPlayAnimation(string avatar, string animation)
|
||||
{
|
||||
|
|
|
@ -67,6 +67,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
|
|||
void osSetParcelMediaURL(string url);
|
||||
void osSetPrimFloatOnWater(int floatYN);
|
||||
|
||||
// Avatar Info Commands
|
||||
string osGetAgentIP(string agent);
|
||||
|
||||
// Teleport commands
|
||||
void osTeleportAgent(string agent, string regionName, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat);
|
||||
void osTeleportAgent(string agent, uint regionX, uint regionY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat);
|
||||
|
|
|
@ -143,6 +143,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
|||
m_OSSL_Functions.osTeleportAgent(agent, position, lookat);
|
||||
}
|
||||
|
||||
// Avatar info functions
|
||||
public string osGetAgentIP(string agent)
|
||||
{
|
||||
return m_OSSL_Functions.osGetAgentIP(agent);
|
||||
}
|
||||
|
||||
// Animation Functions
|
||||
|
||||
public void osAvatarPlayAnimation(string avatar, string animation)
|
||||
|
|
|
@ -1895,6 +1895,7 @@
|
|||
<ReferencePath>../../../../bin/</ReferencePath>
|
||||
<Reference name="System"/>
|
||||
<Reference name="System.Data"/>
|
||||
<Reference name="System.Net"/>
|
||||
<Reference name="System.Web"/>
|
||||
<Reference name="System.Xml"/>
|
||||
<Reference name="OpenMetaverseTypes.dll"/>
|
||||
|
|
Loading…
Reference in New Issue