aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-12-19 18:33:03 +0000
committerJustin Clarke Casey2008-12-19 18:33:03 +0000
commit583fa73126e425d98f12a6e5cef5487a3eb48e52 (patch)
treee8383ce36027550c664c5449b232e25f3e121a73 /OpenSim
parent* Add missing file from last commit (diff)
downloadopensim-SC_OLD-583fa73126e425d98f12a6e5cef5487a3eb48e52.zip
opensim-SC_OLD-583fa73126e425d98f12a6e5cef5487a3eb48e52.tar.gz
opensim-SC_OLD-583fa73126e425d98f12a6e5cef5487a3eb48e52.tar.bz2
opensim-SC_OLD-583fa73126e425d98f12a6e5cef5487a3eb48e52.tar.xz
* refactor: Remove archiver module scene wrappers
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs17
-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
5 files changed, 28 insertions, 38 deletions
diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
index 2c5adfe..4645ee6 100644
--- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
+++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
@@ -37,9 +37,9 @@ using Nini.Config;
37using Nwc.XmlRpc; 37using Nwc.XmlRpc;
38using OpenSim.Framework; 38using OpenSim.Framework;
39using OpenSim.Framework.Servers; 39using OpenSim.Framework.Servers;
40using OpenSim.Region.Environment.Interfaces;
40using OpenSim.Region.Environment.Modules.World.Terrain; 41using OpenSim.Region.Environment.Modules.World.Terrain;
41using OpenSim.Region.Environment.Scenes; 42using OpenSim.Region.Environment.Scenes;
42using OpenSim.Region.Environment.Modules.World.Archiver;
43 43
44namespace OpenSim.ApplicationPlugins.RemoteController 44namespace OpenSim.ApplicationPlugins.RemoteController
45{ 45{
@@ -1082,9 +1082,14 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1082 } 1082 }
1083 else throw new Exception("neither region_name nor region_uuid given"); 1083 else throw new Exception("neither region_name nor region_uuid given");
1084 1084
1085 new ArchiveReadRequest(scene, filename); 1085 IRegionArchiverModule archiver = scene.RequestModuleInterface<IRegionArchiverModule>();
1086 if (archiver != null)
1087 archiver.DearchiveRegion(filename);
1088 else
1089 throw new Exception("Archiver module not present for scene");
1090
1086 responseData["loaded"] = "true"; 1091 responseData["loaded"] = "true";
1087 1092
1088 response.Value = responseData; 1093 response.Value = responseData;
1089 } 1094 }
1090 catch (Exception e) 1095 catch (Exception e)
@@ -1173,7 +1178,11 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1173 } 1178 }
1174 else throw new Exception("neither region_name nor region_uuid given"); 1179 else throw new Exception("neither region_name nor region_uuid given");
1175 1180
1176 scene.SavePrimsToArchive(filename); 1181 IRegionArchiverModule archiver = scene.RequestModuleInterface<IRegionArchiverModule>();
1182 if (archiver != null)
1183 archiver.ArchiveRegion(filename);
1184 else
1185 throw new Exception("Archiver module not present for scene");
1177 1186
1178 responseData["saved"] = "true"; 1187 responseData["saved"] = "true";
1179 1188
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()