put back getAgentIP bug restricted, script owner must be a Administrator (god)

This commit is contained in:
UbitUmarov
2017-06-28 02:19:27 +01:00
parent b0a0163253
commit e243dd0519
4 changed files with 25 additions and 1 deletions

View File

@@ -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)
{