aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs')
-rw-r--r--OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs23
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
28using OpenSim.Region.Environment.Scenes; 28using OpenSim.Region.Environment.Scenes;
29using System;
29using System.Reflection; 30using System.Reflection;
30using log4net; 31using 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}