aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r--OpenSim/Region/Environment/Interfaces/IRegionArchiverModule.cs (renamed from OpenSim/Region/Environment/Modules/World/Archiver/IRegionArchiver.cs)6
-rw-r--r--OpenSim/Region/Environment/Modules/World/Archiver/ArchiverModule.cs11
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs24
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneManager.cs8
4 files changed, 15 insertions, 34 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/IRegionArchiver.cs b/OpenSim/Region/Environment/Interfaces/IRegionArchiverModule.cs
index b949666..11eea20 100644
--- a/OpenSim/Region/Environment/Modules/World/Archiver/IRegionArchiver.cs
+++ b/OpenSim/Region/Environment/Interfaces/IRegionArchiverModule.cs
@@ -25,14 +25,12 @@
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28using OpenSim.Region.Environment.Scenes; 28namespace OpenSim.Region.Environment.Interfaces
29
30namespace OpenSim.Region.Environment.Modules.World.Archiver
31{ 29{
32 /// <summary> 30 /// <summary>
33 /// Interface to region archive functionality 31 /// Interface to region archive functionality
34 /// </summary> 32 /// </summary>
35 public interface IRegionArchiver 33 public interface IRegionArchiverModule
36 { 34 {
37 /// <summary> 35 /// <summary>
38 /// Archive the region to the given path 36 /// Archive the region to the given path
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiverModule.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiverModule.cs
index df17ad2..de60472 100644
--- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiverModule.cs
+++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiverModule.cs
@@ -40,9 +40,9 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
40 /// <summary> 40 /// <summary>
41 /// This module loads and saves OpenSimulator archives 41 /// This module loads and saves OpenSimulator archives
42 /// </summary> 42 /// </summary>
43 public class ArchiverModule : IRegionModule, IRegionArchiver 43 public class ArchiverModule : IRegionModule, IRegionArchiverModule
44 { 44 {
45 // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 45 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
46 46
47 /// <summary> 47 /// <summary>
48 /// Scene to which this module belongs 48 /// Scene to which this module belongs
@@ -58,8 +58,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
58 public void Initialise(Scene scene, IConfigSource source) 58 public void Initialise(Scene scene, IConfigSource source)
59 { 59 {
60 m_scene = scene; 60 m_scene = scene;
61 61 m_scene.RegisterModuleInterface<IRegionArchiverModule>(this);
62 m_scene.RegisterModuleInterface<IRegionArchiver>(this);
63 } 62 }
64 63
65 public void PostInitialise() 64 public void PostInitialise()
@@ -72,11 +71,15 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
72 71
73 public void ArchiveRegion(string savePath) 72 public void ArchiveRegion(string savePath)
74 { 73 {
74 m_log.InfoFormat("[SCENE]: Writing archive for region {0} to {1}", m_scene.RegionInfo.RegionName, savePath);
75
75 new ArchiveWriteRequestPreparation(m_scene, savePath).ArchiveRegion(); 76 new ArchiveWriteRequestPreparation(m_scene, savePath).ArchiveRegion();
76 } 77 }
77 78
78 public void DearchiveRegion(string loadPath) 79 public void DearchiveRegion(string loadPath)
79 { 80 {
81 m_log.InfoFormat("[SCENE]: Loading archive to region {0} from {1}", m_scene.RegionInfo.RegionName, loadPath);
82
80 new ArchiveReadRequest(m_scene, loadPath); 83 new ArchiveReadRequest(m_scene, loadPath);
81 } 84 }
82 } 85 }
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index eecfd70..4272f22 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -142,7 +142,6 @@ namespace OpenSim.Region.Environment.Scenes
142 protected IWorldComm m_worldCommModule; 142 protected IWorldComm m_worldCommModule;
143 protected IAvatarFactory m_AvatarFactory; 143 protected IAvatarFactory m_AvatarFactory;
144 protected IConfigSource m_config; 144 protected IConfigSource m_config;
145 protected IRegionArchiver m_archiver;
146 protected IRegionSerialiser m_serialiser; 145 protected IRegionSerialiser m_serialiser;
147 146
148 // Central Update Loop 147 // Central Update Loop
@@ -729,7 +728,6 @@ namespace OpenSim.Region.Environment.Scenes
729 m_worldCommModule = RequestModuleInterface<IWorldComm>(); 728 m_worldCommModule = RequestModuleInterface<IWorldComm>();
730 XferManager = RequestModuleInterface<IXfer>(); 729 XferManager = RequestModuleInterface<IXfer>();
731 m_AvatarFactory = RequestModuleInterface<IAvatarFactory>(); 730 m_AvatarFactory = RequestModuleInterface<IAvatarFactory>();
732 m_archiver = RequestModuleInterface<IRegionArchiver>();
733 m_serialiser = RequestModuleInterface<IRegionSerialiser>(); 731 m_serialiser = RequestModuleInterface<IRegionSerialiser>();
734 } 732 }
735 733
@@ -1949,28 +1947,6 @@ namespace OpenSim.Region.Environment.Scenes
1949 } 1947 }
1950 1948
1951 /// <summary> 1949 /// <summary>
1952 /// Load a prim archive into the scene. This loads both prims and their assets.
1953 /// </summary>
1954 /// <param name="filePath"></param>
1955 public void LoadPrimsFromArchive(string filePath)
1956 {
1957 m_log.InfoFormat("[SCENE]: Loading archive to region {0} from {1}", RegionInfo.RegionName, filePath);
1958
1959 m_archiver.DearchiveRegion(filePath);
1960 }
1961
1962 /// <summary>
1963 /// Save the prims in the scene to an archive. This saves both prims and their assets.
1964 /// </summary>
1965 /// <param name="filePath"></param>
1966 public void SavePrimsToArchive(string filePath)
1967 {
1968 m_log.InfoFormat("[SCENE]: Writing archive for region {0} to {1}", RegionInfo.RegionName, filePath);
1969
1970 m_archiver.ArchiveRegion(filePath);
1971 }
1972
1973 /// <summary>
1974 /// Move the given scene object into a new region depending on which region its absolute position has moved 1950 /// Move the given scene object into a new region depending on which region its absolute position has moved
1975 /// into. 1951 /// into.
1976 /// 1952 ///
diff --git a/OpenSim/Region/Environment/Scenes/SceneManager.cs b/OpenSim/Region/Environment/Scenes/SceneManager.cs
index bb74c20..6072b70 100644
--- a/OpenSim/Region/Environment/Scenes/SceneManager.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneManager.cs
@@ -227,7 +227,9 @@ namespace OpenSim.Region.Environment.Scenes
227 /// <param name="filename"></param> 227 /// <param name="filename"></param>
228 public void SaveCurrentSceneToArchive(string filename) 228 public void SaveCurrentSceneToArchive(string filename)
229 { 229 {
230 CurrentOrFirstScene.SavePrimsToArchive(filename); 230 IRegionArchiverModule archiver = CurrentOrFirstScene.RequestModuleInterface<IRegionArchiverModule>();
231 if (archiver != null)
232 archiver.ArchiveRegion(filename);
231 } 233 }
232 234
233 /// <summary> 235 /// <summary>
@@ -237,7 +239,9 @@ namespace OpenSim.Region.Environment.Scenes
237 /// <param name="filename"></param> 239 /// <param name="filename"></param>
238 public void LoadArchiveToCurrentScene(string filename) 240 public void LoadArchiveToCurrentScene(string filename)
239 { 241 {
240 CurrentOrFirstScene.LoadPrimsFromArchive(filename); 242 IRegionArchiverModule archiver = CurrentOrFirstScene.RequestModuleInterface<IRegionArchiverModule>();
243 if (archiver != null)
244 archiver.DearchiveRegion(filename);
241 } 245 }
242 246
243 public string SaveCurrentSceneMapToXmlString() 247 public string SaveCurrentSceneMapToXmlString()