Implement oar merging

An oar can now be merged with existing region contents by using the --merge option
For example, load oar --merge my.oar
Existing terrain, region settings and parcel data is left in place when an oar is merged.
See http://opensimulator.org/wiki/OpenSim_Archives#Usage for more information
0.6.8-post-fixes
Justin Clark-Casey (justincc) 2009-11-25 16:02:47 +00:00
parent f9807884a4
commit c18422ad3a
1 changed files with 10 additions and 6 deletions

View File

@ -93,19 +93,23 @@ namespace OpenSim.Region.CoreModules.World.Archiver
/// <param name="cmdparams"></param> /// <param name="cmdparams"></param>
public void HandleLoadOarConsoleCommand(string module, string[] cmdparams) public void HandleLoadOarConsoleCommand(string module, string[] cmdparams)
{ {
OptionSet options = new OptionSet() {}; bool mergeOar = false;
OptionSet options = new OptionSet().Add("m|merge", delegate (string v) { mergeOar = v != null; });
List<string> mainParams = options.Parse(cmdparams); List<string> mainParams = options.Parse(cmdparams);
foreach (string param in mainParams) // m_log.DebugFormat("MERGE OAR IS [{0}]", mergeOar);
m_log.DebugFormat("Found param [{0}]", param); //
// foreach (string param in mainParams)
// m_log.DebugFormat("GOT PARAM [{0}]", param);
if (mainParams.Count > 2) if (mainParams.Count > 2)
{ {
DearchiveRegion(cmdparams[2]); DearchiveRegion(mainParams[2], mergeOar, Guid.Empty);
} }
else else
{ {
DearchiveRegion(DEFAULT_OAR_BACKUP_FILENAME); DearchiveRegion(DEFAULT_OAR_BACKUP_FILENAME, mergeOar, Guid.Empty);
} }
} }