diff options
Diffstat (limited to 'OpenSim/Framework/Communications')
-rw-r--r-- | OpenSim/Framework/Communications/Cache/AssetCache.cs | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/OpenSim/Framework/Communications/Cache/AssetCache.cs b/OpenSim/Framework/Communications/Cache/AssetCache.cs index ca74724..acdd593 100644 --- a/OpenSim/Framework/Communications/Cache/AssetCache.cs +++ b/OpenSim/Framework/Communications/Cache/AssetCache.cs | |||
@@ -211,7 +211,6 @@ namespace OpenSim.Framework.Communications.Caches | |||
211 | this.QueueTextures.Enqueue(sender); | 211 | this.QueueTextures.Enqueue(sender); |
212 | } | 212 | } |
213 | } | 213 | } |
214 | |||
215 | } | 214 | } |
216 | 215 | ||
217 | /// <summary> | 216 | /// <summary> |
@@ -481,7 +480,7 @@ namespace OpenSim.Framework.Communications.Caches | |||
481 | /// </summary> | 480 | /// </summary> |
482 | /// <param name="userInfo"></param> | 481 | /// <param name="userInfo"></param> |
483 | /// <param name="imageID"></param> | 482 | /// <param name="imageID"></param> |
484 | public void AddTextureRequest(IClientAPI userInfo, LLUUID imageID) | 483 | public void AddTextureRequest(IClientAPI userInfo, LLUUID imageID, uint packetNumber) |
485 | { | 484 | { |
486 | // Console.WriteLine("texture request for " + imageID.ToStringHyphenated()); | 485 | // Console.WriteLine("texture request for " + imageID.ToStringHyphenated()); |
487 | //check to see if texture is in local cache, if not request from asset server | 486 | //check to see if texture is in local cache, if not request from asset server |
@@ -489,11 +488,11 @@ namespace OpenSim.Framework.Communications.Caches | |||
489 | { | 488 | { |
490 | this.AvatarRecievedTextures.Add(userInfo.AgentId, new List<LLUUID>()); | 489 | this.AvatarRecievedTextures.Add(userInfo.AgentId, new List<LLUUID>()); |
491 | } | 490 | } |
492 | if(this.AvatarRecievedTextures[userInfo.AgentId].Contains(imageID)) | 491 | /* if(this.AvatarRecievedTextures[userInfo.AgentId].Contains(imageID)) |
493 | { | 492 | { |
494 | //Console.WriteLine(userInfo.AgentId +" is requesting a image( "+ imageID+" that has already been sent to them"); | 493 | //Console.WriteLine(userInfo.AgentId +" is requesting a image( "+ imageID+" that has already been sent to them"); |
495 | return; | 494 | return; |
496 | } | 495 | }*/ |
497 | if (!this.Textures.ContainsKey(imageID)) | 496 | if (!this.Textures.ContainsKey(imageID)) |
498 | { | 497 | { |
499 | if (!this.RequestedTextures.ContainsKey(imageID)) | 498 | if (!this.RequestedTextures.ContainsKey(imageID)) |
@@ -527,6 +526,10 @@ namespace OpenSim.Framework.Communications.Caches | |||
527 | { | 526 | { |
528 | req.NumPackets = 1; | 527 | req.NumPackets = 1; |
529 | } | 528 | } |
529 | if (packetNumber != 0) | ||
530 | { | ||
531 | req.PacketCounter = (int)packetNumber; | ||
532 | } | ||
530 | this.TextureRequests.Add(req); | 533 | this.TextureRequests.Add(req); |
531 | } | 534 | } |
532 | 535 | ||
@@ -653,8 +656,6 @@ namespace OpenSim.Framework.Communications.Caches | |||
653 | { | 656 | { |
654 | AssetRequest req = request; | 657 | AssetRequest req = request; |
655 | // Console.WriteLine("sending " + req.ImageInfo.FullID); | 658 | // Console.WriteLine("sending " + req.ImageInfo.FullID); |
656 | |||
657 | // if (req.ImageInfo.FullID == new LLUUID("00000000-0000-0000-5005-000000000005")) | ||
658 | if (req.PacketCounter == 0) | 659 | if (req.PacketCounter == 0) |
659 | { | 660 | { |
660 | //first time for this request so send imagedata packet | 661 | //first time for this request so send imagedata packet |
@@ -684,7 +685,7 @@ namespace OpenSim.Framework.Communications.Caches | |||
684 | Array.Copy(req.ImageInfo.Data, 0, im.ImageData.Data, 0, 600); | 685 | Array.Copy(req.ImageInfo.Data, 0, im.ImageData.Data, 0, 600); |
685 | im.ImageID.Codec = 2; | 686 | im.ImageID.Codec = 2; |
686 | req.RequestUser.OutPacket(im); | 687 | req.RequestUser.OutPacket(im); |
687 | //this.SaveAssetToFile("packetheader.dat", im.ImageData.Data); | 688 | |
688 | req.PacketCounter++; | 689 | req.PacketCounter++; |
689 | //req.ImageInfo.last_used = time; | 690 | //req.ImageInfo.last_used = time; |
690 | //System.Console.WriteLine("sent first packet of texture: | 691 | //System.Console.WriteLine("sent first packet of texture: |
@@ -693,7 +694,7 @@ namespace OpenSim.Framework.Communications.Caches | |||
693 | } | 694 | } |
694 | else | 695 | else |
695 | { | 696 | { |
696 | // Console.WriteLine("sending packet" + req.PacketCounter + "for " + req.ImageInfo.FullID.ToStringHyphenated()); | 697 | //Console.WriteLine("sending packet" + req.PacketCounter + "for " + req.ImageInfo.FullID.ToStringHyphenated()); |
697 | //send imagepacket | 698 | //send imagepacket |
698 | //more than one packet so split file up | 699 | //more than one packet so split file up |
699 | ImagePacketPacket im = new ImagePacketPacket(); | 700 | ImagePacketPacket im = new ImagePacketPacket(); |
@@ -704,10 +705,6 @@ namespace OpenSim.Framework.Communications.Caches | |||
704 | im.ImageData.Data = new byte[size]; | 705 | im.ImageData.Data = new byte[size]; |
705 | Array.Copy(req.ImageInfo.Data, 600 + (1000 * (req.PacketCounter - 1)), im.ImageData.Data, 0, size); | 706 | Array.Copy(req.ImageInfo.Data, 600 + (1000 * (req.PacketCounter - 1)), im.ImageData.Data, 0, size); |
706 | req.RequestUser.OutPacket(im); | 707 | req.RequestUser.OutPacket(im); |
707 | //if (req.PacketCounter == req.NumPackets) | ||
708 | // { | ||
709 | // this.SaveAssetToFile("packet"+req.PacketCounter+".dat", im.ImageData.Data); | ||
710 | //} | ||
711 | req.PacketCounter++; | 708 | req.PacketCounter++; |
712 | //req.ImageInfo.last_used = time; | 709 | //req.ImageInfo.last_used = time; |
713 | //System.Console.WriteLine("sent a packet of texture: "+req.image_info.FullID); | 710 | //System.Console.WriteLine("sent a packet of texture: "+req.image_info.FullID); |