diff options
author | Justin Clark-Casey (justincc) | 2010-10-22 19:24:42 +0100 |
---|---|---|
committer | Jonathan Freedman | 2010-10-22 18:33:41 -0400 |
commit | 607c07b4aab2a194102832a1e380cfbabe11d078 (patch) | |
tree | 766027397462f11d525cc897ddda632a97a27c1d /OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs | |
parent | slightly simplify oar control file loading code (diff) | |
download | opensim-SC_OLD-607c07b4aab2a194102832a1e380cfbabe11d078.zip opensim-SC_OLD-607c07b4aab2a194102832a1e380cfbabe11d078.tar.gz opensim-SC_OLD-607c07b4aab2a194102832a1e380cfbabe11d078.tar.bz2 opensim-SC_OLD-607c07b4aab2a194102832a1e380cfbabe11d078.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 '')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs | 20 |
1 files changed, 19 insertions, 1 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 |