mirror of
https://github.com/opensim/opensim.git
synced 2026-08-10 19:36:07 +08:00
* 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:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user