* refactor: move code concerned with creating a subsequent image packet to LLClientView
parent
063ba29ff8
commit
2226626fec
|
@ -802,6 +802,15 @@ namespace OpenSim.Framework
|
||||||
/// <param name="ImageData"></param>
|
/// <param name="ImageData"></param>
|
||||||
/// <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();
|
||||||
|
|
||||||
|
|
|
@ -2619,6 +2619,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
im.Header.Zerocoded = true;
|
im.Header.Zerocoded = true;
|
||||||
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()
|
||||||
{
|
{
|
||||||
|
|
|
@ -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++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -625,6 +625,10 @@ namespace OpenSim.Region.Examples.SimpleModule
|
||||||
public void SendImageFirstPart(ushort numParts, UUID ImageUUID, uint ImageSize, byte[] ImageData, byte imageCodec)
|
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()
|
public void SendShutdownConnectionNotice()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue