From e9153e1d1aae50024d8cd05fe14a9bce34343a0e Mon Sep 17 00:00:00 2001 From: teravus Date: Thu, 15 Nov 2012 10:05:16 -0500 Subject: Revert "Merge master into teravuswork", it should have been avination, not master. This reverts commit dfac269032300872c4d0dc507f4f9062d102b0f4, reversing changes made to 619c39e5144f15aca129d6d999bcc5c34133ee64. --- OpenSim/Services/AssetService/AssetService.cs | 17 +++++++++++++++-- OpenSim/Services/AssetService/AssetServiceBase.cs | 4 ++-- OpenSim/Services/AssetService/XAssetService.cs | 18 ++++++++++++++++-- 3 files changed, 33 insertions(+), 6 deletions(-) (limited to 'OpenSim/Services/AssetService') diff --git a/OpenSim/Services/AssetService/AssetService.cs b/OpenSim/Services/AssetService/AssetService.cs index f1bffa4..96b430d 100644 --- a/OpenSim/Services/AssetService/AssetService.cs +++ b/OpenSim/Services/AssetService/AssetService.cs @@ -70,7 +70,7 @@ namespace OpenSim.Services.AssetService if (assetLoaderEnabled) { - m_log.DebugFormat("[ASSET SERVICE]: Loading default asset set from {0}", loaderArgs); + m_log.DebugFormat("[ASSET]: Loading default asset set from {0}", loaderArgs); m_AssetLoader.ForEachDefaultXmlAsset( loaderArgs, @@ -200,7 +200,20 @@ namespace OpenSim.Services.AssetService if (!UUID.TryParse(id, out assetID)) return false; - return m_Database.Delete(id); + AssetBase asset = m_Database.GetAsset(assetID); + if (asset == null) + return false; + + if ((int)(asset.Flags & AssetFlags.Maptile) != 0) + { + return m_Database.Delete(id); + } + else + { + m_log.DebugFormat("[ASSET SERVICE]: Request to delete asset {0}, but flags are not Maptile", id); + } + + return false; } } } \ No newline at end of file diff --git a/OpenSim/Services/AssetService/AssetServiceBase.cs b/OpenSim/Services/AssetService/AssetServiceBase.cs index 58ab052..177c565 100644 --- a/OpenSim/Services/AssetService/AssetServiceBase.cs +++ b/OpenSim/Services/AssetService/AssetServiceBase.cs @@ -84,7 +84,7 @@ namespace OpenSim.Services.AssetService m_Database = LoadPlugin(dllName); if (m_Database == null) - throw new Exception(string.Format("Could not find a storage interface in the module {0}", dllName)); + throw new Exception("Could not find a storage interface in the given module"); m_Database.Initialise(connString); @@ -96,7 +96,7 @@ namespace OpenSim.Services.AssetService m_AssetLoader = LoadPlugin(loaderName); if (m_AssetLoader == null) - throw new Exception(string.Format("Asset loader could not be loaded from {0}", loaderName)); + throw new Exception("Asset loader could not be loaded"); } } } diff --git a/OpenSim/Services/AssetService/XAssetService.cs b/OpenSim/Services/AssetService/XAssetService.cs index a1d10ed..e62bcb5 100644 --- a/OpenSim/Services/AssetService/XAssetService.cs +++ b/OpenSim/Services/AssetService/XAssetService.cs @@ -194,7 +194,21 @@ namespace OpenSim.Services.AssetService if (!UUID.TryParse(id, out assetID)) return false; - return m_Database.Delete(id); + AssetBase asset = m_Database.GetAsset(assetID); + if (asset == null) + return false; + + if ((int)(asset.Flags & AssetFlags.Maptile) != 0) + { + return m_Database.Delete(id); + } + else + { + m_log.DebugFormat("[XASSET SERVICE]: Request to delete asset {0}, but flags are not Maptile", id); + } + + return false; } } -} \ No newline at end of file +} + -- cgit v1.1