예제 #1
0
파일: Int24.cs 프로젝트: CRBairdUSA/MiNET
		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;
		}
예제 #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);
 }
예제 #3
0
		public void Reset()
		{
			isACK = false;
			isNAK = false;
			isPacketPair = false;
			hasBAndAS = false;
			isContinuousSend = false;
			needsBAndAs = false;
			isValid = false;
			datagramSequenceNumber = 0;
		}
예제 #4
0
		public void Write(Int24 value)
		{
			_writer.Write(value.GetBytes());
		}
예제 #5
0
        private void EnqueueAck(IPEndPoint senderEndpoint, Int24 sequenceNumber)
        {
            _numberOfAckSent++;

            if (_playerSessions.ContainsKey(senderEndpoint))
            {
                var session = _playerSessions[senderEndpoint];
                session.PlayerAckQueue.Enqueue(sequenceNumber.IntValue());
            }
        }
예제 #6
0
파일: Int24.cs 프로젝트: CRBairdUSA/MiNET
		public void ReverseIndian()
		{
			var b = GetBytes();
			Array.Reverse(b);
			_value = new Int24(b).IntValue();
		}
예제 #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);
        }