Add a check to see if an asset exists before recreating it while
loading an archive. This does add an extra roundtrip to the asset server if loading new assets but it protects against overwriting (and potentially corrupting) existing assets.iar_mods
parent
53fb20880c
commit
5f7e392c7c
|
@ -404,6 +404,12 @@ namespace OpenSim.Region.CoreModules.World.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 (m_scene.AssetService.GetMetadata(uuid) != null)
|
||||||
|
{
|
||||||
|
// m_log.DebugFormat("[ARCHIVER]: found existing asset {0}",uuid);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (ArchiveConstants.EXTENSION_TO_ASSET_TYPE.ContainsKey(extension))
|
if (ArchiveConstants.EXTENSION_TO_ASSET_TYPE.ContainsKey(extension))
|
||||||
{
|
{
|
||||||
sbyte assetType = ArchiveConstants.EXTENSION_TO_ASSET_TYPE[extension];
|
sbyte assetType = ArchiveConstants.EXTENSION_TO_ASSET_TYPE[extension];
|
||||||
|
|
Loading…
Reference in New Issue