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
This commit is contained in:
Justin Clark-Casey (justincc)
2009-11-24 17:28:38 +00:00
parent 52952a75ca
commit 88ead9ee63
5 changed files with 49 additions and 28 deletions

View File

@@ -45,6 +45,11 @@ namespace OpenSim.Region.CoreModules.World.Archiver
private Scene m_scene;
/// <value>
/// The file used to load and save an opensimulator archive if no filename has been specified
/// </value>
protected const string DEFAULT_OAR_BACKUP_FILENAME = "region.oar";
public string Name
{
get { return "RegionArchiverModule"; }
@@ -80,6 +85,38 @@ namespace OpenSim.Region.CoreModules.World.Archiver
{
}
/// <summary>
/// Load a whole region from an opensimulator archive.
/// </summary>
/// <param name="cmdparams"></param>
public void HandleLoadOarConsoleCommand(string module, string[] cmdparams)
{
if (cmdparams.Length > 2)
{
DearchiveRegion(cmdparams[2]);
}
else
{
DearchiveRegion(DEFAULT_OAR_BACKUP_FILENAME);
}
}
/// <summary>
/// Save a region to a file, including all the assets needed to restore it.
/// </summary>
/// <param name="cmdparams"></param>
public void HandleSaveOarConsoleCommand(string module, string[] cmdparams)
{
if (cmdparams.Length > 2)
{
ArchiveRegion(cmdparams[2]);
}
else
{
ArchiveRegion(DEFAULT_OAR_BACKUP_FILENAME);
}
}
public void ArchiveRegion(string savePath)
{
ArchiveRegion(savePath, Guid.Empty);