From 8ea12ad6c06ec9cce4bc470b40079546f18b61c8 Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Tue, 5 May 2009 09:59:15 +0000 Subject: Add copyright header. Formatting cleanup. Ignore some generated files. --- OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs | 36 ++++++++-------------- .../Region/ClientStack/LindenUDP/LLPacketQueue.cs | 2 +- 2 files changed, 13 insertions(+), 25 deletions(-) (limited to 'OpenSim/Region/ClientStack') diff --git a/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs b/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs index 1882005..aef0ada 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs @@ -36,13 +36,13 @@ using System.Reflection; namespace OpenSim.Region.ClientStack.LindenUDP { - /// - /// We use this class to store image data and associated request data and attributes - /// + /// + /// We use this class to store image data and associated request data and attributes + /// public class J2KImage { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + public double m_designatedPriorityKey; public double m_requestedPriority = 0.0d; public uint m_lastSequence = 0; @@ -55,7 +55,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP public AssetBase m_MissingSubstitute = null; public bool m_decoded = false; public bool m_completedSendAtCurrentDiscardLevel; - + private sbyte m_discardLevel=-1; private uint m_packetNumber; private bool m_decoderequested = false; @@ -135,6 +135,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP { return ((bytePosition - cFirstPacketSize + cImagePacketSize - 1) / cImagePacketSize) + 1; } + public int LastPacketSize() { if (m_packetNumber == 1) @@ -146,8 +147,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP lastsize = cImagePacketSize; } return lastsize; - } - + } public int CurrentBytePosition() { @@ -215,7 +215,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP complete = true; } } - + // It's concievable that the client might request packet one // from a one packet image, which is really packet 0, // which would leave us with a negative imagePacketSize.. @@ -234,7 +234,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP //Send the packet client.SendImageNextPart((ushort)(m_packetNumber-1), m_requestedUUID, imageData); - } if (complete) { @@ -257,7 +256,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP { if (m_packetNumber <= m_stopPacket) { - bool SendMore = true; if (!m_sentinfo || (m_packetNumber == 0)) { @@ -273,8 +271,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP { m_packetNumber = 2; } - - int count=0; + + int count = 0; while (SendMore && count < 5 && m_packetNumber <= m_stopPacket) { count++; @@ -284,13 +282,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP if (m_packetNumber > m_stopPacket) { - return true; - } - } - } return false; } @@ -343,12 +337,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP } else { - - //discardLevel of -1 means just update the priority if (m_requestedDiscardLevel != -1) { - //Evaluate the discard level //First, is it positive? if (m_requestedDiscardLevel >= 0) @@ -361,7 +352,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP { m_discardLevel = m_requestedDiscardLevel; } - + //Calculate the m_stopPacket if (Layers.Length > 0) { @@ -382,18 +373,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP { m_packetNumber = m_requestedPacketNumber; } - + if (m_packetNumber <= m_stopPacket) { m_completedSendAtCurrentDiscardLevel = false; } - } - } } } } - } } diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs index 9ffff97..9b39292 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs @@ -248,7 +248,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP public void Cancel(uint sequence) { - while(contents.Remove(sequence)) + while (contents.Remove(sequence)) ; } -- cgit v1.1