Server Query Protocol (SQP)

Last updated: June 30, 2026

The Server Query Protocol (SQP) allows clients to retrieve information about a running game server using UDP/IP packets.

A client initiates queries by sending a ChallengeRequest to the server. In response, the server sends a ChallengeResponse that includes a ChallengeId. After the client receives the ChallengeResponse, it can continue to query the server for information.

Supported information

Game server state information that SQP supports includes:

  • Server name: The name of the game server

  • Build ID: The identifier of the game image the game server is running

  • Current players: The current number of connected players

  • Max players: The maximum number of players that can join the game server

  • IP address: The IP address of the machine the game server is hosted on

  • Port: The port by which clients can connect to the specific game server on the host machine

  • Game type: The game that the game server is running

  • Map: The game map that's currently loaded on the game server

Note: SQP works with the Multiplay Hosting game server monitoring process to ensure reports by the game server match the information in the platform's database.

Requirements

Before implementing SQP as the game server query protocol, you must populate the ServerInfoData object with all the game server information on the game client end. This ensures the game server reports the correct information.

Reference implementation

Refer to go-svrquery for an example implementation of SQP. go-svrquery is a Golang client for talking to game servers using various query protocols, including SQP.

Data types

All server queries consist of five basic types of data packed together into a data stream. All types are big-endian.

Name

Description

byte

An 8-bit character or an unsigned integer.

ushort

A 16-bit unsigned integer.

uint

A 32-bit unsigned integer.

ulong

A 64-bit unsigned integer.

string

A variable-length byte field, encoded in UTF-8, and prefixed with a byte containing the length of the string. Strings are limited to 255 bytes.

Request types

A client can make the following types of requests to a server:

Request

Response

ChallengeRequest

The server returns a challenge number for the client to use in query request responses.

QueryRequest with ServerInfo chunk

The server returns basic information about the server, for example, the current number of players, the max players, the game type, and the build ID.

Packet types

The following table shows the distinct types of SQP packets:

Packet type

Byte value

ChallengeRequest

0

ChallengeResponse

0

QueryRequest

1

QueryResponse

1

Headers

All SQP packets, whether requests or responses, contain a header with the following data:

Data

Type

Comment

Type

byte

Has the packet type. Refer to Packet types.

ChallengeToken

uint

The ChallengeTokenhas the challenge number. The challenge number is required for QueryRequestand QueryResponsepacket types. Refer to Challenge numbers.

Payload

N/A

Has the body of the packet (if the packet has a body).

Challenge numbers

SQP uses a challenge number, which is a random 32-bit integer, to ensure the client making query requests is the same client that received the challenge number.

When a client first sends a request to a server, the server randomly selects the challenge number and includes it in the packet header. The client must then include the same challenge number in the header of all following requests.

Response format

All chunk types share a standard response format for the first four fields (

VersionCurrentPacketLastPacket, and PacketLength). Information after the PacketLength field of a packet varies depending on the request type.

Standard response format

The following table has the part of the response that's the same for all chunk types.

Data

Type

Comment

Header

Refer to Headers.

Version

short

Has the version of SQP to use.

CurrentPacket

byte

Not supported. The value should always be 0.

LastPacket

byte

Not supported. The value should always be 0.

PacketLength

short

Has the length of the packet after this point.

ServerInfo response format

The ServerInfo response includes:

Data

Type

Comment

ChunkLength

int

Has the length of the 

ServerInfo

 chunk after this point.

CurrentPlayers

short

Has the number of players on the server.

MaxPlayers

short

Has the maximum number of players the server supports.

ServerName

string

Has the name of the server.

GameType

string

Has the game on the server.

BuildId

string

Has the version number or build ID of the server.

Map

string

Has the map the server currently has loaded.

Port

short

Has the game port the server has exposed.

Note: Refer to Standard response format for fields that don't vary between chunk types.

The following code snippet has an example of a  QueryResponse packet:

[0x00000000] 0x01 '\x1' unsigned char
[0x00000001] 0xc0 'À' unsigned char
[0x00000002] 0x7a 'z' unsigned char
[0x00000003] 0x6c 'l' unsigned char
[0x00000004] 0x3d '=' unsigned char
[0x00000005] 0x00 '\0' unsigned char
[0x00000006] 0x01 '\x1' unsigned char
[0x00000007] 0x00 '\0' unsigned char
[0x00000008] 0x00 '\0' unsigned char
[0x00000009] 0x00 '\0' unsigned char
[0x0000000a] 0x5b '[' unsigned char
[0x0000000b] 0x00 '\0' unsigned char
[0x0000000c] 0x00 '\0' unsigned char
[0x0000000d] 0x00 '\0' unsigned char
[0x0000000e] 0x57 'W' unsigned char
[0x0000000f] 0x00 '\0' unsigned char
[0x00000010] 0x00 '\0' unsigned char
[0x00000011] 0x00 '\0' unsigned char
[0x00000012] 0x10 '\x10' unsigned char
[0x00000013] 0x14 '\x14' unsigned char
[0x00000014] 0x55 'U' unsigned char
[0x00000015] 0x45 'E' unsigned char
[0x00000016] 0x34 '4' unsigned char
[0x00000017] 0x20 ' ' unsigned char
[0x00000018] 0x44 'D' unsigned char
[0x00000019] 0x65 'e' unsigned char
[0x0000001a] 0x64 'd' unsigned char
[0x0000001b] 0x69 'i' unsigned char
[0x0000001c] 0x63 'c' unsigned char
[0x0000001d] 0x61 'a' unsigned char
[0x0000001e] 0x74 't' unsigned char
[0x0000001f] 0x65 'e' unsigned char
[0x00000020] 0x64 'd' unsigned char
[0x00000021] 0x20 ' ' unsigned char
[0x00000022] 0x53 'S' unsigned char
[0x00000023] 0x65 'e' unsigned char
[0x00000024] 0x72 'r' unsigned char
[0x00000025] 0x76 'v' unsigned char
[0x00000026] 0x65 'e' unsigned char
[0x00000027] 0x72 'r' unsigned char
[0x00000028] 0x2e '.' unsigned char
[0x00000029] 0x2f '/' unsigned char
[0x0000002a] 0x53 'S' unsigned char
[0x0000002b] 0x63 'c' unsigned char
[0x0000002c] 0x72 'r' unsigned char
[0x0000002d] 0x69 'i' unsigned char
[0x0000002e] 0x70 'p' unsigned char
[0x0000002f] 0x74 't' unsigned char
[0x00000030] 0x2f '/' unsigned char
[0x00000031] 0x53 'S' unsigned char
[0x00000032] 0x68 'h' unsigned char
[0x00000033] 0x6f 'o' unsigned char
[0x00000034] 0x6f 'o' unsigned char
[0x00000035] 0x74 't' unsigned char
[0x00000036] 0x65 'e' unsigned char
[0x00000037] 0x72 'r' unsigned char
[0x00000038] 0x47 'G' unsigned char
[0x00000039] 0x61 'a' unsigned char
[0x0000003a] 0x6d 'm' unsigned char
[0x0000003b] 0x65 'e' unsigned char
[0x0000003c] 0x2e '.' unsigned char
[0x0000003d] 0x53 'S' unsigned char
[0x0000003e] 0x68 'h' unsigned char
[0x0000003f] 0x6f 'o' unsigned char
[0x00000040] 0x6f 'o' unsigned char
[0x00000041] 0x74 't' unsigned char
[0x00000042] 0x65 'e' unsigned char
[0x00000043] 0x72 'r' unsigned char
[0x00000044] 0x47 'G' unsigned char
[0x00000045] 0x61 'a' unsigned char
[0x00000046] 0x6d 'm' unsigned char
[0x00000047] 0x65 'e' unsigned char
[0x00000048] 0x5f '_' unsigned char
[0x00000049] 0x54 'T' unsigned char
[0x0000004a] 0x65 'e' unsigned char
[0x0000004b] 0x61 'a' unsigned char
[0x0000004c] 0x6d 'm' unsigned char
[0x0000004d] 0x44 'D' unsigned char
[0x0000004e] 0x65 'e' unsigned char
[0x0000004f] 0x61 'a' unsigned char
[0x00000050] 0x74 't' unsigned char
[0x00000051] 0x68 'h' unsigned char
[0x00000052] 0x4d 'M' unsigned char
[0x00000053] 0x61 'a' unsigned char
[0x00000054] 0x74 't' unsigned char
[0x00000055] 0x63 'c' unsigned char
[0x00000056] 0x68 'h' unsigned char
[0x00000057] 0x03 '\x3' unsigned char
[0x00000058] 0x30 '0' unsigned char
[0x00000059] 0x30 '0' unsigned char
[0x0000005a] 0x31 '1' unsigned char
[0x0000005b] 0x08 '\b' unsigned char
[0x0000005c] 0x48 'H' unsigned char
[0x0000005d] 0x69 'i' unsigned char
[0x0000005e] 0x67 'g' unsigned char
[0x0000005f] 0x68 'h' unsigned char
[0x00000060] 0x72 'r' unsigned char
[0x00000061] 0x69 'i' unsigned char
[0x00000062] 0x73 's' unsigned char
[0x00000063] 0x65 'e' unsigned char
[0x00000064] 0x1e '\x1e' unsigned char
[0x00000065] 0x61 'a' unsigned char