aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared
diff options
context:
space:
mode:
authorMelanie2012-05-10 00:42:10 +0100
committerMelanie2012-05-10 00:42:10 +0100
commita90822f4b8ce8b10f8d38e09adf45a1e8e4ed86a (patch)
treee14d17475f8dcf643f4153f882f92e89b869a686 /OpenSim/Region/ScriptEngine/Shared
parentMerge branch 'master' into careminster (diff)
parentWhere necessary, rename OpenSim/Services/Connectors/*.cs files to reflect the... (diff)
downloadopensim-SC_OLD-a90822f4b8ce8b10f8d38e09adf45a1e8e4ed86a.zip
opensim-SC_OLD-a90822f4b8ce8b10f8d38e09adf45a1e8e4ed86a.tar.gz
opensim-SC_OLD-a90822f4b8ce8b10f8d38e09adf45a1e8e4ed86a.tar.bz2
opensim-SC_OLD-a90822f4b8ce8b10f8d38e09adf45a1e8e4ed86a.tar.xz
Merge branch 'master' into careminster
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs85
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs1
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs5
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs5
4 files changed, 96 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 {
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs
index 2ecc455..048124d 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs
@@ -109,6 +109,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
109 LSL_Vector llGetAccel(); 109 LSL_Vector llGetAccel();
110 LSL_Integer llGetAgentInfo(string id); 110 LSL_Integer llGetAgentInfo(string id);
111 LSL_String llGetAgentLanguage(string id); 111 LSL_String llGetAgentLanguage(string id);
112 LSL_List llGetAgentList(LSL_Integer scope, LSL_List options);
112 LSL_Vector llGetAgentSize(string id); 113 LSL_Vector llGetAgentSize(string id);
113 LSL_Float llGetAlpha(int face); 114 LSL_Float llGetAlpha(int face);
114 LSL_Float llGetAndResetTime(); 115 LSL_Float llGetAndResetTime();
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
index 9d830c8..5c6ad8a 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
@@ -503,6 +503,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
503 public const int OBJECT_STREAMING_COST = 15; 503 public const int OBJECT_STREAMING_COST = 15;
504 public const int OBJECT_PHYSICS_COST = 16; 504 public const int OBJECT_PHYSICS_COST = 16;
505 505
506 // for llGetAgentList
507 public const int AGENT_LIST_PARCEL = 1;
508 public const int AGENT_LIST_PARCEL_OWNER = 2;
509 public const int AGENT_LIST_REGION = 4;
510
506 // Can not be public const? 511 // Can not be public const?
507 public static readonly vector ZERO_VECTOR = new vector(0.0, 0.0, 0.0); 512 public static readonly vector ZERO_VECTOR = new vector(0.0, 0.0, 0.0);
508 public static readonly rotation ZERO_ROTATION = new rotation(0.0, 0.0, 0.0, 1.0); 513 public static readonly rotation ZERO_ROTATION = new rotation(0.0, 0.0, 0.0, 1.0);
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs
index 8db4006..2d23d30 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs
@@ -396,6 +396,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
396 return m_LSL_Functions.llGetAgentLanguage(id); 396 return m_LSL_Functions.llGetAgentLanguage(id);
397 } 397 }
398 398
399 public LSL_List llGetAgentList(LSL_Integer scope, LSL_List options)
400 {
401 return m_LSL_Functions.llGetAgentList(scope, options);
402 }
403
399 public LSL_Vector llGetAgentSize(string id) 404 public LSL_Vector llGetAgentSize(string id)
400 { 405 {
401 return m_LSL_Functions.llGetAgentSize(id); 406 return m_LSL_Functions.llGetAgentSize(id);