aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorJustin Clarke Casey2009-02-25 17:30:15 +0000
committerJustin Clarke Casey2009-02-25 17:30:15 +0000
commit2d8843968fe7f3dbbb94717957fdc3b637f039cb (patch)
tree4698a7d82ab71905b0754dde84cdea5473727370 /OpenSim
parent* ignored some gens (diff)
downloadopensim-SC_OLD-2d8843968fe7f3dbbb94717957fdc3b637f039cb.zip
opensim-SC_OLD-2d8843968fe7f3dbbb94717957fdc3b637f039cb.tar.gz
opensim-SC_OLD-2d8843968fe7f3dbbb94717957fdc3b637f039cb.tar.bz2
opensim-SC_OLD-2d8843968fe7f3dbbb94717957fdc3b637f039cb.tar.xz
* Store inventory data in an 'inventory' directory rather than in the root of an iar
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs18
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs2
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/ArchiveConstants.cs5
3 files changed, 10 insertions, 15 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
index dfa4100..d2b59ae 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
@@ -77,7 +77,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
77 this.commsManager = commsManager; 77 this.commsManager = commsManager;
78 } 78 }
79 79
80 protected InventoryItemBase loadInvItem(string path, string contents) 80 protected InventoryItemBase LoadInvItem(string path, string contents)
81 { 81 {
82 InventoryItemBase item = new InventoryItemBase(); 82 InventoryItemBase item = new InventoryItemBase();
83 StringReader sr = new StringReader(contents); 83 StringReader sr = new StringReader(contents);
@@ -202,16 +202,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
202 if (entryType == TarArchiveReader.TarEntryType.TYPE_DIRECTORY) { 202 if (entryType == TarArchiveReader.TarEntryType.TYPE_DIRECTORY) {
203 m_log.WarnFormat("[INVENTORY ARCHIVER]: Ignoring directory entry {0}", filePath); 203 m_log.WarnFormat("[INVENTORY ARCHIVER]: Ignoring directory entry {0}", filePath);
204 } 204 }
205 else if (filePath.StartsWith(ArchiveConstants.ASSETS_PATH)) 205 else if (filePath.StartsWith(InventoryArchiveConstants.ASSETS_PATH))
206 { 206 {
207 if (LoadAsset(filePath, data)) 207 if (LoadAsset(filePath, data))
208 successfulAssetRestores++; 208 successfulAssetRestores++;
209 else 209 else
210 failedAssetRestores++; 210 failedAssetRestores++;
211 } 211 }
212 else 212 else if (filePath.StartsWith(InventoryArchiveConstants.INVENTORY_PATH))
213 { 213 {
214 InventoryItemBase item = loadInvItem(filePath, m_asciiEncoding.GetString(data)); 214 InventoryItemBase item = LoadInvItem(filePath, m_asciiEncoding.GetString(data));
215 215
216 if (item != null) 216 if (item != null)
217 { 217 {
@@ -251,14 +251,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
251 { 251 {
252 //IRegionSerialiser serialiser = scene.RequestModuleInterface<IRegionSerialiser>(); 252 //IRegionSerialiser serialiser = scene.RequestModuleInterface<IRegionSerialiser>();
253 // Right now we're nastily obtaining the UUID from the filename 253 // Right now we're nastily obtaining the UUID from the filename
254 string filename = assetPath.Remove(0, ArchiveConstants.ASSETS_PATH.Length); 254 string filename = assetPath.Remove(0, InventoryArchiveConstants.ASSETS_PATH.Length);
255 int i = filename.LastIndexOf(ArchiveConstants.ASSET_EXTENSION_SEPARATOR); 255 int i = filename.LastIndexOf(InventoryArchiveConstants.ASSET_EXTENSION_SEPARATOR);
256 256
257 if (i == -1) 257 if (i == -1)
258 { 258 {
259 m_log.ErrorFormat( 259 m_log.ErrorFormat(
260 "[INVENTORY ARCHIVER]: Could not find extension information in asset path {0} since it's missing the separator {1}. Skipping", 260 "[INVENTORY ARCHIVER]: Could not find extension information in asset path {0} since it's missing the separator {1}. Skipping",
261 assetPath, ArchiveConstants.ASSET_EXTENSION_SEPARATOR); 261 assetPath, InventoryArchiveConstants.ASSET_EXTENSION_SEPARATOR);
262 262
263 return false; 263 return false;
264 } 264 }
@@ -266,9 +266,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
266 string extension = filename.Substring(i); 266 string extension = filename.Substring(i);
267 string uuid = filename.Remove(filename.Length - extension.Length); 267 string uuid = filename.Remove(filename.Length - extension.Length);
268 268
269 if (ArchiveConstants.EXTENSION_TO_ASSET_TYPE.ContainsKey(extension)) 269 if (InventoryArchiveConstants.EXTENSION_TO_ASSET_TYPE.ContainsKey(extension))
270 { 270 {
271 sbyte assetType = ArchiveConstants.EXTENSION_TO_ASSET_TYPE[extension]; 271 sbyte assetType = InventoryArchiveConstants.EXTENSION_TO_ASSET_TYPE[extension];
272 272
273 m_log.DebugFormat("[INVENTORY ARCHIVER]: Importing asset {0}, type {1}", uuid, assetType); 273 m_log.DebugFormat("[INVENTORY ARCHIVER]: Importing asset {0}, type {1}", uuid, assetType);
274 274
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
index 8d25d0f..2b071f0 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
@@ -280,7 +280,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
280 inventoryFolder.Name, inventoryFolder.ID, m_invPath); 280 inventoryFolder.Name, inventoryFolder.ID, m_invPath);
281 281
282 //recurse through all dirs getting dirs and files 282 //recurse through all dirs getting dirs and files
283 saveInvDir(inventoryFolder, ""); 283 saveInvDir(inventoryFolder, InventoryArchiveConstants.INVENTORY_PATH);
284 } 284 }
285 285
286 new AssetsRequest(assetUuids.Keys, m_module.CommsManager.AssetCache, ReceivedAllAssets).Execute(); 286 new AssetsRequest(assetUuids.Keys, m_module.CommsManager.AssetCache, ReceivedAllAssets).Execute();
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveConstants.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveConstants.cs
index 179d1a2..f5f1fdb 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveConstants.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveConstants.cs
@@ -46,11 +46,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver
46 public static readonly string ASSETS_PATH = "assets/"; 46 public static readonly string ASSETS_PATH = "assets/";
47 47
48 /// <summary> 48 /// <summary>
49 /// Path for the assets metadata file
50 /// </summary>
51 //public static readonly string ASSETS_METADATA_PATH = "assets.xml";
52
53 /// <summary>
54 /// Path for the prims file 49 /// Path for the prims file
55 /// </summary> 50 /// </summary>
56 public static readonly string OBJECTS_PATH = "objects/"; 51 public static readonly string OBJECTS_PATH = "objects/";