From 3b381523eb391867e8e66634919e257484610ac3 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Sun, 19 Oct 2008 18:26:44 +0000 Subject: * refactor: move loadInv and saveInv command line param functions up to the interactive OpenSim class * direct module import is temporary --- OpenSim/Region/Application/OpenSim.cs | 47 +++++++++++++++++++++++++++++++ OpenSim/Region/Application/OpenSimBase.cs | 47 ------------------------------- 2 files changed, 47 insertions(+), 47 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 93d56bc..9d3bcda 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -40,6 +40,7 @@ using OpenSim.Framework.Console; using OpenSim.Framework.Statistics; using OpenSim.Region.Environment.Interfaces; using OpenSim.Region.Environment.Scenes; +using OpenSim.Region.Environment.Modules.Avatar.Inventory.Archiver; using Timer=System.Timers.Timer; namespace OpenSim @@ -897,7 +898,53 @@ namespace OpenSim m_sceneManager.SaveCurrentSceneToArchive(DEFAULT_OAR_BACKUP_FILENAME); } } + + /// + /// Load inventory from an inventory file archive + /// + /// + 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 []"); + 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); + } + /// + /// Save inventory to a file archive + /// + /// + 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 []"); + 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) { string result = String.Empty; diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 69bb4d8..16cf5f3 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs @@ -48,7 +48,6 @@ using OpenSim.Region.Environment; using OpenSim.Region.Environment.Interfaces; using OpenSim.Region.Environment.Scenes; using OpenSim.Region.Physics.Manager; -using OpenSim.Region.Environment.Modules.Avatar.Inventory.Archiver; namespace OpenSim { @@ -686,52 +685,6 @@ namespace OpenSim #endregion /// - /// Save inventory to a file archive - /// - /// - 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 []"); - 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); - } - - /// - /// Load inventory from an inventory file archive - /// - /// - 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 []"); - 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); - } - - /// /// Performs any last-minute sanity checking and shuts down the region server /// protected override void ShutdownSpecific() -- cgit v1.1