diff options
author | Justin Clark-Casey (justincc) | 2010-10-22 19:24:42 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2010-10-22 19:24:42 +0100 |
commit | 199b61f1b2c48c82c5878032acfa9b69e4898fec (patch) | |
tree | 740062b018a54a0b50202dd89e3586fc2906f7a1 /OpenSim/Region/CoreModules | |
parent | slightly simplify oar control file loading code (diff) | |
download | opensim-SC-199b61f1b2c48c82c5878032acfa9b69e4898fec.zip opensim-SC-199b61f1b2c48c82c5878032acfa9b69e4898fec.tar.gz opensim-SC-199b61f1b2c48c82c5878032acfa9b69e4898fec.tar.bz2 opensim-SC-199b61f1b2c48c82c5878032acfa9b69e4898fec.tar.xz |
start parsing iar control file
This change requires a prebuild[.sh|.bat] since a System.Xml.Linq reference is added to prebuild.xml
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs | 20 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | 2 |
2 files changed, 20 insertions, 2 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs index c1df827..2beea8e 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs | |||
@@ -33,6 +33,7 @@ using System.Reflection; | |||
33 | using System.Threading; | 33 | using System.Threading; |
34 | using System.Text; | 34 | using System.Text; |
35 | using System.Xml; | 35 | using System.Xml; |
36 | using System.Xml.Linq; | ||
36 | using log4net; | 37 | using log4net; |
37 | using OpenMetaverse; | 38 | using OpenMetaverse; |
38 | using OpenSim.Framework; | 39 | using OpenSim.Framework; |
@@ -133,7 +134,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
133 | 134 | ||
134 | while ((data = archive.ReadEntry(out filePath, out entryType)) != null) | 135 | while ((data = archive.ReadEntry(out filePath, out entryType)) != null) |
135 | { | 136 | { |
136 | if (filePath.StartsWith(ArchiveConstants.ASSETS_PATH)) | 137 | if (filePath == ArchiveConstants.CONTROL_FILE_PATH) |
138 | { | ||
139 | LoadControlFile(filePath, data); | ||
140 | } | ||
141 | else if (filePath.StartsWith(ArchiveConstants.ASSETS_PATH)) | ||
137 | { | 142 | { |
138 | if (LoadAsset(filePath, data)) | 143 | if (LoadAsset(filePath, data)) |
139 | successfulAssetRestores++; | 144 | successfulAssetRestores++; |
@@ -461,5 +466,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
461 | return false; | 466 | return false; |
462 | } | 467 | } |
463 | } | 468 | } |
469 | |||
470 | /// <summary> | ||
471 | /// Load control file | ||
472 | /// </summary> | ||
473 | /// <param name="path"></param> | ||
474 | /// <param name="data"></param> | ||
475 | protected void LoadControlFile(string path, byte[] data) | ||
476 | { | ||
477 | XDocument doc = XDocument.Parse(Encoding.ASCII.GetString(data)); | ||
478 | XElement archiveElement = doc.Element("archive"); | ||
479 | int.Parse(archiveElement.Attribute("major_version").Value); | ||
480 | int.Parse(archiveElement.Attribute("minor_version").Value); | ||
481 | } | ||
464 | } | 482 | } |
465 | } \ No newline at end of file | 483 | } \ No newline at end of file |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index 9192f43..087d3df 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | |||
@@ -481,7 +481,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
481 | /// </summary> | 481 | /// </summary> |
482 | /// <param name="path"></param> | 482 | /// <param name="path"></param> |
483 | /// <param name="data"></param> | 483 | /// <param name="data"></param> |
484 | private void LoadControlFile(string path, byte[] data) | 484 | protected void LoadControlFile(string path, byte[] data) |
485 | { | 485 | { |
486 | XmlNamespaceManager nsmgr = new XmlNamespaceManager(new NameTable()); | 486 | XmlNamespaceManager nsmgr = new XmlNamespaceManager(new NameTable()); |
487 | XmlParserContext context = new XmlParserContext(null, nsmgr, null, XmlSpace.None); | 487 | XmlParserContext context = new XmlParserContext(null, nsmgr, null, XmlSpace.None); |