From 4e526778b7b41f92b0a05c5a78ea3a2a0945325a Mon Sep 17 00:00:00 2001
From: Justin Clarke Casey
Date: Fri, 12 Jun 2009 14:18:01 +0000
Subject: * minor: make control file loading code consistent
---
.../World/Archiver/ArchiveReadRequest.cs | 29 +++++++++-------------
.../World/Archiver/ArchiveWriteRequestExecution.cs | 1 -
2 files changed, 12 insertions(+), 18 deletions(-)
(limited to 'OpenSim/Region/CoreModules/World/Archiver')
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
index e26c145..fd58e80 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
@@ -135,8 +135,10 @@ namespace OpenSim.Region.CoreModules.World.Archiver
else if (!m_merge && filePath.StartsWith(ArchiveConstants.SETTINGS_PATH))
{
LoadRegionSettings(filePath, data);
- } else if (filePath == ArchiveConstants.CONTROL_FILE_PATH) {
- LoadArchiveMetadata(filePath, data);
+ }
+ else if (filePath == ArchiveConstants.CONTROL_FILE_PATH)
+ {
+ LoadControlFile(filePath, data);
}
}
@@ -483,14 +485,11 @@ namespace OpenSim.Region.CoreModules.World.Archiver
}
///
- /// Load oar file metadata
+ /// Load oar control file
///
- ///
+ ///
///
- ///
- /// true if terrain was resolved successfully, false otherwise.
- ///
- private bool LoadArchiveMetadata(string terrainPath, byte[] data)
+ private void LoadControlFile(string path, byte[] data)
{
//Create the XmlNamespaceManager.
NameTable nt = new NameTable();
@@ -499,9 +498,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver
// Create the XmlParserContext.
XmlParserContext context = new XmlParserContext(null, nsmgr, null, XmlSpace.None);
- XmlTextReader xtr = new XmlTextReader(m_asciiEncoding.GetString(data),
- XmlNodeType.Document, context);
-
+ XmlTextReader xtr
+ = new XmlTextReader(m_asciiEncoding.GetString(data), XmlNodeType.Document, context);
RegionSettings currentRegionSettings = m_scene.RegionInfo.RegionSettings;
@@ -514,15 +512,15 @@ namespace OpenSim.Region.CoreModules.World.Archiver
{
if (xtr.NodeType == XmlNodeType.Element)
{
- if (xtr.Name.ToString()=="date")
+ if (xtr.Name.ToString() == "date")
{
currentRegionSettings.LoadedCreationDate = xtr.ReadElementContentAsString();
}
- else if (xtr.Name.ToString()=="time")
+ else if (xtr.Name.ToString() == "time")
{
currentRegionSettings.LoadedCreationTime = xtr.ReadElementContentAsString();
}
- else if (xtr.Name.ToString()=="id")
+ else if (xtr.Name.ToString() == "id")
{
currentRegionSettings.LoadedCreationID = xtr.ReadElementContentAsString();
}
@@ -533,8 +531,5 @@ namespace OpenSim.Region.CoreModules.World.Archiver
return true;
}
-
-
-
}
}
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs
index e9b24f4..ccbf570 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs
@@ -93,7 +93,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver
// Write out control file
m_archiveWriter.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, Create0p2ControlFile());
-
m_log.InfoFormat("[ARCHIVER]: Added control file to archive.");
// Write out region settings
--
cgit v1.1