aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs35
1 files changed, 29 insertions, 6 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 1fc8d3d..7490ac8 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -945,6 +945,18 @@ namespace OpenSim.Region.Framework.Scenes
945 /// </remarks> 945 /// </remarks>
946 public UUID FromFolderID { get; set; } 946 public UUID FromFolderID { get; set; }
947 947
948 /// <summary>
949 /// IDs of all avatars sat on this scene object.
950 /// </summary>
951 /// <remarks>
952 /// We need this so that we can maintain a linkset wide ordering of avatars sat on different parts.
953 /// This must be locked before it is read or written.
954 /// SceneObjectPart sitting avatar add/remove code also locks on this object to avoid race conditions.
955 /// No avatar should appear more than once in this list.
956 /// Do not manipulate this list directly - use the Add/Remove sitting avatar methods on SceneObjectPart.
957 /// </remarks>
958 protected internal List<UUID> m_sittingAvatars = new List<UUID>();
959
948 #endregion 960 #endregion
949 961
950// ~SceneObjectGroup() 962// ~SceneObjectGroup()
@@ -4523,17 +4535,28 @@ namespace OpenSim.Region.Framework.Scenes
4523 } 4535 }
4524 4536
4525 /// <summary> 4537 /// <summary>
4538 /// Get a copy of the list of sitting avatars on all prims of this object.
4539 /// </summary>
4540 /// <remarks>
4541 /// This is sorted by the order in which avatars sat down. If an avatar stands up then all avatars that sat
4542 /// down after it move one place down the list.
4543 /// </remarks>
4544 /// <returns>A list of the sitting avatars. Returns an empty list if there are no sitting avatars.</returns>
4545 public List<UUID> GetSittingAvatars()
4546 {
4547 lock (m_sittingAvatars)
4548 return new List<UUID>(m_sittingAvatars);
4549 }
4550
4551 /// <summary>
4526 /// Gets the number of sitting avatars. 4552 /// Gets the number of sitting avatars.
4527 /// </summary> 4553 /// </summary>
4528 /// <remarks>This applies to all sitting avatars whether there is a sit target set or not.</remarks> 4554 /// <remarks>This applies to all sitting avatars whether there is a sit target set or not.</remarks>
4529 /// <returns></returns> 4555 /// <returns></returns>
4530 public int GetSittingAvatarsCount() 4556 public int GetSittingAvatarsCount()
4531 { 4557 {
4532 int count = 0; 4558 lock (m_sittingAvatars)
4533 4559 return m_sittingAvatars.Count;
4534 Array.ForEach<SceneObjectPart>(m_parts.GetArray(), p => count += p.GetSittingAvatarsCount());
4535
4536 return count;
4537 } 4560 }
4538 4561
4539 public override string ToString() 4562 public override string ToString()
@@ -4542,7 +4565,7 @@ namespace OpenSim.Region.Framework.Scenes
4542 } 4565 }
4543 4566
4544 #region ISceneObject 4567 #region ISceneObject
4545 4568
4546 public virtual ISceneObject CloneForNewScene() 4569 public virtual ISceneObject CloneForNewScene()
4547 { 4570 {
4548 SceneObjectGroup sog = Copy(false); 4571 SceneObjectGroup sog = Copy(false);