aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
authorMW2008-02-27 21:11:01 +0000
committerMW2008-02-27 21:11:01 +0000
commite978d00914a25c12cc03efd597125e2948526681 (patch)
treeaec69b83655fa054c364443a9163b95163f41cb3 /OpenSim/Framework
parent* Turned Friends Module into a shared module (to comply with Scene.AddXmlRPCH... (diff)
downloadopensim-SC_OLD-e978d00914a25c12cc03efd597125e2948526681.zip
opensim-SC_OLD-e978d00914a25c12cc03efd597125e2948526681.tar.gz
opensim-SC_OLD-e978d00914a25c12cc03efd597125e2948526681.tar.bz2
opensim-SC_OLD-e978d00914a25c12cc03efd597125e2948526681.tar.xz
After seeing sdague do his happy dance over trunk working "the best he has ever seen". I'm not sure I should be doing this commit, but oh well.
So anyway, it moves the Asset downloading (packet sending) to a module (AssetDownloadModule). So now at last, AssetCache should be just dealing with fetching assets from the asset server and caching them.
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/Communications/Cache/AssetCache.cs35
-rw-r--r--OpenSim/Framework/IClientAPI.cs3
2 files changed, 21 insertions, 17 deletions
diff --git a/OpenSim/Framework/Communications/Cache/AssetCache.cs b/OpenSim/Framework/Communications/Cache/AssetCache.cs
index 061b857..abb7ce1 100644
--- a/OpenSim/Framework/Communications/Cache/AssetCache.cs
+++ b/OpenSim/Framework/Communications/Cache/AssetCache.cs
@@ -69,12 +69,12 @@ namespace OpenSim.Framework.Communications.Cache
69 /// 69 ///
70 /// Assets requests which are waiting for asset server data. This includes texture requests 70 /// Assets requests which are waiting for asset server data. This includes texture requests
71 /// </summary> 71 /// </summary>
72 private Dictionary<LLUUID, AssetRequest> RequestedAssets; 72 // private Dictionary<LLUUID, AssetRequest> RequestedAssets;
73 73
74 /// <summary> 74 /// <summary>
75 /// Asset requests with data which are ready to be sent back to requesters. This includes textures. 75 /// Asset requests with data which are ready to be sent back to requesters. This includes textures.
76 /// </summary> 76 /// </summary>
77 private List<AssetRequest> AssetRequests; 77 // private List<AssetRequest> AssetRequests;
78 78
79 79
80 /// <summary> 80 /// <summary>
@@ -84,7 +84,7 @@ namespace OpenSim.Framework.Communications.Cache
84 84
85 private readonly IAssetServer m_assetServer; 85 private readonly IAssetServer m_assetServer;
86 86
87 private readonly Thread m_assetCacheThread; 87 // private readonly Thread m_assetCacheThread;
88 88
89 /// <summary> 89 /// <summary>
90 /// Report statistical data. 90 /// Report statistical data.
@@ -94,8 +94,8 @@ namespace OpenSim.Framework.Communications.Cache
94 m_log.InfoFormat("Assets:{0} Textures:{1} AssetRequests:{2} RequestedAssets:{3} RequestLists:{4}", 94 m_log.InfoFormat("Assets:{0} Textures:{1} AssetRequests:{2} RequestedAssets:{3} RequestLists:{4}",
95 Assets.Count, 95 Assets.Count,
96 Textures.Count, 96 Textures.Count,
97 AssetRequests.Count, 97 // AssetRequests.Count,
98 RequestedAssets.Count, 98 // RequestedAssets.Count,
99 RequestLists.Count); 99 RequestLists.Count);
100 100
101 int temporaryImages = 0; 101 int temporaryImages = 0;
@@ -150,9 +150,9 @@ namespace OpenSim.Framework.Communications.Cache
150 { 150 {
151 Assets = new Dictionary<LLUUID, AssetInfo>(); 151 Assets = new Dictionary<LLUUID, AssetInfo>();
152 Textures = new Dictionary<LLUUID, TextureImage>(); 152 Textures = new Dictionary<LLUUID, TextureImage>();
153 AssetRequests = new List<AssetRequest>(); 153 // AssetRequests = new List<AssetRequest>();
154 154
155 RequestedAssets = new Dictionary<LLUUID, AssetRequest>(); 155 // RequestedAssets = new Dictionary<LLUUID, AssetRequest>();
156 RequestLists = new Dictionary<LLUUID, AssetRequestsList>(); 156 RequestLists = new Dictionary<LLUUID, AssetRequestsList>();
157 } 157 }
158 158
@@ -168,18 +168,18 @@ namespace OpenSim.Framework.Communications.Cache
168 m_assetServer = assetServer; 168 m_assetServer = assetServer;
169 m_assetServer.SetReceiver(this); 169 m_assetServer.SetReceiver(this);
170 170
171 m_assetCacheThread = new Thread(new ThreadStart(RunAssetManager)); 171 // m_assetCacheThread = new Thread(new ThreadStart(RunAssetManager));
172 m_assetCacheThread.Name = "AssetCacheThread"; 172 // m_assetCacheThread.Name = "AssetCacheThread";
173 m_assetCacheThread.IsBackground = true; 173 // m_assetCacheThread.IsBackground = true;
174 m_assetCacheThread.Start(); 174 // m_assetCacheThread.Start();
175 OpenSim.Framework.ThreadTracker.Add(m_assetCacheThread); 175 // OpenSim.Framework.ThreadTracker.Add(m_assetCacheThread);
176 } 176 }
177 177
178 /// <summary> 178 /// <summary>
179 /// Process the asset queue which holds data which is packeted up and sent 179 /// Process the asset queue which holds data which is packeted up and sent
180 /// directly back to the client. 180 /// directly back to the client.
181 /// </summary> 181 /// </summary>
182 public void RunAssetManager() 182 /* public void RunAssetManager()
183 { 183 {
184 while (true) 184 while (true)
185 { 185 {
@@ -193,7 +193,7 @@ namespace OpenSim.Framework.Communications.Cache
193 m_log.Error("[ASSET CACHE]: " + e.ToString()); 193 m_log.Error("[ASSET CACHE]: " + e.ToString());
194 } 194 }
195 } 195 }
196 } 196 }*/
197 197
198 /// <summary> 198 /// <summary>
199 /// Only get an asset if we already have it in the cache. 199 /// Only get an asset if we already have it in the cache.
@@ -449,7 +449,7 @@ namespace OpenSim.Framework.Communications.Cache
449 StatsManager.SimExtraStats.AddAsset(assetInf); 449 StatsManager.SimExtraStats.AddAsset(assetInf);
450 } 450 }
451 451
452 if (RequestedAssets.ContainsKey(assetInf.FullID)) 452 /* if (RequestedAssets.ContainsKey(assetInf.FullID))
453 { 453 {
454 #if DEBUG 454 #if DEBUG
455 //m_log.DebugFormat("[ASSET CACHE]: Moving {0} from RequestedAssets to AssetRequests", asset.FullID); 455 //m_log.DebugFormat("[ASSET CACHE]: Moving {0} from RequestedAssets to AssetRequests", asset.FullID);
@@ -461,7 +461,7 @@ namespace OpenSim.Framework.Communications.Cache
461 461
462 RequestedAssets.Remove(assetInf.FullID); 462 RequestedAssets.Remove(assetInf.FullID);
463 AssetRequests.Add(req); 463 AssetRequests.Add(req);
464 } 464 }*/
465 } 465 }
466 } 466 }
467 467
@@ -541,6 +541,7 @@ namespace OpenSim.Framework.Communications.Cache
541 541
542 } 542 }
543 543
544 /*
544 /// <summary> 545 /// <summary>
545 /// Calculate the number of packets required to send the asset to the client. 546 /// Calculate the number of packets required to send the asset to the client.
546 /// </summary> 547 /// </summary>
@@ -734,7 +735,7 @@ namespace OpenSim.Framework.Communications.Cache
734 { 735 {
735 } 736 }
736 } 737 }
737 738 */
738 739
739 public class AssetInfo : AssetBase 740 public class AssetInfo : AssetBase
740 { 741 {
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index 2635a23..511bbad 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -390,6 +390,8 @@ namespace OpenSim.Framework
390 public delegate void RemoveInventoryFolder( 390 public delegate void RemoveInventoryFolder(
391 IClientAPI remoteClient, LLUUID folderID); 391 IClientAPI remoteClient, LLUUID folderID);
392 392
393 public delegate void RequestAsset(IClientAPI remoteClient, TransferRequestPacket transferRequest);
394
393 public delegate void RezScript(IClientAPI remoteClient, LLUUID itemID, uint localID); 395 public delegate void RezScript(IClientAPI remoteClient, LLUUID itemID, uint localID);
394 396
395 public delegate void UpdateTaskInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID folderID, uint localID); 397 public delegate void UpdateTaskInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID folderID, uint localID);
@@ -503,6 +505,7 @@ namespace OpenSim.Framework
503 event RezScript OnRezScript; 505 event RezScript OnRezScript;
504 event UpdateTaskInventory OnUpdateTaskInventory; 506 event UpdateTaskInventory OnUpdateTaskInventory;
505 event RemoveTaskInventory OnRemoveTaskItem; 507 event RemoveTaskInventory OnRemoveTaskItem;
508 event RequestAsset OnRequestAsset;
506 509
507 event UUIDNameRequest OnNameFromUUIDRequest; 510 event UUIDNameRequest OnNameFromUUIDRequest;
508 511