aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/OpenSim.Region/World/World.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/OpenSim.Region/World/World.cs')
-rw-r--r--OpenSim/OpenSim.Region/World/World.cs21
1 files changed, 21 insertions, 0 deletions
diff --git a/OpenSim/OpenSim.Region/World/World.cs b/OpenSim/OpenSim.Region/World/World.cs
index e316e27..3415f08 100644
--- a/OpenSim/OpenSim.Region/World/World.cs
+++ b/OpenSim/OpenSim.Region/World/World.cs
@@ -20,6 +20,8 @@ using OpenSim.Region.Estate;
20 20
21namespace OpenSim.Region 21namespace OpenSim.Region
22{ 22{
23 public delegate bool FilterAvatarList(Avatar avatar);
24
23 public partial class World : WorldBase, ILocalStorageReceiver, IScriptAPI 25 public partial class World : WorldBase, ILocalStorageReceiver, IScriptAPI
24 { 26 {
25 protected System.Timers.Timer m_heartbeatTimer = new System.Timers.Timer(); 27 protected System.Timers.Timer m_heartbeatTimer = new System.Timers.Timer();
@@ -592,6 +594,25 @@ namespace OpenSim.Region
592 return result; 594 return result;
593 } 595 }
594 596
597 /// <summary>
598 /// Request a filtered list of Avatars in this World
599 /// </summary>
600 /// <returns></returns>
601 public List<Avatar> RequestAvatarList(FilterAvatarList filter)
602 {
603 List<Avatar> result = new List<Avatar>();
604
605 foreach (Avatar avatar in Avatars.Values)
606 {
607 if (filter(avatar))
608 {
609 result.Add(avatar);
610 }
611 }
612
613 return result;
614 }
615
595 public Avatar RequestAvatar(LLUUID avatarID) 616 public Avatar RequestAvatar(LLUUID avatarID)
596 { 617 {
597 if (this.Avatars.ContainsKey(avatarID)) 618 if (this.Avatars.ContainsKey(avatarID))