mirror of
https://github.com/opensim/opensim.git
synced 2026-08-01 06:06:06 +08:00
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.
This commit is contained in:
@@ -404,6 +404,12 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||
string extension = filename.Substring(i);
|
||||
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))
|
||||
{
|
||||
sbyte assetType = ArchiveConstants.EXTENSION_TO_ASSET_TYPE[extension];
|
||||
|
||||
Reference in New Issue
Block a user