From 8d479fe5afc30cb4a188b79fb9f09820a763afbb Mon Sep 17 00:00:00 2001 From: Dr Scofield Date: Fri, 15 Aug 2008 07:20:38 +0000 Subject: From: Richard Alimi The following patch makes some enhancements to loading/saving the Xml2 format. - Add streamed version of functionality for saving prims to Xml2 format. The streamed version (optionally) allows for saving the prims whose positions appear within a particular bounding box. - Expose stream versions of LoadPrimsFromXml2 and SavePrimsToXml2 in the Scene class - Extend loading from Xml2 (the streamed version) to optionally start scripts for the loaded scene objects) --- OpenSim/Region/Environment/Scenes/Scene.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'OpenSim/Region/Environment/Scenes') diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index bd02b7e..4e7e764 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -29,6 +29,7 @@ using System; using System.Collections.Generic; using System.Drawing; using System.Drawing.Imaging; +using System.IO; using System.Threading; using System.Timers; using Axiom.Math; @@ -1760,6 +1761,13 @@ namespace OpenSim.Region.Environment.Scenes m_serialiser.LoadPrimsFromXml2(this, fileName); } + public void LoadPrimsFromXml2(TextReader reader, bool startScripts) + { + m_log.InfoFormat("[SCENE]: Loading prims in xml2 format to region {0} from stream", RegionInfo.RegionName); + + m_serialiser.LoadPrimsFromXml2(this, reader, startScripts); + } + public void SavePrimsToXml2(string fileName) { m_log.InfoFormat("[SCENE]: Saving prims in xml2 format for region {0} to {1}", RegionInfo.RegionName, fileName); @@ -1767,6 +1775,13 @@ namespace OpenSim.Region.Environment.Scenes m_serialiser.SavePrimsToXml2(this, fileName); } + public void SavePrimsToXml2(TextWriter stream, LLVector3 min, LLVector3 max) + { + m_log.InfoFormat("[SCENE]: Saving prims in xml2 format for region {0} to stream", RegionInfo.RegionName); + + m_serialiser.SavePrimsToXml2(this, stream, min, max); + } + public void SaveNamedPrimsToXml2(string primName, string fileName) { m_log.InfoFormat( -- cgit v1.1