aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorJustin Clarke Casey2009-02-11 17:34:12 +0000
committerJustin Clarke Casey2009-02-11 17:34:12 +0000
commit04d6a810b6df79b34f9754e0a1b189c070407727 (patch)
treefe89d63863557709283264b379d281e3b70b2d42 /OpenSim/Region
parentThank you kindly, FrankNichols for a patch that: (diff)
downloadopensim-SC_OLD-04d6a810b6df79b34f9754e0a1b189c070407727.zip
opensim-SC_OLD-04d6a810b6df79b34f9754e0a1b189c070407727.tar.gz
opensim-SC_OLD-04d6a810b6df79b34f9754e0a1b189c070407727.tar.bz2
opensim-SC_OLD-04d6a810b6df79b34f9754e0a1b189c070407727.tar.xz
* More inventory archive invocation to a proper region module
* Not ready for use yet
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Application/OpenSim.cs56
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs5
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs7
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs7
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs2
5 files changed, 5 insertions, 72 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index 0b8bd53..fbe3813 100644
--- a/OpenSim/Region/Application/OpenSim.cs
+++ b/OpenSim/Region/Application/OpenSim.cs
@@ -149,16 +149,6 @@ namespace OpenSim
149 "Save a region's data to an OAR archive", 149 "Save a region's data to an OAR archive",
150 "More information on forthcoming options here soon", SaveOar); 150 "More information on forthcoming options here soon", SaveOar);
151 151
152 /*
153 m_console.Commands.AddCommand("region", false, "save inventory",
154 "save inventory <first> <last> <path> <file>",
155 "Save user inventory data", SaveInv);
156
157 m_console.Commands.AddCommand("region", false, "load inventory",
158 "load inventory <first> <last> <path> <file>",
159 "Load user inventory data", LoadInv);
160 */
161
162 m_console.Commands.AddCommand("region", false, "edit scale", 152 m_console.Commands.AddCommand("region", false, "edit scale",
163 "edit scale <name> <x> <y> <z>", 153 "edit scale <name> <x> <y> <z>",
164 "Change the scale of a named prim", HandleEditScale); 154 "Change the scale of a named prim", HandleEditScale);
@@ -1103,52 +1093,6 @@ namespace OpenSim
1103 } 1093 }
1104 } 1094 }
1105 1095
1106 /// <summary>
1107 /// Load inventory from an inventory file archive
1108 /// </summary>
1109 /// <param name="cmdparams"></param>
1110 protected void LoadInv(string module, string[] cmdparams)
1111 {
1112 m_log.Error("[CONSOLE]: This command has not yet been implemented!");
1113 if (cmdparams.Length < 5)
1114 {
1115 m_log.Error("[CONSOLE]: usage is load-inv <first name> <last name> <inventory path> [<load file path>]");
1116 return;
1117 }
1118
1119 string firstName = cmdparams[2];
1120 string lastName = cmdparams[3];
1121 string invPath = cmdparams[4];
1122 string loadPath = (cmdparams.Length > 5 ? cmdparams[5] : DEFAULT_INV_BACKUP_FILENAME);
1123
1124 new InventoryArchiveReadRequest(
1125 m_sceneManager.CurrentOrFirstScene, m_commsManager).execute(
1126 firstName, lastName, invPath, loadPath);
1127 }
1128
1129 /// <summary>
1130 /// Save inventory to a file archive
1131 /// </summary>
1132 /// <param name="cmdparams"></param>
1133 protected void SaveInv(string module, string[] cmdparams)
1134 {
1135 m_log.Error("[CONSOLE]: This command has not yet been implemented!");
1136 if (cmdparams.Length < 5)
1137 {
1138 m_log.Error("[CONSOLE]: usage is save-inv <first name> <last name> <inventory path> [<save file path>]");
1139 return;
1140 }
1141
1142 string firstName = cmdparams[2];
1143 string lastName = cmdparams[3];
1144 string invPath = cmdparams[4];
1145 string savePath = (cmdparams.Length > 5 ? cmdparams[5] : DEFAULT_INV_BACKUP_FILENAME);
1146
1147 new InventoryArchiveWriteRequest(
1148 m_sceneManager.CurrentOrFirstScene,m_commsManager).execute(
1149 firstName, lastName, invPath, savePath);
1150 }
1151
1152 private static string CombineParams(string[] commandParams, int pos) 1096 private static string CombineParams(string[] commandParams, int pos)
1153 { 1097 {
1154 string result = String.Empty; 1098 string result = String.Empty;
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index d86a47b..6592a9b 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -71,11 +71,6 @@ namespace OpenSim
71 /// The file used to load and save an opensim archive if no filename has been specified 71 /// The file used to load and save an opensim archive if no filename has been specified
72 /// </summary> 72 /// </summary>
73 protected const string DEFAULT_OAR_BACKUP_FILENAME = "scene_oar.tar.gz"; 73 protected const string DEFAULT_OAR_BACKUP_FILENAME = "scene_oar.tar.gz";
74
75 /// <summary>
76 /// The file to load and save inventory if no filename has been specified
77 /// </summary>
78 protected const string DEFAULT_INV_BACKUP_FILENAME = "opensim_inv.tar.gz";
79 74
80 public ConfigSettings ConfigurationSettings 75 public ConfigSettings ConfigurationSettings
81 { 76 {
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
index 49006a2..704296c 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
47 { 47 {
48 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 48 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
49 49
50 protected Scene scene;
51 protected TarArchiveReader archive; 50 protected TarArchiveReader archive;
52 private static System.Text.ASCIIEncoding m_asciiEncoding = new System.Text.ASCIIEncoding(); 51 private static System.Text.ASCIIEncoding m_asciiEncoding = new System.Text.ASCIIEncoding();
53 52
54 CommunicationsManager commsManager; 53 CommunicationsManager commsManager;
55 54
56 public InventoryArchiveReadRequest(Scene currentScene, CommunicationsManager commsManager) 55 public InventoryArchiveReadRequest(CommunicationsManager commsManager)
57 { 56 {
58 //List<string> serialisedObjects = new List<string>(); 57 //List<string> serialisedObjects = new List<string>();
59 scene = currentScene;
60 this.commsManager = commsManager; 58 this.commsManager = commsManager;
61 } 59 }
62 60
@@ -261,8 +259,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
261 asset.Metadata.Type = assetType; 259 asset.Metadata.Type = assetType;
262 asset.Data = data; 260 asset.Data = data;
263 261
264 scene.AssetCache.AddAsset(asset); 262 commsManager.AssetCache.AddAsset(asset);
265
266 263
267 return true; 264 return true;
268 } 265 }
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
index f548296..90e2fcd 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;
39using OpenSim.Framework.Communications.Cache; 39using OpenSim.Framework.Communications.Cache;
40using log4net; 40using log4net;
41 41
42
43namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver 42namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
44{ 43{
45 public class InventoryArchiveWriteRequest 44 public class InventoryArchiveWriteRequest
46 { 45 {
47 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 46 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
48 47
49 protected Scene scene;
50 protected TarArchiveWriter archive; 48 protected TarArchiveWriter archive;
51 protected CommunicationsManager commsManager; 49 protected CommunicationsManager commsManager;
52 Dictionary<UUID, int> assetUuids; 50 Dictionary<UUID, int> assetUuids;
@@ -56,9 +54,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
56 /// </value> 54 /// </value>
57 private string m_savePath; 55 private string m_savePath;
58 56
59 public InventoryArchiveWriteRequest(Scene currentScene, CommunicationsManager commsManager) 57 public InventoryArchiveWriteRequest(CommunicationsManager commsManager)
60 { 58 {
61 scene = currentScene;
62 archive = new TarArchiveWriter(); 59 archive = new TarArchiveWriter();
63 this.commsManager = commsManager; 60 this.commsManager = commsManager;
64 assetUuids = new Dictionary<UUID, int>(); 61 assetUuids = new Dictionary<UUID, int>();
@@ -241,7 +238,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
241 saveInvDir(inventoryFolder, ""); 238 saveInvDir(inventoryFolder, "");
242 } 239 }
243 240
244 new AssetsRequest(assetUuids.Keys, scene.AssetCache, ReceivedAllAssets).Execute(); 241 new AssetsRequest(assetUuids.Keys, commsManager.AssetCache, ReceivedAllAssets).Execute();
245 } 242 }
246 } 243 }
247} 244}
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs
index 6259662..dd65e83 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
48 48
49 private Scene m_scene; 49 private Scene m_scene;
50 50
51 public string Name { get { return "Archiver Module"; } } 51 public string Name { get { return "Region Archiver Module"; } }
52 52
53 public bool IsSharedModule { get { return false; } } 53 public bool IsSharedModule { get { return false; } }
54 54