From 8714833986cef44787fd57a61699b7bdcfd3d3bb Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Thu, 12 Jun 2008 17:49:08 +0000 Subject: * 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 --- OpenSim/Region/Environment/Scenes/InnerScene.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Environment/Scenes/InnerScene.cs') 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 { sceneObject.RegionHandle = m_regInfo.RegionHandle; sceneObject.SetScene(m_parentScene); + foreach (SceneObjectPart part in sceneObject.Children.Values) { part.LocalId = m_parentScene.PrimIDAllocate(); @@ -200,16 +201,20 @@ namespace OpenSim.Region.Environment.Scenes } sceneObject.UpdateParentIDs(); - AddSceneObject(sceneObject); + AddSceneObject(sceneObject, true); } /// /// Add an object to the scene. /// /// + /// + /// If true, the object is made persistent into the scene. + /// If false, the object will not persist over server restarts + /// /// true if the object was added, false if an object with the same uuid was already in the scene /// - protected internal bool AddSceneObject(SceneObjectGroup sceneObject) + protected internal bool AddSceneObject(SceneObjectGroup sceneObject, bool attachToBackup) { lock (Entities) { @@ -218,6 +223,9 @@ namespace OpenSim.Region.Environment.Scenes // QuadTree.AddSceneObject(sceneObject); Entities.Add(sceneObject.UUID, sceneObject); m_numPrim += sceneObject.Children.Count; + + if (attachToBackup) + sceneObject.AttachToBackup(); return true; } -- cgit v1.1