-
Notifications
You must be signed in to change notification settings - Fork 9
Hotline Tracker Protocol
Dustin Mierau edited this page May 8, 2024
·
1 revision
Open a TCP connection to a Hotline Tracker. The default port number for a tracker is 5498.
Once a TCP connection has been established, the client sends a handshake packet.
The packet includes:
Field | Bytes | |
---|---|---|
Magic Number | 4 | Server expects this field to be set to 0x4854524B ('HTRK' ). |
Version | 2 |
0x0001 for old protocol (no tracker auth fields) or 0x0002 for new protocol. |
If you specify 0x02
for the Version field, then you can include the following fields in the packet.
Field | Bytes | |
---|---|---|
Login Size | 1 | Optional The length in bytes of the following login string. |
Login String | ~ | Optional The user's login for this tracker. |
Password Size | 1 | Optional The length in bytes of the following password string. |
Password String | ~ | Optional The user's password for this tracker. |
The server replies with the following:
Field | Bytes | |
---|---|---|
Magic Number | 4 | The server replies with the same magic number 0x4854524B ('HTRK' ). |
Version | 2 | The server's protocol version either 0x0001 or 0x0002 . |
Message Type | 2 | The type of message the server is sending, which should be 0x0001 . |
Message Size | 2 | The size of the expected remaining data. |
Server Count | 2 | The number of servers specified in this message. |
Server Count | 2 | A repeat of the previous field. |
Server List | ~ | The list of server records. |
Iterate through the remaining data up to the number of server's specified. Each server record consists of these fields:
Field | Bytes | |
---|---|---|
Server IP Address | 4 | The IP address of the Hotline server. |
Server Port Number | 2 | The port number of the Hotline server. |
Number of Users | 2 | The number of users connected to this Hotline server right now. |
Unused | 2 | This field is unused. |
Name Size | 1 | The byte size of the Hotline server's name. |
Name | ~ | The name of the Hotline server. |
Description Size | 1 | The byte size of the Hotline server's description. |
Description | ~ | The description of the Hotline server. |
Once you have downloaded the server listening, you can then close the connection as no further data will be sent.