aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/World
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Modules/World')
-rw-r--r--OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs29
-rw-r--r--OpenSim/Region/Environment/Modules/World/Serialiser/SerialiserModule.cs5
2 files changed, 31 insertions, 3 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs b/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs
index c856b5b..2e9c551 100644
--- a/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs
+++ b/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs
@@ -28,10 +28,10 @@
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.IO; 30using System.IO;
31//using System.Reflection; 31using System.Reflection;
32using System.Xml; 32using System.Xml;
33using OpenMetaverse; 33using OpenMetaverse;
34//using log4net; 34using log4net;
35using OpenSim.Framework; 35using OpenSim.Framework;
36using OpenSim.Region.Physics.Manager; 36using OpenSim.Region.Physics.Manager;
37 37
@@ -42,7 +42,7 @@ namespace OpenSim.Region.Environment.Scenes
42 /// </summary> 42 /// </summary>
43 public class SceneXmlLoader 43 public class SceneXmlLoader
44 { 44 {
45 //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 45 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
46 46
47 public static void LoadPrimsFromXml(Scene scene, string fileName, bool newIDS, Vector3 loadOffset) 47 public static void LoadPrimsFromXml(Scene scene, string fileName, bool newIDS, Vector3 loadOffset)
48 { 48 {
@@ -213,6 +213,29 @@ namespace OpenSim.Region.Environment.Scenes
213 213
214 SavePrimListToXml2(EntityList, stream, min, max); 214 SavePrimListToXml2(EntityList, stream, min, max);
215 } 215 }
216
217 public static void SaveNamedPrimsToXml2(Scene scene, string primName, string fileName)
218 {
219 m_log.InfoFormat(
220 "[SERIALISER]: Saving prims with name {0} in xml2 format for region {1} to {2}",
221 primName, scene.RegionInfo.RegionName, fileName);
222
223 List<EntityBase> entityList = scene.GetEntities();
224 List<EntityBase> primList = new List<EntityBase>();
225
226 foreach (EntityBase ent in entityList)
227 {
228 if (ent is SceneObjectGroup)
229 {
230 if (ent.Name == primName)
231 {
232 primList.Add(ent);
233 }
234 }
235 }
236
237 SavePrimListToXml2(primList, fileName);
238 }
216 239
217 public static void SavePrimListToXml2(List<EntityBase> entityList, string fileName) 240 public static void SavePrimListToXml2(List<EntityBase> entityList, string fileName)
218 { 241 {
diff --git a/OpenSim/Region/Environment/Modules/World/Serialiser/SerialiserModule.cs b/OpenSim/Region/Environment/Modules/World/Serialiser/SerialiserModule.cs
index 8b5dd2c..c1af947 100644
--- a/OpenSim/Region/Environment/Modules/World/Serialiser/SerialiserModule.cs
+++ b/OpenSim/Region/Environment/Modules/World/Serialiser/SerialiserModule.cs
@@ -116,6 +116,11 @@ namespace OpenSim.Region.Environment.Modules.World.Serialiser
116 { 116 {
117 SceneXmlLoader.SavePrimsToXml2(scene, stream, min, max); 117 SceneXmlLoader.SavePrimsToXml2(scene, stream, min, max);
118 } 118 }
119
120 public void SaveNamedPrimsToXml2(Scene scene, string primName, string fileName)
121 {
122 SceneXmlLoader.SaveNamedPrimsToXml2(scene, primName, fileName);
123 }
119 124
120 public SceneObjectGroup DeserializeGroupFromXml2(string xmlString) 125 public SceneObjectGroup DeserializeGroupFromXml2(string xmlString)
121 { 126 {