* Don't fail the archive operation if exceptions are encountered while analyzing prims

0.6.0-stable
Justin Clarke Casey 2008-07-08 17:58:45 +00:00
parent 00a38df75a
commit 79f68e571f
1 changed files with 45 additions and 37 deletions

View File

@ -31,6 +31,7 @@ using OpenSim.Region.Environment.Interfaces;
using OpenSim.Region.Environment.Modules.World.Serialiser; using OpenSim.Region.Environment.Modules.World.Serialiser;
using OpenSim.Region.Environment.Modules.World.Terrain; using OpenSim.Region.Environment.Modules.World.Terrain;
using OpenSim.Region.Environment.Scenes; using OpenSim.Region.Environment.Scenes;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Reflection; using System.Reflection;
//using System.Text; //using System.Text;
@ -205,48 +206,55 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
m_log.DebugFormat( m_log.DebugFormat(
"[ARCHIVER]: Getting part {0}, {1} for object {2}", part.Name, part.UUID, sceneObject.UUID); "[ARCHIVER]: Getting part {0}, {1} for object {2}", part.Name, part.UUID, sceneObject.UUID);
LLObject.TextureEntry textureEntry = part.Shape.Textures; try
// Get the prim's default texture. This will be used for faces which don't have their own texture
assetUuids[textureEntry.DefaultTexture.TextureID] = 1;
// XXX: Not a great way to iterate through face textures, but there's no
// other method available to tell how many faces there actually are
int i = 0;
foreach (LLObject.TextureEntryFace texture in textureEntry.FaceTextures)
{ {
if (texture != null) LLObject.TextureEntry textureEntry = part.Shape.Textures;
// Get the prim's default texture. This will be used for faces which don't have their own texture
assetUuids[textureEntry.DefaultTexture.TextureID] = 1;
// XXX: Not a great way to iterate through face textures, but there's no
// other method available to tell how many faces there actually are
int i = 0;
foreach (LLObject.TextureEntryFace texture in textureEntry.FaceTextures)
{ {
m_log.DebugFormat("[ARCHIVER]: Got face {0}", i++); if (texture != null)
assetUuids[texture.TextureID] = 1; {
m_log.DebugFormat("[ARCHIVER]: Got face {0}", i++);
assetUuids[texture.TextureID] = 1;
}
}
foreach (TaskInventoryItem tii in part.TaskInventory.Values)
{
m_log.DebugFormat("[ARCHIVER]: Analysing item asset type {0}", tii.Type);
if (!assetUuids.ContainsKey(tii.AssetID))
{
assetUuids[tii.AssetID] = 1;
if ((int)AssetType.Bodypart == tii.Type || ((int)AssetType.Clothing == tii.Type))
{
GetWearableAssetUuids(tii.AssetID, assetUuids);
}
else if ((int)AssetType.LSLText == tii.Type)
{
GetScriptAssetUuids(tii.AssetID, assetUuids);
}
else if ((int)AssetType.Object == tii.Type)
{
GetSceneObjectAssetUuids(tii.AssetID, assetUuids);
}
else
{
m_log.DebugFormat("[ARCHIVER]: Recording asset {0} in object {1}", tii.AssetID, part.UUID);
}
}
} }
} }
catch (Exception e)
foreach (TaskInventoryItem tii in part.TaskInventory.Values)
{ {
m_log.DebugFormat("[ARCHIVER]: Analysing item asset type {0}", tii.Type); m_log.ErrorFormat("[ARCHIVER]: Failed to get part - {0}", e);
if (!assetUuids.ContainsKey(tii.AssetID))
{
assetUuids[tii.AssetID] = 1;
if ((int)AssetType.Bodypart == tii.Type || ((int)AssetType.Clothing == tii.Type))
{
GetWearableAssetUuids(tii.AssetID, assetUuids);
}
else if ((int)AssetType.LSLText == tii.Type)
{
GetScriptAssetUuids(tii.AssetID, assetUuids);
}
else if ((int)AssetType.Object == tii.Type)
{
GetSceneObjectAssetUuids(tii.AssetID, assetUuids);
}
else
{
m_log.DebugFormat("[ARCHIVER]: Recording asset {0} in object {1}", tii.AssetID, part.UUID);
}
}
} }
} }
} }