Acknowledge - edqx/amongus-protocol GitHub Wiki

Acknowledge packets are sent after a reliable packet is received, i.e. a packet with a nonce. The client or server must send the acknowledgement packet with the same nonce as the reliable packet being acknowledged.

Name Type Description
Nonce uint16 The acknowledgement identifier for the payload, the integer is in Big Endian.
0xFF byte Always 0xFF

Example

// On reliable packet
if (packet.reliable) {
    acknowledgePacket(packet.nonce);
}

Example parsing code

const opcode = reader.uint8();

if (opcode === Opcode.Acknowledge) {
    const nonce = reader.uint16BE();
}

Example compose code

writer.uint8(0x0a);
writer.uint16BE(nonce);
writer.byte(0xFF);

Example packet

0000   0a 02 85 ff                                       ....