Enabled the TextureDownloadModule, so that hopefully I might get some feedback, as to if it makes the texture problem better or worse. As I plan/hope to work on texture/asset downloading this weekend.

afrisby
MW 2007-12-07 22:47:11 +00:00
parent a71f4c021b
commit 87b337ebf9
4 changed files with 28 additions and 32 deletions

View File

@ -2728,19 +2728,19 @@ namespace OpenSim.Region.ClientStack
for (int i = 0; i < imageRequest.RequestImage.Length; i++) for (int i = 0; i < imageRequest.RequestImage.Length; i++)
{ {
// still working on the Texture download module so for now using old method // still working on the Texture download module so for now using old method
// TextureRequestArgs args = new TextureRequestArgs(); if (OnRequestTexture != null)
// args.RequestedAssetID = imageRequest.RequestImage[i].Image; {
// args.DiscardLevel = imageRequest.RequestImage[i].DiscardLevel; TextureRequestArgs args = new TextureRequestArgs();
// args.PacketNumber = imageRequest.RequestImage[i].Packet; args.RequestedAssetID = imageRequest.RequestImage[i].Image;
args.DiscardLevel = imageRequest.RequestImage[i].DiscardLevel;
args.PacketNumber = imageRequest.RequestImage[i].Packet;
// if (OnRequestTexture != null) OnRequestTexture(this, args);
// { }
// OnRequestTexture(this, args);
// }
m_assetCache.AddTextureRequest(this, imageRequest.RequestImage[i].Image, // m_assetCache.AddTextureRequest(this, imageRequest.RequestImage[i].Image,
imageRequest.RequestImage[i].Packet, // imageRequest.RequestImage[i].Packet,
imageRequest.RequestImage[i].DiscardLevel); // imageRequest.RequestImage[i].DiscardLevel);
} }
break; break;
case PacketType.TransferRequest: case PacketType.TransferRequest:

View File

@ -80,7 +80,7 @@ namespace OpenSim.Region.Environment.Modules
{ {
if (profile.RootFolder != null) if (profile.RootFolder != null)
{ {
//Todo look up the assetid from the inventory cache (or something) for each itemId that is in AvatarWearingArgs //Todo look up the assetid from the inventory cache for each itemId that is in AvatarWearingArgs
// then store assetid and itemId and wearable type in a database // then store assetid and itemId and wearable type in a database
foreach (AvatarWearingArgs.Wearable wear in e.NowWearing) foreach (AvatarWearingArgs.Wearable wear in e.NowWearing)
{ {

View File

@ -27,6 +27,7 @@
*/ */
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading;
using libsecondlife; using libsecondlife;
using libsecondlife.Packets; using libsecondlife.Packets;
using Nini.Config; using Nini.Config;
@ -50,13 +51,13 @@ namespace OpenSim.Region.Environment.Modules
private BlockingQueue<TextureSender> QueueSenders = new BlockingQueue<TextureSender>(); private BlockingQueue<TextureSender> QueueSenders = new BlockingQueue<TextureSender>();
private Dictionary<LLUUID, List<LLUUID>> InProcess = new Dictionary<LLUUID, List<LLUUID>>(); private Dictionary<LLUUID, List<LLUUID>> InProcess = new Dictionary<LLUUID, List<LLUUID>>();
// private Thread m_thread; private Thread m_thread;
public TextureDownloadModule() public TextureDownloadModule()
{ {
// m_thread = new Thread(new ThreadStart(ProcessTextureSenders)); m_thread = new Thread(new ThreadStart(ProcessTextureSenders));
// m_thread.IsBackground = true; m_thread.IsBackground = true;
// m_thread.Start(); m_thread.Start();
} }
public void Initialise(Scene scene, IConfigSource config) public void Initialise(Scene scene, IConfigSource config)
@ -89,7 +90,7 @@ namespace OpenSim.Region.Environment.Modules
public void NewClient(IClientAPI client) public void NewClient(IClientAPI client)
{ {
/* lock (ClientRequests) lock (ClientRequests)
{ {
if (!ClientRequests.ContainsKey(client.AgentId)) if (!ClientRequests.ContainsKey(client.AgentId))
{ {
@ -98,7 +99,7 @@ namespace OpenSim.Region.Environment.Modules
} }
} }
client.OnRequestTexture += TextureRequest; client.OnRequestTexture += TextureRequest;
*/
} }
public void TextureCallback(LLUUID textureID, AssetBase asset) public void TextureCallback(LLUUID textureID, AssetBase asset)
@ -124,7 +125,7 @@ namespace OpenSim.Region.Environment.Modules
public void TextureRequest(Object sender, TextureRequestArgs e) public void TextureRequest(Object sender, TextureRequestArgs e)
{ {
IClientAPI client = (IClientAPI) sender; IClientAPI client = (IClientAPI)sender;
if (!ClientRequests[client.AgentId].ContainsKey(e.RequestedAssetID)) if (!ClientRequests[client.AgentId].ContainsKey(e.RequestedAssetID))
{ {
lock (ClientRequests) lock (ClientRequests)
@ -177,14 +178,14 @@ namespace OpenSim.Region.Environment.Modules
if (asset.Data.LongLength > 600) if (asset.Data.LongLength > 600)
{ {
NumPackets = 2 + (int) (asset.Data.Length - 601)/1000; NumPackets = 2 + (int)(asset.Data.Length - 601) / 1000;
} }
else else
{ {
NumPackets = 1; NumPackets = 1;
} }
PacketCounter = (int) req.PacketNumber; PacketCounter = (int)req.PacketNumber;
} }
public bool SendTexture() public bool SendTexture()
@ -209,7 +210,7 @@ namespace OpenSim.Region.Environment.Modules
im.Header.Reliable = false; im.Header.Reliable = false;
im.ImageID.Packets = 1; im.ImageID.Packets = 1;
im.ImageID.ID = m_asset.FullID; im.ImageID.ID = m_asset.FullID;
im.ImageID.Size = (uint) m_asset.Data.Length; im.ImageID.Size = (uint)m_asset.Data.Length;
im.ImageData.Data = m_asset.Data; im.ImageData.Data = m_asset.Data;
im.ImageID.Codec = 2; im.ImageID.Codec = 2;
req.RequestUser.OutPacket(im, ThrottleOutPacketType.Texture); req.RequestUser.OutPacket(im, ThrottleOutPacketType.Texture);
@ -219,9 +220,9 @@ namespace OpenSim.Region.Environment.Modules
{ {
ImageDataPacket im = new ImageDataPacket(); ImageDataPacket im = new ImageDataPacket();
im.Header.Reliable = false; im.Header.Reliable = false;
im.ImageID.Packets = (ushort) (NumPackets); im.ImageID.Packets = (ushort)(NumPackets);
im.ImageID.ID = m_asset.FullID; im.ImageID.ID = m_asset.FullID;
im.ImageID.Size = (uint) m_asset.Data.Length; im.ImageID.Size = (uint)m_asset.Data.Length;
im.ImageData.Data = new byte[600]; im.ImageData.Data = new byte[600];
Array.Copy(m_asset.Data, 0, im.ImageData.Data, 0, 600); Array.Copy(m_asset.Data, 0, im.ImageData.Data, 0, 600);
im.ImageID.Codec = 2; im.ImageID.Codec = 2;
@ -233,12 +234,12 @@ namespace OpenSim.Region.Environment.Modules
{ {
ImagePacketPacket im = new ImagePacketPacket(); ImagePacketPacket im = new ImagePacketPacket();
im.Header.Reliable = false; im.Header.Reliable = false;
im.ImageID.Packet = (ushort) (PacketCounter); im.ImageID.Packet = (ushort)(PacketCounter);
im.ImageID.ID = m_asset.FullID; im.ImageID.ID = m_asset.FullID;
int size = m_asset.Data.Length - 600 - (1000*(PacketCounter - 1)); int size = m_asset.Data.Length - 600 - (1000 * (PacketCounter - 1));
if (size > 1000) size = 1000; if (size > 1000) size = 1000;
im.ImageData.Data = new byte[size]; im.ImageData.Data = new byte[size];
Array.Copy(m_asset.Data, 600 + (1000*(PacketCounter - 1)), im.ImageData.Data, 0, size); Array.Copy(m_asset.Data, 600 + (1000 * (PacketCounter - 1)), im.ImageData.Data, 0, size);
req.RequestUser.OutPacket(im, ThrottleOutPacketType.Texture); req.RequestUser.OutPacket(im, ThrottleOutPacketType.Texture);
PacketCounter++; PacketCounter++;
} }

View File

@ -61,11 +61,6 @@ namespace OpenSim.Region.Environment.Scenes
} }
public void SetID(LLUUID avatarID)
{
m_scenePresenceID = avatarID;
}
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>