aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Communications/Cache/AssetCache.cs
diff options
context:
space:
mode:
authorTeravus Ovares2008-09-06 07:52:41 +0000
committerTeravus Ovares2008-09-06 07:52:41 +0000
commit7d89e122930be39e84a6d174548fa2d12ac0484a (patch)
treee5aa5752f988a9aba2a969f49e5e208985eda80c /OpenSim/Framework/Communications/Cache/AssetCache.cs
parent* minor: speculatively try a change to bamboo.build to see if this generates ... (diff)
downloadopensim-SC-7d89e122930be39e84a6d174548fa2d12ac0484a.zip
opensim-SC-7d89e122930be39e84a6d174548fa2d12ac0484a.tar.gz
opensim-SC-7d89e122930be39e84a6d174548fa2d12ac0484a.tar.bz2
opensim-SC-7d89e122930be39e84a6d174548fa2d12ac0484a.tar.xz
* This is the fabled LibOMV update with all of the libOMV types from JHurliman
* This is a HUGE OMG update and will definitely have unknown side effects.. so this is really only for the strong hearted at this point. Regular people should let the dust settle. * This has been tested to work with most basic functions. However.. make sure you back up 'everything' before using this. It's that big! * Essentially we're back at square 1 in the testing phase.. so lets identify things that broke.
Diffstat (limited to 'OpenSim/Framework/Communications/Cache/AssetCache.cs')
-rw-r--r--OpenSim/Framework/Communications/Cache/AssetCache.cs52
1 files changed, 26 insertions, 26 deletions
diff --git a/OpenSim/Framework/Communications/Cache/AssetCache.cs b/OpenSim/Framework/Communications/Cache/AssetCache.cs
index e924b3f..3e88eba 100644
--- a/OpenSim/Framework/Communications/Cache/AssetCache.cs
+++ b/OpenSim/Framework/Communications/Cache/AssetCache.cs
@@ -29,14 +29,14 @@ using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Reflection; 30using System.Reflection;
31using System.Threading; 31using System.Threading;
32using libsecondlife; 32using OpenMetaverse;
33using libsecondlife.Packets; 33using OpenMetaverse.Packets;
34using log4net; 34using log4net;
35using OpenSim.Framework.Statistics; 35using OpenSim.Framework.Statistics;
36 36
37namespace OpenSim.Framework.Communications.Cache 37namespace OpenSim.Framework.Communications.Cache
38{ 38{
39 public delegate void AssetRequestCallback(LLUUID assetID, AssetBase asset); 39 public delegate void AssetRequestCallback(UUID assetID, AssetBase asset);
40 40
41 /// <summary> 41 /// <summary>
42 /// Manages local cache of assets and their sending to viewers. 42 /// Manages local cache of assets and their sending to viewers.
@@ -58,17 +58,17 @@ namespace OpenSim.Framework.Communications.Cache
58 /// <summary> 58 /// <summary>
59 /// The cache of assets. This does not include textures. 59 /// The cache of assets. This does not include textures.
60 /// </summary> 60 /// </summary>
61 private Dictionary<LLUUID, AssetInfo> Assets; 61 private Dictionary<UUID, AssetInfo> Assets;
62 62
63 /// <summary> 63 /// <summary>
64 /// The cache of textures. 64 /// The cache of textures.
65 /// </summary> 65 /// </summary>
66 private Dictionary<LLUUID, TextureImage> Textures; 66 private Dictionary<UUID, TextureImage> Textures;
67 67
68 /// <summary> 68 /// <summary>
69 /// Assets requests which are waiting for asset server data. This includes texture requests 69 /// Assets requests which are waiting for asset server data. This includes texture requests
70 /// </summary> 70 /// </summary>
71 private Dictionary<LLUUID, AssetRequest> RequestedAssets; 71 private Dictionary<UUID, AssetRequest> RequestedAssets;
72 72
73 /// <summary> 73 /// <summary>
74 /// Asset requests with data which are ready to be sent back to requesters. This includes textures. 74 /// Asset requests with data which are ready to be sent back to requesters. This includes textures.
@@ -78,7 +78,7 @@ namespace OpenSim.Framework.Communications.Cache
78 /// <summary> 78 /// <summary>
79 /// Until the asset request is fulfilled, each asset request is associated with a list of requesters 79 /// Until the asset request is fulfilled, each asset request is associated with a list of requesters
80 /// </summary> 80 /// </summary>
81 private Dictionary<LLUUID, AssetRequestsList> RequestLists; 81 private Dictionary<UUID, AssetRequestsList> RequestLists;
82 82
83 private readonly IAssetServer m_assetServer; 83 private readonly IAssetServer m_assetServer;
84 84
@@ -155,12 +155,12 @@ namespace OpenSim.Framework.Communications.Cache
155 /// </summary> 155 /// </summary>
156 private void Initialize() 156 private void Initialize()
157 { 157 {
158 Assets = new Dictionary<LLUUID, AssetInfo>(); 158 Assets = new Dictionary<UUID, AssetInfo>();
159 Textures = new Dictionary<LLUUID, TextureImage>(); 159 Textures = new Dictionary<UUID, TextureImage>();
160 AssetRequests = new List<AssetRequest>(); 160 AssetRequests = new List<AssetRequest>();
161 161
162 RequestedAssets = new Dictionary<LLUUID, AssetRequest>(); 162 RequestedAssets = new Dictionary<UUID, AssetRequest>();
163 RequestLists = new Dictionary<LLUUID, AssetRequestsList>(); 163 RequestLists = new Dictionary<UUID, AssetRequestsList>();
164 } 164 }
165 165
166 /// <summary> 166 /// <summary>
@@ -207,7 +207,7 @@ namespace OpenSim.Framework.Communications.Cache
207 /// </summary> 207 /// </summary>
208 /// <param name="assetId"></param></param> 208 /// <param name="assetId"></param></param>
209 /// <returns></returns> 209 /// <returns></returns>
210 //private AssetBase GetCachedAsset(LLUUID assetId) 210 //private AssetBase GetCachedAsset(UUID assetId)
211 //{ 211 //{
212 // AssetBase asset = null; 212 // AssetBase asset = null;
213 213
@@ -223,7 +223,7 @@ namespace OpenSim.Framework.Communications.Cache
223 // return asset; 223 // return asset;
224 //} 224 //}
225 225
226 private bool TryGetCachedAsset(LLUUID assetId, out AssetBase asset) 226 private bool TryGetCachedAsset(UUID assetId, out AssetBase asset)
227 { 227 {
228 if (Textures.ContainsKey(assetId)) 228 if (Textures.ContainsKey(assetId))
229 { 229 {
@@ -248,7 +248,7 @@ namespace OpenSim.Framework.Communications.Cache
248 /// A callback invoked when the asset has either been found or not found. 248 /// A callback invoked when the asset has either been found or not found.
249 /// If the asset was found this is called with the asset UUID and the asset data 249 /// If the asset was found this is called with the asset UUID and the asset data
250 /// If the asset was not found this is still called with the asset UUID but with a null asset data reference</param> 250 /// If the asset was not found this is still called with the asset UUID but with a null asset data reference</param>
251 public void GetAsset(LLUUID assetId, AssetRequestCallback callback, bool isTexture) 251 public void GetAsset(UUID assetId, AssetRequestCallback callback, bool isTexture)
252 { 252 {
253 //m_log.DebugFormat("[ASSET CACHE]: Requesting {0} {1}", isTexture ? "texture" : "asset", assetId); 253 //m_log.DebugFormat("[ASSET CACHE]: Requesting {0} {1}", isTexture ? "texture" : "asset", assetId);
254 254
@@ -308,7 +308,7 @@ namespace OpenSim.Framework.Communications.Cache
308 /// <param name="assetID"></param> 308 /// <param name="assetID"></param>
309 /// <param name="isTexture"></param> 309 /// <param name="isTexture"></param>
310 /// <returns>null if the asset could not be retrieved</returns> 310 /// <returns>null if the asset could not be retrieved</returns>
311 public AssetBase GetAsset(LLUUID assetID, bool isTexture) 311 public AssetBase GetAsset(UUID assetID, bool isTexture)
312 { 312 {
313 // I'm not going over 3 seconds since this will be blocking processing of all the other inbound 313 // I'm not going over 3 seconds since this will be blocking processing of all the other inbound
314 // packets from the client. 314 // packets from the client.
@@ -390,7 +390,7 @@ namespace OpenSim.Framework.Communications.Cache
390 /// this is a stop gap measure until we have such a thing. 390 /// this is a stop gap measure until we have such a thing.
391 /// </summary> 391 /// </summary>
392 392
393 public void ExpireAsset(LLUUID uuid) 393 public void ExpireAsset(UUID uuid)
394 { 394 {
395 // uuid is unique, so no need to worry about it showing up 395 // uuid is unique, so no need to worry about it showing up
396 // in the 2 caches differently. Also, locks are probably 396 // in the 2 caches differently. Also, locks are probably
@@ -495,7 +495,7 @@ namespace OpenSim.Framework.Communications.Cache
495 } 495 }
496 496
497 // See IAssetReceiver 497 // See IAssetReceiver
498 public void AssetNotFound(LLUUID assetID, bool IsTexture) 498 public void AssetNotFound(UUID assetID, bool IsTexture)
499 { 499 {
500 //m_log.WarnFormat("[ASSET CACHE]: AssetNotFound for {0}", assetID); 500 //m_log.WarnFormat("[ASSET CACHE]: AssetNotFound for {0}", assetID);
501 501
@@ -567,17 +567,17 @@ namespace OpenSim.Framework.Communications.Cache
567 /// <param name="transferRequest"></param> 567 /// <param name="transferRequest"></param>
568 public void AddAssetRequest(IClientAPI userInfo, TransferRequestPacket transferRequest) 568 public void AddAssetRequest(IClientAPI userInfo, TransferRequestPacket transferRequest)
569 { 569 {
570 LLUUID requestID = null; 570 UUID requestID = null;
571 byte source = 2; 571 byte source = 2;
572 if (transferRequest.TransferInfo.SourceType == 2) 572 if (transferRequest.TransferInfo.SourceType == 2)
573 { 573 {
574 //direct asset request 574 //direct asset request
575 requestID = new LLUUID(transferRequest.TransferInfo.Params, 0); 575 requestID = new UUID(transferRequest.TransferInfo.Params, 0);
576 } 576 }
577 else if (transferRequest.TransferInfo.SourceType == 3) 577 else if (transferRequest.TransferInfo.SourceType == 3)
578 { 578 {
579 //inventory asset request 579 //inventory asset request
580 requestID = new LLUUID(transferRequest.TransferInfo.Params, 80); 580 requestID = new UUID(transferRequest.TransferInfo.Params, 80);
581 source = 3; 581 source = 3;
582 //Console.WriteLine("asset request " + requestID); 582 //Console.WriteLine("asset request " + requestID);
583 } 583 }
@@ -678,10 +678,10 @@ namespace OpenSim.Framework.Communications.Cache
678 public class AssetRequest 678 public class AssetRequest
679 { 679 {
680 public IClientAPI RequestUser; 680 public IClientAPI RequestUser;
681 public LLUUID RequestAssetID; 681 public UUID RequestAssetID;
682 public AssetInfo AssetInf; 682 public AssetInfo AssetInf;
683 public TextureImage ImageInfo; 683 public TextureImage ImageInfo;
684 public LLUUID TransferRequestID; 684 public UUID TransferRequestID;
685 public long DataPointer = 0; 685 public long DataPointer = 0;
686 public int NumPackets = 0; 686 public int NumPackets = 0;
687 public int PacketCounter = 0; 687 public int PacketCounter = 0;
@@ -731,10 +731,10 @@ namespace OpenSim.Framework.Communications.Cache
731 731
732 public class AssetRequestsList 732 public class AssetRequestsList
733 { 733 {
734 public LLUUID AssetID; 734 public UUID AssetID;
735 public List<NewAssetRequest> Requests = new List<NewAssetRequest>(); 735 public List<NewAssetRequest> Requests = new List<NewAssetRequest>();
736 736
737 public AssetRequestsList(LLUUID assetID) 737 public AssetRequestsList(UUID assetID)
738 { 738 {
739 AssetID = assetID; 739 AssetID = assetID;
740 } 740 }
@@ -742,10 +742,10 @@ namespace OpenSim.Framework.Communications.Cache
742 742
743 public class NewAssetRequest 743 public class NewAssetRequest
744 { 744 {
745 public LLUUID AssetID; 745 public UUID AssetID;
746 public AssetRequestCallback Callback; 746 public AssetRequestCallback Callback;
747 747
748 public NewAssetRequest(LLUUID assetID, AssetRequestCallback callback) 748 public NewAssetRequest(UUID assetID, AssetRequestCallback callback)
749 { 749 {
750 AssetID = assetID; 750 AssetID = assetID;
751 Callback = callback; 751 Callback = callback;