* More inventory archive invocation to a proper region module

* Not ready for use yet
0.6.3-post-fixes
Justin Clarke Casey 2009-02-11 17:34:12 +00:00
parent 6b187ae196
commit 04d6a810b6
5 changed files with 5 additions and 72 deletions

View File

@ -149,16 +149,6 @@ namespace OpenSim
"Save a region's data to an OAR archive",
"More information on forthcoming options here soon", SaveOar);
/*
m_console.Commands.AddCommand("region", false, "save inventory",
"save inventory <first> <last> <path> <file>",
"Save user inventory data", SaveInv);
m_console.Commands.AddCommand("region", false, "load inventory",
"load inventory <first> <last> <path> <file>",
"Load user inventory data", LoadInv);
*/
m_console.Commands.AddCommand("region", false, "edit scale",
"edit scale <name> <x> <y> <z>",
"Change the scale of a named prim", HandleEditScale);
@ -1103,52 +1093,6 @@ namespace OpenSim
}
}
/// <summary>
/// Load inventory from an inventory file archive
/// </summary>
/// <param name="cmdparams"></param>
protected void LoadInv(string module, string[] cmdparams)
{
m_log.Error("[CONSOLE]: This command has not yet been implemented!");
if (cmdparams.Length < 5)
{
m_log.Error("[CONSOLE]: usage is load-inv <first name> <last name> <inventory path> [<load file path>]");
return;
}
string firstName = cmdparams[2];
string lastName = cmdparams[3];
string invPath = cmdparams[4];
string loadPath = (cmdparams.Length > 5 ? cmdparams[5] : 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 module, string[] cmdparams)
{
m_log.Error("[CONSOLE]: This command has not yet been implemented!");
if (cmdparams.Length < 5)
{
m_log.Error("[CONSOLE]: usage is save-inv <first name> <last name> <inventory path> [<save file path>]");
return;
}
string firstName = cmdparams[2];
string lastName = cmdparams[3];
string invPath = cmdparams[4];
string savePath = (cmdparams.Length > 5 ? cmdparams[5] : DEFAULT_INV_BACKUP_FILENAME);
new InventoryArchiveWriteRequest(
m_sceneManager.CurrentOrFirstScene,m_commsManager).execute(
firstName, lastName, invPath, savePath);
}
private static string CombineParams(string[] commandParams, int pos)
{
string result = String.Empty;

View File

@ -71,11 +71,6 @@ namespace OpenSim
/// The file used to load and save an opensim archive if no filename has been specified
/// </summary>
protected const string DEFAULT_OAR_BACKUP_FILENAME = "scene_oar.tar.gz";
/// <summary>
/// The file to load and save inventory if no filename has been specified
/// </summary>
protected const string DEFAULT_INV_BACKUP_FILENAME = "opensim_inv.tar.gz";
public ConfigSettings ConfigurationSettings
{

View File

@ -47,16 +47,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
protected Scene scene;
protected TarArchiveReader archive;
private static System.Text.ASCIIEncoding m_asciiEncoding = new System.Text.ASCIIEncoding();
CommunicationsManager commsManager;
public InventoryArchiveReadRequest(Scene currentScene, CommunicationsManager commsManager)
public InventoryArchiveReadRequest(CommunicationsManager commsManager)
{
//List<string> serialisedObjects = new List<string>();
scene = currentScene;
this.commsManager = commsManager;
}
@ -261,8 +259,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
asset.Metadata.Type = assetType;
asset.Data = data;
scene.AssetCache.AddAsset(asset);
commsManager.AssetCache.AddAsset(asset);
return true;
}

View File

@ -39,14 +39,12 @@ using OpenSim.Framework.Communications;
using OpenSim.Framework.Communications.Cache;
using log4net;
namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
{
public class InventoryArchiveWriteRequest
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
protected Scene scene;
protected TarArchiveWriter archive;
protected CommunicationsManager commsManager;
Dictionary<UUID, int> assetUuids;
@ -56,9 +54,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
/// </value>
private string m_savePath;
public InventoryArchiveWriteRequest(Scene currentScene, CommunicationsManager commsManager)
public InventoryArchiveWriteRequest(CommunicationsManager commsManager)
{
scene = currentScene;
archive = new TarArchiveWriter();
this.commsManager = commsManager;
assetUuids = new Dictionary<UUID, int>();
@ -241,7 +238,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
saveInvDir(inventoryFolder, "");
}
new AssetsRequest(assetUuids.Keys, scene.AssetCache, ReceivedAllAssets).Execute();
new AssetsRequest(assetUuids.Keys, commsManager.AssetCache, ReceivedAllAssets).Execute();
}
}
}

View File

@ -48,7 +48,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
private Scene m_scene;
public string Name { get { return "Archiver Module"; } }
public string Name { get { return "Region Archiver Module"; } }
public bool IsSharedModule { get { return false; } }