aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs30
1 files changed, 19 insertions, 11 deletions
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
index 03e4bce..5c9f755 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
@@ -167,10 +167,24 @@ namespace OpenSim.Region.CoreModules.World.Archiver
167 m_log.InfoFormat("[ARCHIVER]: Loading {0} scene objects. Please wait.", serialisedSceneObjects.Count); 167 m_log.InfoFormat("[ARCHIVER]: Loading {0} scene objects. Please wait.", serialisedSceneObjects.Count);
168 168
169 IRegionSerialiserModule serialiser = m_scene.RequestModuleInterface<IRegionSerialiserModule>(); 169 IRegionSerialiserModule serialiser = m_scene.RequestModuleInterface<IRegionSerialiserModule>();
170 ICollection<SceneObjectGroup> sceneObjects = new List<SceneObjectGroup>(); 170 int sceneObjectsLoadedCount = 0;
171
171 172
172 foreach (string serialisedSceneObject in serialisedSceneObjects) 173 foreach (string serialisedSceneObject in serialisedSceneObjects)
173 { 174 {
175 m_log.DebugFormat("[ARCHIVER]: Loading xml with raw size {0}", serialisedSceneObject.Length);
176
177 // Really large xml files (multi megabyte) appear to cause
178 // memory problems
179 // when loading the xml. But don't enable this check yet
180/*
181 if (serialisedSceneObject.Length > 5000000)
182 {
183 m_log.Error("[ARCHIVER]: Ignoring xml since size > 5000000);");
184 continue;
185 }
186*/
187
174 SceneObjectGroup sceneObject = serialiser.DeserializeGroupFromXml2(serialisedSceneObject); 188 SceneObjectGroup sceneObject = serialiser.DeserializeGroupFromXml2(serialisedSceneObject);
175 189
176 // For now, give all incoming scene objects new uuids. This will allow scenes to be cloned 190 // For now, give all incoming scene objects new uuids. This will allow scenes to be cloned
@@ -222,26 +236,20 @@ namespace OpenSim.Region.CoreModules.World.Archiver
222 236
223 if (m_scene.AddRestoredSceneObject(sceneObject, true, false)) 237 if (m_scene.AddRestoredSceneObject(sceneObject, true, false))
224 { 238 {
225 sceneObjects.Add(sceneObject); 239 sceneObjectsLoadedCount++;
240 sceneObject.CreateScriptInstances(0, true, m_scene.DefaultScriptEngine, 0);
226 } 241 }
227 } 242 }
228 243
229 m_log.InfoFormat("[ARCHIVER]: Restored {0} scene objects to the scene", sceneObjects.Count); 244 m_log.InfoFormat("[ARCHIVER]: Restored {0} scene objects to the scene", sceneObjectsLoadedCount);
230 245
231 int ignoredObjects = serialisedSceneObjects.Count - sceneObjects.Count; 246 int ignoredObjects = serialisedSceneObjects.Count - sceneObjectsLoadedCount;
232 247
233 if (ignoredObjects > 0) 248 if (ignoredObjects > 0)
234 m_log.WarnFormat("[ARCHIVER]: Ignored {0} scene objects that already existed in the scene", ignoredObjects); 249 m_log.WarnFormat("[ARCHIVER]: Ignored {0} scene objects that already existed in the scene", ignoredObjects);
235 250
236 m_log.InfoFormat("[ARCHIVER]: Successfully loaded archive"); 251 m_log.InfoFormat("[ARCHIVER]: Successfully loaded archive");
237 252
238 m_log.Debug("[ARCHIVER]: Starting scripts");
239
240 foreach (SceneObjectGroup sceneObject in sceneObjects)
241 {
242 sceneObject.CreateScriptInstances(0, true, m_scene.DefaultScriptEngine, 0);
243 }
244
245 m_scene.EventManager.TriggerOarFileLoaded(m_errorMessage); 253 m_scene.EventManager.TriggerOarFileLoaded(m_errorMessage);
246 } 254 }
247 255