* 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).ThreadPoolClientBranch
parent
5f7a02fce9
commit
b0c5ef0b68
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -317,18 +317,11 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
AssetBase asset = AssetCache.CopyAsset(item.assetID);
|
||||
if (asset == null)
|
||||
{
|
||||
m_log.Warn("[AGENTINVENTORY]: Failed to find asset " + item.assetID.ToString());
|
||||
return;
|
||||
}
|
||||
|
||||
asset.Name = (newName.Length == 0) ? item.inventoryName : newName;
|
||||
|
||||
// TODO: preserve current permissions?
|
||||
CreateNewInventoryItem(remoteClient, newFolderID, callbackID, asset, item.inventoryNextPermissions);
|
||||
CreateNewInventoryItem(
|
||||
remoteClient, newFolderID, callbackID,
|
||||
AssetCache.GetAsset(item.assetID, (item.assetType == (int)AssetType.Texture ? true : false)),
|
||||
item.inventoryNextPermissions);
|
||||
}
|
||||
|
||||
private AssetBase CreateAsset(string name, string description, sbyte invType, sbyte assetType, byte[] data)
|
||||
|
@ -824,6 +817,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void RezSingleAttachment(IClientAPI remoteClient, LLUUID itemID, uint AttachmentPt,
|
||||
uint ItemFlags, uint NextOwnerMask)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue