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.cs54
1 files changed, 6 insertions, 48 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 7ede725..529bc9f 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -121,7 +121,6 @@ namespace OpenSim.Region.Framework.Scenes
121 private bool m_hasGroupChanged = false; 121 private bool m_hasGroupChanged = false;
122 private long timeFirstChanged; 122 private long timeFirstChanged;
123 private long timeLastChanged; 123 private long timeLastChanged;
124 private List<ScenePresence> m_linkedAvatars = new List<ScenePresence>();
125 124
126 /// <summary> 125 /// <summary>
127 /// This indicates whether the object has changed such that it needs to be repersisted to permenant storage 126 /// This indicates whether the object has changed such that it needs to be repersisted to permenant storage
@@ -484,7 +483,7 @@ namespace OpenSim.Region.Framework.Scenes
484 m_rootPart.KeyframeMotion.StartCrossingCheck(); 483 m_rootPart.KeyframeMotion.StartCrossingCheck();
485 484
486 bool canCross = true; 485 bool canCross = true;
487 foreach (ScenePresence av in m_linkedAvatars) 486 foreach (ScenePresence av in GetSittingAvatars())
488 { 487 {
489 // We need to cross these agents. First, let's find 488 // We need to cross these agents. First, let's find
490 // out if any of them can't cross for some reason. 489 // out if any of them can't cross for some reason.
@@ -511,7 +510,7 @@ namespace OpenSim.Region.Framework.Scenes
511 510
512 List<avtocrossInfo> avsToCross = new List<avtocrossInfo>(); 511 List<avtocrossInfo> avsToCross = new List<avtocrossInfo>();
513 512
514 foreach (ScenePresence av in m_linkedAvatars) 513 foreach (ScenePresence av in GetSittingAvatars())
515 { 514 {
516 avtocrossInfo avinfo = new avtocrossInfo(); 515 avtocrossInfo avinfo = new avtocrossInfo();
517 SceneObjectPart parentPart = m_scene.GetSceneObjectPart(av.ParentID); 516 SceneObjectPart parentPart = m_scene.GetSceneObjectPart(av.ParentID);
@@ -838,7 +837,7 @@ namespace OpenSim.Region.Framework.Scenes
838 /// No avatar should appear more than once in this list. 837 /// No avatar should appear more than once in this list.
839 /// Do not manipulate this list directly - use the Add/Remove sitting avatar methods on SceneObjectPart. 838 /// Do not manipulate this list directly - use the Add/Remove sitting avatar methods on SceneObjectPart.
840 /// </remarks> 839 /// </remarks>
841 protected internal List<UUID> m_sittingAvatars = new List<UUID>(); 840 protected internal List<ScenePresence> m_sittingAvatars = new List<ScenePresence>();
842 841
843 #endregion 842 #endregion
844 843
@@ -1281,46 +1280,6 @@ namespace OpenSim.Region.Framework.Scenes
1281 part.ParentID = m_rootPart.LocalId; 1280 part.ParentID = m_rootPart.LocalId;
1282 part.ClearUndoState(); 1281 part.ClearUndoState();
1283 } 1282 }
1284 /// <summary>
1285 /// Add the avatar to this linkset (avatar is sat).
1286 /// </summary>
1287 /// <param name="agentID"></param>
1288 public void AddAvatar(UUID agentID)
1289 {
1290 ScenePresence presence;
1291 if (m_scene.TryGetScenePresence(agentID, out presence))
1292 {
1293 if (!m_linkedAvatars.Contains(presence))
1294 {
1295 m_linkedAvatars.Add(presence);
1296 }
1297 }
1298 }
1299
1300 /// <summary>
1301 /// Delete the avatar from this linkset (avatar is unsat).
1302 /// </summary>
1303 /// <param name="agentID"></param>
1304 public void DeleteAvatar(UUID agentID)
1305 {
1306 ScenePresence presence;
1307 if (m_scene.TryGetScenePresence(agentID, out presence))
1308 {
1309 if (m_linkedAvatars.Contains(presence))
1310 {
1311 m_linkedAvatars.Remove(presence);
1312 }
1313 }
1314 }
1315
1316 /// <summary>
1317 /// Returns the list of linked presences (avatars sat on this group)
1318 /// </summary>
1319 /// <param name="agentID"></param>
1320 public List<ScenePresence> GetLinkedAvatars()
1321 {
1322 return m_linkedAvatars;
1323 }
1324 1283
1325 public ushort GetTimeDilation() 1284 public ushort GetTimeDilation()
1326 { 1285 {
@@ -1714,8 +1673,7 @@ namespace OpenSim.Region.Framework.Scenes
1714 1673
1715 dupe.Backup = false; 1674 dupe.Backup = false;
1716 dupe.m_parts = new MapAndArray<OpenMetaverse.UUID, SceneObjectPart>(); 1675 dupe.m_parts = new MapAndArray<OpenMetaverse.UUID, SceneObjectPart>();
1717 dupe.m_sittingAvatars = new List<UUID>(); 1676 dupe.m_sittingAvatars = new List<ScenePresence>();
1718 dupe.m_linkedAvatars = new List<ScenePresence>();
1719 dupe.CopyRootPart(m_rootPart, OwnerID, GroupID, userExposed); 1677 dupe.CopyRootPart(m_rootPart, OwnerID, GroupID, userExposed);
1720 dupe.m_rootPart.LinkNum = m_rootPart.LinkNum; 1678 dupe.m_rootPart.LinkNum = m_rootPart.LinkNum;
1721 1679
@@ -3833,10 +3791,10 @@ namespace OpenSim.Region.Framework.Scenes
3833 /// down after it move one place down the list. 3791 /// down after it move one place down the list.
3834 /// </remarks> 3792 /// </remarks>
3835 /// <returns>A list of the sitting avatars. Returns an empty list if there are no sitting avatars.</returns> 3793 /// <returns>A list of the sitting avatars. Returns an empty list if there are no sitting avatars.</returns>
3836 public List<UUID> GetSittingAvatars() 3794 public List<ScenePresence> GetSittingAvatars()
3837 { 3795 {
3838 lock (m_sittingAvatars) 3796 lock (m_sittingAvatars)
3839 return new List<UUID>(m_sittingAvatars); 3797 return new List<ScenePresence>(m_sittingAvatars);
3840 } 3798 }
3841 3799
3842 /// <summary> 3800 /// <summary>