diff options
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 146bc63..5f2fbac 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -99,6 +99,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
99 | 99 | ||
100 | protected LLPacketServer m_networkServer; | 100 | protected LLPacketServer m_networkServer; |
101 | 101 | ||
102 | protected LLImageManager m_imageManager; | ||
103 | |||
102 | /* public variables */ | 104 | /* public variables */ |
103 | protected string m_firstName; | 105 | protected string m_firstName; |
104 | protected string m_lastName; | 106 | protected string m_lastName; |
@@ -471,6 +473,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
471 | m_PacketHandler.OnPacketStats += PopulateStats; | 473 | m_PacketHandler.OnPacketStats += PopulateStats; |
472 | 474 | ||
473 | RegisterLocalPacketHandlers(); | 475 | RegisterLocalPacketHandlers(); |
476 | m_imageManager = new LLImageManager(this, m_assetCache,Scene.RequestModuleInterface<OpenSim.Region.Environment.Interfaces.IJ2KDecoder>()); | ||
474 | } | 477 | } |
475 | 478 | ||
476 | public void SetDebugPacketLevel(int newDebugPacketLevel) | 479 | public void SetDebugPacketLevel(int newDebugPacketLevel) |
@@ -496,6 +499,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
496 | // Shut down timers | 499 | // Shut down timers |
497 | m_clientPingTimer.Stop(); | 500 | m_clientPingTimer.Stop(); |
498 | 501 | ||
502 | |||
499 | // This is just to give the client a reasonable chance of | 503 | // This is just to give the client a reasonable chance of |
500 | // flushing out all it's packets. There should probably | 504 | // flushing out all it's packets. There should probably |
501 | // be a better mechanism here | 505 | // be a better mechanism here |
@@ -510,7 +514,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
510 | if (!(shutdownCircuit)) | 514 | if (!(shutdownCircuit)) |
511 | { | 515 | { |
512 | GC.Collect(); | 516 | GC.Collect(); |
513 | 517 | m_imageManager = null; | |
514 | // Sends a KillPacket object, with which, the | 518 | // Sends a KillPacket object, with which, the |
515 | // blockingqueue dequeues and sees it's a killpacket | 519 | // blockingqueue dequeues and sees it's a killpacket |
516 | // and terminates within the context of the client thread. | 520 | // and terminates within the context of the client thread. |
@@ -532,6 +536,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
532 | m_log.DebugFormat( | 536 | m_log.DebugFormat( |
533 | "[CLIENT]: Close has been called with shutdownCircuit = {0} for {1} attached to scene {2}", | 537 | "[CLIENT]: Close has been called with shutdownCircuit = {0} for {1} attached to scene {2}", |
534 | shutdownCircuit, Name, m_scene.RegionInfo.RegionName); | 538 | shutdownCircuit, Name, m_scene.RegionInfo.RegionName); |
539 | |||
540 | m_imageManager.Close(); | ||
535 | 541 | ||
536 | m_PacketHandler.Flush(); | 542 | m_PacketHandler.Flush(); |
537 | 543 | ||
@@ -2759,7 +2765,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
2759 | ushort numParts, UUID ImageUUID, uint ImageSize, byte[] ImageData, byte imageCodec) | 2765 | ushort numParts, UUID ImageUUID, uint ImageSize, byte[] ImageData, byte imageCodec) |
2760 | { | 2766 | { |
2761 | ImageDataPacket im = new ImageDataPacket(); | 2767 | ImageDataPacket im = new ImageDataPacket(); |
2762 | im.Header.Reliable = false; | 2768 | im.Header.Reliable = true; |
2763 | im.ImageID.Packets = numParts; | 2769 | im.ImageID.Packets = numParts; |
2764 | im.ImageID.ID = ImageUUID; | 2770 | im.ImageID.ID = ImageUUID; |
2765 | 2771 | ||
@@ -2775,7 +2781,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
2775 | public void SendImageNextPart(ushort partNumber, UUID imageUuid, byte[] imageData) | 2781 | public void SendImageNextPart(ushort partNumber, UUID imageUuid, byte[] imageData) |
2776 | { | 2782 | { |
2777 | ImagePacketPacket im = new ImagePacketPacket(); | 2783 | ImagePacketPacket im = new ImagePacketPacket(); |
2778 | im.Header.Reliable = false; | 2784 | im.Header.Reliable = true; |
2779 | im.ImageID.Packet = partNumber; | 2785 | im.ImageID.Packet = partNumber; |
2780 | im.ImageID.ID = imageUuid; | 2786 | im.ImageID.ID = imageUuid; |
2781 | im.ImageData.Data = imageData; | 2787 | im.ImageData.Data = imageData; |
@@ -4192,6 +4198,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4192 | if (ProcessPacketMethod(Pack)) | 4198 | if (ProcessPacketMethod(Pack)) |
4193 | { | 4199 | { |
4194 | //there is a handler registered that handled this packet type | 4200 | //there is a handler registered that handled this packet type |
4201 | |||
4202 | // in the end, we dereference this, so we have to check if it's null | ||
4203 | if (m_imageManager != null) | ||
4204 | m_imageManager.ProcessImageQueue(3); | ||
4195 | return; | 4205 | return; |
4196 | } | 4206 | } |
4197 | 4207 | ||
@@ -5232,10 +5242,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
5232 | args.PacketNumber = imageRequest.RequestImage[i].Packet; | 5242 | args.PacketNumber = imageRequest.RequestImage[i].Packet; |
5233 | args.Priority = imageRequest.RequestImage[i].DownloadPriority; | 5243 | args.Priority = imageRequest.RequestImage[i].DownloadPriority; |
5234 | 5244 | ||
5235 | handlerTextureRequest = OnRequestTexture; | 5245 | //handlerTextureRequest = OnRequestTexture; |
5236 | 5246 | ||
5237 | if (handlerTextureRequest != null) | 5247 | //if (handlerTextureRequest != null) |
5238 | OnRequestTexture(this, args); | 5248 | //OnRequestTexture(this, args); |
5249 | m_imageManager.EnqueueReq(args); | ||
5239 | } | 5250 | } |
5240 | } | 5251 | } |
5241 | break; | 5252 | break; |
@@ -7374,6 +7385,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
7374 | #endregion | 7385 | #endregion |
7375 | } | 7386 | } |
7376 | 7387 | ||
7388 | // in the end, we dereference this, so we have to check if it's null | ||
7389 | if (m_imageManager != null ) | ||
7390 | m_imageManager.ProcessImageQueue(3); | ||
7377 | PacketPool.Instance.ReturnPacket(Pack); | 7391 | PacketPool.Instance.ReturnPacket(Pack); |
7378 | } | 7392 | } |
7379 | 7393 | ||