* refactor: move loadInv and saveInv command line param functions up to the interactive OpenSim class

* direct module import is temporary
0.6.0-stable
Justin Clarke Casey 2008-10-19 18:26:44 +00:00
parent 6e98233b2e
commit 3b381523eb
2 changed files with 47 additions and 47 deletions

View File

@ -40,6 +40,7 @@ using OpenSim.Framework.Console;
using OpenSim.Framework.Statistics; using OpenSim.Framework.Statistics;
using OpenSim.Region.Environment.Interfaces; using OpenSim.Region.Environment.Interfaces;
using OpenSim.Region.Environment.Scenes; using OpenSim.Region.Environment.Scenes;
using OpenSim.Region.Environment.Modules.Avatar.Inventory.Archiver;
using Timer=System.Timers.Timer; using Timer=System.Timers.Timer;
namespace OpenSim namespace OpenSim
@ -897,7 +898,53 @@ namespace OpenSim
m_sceneManager.SaveCurrentSceneToArchive(DEFAULT_OAR_BACKUP_FILENAME); m_sceneManager.SaveCurrentSceneToArchive(DEFAULT_OAR_BACKUP_FILENAME);
} }
} }
/// <summary>
/// Load inventory from an inventory file archive
/// </summary>
/// <param name="cmdparams"></param>
protected void LoadInv(string[] cmdparams)
{
m_log.Error("[CONSOLE]: This command has not yet been implemented!");
if (cmdparams.Length < 3)
{
m_log.Error("[CONSOLE]: usage is load-inv <first name> <last name> <inventory path> [<load file path>]");
return;
}
string firstName = cmdparams[0];
string lastName = cmdparams[1];
string invPath = cmdparams[2];
string loadPath = (cmdparams.Length > 3 ? cmdparams[3] : DEFAULT_INV_BACKUP_FILENAME);
new InventoryArchiveReadRequest(
m_sceneManager.CurrentOrFirstScene, m_commsManager).execute(
firstName, lastName, invPath, loadPath);
}
/// <summary>
/// Save inventory to a file archive
/// </summary>
/// <param name="cmdparams"></param>
protected void SaveInv(string[] cmdparams)
{
m_log.Error("[CONSOLE]: This command has not yet been implemented!");
if (cmdparams.Length < 3)
{
m_log.Error("[CONSOLE]: usage is save-inv <first name> <last name> <inventory path> [<save file path>]");
return;
}
string firstName = cmdparams[0];
string lastName = cmdparams[1];
string invPath = cmdparams[2];
string savePath = (cmdparams.Length > 3 ? cmdparams[3] : DEFAULT_INV_BACKUP_FILENAME);
new InventoryArchiveWriteRequest(
m_sceneManager.CurrentOrFirstScene,m_commsManager).execute(
firstName, lastName, invPath, savePath);
}
private static string CombineParams(string[] commandParams, int pos) private static string CombineParams(string[] commandParams, int pos)
{ {
string result = String.Empty; string result = String.Empty;

View File

@ -48,7 +48,6 @@ using OpenSim.Region.Environment;
using OpenSim.Region.Environment.Interfaces; using OpenSim.Region.Environment.Interfaces;
using OpenSim.Region.Environment.Scenes; using OpenSim.Region.Environment.Scenes;
using OpenSim.Region.Physics.Manager; using OpenSim.Region.Physics.Manager;
using OpenSim.Region.Environment.Modules.Avatar.Inventory.Archiver;
namespace OpenSim namespace OpenSim
{ {
@ -685,52 +684,6 @@ namespace OpenSim
#endregion #endregion
/// <summary>
/// Save inventory to a file archive
/// </summary>
/// <param name="cmdparams"></param>
protected void SaveInv(string[] cmdparams)
{
m_log.Error("[CONSOLE]: This command has not yet been implemented!");
if (cmdparams.Length < 3)
{
m_log.Error("[CONSOLE]: usage is save-inv <first name> <last name> <inventory path> [<save file path>]");
return;
}
string firstName = cmdparams[0];
string lastName = cmdparams[1];
string invPath = cmdparams[2];
string savePath = (cmdparams.Length > 3 ? cmdparams[3] : DEFAULT_INV_BACKUP_FILENAME);
new InventoryArchiveWriteRequest(
m_sceneManager.CurrentOrFirstScene,m_commsManager).execute(
firstName, lastName, invPath, savePath);
}
/// <summary>
/// Load inventory from an inventory file archive
/// </summary>
/// <param name="cmdparams"></param>
protected void LoadInv(string[] cmdparams)
{
m_log.Error("[CONSOLE]: This command has not yet been implemented!");
if (cmdparams.Length < 3)
{
m_log.Error("[CONSOLE]: usage is load-inv <first name> <last name> <inventory path> [<load file path>]");
return;
}
string firstName = cmdparams[0];
string lastName = cmdparams[1];
string invPath = cmdparams[2];
string loadPath = (cmdparams.Length > 3 ? cmdparams[3] : DEFAULT_INV_BACKUP_FILENAME);
new InventoryArchiveReadRequest(
m_sceneManager.CurrentOrFirstScene, m_commsManager).execute(
firstName, lastName, invPath, loadPath);
}
/// <summary> /// <summary>
/// Performs any last-minute sanity checking and shuts down the region server /// Performs any last-minute sanity checking and shuts down the region server
/// </summary> /// </summary>