aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/World
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-07-12 22:14:38 +0000
committerJustin Clarke Casey2008-07-12 22:14:38 +0000
commita89385818d35dd991aa29f835fdb742e0923c26e (patch)
tree56cd5b650bcc8aceafcbd4a1cb7f3026e8d9c30f /OpenSim/Region/Environment/Modules/World
parentminor: method documentation (diff)
downloadopensim-SC_OLD-a89385818d35dd991aa29f835fdb742e0923c26e.zip
opensim-SC_OLD-a89385818d35dd991aa29f835fdb742e0923c26e.tar.gz
opensim-SC_OLD-a89385818d35dd991aa29f835fdb742e0923c26e.tar.bz2
opensim-SC_OLD-a89385818d35dd991aa29f835fdb742e0923c26e.tar.xz
* On archive loading, tell the user how many objects we are ignoring because they already exist in the scene
* (ability to give objects new uuids will come later)
Diffstat (limited to 'OpenSim/Region/Environment/Modules/World')
-rw-r--r--OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs16
-rw-r--r--OpenSim/Region/Environment/Modules/World/Serialiser/IRegionSerialiser.cs2
-rw-r--r--OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs9
3 files changed, 19 insertions, 8 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs
index 0e37197..c9f8fce 100644
--- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs
+++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs
@@ -103,11 +103,14 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
103 m_log.InfoFormat("[ARCHIVER]: Loading {0} scene objects", serialisedSceneObjects.Count); 103 m_log.InfoFormat("[ARCHIVER]: Loading {0} scene objects", serialisedSceneObjects.Count);
104 104
105 IRegionSerialiser serialiser = m_scene.RequestModuleInterface<IRegionSerialiser>(); 105 IRegionSerialiser serialiser = m_scene.RequestModuleInterface<IRegionSerialiser>();
106 ICollection<SceneObjectGroup> sceneObjects = new List<SceneObjectGroup>(); 106 ICollection<SceneObjectGroup> sceneObjects = new List<SceneObjectGroup>();
107 107
108 foreach (string serialisedSceneObject in serialisedSceneObjects) 108 foreach (string serialisedSceneObject in serialisedSceneObjects)
109 { 109 {
110 sceneObjects.Add(serialiser.LoadGroupFromXml2(m_scene, serialisedSceneObject)); 110 SceneObjectGroup sceneObject = serialiser.LoadGroupFromXml2(m_scene, serialisedSceneObject);
111
112 if (null != sceneObject)
113 sceneObjects.Add(sceneObject);
111 } 114 }
112 115
113 m_log.Debug("[ARCHIVER]: Starting scripts"); 116 m_log.Debug("[ARCHIVER]: Starting scripts");
@@ -117,6 +120,13 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
117 sceneObject.CreateScriptInstances(0, true); 120 sceneObject.CreateScriptInstances(0, true);
118 } 121 }
119 122
123 m_log.InfoFormat("[ARCHIVER]: Restored {0} objects to the scene", sceneObjects.Count);
124
125 int ignoredObjects = serialisedSceneObjects.Count - sceneObjects.Count;
126
127 if (ignoredObjects > 0)
128 m_log.WarnFormat("[ARCHIVER]: Ignored {0} objects that already existed in the scene", ignoredObjects);
129
120 m_log.InfoFormat("[ARCHIVER]: Successfully loaded archive"); 130 m_log.InfoFormat("[ARCHIVER]: Successfully loaded archive");
121 } 131 }
122 132
diff --git a/OpenSim/Region/Environment/Modules/World/Serialiser/IRegionSerialiser.cs b/OpenSim/Region/Environment/Modules/World/Serialiser/IRegionSerialiser.cs
index 0fc8ac3..6e48f8e 100644
--- a/OpenSim/Region/Environment/Modules/World/Serialiser/IRegionSerialiser.cs
+++ b/OpenSim/Region/Environment/Modules/World/Serialiser/IRegionSerialiser.cs
@@ -85,7 +85,7 @@ namespace OpenSim.Region.Environment.Modules.World.Serialiser
85 /// </summary> 85 /// </summary>
86 /// <param name="scene"></param> 86 /// <param name="scene"></param>
87 /// <param name="xmlString"></param> 87 /// <param name="xmlString"></param>
88 /// <returns>The scene object created</returns> 88 /// <returns>The scene object created. null if the scene object already existed</returns>
89 SceneObjectGroup LoadGroupFromXml2(Scene scene, string xmlString); 89 SceneObjectGroup LoadGroupFromXml2(Scene scene, string xmlString);
90 90
91 /// <summary> 91 /// <summary>
diff --git a/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs b/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs
index f283ecb..bd19a7e 100644
--- a/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs
+++ b/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs
@@ -180,14 +180,15 @@ namespace OpenSim.Region.Environment.Scenes
180 /// </summary> 180 /// </summary>
181 /// <param name="scene"></param> 181 /// <param name="scene"></param>
182 /// <param name="xmlData"></param> 182 /// <param name="xmlData"></param>
183 /// <returns>The scene object created</returns> 183 /// <returns>The scene object created. null if the scene object already existed</returns>
184 protected static SceneObjectGroup CreatePrimFromXml2(Scene scene, string xmlData) 184 protected static SceneObjectGroup CreatePrimFromXml2(Scene scene, string xmlData)
185 { 185 {
186 SceneObjectGroup obj = new SceneObjectGroup(xmlData); 186 SceneObjectGroup obj = new SceneObjectGroup(xmlData);
187 187
188 scene.AddRestoredSceneObject(obj, true); 188 if (scene.AddRestoredSceneObject(obj, true))
189 189 return obj;
190 return obj; 190 else
191 return null;
191 } 192 }
192 193
193 public static void SavePrimsToXml2(Scene scene, string fileName) 194 public static void SavePrimsToXml2(Scene scene, string fileName)