aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Communications/Cache/AssetCache.cs
diff options
context:
space:
mode:
authorlbsa712009-03-26 06:56:10 +0000
committerlbsa712009-03-26 06:56:10 +0000
commit3ca1481c3da08f7da68ec9a1007587389e10d37f (patch)
tree8c069af1e9510f44a4080e3dbce0a76f1f14cfe5 /OpenSim/Framework/Communications/Cache/AssetCache.cs
parentOne more -- CopyItem. (diff)
downloadopensim-SC-3ca1481c3da08f7da68ec9a1007587389e10d37f.zip
opensim-SC-3ca1481c3da08f7da68ec9a1007587389e10d37f.tar.gz
opensim-SC-3ca1481c3da08f7da68ec9a1007587389e10d37f.tar.bz2
opensim-SC-3ca1481c3da08f7da68ec9a1007587389e10d37f.tar.xz
* Minor fixes, inverted an if for readability and introduced a virtual pre-process step on the asset cache
Diffstat (limited to 'OpenSim/Framework/Communications/Cache/AssetCache.cs')
-rw-r--r--OpenSim/Framework/Communications/Cache/AssetCache.cs24
1 files changed, 20 insertions, 4 deletions
diff --git a/OpenSim/Framework/Communications/Cache/AssetCache.cs b/OpenSim/Framework/Communications/Cache/AssetCache.cs
index bd0b1b1..d79645e 100644
--- a/OpenSim/Framework/Communications/Cache/AssetCache.cs
+++ b/OpenSim/Framework/Communications/Cache/AssetCache.cs
@@ -333,6 +333,9 @@ namespace OpenSim.Framework.Communications.Cache
333 public virtual void AssetReceived(AssetBase asset, bool IsTexture) 333 public virtual void AssetReceived(AssetBase asset, bool IsTexture)
334 { 334 {
335 AssetInfo assetInf = new AssetInfo(asset); 335 AssetInfo assetInf = new AssetInfo(asset);
336
337 ProcessRecievedAsset(IsTexture, assetInf);
338
336 if (!m_memcache.Contains(assetInf.FullID)) 339 if (!m_memcache.Contains(assetInf.FullID))
337 { 340 {
338 m_memcache.AddOrUpdate(assetInf.FullID, assetInf, TimeSpan.FromHours(24)); 341 m_memcache.AddOrUpdate(assetInf.FullID, assetInf, TimeSpan.FromHours(24));
@@ -347,10 +350,19 @@ namespace OpenSim.Framework.Communications.Cache
347 req.NumPackets = CalculateNumPackets(assetInf.Data); 350 req.NumPackets = CalculateNumPackets(assetInf.Data);
348 351
349 RequestedAssets.Remove(assetInf.FullID); 352 RequestedAssets.Remove(assetInf.FullID);
350 // If it's a direct request for a script, drop it 353
351 // because it's a hacked client 354 if (req.AssetRequestSource == 2 && assetInf.Type == 10)
352 if (req.AssetRequestSource != 2 || assetInf.Type != 10) 355 {
353 lock(AssetRequests) AssetRequests.Add(req); 356 // If it's a direct request for a script, drop it
357 // because it's a hacked client
358 }
359 else
360 {
361 lock (AssetRequests)
362 {
363 AssetRequests.Add(req);
364 }
365 }
354 } 366 }
355 } 367 }
356 368
@@ -377,6 +389,10 @@ namespace OpenSim.Framework.Communications.Cache
377 } 389 }
378 } 390 }
379 391
392 protected void ProcessRecievedAsset(bool IsTexture, AssetInfo assetInf)
393 {
394 }
395
380 // See IAssetReceiver 396 // See IAssetReceiver
381 public virtual void AssetNotFound(UUID assetID, bool IsTexture) 397 public virtual void AssetNotFound(UUID assetID, bool IsTexture)
382 { 398 {