Esempio n. 1
0
		public static byte[] FromInt24(Int24 value)
		{
			byte[] buffer = new byte[3];
			buffer[0] = (byte) value.IntValue();
			buffer[1] = (byte) (value.IntValue() >> 8);
			buffer[2] = (byte) (value.IntValue() >> 16);
			return buffer;
		}
Esempio n. 2
0
 public static byte[] FromInt24(Int24 value)
 {
     byte[] buffer = new byte[3];
     buffer[0] = (byte)value.IntValue();
     buffer[1] = (byte)(value.IntValue() >> 8);
     buffer[2] = (byte)(value.IntValue() >> 16);
     return(buffer);
 }
Esempio n. 3
0
		public void Reset()
		{
			isACK = false;
			isNAK = false;
			isPacketPair = false;
			hasBAndAS = false;
			isContinuousSend = false;
			needsBAndAs = false;
			isValid = false;
			datagramSequenceNumber = 0;
		}
Esempio n. 4
0
		public void Write(Int24 value)
		{
			_writer.Write(value.GetBytes());
		}
Esempio n. 5
0
        private void EnqueueAck(IPEndPoint senderEndpoint, Int24 sequenceNumber)
        {
            _numberOfAckSent++;

            if (_playerSessions.ContainsKey(senderEndpoint))
            {
                var session = _playerSessions[senderEndpoint];
                session.PlayerAckQueue.Enqueue(sequenceNumber.IntValue());
            }
        }
Esempio n. 6
0
		public void ReverseIndian()
		{
			var b = GetBytes();
			Array.Reverse(b);
			_value = new Int24(b).IntValue();
		}
Esempio n. 7
0
        private void SendAck(IPEndPoint senderEndpoint, Int24 sequenceNumber)
        {
            var ack = new Ack
            {
                sequenceNumber = sequenceNumber,
                count = 1,
                onlyOneSequence = 1
            };

            var data = ack.Encode();

            SendData(data);
        }