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 | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 845834e..9474bab 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -697,10 +697,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
697 | CheckThreatLevel(ThreatLevel.None, "osGetAgents"); | 697 | CheckThreatLevel(ThreatLevel.None, "osGetAgents"); |
698 | 698 | ||
699 | LSL_List result = new LSL_List(); | 699 | LSL_List result = new LSL_List(); |
700 | foreach (ScenePresence avatar in World.GetAvatars()) | 700 | World.ForEachScenePresence(delegate(ScenePresence sp) |
701 | { | 701 | { |
702 | result.Add(avatar.Name); | 702 | if (!sp.IsChildAgent) |
703 | } | 703 | result.Add(sp.Name); |
704 | }); | ||
704 | return result; | 705 | return result; |
705 | } | 706 | } |
706 | 707 | ||
@@ -1989,19 +1990,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1989 | CheckThreatLevel(ThreatLevel.Severe, "osKickAvatar"); | 1990 | CheckThreatLevel(ThreatLevel.Severe, "osKickAvatar"); |
1990 | if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID)) | 1991 | if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID)) |
1991 | { | 1992 | { |
1992 | foreach (ScenePresence presence in World.GetAvatars()) | 1993 | World.ForEachScenePresence(delegate(ScenePresence sp) |
1993 | { | 1994 | { |
1994 | if ((presence.Firstname == FirstName) && | 1995 | if (!sp.IsChildAgent && |
1995 | presence.Lastname == SurName) | 1996 | sp.Firstname == FirstName && |
1997 | sp.Lastname == SurName) | ||
1996 | { | 1998 | { |
1997 | // kick client... | 1999 | // kick client... |
1998 | if (alert != null) | 2000 | if (alert != null) |
1999 | presence.ControllingClient.Kick(alert); | 2001 | sp.ControllingClient.Kick(alert); |
2000 | 2002 | ||
2001 | // ...and close on our side | 2003 | // ...and close on our side |
2002 | presence.Scene.IncomingCloseAgent(presence.UUID); | 2004 | sp.Scene.IncomingCloseAgent(sp.UUID); |
2003 | } | 2005 | } |
2004 | } | 2006 | }); |
2005 | } | 2007 | } |
2006 | } | 2008 | } |
2007 | 2009 | ||