* refactor: move code concerned with creating a subsequent image packet to LLClientView

0.6.0-stable
Justin Clarke Casey 2008-10-15 15:30:27 +00:00
parent 063ba29ff8
commit 2226626fec
5 changed files with 32 additions and 9 deletions

View File

@ -802,6 +802,15 @@ namespace OpenSim.Framework
/// <param name="ImageData"></param>
/// <param name="imageCodec"></param>
void SendImageFirstPart(ushort numParts, UUID ImageUUID, uint ImageSize, byte[] ImageData, byte imageCodec);
/// <summary>
/// Send the next packet for a series of packets making up a single texture,
/// as established by SendImageFirstPart()
/// </summary>
/// <param name="partNumber"></param>
/// <param name="imageUuid"></param>
/// <param name="imageData"></param>
void SendImageNextPart(ushort partNumber, UUID imageUuid, byte[] imageData);
void SendShutdownConnectionNotice();

View File

@ -2619,6 +2619,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP
im.Header.Zerocoded = true;
OutPacket(im, ThrottleOutPacketType.Texture);
}
public void SendImageNextPart(ushort partNumber, UUID imageUuid, byte[] imageData)
{
ImagePacketPacket im = new ImagePacketPacket();
im.Header.Reliable = false;
im.ImageID.Packet = partNumber;
im.ImageID.ID = imageUuid;
im.ImageData.Data = imageData;
OutPacket(im, ThrottleOutPacketType.Texture);
}
public void SendShutdownConnectionNotice()
{

View File

@ -171,17 +171,12 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureSender
}
else
{
// Doesn't like to be refactored...
ImagePacketPacket im = new ImagePacketPacket();
im.Header.Reliable = false;
im.ImageID.Packet = (ushort)(PacketCounter);
im.ImageID.ID = m_asset.FullID;
int size = m_asset.Data.Length - 600 - (1000 * (PacketCounter - 1));
if (size > 1000) size = 1000;
im.ImageData.Data = new byte[size];
byte[] imageData = new byte[size];
try
{
Array.Copy(m_asset.Data, 600 + (1000 * (PacketCounter - 1)), im.ImageData.Data, 0, size);
Array.Copy(m_asset.Data, 600 + (1000 * (PacketCounter - 1)), imageData, 0, size);
}
catch (ArgumentOutOfRangeException)
{
@ -189,8 +184,8 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureSender
m_asset.FullID.ToString());
return;
}
RequestUser.OutPacket(im, ThrottleOutPacketType.Texture);
RequestUser.SendImageNextPart((ushort)PacketCounter, m_asset.FullID, imageData);
PacketCounter++;
}
}

View File

@ -708,6 +708,10 @@ namespace OpenSim.Region.Environment.Modules.World.NPC
{
}
public void SendImageNextPart(ushort partNumber, UUID imageUuid, byte[] imageData)
{
}
public void SendShutdownConnectionNotice()
{
}

View File

@ -625,6 +625,10 @@ namespace OpenSim.Region.Examples.SimpleModule
public void SendImageFirstPart(ushort numParts, UUID ImageUUID, uint ImageSize, byte[] ImageData, byte imageCodec)
{
}
public void SendImageNextPart(ushort partNumber, UUID imageUuid, byte[] imageData)
{
}
public void SendShutdownConnectionNotice()
{