From 4f237f3ae3b8561de0dacd1ec0e937ec7a8e0307 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Fri, 30 May 2008 17:52:14 +0000 Subject: * Crudely migrate SceneXmlLoader into the Serializer module --- OpenSim/Region/Environment/Scenes/Scene.cs | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) (limited to 'OpenSim/Region/Environment/Scenes/Scene.cs') diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index c1e8602..26f3499 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -41,6 +41,7 @@ using OpenSim.Framework.Communications.Cache; using OpenSim.Framework.Servers; using OpenSim.Region.Environment.Interfaces; using OpenSim.Region.Environment.Modules.World.Archiver; +using OpenSim.Region.Environment.Modules.World.Serialiser; using OpenSim.Region.Environment.Modules.World.Terrain; using OpenSim.Region.Environment.Scenes.Scripting; using OpenSim.Region.Physics.Manager; @@ -94,7 +95,6 @@ namespace OpenSim.Region.Environment.Scenes public CommunicationsManager CommsManager; protected SceneCommunicationService m_sceneGridService; - protected SceneXmlLoader m_sceneXmlLoader; /// /// Each agent has its own capabilities handler. @@ -268,8 +268,6 @@ namespace OpenSim.Region.Environment.Scenes // Operating system has killed the plugin m_innerScene.UnRecoverableError += RestartNow; - m_sceneXmlLoader = new SceneXmlLoader(this, m_innerScene, m_regInfo); - RegisterDefaultSceneEvents(); m_httpListener = httpServer; @@ -1400,22 +1398,26 @@ namespace OpenSim.Region.Environment.Scenes public void LoadPrimsFromXml(string fileName, bool newIdsFlag, LLVector3 loadOffset) { - m_sceneXmlLoader.LoadPrimsFromXml(fileName, newIdsFlag, loadOffset); + IRegionSerialiser loader = RequestModuleInterface(); + loader.LoadPrimsFromXml(this, fileName, newIdsFlag, loadOffset); } public void SavePrimsToXml(string fileName) { - m_sceneXmlLoader.SavePrimsToXml(fileName); + IRegionSerialiser loader = RequestModuleInterface(); + loader.SavePrimsToXml(this, fileName); } public void LoadPrimsFromXml2(string fileName) { - m_sceneXmlLoader.LoadPrimsFromXml2(fileName); + IRegionSerialiser loader = RequestModuleInterface(); + loader.LoadPrimsFromXml2(this, fileName); } public void SavePrimsToXml2(string fileName) { - m_sceneXmlLoader.SavePrimsToXml2(fileName); + IRegionSerialiser loader = RequestModuleInterface(); + loader.SavePrimsToXml2(this, fileName); } /// @@ -1505,15 +1507,20 @@ namespace OpenSim.Region.Environment.Scenes grp.OffsetForNewRegion(pos); CrossPrimGroupIntoNewRegion(newRegionHandle, grp); - } + public void CrossPrimGroupIntoNewRegion(ulong newRegionHandle, SceneObjectGroup grp) { int primcrossingXMLmethod = 0; if (newRegionHandle != 0) { bool successYN = false; - successYN = m_sceneGridService.PrimCrossToNeighboringRegion(newRegionHandle, grp.UUID, m_sceneXmlLoader.SavePrimGroupToXML2String(grp), primcrossingXMLmethod); + + IRegionSerialiser loader = RequestModuleInterface(); + successYN + = m_sceneGridService.PrimCrossToNeighboringRegion( + newRegionHandle, grp.UUID, loader.SavePrimGroupToXML2String(grp), primcrossingXMLmethod); + if (successYN) { // We remove the object here @@ -1545,7 +1552,9 @@ namespace OpenSim.Region.Environment.Scenes m_log.Warn("{[INTERREGION]: A new prim arrived from a neighbor"); if (XMLMethod == 0) { - m_sceneXmlLoader.LoadGroupFromXml2String(objXMLData); + IRegionSerialiser loader = RequestModuleInterface(); + loader.LoadGroupFromXml2String(this, objXMLData); + SceneObjectPart RootPrim = GetSceneObjectPart(primID); if (RootPrim != null) { @@ -3025,7 +3034,6 @@ namespace OpenSim.Region.Environment.Scenes public bool pipeEventsForScript(uint localID) { - SceneObjectPart part = GetSceneObjectPart(localID); if (part != null) { -- cgit v1.1