diff options
author | Justin Clarke Casey | 2008-07-14 16:23:59 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-07-14 16:23:59 +0000 |
commit | 9cb4ba9d6b8def715018aab7d69ab64b9cf875c0 (patch) | |
tree | 8930ebacd332290fc8cf3d8aae9b52c1ef9d8040 | |
parent | adding support for Xml2 serialization format to XmlRpcLoadXMLMethod. (diff) | |
download | opensim-SC-9cb4ba9d6b8def715018aab7d69ab64b9cf875c0.zip opensim-SC-9cb4ba9d6b8def715018aab7d69ab64b9cf875c0.tar.gz opensim-SC-9cb4ba9d6b8def715018aab7d69ab64b9cf875c0.tar.bz2 opensim-SC-9cb4ba9d6b8def715018aab7d69ab64b9cf875c0.tar.xz |
* For now, when loading an archive all the existing scene objects get deleted by default
-rw-r--r-- | OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs | 5 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 17 |
2 files changed, 22 insertions, 0 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs index 40c7a69..fbda830 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs | |||
@@ -112,6 +112,9 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
112 | if (failedAssetRestores > 0) | 112 | if (failedAssetRestores > 0) |
113 | m_log.ErrorFormat("[ARCHIVER]: Failed to load {0} assets", failedAssetRestores); | 113 | m_log.ErrorFormat("[ARCHIVER]: Failed to load {0} assets", failedAssetRestores); |
114 | 114 | ||
115 | m_log.Info("[ARCHIVER]: Clearing all existing scene objects"); | ||
116 | m_scene.DeleteAllSceneObjects(); | ||
117 | |||
115 | // Reload serialized prims | 118 | // Reload serialized prims |
116 | m_log.InfoFormat("[ARCHIVER]: Loading {0} scene objects. Please wait.", serialisedSceneObjects.Count); | 119 | m_log.InfoFormat("[ARCHIVER]: Loading {0} scene objects. Please wait.", serialisedSceneObjects.Count); |
117 | 120 | ||
@@ -122,6 +125,8 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
122 | { | 125 | { |
123 | SceneObjectGroup sceneObject = serialiser.LoadGroupFromXml2(m_scene, serialisedSceneObject); | 126 | SceneObjectGroup sceneObject = serialiser.LoadGroupFromXml2(m_scene, serialisedSceneObject); |
124 | 127 | ||
128 | // TODO: Change object creator/owner here | ||
129 | |||
125 | if (null != sceneObject) | 130 | if (null != sceneObject) |
126 | sceneObjects.Add(sceneObject); | 131 | sceneObjects.Add(sceneObject); |
127 | } | 132 | } |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index a6a5264..ad9646f 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -1684,6 +1684,23 @@ namespace OpenSim.Region.Environment.Scenes | |||
1684 | } | 1684 | } |
1685 | 1685 | ||
1686 | /// <summary> | 1686 | /// <summary> |
1687 | /// Delete every object from the scene | ||
1688 | /// </summary> | ||
1689 | public void DeleteAllSceneObjects() | ||
1690 | { | ||
1691 | lock (Entities) | ||
1692 | { | ||
1693 | ICollection<EntityBase> entities = new List<EntityBase>(Entities.Values); | ||
1694 | |||
1695 | foreach (EntityBase e in entities) | ||
1696 | { | ||
1697 | if (e is SceneObjectGroup) | ||
1698 | DeleteSceneObject((SceneObjectGroup)e); | ||
1699 | } | ||
1700 | } | ||
1701 | } | ||
1702 | |||
1703 | /// <summary> | ||
1687 | /// Delete the given object from the scene. | 1704 | /// Delete the given object from the scene. |
1688 | /// </summary> | 1705 | /// </summary> |
1689 | /// <param name="group"></param> | 1706 | /// <param name="group"></param> |