From fdf4de419f6cc2f8cfba2a20de938ce4a2ea63d4 Mon Sep 17 00:00:00 2001
From: Justin Clarke Casey
Date: Tue, 27 May 2008 23:29:59 +0000
Subject: * Include prims.xml file in archive
---
.../Environment/Modules/World/Archiver/ArchiveRequest.cs | 10 +++++++---
.../Region/Environment/Modules/World/Archiver/TarArchive.cs | 12 ++++++++++--
2 files changed, 17 insertions(+), 5 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveRequest.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveRequest.cs
index 34610e0..8a3fdb6 100644
--- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveRequest.cs
+++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveRequest.cs
@@ -51,7 +51,9 @@ namespace OpenSim.Region.Environment
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private Scene m_scene;
- private string m_savePath;
+ private string m_savePath;
+
+ private string m_serializedEntities;
public ArchiveRequest(Scene scene, string savePath)
{
@@ -83,9 +85,9 @@ namespace OpenSim.Region.Environment
}
}
- string serEntities = SerializeObjects(entities);
+ m_serializedEntities = SerializeObjects(entities);
- if (serEntities != null && serEntities.Length > 0)
+ if (m_serializedEntities != null && m_serializedEntities.Length > 0)
{
m_log.DebugFormat("[ARCHIVER]: Successfully got serialization for {0} entities", entities.Count);
m_log.DebugFormat("[ARCHIVER]: Requiring save of {0} textures", textureUuids.Count);
@@ -103,6 +105,8 @@ namespace OpenSim.Region.Environment
TarArchive archive = new TarArchive();
+ archive.AddFile("prims.xml", m_serializedEntities);
+
foreach (LLUUID uuid in assets.Keys)
{
archive.AddFile(uuid.ToString() + ".jp2", assets[uuid].Data);
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/TarArchive.cs b/OpenSim/Region/Environment/Modules/World/Archiver/TarArchive.cs
index 0a6b1c1..5e5be34 100644
--- a/OpenSim/Region/Environment/Modules/World/Archiver/TarArchive.cs
+++ b/OpenSim/Region/Environment/Modules/World/Archiver/TarArchive.cs
@@ -51,6 +51,16 @@ namespace OpenSim.Region.Environment
///
///
///
+ public void AddFile(string filePath, string data)
+ {
+ AddFile(filePath, m_asciiEncoding.GetBytes(data));
+ }
+
+ ///
+ /// Add a file to the tar archive
+ ///
+ ///
+ ///
public void AddFile(string filePath, byte[] data)
{
m_files[filePath] = data;
@@ -164,8 +174,6 @@ namespace OpenSim.Region.Environment
oString = "0" + oString;
}
- m_log.DebugFormat("[TAR ARCHIVE]: oString is {0}", oString);
-
byte[] oBytes = m_asciiEncoding.GetBytes(oString);
return oBytes;
--
cgit v1.1