1 Minetest-c55 protocol (incomplete, early draft):
4 A custom protocol over UDP.
7 - A dummy reliable packet with peer_id=PEER_ID_INEXISTENT=0 is sent to the server:
8 - Actually this can be sent without the reliable packet header, too, i guess,
9 but the sequence number in the header allows the sender to re-send the
10 packet without accidentally getting a double initialization.
13 u32 protocol_id = PROTOCOL_ID = 0x4f457403
14 u16 sender_peer_id = PEER_ID_INEXISTENT = 0
16 # Reliable packet header
17 u8 type = TYPE_RELIABLE = 3
18 u16 seqnum = SEQNUM_INITIAL = 6550
19 # Original packet header
20 u8 type = TYPE_ORIGINAL = 1
21 # And no actual payload.
22 - Server responds with something like this:
25 u32 protocol_id = PROTOCOL_ID = 0x4f457403
26 u16 sender_peer_id = PEER_ID_INEXISTENT = 0
28 # Reliable packet header
29 u8 type = TYPE_RELIABLE = 3
30 u16 seqnum = SEQNUM_INITIAL = 6550
31 # Control packet header
32 u8 type = TYPE_CONTROL = 0
33 u8 controltype = CONTROLTYPE_SET_PEER_ID = 1
34 u16 peer_id_new = assigned peer id to client (other than 0 or 1)
35 - Then the connection can be disconnected by sending:
38 u32 protocol_id = PROTOCOL_ID = 0x4f457403
39 u16 sender_peer_id = whatever was gotten in CONTROLTYPE_SET_PEER_ID
41 # Control packet header
42 u8 type = TYPE_CONTROL = 0
43 u8 controltype = CONTROLTYPE_DISCO = 2