... 
Warning:This translation template will
soon be deprecated.
Please replace {{Lang}}
to
{{MultiPage}}
if possible.
You can query information from a running game server using UDP/IP packets. This document describes the packet formats and protocol to access this data.
Data Types
All server queries consist of five basic types of data packed together into a data stream. All types are little endian, which is the default on most languages on x86 CPUs. Java users should use ByteBuffer to convert.
Name |
Description
|
byte |
8 bit character or unsigned integer
|
short |
16 bit signed integer
|
long |
32 bit signed integer
|
float |
32 bit floating point
|
long long |
64 bit unsigned integer
|
string |
variable-length byte field, encoded in UTF-8, terminated by 0x00
|
Protocol
Steam uses a packet size of 1400 bytes + IP/UDP headers. If a request or response needs more packets for the data it starts the packets with an additional header.
Simple Response Format
Data |
Type |
Comment
|
Header |
long |
Always equal to -1 (0xFFFFFFFF). Means it isn't split.
|
Payload
|
Multi-packet Response Format
Data |
Type |
Comment
|
Header |
long |
Always equal to -2 (0xFFFFFFFE). Means the packet is split.
|
ID |
long |
Unique number assigned by server per answer.
|
Packet number |
byte |
Upper 4 bits represent the number of the current packet (starting at 0) and bottom 4 bits represent the total number of packets (2 to 15).
|
Payload
|
Data |
Type |
Comment
|
Header |
long |
Always equal to -2 (0xFFFFFFFE). Means the packet is split.
|
ID |
long |
Same as the Goldsource server meaning. However, if the most significant bit is 1, then the response was compressed with bzip2 before being cut and sent. Refer to compression procedure below.
|
Total |
byte |
The total number of packets in the response.
|
Number |
byte |
The number of the packet. Starts at 0.
|
Size |
short |
(Orange Box Engine and above only.) Maximum size of packet before packet switching occurs. The default value is 1248 bytes (0x04E0), but the server administrator can decrease this. For older engine versions: the maximum and minimum size of the packet was unchangeable. AppIDs which are known not to contain this field: 215, 17550, 17700, and 240 when protocol = 7.
|
This is only present in the first packet of the response and only if the response is being compressed.
Data |
Type |
Comment
|
Size |
long |
Size of the whole response once it is decompressed.
|
CRC32 sum |
long |
CRC32 checksum of uncompressed response.
|
To uncompress this response: collect and assemble all the payloads of the received packets, then pass that into a function like BZ2_bzBuffToBuffDecompress() in C, bzdecompress() in PHP, or bz2.decompress() in Python. Compression appears to have been phased out in newer Source games, but is still present in ~2006-era engines.
|
Payload
|
Because UDP packets can arrive in different order or delayed, every packet should be verified by its "ID" and "Number"! Every request or response with or without this header is continued with an integer -1 (0xFFFFFFFF) and the user data.
So by reading the first 4 bytes you can decide whether the data is split (-2) or in one packet (-1).
Requests
The server responds to 5 queries:
A2S_INFO
- Basic information about the server.
A2S_PLAYER
- Details about each player on the server.
A2S_RULES
- The rules the server is using.
A2A_PING
- Ping the server. (DEPRECATED)
A2S_SERVERQUERY_GETCHALLENGE
- Returns a challenge number for use in the player and rules query. (DEPRECATED)
Queries should be sent in UDP packets to the listen port of the server.
A2S_INFO
Retrieves information about the server including, but not limited to: its name, the map currently being played, and the number of players.
l4d2 server 2.2.1.3 update:some server will send challenge number ,it caused hlsw cant get server info;
Request Format
Data |
Type |
Value
|
Header |
byte |
'T' (0x54)
|
Payload |
string |
"Source Engine Query\0"
|
Challenge |
long |
4-byte challenge (sometimes -- see below)
|
FF FF FF FF 54 53 6F 75 72 63 65 20 45 6E 67 69 ÿÿÿÿTSource Engi
6E 65 20 51 75 65 72 79 00 ne Query.
|
Example for challenge number:
Server response:
FF FF FF FF 41 0A 08 5E EA
|
You need send :
FF FF FF FF 54 53 6F 75 72 63 65 20 45 6E 67 69 6E 65 20 51 75 65 72 79 00 0A 08 5E EA
|
NOTE: In the future, additional data may be appended to the request! Do not assume that if a request has extra data, that it is a bogus packet!
Servers may respond with the data immediately. However, since this reply is larger than the request, it makes the server vulnerable to a reflection amplification attack.
Instead, the server may reply with a challenge to the client using S2C_CHALLENGE ('A' or 0x41). In that case, the client should repeat the request by appending the challenge number.
This change was introduced in December 2020 to address the reflection attack vulnerability, and all clients are encouraged to support the new protocol. See this post for more info.
NOTE:changed 2021-6-19 13:05:43 :when l4d2 server received some packet from same ip address,it may deined replay
Response Format
Data |
Type |
Comment
|
Header |
byte |
Always equal to 'I' (0x49)
|
Protocol |
byte |
Protocol version used by the server.
|
Name |
string |
Name of the server.
|
Map |
string |
Map the server has currently loaded.
|
Folder |
string |
Name of the folder containing the game files.
|
Game |
string |
Full name of the game.
|
ID |
short |
Steam Application ID of game.
|
Players |
byte |
Number of players on the server.
|
Max. Players |
byte |
Maximum number of players the server reports it can hold.
|
Bots |
byte |
Number of bots on the server.
|
Server type |
byte |
Indicates the type of server: - 'd' for a dedicated server
- 'l' for a non-dedicated server
- 'p' for a SourceTV relay (proxy)
|
Environment |
byte |
Indicates the operating system of the server: - 'l' for Linux
- 'w' for Windows
- 'm' or 'o' for Mac (the code changed after L4D1)
|
Visibility |
byte |
Indicates whether the server requires a password: - 0 for public
- 1 for private
|
VAC |
byte |
Specifies whether the server uses VAC: - 0 for unsecured
- 1 for secured
|
These fields only exist in a response if the server is running The Ship:
Data |
Type |
Comment
|
Mode |
byte |
Indicates the game mode: - 0 for Hunt
- 1 for Elimination
- 2 for Duel
- 3 for Deathmatch
- 4 for VIP Team
- 5 for Team Elimination
|
Witnesses |
byte |
The number of witnesses necessary to have a player arrested.
|
Duration |
byte |
Time (in seconds) before a player is arrested while being witnessed.
|
|
Version |
string |
Version of the game installed on the server.
|
Extra Data Flag (EDF) |
byte |
If present, this specifies which additional data fields will be included.
|
Only if if ( EDF & 0x80 ) proves true:
Data |
Type |
Comment
|
Port |
short |
The server's game port number.
|
|
Only if if ( EDF & 0x10 ) proves true:
|
Only if if ( EDF & 0x40 ) proves true:
Data |
Type |
Comment
|
Port |
short |
Spectator port number for SourceTV.
|
Name |
string |
Name of the spectator server for SourceTV.
|
|
Only if if ( EDF & 0x20 ) proves true:
Data |
Type |
Comment
|
Keywords |
string |
Tags that describe the game according to the server (for future use.)
|
|
Only if if ( EDF & 0x01 ) proves true:
Data |
Type |
Comment
|
GameID |
long long |
The server's 64-bit GameID. If this is present, a more accurate AppID is present in the low 24 bits. The earlier AppID could have been truncated as it was forced into 16-bit storage.
|
|
Example response for Counter-Strike: Source:
FF FF FF FF 49 02 67 61 6D 65 32 78 73 2E 63 6F ÿÿÿÿI.game2xs.co
6D 20 43 6F 75 6E 74 65 72 2D 53 74 72 69 6B 65 m Counter-Strike
20 53 6F 75 72 63 65 20 23 31 00 64 65 5F 64 75 Source #1.de_du
73 74 00 63 73 74 72 69 6B 65 00 43 6F 75 6E 74 st.cstrike.Count
65 72 2D 53 74 72 69 6B 65 3A 20 53 6F 75 72 63 er-Strike: Sourc
65 00 F0 00 05 10 04 64 6C 00 00 31 2E 30 2E 30 e......dl..1.0.0
2E 32 32 00 .22.
|
Example response for The Ship:
FF FF FF FF 49 07 53 68 69 70 20 53 65 72 76 65 ÿÿÿÿI.Ship Serve
72 00 62 61 74 61 76 69 65 72 00 73 68 69 70 00 r.batavier.ship.
54 68 65 20 53 68 69 70 00 60 09 01 05 00 6C 77 The Ship.`....lw
00 00 01 03 03 31 2E 30 2E 30 2E 34 00 .....1.0.0.4.
|
Example response for SiN 1 Multiplayer:
FF FF FF FF 49 2F 53 65 6E 73 65 6D 61 6E 6E 20 ÿÿÿÿI/Sensemann
53 69 4E 20 44 4D 00 70 61 72 61 64 6F 78 00 53 SiN DM.paradox.S
69 4E 20 31 00 53 69 4E 20 31 00 1D 05 00 10 00 iN 1.SiN 1......
6C 77 00 00 31 2E 30 2E 30 2E 30 00 lw..1.0.0.0.
|
Example response for Rag Doll Kung Fu:
FF FF FF FF 49 FC 54 68 65 20 44 75 64 65 27 73 ÿÿÿÿIüThe Dude's
20 64 6F 6A 6F 00 53 6F 63 63 65 72 00 52 44 4B dojo.Soccer.RDK
46 53 6F 63 63 65 72 00 52 61 67 44 6F 6C 6C 4B FSoccer.RagDollK
75 6E 67 46 75 3A 20 53 6F 63 63 65 72 00 EA 03 ungFu: Soccer.ê.
01 04 00 00 77 00 00 32 2E 33 2E 30 2E 30 00 ....w..2.3.0.0.
|
GoldSource servers reply using the same response as Source servers. Older and pre-Steam servers still reply with the response format below. GoldSource can be distinguished from Source via AppIDs.
Data |
Type |
Comment
|
Header |
byte |
Always equal to 'm' (0x6D)
|
Address |
string |
IP address and port of the server.
|
Name |
string |
Name of the server.
|
Map |
string |
Map the server has currently loaded.
|
Folder |
string |
Name of the folder containing the game files.
|
Game |
string |
Full name of the game.
|
Players |
byte |
Number of players on the server.
|
Max. Players |
byte |
Maximum number of players the server reports it can hold.
|
Protocol |
byte |
Protocol version used by the server.
|
Server type |
byte |
Indicates the type of server: - 'D' for dedicated server
- 'L' for non-dedicated server
- 'P' for a HLTV server
|
Environment |
byte |
Indicates the operating system of the server: - 'L' for Linux
- 'W' for Windows
|
Visibility |
byte |
Indicates whether the server requires a password: - 0 for public
- 1 for private
|
Mod |
byte |
Indicates whether the game is a mod:
|
These fields are only present in the response if "Mod" is 1:
Data |
Type |
Comment
|
Link |
string |
URL to mod website.
|
Download Link |
string |
URL to download the mod.
|
NULL |
byte |
NULL byte (0x00)
|
Version |
long |
Version of mod installed on server.
|
Size |
long |
Space (in bytes) the mod takes up.
|
Type |
byte |
Indicates the type of mod: - 0 for single and multiplayer mod
- 1 for multiplayer only mod
|
DLL |
byte |
Indicates whether mod uses its own DLL: - 0 if it uses the Half-Life DLL
- 1 if it uses its own DLL
|
|
VAC |
byte |
Specifies whether the server uses VAC: - 0 for unsecured
- 1 for secured
|
Bots |
byte |
Number of bots on the server.
|
Note: HLTV servers may respond with a late request that is either incomplete or incorrect if the number of slots is 255.
Example response:
FF FF FF FF 6D 37 37 2E 31 31 31 2E 31 39 34 2E ÿÿÿÿm77.111.194.
31 31 30 3A 32 37 30 31 35 00 46 52 20 2D 20 56 110:27015.FR - V
65 72 79 47 61 6D 65 73 2E 6E 65 74 20 2D 20 44 eryGames.net - D
65 61 74 6D 61 74 63 68 20 2D 20 6F 6E 6C 79 20 eatmatch - only
73 75 72 66 5F 73 6B 69 20 2D 20 6E 67 52 00 73 surf_ski - ngR.s
75 72 66 5F 73 6B 69 00 63 73 74 72 69 6B 65 00 urf_ski.cstrike.
43 6F 75 6E 74 65 72 2D 53 74 72 69 6B 65 00 0C Counter-Strike..
12 2F 64 6C 00 01 77 77 77 2E 63 6F 75 6E 74 65 ./dl..www.counte
72 2D 73 74 72 69 6B 65 2E 6E 65 74 00 00 00 01 r-strike.net....
00 00 00 00 9E F7 0A 00 01 01 00 ....ž÷.....
|
A2S_PLAYER
This query retrieves information about the players currently on the server. It needs an initial step to acquire a challenge number.
Note: SourceTV does not respond to this request.
Request Format
Data |
Type |
Value
|
Header |
byte |
'U' (0x55)
|
Challenge |
int |
Challenge number, or -1 (0xFFFFFFFF) to receive a challenge number.
|
Challenge response format:
Data |
Type |
Value
|
Header |
byte |
'A' (0x41)
|
Challenge |
int |
Challenge number.
|
Example challenge request:
FF FF FF FF 55 FF FF FF FF ÿÿÿÿUÿÿÿÿ"
|
Example challenge response:
FF FF FF FF 41 4B A1 D5 22 ÿÿÿÿAÿÿÿÿ"
|
Example A2S_PLAYER request with the received challenge number:
FF FF FF FF 55 4B A1 D5 22 ÿÿÿÿUÿÿÿÿ"
|
Response Format
Data |
Type |
Comment
|
Header |
byte |
Always equal to 'D' (0x44)
|
Players |
byte |
Number of players whose information was gathered.
|
For every player in "Players" there is this chunk in the response:
Data |
Type |
Comment
|
Index |
byte |
Index of player chunk starting from 0.
|
Name |
string |
Name of the player.
|
Score |
long |
Player's score (usually "frags" or "kills".)
|
Duration |
float |
Time (in seconds) player has been connected to the server.
|
|
The Ship additional player info (comes after the basic information in the packet):
Data |
Type |
Comment
|
Deaths |
long |
Player's deaths
|
Money |
long |
Player's money
|
Note: When a player is trying to connect to a server, they are recorded in the number of players. However, they will not be in the list of player information chunks.
Warning: CS:GO Server by default returns only max players and server uptime. You have to change server cvar "host_players_show" in server.cfg to value "2" if you want to revert to old format with players list.
Example response:
FF FF FF FF 44 02 01 5B 44 5D 2D 2D 2D 2D 3E 54 ÿÿÿÿD..[D]---->T
2E 4E 2E 57 3C 2D 2D 2D 2D 00 0E 00 00 00 B4 97 .N.W<----.....´—
00 44 02 4B 69 6C 6C 65 72 20 21 21 21 00 05 00 .D.Killer !!!...
00 00 69 24 D9 43 ..i$ÙC
|
The Ship response:
FF FF FF FF 44 13 00 53 68 69 70 6D 61 74 65 31 ▒▒▒▒D..Shipmate1
00 00 00 00 00 00 00 80 BF 01 53 68 69 70 6D 61 .......▒▒.Shipma
74 65 32 00 00 00 00 00 00 00 80 BF 02 53 68 69 te2.......▒▒.Shi
70 6D 61 74 65 33 00 00 00 00 00 00 00 80 BF 03 pmate3.......▒▒.
53 68 69 70 6D 61 74 65 34 00 00 00 00 00 00 00 Shipmate4.......
80 BF 04 53 68 69 70 6D 61 74 65 35 00 00 00 00 ▒▒.Shipmate5....
00 00 00 80 BF 07 28 31 29 4C 61 6E 64 4C 75 62 ...▒▒.(1)LandLub
62 65 72 00 00 00 00 00 D3 8E 68 45 00 00 00 00 ber.....ӎhE....
C4 09 00 00 00 00 00 00 C4 09 00 00 00 00 00 00 ▒.......▒.......
C4 09 00 00 00 00 00 00 C4 09 00 00 00 00 00 00 ▒.......▒.......
C4 09 00 00 00 00 00 00 C4 09 00 00 ▒.......▒...
|
A2S_RULES
Returns the server rules, or configuration variables in name/value pairs. This query requires an initial challenge step.
The Console variables included are the ones marked with FCVAR_NOTIFY as well as any additional ones listed in the server configuration.
Request Format
Data |
Type |
Value
|
Header |
byte |
'V' (0x56)
|
Challenge |
long |
Challenge number, or -1 (0xFFFFFFFF) to receive a challenge number.
|
Challenge response format:
Data |
Type |
Value
|
Header |
byte |
'A' (0x41)
|
Challenge |
long |
Challenge number.
|
Example challenge request:
FF FF FF FF 56 FF FF FF FF ÿÿÿÿVÿÿÿÿ"
|
Example challenge response:
FF FF FF FF 41 4B A1 D5 22 ÿÿÿÿVK¡Õ"
|
Warning: Some servers will bypass replying with a challenge, and instead will immediately send a full rules response. This has been observed in a few servers that have modified their network code and in servers running older engines. A simple way to detect this situation is if the packet header is -2 (0xFFFFFFFE), or -1 (0xFFFFFFFF) with a message header of 0x45 ('E').
Warning: CS:GO Rules reply is broken since update CSGO 1.32.3.0 (Feb 21, 2014). Before the update rules got truncated when exceeding MTU, after the update rules reply is not sent at all. You can also see a console message: [NET] Cannot send connectionless packet to xxx.xxx.xxx.xxx:xxxxx '0x45' exceeding MTU (2644)
Final request that includes the received challenge number:
FF FF FF FF 56 4B A1 D5 22 ÿÿÿÿVK¡Õ"
|
Response Format
Note: Responses to this query are usually multi-packeted.
Data |
Type |
Comment
|
Header |
byte |
Always equal to 'E' (0x45)
|
Rules |
short |
Number of rules in the response.
|
For every rule in "Rules" there is this chunk in the response:
Data |
Type |
Comment
|
Name |
string |
Name of the rule.
|
Value |
string |
Value of the rule.
|
|
Warning: Older games, usually on Source SDK 2007, may reply with a truncated single packet reply. In this case, the message may be terminated in the middle of a string or in between a name and value.
Example response:
FE FF FF FF 56 0A 00 00 02 FF FF FF FF 45 5D 00 þÿÿÿV....ÿÿÿÿE].
5F 74 75 74 6F 72 5F 62 6F 6D 62 5F 76 69 65 77 _tutor_bomb_view
61 62 6C 65 5F 63 68 65 63 6B 5F 69 6E 74 65 72 able_check_inter
76 61 6C 00 30 2E 35 00 5F 74 75 74 6F 72 5F 64 val.0.5._tutor_d
65 62 75 67 5F 6C 65 76 65 6C 00 30 00 5F 74 75 ebug_level.0._tu
74 6F 72 5F 65 78 61 6D 69 6E 65 5F 74 69 6D 65 tor_examine_time
00 30 2E 35 00 5F 74 75 74 6F 72 5F 68 69 6E 74 .0.5._tutor_hint
5F 69 6E 74 65 72 76 61 6C 5F 74 69 6D 65 00 31 _interval_time.1
30 2E 30 00 5F 74 75 74 6F 72 5F 6C 6F 6F 6B 5F 0.0._tutor_look_
61 6E 67 6C 65 00 31 30 00 5F 74 75 74 6F 72 5F angle.10._tutor_
6C 6F 6F 6B 5F 64 69 73 74 61 6E 63 65 00 32 30 look_distance.20
30 00 5F 74 75 74 6F 72 5F 6D 65 73 73 61 67 65 0._tutor_message
5F 63 68 61 72 61 63 74 65 72 5F 64 69 73 70 6C _character_displ
61 79 5F 74 69 6D 65 5F 63 6F 65 66 66 69 63 69 ay_time_coeffici
65 6E 74 00 30 2E 30 37 00 5F 74 75 74 6F 72 5F ent.0.07._tutor_
6D 65 73 73 61 67 65 5F 6D 69 6E 69 6D 75 6D 5F message_minimum_
64 69 73 70 6C 61 79 5F 74 69 6D 65 00 31 00 5F display_time.1._
74 75 74 6F 72 5F 6D 65 73 73 61 67 65 5F 72 65 tutor_message_re
70 65 61 74 73 00 35 00 5F 74 75 74 6F 72 5F 76 peats.5._tutor_v
69 65 77 5F 64 69 73 74 61 6E 63 65 00 31 30 30 iew_distance.100
30 00 61 6C 6C 6F 77 5F 73 70 65 63 74 61 74 6F 0.allow_spectato
72 73 00 31 00 61 6D 78 5F 63 6C 69 65 6E 74 5F rs.1.amx_client_
6C 61 6E 67 75 61 67 65 73 00 31 00 61 6D 78 5F languages.1.amx_
6C 61 6E 67 75 61 67 65 00 66 72 00 61 6D 78 5F language.fr.amx_
6E 65 78 74 6D 61 70 00 64 65 5F 61 7A 74 65 63 nextmap.de_aztec
00 61 6D 78 5F 74 69 6D 65 6C 65 66 74 00 30 30 .amx_timeleft.00
3A 30 30 00 61 6D 78 6D 6F 64 78 5F 76 65 72 73 :00.amxmodx_vers
69 6F 6E 00 31 2E 37 36 64 00 63 6F 6F 70 00 30 ion.1.76d.coop.0
00 63 73 64 6D 5F 61 63 74 69 76 65 00 31 00 63 .csdm_active.1.c
73 64 6D 5F 76 65 72 73 69 6F 6E 00 32 2E 31 00 sdm_version.2.1.
64 65 61 74 68 6D 61 74 63 68 00 31 00 64 65 63 deathmatch.1.dec
61 6C 66 72 65 71 75 65 6E 63 79 00 36 30 00 65 alfrequency.60.e
64 67 65 66 72 69 63 74 69 6F 6E 00 32 00 68 6F dgefriction.2.ho
73 74 61 67 65 5F 64 65 62 75 67 00 30 00 68 6F stage_debug.0.ho
73 74 61 67 65 5F 73 74 6F 70 00 30 00 68 75 6D stage_stop.0.hum
61 6E 73 5F 6A 6F 69 6E 5F 74 65 61 6D 00 61 6E ans_join_team.an
79 00 6A 74 70 31 30 31 38 31 00 63 68 75 74 65 y.jtp10181.chute
00 6D 61 78 5F 71 75 65 72 69 65 73 5F 73 65 63 .max_queries_sec
00 31 00 6D 61 78 5F 71 75 65 72 69 65 73 5F 73 .1.max_queries_s
65 63 5F 67 6C 6F 62 61 6C 00 31 00 6D 61 78 5F ec_global.1.max_
71 75 65 72 69 65 73 5F 77 69 6E 64 6F 77 00 31 queries_window.1
00 6D 65 74 61 6D 6F 64 5F 76 65 72 73 69 6F 6E .metamod_version
00 31 2E 31 39 00 6D 70 5F 61 6C 6C 6F 77 6D 6F .1.19.mp_allowmo
6E 73 74 65 72 73 00 30 00 6D 70 5F 61 75 74 6F nsters.0.mp_auto
6B 69 63 6B 00 30 00 6D 70 5F 61 75 74 6F 74 65 kick.0.mp_autote
61 6D 62 61 6C 61 6E 63 65 00 30 00 6D 70 5F 62 ambalance.0.mp_b
75 79 74 69 6D 65 00 39 39 39 39 00 6D 70 5F 63 uytime.9999.mp_c
34 74 69 6D 65 72 00 33 35 00 6D 70 5F 63 68 61 4timer.35.mp_cha
74 74 69 6D 65 00 35 00 6D 70 5F 63 6F 6E 73 69 ttime.5.mp_consi
73 74 65 6E 63 79 00 31 00 6D 70 5F 66 61 64 65 stency.1.mp_fade
74 6F 62 6C 61 63 6B 00 30 00 6D 70 5F 66 6C 61 toblack.0.mp_fla
73 68 6C 69 67 68 74 00 31 00 6D 70 5F 66 6F 6F shlight.1.mp_foo
74 73 74 65 70 73 00 31 00 6D 70 5F 66 6F 72 63 tsteps.1.mp_forc
65 63 61 6D 65 72 61 00 30 00 6D 70 5F 66 6F 72 ecamera.0.mp_for
63 65 63 68 61 73 65 63 61 6D 00 30 00 6D 70 5F cechasecam.0.mp_
66 72 61 67 73 6C 65 66 74 00 30 00 6D 70 5F 66 fragsleft.0.mp_f
72 65 65 66 6F 72 61 6C 6C 00 30 00 6D 70 5F 66 reeforall.0.mp_f
72 65 65 7A 65 74 69 6D 65 00 32 00 6D 70 5F 66 reezetime.2.mp_f
72 69 65 6E 64 6C 79 66 69 72 65 00 30 00 6D 70 riendlyfire.0.mp
5F 67 68 6F 73 74 66 72 65 71 75 65 6E 63 79 00 _ghostfrequency.
30 2E 31 00 6D 70 5F 68 6F 73 74 61 67 65 70 65 0.1.mp_hostagepe
6E 61 6C 74 79 00 31 33 00 6D 70 5F 6B 69 63 6B nalty.13.mp_kick
70 65 72 63 65 6E 74 00 30 00 6D 70 5F 6C 69 6D percent.0.mp_lim
69 74 74 65 61 6D 73 00 30 00 6D 70 5F 6C 6F 67 itteams.0.mp_log
64 65 74 61 69 6C 00 33 00 6D 70 5F 6C 6F 67 66 detail.3.mp_logf
69 6C 65 00 31 00 6D 70 5F 6C 6F 67 6D 65 73 73 ile.1.mp_logmess
61 67 65 73 00 31 00 6D 70 5F 6D 61 70 76 6F 74 ages.1.mp_mapvot
65 72 61 74 69 6F 00 31 00 6D 70 5F 6D 61 78 72 eratio.1.mp_maxr
6F 75 6E 64 73 00 30 00 6D 70 5F 6D 69 72 72 6F ounds.0.mp_mirro
72 64 61 6D 61 67 65 00 30 00 6D 70 5F 70 6C 61 rdamage.0.mp_pla
79 65 72 69 64 00 30 00 6D 70 5F 72 6F 75 6E 64 yerid.0.mp_round
74 69 6D 65 00 33 00 6D 70 5F 73 74 61 72 74 6D time.3.mp_startm
6F 6E 65 79 00 38 30 30 00 6D 70 5F 74 69 6D 65 oney.800.mp_time
6C 65 66 74 00 30 00 6D 70 5F 74 69 6D 65 6C 69 left.0.mp_timeli
6D 69 74 00 30 00 6D 70 5F 74 6B 70 75 6E 69 73 mit.0.mp_tkpunis
68 00 30 00 6D 70 5F 77 69 6E 64 69 66 66 65 72 h.0.mp_windiffer
65 6E 63 65 00 31 00 6D 70 5F 77 69 6E 6C 69 6D ence.1.mp_winlim
69 74 00 30 00 70 61 75 73 61 62 6C 65 00 31 00 it.0.pausable.1.
73 76 5F 61 63 63 65 6C 65 72 61 74 65 00 35 00 sv_accelerate.5.
73 76 5F 61 69 6D 00 30 00 73 76 5F 61 69 72 61 sv_aim.0.sv_aira
63 63 65 6C 65 72 61 74 65 00 31 30 30 00 73 76 ccelerate.100.sv
5F 61 69 72 6D 6F 76 65 00 31 00 73 76 5F 61 6C _airmove.1.sv_al
6C 6F 77 75 70 6C 6F 61 64 00 31 00 73 76 5F 61 lowupload.1.sv_a
6C 6C 74 61 6C 6B 00 31 00 73 76 5F 62 6F 75 6E lltalk.1.sv_boun
63 65 00 31 00 73 76 5F 63 68 65 61 74 73 00 30 ce.1.sv_cheats.0
00 73 76 5F 63 6C 69 65 6E 74 74 72 61 63 65 00 .sv_clienttrace.
31 00 73 76 5F 63 6C 69 70 6D 6F 64 65 00 30 00 1.sv_clipmode.0.
73 76 5F 63 6F 6E 74 61 sv_conta
FE FF FF FF 56 0A 00 00 12 63 74 00 00 73 76 5F þÿÿÿV....ct..sv_
66 72 69 63 74 69 6F 6E 00 34 00 73 76 5F 67 72 friction.4.sv_gr
61 76 69 74 79 00 37 35 30 00 73 76 5F 6C 6F 67 avity.750.sv_log
62 6C 6F 63 6B 73 00 30 00 73 76 5F 6D 61 78 72 blocks.0.sv_maxr
61 74 65 00 32 35 30 30 30 00 73 76 5F 6D 61 78 ate.25000.sv_max
73 70 65 65 64 00 33 32 30 00 73 76 5F 6D 69 6E speed.320.sv_min
72 61 74 65 00 31 35 30 30 30 00 73 76 5F 70 61 rate.15000.sv_pa
73 73 77 6F 72 64 00 30 00 73 76 5F 70 72 6F 78 ssword.0.sv_prox
69 65 73 00 32 00 73 76 5F 72 65 67 69 6F 6E 00 ies.2.sv_region.
33 00 73 76 5F 72 65 73 74 61 72 74 00 30 00 73 3.sv_restart.0.s
76 5F 72 65 73 74 61 72 74 72 6F 75 6E 64 00 30 v_restartround.0
00 73 76 5F 73 74 65 70 73 69 7A 65 00 31 38 00 .sv_stepsize.18.
73 76 5F 73 74 6F 70 73 70 65 65 64 00 37 35 00 sv_stopspeed.75.
73 76 5F 75 70 6C 6F 61 64 6D 61 78 00 30 2E 35 sv_uploadmax.0.5
00 73 76 5F 76 6F 69 63 65 65 6E 61 62 6C 65 00 .sv_voiceenable.
31 00 73 76 5F 77 61 74 65 72 61 63 63 65 6C 65 1.sv_wateraccele
72 61 74 65 00 31 30 00 73 76 5F 77 61 74 65 72 rate.10.sv_water
66 72 69 63 74 69 6F 6E 00 31 00 friction.1.
|
A2A_PING
Ping the server to see if it exists, this can be used to calculate the latency to the server.
Warning: According to Valve (see Talk Page), A2A_PING is no longer supported on Counter-Strike: Source and Team Fortress 2 servers, and is considered a deprecated feature.
Request Format
Data |
Type |
Value
|
Header |
byte |
'i' (0x69)
|
Response Format
Data |
Type |
Value
|
Header |
byte |
'j' (0x6A)
|
Payload |
string |
Null
|
Data |
Type |
Value
|
Heading |
byte |
'j' (0x6A)
|
Payload |
string |
'00000000000000.'
|
FF FF FF FF 6A 30 30 30 30 30 30 30 30 30 30 30 ÿÿÿÿj00000000000
30 30 30 00 000.
|
A2S_SERVERQUERY_GETCHALLENGE
A2S_PLAYER and A2S_RULES queries both require a challenge number. Formerly, this number could be obtained via an A2S_SERVERQUERY_GETCHALLENGE request. In newer games it no longer works. Instead, issue A2S_PLAYER or A2S_RULES queries with an initial challenge of -1 (0xFFFFFFFF)
to receive a usable challenge number.
On some engines (confirmed AppIDs: 17510, 17530, 17740, 17550, 17700) it can be used. The format is:
Request Format
Data |
Type |
Value
|
Header |
byte |
'W' (0x57)
|
Response Format
Data |
Type |
Comment
|
Header |
byte |
Should be equal to 'A' (0x41.)
|
Challenge |
long |
The challenge number to use.
|
Example response:
FF FF FF FF 41 4B A1 D5 22 ÿÿÿÿAK¡Õ"
|
Implementations
- @fabricio-191/valve-server-query Server, Master Server and RCON protocols implementation for Node.js
- Steam Server Query Javascript (Node.js) module which implements the Master Server Query Protocol and Game Server Queries
- Asynchronous Game Query Library A Java 8 based Asynchronous Game Query Library powered by Netty
- Source Server Query Library C library
- libssq C library
- GameServer Java library
- QueryEd Java library
- Steam Condenser Java, PHP, and Ruby library
- GameDig Javascript (Node.JS) module
- Net-SRCDS-Queries Perl module
- SRCDSpy Python library
- SourceLib Python library
- python-valve Python library
- valve-range-query Python Library for IP range query
- python-a2s Python library (supports async)
- dayzquery Add-on for python-a2s library which parses DayZ-specific binary data in A2S_RULES response
- aQuery VB.NET library
- SourceStats Source Server Statistics
- PHP Source Query PHP library
- QueryMaster C# library
- QueryMaster C# library (remaster for .NET Standart 2.0)
- Okolni-Source-Query C# library (.NET Standard 2.0, Now Support l4d2 2213)
- A2S C# library utilizing NET5. (Currently supports A2S_Info and A2S_Player)
- go-a2s Golang library
- a2s-rs Rust library
- Rcon and A2s WebApi中文的WebApi协议库,基于Spring boot,仅支持A2S_INFO、A2S_PLAYER,Now Support l4d2 2213
- SteamPS Module that utilizes PowerShell as a wrapper for SteamCMD. Uses server queries in the command Get-SteamServerInfo
- Mirai Tencent QQ robot基于mriaiBot适配了a2s rcon的腾讯qq机器人,仅支持A2S_INFO、A2S_PLAYER,Rcon,Now Support l4d2 2213
- Rust-GameDig Rust library that supports the entirety of the protocol (also has the obsolete GoldSrc response).
See Also