* Store inventory data in an 'inventory' directory rather than in the root of an iar

GenericGridServerConcept
Justin Clarke Casey 2009-02-25 17:30:15 +00:00
parent 4968e5646e
commit 2d8843968f
3 changed files with 10 additions and 15 deletions

View File

@ -77,7 +77,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
this.commsManager = commsManager; this.commsManager = commsManager;
} }
protected InventoryItemBase loadInvItem(string path, string contents) protected InventoryItemBase LoadInvItem(string path, string contents)
{ {
InventoryItemBase item = new InventoryItemBase(); InventoryItemBase item = new InventoryItemBase();
StringReader sr = new StringReader(contents); StringReader sr = new StringReader(contents);
@ -202,16 +202,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
if (entryType == TarArchiveReader.TarEntryType.TYPE_DIRECTORY) { if (entryType == TarArchiveReader.TarEntryType.TYPE_DIRECTORY) {
m_log.WarnFormat("[INVENTORY ARCHIVER]: Ignoring directory entry {0}", filePath); m_log.WarnFormat("[INVENTORY ARCHIVER]: Ignoring directory entry {0}", filePath);
} }
else if (filePath.StartsWith(ArchiveConstants.ASSETS_PATH)) else if (filePath.StartsWith(InventoryArchiveConstants.ASSETS_PATH))
{ {
if (LoadAsset(filePath, data)) if (LoadAsset(filePath, data))
successfulAssetRestores++; successfulAssetRestores++;
else else
failedAssetRestores++; failedAssetRestores++;
} }
else else if (filePath.StartsWith(InventoryArchiveConstants.INVENTORY_PATH))
{ {
InventoryItemBase item = loadInvItem(filePath, m_asciiEncoding.GetString(data)); InventoryItemBase item = LoadInvItem(filePath, m_asciiEncoding.GetString(data));
if (item != null) if (item != null)
{ {
@ -251,14 +251,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
{ {
//IRegionSerialiser serialiser = scene.RequestModuleInterface<IRegionSerialiser>(); //IRegionSerialiser serialiser = scene.RequestModuleInterface<IRegionSerialiser>();
// Right now we're nastily obtaining the UUID from the filename // Right now we're nastily obtaining the UUID from the filename
string filename = assetPath.Remove(0, ArchiveConstants.ASSETS_PATH.Length); string filename = assetPath.Remove(0, InventoryArchiveConstants.ASSETS_PATH.Length);
int i = filename.LastIndexOf(ArchiveConstants.ASSET_EXTENSION_SEPARATOR); int i = filename.LastIndexOf(InventoryArchiveConstants.ASSET_EXTENSION_SEPARATOR);
if (i == -1) if (i == -1)
{ {
m_log.ErrorFormat( m_log.ErrorFormat(
"[INVENTORY ARCHIVER]: Could not find extension information in asset path {0} since it's missing the separator {1}. Skipping", "[INVENTORY ARCHIVER]: Could not find extension information in asset path {0} since it's missing the separator {1}. Skipping",
assetPath, ArchiveConstants.ASSET_EXTENSION_SEPARATOR); assetPath, InventoryArchiveConstants.ASSET_EXTENSION_SEPARATOR);
return false; return false;
} }
@ -266,9 +266,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
string extension = filename.Substring(i); string extension = filename.Substring(i);
string uuid = filename.Remove(filename.Length - extension.Length); string uuid = filename.Remove(filename.Length - extension.Length);
if (ArchiveConstants.EXTENSION_TO_ASSET_TYPE.ContainsKey(extension)) if (InventoryArchiveConstants.EXTENSION_TO_ASSET_TYPE.ContainsKey(extension))
{ {
sbyte assetType = ArchiveConstants.EXTENSION_TO_ASSET_TYPE[extension]; sbyte assetType = InventoryArchiveConstants.EXTENSION_TO_ASSET_TYPE[extension];
m_log.DebugFormat("[INVENTORY ARCHIVER]: Importing asset {0}, type {1}", uuid, assetType); m_log.DebugFormat("[INVENTORY ARCHIVER]: Importing asset {0}, type {1}", uuid, assetType);

View File

@ -280,7 +280,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
inventoryFolder.Name, inventoryFolder.ID, m_invPath); inventoryFolder.Name, inventoryFolder.ID, m_invPath);
//recurse through all dirs getting dirs and files //recurse through all dirs getting dirs and files
saveInvDir(inventoryFolder, ""); saveInvDir(inventoryFolder, InventoryArchiveConstants.INVENTORY_PATH);
} }
new AssetsRequest(assetUuids.Keys, m_module.CommsManager.AssetCache, ReceivedAllAssets).Execute(); new AssetsRequest(assetUuids.Keys, m_module.CommsManager.AssetCache, ReceivedAllAssets).Execute();

View File

@ -45,11 +45,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver
/// </summary> /// </summary>
public static readonly string ASSETS_PATH = "assets/"; public static readonly string ASSETS_PATH = "assets/";
/// <summary>
/// Path for the assets metadata file
/// </summary>
//public static readonly string ASSETS_METADATA_PATH = "assets.xml";
/// <summary> /// <summary>
/// Path for the prims file /// Path for the prims file
/// </summary> /// </summary>