From 60357d3778c95a47481f790803b7af39c70cde9c Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 9 May 2010 17:56:52 +0100 Subject: Implement the "delete" path for assets. Adds a new option to allow remote asset deletion in robust handler. --- OpenSim/Services/AssetService/AssetService.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'OpenSim/Services/AssetService') diff --git a/OpenSim/Services/AssetService/AssetService.cs b/OpenSim/Services/AssetService/AssetService.cs index 2114933..4fc38f3 100644 --- a/OpenSim/Services/AssetService/AssetService.cs +++ b/OpenSim/Services/AssetService/AssetService.cs @@ -156,6 +156,17 @@ namespace OpenSim.Services.AssetService public bool Delete(string id) { + UUID assetID; + if (!UUID.TryParse(id, out assetID)) + return false; + + AssetBase asset = m_Database.GetAsset(assetID); + if (asset == null) + return false; + + if ((int)(asset.Flags & AssetFlags.Maptile) != 0) + return m_Database.Delete(id); + return false; } -- cgit v1.1