aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Modules')
-rw-r--r--OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs30
-rw-r--r--OpenSim/Region/Environment/Modules/World/Serialiser/IRegionSerialiser.cs31
-rw-r--r--OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs4
-rw-r--r--OpenSim/Region/Environment/Modules/World/Serialiser/SerialiserModule.cs8
4 files changed, 52 insertions, 21 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs
index d2b8018..26fc1a6 100644
--- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs
+++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs
@@ -99,24 +99,28 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
99 } 99 }
100 100
101 // Reload serialized prims 101 // Reload serialized prims
102 m_log.InfoFormat("[ARCHIVER]: Loading prim data"); 102 m_log.InfoFormat("[ARCHIVER]: Loading scene objects");
103 103
104 IRegionSerialiser serialiser = m_scene.RequestModuleInterface<IRegionSerialiser>(); 104 IRegionSerialiser serialiser = m_scene.RequestModuleInterface<IRegionSerialiser>();
105 105
106 // Temporary code to read each sog in the file separately, pending actually having these in separate files 106 // Temporary code to read each sog in the file separately, pending actually having these in separate files
107// XmlTextReader xtr = new XmlTextReader(new StringReader(serializedPrims)); 107 XmlTextReader xtr = new XmlTextReader(new StringReader(serializedPrims));
108// XmlDocument doc = new XmlDocument(); 108 XmlDocument doc = new XmlDocument();
109// reader.WhitespaceHandling = WhitespaceHandling.None; 109 xtr.WhitespaceHandling = WhitespaceHandling.None;
110// doc.Load(xtr); 110 doc.Load(xtr);
111// xtr.Close(); 111 xtr.Close();
112// XmlNode sceneNode = doc.FirstChild; 112 XmlNode sceneNode = doc.FirstChild;
113// 113 int count = 0;
114// foreach (XmlNode objectNode in sceneNode.ChildNodes) 114
115// { 115 foreach (XmlNode objectNode in sceneNode.ChildNodes)
116// CreatePrimFromXml2(m_scene, objectNode.OuterXml); 116 {
117// } 117 serialiser.LoadGroupFromXml2(m_scene, objectNode.OuterXml.ToString());
118 count++;
119 }
120
121 //serialiser.LoadPrimsFromXml2(m_scene, new StringReader(serializedPrims));
118 122
119 serialiser.LoadPrimsFromXml2(m_scene, new StringReader(serializedPrims)); 123 m_log.DebugFormat("[ARCHIVER]: Loaded {0} scene objects", count);
120 } 124 }
121 } 125 }
122} 126}
diff --git a/OpenSim/Region/Environment/Modules/World/Serialiser/IRegionSerialiser.cs b/OpenSim/Region/Environment/Modules/World/Serialiser/IRegionSerialiser.cs
index e0d2add..e6090a7 100644
--- a/OpenSim/Region/Environment/Modules/World/Serialiser/IRegionSerialiser.cs
+++ b/OpenSim/Region/Environment/Modules/World/Serialiser/IRegionSerialiser.cs
@@ -36,8 +36,20 @@ namespace OpenSim.Region.Environment.Modules.World.Serialiser
36 { 36 {
37 List<string> SerialiseRegion(Scene scene, string saveDir); 37 List<string> SerialiseRegion(Scene scene, string saveDir);
38 38
39 /// <summary>
40 /// Load prims from the xml format
41 /// </summary>
42 /// <param name="scene"></param>
43 /// <param name="fileName"></param>
44 /// <param name="newIDS"></param>
45 /// <param name="loadOffset"></param>
39 void LoadPrimsFromXml(Scene scene, string fileName, bool newIDS, LLVector3 loadOffset); 46 void LoadPrimsFromXml(Scene scene, string fileName, bool newIDS, LLVector3 loadOffset);
40 47
48 /// <summary>
49 /// Save prims in the xml format
50 /// </summary>
51 /// <param name="scene"> </param>
52 /// <param name="fileName"></param>
41 void SavePrimsToXml(Scene scene, string fileName); 53 void SavePrimsToXml(Scene scene, string fileName);
42 54
43 /// <summary> 55 /// <summary>
@@ -54,10 +66,25 @@ namespace OpenSim.Region.Environment.Modules.World.Serialiser
54 /// <param name="reader"></param> 66 /// <param name="reader"></param>
55 void LoadPrimsFromXml2(Scene scene, TextReader reader); 67 void LoadPrimsFromXml2(Scene scene, TextReader reader);
56 68
69 /// <summary>
70 /// Save prims in the xml2 format
71 /// </summary>
72 /// <param name="scene"></param>
73 /// <param name="fileName"></param>
57 void SavePrimsToXml2(Scene scene, string fileName); 74 void SavePrimsToXml2(Scene scene, string fileName);
58 75
59 void LoadGroupFromXml2String(Scene scene, string xmlString); 76 /// <summary>
77 /// Load an individual scene object from the xml2 format
78 /// </summary>
79 /// <param name="scene"></param>
80 /// <param name="xmlString"></param>
81 void LoadGroupFromXml2(Scene scene, string xmlString);
60 82
61 string SavePrimGroupToXML2String(SceneObjectGroup grp); 83 /// <summary>
84 /// Serialize an individual scene object into the xml2 format
85 /// </summary>
86 /// <param name="grp"></param>
87 /// <returns></returns>
88 string SaveGroupToXml2(SceneObjectGroup grp);
62 } 89 }
63} 90}
diff --git a/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs b/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs
index 7cc2459..1945fac 100644
--- a/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs
+++ b/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs
@@ -99,12 +99,12 @@ namespace OpenSim.Region.Environment.Scenes
99 file.Close(); 99 file.Close();
100 } 100 }
101 101
102 public static string SavePrimGroupToXML2String(SceneObjectGroup grp) 102 public static string SaveGroupToXml2(SceneObjectGroup grp)
103 { 103 {
104 return grp.ToXmlString2(); 104 return grp.ToXmlString2();
105 } 105 }
106 106
107 public static void LoadGroupFromXml2String(Scene scene, string xmlString) 107 public static void LoadGroupFromXml2(Scene scene, string xmlString)
108 { 108 {
109 XmlDocument doc = new XmlDocument(); 109 XmlDocument doc = new XmlDocument();
110 XmlNode rootNode; 110 XmlNode rootNode;
diff --git a/OpenSim/Region/Environment/Modules/World/Serialiser/SerialiserModule.cs b/OpenSim/Region/Environment/Modules/World/Serialiser/SerialiserModule.cs
index c7c8e39..01f6301 100644
--- a/OpenSim/Region/Environment/Modules/World/Serialiser/SerialiserModule.cs
+++ b/OpenSim/Region/Environment/Modules/World/Serialiser/SerialiserModule.cs
@@ -112,14 +112,14 @@ namespace OpenSim.Region.Environment.Modules.World.Serialiser
112 SceneXmlLoader.SavePrimsToXml2(scene, fileName); 112 SceneXmlLoader.SavePrimsToXml2(scene, fileName);
113 } 113 }
114 114
115 public void LoadGroupFromXml2String(Scene scene, string xmlString) 115 public void LoadGroupFromXml2(Scene scene, string xmlString)
116 { 116 {
117 SceneXmlLoader.LoadGroupFromXml2String(scene, xmlString); 117 SceneXmlLoader.LoadGroupFromXml2(scene, xmlString);
118 } 118 }
119 119
120 public string SavePrimGroupToXML2String(SceneObjectGroup grp) 120 public string SaveGroupToXml2(SceneObjectGroup grp)
121 { 121 {
122 return SceneXmlLoader.SavePrimGroupToXML2String(grp); 122 return SceneXmlLoader.SaveGroupToXml2(grp);
123 } 123 }
124 124
125 public List<string> SerialiseRegion(Scene scene, string saveDir) 125 public List<string> SerialiseRegion(Scene scene, string saveDir)