* 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

@ -803,6 +803,15 @@ namespace OpenSim.Framework
/// <param name="imageCodec"></param> /// <param name="imageCodec"></param>
void SendImageFirstPart(ushort numParts, UUID ImageUUID, uint ImageSize, byte[] ImageData, byte imageCodec); 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(); void SendShutdownConnectionNotice();
/// <summary> /// <summary>

View File

@ -2620,6 +2620,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP
OutPacket(im, ThrottleOutPacketType.Texture); 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() public void SendShutdownConnectionNotice()
{ {
OutPacket(PacketPool.Instance.GetPacket(PacketType.DisableSimulator), ThrottleOutPacketType.Unknown); OutPacket(PacketPool.Instance.GetPacket(PacketType.DisableSimulator), ThrottleOutPacketType.Unknown);

View File

@ -171,17 +171,12 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureSender
} }
else 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)); 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]; byte[] imageData = new byte[size];
try 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) catch (ArgumentOutOfRangeException)
{ {
@ -189,8 +184,8 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureSender
m_asset.FullID.ToString()); m_asset.FullID.ToString());
return; return;
} }
RequestUser.OutPacket(im, ThrottleOutPacketType.Texture);
RequestUser.SendImageNextPart((ushort)PacketCounter, m_asset.FullID, imageData);
PacketCounter++; 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() public void SendShutdownConnectionNotice()
{ {
} }

View File

@ -626,6 +626,10 @@ namespace OpenSim.Region.Examples.SimpleModule
{ {
} }
public void SendImageNextPart(ushort partNumber, UUID imageUuid, byte[] imageData)
{
}
public void SendShutdownConnectionNotice() public void SendShutdownConnectionNotice()
{ {
} }