Skip to content
This repository was archived by the owner on Feb 12, 2021. It is now read-only.
Edward Smale edited this page Oct 24, 2020 · 5 revisions

A Hello packet is sent by the client to first identify itself with the server. It is identified by the opcode 0x08 and is reliable. It contains a username that the client must send.

Name Type Description
Nonce uint16 The acknowledgement identifier for the payload, the integer is in Big Endian.
Hazel Version uint8 The version of hazel being used, always 0x00
Client Version int32 The version of the client being used, e.g. 0x46d20203.
Username string The username of the client to be identified by.

Example parsing code

const opcode = reader.byte();

if (opcode === Opcode.Hello) {
    const nonce = reader.uint16BE();
    const hazelver = reader.byte();
    const clientver = reader.int32LE();
    const username = reader.string();
}

Example compose code

writer.byte(0x08);
writer.uint16BE(nonce);
writer.byte(0x00);
writer.int32BE(0x46d20203);
writer.string(username);

Example packet

0000   08 00 01 00 46 d2 02 03 08 77 65 61 6b 65 79 65   ....F....weakeye
0010   73                                                s
Clone this wiki locally