From 199b61f1b2c48c82c5878032acfa9b69e4898fec Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 22 Oct 2010 19:24:42 +0100
Subject: start parsing iar control file
This change requires a prebuild[.sh|.bat] since a System.Xml.Linq reference is added to prebuild.xml
---
.../Archiver/InventoryArchiveReadRequest.cs | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Region/CoreModules/Avatar/Inventory/Archiver')
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;
using System.Threading;
using System.Text;
using System.Xml;
+using System.Xml.Linq;
using log4net;
using OpenMetaverse;
using OpenSim.Framework;
@@ -133,7 +134,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
while ((data = archive.ReadEntry(out filePath, out entryType)) != null)
{
- if (filePath.StartsWith(ArchiveConstants.ASSETS_PATH))
+ if (filePath == ArchiveConstants.CONTROL_FILE_PATH)
+ {
+ LoadControlFile(filePath, data);
+ }
+ else if (filePath.StartsWith(ArchiveConstants.ASSETS_PATH))
{
if (LoadAsset(filePath, data))
successfulAssetRestores++;
@@ -461,5 +466,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
return false;
}
}
+
+ ///
+ /// Load control file
+ ///
+ ///
+ ///
+ protected void LoadControlFile(string path, byte[] data)
+ {
+ XDocument doc = XDocument.Parse(Encoding.ASCII.GetString(data));
+ XElement archiveElement = doc.Element("archive");
+ int.Parse(archiveElement.Attribute("major_version").Value);
+ int.Parse(archiveElement.Attribute("minor_version").Value);
+ }
}
}
\ No newline at end of file
--
cgit v1.1