An open source master server for Unreal Tournament 2004, compatible with the GameSpy enctype 2 protocol used by openspy.net.
Built by reverse engineering the utmaster.openspy.net protocol from packet captures and the UT2004 IpDrv.dll binary via Ghidra.
- TCP master server on port 28902 — handles game client server list queries and game server uplinks
- UDP heartbeat listeners on ports 27900 and 28902 — receives server heartbeats
- HTTP management API on port 8090 — register servers and view status
- MOTD/news support — game client News tab populates with server messages
- Automatic server registration — game servers uplink via TCP, master detects port/gametype/name from refresh data
Client Master
| |
|<-------- challenge -----------|
|-------- auth (hashes) ------->|
|<-------- APPROVED ------------|
|-------- verification -------->|
|<-------- VERIFIED ------------|
|--- request (0x00=all/0x01=motd/0x02=filtered) -->|
|<--- server list / motd -------|
Server Master
| |
|<-------- challenge -----------|
|-------- auth (UE binary) ---->|
|<-------- APPROVED ------------|
|-------- state2 dwords ------->|
|<-- continue/heartbeat mode ---|
|-- state3 (revision, info) --->|
| (connection kept alive) |
|-- refresh (name/port/etc) --->| (fires after ~60s)
Binary format matches openspy.net exactly — server list entries, MOTD responses, and GameSpy challenge/response all verified against packet captures.
# Build
go build -o masterserver.exe ./cmd/masterserver/
# Run (all flags optional)
./masterserver.exe -tcp=28902 -udp=28902,27900 -http=8090 -timeout=300sVia HTTP API:
http://localhost:8090/register?ip=1.2.3.4&port=7777&query_port=7778
View registered servers:
http://localhost:8090/
Automatic: Configure your UT2004 server to uplink to this master:
[IpDrv.MasterServerUplink]
DoUplink=True
UplinkToGamespy=True
ServerBehindNAT=False
; Point to your master server:
MasterServerAddress=your-ip-here
MasterServerPort=28902| Flag | Default | Description |
|---|---|---|
-tcp |
28902 | TCP master server port |
-udp |
28902,27900 | UDP heartbeat ports (comma-separated) |
-http |
8090 | HTTP management API port |
-timeout |
300s | Server heartbeat timeout |
- UT2004 categorizes
127.0.0.1servers under the LAN tab, not Internet. Use your network IP for Internet tab visibility. - The News tab uses the MOTD protocol (client request type
0x01after VERIFIED). The response format uses GameSpy color codes (\x1b\xff\xff\xffprefix). - Server uplink initially registers with a default port. After ~60 seconds, the server sends a refresh packet containing the actual server name, port, and gametype.
MIT — use freely, modify, distribute.