Ping

This page documents the raw UDP protocol of a server: the classic ping and LAN discovery, and our HELLOINFO (server details) and map preview. No ENet and no packet id: the first bytes of the datagram are the packet.

Connection

Open a raw UDP socket and send the datagram to the server's game port (32887 by convention). A server answers with a datagram to the source address.

UDP proves nobody's address, so a query is also a way to make a server send its answer to a forged victim. Our server therefore budgets answers per source address, and every answer is no larger than its query where it matters. Pad HELLOINFO to 1200 bytes: the padded query gets 5 answers a second (burst 10) per address, the bare 9-byte word only 0.5 (burst 3).

Packets

Ping Start

Client -> Server

LengthValueField TypeNotes
5 bytesHELLOStringfixed length, never send anything more

Ping Acknowledge

Server -> Client

LengthValueField TypeNotes
2 bytesHIStringfixed length

The round trip is the ping; halve it yourself.

Ping LAN

Client -> Server

LengthValueField TypeNotes
8 bytesHELLOLANStringfixed length

A server answers only to a local address (10/8, 172.16/12, 192.168/16, 127/8, 169.254/16, ::1, fc00::/7, fe80::/10). Send it as a broadcast and to 127.0.0.1 on ports 32882..32897 to find servers on the local network.

LAN Info

Server -> Client

LengthValueField TypeNotes
variablesee belowStringJSON
ParamNotes
nameserver name
players_currentplayers, bots included
players_maxslots
mapmap name
map_shape64 hex digits identifying the map
game_modemode name
game_version"1.0" or "0.75"
{"name":"Alpha","players_current":3,"players_max":32,"map":"Raindance",
 "map_shape":"<64 hex>","game_mode":"ctf","game_version":"1.0"}

Info Query

Client -> Server

HELLOINFO, padded to 1200 bytes with any bytes after the word.

LengthValueField TypeNotes
9 bytesHELLOINFOStringbare: heavily rate limited
1200 bytesHELLOINFO + paddingStringthe normal form

Info Answer

Server -> Client

LengthValueField TypeNotes
variablesee belowStringJSON, a few KB

kind is always "info".

ParamNotes
name, map, game_mode, packagestrings
map_shapeSHA-256 of the map's solid cells, 64 hex digits
map_previewbyte length of the top-view picture, 0 when there is none
protocol"1.0" or "0.75"
players_max, players_current, bots, humanscounts
teams[{name, score, players}, ...]
score_limitdecimal
features{perks, classes, assists, spotting, squad_spawn, aim_assist} booleans
classesclass titles, when the match has classes
rotationup to 32 map names
pluginscomma-separated names
playersup to 32 {name, team, kills, deaths, bot, ping}, best by kills

A 0.75/0.76 server of ours answers protocol: "0.75"; a third-party 0.75 server does not answer at all — do not ask it.

Map Preview

Client -> Server

The details panel can show the map's top view. It is a 256 x 256 RGB picture, zlib-compressed, framed as:

"SDP1" | Uint16 width | Uint16 height | zlib(RGB rows)

row 0 is map y 0. info.map_preview is the length of that stream and info.map_shape identifies it.

Ask for it in pieces:

LengthValueField TypeNotes
1200 bytesHELLOPREVIEW + Uint32 offset + paddingString + Uint32the query must be padded; a short one is refused

Map Preview Answer

Server -> Client

Field NameField TypeNotes
Magic4 bytes"SDPC"
TotalUint32the whole stream's length
OffsetUint32echoed
Shape64 bytesthe map's shape, hex, no NUL
DataUint8 arrayup to query size - 72 bytes of the stream

The answer is never larger than the query, so a forged source amplifies nothing. Keep up to 8 chunks in flight, ask again every 0.5 s, and give up after 3 s without a chunk (a slow link is not a failure). Check SDP1, the size and the inflate before showing it, and cache by map_shape. A browser cannot send UDP, so a web client has no preview.

Rate Limits

QueryAnswers a secondBurst
HELLOINFO, padded510
HELLOINFO, bare0.53
HELLOLAN510
HELLOPREVIEW4040
any answer the server sends20010

Refusals are counted and logged once a second (EVT net action=query_refused why=rate|rate_short|not_lan|preview_short count=).

Other Resources