From 587f6ab6459d12a9c6fe02dcf272d954b545d099 Mon Sep 17 00:00:00 2001
From: Justin Clarke Casey
Date: Wed, 14 May 2008 21:09:41 +0000
Subject: * Refactor: Remove SceneObjectGroup.GetScenePresences() in favour of
a direct call to Scene
---
OpenSim/Region/Environment/Scenes/EntityBase.cs | 8 +++++---
OpenSim/Region/Environment/Scenes/Scene.cs | 2 +-
OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | 11 +----------
OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | 12 ++++++------
4 files changed, 13 insertions(+), 20 deletions(-)
diff --git a/OpenSim/Region/Environment/Scenes/EntityBase.cs b/OpenSim/Region/Environment/Scenes/EntityBase.cs
index 11bafb7..18a2851 100644
--- a/OpenSim/Region/Environment/Scenes/EntityBase.cs
+++ b/OpenSim/Region/Environment/Scenes/EntityBase.cs
@@ -35,13 +35,15 @@ namespace OpenSim.Region.Environment.Scenes
{
[Serializable]
public abstract class EntityBase : ISerializable
- {
- protected Scene m_scene;
-
+ {
+ ///
+ /// The scene to which this entity belongs
+ ///
public Scene Scene
{
get { return m_scene; }
}
+ protected Scene m_scene;
protected LLUUID m_uuid;
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index d017c50..4188deb 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -3096,7 +3096,7 @@ namespace OpenSim.Region.Environment.Scenes
}
///
- /// Request a List of all ScenePresences in this region
+ /// Request a List of all ScenePresences in this region. This returns child agents as well as root agents.
///
///
public List GetScenePresences()
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
index bc99aa4..4a112ae 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -785,15 +785,6 @@ namespace OpenSim.Region.Environment.Scenes
part.ClearUndoState();
}
- ///
- ///
- ///
- ///
- public List GetScenePresences()
- {
- return m_scene.GetScenePresences();
- }
-
public override void UpdateMovement()
{
lock (m_parts)
@@ -933,7 +924,7 @@ namespace OpenSim.Region.Environment.Scenes
{
foreach (SceneObjectPart part in m_parts.Values)
{
- List avatars = GetScenePresences();
+ List avatars = Scene.GetScenePresences();
for (int i = 0; i < avatars.Count; i++)
{
if (avatars[i].ParentID == LocalId)
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
index 6c5a68d..c171e78 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
@@ -2247,7 +2247,7 @@ namespace OpenSim.Region.Environment.Scenes
private void SendObjectPropertiesToClient(LLUUID AgentID)
{
- List avatars = m_parentGroup.GetScenePresences();
+ List avatars = m_parentGroup.Scene.GetScenePresences();
for (int i = 0; i < avatars.Count; i++)
{
// Ugly reference :(
@@ -2277,7 +2277,7 @@ namespace OpenSim.Region.Environment.Scenes
///
public void AddFullUpdateToAllAvatars()
{
- List avatars = m_parentGroup.GetScenePresences();
+ List avatars = m_parentGroup.Scene.GetScenePresences();
for (int i = 0; i < avatars.Count; i++)
{
avatars[i].QueuePartForUpdate(this);
@@ -2286,7 +2286,7 @@ namespace OpenSim.Region.Environment.Scenes
public void SendFullUpdateToAllClientsExcept(LLUUID agentID)
{
- List avatars = m_parentGroup.GetScenePresences();
+ List avatars = m_parentGroup.Scene.GetScenePresences();
for (int i = 0; i < avatars.Count; i++)
{
// Ugly reference :(
@@ -2309,7 +2309,7 @@ namespace OpenSim.Region.Environment.Scenes
///
public void SendFullUpdateToAllClients()
{
- List avatars = m_parentGroup.GetScenePresences();
+ List avatars = m_parentGroup.Scene.GetScenePresences();
for (int i = 0; i < avatars.Count; i++)
{
// Ugly reference :(
@@ -2370,7 +2370,7 @@ namespace OpenSim.Region.Environment.Scenes
/// Terse updates
public void AddTerseUpdateToAllAvatars()
{
- List avatars = m_parentGroup.GetScenePresences();
+ List avatars = m_parentGroup.Scene.GetScenePresences();
for (int i = 0; i < avatars.Count; i++)
{
avatars[i].QueuePartForUpdate(this);
@@ -2387,7 +2387,7 @@ namespace OpenSim.Region.Environment.Scenes
///
public void SendTerseUpdateToAllClients()
{
- List avatars = m_parentGroup.GetScenePresences();
+ List avatars = m_parentGroup.Scene.GetScenePresences();
for (int i = 0; i < avatars.Count; i++)
{
m_parentGroup.SendPartTerseUpdate(avatars[i].ControllingClient, this);
--
cgit v1.1