SimTX API v24/Packets/Handshake: Difference between revisions
Appearance
m Clanker moved page SimTX API/Packets/Handshake to SimTX API v24/Packets/Handshake: Archive the v24 protocol reference |
Archive the v24 protocol reference: use the v24 templates, links and categories |
||
| Line 1: | Line 1: | ||
{{SimTX API navigation}} | {{SimTX API v24 navigation}} | ||
{{SimTX packet | {{SimTX packet v24 | ||
| name = Handshake | | name = Handshake | ||
| id = — | | id = — | ||
| direction = c2s | | direction = c2s | ||
| session = [[SimTX API/Connection and handshake|All roles]] | | session = [[SimTX API v24/Connection and handshake|All roles]] | ||
| size = 12 bytes + credential | | size = 12 bytes + credential | ||
| permission = None | | permission = None | ||
| reply = [[SimTX API/Packets/HandshakeResult|HandshakeResult]] | | reply = [[SimTX API v24/Packets/HandshakeResult|HandshakeResult]] | ||
| group = handshake | | group = handshake | ||
}} | }} | ||
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 [[SimTX API/Game tickets|game ticket]]. Unlike every other packet, it has no packet ID byte. | 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 [[SimTX API v24/Game tickets|game ticket]]. Unlike every other packet, it has no packet ID byte. | ||
== Layout == | == Layout == | ||
| Line 47: | Line 47: | ||
* <code>authKind = 0</code> requires an empty credential; <code>authKind = 1</code> requires a non-blank one. | * <code>authKind = 0</code> requires an empty credential; <code>authKind = 1</code> requires a non-blank one. | ||
* A wrong magic number, an unknown <code>authKind</code>, or an illegal credential (too long, control characters, or inconsistent with <code>authKind</code>) closes the connection '''without a reply'''. | * A wrong magic number, an unknown <code>authKind</code>, or an illegal credential (too long, control characters, or inconsistent with <code>authKind</code>) closes the connection '''without a reply'''. | ||
* A wrong version is answered with [[SimTX API/Packets/HandshakeResult|HandshakeResult]] status <code>VERSION_UNSUPPORTED</code>. | * A wrong version is answered with [[SimTX API v24/Packets/HandshakeResult|HandshakeResult]] status <code>VERSION_UNSUPPORTED</code>. | ||
* The handshake and the first session request must arrive within 5 seconds through the public gateway (15 seconds on a direct server). | * The handshake and the first session request must arrive within 5 seconds through the public gateway (15 seconds on a direct server). | ||
| Line 63: | Line 63: | ||
== See also == | == See also == | ||
* [[SimTX API/Connection and handshake]] | * [[SimTX API v24/Connection and handshake]] | ||
* [[SimTX API/Game tickets]] | * [[SimTX API v24/Game tickets]] | ||
{{SimTX API navbox}} | {{SimTX API v24 navbox}} | ||
[[Category:SimTX API]] | [[Category:SimTX API v24]] | ||
Latest revision as of 16:15, 24 October 2026
| Packet ID | —
|
|---|---|
| Direction | Client → server |
| Session | All roles |
| Body size | 12 bytes + credential |
| Permission | None |
| Answered by | HandshakeResult |
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[edit | edit source]
| 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[edit | edit source]
| 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[edit | edit source]
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[edit | edit source]
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_…"