From 04d6a810b6df79b34f9754e0a1b189c070407727 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Wed, 11 Feb 2009 17:34:12 +0000 Subject: [PATCH] * More inventory archive invocation to a proper region module * Not ready for use yet --- OpenSim/Region/Application/OpenSim.cs | 56 ------------------- OpenSim/Region/Application/OpenSimBase.cs | 5 -- .../Archiver/InventoryArchiveReadRequest.cs | 7 +-- .../Archiver/InventoryArchiveWriteRequest.cs | 7 +-- .../World/Archiver/ArchiverModule.cs | 2 +- 5 files changed, 5 insertions(+), 72 deletions(-) diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 0b8bd53c0c..fbe3813b7d 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -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 ", - "Save user inventory data", SaveInv); - - m_console.Commands.AddCommand("region", false, "load inventory", - "load inventory ", - "Load user inventory data", LoadInv); - */ - m_console.Commands.AddCommand("region", false, "edit scale", "edit scale ", "Change the scale of a named prim", HandleEditScale); @@ -1103,52 +1093,6 @@ namespace OpenSim } } - /// - /// Load inventory from an inventory file archive - /// - /// - 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 []"); - 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); - } - - /// - /// Save inventory to a file archive - /// - /// - 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 []"); - 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; diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index d86a47b096..6592a9b6fa 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs @@ -71,11 +71,6 @@ namespace OpenSim /// The file used to load and save an opensim archive if no filename has been specified /// protected const string DEFAULT_OAR_BACKUP_FILENAME = "scene_oar.tar.gz"; - - /// - /// The file to load and save inventory if no filename has been specified - /// - protected const string DEFAULT_INV_BACKUP_FILENAME = "opensim_inv.tar.gz"; public ConfigSettings ConfigurationSettings { diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs index 49006a2bbe..704296c3e1 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs @@ -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 serialisedObjects = new List(); - 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; } diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs index f54829606d..90e2fcdf77 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs @@ -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 assetUuids; @@ -56,9 +54,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver /// 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(); @@ -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(); } } } diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs index 6259662c08..dd65e83581 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs @@ -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; } }