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 +++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) (limited to 'OpenSim/Region/Application/OpenSim.cs') 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; -- cgit v1.1