diff options
author | Justin Clark-Casey (justincc) | 2012-10-24 03:08:58 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-10-24 03:08:58 +0100 |
commit | f76dceb90b5a76a7b6a5243c9032996c007c0cf5 (patch) | |
tree | 19b99bef42c0c56febfad10835027d3c6f101619 /OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs | |
parent | Add "dump object uuid" console command. This allows any object in the scene ... (diff) | |
download | opensim-SC_OLD-f76dceb90b5a76a7b6a5243c9032996c007c0cf5.zip opensim-SC_OLD-f76dceb90b5a76a7b6a5243c9032996c007c0cf5.tar.gz opensim-SC_OLD-f76dceb90b5a76a7b6a5243c9032996c007c0cf5.tar.bz2 opensim-SC_OLD-f76dceb90b5a76a7b6a5243c9032996c007c0cf5.tar.xz |
Get "save oar" and "save iar" to tell you in a more friendly manner if the filename to save already exists, rather than exception throwing.
Also changes ConsoleUtil.CheckFileExists to CheckFileDoesNotExist() since this is more meaningful in the context, even though it does result in double negatives.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs index 2a87dc2..970487a 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs | |||
@@ -32,6 +32,8 @@ using System.Reflection; | |||
32 | using log4net; | 32 | using log4net; |
33 | using NDesk.Options; | 33 | using NDesk.Options; |
34 | using Nini.Config; | 34 | using Nini.Config; |
35 | using OpenSim.Framework; | ||
36 | using OpenSim.Framework.Console; | ||
35 | using OpenSim.Region.Framework.Interfaces; | 37 | using OpenSim.Region.Framework.Interfaces; |
36 | using OpenSim.Region.Framework.Scenes; | 38 | using OpenSim.Region.Framework.Scenes; |
37 | 39 | ||
@@ -117,7 +119,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
117 | // | 119 | // |
118 | // foreach (string param in mainParams) | 120 | // foreach (string param in mainParams) |
119 | // m_log.DebugFormat("GOT PARAM [{0}]", param); | 121 | // m_log.DebugFormat("GOT PARAM [{0}]", param); |
120 | 122 | ||
121 | if (mainParams.Count > 2) | 123 | if (mainParams.Count > 2) |
122 | { | 124 | { |
123 | DearchiveRegion(mainParams[2], mergeOar, skipAssets, Guid.Empty); | 125 | DearchiveRegion(mainParams[2], mergeOar, skipAssets, Guid.Empty); |
@@ -150,14 +152,16 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
150 | 152 | ||
151 | List<string> mainParams = ops.Parse(cmdparams); | 153 | List<string> mainParams = ops.Parse(cmdparams); |
152 | 154 | ||
155 | string path; | ||
153 | if (mainParams.Count > 2) | 156 | if (mainParams.Count > 2) |
154 | { | 157 | path = mainParams[2]; |
155 | ArchiveRegion(mainParams[2], options); | ||
156 | } | ||
157 | else | 158 | else |
158 | { | 159 | path = DEFAULT_OAR_BACKUP_FILENAME; |
159 | ArchiveRegion(DEFAULT_OAR_BACKUP_FILENAME, options); | 160 | |
160 | } | 161 | if (!ConsoleUtil.CheckFileDoesNotExist(MainConsole.Instance, path)) |
162 | return; | ||
163 | |||
164 | ArchiveRegion(path, options); | ||
161 | } | 165 | } |
162 | 166 | ||
163 | public void ArchiveRegion(string savePath, Dictionary<string, object> options) | 167 | public void ArchiveRegion(string savePath, Dictionary<string, object> options) |