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; }
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); }
public void Reset() { isACK = false; isNAK = false; isPacketPair = false; hasBAndAS = false; isContinuousSend = false; needsBAndAs = false; isValid = false; datagramSequenceNumber = 0; }
public void Write(Int24 value) { _writer.Write(value.GetBytes()); }
private void EnqueueAck(IPEndPoint senderEndpoint, Int24 sequenceNumber) { _numberOfAckSent++; if (_playerSessions.ContainsKey(senderEndpoint)) { var session = _playerSessions[senderEndpoint]; session.PlayerAckQueue.Enqueue(sequenceNumber.IntValue()); } }
public void ReverseIndian() { var b = GetBytes(); Array.Reverse(b); _value = new Int24(b).IntValue(); }
private void SendAck(IPEndPoint senderEndpoint, Int24 sequenceNumber) { var ack = new Ack { sequenceNumber = sequenceNumber, count = 1, onlyOneSequence = 1 }; var data = ack.Encode(); SendData(data); }