aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/InnerScene.cs
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-06-12 17:49:08 +0000
committerJustin Clarke Casey2008-06-12 17:49:08 +0000
commit8714833986cef44787fd57a61699b7bdcfd3d3bb (patch)
treefbd78ff5755484df5ca5732389a7006f92db6508 /OpenSim/Region/Environment/Scenes/InnerScene.cs
parent* refactor: rename CreatePrimFromXml to CreatePrimFromXml2 (diff)
downloadopensim-SC-8714833986cef44787fd57a61699b7bdcfd3d3bb.zip
opensim-SC-8714833986cef44787fd57a61699b7bdcfd3d3bb.tar.gz
opensim-SC-8714833986cef44787fd57a61699b7bdcfd3d3bb.tar.bz2
opensim-SC-8714833986cef44787fd57a61699b7bdcfd3d3bb.tar.xz
* refactor: For new objects, move attach to backup to occur when adding to a scene, rather than on creation of the group
* Adding to a scene is now parameterized such that one can choose not to actually persist that group * This is to support a use case where a module wants a scene which consists of both objects which are persisted, and ones which are just temporary for the lifetime of that server instance
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/InnerScene.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/InnerScene.cs12
1 files changed, 10 insertions, 2 deletions
diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs
index 3cd32c6..d09efd8 100644
--- a/OpenSim/Region/Environment/Scenes/InnerScene.cs
+++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs
@@ -193,6 +193,7 @@ namespace OpenSim.Region.Environment.Scenes
193 { 193 {
194 sceneObject.RegionHandle = m_regInfo.RegionHandle; 194 sceneObject.RegionHandle = m_regInfo.RegionHandle;
195 sceneObject.SetScene(m_parentScene); 195 sceneObject.SetScene(m_parentScene);
196
196 foreach (SceneObjectPart part in sceneObject.Children.Values) 197 foreach (SceneObjectPart part in sceneObject.Children.Values)
197 { 198 {
198 part.LocalId = m_parentScene.PrimIDAllocate(); 199 part.LocalId = m_parentScene.PrimIDAllocate();
@@ -200,16 +201,20 @@ namespace OpenSim.Region.Environment.Scenes
200 } 201 }
201 sceneObject.UpdateParentIDs(); 202 sceneObject.UpdateParentIDs();
202 203
203 AddSceneObject(sceneObject); 204 AddSceneObject(sceneObject, true);
204 } 205 }
205 206
206 /// <summary> 207 /// <summary>
207 /// Add an object to the scene. 208 /// Add an object to the scene.
208 /// </summary> 209 /// </summary>
209 /// <param name="sceneObject"></param> 210 /// <param name="sceneObject"></param>
211 /// <param name="attachToBackup">
212 /// If true, the object is made persistent into the scene.
213 /// If false, the object will not persist over server restarts
214 /// </param>
210 /// <returns>true if the object was added, false if an object with the same uuid was already in the scene 215 /// <returns>true if the object was added, false if an object with the same uuid was already in the scene
211 /// </returns> 216 /// </returns>
212 protected internal bool AddSceneObject(SceneObjectGroup sceneObject) 217 protected internal bool AddSceneObject(SceneObjectGroup sceneObject, bool attachToBackup)
213 { 218 {
214 lock (Entities) 219 lock (Entities)
215 { 220 {
@@ -218,6 +223,9 @@ namespace OpenSim.Region.Environment.Scenes
218 // QuadTree.AddSceneObject(sceneObject); 223 // QuadTree.AddSceneObject(sceneObject);
219 Entities.Add(sceneObject.UUID, sceneObject); 224 Entities.Add(sceneObject.UUID, sceneObject);
220 m_numPrim += sceneObject.Children.Count; 225 m_numPrim += sceneObject.Children.Count;
226
227 if (attachToBackup)
228 sceneObject.AttachToBackup();
221 229
222 return true; 230 return true;
223 } 231 }