* Minor fixes, inverted an if for readability and introduced a virtual pre-process step on the asset cache
parent
de3971a8d3
commit
3ca1481c3d
|
@ -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 it's a direct request for a script, drop it
|
|
||||||
// because it's a hacked client
|
if (req.AssetRequestSource == 2 && assetInf.Type == 10)
|
||||||
if (req.AssetRequestSource != 2 || assetInf.Type != 10)
|
{
|
||||||
lock(AssetRequests) AssetRequests.Add(req);
|
// If it's a direct request for a script, drop it
|
||||||
|
// because it's a hacked client
|
||||||
|
}
|
||||||
|
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)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue