aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
authorMW2007-08-08 19:51:51 +0000
committerMW2007-08-08 19:51:51 +0000
commita13770361142faaaae7e535eae9526586de1106f (patch)
treed005745f311e4fd46a99ca79d4c9d0555d8256ea /OpenSim/Framework
parentmoving to new namespace as this is mono only (diff)
downloadopensim-SC_OLD-a13770361142faaaae7e535eae9526586de1106f.zip
opensim-SC_OLD-a13770361142faaaae7e535eae9526586de1106f.tar.gz
opensim-SC_OLD-a13770361142faaaae7e535eae9526586de1106f.tar.bz2
opensim-SC_OLD-a13770361142faaaae7e535eae9526586de1106f.tar.xz
Fixed the asset download problem I think, solution might not be ideal but works for now.
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/Communications/Cache/AssetCache.cs21
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);