diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequest.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequest.cs | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequest.cs index 6c8f37b..8dabcee 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequest.cs | |||
@@ -60,8 +60,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
60 | /// <summary> | 60 | /// <summary> |
61 | /// The minimum major version of OAR that we can write. | 61 | /// The minimum major version of OAR that we can write. |
62 | /// </summary> | 62 | /// </summary> |
63 | public static int MIN_MAJOR_VERSION = 0; | 63 | public static int MIN_MAJOR_VERSION = 0; |
64 | 64 | ||
65 | /// <summary> | 65 | /// <summary> |
66 | /// The maximum major version of OAR that we can write. | 66 | /// The maximum major version of OAR that we can write. |
67 | /// </summary> | 67 | /// </summary> |
@@ -112,7 +112,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
112 | m_log.ErrorFormat("{0} {1}", e.Message, e.StackTrace); | 112 | m_log.ErrorFormat("{0} {1}", e.Message, e.StackTrace); |
113 | } | 113 | } |
114 | } | 114 | } |
115 | 115 | ||
116 | /// <summary> | 116 | /// <summary> |
117 | /// Constructor. | 117 | /// Constructor. |
118 | /// </summary> | 118 | /// </summary> |
@@ -226,7 +226,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
226 | List<SceneObjectGroup> sceneObjects = new List<SceneObjectGroup>(); | 226 | List<SceneObjectGroup> sceneObjects = new List<SceneObjectGroup>(); |
227 | 227 | ||
228 | int numObjectsSkippedPermissions = 0; | 228 | int numObjectsSkippedPermissions = 0; |
229 | 229 | ||
230 | // Filter entities so that we only have scene objects. | 230 | // Filter entities so that we only have scene objects. |
231 | // FIXME: Would be nicer to have this as a proper list in SceneGraph, since lots of methods | 231 | // FIXME: Would be nicer to have this as a proper list in SceneGraph, since lots of methods |
232 | // end up having to do this | 232 | // end up having to do this |
@@ -256,7 +256,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
256 | { | 256 | { |
257 | UuidGatherer assetGatherer = new UuidGatherer(scene.AssetService, assetUuids); | 257 | UuidGatherer assetGatherer = new UuidGatherer(scene.AssetService, assetUuids); |
258 | int prevAssets = assetUuids.Count; | 258 | int prevAssets = assetUuids.Count; |
259 | 259 | ||
260 | foreach (SceneObjectGroup sceneObject in sceneObjects) | 260 | foreach (SceneObjectGroup sceneObject in sceneObjects) |
261 | assetGatherer.AddForInspection(sceneObject); | 261 | assetGatherer.AddForInspection(sceneObject); |
262 | 262 | ||
@@ -276,16 +276,16 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
276 | 276 | ||
277 | // Make sure that we also request terrain texture assets | 277 | // Make sure that we also request terrain texture assets |
278 | RegionSettings regionSettings = scene.RegionInfo.RegionSettings; | 278 | RegionSettings regionSettings = scene.RegionInfo.RegionSettings; |
279 | 279 | ||
280 | if (regionSettings.TerrainTexture1 != RegionSettings.DEFAULT_TERRAIN_TEXTURE_1) | 280 | if (regionSettings.TerrainTexture1 != RegionSettings.DEFAULT_TERRAIN_TEXTURE_1) |
281 | assetUuids[regionSettings.TerrainTexture1] = (sbyte)AssetType.Texture; | 281 | assetUuids[regionSettings.TerrainTexture1] = (sbyte)AssetType.Texture; |
282 | 282 | ||
283 | if (regionSettings.TerrainTexture2 != RegionSettings.DEFAULT_TERRAIN_TEXTURE_2) | 283 | if (regionSettings.TerrainTexture2 != RegionSettings.DEFAULT_TERRAIN_TEXTURE_2) |
284 | assetUuids[regionSettings.TerrainTexture2] = (sbyte)AssetType.Texture; | 284 | assetUuids[regionSettings.TerrainTexture2] = (sbyte)AssetType.Texture; |
285 | 285 | ||
286 | if (regionSettings.TerrainTexture3 != RegionSettings.DEFAULT_TERRAIN_TEXTURE_3) | 286 | if (regionSettings.TerrainTexture3 != RegionSettings.DEFAULT_TERRAIN_TEXTURE_3) |
287 | assetUuids[regionSettings.TerrainTexture3] = (sbyte)AssetType.Texture; | 287 | assetUuids[regionSettings.TerrainTexture3] = (sbyte)AssetType.Texture; |
288 | 288 | ||
289 | if (regionSettings.TerrainTexture4 != RegionSettings.DEFAULT_TERRAIN_TEXTURE_4) | 289 | if (regionSettings.TerrainTexture4 != RegionSettings.DEFAULT_TERRAIN_TEXTURE_4) |
290 | assetUuids[regionSettings.TerrainTexture4] = (sbyte)AssetType.Texture; | 290 | assetUuids[regionSettings.TerrainTexture4] = (sbyte)AssetType.Texture; |
291 | 291 | ||
@@ -398,18 +398,18 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
398 | // string[] parts = m_options["version"].ToString().Split('.'); | 398 | // string[] parts = m_options["version"].ToString().Split('.'); |
399 | // if (parts.Length >= 1) | 399 | // if (parts.Length >= 1) |
400 | // { | 400 | // { |
401 | // majorVersion = Int32.Parse(parts[0]); | 401 | // majorVersion = Int32.Parse(parts[0]); |
402 | // | 402 | // |
403 | // if (parts.Length >= 2) | 403 | // if (parts.Length >= 2) |
404 | // minorVersion = Int32.Parse(parts[1]); | 404 | // minorVersion = Int32.Parse(parts[1]); |
405 | // } | 405 | // } |
406 | // } | 406 | // } |
407 | // | 407 | // |
408 | // if (majorVersion < MIN_MAJOR_VERSION || majorVersion > MAX_MAJOR_VERSION) | 408 | // if (majorVersion < MIN_MAJOR_VERSION || majorVersion > MAX_MAJOR_VERSION) |
409 | // { | 409 | // { |
410 | // throw new Exception( | 410 | // throw new Exception( |
411 | // string.Format( | 411 | // string.Format( |
412 | // "OAR version number for save must be between {0} and {1}", | 412 | // "OAR version number for save must be between {0} and {1}", |
413 | // MIN_MAJOR_VERSION, MAX_MAJOR_VERSION)); | 413 | // MIN_MAJOR_VERSION, MAX_MAJOR_VERSION)); |
414 | // } | 414 | // } |
415 | // else if (majorVersion == MAX_MAJOR_VERSION) | 415 | // else if (majorVersion == MAX_MAJOR_VERSION) |
@@ -420,9 +420,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
420 | // else if (majorVersion == MIN_MAJOR_VERSION) | 420 | // else if (majorVersion == MIN_MAJOR_VERSION) |
421 | // { | 421 | // { |
422 | // // Force 0.4 | 422 | // // Force 0.4 |
423 | // minorVersion = 4; | 423 | // minorVersion = 4; |
424 | // } | 424 | // } |
425 | 425 | ||
426 | m_log.InfoFormat("[ARCHIVER]: Creating version {0}.{1} OAR", majorVersion, minorVersion); | 426 | m_log.InfoFormat("[ARCHIVER]: Creating version {0}.{1} OAR", majorVersion, minorVersion); |
427 | if (majorVersion == 1) | 427 | if (majorVersion == 1) |
428 | { | 428 | { |
@@ -430,7 +430,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
430 | } | 430 | } |
431 | 431 | ||
432 | String s; | 432 | String s; |
433 | 433 | ||
434 | using (StringWriter sw = new StringWriter()) | 434 | using (StringWriter sw = new StringWriter()) |
435 | { | 435 | { |
436 | using (XmlTextWriter xtw = new XmlTextWriter(sw)) | 436 | using (XmlTextWriter xtw = new XmlTextWriter(sw)) |
@@ -440,7 +440,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
440 | xtw.WriteStartElement("archive"); | 440 | xtw.WriteStartElement("archive"); |
441 | xtw.WriteAttributeString("major_version", majorVersion.ToString()); | 441 | xtw.WriteAttributeString("major_version", majorVersion.ToString()); |
442 | xtw.WriteAttributeString("minor_version", minorVersion.ToString()); | 442 | xtw.WriteAttributeString("minor_version", minorVersion.ToString()); |
443 | 443 | ||
444 | xtw.WriteStartElement("creation_info"); | 444 | xtw.WriteStartElement("creation_info"); |
445 | DateTime now = DateTime.UtcNow; | 445 | DateTime now = DateTime.UtcNow; |
446 | TimeSpan t = now - new DateTime(1970, 1, 1); | 446 | TimeSpan t = now - new DateTime(1970, 1, 1); |
@@ -448,7 +448,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
448 | if (!MultiRegionFormat) | 448 | if (!MultiRegionFormat) |
449 | xtw.WriteElementString("id", m_rootScene.RegionInfo.RegionID.ToString()); | 449 | xtw.WriteElementString("id", m_rootScene.RegionInfo.RegionID.ToString()); |
450 | xtw.WriteEndElement(); | 450 | xtw.WriteEndElement(); |
451 | 451 | ||
452 | xtw.WriteElementString("assets_included", SaveAssets.ToString()); | 452 | xtw.WriteElementString("assets_included", SaveAssets.ToString()); |
453 | 453 | ||
454 | if (MultiRegionFormat) | 454 | if (MultiRegionFormat) |
@@ -463,7 +463,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
463 | } | 463 | } |
464 | 464 | ||
465 | xtw.WriteEndElement(); | 465 | xtw.WriteEndElement(); |
466 | 466 | ||
467 | xtw.Flush(); | 467 | xtw.Flush(); |
468 | } | 468 | } |
469 | 469 | ||
@@ -525,7 +525,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
525 | Vector2 size; | 525 | Vector2 size; |
526 | 526 | ||
527 | size = new Vector2((float)scene.RegionInfo.RegionSizeX, (float)scene.RegionInfo.RegionSizeY); | 527 | size = new Vector2((float)scene.RegionInfo.RegionSizeX, (float)scene.RegionInfo.RegionSizeY); |
528 | 528 | ||
529 | xtw.WriteElementString("size_in_meters", string.Format("{0},{1}", size.X, size.Y)); | 529 | xtw.WriteElementString("size_in_meters", string.Format("{0},{1}", size.X, size.Y)); |
530 | } | 530 | } |
531 | 531 | ||
@@ -548,7 +548,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
548 | foreach (ILandObject lo in landObjects) | 548 | foreach (ILandObject lo in landObjects) |
549 | { | 549 | { |
550 | LandData landData = lo.LandData; | 550 | LandData landData = lo.LandData; |
551 | string landDataPath | 551 | string landDataPath |
552 | = String.Format("{0}{1}", regionDir, ArchiveConstants.CreateOarLandDataPath(landData)); | 552 | = String.Format("{0}{1}", regionDir, ArchiveConstants.CreateOarLandDataPath(landData)); |
553 | m_archiveWriter.WriteFile(landDataPath, LandDataSerializer.Serialize(landData, m_options)); | 553 | m_archiveWriter.WriteFile(landDataPath, LandDataSerializer.Serialize(landData, m_options)); |
554 | } | 554 | } |
@@ -578,11 +578,11 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
578 | m_archiveWriter.WriteFile(objectPath, serializedObject); | 578 | m_archiveWriter.WriteFile(objectPath, serializedObject); |
579 | } | 579 | } |
580 | } | 580 | } |
581 | 581 | ||
582 | protected void ReceivedAllAssets(ICollection<UUID> assetsFoundUuids, ICollection<UUID> assetsNotFoundUuids, bool timedOut) | 582 | protected void ReceivedAllAssets(ICollection<UUID> assetsFoundUuids, ICollection<UUID> assetsNotFoundUuids, bool timedOut) |
583 | { | 583 | { |
584 | string errorMessage; | 584 | string errorMessage; |
585 | 585 | ||
586 | if (timedOut) | 586 | if (timedOut) |
587 | { | 587 | { |
588 | errorMessage = "Loading assets timed out"; | 588 | errorMessage = "Loading assets timed out"; |
@@ -600,10 +600,10 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
600 | 600 | ||
601 | errorMessage = String.Empty; | 601 | errorMessage = String.Empty; |
602 | } | 602 | } |
603 | 603 | ||
604 | CloseArchive(errorMessage); | 604 | CloseArchive(errorMessage); |
605 | } | 605 | } |
606 | 606 | ||
607 | /// <summary> | 607 | /// <summary> |
608 | /// Closes the archive and notifies that we're done. | 608 | /// Closes the archive and notifies that we're done. |
609 | /// </summary> | 609 | /// </summary> |
@@ -622,7 +622,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
622 | if (errorMessage == string.Empty) | 622 | if (errorMessage == string.Empty) |
623 | errorMessage = e.Message; | 623 | errorMessage = e.Message; |
624 | } | 624 | } |
625 | 625 | ||
626 | m_log.InfoFormat("[ARCHIVER]: Finished writing out OAR for {0}", m_rootScene.RegionInfo.RegionName); | 626 | m_log.InfoFormat("[ARCHIVER]: Finished writing out OAR for {0}", m_rootScene.RegionInfo.RegionName); |
627 | 627 | ||
628 | m_rootScene.EventManager.TriggerOarFileSaved(m_requestId, errorMessage); | 628 | m_rootScene.EventManager.TriggerOarFileSaved(m_requestId, errorMessage); |