diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneGraph.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneGraph.cs | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index debb164..00f76e0 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs | |||
@@ -102,8 +102,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
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> | 104 | /// <summary> |
105 | /// Lock to prevent object group update, linking and delinking operations from running concurrently. | 105 | /// Lock to prevent object group update, linking, delinking and duplication operations from running concurrently. |
106 | /// </summary> | 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> | ||
107 | private Object m_updateLock = new Object(); | 111 | private Object m_updateLock = new Object(); |
108 | 112 | ||
109 | #endregion | 113 | #endregion |
@@ -2067,12 +2071,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
2067 | /// <param name="AgentID"></param> | 2071 | /// <param name="AgentID"></param> |
2068 | /// <param name="GroupID"></param> | 2072 | /// <param name="GroupID"></param> |
2069 | /// <param name="rot"></param> | 2073 | /// <param name="rot"></param> |
2074 | /// <returns>null if duplication fails, otherwise the duplicated object</returns> | ||
2075 | /// <summary> | ||
2070 | public SceneObjectGroup DuplicateObject(uint originalPrimID, Vector3 offset, uint flags, UUID AgentID, UUID GroupID, Quaternion rot) | 2076 | public SceneObjectGroup DuplicateObject(uint originalPrimID, Vector3 offset, uint flags, UUID AgentID, UUID GroupID, Quaternion rot) |
2071 | { | 2077 | { |
2072 | // m_log.DebugFormat( | 2078 | // m_log.DebugFormat( |
2073 | // "[SCENE]: Duplication of object {0} at offset {1} requested by agent {2}", | 2079 | // "[SCENE]: Duplication of object {0} at offset {1} requested by agent {2}", |
2074 | // originalPrimID, offset, AgentID); | 2080 | // originalPrimID, offset, AgentID); |
2075 | 2081 | ||
2076 | SceneObjectGroup original = GetGroupByPrim(originalPrimID); | 2082 | SceneObjectGroup original = GetGroupByPrim(originalPrimID); |
2077 | if (original != null) | 2083 | if (original != null) |
2078 | { | 2084 | { |
@@ -2102,25 +2108,25 @@ namespace OpenSim.Region.Framework.Scenes | |||
2102 | 2108 | ||
2103 | // FIXME: This section needs to be refactored so that it just calls AddSceneObject() | 2109 | // FIXME: This section needs to be refactored so that it just calls AddSceneObject() |
2104 | Entities.Add(copy); | 2110 | Entities.Add(copy); |
2105 | 2111 | ||
2106 | lock (SceneObjectGroupsByFullID) | 2112 | lock (SceneObjectGroupsByFullID) |
2107 | SceneObjectGroupsByFullID[copy.UUID] = copy; | 2113 | SceneObjectGroupsByFullID[copy.UUID] = copy; |
2108 | 2114 | ||
2109 | SceneObjectPart[] children = copy.Parts; | 2115 | SceneObjectPart[] children = copy.Parts; |
2110 | 2116 | ||
2111 | lock (SceneObjectGroupsByFullPartID) | 2117 | lock (SceneObjectGroupsByFullPartID) |
2112 | { | 2118 | { |
2113 | SceneObjectGroupsByFullPartID[copy.UUID] = copy; | 2119 | SceneObjectGroupsByFullPartID[copy.UUID] = copy; |
2114 | foreach (SceneObjectPart part in children) | 2120 | foreach (SceneObjectPart part in children) |
2115 | SceneObjectGroupsByFullPartID[part.UUID] = copy; | 2121 | SceneObjectGroupsByFullPartID[part.UUID] = copy; |
2116 | } | 2122 | } |
2117 | 2123 | ||
2118 | lock (SceneObjectGroupsByLocalPartID) | 2124 | lock (SceneObjectGroupsByLocalPartID) |
2119 | { | 2125 | { |
2120 | SceneObjectGroupsByLocalPartID[copy.LocalId] = copy; | 2126 | SceneObjectGroupsByLocalPartID[copy.LocalId] = copy; |
2121 | foreach (SceneObjectPart part in children) | 2127 | foreach (SceneObjectPart part in children) |
2122 | SceneObjectGroupsByLocalPartID[part.LocalId] = copy; | 2128 | SceneObjectGroupsByLocalPartID[part.LocalId] = copy; |
2123 | } | 2129 | } |
2124 | // PROBABLE END OF FIXME | 2130 | // PROBABLE END OF FIXME |
2125 | 2131 | ||
2126 | // Since we copy from a source group that is in selected | 2132 | // Since we copy from a source group that is in selected |
@@ -2152,11 +2158,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
2152 | { | 2158 | { |
2153 | m_log.WarnFormat("[SCENE]: Attempted to duplicate nonexistant prim id {0}", GroupID); | 2159 | m_log.WarnFormat("[SCENE]: Attempted to duplicate nonexistant prim id {0}", GroupID); |
2154 | } | 2160 | } |
2155 | 2161 | ||
2156 | return null; | 2162 | return null; |
2157 | } | 2163 | } |
2158 | 2164 | ||
2159 | /// <summary> | ||
2160 | /// Calculates the distance between two Vector3s | 2165 | /// Calculates the distance between two Vector3s |
2161 | /// </summary> | 2166 | /// </summary> |
2162 | /// <param name="v1"></param> | 2167 | /// <param name="v1"></param> |