aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/Agent
diff options
context:
space:
mode:
authorAdam Frisby2008-04-30 23:11:07 +0000
committerAdam Frisby2008-04-30 23:11:07 +0000
commit25a49ac4de056f43d6c5803fcd34804fcea96ae2 (patch)
tree3b3f24601da9ebdcc8818b86fe201da2c63d7dda /OpenSim/Region/Environment/Modules/Agent
parent* Fix #3 (diff)
downloadopensim-SC-25a49ac4de056f43d6c5803fcd34804fcea96ae2.zip
opensim-SC-25a49ac4de056f43d6c5803fcd34804fcea96ae2.tar.gz
opensim-SC-25a49ac4de056f43d6c5803fcd34804fcea96ae2.tar.bz2
opensim-SC-25a49ac4de056f43d6c5803fcd34804fcea96ae2.tar.xz
* Spring cleaned a bunch of '//TODO: unused' marked functions.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Modules/Agent/AssetDownload/AssetDownloadModule.cs114
1 files changed, 0 insertions, 114 deletions
diff --git a/OpenSim/Region/Environment/Modules/Agent/AssetDownload/AssetDownloadModule.cs b/OpenSim/Region/Environment/Modules/Agent/AssetDownload/AssetDownloadModule.cs
index 33e917a..c0b7380 100644
--- a/OpenSim/Region/Environment/Modules/Agent/AssetDownload/AssetDownloadModule.cs
+++ b/OpenSim/Region/Environment/Modules/Agent/AssetDownload/AssetDownloadModule.cs
@@ -178,120 +178,6 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetDownload
178 } 178 }
179 } 179 }
180 180
181// TODO: unused
182// private void RunAssetQueue()
183// {
184// while (true)
185// {
186// try
187// {
188// ProcessAssetQueue();
189// Thread.Sleep(500);
190// }
191// catch (Exception)
192// {
193// // m_log.Error("[ASSET CACHE]: " + e.ToString());
194// }
195// }
196// }
197
198// TODO: unused
199// /// <summary>
200// /// Process the asset queue which sends packets directly back to the client.
201// /// </summary>
202// private void ProcessAssetQueue()
203// {
204// //should move the asset downloading to a module, like has been done with texture downloading
205// if (AssetRequests.Count == 0)
206// {
207// //no requests waiting
208// return;
209// }
210// // if less than 5, do all of them
211// int num = Math.Min(5, AssetRequests.Count);
212
213// AssetRequest req;
214// for (int i = 0; i < num; i++)
215// {
216// req = (AssetRequest)AssetRequests[i];
217// //Console.WriteLine("sending asset " + req.RequestAssetID);
218// TransferInfoPacket Transfer = new TransferInfoPacket();
219// Transfer.TransferInfo.ChannelType = 2;
220// Transfer.TransferInfo.Status = 0;
221// Transfer.TransferInfo.TargetType = 0;
222// if (req.AssetRequestSource == 2)
223// {
224// Transfer.TransferInfo.Params = new byte[20];
225// Array.Copy(req.RequestAssetID.GetBytes(), 0, Transfer.TransferInfo.Params, 0, 16);
226// int assType = (int)req.AssetInf.Type;
227// Array.Copy(Helpers.IntToBytes(assType), 0, Transfer.TransferInfo.Params, 16, 4);
228// }
229// else if (req.AssetRequestSource == 3)
230// {
231// Transfer.TransferInfo.Params = req.Params;
232// // Transfer.TransferInfo.Params = new byte[100];
233// //Array.Copy(req.RequestUser.AgentId.GetBytes(), 0, Transfer.TransferInfo.Params, 0, 16);
234// //Array.Copy(req.RequestUser.SessionId.GetBytes(), 0, Transfer.TransferInfo.Params, 16, 16);
235// }
236// Transfer.TransferInfo.Size = (int)req.AssetInf.Data.Length;
237// Transfer.TransferInfo.TransferID = req.TransferRequestID;
238// req.RequestUser.OutPacket(Transfer, ThrottleOutPacketType.Asset);
239
240// if (req.NumPackets == 1)
241// {
242// TransferPacketPacket TransferPacket = new TransferPacketPacket();
243// TransferPacket.TransferData.Packet = 0;
244// TransferPacket.TransferData.ChannelType = 2;
245// TransferPacket.TransferData.TransferID = req.TransferRequestID;
246// TransferPacket.TransferData.Data = req.AssetInf.Data;
247// TransferPacket.TransferData.Status = 1;
248// req.RequestUser.OutPacket(TransferPacket, ThrottleOutPacketType.Asset);
249// }
250// else
251// {
252// int processedLength = 0;
253// // libsecondlife hardcodes 1500 as the maximum data chunk size
254// int maxChunkSize = 1250;
255// int packetNumber = 0;
256
257// while (processedLength < req.AssetInf.Data.Length)
258// {
259// TransferPacketPacket TransferPacket = new TransferPacketPacket();
260// TransferPacket.TransferData.Packet = packetNumber;
261// TransferPacket.TransferData.ChannelType = 2;
262// TransferPacket.TransferData.TransferID = req.TransferRequestID;
263
264// int chunkSize = Math.Min(req.AssetInf.Data.Length - processedLength, maxChunkSize);
265// byte[] chunk = new byte[chunkSize];
266// Array.Copy(req.AssetInf.Data, processedLength, chunk, 0, chunk.Length);
267
268// TransferPacket.TransferData.Data = chunk;
269
270// // 0 indicates more packets to come, 1 indicates last packet
271// if (req.AssetInf.Data.Length - processedLength > maxChunkSize)
272// {
273// TransferPacket.TransferData.Status = 0;
274// }
275// else
276// {
277// TransferPacket.TransferData.Status = 1;
278// }
279
280// req.RequestUser.OutPacket(TransferPacket, ThrottleOutPacketType.Asset);
281
282// processedLength += chunkSize;
283// packetNumber++;
284// }
285// }
286// }
287
288// //remove requests that have been completed
289// for (int i = 0; i < num; i++)
290// {
291// AssetRequests.RemoveAt(0);
292// }
293// }
294
295 /// <summary> 181 /// <summary>
296 /// Calculate the number of packets required to send the asset to the client. 182 /// Calculate the number of packets required to send the asset to the client.
297 /// </summary> 183 /// </summary>