diff options
author | Justin Clarke Casey | 2008-10-19 18:26:44 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-10-19 18:26:44 +0000 |
commit | 3b381523eb391867e8e66634919e257484610ac3 (patch) | |
tree | d69f8fd4b810f9f03b11cf7a9a244a573183f7cd /OpenSim/Region/Application/OpenSim.cs | |
parent | * Restore loaded inventory items to the given folder (diff) | |
download | opensim-SC_OLD-3b381523eb391867e8e66634919e257484610ac3.zip opensim-SC_OLD-3b381523eb391867e8e66634919e257484610ac3.tar.gz opensim-SC_OLD-3b381523eb391867e8e66634919e257484610ac3.tar.bz2 opensim-SC_OLD-3b381523eb391867e8e66634919e257484610ac3.tar.xz |
* refactor: move loadInv and saveInv command line param functions up to the interactive OpenSim class
* direct module import is temporary
Diffstat (limited to 'OpenSim/Region/Application/OpenSim.cs')
-rw-r--r-- | OpenSim/Region/Application/OpenSim.cs | 47 |
1 files changed, 47 insertions, 0 deletions
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; | |||
40 | using OpenSim.Framework.Statistics; | 40 | using OpenSim.Framework.Statistics; |
41 | using OpenSim.Region.Environment.Interfaces; | 41 | using OpenSim.Region.Environment.Interfaces; |
42 | using OpenSim.Region.Environment.Scenes; | 42 | using OpenSim.Region.Environment.Scenes; |
43 | using OpenSim.Region.Environment.Modules.Avatar.Inventory.Archiver; | ||
43 | using Timer=System.Timers.Timer; | 44 | using Timer=System.Timers.Timer; |
44 | 45 | ||
45 | namespace OpenSim | 46 | namespace OpenSim |
@@ -897,7 +898,53 @@ namespace OpenSim | |||
897 | m_sceneManager.SaveCurrentSceneToArchive(DEFAULT_OAR_BACKUP_FILENAME); | 898 | m_sceneManager.SaveCurrentSceneToArchive(DEFAULT_OAR_BACKUP_FILENAME); |
898 | } | 899 | } |
899 | } | 900 | } |
901 | |||
902 | /// <summary> | ||
903 | /// Load inventory from an inventory file archive | ||
904 | /// </summary> | ||
905 | /// <param name="cmdparams"></param> | ||
906 | protected void LoadInv(string[] cmdparams) | ||
907 | { | ||
908 | m_log.Error("[CONSOLE]: This command has not yet been implemented!"); | ||
909 | if (cmdparams.Length < 3) | ||
910 | { | ||
911 | m_log.Error("[CONSOLE]: usage is load-inv <first name> <last name> <inventory path> [<load file path>]"); | ||
912 | return; | ||
913 | } | ||
914 | |||
915 | string firstName = cmdparams[0]; | ||
916 | string lastName = cmdparams[1]; | ||
917 | string invPath = cmdparams[2]; | ||
918 | string loadPath = (cmdparams.Length > 3 ? cmdparams[3] : DEFAULT_INV_BACKUP_FILENAME); | ||
919 | |||
920 | new InventoryArchiveReadRequest( | ||
921 | m_sceneManager.CurrentOrFirstScene, m_commsManager).execute( | ||
922 | firstName, lastName, invPath, loadPath); | ||
923 | } | ||
900 | 924 | ||
925 | /// <summary> | ||
926 | /// Save inventory to a file archive | ||
927 | /// </summary> | ||
928 | /// <param name="cmdparams"></param> | ||
929 | protected void SaveInv(string[] cmdparams) | ||
930 | { | ||
931 | m_log.Error("[CONSOLE]: This command has not yet been implemented!"); | ||
932 | if (cmdparams.Length < 3) | ||
933 | { | ||
934 | m_log.Error("[CONSOLE]: usage is save-inv <first name> <last name> <inventory path> [<save file path>]"); | ||
935 | return; | ||
936 | } | ||
937 | |||
938 | string firstName = cmdparams[0]; | ||
939 | string lastName = cmdparams[1]; | ||
940 | string invPath = cmdparams[2]; | ||
941 | string savePath = (cmdparams.Length > 3 ? cmdparams[3] : DEFAULT_INV_BACKUP_FILENAME); | ||
942 | |||
943 | new InventoryArchiveWriteRequest( | ||
944 | m_sceneManager.CurrentOrFirstScene,m_commsManager).execute( | ||
945 | firstName, lastName, invPath, savePath); | ||
946 | } | ||
947 | |||
901 | private static string CombineParams(string[] commandParams, int pos) | 948 | private static string CombineParams(string[] commandParams, int pos) |
902 | { | 949 | { |
903 | string result = String.Empty; | 950 | string result = String.Empty; |