aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/World
diff options
context:
space:
mode:
authorMW2008-07-01 19:23:45 +0000
committerMW2008-07-01 19:23:45 +0000
commitc9fe500212cf8b8231ef0604a1f577e9bbedfcbe (patch)
tree4515ef7ae75a913ff2172c5ad2d3be747ffc893d /OpenSim/Region/Environment/Modules/World
parentMantis#1640. Thank you, Chernega for a patch that addresses: (diff)
downloadopensim-SC_OLD-c9fe500212cf8b8231ef0604a1f577e9bbedfcbe.zip
opensim-SC_OLD-c9fe500212cf8b8231ef0604a1f577e9bbedfcbe.tar.gz
opensim-SC_OLD-c9fe500212cf8b8231ef0604a1f577e9bbedfcbe.tar.bz2
opensim-SC_OLD-c9fe500212cf8b8231ef0604a1f577e9bbedfcbe.tar.xz
Added "save-prims-xml2 <PrimName> <FileName>", as we were lacking a method to save a single primitive or small group of them. This command will save all prims in the current scene that name matches the "PrimName" parameter. The saved file is in standard xml2 format, so can be loaded using load-xml2
Diffstat (limited to 'OpenSim/Region/Environment/Modules/World')
-rw-r--r--OpenSim/Region/Environment/Modules/World/Serialiser/IRegionSerialiser.cs7
-rw-r--r--OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs13
-rw-r--r--OpenSim/Region/Environment/Modules/World/Serialiser/SerialiserModule.cs5
3 files changed, 21 insertions, 4 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/Serialiser/IRegionSerialiser.cs b/OpenSim/Region/Environment/Modules/World/Serialiser/IRegionSerialiser.cs
index e6090a7..3ae7a54 100644
--- a/OpenSim/Region/Environment/Modules/World/Serialiser/IRegionSerialiser.cs
+++ b/OpenSim/Region/Environment/Modules/World/Serialiser/IRegionSerialiser.cs
@@ -74,6 +74,13 @@ namespace OpenSim.Region.Environment.Modules.World.Serialiser
74 void SavePrimsToXml2(Scene scene, string fileName); 74 void SavePrimsToXml2(Scene scene, string fileName);
75 75
76 /// <summary> 76 /// <summary>
77 /// Save a set of prims in the xml2 format
78 /// </summary>
79 /// <param name="entityList"></param>
80 /// <param name="fileName"></param>
81 void SavePrimListToXml2(List<EntityBase> entityList, string fileName);
82
83 /// <summary>
77 /// Load an individual scene object from the xml2 format 84 /// Load an individual scene object from the xml2 format
78 /// </summary> 85 /// </summary>
79 /// <param name="scene"></param> 86 /// <param name="scene"></param>
diff --git a/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs b/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs
index ed211e4..9bab2b6 100644
--- a/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs
+++ b/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs
@@ -186,18 +186,23 @@ namespace OpenSim.Region.Environment.Scenes
186 186
187 public static void SavePrimsToXml2(Scene scene, string fileName) 187 public static void SavePrimsToXml2(Scene scene, string fileName)
188 { 188 {
189 List<EntityBase> EntityList = scene.GetEntities();
190
191 SavePrimListToXml2(EntityList, fileName);
192 }
193
194 public static void SavePrimListToXml2(List<EntityBase> entityList, string fileName)
195 {
189 FileStream file = new FileStream(fileName, FileMode.Create); 196 FileStream file = new FileStream(fileName, FileMode.Create);
190 StreamWriter stream = new StreamWriter(file); 197 StreamWriter stream = new StreamWriter(file);
191 int primCount = 0; 198 int primCount = 0;
192 stream.WriteLine("<scene>\n"); 199 stream.WriteLine("<scene>\n");
193 200
194 List<EntityBase> EntityList = scene.GetEntities(); 201 foreach (EntityBase ent in entityList)
195
196 foreach (EntityBase ent in EntityList)
197 { 202 {
198 if (ent is SceneObjectGroup) 203 if (ent is SceneObjectGroup)
199 { 204 {
200 stream.WriteLine(((SceneObjectGroup) ent).ToXmlString2()); 205 stream.WriteLine(((SceneObjectGroup)ent).ToXmlString2());
201 primCount++; 206 primCount++;
202 } 207 }
203 } 208 }
diff --git a/OpenSim/Region/Environment/Modules/World/Serialiser/SerialiserModule.cs b/OpenSim/Region/Environment/Modules/World/Serialiser/SerialiserModule.cs
index 28f3996..c7b5fa5 100644
--- a/OpenSim/Region/Environment/Modules/World/Serialiser/SerialiserModule.cs
+++ b/OpenSim/Region/Environment/Modules/World/Serialiser/SerialiserModule.cs
@@ -122,6 +122,11 @@ namespace OpenSim.Region.Environment.Modules.World.Serialiser
122 return SceneXmlLoader.SaveGroupToXml2(grp); 122 return SceneXmlLoader.SaveGroupToXml2(grp);
123 } 123 }
124 124
125 public void SavePrimListToXml2(List<EntityBase> entityList, string fileName)
126 {
127 SceneXmlLoader.SavePrimListToXml2(entityList, fileName);
128 }
129
125 public List<string> SerialiseRegion(Scene scene, string saveDir) 130 public List<string> SerialiseRegion(Scene scene, string saveDir)
126 { 131 {
127 List<string> results = new List<string>(); 132 List<string> results = new List<string>();