aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs
diff options
context:
space:
mode:
authorJeff Ames2008-08-18 00:39:10 +0000
committerJeff Ames2008-08-18 00:39:10 +0000
commit6ef9d4da901a346c232458317cca6268da888e2e (patch)
treedd1d935b10f34f261839da9f9879c02322e8ede7 /OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs
parentUpdate svn properties, minor formatting cleanup. (diff)
downloadopensim-SC_OLD-6ef9d4da901a346c232458317cca6268da888e2e.zip
opensim-SC_OLD-6ef9d4da901a346c232458317cca6268da888e2e.tar.gz
opensim-SC_OLD-6ef9d4da901a346c232458317cca6268da888e2e.tar.bz2
opensim-SC_OLD-6ef9d4da901a346c232458317cca6268da888e2e.tar.xz
Formatting cleanup.
Diffstat (limited to 'OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs')
-rw-r--r--OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs54
1 files changed, 27 insertions, 27 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs
index 327808a..20e15ab 100644
--- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs
+++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs
@@ -52,14 +52,14 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
52 52
53 protected Scene m_scene; 53 protected Scene m_scene;
54 protected string m_savePath; 54 protected string m_savePath;
55 55
56 /// <summary> 56 /// <summary>
57 /// Used for identifying uuids embedded in scripts 57 /// Used for identifying uuids embedded in scripts
58 /// </summary> 58 /// </summary>
59 protected static readonly Regex m_uuidRegex 59 protected static readonly Regex m_uuidRegex
60 = new Regex( 60 = new Regex(
61 "[0-9a-eA-E]{8}-[0-9a-eA-E]{4}-[0-9a-eA-E]{4}-[0-9a-eA-E]{4}-[0-9a-eA-E]{12}", 61 "[0-9a-eA-E]{8}-[0-9a-eA-E]{4}-[0-9a-eA-E]{4}-[0-9a-eA-E]{4}-[0-9a-eA-E]{12}",
62 RegexOptions.Compiled); 62 RegexOptions.Compiled);
63 63
64 /// <summary> 64 /// <summary>
65 /// Used as a temporary store of an asset which represents an object. This can be a null if no appropriate 65 /// Used as a temporary store of an asset which represents an object. This can be a null if no appropriate
@@ -93,9 +93,9 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
93 Monitor.Pulse(this); 93 Monitor.Pulse(this);
94 } 94 }
95 } 95 }
96 96
97 /// <summary> 97 /// <summary>
98 /// Get an asset synchronously, potentially using an asynchronous callback. If the 98 /// Get an asset synchronously, potentially using an asynchronous callback. If the
99 /// asynchronous callback is used, we will wait for it to complete. 99 /// asynchronous callback is used, we will wait for it to complete.
100 /// </summary> 100 /// </summary>
101 /// <param name="uuid"></param> 101 /// <param name="uuid"></param>
@@ -118,11 +118,11 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
118 Monitor.Wait(this); 118 Monitor.Wait(this);
119 m_waitingForObjectAsset = false; 119 m_waitingForObjectAsset = false;
120 } 120 }
121 } 121 }
122 122
123 return m_requestedObjectAsset; 123 return m_requestedObjectAsset;
124 } 124 }
125 125
126 /// <summary> 126 /// <summary>
127 /// Record the asset uuids embedded within the given script. 127 /// Record the asset uuids embedded within the given script.
128 /// </summary> 128 /// </summary>
@@ -138,16 +138,16 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
138 //m_log.DebugFormat("[ARCHIVER]: Script {0}", script); 138 //m_log.DebugFormat("[ARCHIVER]: Script {0}", script);
139 MatchCollection uuidMatches = m_uuidRegex.Matches(script); 139 MatchCollection uuidMatches = m_uuidRegex.Matches(script);
140 //m_log.DebugFormat("[ARCHIVER]: Found {0} matches in script", uuidMatches.Count); 140 //m_log.DebugFormat("[ARCHIVER]: Found {0} matches in script", uuidMatches.Count);
141 141
142 foreach (Match uuidMatch in uuidMatches) 142 foreach (Match uuidMatch in uuidMatches)
143 { 143 {
144 LLUUID uuid = new LLUUID(uuidMatch.Value); 144 LLUUID uuid = new LLUUID(uuidMatch.Value);
145 //m_log.DebugFormat("[ARCHIVER]: Recording {0} in script", uuid); 145 //m_log.DebugFormat("[ARCHIVER]: Recording {0} in script", uuid);
146 assetUuids[uuid] = 1; 146 assetUuids[uuid] = 1;
147 } 147 }
148 } 148 }
149 } 149 }
150 150
151 /// <summary> 151 /// <summary>
152 /// Record the uuids referenced by the given wearable asset 152 /// Record the uuids referenced by the given wearable asset
153 /// </summary> 153 /// </summary>
@@ -159,25 +159,25 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
159 //m_log.Debug(new System.Text.ASCIIEncoding().GetString(bodypartAsset.Data)); 159 //m_log.Debug(new System.Text.ASCIIEncoding().GetString(bodypartAsset.Data));
160 AssetWearable wearableAsset = new AssetBodypart(assetBase.Data); 160 AssetWearable wearableAsset = new AssetBodypart(assetBase.Data);
161 wearableAsset.Decode(); 161 wearableAsset.Decode();
162 162
163 //m_log.DebugFormat( 163 //m_log.DebugFormat(
164 // "[ARCHIVER]: Wearable asset {0} references {1} assets", wearableAssetUuid, wearableAsset.Textures.Count); 164 // "[ARCHIVER]: Wearable asset {0} references {1} assets", wearableAssetUuid, wearableAsset.Textures.Count);
165 165
166 foreach (LLUUID uuid in wearableAsset.Textures.Values) 166 foreach (LLUUID uuid in wearableAsset.Textures.Values)
167 { 167 {
168 //m_log.DebugFormat("[ARCHIVER]: Got bodypart uuid {0}", uuid); 168 //m_log.DebugFormat("[ARCHIVER]: Got bodypart uuid {0}", uuid);
169 assetUuids[uuid] = 1; 169 assetUuids[uuid] = 1;
170 } 170 }
171 } 171 }
172 172
173 /// <summary> 173 /// <summary>
174 /// Get all the asset uuids associated with a given object. This includes both those directly associated with 174 /// Get all the asset uuids associated with a given object. This includes both those directly associated with
175 /// it (e.g. face textures) and recursively, those of items within it's inventory (e.g. objects contained 175 /// it (e.g. face textures) and recursively, those of items within it's inventory (e.g. objects contained
176 /// within this object). 176 /// within this object).
177 /// </summary> 177 /// </summary>
178 /// <param name="sceneObject"></param> 178 /// <param name="sceneObject"></param>
179 /// <param name="assetUuids"></param> 179 /// <param name="assetUuids"></param>
180 protected void GetSceneObjectAssetUuids(LLUUID sceneObjectUuid, IDictionary<LLUUID, int> assetUuids) 180 protected void GetSceneObjectAssetUuids(LLUUID sceneObjectUuid, IDictionary<LLUUID, int> assetUuids)
181 { 181 {
182 AssetBase objectAsset = GetAsset(sceneObjectUuid); 182 AssetBase objectAsset = GetAsset(sceneObjectUuid);
183 183
@@ -186,7 +186,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
186 string xml = Helpers.FieldToUTF8String(objectAsset.Data); 186 string xml = Helpers.FieldToUTF8String(objectAsset.Data);
187 SceneObjectGroup sog = new SceneObjectGroup(m_scene, m_scene.RegionInfo.RegionHandle, xml); 187 SceneObjectGroup sog = new SceneObjectGroup(m_scene, m_scene.RegionInfo.RegionHandle, xml);
188 GetSceneObjectAssetUuids(sog, assetUuids); 188 GetSceneObjectAssetUuids(sog, assetUuids);
189 } 189 }
190 } 190 }
191 191
192 /// <summary> 192 /// <summary>
@@ -209,10 +209,10 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
209 try 209 try
210 { 210 {
211 LLObject.TextureEntry textureEntry = part.Shape.Textures; 211 LLObject.TextureEntry textureEntry = part.Shape.Textures;
212 212
213 // Get the prim's default texture. This will be used for faces which don't have their own texture 213 // Get the prim's default texture. This will be used for faces which don't have their own texture
214 assetUuids[textureEntry.DefaultTexture.TextureID] = 1; 214 assetUuids[textureEntry.DefaultTexture.TextureID] = 1;
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;
@@ -224,15 +224,15 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
224 assetUuids[texture.TextureID] = 1; 224 assetUuids[texture.TextureID] = 1;
225 } 225 }
226 } 226 }
227 227
228 foreach (TaskInventoryItem tii in part.TaskInventory.Values) 228 foreach (TaskInventoryItem tii in part.TaskInventory.Values)
229 { 229 {
230 //m_log.DebugFormat("[ARCHIVER]: Analysing item asset type {0}", tii.Type); 230 //m_log.DebugFormat("[ARCHIVER]: Analysing item asset type {0}", tii.Type);
231 231
232 if (!assetUuids.ContainsKey(tii.AssetID)) 232 if (!assetUuids.ContainsKey(tii.AssetID))
233 { 233 {
234 assetUuids[tii.AssetID] = 1; 234 assetUuids[tii.AssetID] = 1;
235 235
236 if ((int)AssetType.Bodypart == tii.Type || ((int)AssetType.Clothing == tii.Type)) 236 if ((int)AssetType.Bodypart == tii.Type || ((int)AssetType.Clothing == tii.Type))
237 { 237 {
238 GetWearableAssetUuids(tii.AssetID, assetUuids); 238 GetWearableAssetUuids(tii.AssetID, assetUuids);
@@ -275,20 +275,20 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
275 if (entity is SceneObjectGroup) 275 if (entity is SceneObjectGroup)
276 sceneObjects.Add((SceneObjectGroup)entity); 276 sceneObjects.Add((SceneObjectGroup)entity);
277 } 277 }
278 278
279 foreach (SceneObjectGroup sceneObject in sceneObjects) 279 foreach (SceneObjectGroup sceneObject in sceneObjects)
280 { 280 {
281 GetSceneObjectAssetUuids(sceneObject, assetUuids); 281 GetSceneObjectAssetUuids(sceneObject, assetUuids);
282 } 282 }
283 283
284 m_log.DebugFormat( 284 m_log.DebugFormat(
285 "[ARCHIVER]: {0} scene objects to serialize requiring save of {1} assets", 285 "[ARCHIVER]: {0} scene objects to serialize requiring save of {1} assets",
286 sceneObjects.Count, assetUuids.Count); 286 sceneObjects.Count, assetUuids.Count);
287 287
288 // Asynchronously request all the assets required to perform this archive operation 288 // Asynchronously request all the assets required to perform this archive operation
289 ArchiveWriteRequestExecution awre 289 ArchiveWriteRequestExecution awre
290 = new ArchiveWriteRequestExecution( 290 = new ArchiveWriteRequestExecution(
291 sceneObjects, 291 sceneObjects,
292 m_scene.RequestModuleInterface<ITerrainModule>(), 292 m_scene.RequestModuleInterface<ITerrainModule>(),
293 m_scene.RequestModuleInterface<IRegionSerialiser>(), 293 m_scene.RequestModuleInterface<IRegionSerialiser>(),
294 m_scene.RegionInfo.RegionName, 294 m_scene.RegionInfo.RegionName,