* 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).
This commit is contained in:
Justin Clarke Casey
2008-02-20 23:21:51 +00:00
parent 5f7a02fce9
commit b0c5ef0b68
2 changed files with 30 additions and 58 deletions

View File

@@ -298,6 +298,10 @@ namespace OpenSim.Framework.Communications.Cache
AssetBase asset;
if (TryGetCachedAsset(assetID, out asset))
{
return asset;
}
else
{
m_assetServer.RequestAsset(assetID, isTexture);
@@ -316,10 +320,6 @@ namespace OpenSim.Framework.Communications.Cache
return null;
}
else
{
return asset;
}
}
/// <summary>
@@ -387,28 +387,6 @@ namespace OpenSim.Framework.Communications.Cache
m_log.DebugFormat("[ASSET CACHE]: Adding {0} {1} [{2}]: {3}.", temporary, type, asset.FullID, result);
}
/// <summary>
/// Copy an asset and add it to the cache with a new assetID.
/// XXX We shouldn't actually ever need to do this!
/// </summary>
/// <param name="assetID"></param>
/// <returns></returns>
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)
{