aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs')
-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 afd943b..5b5cab8 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -5529,6 +5529,91 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5529 m_host.AddScriptLPS(1); 5529 m_host.AddScriptLPS(1);
5530 return "en-us"; 5530 return "en-us";
5531 } 5531 }
5532 /// <summary>
5533 /// http://wiki.secondlife.com/wiki/LlGetAgentList
5534 /// The list of options is currently not used in SL
5535 /// scope is one of:-
5536 /// AGENT_LIST_REGION - all in the region
5537 /// AGENT_LIST_PARCEL - all in the same parcel as the scripted object
5538 /// AGENT_LIST_PARCEL_OWNER - all in any parcel owned by the owner of the
5539 /// current parcel.
5540 /// </summary>
5541 public LSL_List llGetAgentList(LSL_Integer scope, LSL_List options)
5542 {
5543 m_host.AddScriptLPS(1);
5544
5545 // the constants are 1, 2 and 4 so bits are being set, but you
5546 // get an error "INVALID_SCOPE" if it is anything but 1, 2 and 4
5547 bool regionWide = scope == ScriptBaseClass.AGENT_LIST_REGION;
5548 bool parcelOwned = scope == ScriptBaseClass.AGENT_LIST_PARCEL_OWNER;
5549 bool parcel = scope == ScriptBaseClass.AGENT_LIST_PARCEL;
5550
5551 LSL_List result = new LSL_List();
5552
5553 if (!regionWide && !parcelOwned && !parcel)
5554 {
5555 result.Add("INVALID_SCOPE");
5556 return result;
5557 }
5558
5559 ILandObject land;
5560 Vector3 pos;
5561 UUID id = UUID.Zero;
5562 if (parcel || parcelOwned)
5563 {
5564 pos = m_host.ParentGroup.RootPart.GetWorldPosition();
5565 land = World.LandChannel.GetLandObject(pos.X, pos.Y);
5566 if (land == null)
5567 {
5568 id = UUID.Zero;
5569 }
5570 else
5571 {
5572 if (parcelOwned)
5573 {
5574 id = land.LandData.OwnerID;
5575 }
5576 else
5577 {
5578 id = land.LandData.GlobalID;
5579 }
5580 }
5581 }
5582 List<UUID> presenceIds = new List<UUID>();
5583
5584 World.ForEachRootScenePresence(
5585 delegate (ScenePresence ssp)
5586 {
5587 // Gods are not listed in SL
5588 if (!ssp.IsDeleted && ssp.GodLevel == 0.0 && !ssp.IsChildAgent)
5589 {
5590 if (!regionWide)
5591 {
5592 pos = ssp.AbsolutePosition;
5593 land = World.LandChannel.GetLandObject(pos.X, pos.Y);
5594 if (land != null)
5595 {
5596 if (parcelOwned && land.LandData.OwnerID == id ||
5597 parcel && land.LandData.GlobalID == id)
5598 {
5599 result.Add(ssp.UUID.ToString());
5600 }
5601 }
5602 }
5603 else
5604 {
5605 result.Add(ssp.UUID.ToString());
5606 }
5607 }
5608 // Maximum of 100 results
5609 if (result.Length > 99)
5610 {
5611 return;
5612 }
5613 }
5614 );
5615 return result;
5616 }
5532 5617
5533 public void llAdjustSoundVolume(double volume) 5618 public void llAdjustSoundVolume(double volume)
5534 { 5619 {