From 83f390e42137d09e737aeb2ebd030777c3c43bac Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Fri, 30 May 2008 18:01:28 +0000 Subject: * Refactor: Change multiple requests for a module interface to use a stored reference instead. --- OpenSim/Region/Environment/Scenes/Scene.cs | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 26f3499..6916c6d 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -121,6 +121,8 @@ namespace OpenSim.Region.Environment.Scenes protected IWorldComm m_worldCommModule; protected IAvatarFactory m_AvatarFactory; protected IConfigSource m_config; + protected IRegionArchiver m_archiver; + protected IRegionSerialiser m_serialiser; // Central Update Loop @@ -643,6 +645,8 @@ namespace OpenSim.Region.Environment.Scenes m_worldCommModule = RequestModuleInterface(); XferManager = RequestModuleInterface(); m_AvatarFactory = RequestModuleInterface(); + m_archiver = RequestModuleInterface(); + m_serialiser = RequestModuleInterface(); } #endregion @@ -1398,26 +1402,22 @@ namespace OpenSim.Region.Environment.Scenes public void LoadPrimsFromXml(string fileName, bool newIdsFlag, LLVector3 loadOffset) { - IRegionSerialiser loader = RequestModuleInterface(); - loader.LoadPrimsFromXml(this, fileName, newIdsFlag, loadOffset); + m_serialiser.LoadPrimsFromXml(this, fileName, newIdsFlag, loadOffset); } public void SavePrimsToXml(string fileName) { - IRegionSerialiser loader = RequestModuleInterface(); - loader.SavePrimsToXml(this, fileName); + m_serialiser.SavePrimsToXml(this, fileName); } public void LoadPrimsFromXml2(string fileName) { - IRegionSerialiser loader = RequestModuleInterface(); - loader.LoadPrimsFromXml2(this, fileName); + m_serialiser.LoadPrimsFromXml2(this, fileName); } public void SavePrimsToXml2(string fileName) { - IRegionSerialiser loader = RequestModuleInterface(); - loader.SavePrimsToXml2(this, fileName); + m_serialiser.SavePrimsToXml2(this, fileName); } /// @@ -1426,8 +1426,7 @@ namespace OpenSim.Region.Environment.Scenes /// public void LoadPrimsFromArchive(string filePath) { - IRegionArchiver archiver = RequestModuleInterface(); - archiver.DearchiveRegion(filePath); + m_archiver.DearchiveRegion(filePath); } /// @@ -1436,8 +1435,7 @@ namespace OpenSim.Region.Environment.Scenes /// public void SavePrimsToArchive(string filePath) { - IRegionArchiver archiver = RequestModuleInterface(); - archiver.ArchiveRegion(filePath); + m_archiver.ArchiveRegion(filePath); } /// @@ -1516,10 +1514,9 @@ namespace OpenSim.Region.Environment.Scenes { bool successYN = false; - IRegionSerialiser loader = RequestModuleInterface(); successYN = m_sceneGridService.PrimCrossToNeighboringRegion( - newRegionHandle, grp.UUID, loader.SavePrimGroupToXML2String(grp), primcrossingXMLmethod); + newRegionHandle, grp.UUID, m_serialiser.SavePrimGroupToXML2String(grp), primcrossingXMLmethod); if (successYN) { @@ -1552,8 +1549,7 @@ namespace OpenSim.Region.Environment.Scenes m_log.Warn("{[INTERREGION]: A new prim arrived from a neighbor"); if (XMLMethod == 0) { - IRegionSerialiser loader = RequestModuleInterface(); - loader.LoadGroupFromXml2String(this, objXMLData); + m_serialiser.LoadGroupFromXml2String(this, objXMLData); SceneObjectPart RootPrim = GetSceneObjectPart(primID); if (RootPrim != null) -- cgit v1.1