* Two more OutPacket refactors. TextureSender.
* The split image packet sender doesn't like to be refactored (images don't load after it's been refactored), so left that as is for the moment.0.6.0-stable
parent
536a92ca84
commit
b67f88a3a2
|
@ -936,6 +936,8 @@ namespace OpenSim.Framework
|
||||||
void SendAssetUploadCompleteMessage(sbyte AssetType, bool Success, LLUUID AssetFullID);
|
void SendAssetUploadCompleteMessage(sbyte AssetType, bool Success, LLUUID AssetFullID);
|
||||||
void SendConfirmXfer(ulong xferID, uint PacketID);
|
void SendConfirmXfer(ulong xferID, uint PacketID);
|
||||||
void SendXferRequest(ulong XferID, short AssetType, LLUUID vFileID, byte FilePath, byte[] FileName);
|
void SendXferRequest(ulong XferID, short AssetType, LLUUID vFileID, byte FilePath, byte[] FileName);
|
||||||
|
|
||||||
|
void SendImagePart(ushort numParts, LLUUID ImageUUID, uint ImageSize, byte[] ImageData, byte imageCodec);
|
||||||
|
|
||||||
byte[] GetThrottlesPacked(float multiplier);
|
byte[] GetThrottlesPacked(float multiplier);
|
||||||
|
|
||||||
|
|
|
@ -2229,6 +2229,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
newPack.Header.Zerocoded = true;
|
newPack.Header.Zerocoded = true;
|
||||||
OutPacket(newPack, ThrottleOutPacketType.Asset);
|
OutPacket(newPack, ThrottleOutPacketType.Asset);
|
||||||
}
|
}
|
||||||
|
public void SendImagePart(ushort numParts, LLUUID ImageUUID, uint ImageSize, byte[] ImageData, byte imageCodec)
|
||||||
|
{
|
||||||
|
ImageDataPacket im = new ImageDataPacket();
|
||||||
|
im.Header.Reliable = false;
|
||||||
|
im.ImageID.Packets = numParts;
|
||||||
|
im.ImageID.ID = ImageUUID;
|
||||||
|
|
||||||
|
if (ImageSize > 0)
|
||||||
|
im.ImageID.Size = ImageSize;
|
||||||
|
|
||||||
|
im.ImageData.Data = ImageData;
|
||||||
|
im.ImageID.Codec = imageCodec;
|
||||||
|
im.Header.Zerocoded = true;
|
||||||
|
OutPacket(im, ThrottleOutPacketType.Texture);
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Estate Data Sending Methods
|
#region Estate Data Sending Methods
|
||||||
|
|
|
@ -150,37 +150,27 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureSender
|
||||||
{
|
{
|
||||||
if (NumPackets == 0)
|
if (NumPackets == 0)
|
||||||
{
|
{
|
||||||
ImageDataPacket im = new ImageDataPacket();
|
|
||||||
im.Header.Reliable = false;
|
RequestUser.SendImagePart(1, m_asset.FullID, (uint)m_asset.Data.Length, m_asset.Data, 2);
|
||||||
im.ImageID.Packets = 1;
|
|
||||||
im.ImageID.ID = m_asset.FullID;
|
|
||||||
im.ImageID.Size = (uint) m_asset.Data.Length;
|
|
||||||
im.ImageData.Data = m_asset.Data;
|
|
||||||
im.ImageID.Codec = 2;
|
|
||||||
im.Header.Zerocoded = true;
|
|
||||||
RequestUser.OutPacket(im, ThrottleOutPacketType.Texture);
|
|
||||||
PacketCounter++;
|
PacketCounter++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ImageDataPacket im = new ImageDataPacket();
|
|
||||||
im.Header.Reliable = false;
|
byte[] ImageData1 = new byte[600];
|
||||||
im.ImageID.Packets = (ushort) (NumPackets);
|
Array.Copy(m_asset.Data, 0, ImageData1, 0, 600);
|
||||||
im.ImageID.ID = m_asset.FullID;
|
|
||||||
im.ImageID.Size = (uint) m_asset.Data.Length;
|
RequestUser.SendImagePart((ushort)(NumPackets), m_asset.FullID, (uint)m_asset.Data.Length, ImageData1, 2);
|
||||||
im.ImageData.Data = new byte[600];
|
|
||||||
Array.Copy(m_asset.Data, 0, im.ImageData.Data, 0, 600);
|
|
||||||
im.ImageID.Codec = 2;
|
|
||||||
im.Header.Zerocoded = true;
|
|
||||||
RequestUser.OutPacket(im, ThrottleOutPacketType.Texture);
|
|
||||||
PacketCounter++;
|
PacketCounter++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// Doesn't like to be refactored...
|
||||||
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;
|
||||||
|
@ -195,8 +185,9 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureSender
|
||||||
m_asset.FullID.ToString());
|
m_asset.FullID.ToString());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
im.Header.Zerocoded = true;
|
|
||||||
RequestUser.OutPacket(im, ThrottleOutPacketType.Texture);
|
RequestUser.OutPacket(im, ThrottleOutPacketType.Texture);
|
||||||
|
|
||||||
|
|
||||||
PacketCounter++;
|
PacketCounter++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -522,13 +522,19 @@ namespace OpenSim.Region.Examples.SimpleModule
|
||||||
public void SendAssetUploadCompleteMessage(sbyte AssetType, bool Success, LLUUID AssetFullID)
|
public void SendAssetUploadCompleteMessage(sbyte AssetType, bool Success, LLUUID AssetFullID)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SendConfirmXfer(ulong xferID, uint PacketID)
|
public void SendConfirmXfer(ulong xferID, uint PacketID)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SendXferRequest(ulong XferID, short AssetType, LLUUID vFileID, byte FilePath, byte[] FileName)
|
public void SendXferRequest(ulong XferID, short AssetType, LLUUID vFileID, byte FilePath, byte[] FileName)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SendImagePart(ushort numParts, LLUUID ImageUUID, uint ImageSize, byte[] ImageData, byte imageCodec)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
private void Update()
|
private void Update()
|
||||||
{
|
{
|
||||||
frame++;
|
frame++;
|
||||||
|
|
Loading…
Reference in New Issue