diff options
author | Justin Clarke Casey | 2008-05-30 16:08:28 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-05-30 16:08:28 +0000 |
commit | ea4982e4532f0cd2b793375f2c9f54c3c389c552 (patch) | |
tree | 9f4c271ef83571b2ac8ff516868297d882156f69 /OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs | |
parent | Mantis#1422. Thank you kindly, Xantor for a patch that : (diff) | |
download | opensim-SC_OLD-ea4982e4532f0cd2b793375f2c9f54c3c389c552.zip opensim-SC_OLD-ea4982e4532f0cd2b793375f2c9f54c3c389c552.tar.gz opensim-SC_OLD-ea4982e4532f0cd2b793375f2c9f54c3c389c552.tar.bz2 opensim-SC_OLD-ea4982e4532f0cd2b793375f2c9f54c3c389c552.tar.xz |
* Successfully pick out prims.xml file from archive
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs index 268b9b5..6ad11ee 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs | |||
@@ -26,6 +26,7 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | using OpenSim.Region.Environment.Scenes; | 28 | using OpenSim.Region.Environment.Scenes; |
29 | using System; | ||
29 | using System.Reflection; | 30 | using System.Reflection; |
30 | using log4net; | 31 | using log4net; |
31 | 32 | ||
@@ -38,6 +39,8 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
38 | { | 39 | { |
39 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 40 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
40 | 41 | ||
42 | protected static System.Text.ASCIIEncoding m_asciiEncoding = new System.Text.ASCIIEncoding(); | ||
43 | |||
41 | private Scene m_scene; | 44 | private Scene m_scene; |
42 | private string m_loadPath; | 45 | private string m_loadPath; |
43 | 46 | ||
@@ -53,6 +56,8 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
53 | { | 56 | { |
54 | TarArchiveReader archive = new TarArchiveReader(m_loadPath); | 57 | TarArchiveReader archive = new TarArchiveReader(m_loadPath); |
55 | 58 | ||
59 | string serializedPrims = string.Empty; | ||
60 | |||
56 | // Just test for now by reading first file | 61 | // Just test for now by reading first file |
57 | string filePath = "ERROR"; | 62 | string filePath = "ERROR"; |
58 | 63 | ||
@@ -60,11 +65,27 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
60 | while ((data = archive.ReadEntry(out filePath)) != null) | 65 | while ((data = archive.ReadEntry(out filePath)) != null) |
61 | { | 66 | { |
62 | m_log.DebugFormat("[ARCHIVER]: Successfully read {0} ({1} bytes) from archive {2}", filePath, data.Length, m_loadPath); | 67 | m_log.DebugFormat("[ARCHIVER]: Successfully read {0} ({1} bytes) from archive {2}", filePath, data.Length, m_loadPath); |
68 | |||
69 | if (filePath.Equals(ArchiveConstants.PRIMS_PATH)) | ||
70 | { | ||
71 | serializedPrims = m_asciiEncoding.GetString(data); | ||
72 | } | ||
63 | } | 73 | } |
64 | 74 | ||
65 | m_log.DebugFormat("[ARCHIVER]: Reached end of archive"); | 75 | m_log.DebugFormat("[ARCHIVER]: Reached end of archive"); |
66 | 76 | ||
67 | archive.Close(); | 77 | archive.Close(); |
78 | |||
79 | if (serializedPrims.Equals(string.Empty)) | ||
80 | { | ||
81 | m_log.ErrorFormat("[ARCHIVER]: Archive did not contain a {0} file", ArchiveConstants.PRIMS_PATH); | ||
82 | return; | ||
83 | } | ||
84 | |||
85 | // Reload serialized prims | ||
86 | m_log.InfoFormat("[ARCHIVER]: Loading prim data"); | ||
87 | |||
88 | //m_scene.LoadPrimsFromXml2( | ||
68 | } | 89 | } |
69 | } | 90 | } |
70 | } | 91 | } |