aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/World
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-07-13 00:18:29 +0000
committerJustin Clarke Casey2008-07-13 00:18:29 +0000
commiteb63b9bbc10ee9d794c273dc01111de8ce8c8a0c (patch)
treee744381547466429d3001955b62dd4f2e28c7983 /OpenSim/Region/Environment/Modules/World
parent* Elminate most of the debugging log output from the archive commands (diff)
downloadopensim-SC-eb63b9bbc10ee9d794c273dc01111de8ce8c8a0c.zip
opensim-SC-eb63b9bbc10ee9d794c273dc01111de8ce8c8a0c.tar.gz
opensim-SC-eb63b9bbc10ee9d794c273dc01111de8ce8c8a0c.tar.bz2
opensim-SC-eb63b9bbc10ee9d794c273dc01111de8ce8c8a0c.tar.xz
* Actually persist restored archives to the database - wasn't actually doing this before (doh)
* Not quite perfect yet
Diffstat (limited to 'OpenSim/Region/Environment/Modules/World')
-rw-r--r--OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs23
-rw-r--r--OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs2
-rw-r--r--OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs2
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 0522372..40c7a69 100644
--- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs
+++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs
@@ -71,6 +71,9 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
71 71
72 List<string> serialisedSceneObjects = new List<string>(); 72 List<string> serialisedSceneObjects = new List<string>();
73 string filePath = "ERROR"; 73 string filePath = "ERROR";
74
75 int successfulAssetRestores = 0;
76 int failedAssetRestores = 0;
74 77
75 byte[] data; 78 byte[] data;
76 while ((data = archive.ReadEntry(out filePath)) != null) 79 while ((data = archive.ReadEntry(out filePath)) != null)
@@ -89,7 +92,10 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
89// } 92// }
90 else if (filePath.StartsWith(ArchiveConstants.ASSETS_PATH)) 93 else if (filePath.StartsWith(ArchiveConstants.ASSETS_PATH))
91 { 94 {
92 LoadAsset(filePath, data); 95 if (LoadAsset(filePath, data))
96 successfulAssetRestores++;
97 else
98 failedAssetRestores++;
93 } 99 }
94 else if (filePath.StartsWith(ArchiveConstants.TERRAINS_PATH)) 100 else if (filePath.StartsWith(ArchiveConstants.TERRAINS_PATH))
95 { 101 {
@@ -100,9 +106,14 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
100 //m_log.Debug("[ARCHIVER]: Reached end of archive"); 106 //m_log.Debug("[ARCHIVER]: Reached end of archive");
101 107
102 archive.Close(); 108 archive.Close();
109
110 m_log.InfoFormat("[ARCHIVER]: Restored {0} assets", successfulAssetRestores);
111
112 if (failedAssetRestores > 0)
113 m_log.ErrorFormat("[ARCHIVER]: Failed to load {0} assets", failedAssetRestores);
103 114
104 // Reload serialized prims 115 // Reload serialized prims
105 m_log.InfoFormat("[ARCHIVER]: Loading {0} scene objects", serialisedSceneObjects.Count); 116 m_log.InfoFormat("[ARCHIVER]: Loading {0} scene objects. Please wait.", serialisedSceneObjects.Count);
106 117
107 IRegionSerialiser serialiser = m_scene.RequestModuleInterface<IRegionSerialiser>(); 118 IRegionSerialiser serialiser = m_scene.RequestModuleInterface<IRegionSerialiser>();
108 ICollection<SceneObjectGroup> sceneObjects = new List<SceneObjectGroup>(); 119 ICollection<SceneObjectGroup> sceneObjects = new List<SceneObjectGroup>();
@@ -115,12 +126,12 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
115 sceneObjects.Add(sceneObject); 126 sceneObjects.Add(sceneObject);
116 } 127 }
117 128
118 m_log.InfoFormat("[ARCHIVER]: Restored {0} objects to the scene", sceneObjects.Count); 129 m_log.InfoFormat("[ARCHIVER]: Restored {0} scene objects to the scene", sceneObjects.Count);
119 130
120 int ignoredObjects = serialisedSceneObjects.Count - sceneObjects.Count; 131 int ignoredObjects = serialisedSceneObjects.Count - sceneObjects.Count;
121 132
122 if (ignoredObjects > 0) 133 if (ignoredObjects > 0)
123 m_log.WarnFormat("[ARCHIVER]: Ignored {0} objects that already existed in the scene", ignoredObjects); 134 m_log.WarnFormat("[ARCHIVER]: Ignored {0} scene objects that already existed in the scene", ignoredObjects);
124 135
125 m_log.InfoFormat("[ARCHIVER]: Successfully loaded archive"); 136 m_log.InfoFormat("[ARCHIVER]: Successfully loaded archive");
126 137
@@ -149,7 +160,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
149 { 160 {
150 sbyte assetType = ArchiveConstants.EXTENSION_TO_ASSET_TYPE[extension]; 161 sbyte assetType = ArchiveConstants.EXTENSION_TO_ASSET_TYPE[extension];
151 162
152 m_log.DebugFormat("[ARCHIVER]: Importing asset {0}, type {1}", uuid, assetType); 163 //m_log.DebugFormat("[ARCHIVER]: Importing asset {0}, type {1}", uuid, assetType);
153 164
154 AssetBase asset = new AssetBase(new LLUUID(uuid), String.Empty); 165 AssetBase asset = new AssetBase(new LLUUID(uuid), String.Empty);
155 asset.Type = assetType; 166 asset.Type = assetType;
@@ -185,7 +196,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
185 terrainModule.LoadFromStream(terrainPath, ms); 196 terrainModule.LoadFromStream(terrainPath, ms);
186 ms.Close(); 197 ms.Close();
187 198
188 m_log.DebugFormat("[ARCHIVER]: Successfully loaded terrain {0}", terrainPath); 199 m_log.DebugFormat("[ARCHIVER]: Restored terrain {0}", terrainPath);
189 200
190 return true; 201 return true;
191 } 202 }
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs
index a0a579c..8236b6c 100644
--- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs
+++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs
@@ -215,7 +215,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
215 215
216 // XXX: Not a great way to iterate through face textures, but there's no 216 // XXX: Not a great way to iterate through face textures, but there's no
217 // other method available to tell how many faces there actually are 217 // other method available to tell how many faces there actually are
218 int i = 0; 218 //int i = 0;
219 foreach (LLObject.TextureEntryFace texture in textureEntry.FaceTextures) 219 foreach (LLObject.TextureEntryFace texture in textureEntry.FaceTextures)
220 { 220 {
221 if (texture != null) 221 if (texture != null)
diff --git a/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs b/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs
index bd19a7e..6327d65 100644
--- a/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs
+++ b/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs
@@ -185,7 +185,7 @@ namespace OpenSim.Region.Environment.Scenes
185 { 185 {
186 SceneObjectGroup obj = new SceneObjectGroup(xmlData); 186 SceneObjectGroup obj = new SceneObjectGroup(xmlData);
187 187
188 if (scene.AddRestoredSceneObject(obj, true)) 188 if (scene.AddRestoredSceneObject(obj, true, false))
189 return obj; 189 return obj;
190 else 190 else
191 return null; 191 return null;