From b0c5ef0b68c8664d250d0b0c0c5c1ddb7eab3acf Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Wed, 20 Feb 2008 23:21:51 +0000 Subject: * Eliminate AssetCache.CopyAsset() * Resolve a bad logic bug in AssetCache.GetAsset() * This may make some asset related things work better (possibly getting main map images will now be improved). --- .../Framework/Communications/Cache/AssetCache.cs | 30 +++------------------- 1 file changed, 4 insertions(+), 26 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Communications/Cache/AssetCache.cs b/OpenSim/Framework/Communications/Cache/AssetCache.cs index 5e6bd5f..8f8e362 100644 --- a/OpenSim/Framework/Communications/Cache/AssetCache.cs +++ b/OpenSim/Framework/Communications/Cache/AssetCache.cs @@ -299,6 +299,10 @@ namespace OpenSim.Framework.Communications.Cache if (TryGetCachedAsset(assetID, out asset)) { + return asset; + } + else + { m_assetServer.RequestAsset(assetID, isTexture); do @@ -316,10 +320,6 @@ namespace OpenSim.Framework.Communications.Cache return null; } - else - { - return asset; - } } /// @@ -387,28 +387,6 @@ namespace OpenSim.Framework.Communications.Cache m_log.DebugFormat("[ASSET CACHE]: Adding {0} {1} [{2}]: {3}.", temporary, type, asset.FullID, result); } - /// - /// Copy an asset and add it to the cache with a new assetID. - /// XXX We shouldn't actually ever need to do this! - /// - /// - /// - public AssetBase CopyAsset(LLUUID assetID) - { - AssetBase asset; - - if (TryGetCachedAsset(assetID, out asset)) - { - asset.FullID = LLUUID.Random(); // TODO: check for conflicts - AddAsset(asset); - return asset; - } - else - { - return null; - } - } - // See IAssetReceiver public void AssetReceived(AssetBase asset, bool IsTexture) { -- cgit v1.1