SimTX API v24/Packets/Handshake
Appearance
| Frame | {{{frame}}}, field {{{field}}}
|
|---|---|
| Member | {{{member}}}
|
| Direction | Client → server |
| Session | All roles |
| Roles | |
| Permission | None |
| Answered by | HandshakeResult |
| Defined in |
|
The Handshake is the first data a client sends on a new connection, immediately after the TLS handshake. It identifies the protocol, states the protocol version, selects the session role, and optionally carries a game ticket. Unlike every other packet, it has no packet ID byte.
Layout
| Field | Type | Description |
|---|---|---|
magic |
i32 |
Always 0x53494D54, the ASCII bytes SIMT.
|
version |
i32 |
Protocol version. Must be 24.
|
role |
u8 |
Session role. See Roles. |
authKind |
u8 |
0 = ANONYMOUS, 1 = GAME_TICKET.
|
credential |
UTF |
Empty for anonymous connections. Otherwise the stx_gt1_ ticket. At most 512 characters, no control characters.
|
Roles
| Byte | Role | Authentication |
|---|---|---|
| 1 | RECEIVER |
Anonymous, or ticket role receiver
|
| 2 | TX_AUDIO |
Ticket role tx-audio
|
| 3 | TX_GENERATED |
Ticket role tx-generated
|
| 4 | CONTROL |
Anonymous, or ticket role control
|
| 5 | MODERATION |
Ticket role moderation
|
| 6 | TIMESTAMPED_RECEIVER |
Anonymous only |
Validation
authKind = 0requires an empty credential;authKind = 1requires a non-blank one.- A wrong magic number, an unknown
authKind, or an illegal credential (too long, control characters, or inconsistent withauthKind) closes the connection without a reply. - A wrong version is answered with HandshakeResult status
VERSION_UNSUPPORTED. - The handshake and the first session request must arrive within 5 seconds through the public gateway (15 seconds on a direct server).
Example
Transmitter handshake with a ticket (ticket shortened):
53 49 4D 54 magic "SIMT"
00 00 00 18 version 24
02 role TX_AUDIO
01 authKind GAME_TICKET
00 48 credential length 72
73 74 78 5F 67 74 31 5F … "stx_gt1_…"