From fff5459f4d3a6fcb7acae9e092fd8aae3c74dd7b Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 28 May 2010 20:07:15 +0100 Subject: Add ability to load IARs directly from URIs So, something like load iar Justin Clark-Casey / PASSWORD http://justincc.org/downloads/iars/my-great-items.iar Will load my IAR directly from the web. --- OpenSim/Framework/Console/CommandConsole.cs | 3 +-- .../Archiver/InventoryArchiveReadRequest.cs | 3 +-- .../Inventory/Archiver/InventoryArchiverModule.cs | 21 +++++++++++++---- OpenSim/Region/Framework/Scenes/SceneBase.cs | 26 +++++++++++++++++++++- 4 files changed, 44 insertions(+), 9 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Framework/Console/CommandConsole.cs b/OpenSim/Framework/Console/CommandConsole.cs index 66f483c..2008613 100644 --- a/OpenSim/Framework/Console/CommandConsole.cs +++ b/OpenSim/Framework/Console/CommandConsole.cs @@ -182,8 +182,7 @@ namespace OpenSim.Framework.Console public void AddCommand(string module, bool shared, string command, string help, string longhelp, CommandDelegate fn) { - AddCommand(module, shared, command, help, longhelp, - String.Empty, fn); + AddCommand(module, shared, command, help, longhelp, String.Empty, fn); } /// diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs index dc7439c..806aa4f 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs @@ -37,7 +37,6 @@ using log4net; using OpenMetaverse; using OpenSim.Framework; using OpenSim.Framework.Communications; - using OpenSim.Framework.Communications.Osp; using OpenSim.Framework.Serialization; using OpenSim.Framework.Serialization.External; @@ -72,7 +71,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver scene, userInfo, invPath, - new GZipStream(new FileStream(loadPath, FileMode.Open), CompressionMode.Decompress)) + new GZipStream(ArchiveHelpers.GetStream(loadPath), CompressionMode.Decompress)) { } diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs index f570999..307db97 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs @@ -91,13 +91,26 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver scene.AddCommand( this, "load iar", - "load iar []", - "Load user inventory archive.", HandleLoadInvConsoleCommand); + "load iar []", + "Load user inventory archive (IAR).", + " is user's first name." + Environment.NewLine + + " is user's last name." + Environment.NewLine + + " is the path inside the user's inventory where the IAR should be loaded." + Environment.NewLine + + " is the user's password." + Environment.NewLine + + " is the filesystem path or URI from which to load the IAR." + + string.Format(" If this is not given then the filename {0} in the current directory is used", DEFAULT_INV_BACKUP_FILENAME), + HandleLoadInvConsoleCommand); scene.AddCommand( this, "save iar", - "save iar []", - "Save user inventory archive.", HandleSaveInvConsoleCommand); + "save iar []", + "Save user inventory archive (IAR).", + " is the user's first name." + Environment.NewLine + + " is the user's last name." + Environment.NewLine + + " is the path inside the user's inventory for the folder/item to be saved." + Environment.NewLine + + " is the filesystem path at which to save the IAR." + + string.Format(" If this is not given then the filename {0} in the current directory is used", DEFAULT_INV_BACKUP_FILENAME), + HandleSaveInvConsoleCommand); m_aScene = scene; } diff --git a/OpenSim/Region/Framework/Scenes/SceneBase.cs b/OpenSim/Region/Framework/Scenes/SceneBase.cs index bfc19b7..c363a91 100644 --- a/OpenSim/Region/Framework/Scenes/SceneBase.cs +++ b/OpenSim/Region/Framework/Scenes/SceneBase.cs @@ -498,8 +498,31 @@ namespace OpenSim.Region.Framework.Scenes } } + /// + /// Call this from a region module to add a command to the OpenSim console. + /// + /// + /// + /// + /// + /// public void AddCommand(object mod, string command, string shorthelp, string longhelp, CommandDelegate callback) { + AddCommand(mod, command, shorthelp, longhelp, string.Empty, callback); + } + + /// + /// Call this from a region module to add a command to the OpenSim console. + /// + /// + /// + /// + /// + /// + /// + public void AddCommand( + object mod, string command, string shorthelp, string longhelp, string descriptivehelp, CommandDelegate callback) + { if (MainConsole.Instance == null) return; @@ -523,7 +546,8 @@ namespace OpenSim.Region.Framework.Scenes else throw new Exception("AddCommand module parameter must be IRegionModule or IRegionModuleBase"); } - MainConsole.Instance.Commands.AddCommand(modulename, shared, command, shorthelp, longhelp, callback); + MainConsole.Instance.Commands.AddCommand( + modulename, shared, command, shorthelp, longhelp, descriptivehelp, callback); } public virtual ISceneObject DeserializeObject(string representation) -- cgit v1.1