aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2009-11-24 17:28:38 +0000
committerJustin Clark-Casey (justincc)2009-11-24 17:28:38 +0000
commit88ead9ee63fe87b16d7c24b3a38bf6567f3166f6 (patch)
tree950bc1123bba17a0583076fc0c6a5009028211e9
parentminor: remove experimental tags from load iar and save iar commands (diff)
downloadopensim-SC-88ead9ee63fe87b16d7c24b3a38bf6567f3166f6.zip
opensim-SC-88ead9ee63fe87b16d7c24b3a38bf6567f3166f6.tar.gz
opensim-SC-88ead9ee63fe87b16d7c24b3a38bf6567f3166f6.tar.bz2
opensim-SC-88ead9ee63fe87b16d7c24b3a38bf6567f3166f6.tar.xz
pass all command parameters to load/save oar, not just the filename
unfortunately, these commands cannot yet be properly relocated to the region modules due to deficiencies in the region module infrastructure
-rw-r--r--OpenSim/Region/Application/OpenSim.cs18
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs5
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs37
-rw-r--r--OpenSim/Region/Framework/Interfaces/IRegionArchiverModule.cs5
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneManager.cs12
5 files changed, 49 insertions, 28 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index 60c34df..f9be1e2 100644
--- a/OpenSim/Region/Application/OpenSim.cs
+++ b/OpenSim/Region/Application/OpenSim.cs
@@ -1294,14 +1294,7 @@ namespace OpenSim
1294 { 1294 {
1295 try 1295 try
1296 { 1296 {
1297 if (cmdparams.Length > 2) 1297 m_sceneManager.LoadArchiveToCurrentScene(cmdparams);
1298 {
1299 m_sceneManager.LoadArchiveToCurrentScene(cmdparams[2]);
1300 }
1301 else
1302 {
1303 m_sceneManager.LoadArchiveToCurrentScene(DEFAULT_OAR_BACKUP_FILENAME);
1304 }
1305 } 1298 }
1306 catch (Exception e) 1299 catch (Exception e)
1307 { 1300 {
@@ -1315,14 +1308,7 @@ namespace OpenSim
1315 /// <param name="cmdparams"></param> 1308 /// <param name="cmdparams"></param>
1316 protected void SaveOar(string module, string[] cmdparams) 1309 protected void SaveOar(string module, string[] cmdparams)
1317 { 1310 {
1318 if (cmdparams.Length > 2) 1311 m_sceneManager.SaveCurrentSceneToArchive(cmdparams);
1319 {
1320 m_sceneManager.SaveCurrentSceneToArchive(cmdparams[2]);
1321 }
1322 else
1323 {
1324 m_sceneManager.SaveCurrentSceneToArchive(DEFAULT_OAR_BACKUP_FILENAME);
1325 }
1326 } 1312 }
1327 1313
1328 private static string CombineParams(string[] commandParams, int pos) 1314 private static string CombineParams(string[] commandParams, int pos)
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index cc18f1a..391856b 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -75,11 +75,6 @@ namespace OpenSim
75 /// </value> 75 /// </value>
76 protected const string DEFAULT_PRIM_BACKUP_FILENAME = "prim-backup.xml"; 76 protected const string DEFAULT_PRIM_BACKUP_FILENAME = "prim-backup.xml";
77 77
78 /// <value>
79 /// The file used to load and save an opensimulator archive if no filename has been specified
80 /// </value>
81 protected const string DEFAULT_OAR_BACKUP_FILENAME = "region.oar";
82
83 public ConfigSettings ConfigurationSettings 78 public ConfigSettings ConfigurationSettings
84 { 79 {
85 get { return m_configSettings; } 80 get { return m_configSettings; }
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs
index 8d4f91b..181f4c6 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs
@@ -45,6 +45,11 @@ namespace OpenSim.Region.CoreModules.World.Archiver
45 45
46 private Scene m_scene; 46 private Scene m_scene;
47 47
48 /// <value>
49 /// The file used to load and save an opensimulator archive if no filename has been specified
50 /// </value>
51 protected const string DEFAULT_OAR_BACKUP_FILENAME = "region.oar";
52
48 public string Name 53 public string Name
49 { 54 {
50 get { return "RegionArchiverModule"; } 55 get { return "RegionArchiverModule"; }
@@ -80,6 +85,38 @@ namespace OpenSim.Region.CoreModules.World.Archiver
80 { 85 {
81 } 86 }
82 87
88 /// <summary>
89 /// Load a whole region from an opensimulator archive.
90 /// </summary>
91 /// <param name="cmdparams"></param>
92 public void HandleLoadOarConsoleCommand(string module, string[] cmdparams)
93 {
94 if (cmdparams.Length > 2)
95 {
96 DearchiveRegion(cmdparams[2]);
97 }
98 else
99 {
100 DearchiveRegion(DEFAULT_OAR_BACKUP_FILENAME);
101 }
102 }
103
104 /// <summary>
105 /// Save a region to a file, including all the assets needed to restore it.
106 /// </summary>
107 /// <param name="cmdparams"></param>
108 public void HandleSaveOarConsoleCommand(string module, string[] cmdparams)
109 {
110 if (cmdparams.Length > 2)
111 {
112 ArchiveRegion(cmdparams[2]);
113 }
114 else
115 {
116 ArchiveRegion(DEFAULT_OAR_BACKUP_FILENAME);
117 }
118 }
119
83 public void ArchiveRegion(string savePath) 120 public void ArchiveRegion(string savePath)
84 { 121 {
85 ArchiveRegion(savePath, Guid.Empty); 122 ArchiveRegion(savePath, Guid.Empty);
diff --git a/OpenSim/Region/Framework/Interfaces/IRegionArchiverModule.cs b/OpenSim/Region/Framework/Interfaces/IRegionArchiverModule.cs
index 9ad2036..1a8babc 100644
--- a/OpenSim/Region/Framework/Interfaces/IRegionArchiverModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IRegionArchiverModule.cs
@@ -34,7 +34,10 @@ namespace OpenSim.Region.Framework.Interfaces
34 /// Interface to region archive functionality 34 /// Interface to region archive functionality
35 /// </summary> 35 /// </summary>
36 public interface IRegionArchiverModule 36 public interface IRegionArchiverModule
37 { 37 {
38 void HandleLoadOarConsoleCommand(string module, string[] cmdparams);
39 void HandleSaveOarConsoleCommand(string module, string[] cmdparams);
40
38 /// <summary> 41 /// <summary>
39 /// Archive the region to the given path 42 /// Archive the region to the given path
40 /// </summary> 43 /// </summary>
diff --git a/OpenSim/Region/Framework/Scenes/SceneManager.cs b/OpenSim/Region/Framework/Scenes/SceneManager.cs
index dfaa7ea..c2e3370 100644
--- a/OpenSim/Region/Framework/Scenes/SceneManager.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneManager.cs
@@ -241,24 +241,24 @@ namespace OpenSim.Region.Framework.Scenes
241 /// Save the current scene to an OpenSimulator archive. This archive will eventually include the prim's assets 241 /// Save the current scene to an OpenSimulator archive. This archive will eventually include the prim's assets
242 /// as well as the details of the prims themselves. 242 /// as well as the details of the prims themselves.
243 /// </summary> 243 /// </summary>
244 /// <param name="filename"></param> 244 /// <param name="cmdparams"></param>
245 public void SaveCurrentSceneToArchive(string filename) 245 public void SaveCurrentSceneToArchive(string[] cmdparams)
246 { 246 {
247 IRegionArchiverModule archiver = CurrentOrFirstScene.RequestModuleInterface<IRegionArchiverModule>(); 247 IRegionArchiverModule archiver = CurrentOrFirstScene.RequestModuleInterface<IRegionArchiverModule>();
248 if (archiver != null) 248 if (archiver != null)
249 archiver.ArchiveRegion(filename); 249 archiver.HandleSaveOarConsoleCommand(string.Empty, cmdparams);
250 } 250 }
251 251
252 /// <summary> 252 /// <summary>
253 /// Load an OpenSim archive into the current scene. This will load both the shapes of the prims and upload 253 /// Load an OpenSim archive into the current scene. This will load both the shapes of the prims and upload
254 /// their assets to the asset service. 254 /// their assets to the asset service.
255 /// </summary> 255 /// </summary>
256 /// <param name="filename"></param> 256 /// <param name="cmdparams"></param>
257 public void LoadArchiveToCurrentScene(string filename) 257 public void LoadArchiveToCurrentScene(string[] cmdparams)
258 { 258 {
259 IRegionArchiverModule archiver = CurrentOrFirstScene.RequestModuleInterface<IRegionArchiverModule>(); 259 IRegionArchiverModule archiver = CurrentOrFirstScene.RequestModuleInterface<IRegionArchiverModule>();
260 if (archiver != null) 260 if (archiver != null)
261 archiver.DearchiveRegion(filename); 261 archiver.HandleLoadOarConsoleCommand(string.Empty, cmdparams);
262 } 262 }
263 263
264 public string SaveCurrentSceneMapToXmlString() 264 public string SaveCurrentSceneMapToXmlString()