diff options
Diffstat (limited to 'OpenSim/Region/Environment/Modules/Agent/AssetDownload/AssetDownloadModule.cs')
-rw-r--r-- | OpenSim/Region/Environment/Modules/Agent/AssetDownload/AssetDownloadModule.cs | 37 |
1 files changed, 23 insertions, 14 deletions
diff --git a/OpenSim/Region/Environment/Modules/Agent/AssetDownload/AssetDownloadModule.cs b/OpenSim/Region/Environment/Modules/Agent/AssetDownload/AssetDownloadModule.cs index 47c1479..33e917a 100644 --- a/OpenSim/Region/Environment/Modules/Agent/AssetDownload/AssetDownloadModule.cs +++ b/OpenSim/Region/Environment/Modules/Agent/AssetDownload/AssetDownloadModule.cs | |||
@@ -37,17 +37,18 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetDownload | |||
37 | { | 37 | { |
38 | public class AssetDownloadModule : IRegionModule | 38 | public class AssetDownloadModule : IRegionModule |
39 | { | 39 | { |
40 | /// <summary> | ||
41 | /// Asset requests with data which are ready to be sent back to requesters. This includes textures. | ||
42 | /// </summary> | ||
43 | private List<AssetRequest> AssetRequests; | ||
44 | |||
40 | private Scene m_scene; | 45 | private Scene m_scene; |
41 | private Dictionary<LLUUID, Scene> RegisteredScenes = new Dictionary<LLUUID, Scene>(); | 46 | private Dictionary<LLUUID, Scene> RegisteredScenes = new Dictionary<LLUUID, Scene>(); |
47 | |||
42 | /// | 48 | /// |
43 | /// Assets requests (for each user) which are waiting for asset server data. This includes texture requests | 49 | /// Assets requests (for each user) which are waiting for asset server data. This includes texture requests |
44 | /// </summary> | 50 | /// </summary> |
45 | private Dictionary<LLUUID, Dictionary<LLUUID,AssetRequest>> RequestedAssets; | 51 | private Dictionary<LLUUID, Dictionary<LLUUID, AssetRequest>> RequestedAssets; |
46 | |||
47 | /// <summary> | ||
48 | /// Asset requests with data which are ready to be sent back to requesters. This includes textures. | ||
49 | /// </summary> | ||
50 | private List<AssetRequest> AssetRequests; | ||
51 | 52 | ||
52 | public AssetDownloadModule() | 53 | public AssetDownloadModule() |
53 | { | 54 | { |
@@ -55,6 +56,8 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetDownload | |||
55 | AssetRequests = new List<AssetRequest>(); | 56 | AssetRequests = new List<AssetRequest>(); |
56 | } | 57 | } |
57 | 58 | ||
59 | #region IRegionModule Members | ||
60 | |||
58 | public void Initialise(Scene scene, IConfigSource config) | 61 | public void Initialise(Scene scene, IConfigSource config) |
59 | { | 62 | { |
60 | if (!RegisteredScenes.ContainsKey(scene.RegionInfo.RegionID)) | 63 | if (!RegisteredScenes.ContainsKey(scene.RegionInfo.RegionID)) |
@@ -92,6 +95,8 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetDownload | |||
92 | get { return true; } | 95 | get { return true; } |
93 | } | 96 | } |
94 | 97 | ||
98 | #endregion | ||
99 | |||
95 | public void NewClient(IClientAPI client) | 100 | public void NewClient(IClientAPI client) |
96 | { | 101 | { |
97 | // client.OnRequestAsset += AddAssetRequest; | 102 | // client.OnRequestAsset += AddAssetRequest; |
@@ -301,33 +306,37 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetDownload | |||
301 | { | 306 | { |
302 | // over max number of bytes so split up file | 307 | // over max number of bytes so split up file |
303 | long restData = data.LongLength - m_maxPacketSize; | 308 | long restData = data.LongLength - m_maxPacketSize; |
304 | int restPackets = (int)((restData + m_maxPacketSize - 1) / m_maxPacketSize); | 309 | int restPackets = (int) ((restData + m_maxPacketSize - 1) / m_maxPacketSize); |
305 | numPackets += restPackets; | 310 | numPackets += restPackets; |
306 | } | 311 | } |
307 | 312 | ||
308 | return numPackets; | 313 | return numPackets; |
309 | } | 314 | } |
310 | 315 | ||
316 | #region Nested type: AssetRequest | ||
317 | |||
311 | public class AssetRequest | 318 | public class AssetRequest |
312 | { | 319 | { |
313 | public IClientAPI RequestUser; | ||
314 | public LLUUID RequestAssetID; | ||
315 | public AssetBase AssetInf; | 320 | public AssetBase AssetInf; |
316 | public AssetBase ImageInfo; | 321 | public byte AssetRequestSource = 2; |
317 | public LLUUID TransferRequestID; | ||
318 | public long DataPointer = 0; | 322 | public long DataPointer = 0; |
323 | public int DiscardLevel = -1; | ||
324 | public AssetBase ImageInfo; | ||
325 | public bool IsTextureRequest; | ||
319 | public int NumPackets = 0; | 326 | public int NumPackets = 0; |
320 | public int PacketCounter = 0; | 327 | public int PacketCounter = 0; |
321 | public bool IsTextureRequest; | ||
322 | public byte AssetRequestSource = 2; | ||
323 | public byte[] Params = null; | 328 | public byte[] Params = null; |
329 | public LLUUID RequestAssetID; | ||
330 | public IClientAPI RequestUser; | ||
331 | public LLUUID TransferRequestID; | ||
324 | //public bool AssetInCache; | 332 | //public bool AssetInCache; |
325 | //public int TimeRequested; | 333 | //public int TimeRequested; |
326 | public int DiscardLevel = -1; | ||
327 | 334 | ||
328 | public AssetRequest() | 335 | public AssetRequest() |
329 | { | 336 | { |
330 | } | 337 | } |
331 | } | 338 | } |
339 | |||
340 | #endregion | ||
332 | } | 341 | } |
333 | } \ No newline at end of file | 342 | } \ No newline at end of file |