* Minor fixes, inverted an if for readability and introduced a virtual pre-process step on the asset cache

0.6.5-rc1
lbsa71 2009-03-26 06:56:10 +00:00
parent de3971a8d3
commit 3ca1481c3d
1 changed files with 20 additions and 4 deletions

View File

@ -333,6 +333,9 @@ namespace OpenSim.Framework.Communications.Cache
public virtual void AssetReceived(AssetBase asset, bool IsTexture) public virtual void AssetReceived(AssetBase asset, bool IsTexture)
{ {
AssetInfo assetInf = new AssetInfo(asset); AssetInfo assetInf = new AssetInfo(asset);
ProcessRecievedAsset(IsTexture, assetInf);
if (!m_memcache.Contains(assetInf.FullID)) if (!m_memcache.Contains(assetInf.FullID))
{ {
m_memcache.AddOrUpdate(assetInf.FullID, assetInf, TimeSpan.FromHours(24)); m_memcache.AddOrUpdate(assetInf.FullID, assetInf, TimeSpan.FromHours(24));
@ -347,10 +350,19 @@ namespace OpenSim.Framework.Communications.Cache
req.NumPackets = CalculateNumPackets(assetInf.Data); req.NumPackets = CalculateNumPackets(assetInf.Data);
RequestedAssets.Remove(assetInf.FullID); RequestedAssets.Remove(assetInf.FullID);
if (req.AssetRequestSource == 2 && assetInf.Type == 10)
{
// If it's a direct request for a script, drop it // If it's a direct request for a script, drop it
// because it's a hacked client // because it's a hacked client
if (req.AssetRequestSource != 2 || assetInf.Type != 10) }
lock(AssetRequests) AssetRequests.Add(req); else
{
lock (AssetRequests)
{
AssetRequests.Add(req);
}
}
} }
} }
@ -377,6 +389,10 @@ namespace OpenSim.Framework.Communications.Cache
} }
} }
protected void ProcessRecievedAsset(bool IsTexture, AssetInfo assetInf)
{
}
// See IAssetReceiver // See IAssetReceiver
public virtual void AssetNotFound(UUID assetID, bool IsTexture) public virtual void AssetNotFound(UUID assetID, bool IsTexture)
{ {