aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneGraph.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneGraph.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs37
1 files changed, 17 insertions, 20 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index b7466be..4c12496 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -101,6 +101,13 @@ namespace OpenSim.Region.Framework.Scenes
101 /// </summary> 101 /// </summary>
102 protected internal Dictionary<uint, SceneObjectGroup> SceneObjectGroupsByLocalPartID = new Dictionary<uint, SceneObjectGroup>(); 102 protected internal Dictionary<uint, SceneObjectGroup> SceneObjectGroupsByLocalPartID = new Dictionary<uint, SceneObjectGroup>();
103 103
104 /// <summary>
105 /// Lock to prevent object group update, linking, delinking and duplication operations from running concurrently.
106 /// </summary>
107 /// <remarks>
108 /// These operations rely on the parts composition of the object. If allowed to run concurrently then race
109 /// conditions can occur.
110 /// </remarks>
104 private Object m_updateLock = new Object(); 111 private Object m_updateLock = new Object();
105 112
106 #endregion 113 #endregion
@@ -775,12 +782,6 @@ namespace OpenSim.Region.Framework.Scenes
775 782
776 public int GetChildAgentCount() 783 public int GetChildAgentCount()
777 { 784 {
778 // some network situations come in where child agents get closed twice.
779 if (m_numChildAgents < 0)
780 {
781 m_numChildAgents = 0;
782 }
783
784 return m_numChildAgents; 785 return m_numChildAgents;
785 } 786 }
786 787
@@ -852,11 +853,6 @@ namespace OpenSim.Region.Framework.Scenes
852 return m_scenePresenceArray; 853 return m_scenePresenceArray;
853 } 854 }
854 855
855 public int GetNumberOfScenePresences()
856 {
857 return m_scenePresenceArray.Count;
858 }
859
860 /// <summary> 856 /// <summary>
861 /// Request a scene presence by UUID. Fast, indexed lookup. 857 /// Request a scene presence by UUID. Fast, indexed lookup.
862 /// </summary> 858 /// </summary>
@@ -2063,12 +2059,14 @@ namespace OpenSim.Region.Framework.Scenes
2063 /// <param name="AgentID"></param> 2059 /// <param name="AgentID"></param>
2064 /// <param name="GroupID"></param> 2060 /// <param name="GroupID"></param>
2065 /// <param name="rot"></param> 2061 /// <param name="rot"></param>
2062 /// <returns>null if duplication fails, otherwise the duplicated object</returns>
2063 /// <summary>
2066 public SceneObjectGroup DuplicateObject(uint originalPrimID, Vector3 offset, uint flags, UUID AgentID, UUID GroupID, Quaternion rot) 2064 public SceneObjectGroup DuplicateObject(uint originalPrimID, Vector3 offset, uint flags, UUID AgentID, UUID GroupID, Quaternion rot)
2067 { 2065 {
2068// m_log.DebugFormat( 2066// m_log.DebugFormat(
2069// "[SCENE]: Duplication of object {0} at offset {1} requested by agent {2}", 2067// "[SCENE]: Duplication of object {0} at offset {1} requested by agent {2}",
2070// originalPrimID, offset, AgentID); 2068// originalPrimID, offset, AgentID);
2071 2069
2072 SceneObjectGroup original = GetGroupByPrim(originalPrimID); 2070 SceneObjectGroup original = GetGroupByPrim(originalPrimID);
2073 if (original != null) 2071 if (original != null)
2074 { 2072 {
@@ -2098,25 +2096,25 @@ namespace OpenSim.Region.Framework.Scenes
2098 2096
2099 // FIXME: This section needs to be refactored so that it just calls AddSceneObject() 2097 // FIXME: This section needs to be refactored so that it just calls AddSceneObject()
2100 Entities.Add(copy); 2098 Entities.Add(copy);
2101 2099
2102 lock (SceneObjectGroupsByFullID) 2100 lock (SceneObjectGroupsByFullID)
2103 SceneObjectGroupsByFullID[copy.UUID] = copy; 2101 SceneObjectGroupsByFullID[copy.UUID] = copy;
2104 2102
2105 SceneObjectPart[] children = copy.Parts; 2103 SceneObjectPart[] children = copy.Parts;
2106 2104
2107 lock (SceneObjectGroupsByFullPartID) 2105 lock (SceneObjectGroupsByFullPartID)
2108 { 2106 {
2109 SceneObjectGroupsByFullPartID[copy.UUID] = copy; 2107 SceneObjectGroupsByFullPartID[copy.UUID] = copy;
2110 foreach (SceneObjectPart part in children) 2108 foreach (SceneObjectPart part in children)
2111 SceneObjectGroupsByFullPartID[part.UUID] = copy; 2109 SceneObjectGroupsByFullPartID[part.UUID] = copy;
2112 } 2110 }
2113 2111
2114 lock (SceneObjectGroupsByLocalPartID) 2112 lock (SceneObjectGroupsByLocalPartID)
2115 { 2113 {
2116 SceneObjectGroupsByLocalPartID[copy.LocalId] = copy; 2114 SceneObjectGroupsByLocalPartID[copy.LocalId] = copy;
2117 foreach (SceneObjectPart part in children) 2115 foreach (SceneObjectPart part in children)
2118 SceneObjectGroupsByLocalPartID[part.LocalId] = copy; 2116 SceneObjectGroupsByLocalPartID[part.LocalId] = copy;
2119 } 2117 }
2120 // PROBABLE END OF FIXME 2118 // PROBABLE END OF FIXME
2121 2119
2122 // Since we copy from a source group that is in selected 2120 // Since we copy from a source group that is in selected
@@ -2148,11 +2146,10 @@ namespace OpenSim.Region.Framework.Scenes
2148 { 2146 {
2149 m_log.WarnFormat("[SCENE]: Attempted to duplicate nonexistant prim id {0}", GroupID); 2147 m_log.WarnFormat("[SCENE]: Attempted to duplicate nonexistant prim id {0}", GroupID);
2150 } 2148 }
2151 2149
2152 return null; 2150 return null;
2153 } 2151 }
2154 2152
2155 /// <summary>
2156 /// Calculates the distance between two Vector3s 2153 /// Calculates the distance between two Vector3s
2157 /// </summary> 2154 /// </summary>
2158 /// <param name="v1"></param> 2155 /// <param name="v1"></param>