diff options
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 '')
-rw-r--r-- | OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs | 13 |
1 files changed, 9 insertions, 4 deletions
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 | } |