diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneGraph.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneGraph.cs | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index b7466be..a62c1ac 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 |
@@ -852,11 +859,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
852 | return m_scenePresenceArray; | 859 | return m_scenePresenceArray; |
853 | } | 860 | } |
854 | 861 | ||
855 | public int GetNumberOfScenePresences() | ||
856 | { | ||
857 | return m_scenePresenceArray.Count; | ||
858 | } | ||
859 | |||
860 | /// <summary> | 862 | /// <summary> |
861 | /// Request a scene presence by UUID. Fast, indexed lookup. | 863 | /// Request a scene presence by UUID. Fast, indexed lookup. |
862 | /// </summary> | 864 | /// </summary> |
@@ -2063,12 +2065,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
2063 | /// <param name="AgentID"></param> | 2065 | /// <param name="AgentID"></param> |
2064 | /// <param name="GroupID"></param> | 2066 | /// <param name="GroupID"></param> |
2065 | /// <param name="rot"></param> | 2067 | /// <param name="rot"></param> |
2068 | /// <returns>null if duplication fails, otherwise the duplicated object</returns> | ||
2069 | /// <summary> | ||
2066 | public SceneObjectGroup DuplicateObject(uint originalPrimID, Vector3 offset, uint flags, UUID AgentID, UUID GroupID, Quaternion rot) | 2070 | public SceneObjectGroup DuplicateObject(uint originalPrimID, Vector3 offset, uint flags, UUID AgentID, UUID GroupID, Quaternion rot) |
2067 | { | 2071 | { |
2068 | // m_log.DebugFormat( | 2072 | // m_log.DebugFormat( |
2069 | // "[SCENE]: Duplication of object {0} at offset {1} requested by agent {2}", | 2073 | // "[SCENE]: Duplication of object {0} at offset {1} requested by agent {2}", |
2070 | // originalPrimID, offset, AgentID); | 2074 | // originalPrimID, offset, AgentID); |
2071 | 2075 | ||
2072 | SceneObjectGroup original = GetGroupByPrim(originalPrimID); | 2076 | SceneObjectGroup original = GetGroupByPrim(originalPrimID); |
2073 | if (original != null) | 2077 | if (original != null) |
2074 | { | 2078 | { |
@@ -2098,25 +2102,25 @@ namespace OpenSim.Region.Framework.Scenes | |||
2098 | 2102 | ||
2099 | // FIXME: This section needs to be refactored so that it just calls AddSceneObject() | 2103 | // FIXME: This section needs to be refactored so that it just calls AddSceneObject() |
2100 | Entities.Add(copy); | 2104 | Entities.Add(copy); |
2101 | 2105 | ||
2102 | lock (SceneObjectGroupsByFullID) | 2106 | lock (SceneObjectGroupsByFullID) |
2103 | SceneObjectGroupsByFullID[copy.UUID] = copy; | 2107 | SceneObjectGroupsByFullID[copy.UUID] = copy; |
2104 | 2108 | ||
2105 | SceneObjectPart[] children = copy.Parts; | 2109 | SceneObjectPart[] children = copy.Parts; |
2106 | 2110 | ||
2107 | lock (SceneObjectGroupsByFullPartID) | 2111 | lock (SceneObjectGroupsByFullPartID) |
2108 | { | 2112 | { |
2109 | SceneObjectGroupsByFullPartID[copy.UUID] = copy; | 2113 | SceneObjectGroupsByFullPartID[copy.UUID] = copy; |
2110 | foreach (SceneObjectPart part in children) | 2114 | foreach (SceneObjectPart part in children) |
2111 | SceneObjectGroupsByFullPartID[part.UUID] = copy; | 2115 | SceneObjectGroupsByFullPartID[part.UUID] = copy; |
2112 | } | 2116 | } |
2113 | 2117 | ||
2114 | lock (SceneObjectGroupsByLocalPartID) | 2118 | lock (SceneObjectGroupsByLocalPartID) |
2115 | { | 2119 | { |
2116 | SceneObjectGroupsByLocalPartID[copy.LocalId] = copy; | 2120 | SceneObjectGroupsByLocalPartID[copy.LocalId] = copy; |
2117 | foreach (SceneObjectPart part in children) | 2121 | foreach (SceneObjectPart part in children) |
2118 | SceneObjectGroupsByLocalPartID[part.LocalId] = copy; | 2122 | SceneObjectGroupsByLocalPartID[part.LocalId] = copy; |
2119 | } | 2123 | } |
2120 | // PROBABLE END OF FIXME | 2124 | // PROBABLE END OF FIXME |
2121 | 2125 | ||
2122 | // Since we copy from a source group that is in selected | 2126 | // Since we copy from a source group that is in selected |
@@ -2148,11 +2152,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
2148 | { | 2152 | { |
2149 | m_log.WarnFormat("[SCENE]: Attempted to duplicate nonexistant prim id {0}", GroupID); | 2153 | m_log.WarnFormat("[SCENE]: Attempted to duplicate nonexistant prim id {0}", GroupID); |
2150 | } | 2154 | } |
2151 | 2155 | ||
2152 | return null; | 2156 | return null; |
2153 | } | 2157 | } |
2154 | 2158 | ||
2155 | /// <summary> | ||
2156 | /// Calculates the distance between two Vector3s | 2159 | /// Calculates the distance between two Vector3s |
2157 | /// </summary> | 2160 | /// </summary> |
2158 | /// <param name="v1"></param> | 2161 | /// <param name="v1"></param> |