aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api/Implementation
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs85
1 files changed, 85 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index ca14399..5bd781c 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -5953,6 +5953,91 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5953 m_host.AddScriptLPS(1); 5953 m_host.AddScriptLPS(1);
5954 return "en-us"; 5954 return "en-us";
5955 } 5955 }
5956 /// <summary>
5957 /// http://wiki.secondlife.com/wiki/LlGetAgentList
5958 /// The list of options is currently not used in SL
5959 /// scope is one of:-
5960 /// AGENT_LIST_REGION - all in the region
5961 /// AGENT_LIST_PARCEL - all in the same parcel as the scripted object
5962 /// AGENT_LIST_PARCEL_OWNER - all in any parcel owned by the owner of the
5963 /// current parcel.
5964 /// </summary>
5965 public LSL_List llGetAgentList(LSL_Integer scope, LSL_List options)
5966 {
5967 m_host.AddScriptLPS(1);
5968
5969 // the constants are 1, 2 and 4 so bits are being set, but you
5970 // get an error "INVALID_SCOPE" if it is anything but 1, 2 and 4
5971 bool regionWide = scope == ScriptBaseClass.AGENT_LIST_REGION;
5972 bool parcelOwned = scope == ScriptBaseClass.AGENT_LIST_PARCEL_OWNER;
5973 bool parcel = scope == ScriptBaseClass.AGENT_LIST_PARCEL;
5974
5975 LSL_List result = new LSL_List();
5976
5977 if (!regionWide && !parcelOwned && !parcel)
5978 {
5979 result.Add("INVALID_SCOPE");
5980 return result;
5981 }
5982
5983 ILandObject land;
5984 Vector3 pos;
5985 UUID id = UUID.Zero;
5986 if (parcel || parcelOwned)
5987 {
5988 pos = m_host.ParentGroup.RootPart.GetWorldPosition();
5989 land = World.LandChannel.GetLandObject(pos.X, pos.Y);
5990 if (land == null)
5991 {
5992 id = UUID.Zero;
5993 }
5994 else
5995 {
5996 if (parcelOwned)
5997 {
5998 id = land.LandData.OwnerID;
5999 }
6000 else
6001 {
6002 id = land.LandData.GlobalID;
6003 }
6004 }
6005 }
6006 List<UUID> presenceIds = new List<UUID>();
6007
6008 World.ForEachRootScenePresence(
6009 delegate (ScenePresence ssp)
6010 {
6011 // Gods are not listed in SL
6012 if (!ssp.IsDeleted && ssp.GodLevel == 0.0 && !ssp.IsChildAgent)
6013 {
6014 if (!regionWide)
6015 {
6016 pos = ssp.AbsolutePosition;
6017 land = World.LandChannel.GetLandObject(pos.X, pos.Y);
6018 if (land != null)
6019 {
6020 if (parcelOwned && land.LandData.OwnerID == id ||
6021 parcel && land.LandData.GlobalID == id)
6022 {
6023 result.Add(ssp.UUID.ToString());
6024 }
6025 }
6026 }
6027 else
6028 {
6029 result.Add(ssp.UUID.ToString());
6030 }
6031 }
6032 // Maximum of 100 results
6033 if (result.Length > 99)
6034 {
6035 return;
6036 }
6037 }
6038 );
6039 return result;
6040 }
5956 6041
5957 public void llAdjustSoundVolume(double volume) 6042 public void llAdjustSoundVolume(double volume)
5958 { 6043 {